ok, ive spent way to long on this and it has to be easier...
im making a skill off the game lineage 2 (for those familiar) called Ultimate Defense. basically i need it to buff the unit that casts it for 20 seconds which increases armor by a %, magic reduction by a % but sets movement speed to 0 (or as close to not moving as possible) for some strange reason i cant get it right.
this needs to be MUI, and im fine with a JASS code, my current ones trigger and run (used ingame text) but it doesnt work as intended.
im game for either an idea on how to do this properly and which skills/buffs to give him and how to set speed correctly to 0. SetUnitSpeed i assume, but i somehow am going wrong.
This is my current system which doesnt seem to work, and i've checked ID's like 10 times each.
im making a skill off the game lineage 2 (for those familiar) called Ultimate Defense. basically i need it to buff the unit that casts it for 20 seconds which increases armor by a %, magic reduction by a % but sets movement speed to 0 (or as close to not moving as possible) for some strange reason i cant get it right.
this needs to be MUI, and im fine with a JASS code, my current ones trigger and run (used ingame text) but it doesnt work as intended.
im game for either an idea on how to do this properly and which skills/buffs to give him and how to set speed correctly to 0. SetUnitSpeed i assume, but i somehow am going wrong.
This is my current system which doesnt seem to work, and i've checked ID's like 10 times each.
JASS:
function Trig_Ultimate_Defense_JASS_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A02E'
endfunction
function Trig_Ultimate_Defense_JASS_Actions takes nothing returns nothing
local unit UDunit = GetEnumUnit()
call SetUnitMoveSpeed(UDunit, 1.0)
call UnitAddAbility(UDunit, 'A02C')
call SetUnitAbilityLevel(UDunit, 'A02C', GetUnitAbilityLevel(UDunit, 'A02E')
call IssueImmediateOrder( UDunit, "defend" )
call IssueImmediateOrder( UDunit, "stop" )
call DisplayTextToForce( GetPlayersAll(),"Debug: defending yet?")
call PolledWait(20.0)
call UnitRemoveAbility(UDunit, 'A02C')
call SetUnitMoveSpeed(UDunit, GetUnitDefaultMoveSpeed(UDunit))
call DisplayTextToForce( GetPlayersAll(),"Debug: All Done")
set UDunit = null
endfunction
//===========================================================================
function InitTrig_Ultimate_Defense_JASS takes nothing returns nothing
set gg_trg_Ultimate_Defense_JASS = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ultimate_Defense_JASS, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Ultimate_Defense_JASS, Condition( function Trig_Ultimate_Defense_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Ultimate_Defense_JASS, function Trig_Ultimate_Defense_JASS_Actions )
endfunction