Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spell Number
#1
how do i get the spell number of a spell?
Reply
#2
Need to be more descriptive. Are you trying to find a number of a spell based on its name? Or what?

If you already know the number you can just do... Spell(#)
Reply
#3
i need a line of code to do

Code:
If number_of_spell_casted = 1 then
Reply
#4
Not sure what you mean, but might be this?

Code:
Player(MyIndex).Spell(i)
Reply
#5
You'll have to do several checks leading up to it. For instance

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?
Reply
#6
Yeah i actually didn't even think about that. The spell number that they used... is more than likely sent through the "cast" packet... just leech off of that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)