Spellbook usage

Naga'sShadow

Ultra Cool Member
Reaction score
49
I'm creating a multi leveled spell based on a spell book. Every spell in the spellbook is leveled accordingly. I don't believe it is possible to place a multi leveled spell in a spellbook so every level is a different spell. Problem is detecting and using the spells using triggers. As each one is a different spell I need a different rawcode for each one. In the test function I'm working with now I have this monster as a condition function.

JASS:
private function conditions takes nothing returns boolean
    if GetSpellAbilityId() == 'A001' then
        return true
    elseif GetSpellAbilityId() == 'A002' then
        return true
    elseif GetSpellAbilityId() == 'A003' then
        return true    
    elseif GetSpellAbilityId() == 'A004' then
        return true
    elseif GetSpellAbilityId() == 'A005' then
        return true    
    elseif GetSpellAbilityId() == 'A006' then
        return true    
    elseif GetSpellAbilityId() == 'A007' then
        return true    
    elseif GetSpellAbilityId() == 'A008' then
        return true    
    elseif GetSpellAbilityId() == 'A009' then
        return true   
    elseif GetSpellAbilityId() == 'A00A' then
        return true    
    else
        return false
    endif
endfunction


I could turn is sideways by using or instead of elseif but this is easier to read for the moment.

I know that the following won't work 'A00[x]' Where x is an index for a loop. Is there any way to condense this into something workable?
 

Kenny

Back for now.
Reaction score
202
Not 100% sure what your asking for, but why don't you use a spell with no normal icon, such as permanent invisibility or something along those lines (preferably not permanent invis) then use EVENT_PLAYER_HERO_SKILL to check the level of the skill learnt, then add a spell book accordingly.
 

saw792

Is known to say things. That is all.
Reaction score
280
If you change the 'A00A' ability to 'A00:' (which is one higher than 'A009') you can use this:
JASS:
return GetSpellAbilityId() >= 'A001' and GetSpellAbilityId() <= 'A00:'


The next integer ('A00_') can be found by finding the next character in the ASCII character map if you need more abilities. After : comes ;.

Otherwise avoid the problem by doing something like what kenny! suggested.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top