exge
New Member
- Reaction score
- 15
the spell works great , but why does the caster move around meaninglessly after the spell ends ... pls help me check
thx
thx
PHP:
function Trig_jump_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function fly takes unit caster, real height, real speed returns nothing
call SetUnitFlyHeightBJ(caster, height, speed )
endfunction
function knockback takes nothing returns nothing
local group g = GetHandleGroup(GetExpiredTimer(), "g")
local group g2 = CreateGroup()
local unit var1
local unit caster = GetHandleUnit(GetExpiredTimer(), "caster")
call GroupAddGroup(g, g2)
loop
set var1 = FirstOfGroup(g2)
call GroupRemoveUnit(g2, var1)
call SetUnitPositionLoc(var1, PolarProjectionBJ(GetUnitLoc(var1),5,(GetUnitFacing(var1)-180)))
call GroupRemoveUnit(g2, var1)
exitwhen var1 == null
endloop
call DestroyGroup(g2)
endfunction
function jump_move takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = GetHandleUnit(t, "caster")
local location targetloc = GetHandleLocation(t, "targetloc")
call SetUnitPositionLoc(caster,PolarProjectionBJ(GetUnitLoc(caster), 15, AngleBetweenPoints(GetUnitLoc(caster), targetloc)) )
endfunction
function checktarget takes nothing returns boolean
local unit caster = GetHandleUnit(GetTriggeringTrigger(), "caster")
return IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(caster)) == true
return IsUnitType(GetEnumUnit(), UNIT_TYPE_STRUCTURE) == false
return GetEnumUnit() != caster
endfunction
function damage takes nothing returns nothing
local unit caster = GetHandleUnit(GetTriggeringTrigger(), "caster")
call UnitDamageTargetBJ( caster, GetEnumUnit(), 100, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction
function Trig_jump_Actions takes nothing returns nothing
local timer t = CreateTimer()
local timer t2 = CreateTimer()
local unit caster = GetSpellAbilityUnit()
local location targetloc = GetSpellTargetLoc()
local effect stomp
local effect weapon
local group g = CreateGroup()
local unit u
local group g3 = CreateGroup()
call SetHandleHandle(t, "caster", caster)
call SetHandleHandle(t, "targetloc", targetloc)
call SetHandleHandle(GetTriggeringTrigger(), "caster", caster)
call TimerStart(t, 0.03, true, function jump_move)
call SetUnitTimeScalePercent(caster, 50.00 )
call SetUnitInvulnerable(caster, true)
call SetUnitPathing(caster, false )
call UnitAddAbilityBJ( 'Amrf', caster)
call UnitRemoveAbilityBJ( 'Amrf',caster)
call AddSpecialEffectTargetUnitBJ( "weapon",caster, "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl" )
set weapon = GetLastCreatedEffectBJ()
call SetUnitAnimation( caster, "attack slam" )
call fly(caster,400,800)
call PolledWait(0.6)
call fly(caster,0,800)
loop
call PolledWait(0.5)
exitwhen DistanceBetweenPoints(GetUnitLoc(caster), targetloc) <= 600
endloop
call SetUnitPositionLoc(caster, targetloc)
call ResetUnitAnimation(caster)
call AddSpecialEffectLocBJ(targetloc, "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
set stomp = GetLastCreatedEffectBJ()
call DestroyEffectBJ(stomp)
call DestroyEffectBJ(weapon)
call ForGroupBJ( GetUnitsInRangeOfLocMatching(300,targetloc, Condition(function checktarget)), function damage )
set g = GetUnitsInRangeOfLocMatching(300,targetloc, Condition(function checktarget))
call SetHandleHandle(t2, "g", g)
call SetHandleHandle(t2, "caster", caster)
call GroupAddGroup(g, g3)
loop
set u = FirstOfGroup(g3)
call SetUnitFacingToFaceLocTimed(u, GetUnitLoc(caster), 0 )
call GroupRemoveUnit(g3, u)
exitwhen u == null
endloop
call TimerStart(t2, 0.03, true, function knockback)
call PolledWait(1)
call DestroyTimer(t2)
call SetUnitTimeScalePercent(caster, 100.00 )
call SetUnitInvulnerable(caster, false)
call SetUnitPathing(caster, true )
call DestroyTimer(t)
call FlushHandleLocals(t)
call RemoveLocation(targetloc)
set caster = null
call DestroyGroup(g)
call DestroyGroup(g3)
set u = null
endfunction
//===========================================================================
function InitTrig_jump takes nothing returns nothing
set gg_trg_jump = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_jump, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_jump, Condition( function Trig_jump_Conditions ) )
call TriggerAddAction( gg_trg_jump, function Trig_jump_Actions )
endfunction