15-02-2007, 12:21 AM
You'll have to do several checks leading up to it. For instance
Something similar to that. But you're going to need to do a few other things as well. It's actually probably best, to check if the casted the spell, BEFORE running the For Loop and what-not. It might be a good idea, and shortcut the entire process... is just add a new Byte to the PlayerSpellRec, like, CurrentlyCast and then just Update/Remove that... then the code that i wrote would be much more simplified down to... making sure that they've casted a spell, and then making sure that the Cast Spell is the Spell Number that you're looking for. Make sense?
Code:
for i = 1 to max_player_spells
If Player(Index).Spell(i) = *INSERT SPELL NUM HERE* Then
If Player(Index).CastedSpell = True Then ' Not sure if CastedSpell is an assigned variable in the player UDT or not
*DO WHATEVER*
End If
End If
next i
Something similar to that. But you're going to need to do a few other things as well. It's actually probably best, to check if the casted the spell, BEFORE running the For Loop and what-not. It might be a good idea, and shortcut the entire process... is just add a new Byte to the PlayerSpellRec, like, CurrentlyCast and then just Update/Remove that... then the code that i wrote would be much more simplified down to... making sure that they've casted a spell, and then making sure that the Cast Spell is the Spell Number that you're looking for. Make sense?