- Joined
- May 4, 2007
- Messages
- 2,260
Hi guys, here i am again. This time i have a spell, not for my map, but for the Pyrite's camp (i joined his project and i am helping him)
I am making evil aura. You can easily know what it is if you read the Brainstorm section.
Anyway, back to the point, the compiler reports 2 errors, the first error is in my second "if" statement, and my second error is in the "elseif" statement. I have no idea what is wrong. Please help me.
Now, this spell is not MUI as well. Being MUI is not important (there will only be 1 hero using this aura), but still, i would like to make the spell MUI (if possible) because i would like to know how you can use Globals to make MUI spells.
It's just something i would like to know, but the really important thing here is the error reports ... i think i am not using the "and" and the "or" expression correctly, but i am not sure.
Please help.
Btw, long time no c mates =)
I am making evil aura. You can easily know what it is if you read the Brainstorm section.
Anyway, back to the point, the compiler reports 2 errors, the first error is in my second "if" statement, and my second error is in the "elseif" statement. I have no idea what is wrong. Please help me.
JASS:
globals
unit udg_Hero
endglobals
//====================================================
function Armor_Acts takes nothing returns nothing
local player owner = GetOwningPlayer(udg_Hero)
if GetSpellAbilityId() == 'DUM1' and GetTriggerUnit() == udg_Hero then //the ability used is the a dummy ability
if GetUnitAbilityLevel(udg_Hero, 'ARAI' )== 1 or GetUnitAbilityLevel(udg_Hero, 'ARAD' )== 1 then //if Armor aura increase or decrase lv is ==1
UnitRemoveAbility(udg_Hero, 'B0K1') //remove book1
UnitAddAbility(udg_Hero, 'B0K2') //add book2
SetPlayerAbilityAvailable(owner, 'B0K2', false) //disable book2
elseif GetUnitAbilityLevel(udg_Hero, 'ARAI' )== 2 or GetUnitAbilityLevel(udg_Hero, 'ARAD' )== 2 then then
UnitRemoveAbility(udg_Hero, 'B0K1')
UnitAddAbility(udg_Hero, 'B0K2')
SetPlayerAbilityAvailable(owner, 'B0K2', false)
endif
endif
set owner = null
endfunction
//====================================================
function InitTrig_Armor takes nothing returns nothing
local trigger Armor = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( Armor, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( Armor, function Armor_Acts )
set Armor = null
//the trigger is local, but will be set to global in firther versions
endfunction
Now, this spell is not MUI as well. Being MUI is not important (there will only be 1 hero using this aura), but still, i would like to make the spell MUI (if possible) because i would like to know how you can use Globals to make MUI spells.
It's just something i would like to know, but the really important thing here is the error reports ... i think i am not using the "and" and the "or" expression correctly, but i am not sure.
Please help.
Btw, long time no c mates =)