Add support for using magic spells
Magic spells are now supported through the abilities system, based on ability data in the client data that describes each spell: its chat invocation, mana cost, category, description, target mode and required skill levels. Since the server applies the same skill level rule, the client can derive which abilities have been learned from the skill levels it already receives.
-
The Abilities window lists learned abilities with their invocation and a Use button, which is disabled while an ability cannot be used. Entries show a tooltip with details like the mana cost and can be dragged onto the shortcut bar. The window title can be customized by the game data (The Mana World calls it "Spells") and its menu button appears whenever ability data exists.
-
On tmwAthena, abilities are cast by sending their chat invocation, appending the name of the targeted player where applicable. Cast requirements are checked client-side, with a message explaining why an ability cannot be used, since the server tends to fail silently.
-
The item shortcut bar has been generalized: each slot can now hold either an item or an ability. Ability slots show the ability icon, are drawn transparently while the ability cannot be used, have a details tooltip and cast the ability on activation. They persist through a new
typeattribute on theitemshortcutconfig element. -
Dropping an ability on the chat window inserts its invocation into the chat input.
On manaserv, learned abilities are still those reported by the server, and the recharge bar is shown for rechargeable abilities as before.
A second commit improves the handling of ability target modes: direction abilities are cast through the existing direction support, and point abilities appear disabled until aiming is implemented.
The Mana World data counterpart is tmw/clientdata!734.