- Joined
- Jul 14, 2011
- Messages
- 3,213
Hi!
I'm trying to make Magic Items that disable the attack of the unit, and replace it with a skill.
I'm using
In other words: When the unit equips (uses) the item:
Ability 'Aatk' (Attack) is removed, and Ability 'A03L' is added.
When the unit unequips the item, Ability 'Aatk' (Attack) is added, and Ability 'A03L' is removed.
The thing is that the Attack is being removed, but not added afterwards =/
Also, I've been searching for a dummy simple skill like 'Firebolt' to attack units, but without the stun factor, and haven't found one. I just want a spell that shoots a missile and deals damage =/
I'm trying to make Magic Items that disable the attack of the unit, and replace it with a skill.
I'm using
JASS:
private function onEquip takes nothing returns nothing
local integer id = GetTriggeringItemId()
if id == 'I01I' then
call UnitRemoveAbilityBJ( 'Aatk', GetEquippingUnit() )
call UnitAddAbilityBJ( 'A03L', GetEquippingUnit() )
endif
endfunction
private function onUnequip takes nothing returns nothing
local integer id = GetTriggeringItemId()
if id == 'I01I' then
call UnitRemoveAbilityBJ( 'A03L', GetEquippingUnit() )
call UnitAddAbilityBJ( 'Aatk', GetEquippingUnit() )
endif
endfunction
Ability 'Aatk' (Attack) is removed, and Ability 'A03L' is added.
When the unit unequips the item, Ability 'Aatk' (Attack) is added, and Ability 'A03L' is removed.
The thing is that the Attack is being removed, but not added afterwards =/
Also, I've been searching for a dummy simple skill like 'Firebolt' to attack units, but without the stun factor, and haven't found one. I just want a spell that shoots a missile and deals damage =/