- Joined
- Jul 26, 2008
- Messages
- 1,009
Alright so I have a spell on a hero based off bearform.
It's a hero transformation, so the spells the hero learns stay with him.
The thing is, he has 2 dummy hero spells which give him abilities. If he is in Non-Form, he will be given SpellA, but when he changes to Form he is given SpellB and SpellA is removed. Vice versa on change back. The abilities he's given also level when he learns the dummy spells, and are non-hero abilities.
The problem is I need to give him the spells after he transforms, and I don't know how to detect the time after he transforms and changes back.
But for your amusement, here is the current setup I have for the trigger. It's highly incomplete as I'm on crossroads what to do with it :\
It's a hero transformation, so the spells the hero learns stay with him.
The thing is, he has 2 dummy hero spells which give him abilities. If he is in Non-Form, he will be given SpellA, but when he changes to Form he is given SpellB and SpellA is removed. Vice versa on change back. The abilities he's given also level when he learns the dummy spells, and are non-hero abilities.
The problem is I need to give him the spells after he transforms, and I don't know how to detect the time after he transforms and changes back.
But for your amusement, here is the current setup I have for the trigger. It's highly incomplete as I'm on crossroads what to do with it :\
JASS:
function BatForm_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
if GetIssuedOrderId() == OrderId("bearform") then
//If the order is to transform the unit from normal form into a bat
call SetUnitAbilityLevel(caster, 'isba', GetUnitAbilityLevel(caster, 'gbaf'))
//isba is the spell IsBat, and is a passive, invisible stat boost that grants +STR
// and is used to see if the unit has the spell, meaning it's a bat.
if GetUnitAbilityLevel(caster, 'fbfl') >= 1 then
//Checks to see if we've learned the "Find Blood/Flurry" dummy hero ability.
call UnitAddAbility(caster, 'flur')
//We add the ability Flurry for his bat form, then level it up.
call SetUnitAbilityLevel(caster, 'flur', GetUnitAbilityLevel(caster, 'fbfl'))
call UnitRemoveAbility(caster, 'fibl')
//We now remove Find Blood from the hero as it is only for regular form.
endif
//rinse, repeat
if GetUnitAbilityLevel(caster, 'frdr') >= 1 then
call UnitAddAbility(caster, 'drin')
call SetUnitAbilityLevel(caster, 'drin', GetUnitAbilityLevel(caster, 'frdr'))
call UnitRemoveAbility(caster, 'fren')
endif
else
//when turning back we need to make the gangrel not up in the air, unlike his bat counterpart
call SetUnitFlyHeight(caster, 0.0, 0.0)
if GetUnitAbilityLevel(caster, 'fbfl') >= 1 then
//repeat steps
call UnitAddAbility(caster, 'fibl')
call SetUnitAbilityLevel(caster, 'fibl', GetUnitAbilityLevel(caster, 'fbfl'))
call UnitRemoveAbility(caster, 'flur')
endif
if GetUnitAbilityLevel(caster, 'frdr') >= 1 then
call UnitAddAbility(caster, 'fren')
call SetUnitAbilityLevel(caster, 'fren', GetUnitAbilityLevel(caster, 'fbfl'))
call UnitRemoveAbility(caster, 'drin')
endif
endif
set caster = null
endfunction
function BatForm_Conditions takes nothing returns boolean
//Check to see if the unit is using bearform spell in the form of a Orderstring, so we can call up orderstrings
return GetIssuedOrderId() == OrderId('bearform') or GetIssuedOrderId() == OrderId('unbearform')
endfunction
//===========================================================================
function InitTrig_BatForm takes nothing returns nothing
local trigger BatForm = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( BatForm, EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( BatForm, function BatForm_Conditions )
call TriggerAddAction( BatForm, function BatForm_Actions )
set BatForm = null
endfunction
Last edited: