From The Mana World
< User:Crush
Revision as of 19:17, 6 April 2008 by Crush (talk | contribs) (notes for implementing special actions like magic or special attacks)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Notes for implementing special actions like special attacks, magic or other special actions a player character can perform (emoticons?).

specials.xml

An XML file which maps special action ids to corresponding client-sided effects (particle, sound, sprite animation etc.) and server-sided effects (execute script, inflict damage in an area).

<specials>
 <action id="1">
 	<particlefx>graphics/particles/heal.particle.xml</particlefx>
 	<soundfx>sounds/heal.ogg</soundfx>
 	<saytext>HEAL!!</saytext>
 	<gameeffect
 	  area="point"
 	  position-forward="32"
 	  position-sideways="0"
 	  effect-type="heal"
 	  effect-factor="10"
 	/>
 </action>
 <action id="2">
 	<particlefx>graphics/particles/firebolt.particle.xml</particlefx>
 	<soundfx>sounds/fire.ogg</soundfx>
 	<saytext>FIREBOLT!!</saytext>
 	<gameeffect
 	  area="projectile"
 	  range="256"
 	  effect-type="damage"
 	  effect-element="fire"
 	  effect-factor="5"
 	/>
 </action>
</specials>

Protocol:

  • Client sends PGMSG_USE_SPECIAL W number (number is the ID number of the special attack)
  • Server checks if the character may perform this special action
  • If yes the server does whatever the special action requires it to do (damage beings in attack zone or whatever)
  • Server sends GPMSG_USE_SPECIAL W beingID W number to all clients nearby
  • Clients respond with displaying the corresponding effects