- Joined
- Jul 26, 2008
- Messages
- 1,009
I got a pretty simple transformation spell, and only one on the current hero. It's the hero's actual skill as well. Basically whenever the hero Transforms from form A to form B he'll change two of those skills based on his dummy skills.
Dummy Skill 1 is Hunt/Flurry, which in form A gives him hunt and in form B gives him flurry. The spell he learns is a dummy spell based on channel. The abilities are given and levled upon learning the skill.
DummySkill 2 follows the same principles as Dummy Skill 1. It's Rend/Drink.
Now the problem is, whenever he goes from form A to form B he doesn't transfer his skills. But when he goes back from form B to form A his skills transfer.
It use to work perfectly fine before I edited the code slightly, and I've been through it and can't see a problem.
Is my scripting off or is the problem with something in the object editor? Though I couldn't imagine what the problem in the object editor would be since it hasn't changed. The isbat skill is naturally on, and he's obviously learned the Dummy skills if they transfer proper.
tl;dr: Worked before, doesn't work now. WTF?
Dummy Skill 1 is Hunt/Flurry, which in form A gives him hunt and in form B gives him flurry. The spell he learns is a dummy spell based on channel. The abilities are given and levled upon learning the skill.
DummySkill 2 follows the same principles as Dummy Skill 1. It's Rend/Drink.
Now the problem is, whenever he goes from form A to form B he doesn't transfer his skills. But when he goes back from form B to form A his skills transfer.
It use to work perfectly fine before I edited the code slightly, and I've been through it and can't see a problem.
Is my scripting off or is the problem with something in the object editor? Though I couldn't imagine what the problem in the object editor would be since it hasn't changed. The isbat skill is naturally on, and he's obviously learned the Dummy skills if they transfer proper.
tl;dr: Worked before, doesn't work now. WTF?
JASS:
scope BatForm initializer Init
globals
private constant integer BatForm = 'gbaf'
private constant integer IsBat = 'isba'
private constant integer HuntFlurry = 'fbfl'
private constant integer Flurry = 'flur'
private constant integer Hunt = 'fibl'
private constant integer RendDrink = 'frdr'
private constant integer Rend = 'rend'
private constant integer Drink = 'drin'
endglobals
private function Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local integer BFlvl = GetUnitAbilityLevel(c, BatForm)
local integer HuntFlurrylvl = GetUnitAbilityLevel(c, HuntFlurry)
local integer RendDrinklvl = GetUnitAbilityLevel(c, RendDrink)
call TriggerSleepAction(0.27)
if GetIssuedOrderId() == OrderId("bearform") then
call SetUnitAbilityLevel(c, IsBat, BFlvl)
if HuntFlurrylvl >= 1 then
call UnitAddAbility(c, Flurry)
call SetUnitAbilityLevel(c, Flurry, HuntFlurrylvl)
call UnitRemoveAbility(c, Hunt)
endif
if RendDrinklvl >= 1 then
call UnitAddAbility(c, Drink)
call SetUnitAbilityLevel(c, Drink, RendDrinklvl)
call UnitRemoveAbility(c, Rend)
endif
elseif GetIssuedOrderId() == OrderId("unbearform") then
call SetUnitFlyHeight(c, 0.0, 0.0)
if HuntFlurrylvl >= 1 then
call UnitAddAbility(c, Hunt)
call SetUnitAbilityLevel(c, Hunt, HuntFlurrylvl)
call UnitRemoveAbility(c, Flurry)
endif
if RendDrinklvl >= 1 then
call UnitAddAbility(c, Rend)
call SetUnitAbilityLevel(c, Rend, RendDrinklvl)
call UnitRemoveAbility(c, Drink)
endif
endif
set c = null
endfunction
private function Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(), BatForm) >= 1 and (GetIssuedOrderId() == OrderId("bearform") or GetIssuedOrderId() == OrderId("unbearform"))
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( t, function Conditions )
call TriggerAddAction( t, function Actions )
endfunction
private function InitTrig_BatForm takes nothing returns nothing
endfunction
endscope