LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI. Just an X-34 landspeeder out for a drive.

Home Page:https://landsandboat.github.io/server/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🔨 drastic improvements of the castSpell lua binding

TeoTwawki opened this issue · comments

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my issue will be ignored.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated.

Describe the feature

The current binding is severely limited. It has 2 parameters, the spell id, and an optional target.

Unfortunately:

  • The normal valid targets of the spell cannot be overridden, so you cannot use it to force a mob to nuke itself (I just tested this, I could swear this worked previously)
  • If the caster is a mob, the caster still has to have MP or the map server throws an error and they don't cast
  • The function seems to only work on mobs, not players, and according to comments might be able to make an npc "cast". Not sure that is the case and it seems doubtful. Only checked players and mobs. This may have been different in the past, unsure.

What I really want, is to force any object to cast any spell regardless of MP. Why? Because SE made items that can cast on use. Even more than that, the spell power is not even calculated, it's static, and the players stats don't even matter - several of these items will do an even 100 damage even if you are level one or level 99/119 and regardless of main/sub job combination if the spell is not resisted (resist rates don't seem normal either, but that's anecdotal atm). So spell power needs to be able to be overridden as well.

These items were my main goal in investigating what would be needed here.

I took a trip through the magic states and controllers tonight and this doesn't look simple to pull off. If I coudl put a bounty on one thing to not have to do myself right now, I think this would be it.