Hi all i need help with a non targeted leap...Descriptn: the caster jumps (700 range) and at the end of his path the caster stuns all nearby enemy units with the stomp ability, the stomp stacks in continuous cast (in a very fast cast) logically, the number of stomps=the number of continuous cast...Ok i make the leap in gui but it does not suport a 10 players map bcoz the leap have problems when two players cast the leap at the same time. So i make this spell in jass and all players can cast the leap at the same time without problems but now the leap s stomp effect does not stack....Heres the leap spell en gui and the bad code in jass:
I want to convert my GUI leap spell in a correctly code in jass with all his atributes. Help plzz
-
TigerLeap
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to TigerLeap
-
Actions
- Set Unis[15] = (Casting unit)
- Set r[2] = 0.00
- Custom script: call SetUnitAnimationByIndex(udg_Unis[15],6)
- Custom script: call SetUnitInvulnerable(udg_Unis[15],true)
- Custom script: call SetUnitPathing(udg_Unis[15],false)
- Unit - Add to Unis[15]
- Trigger - Turn on LeapMove <gen>
- Trigger - Run gg_trg_TigerLeapPathing (checking conditions)
- Animation - Change Unis[15] flying height to 250.00 at 350.00
- Wait 0.25 seconds
- Animation - Change Unis[15] flying height to 0.00 at 700.00
- Wait until (r[2] Greater than or equal to 700.00), checking every 0.10 seconds
- Trigger - Turn off LeapMove <gen>
- Animation - Reset Unis[15]'s animation
- Unit - Create 1 TigerLeapUnit for (Owner of Unis[15]) at (Position of Unis[15]) facing Default building facing degrees
- Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
- Special Effect - Create a special effect at (Position of Unis[15]) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call SetUnitInvulnerable(udg_Unis[15],false)
- Custom script: call SetUnitPathing(udg_Unis[15],true)
- Unit - Remove from Unis[15]
- Animation - Change Unis[15]'s animation speed to 100.00% of its original speed
-
Events
-
Leap Move
-
Events
- Time - Every 0.02 seconds of game time
- Conditions
-
Actions
- Set p[7] = (Position of Unis[15])
- Set r[2] = (r[2] + 25.00)
- Unit - Move Unis[15] instantly to p[7], facing (Facing of Unis[15]) degrees
- Custom script: call RemoveLocation(udg_p[7])
-
Events
JASS:
function Trig_TigerLeap1_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A010'
endfunction
function Leap_Move takes nothing returns nothing
local timer tl = GetExpiredTimer()
local unit lp = GetHandleUnit(tl,"lp")
local location loct = GetUnitLoc(lp)
local real lr = GetHandleReal(tl,"lr")
local location loct2 = PolarProjectionBJ(loct,5,GetUnitFacing(lp))
if lr >= 0 then
call SetUnitPositionLoc( lp,loct2 )
call SetHandleReal(tl,"lr",lr*.25)
else
call CreateNUnitsAtLoc( 1, 'e00B', GetOwningPlayer(lp), GetUnitLoc(lp), bj_UNIT_FACING )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
call AddSpecialEffectLocBJ( GetUnitLoc(lp), "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call RemoveLocation(loct)
set loct = null
call RemoveLocation(loct2)
set loct2 = null
set lp = null
set tl = null
endfunction
function Trig_TigerLeap1_Actions takes nothing returns nothing
local timer tl = CreateTimer()
local unit lp = GetTriggerUnit()
local location loct = GetUnitLoc(lp)
call SetHandleReal(tl,"lr",5)
call SetHandleHandle(tl, "lp", lp)
call SetUnitAnimationByIndex(lp,6)
call SetUnitInvulnerable(lp,true)
call SetUnitPathing(lp,false)
call UnitAddAbilityBJ( 'A00Z', lp )
call SetUnitFlyHeightBJ( lp, 250.00, 350.00 )
call TimerStart(tl, 0.01, true, function Leap_Move)
call TriggerSleepAction( 0.25 )
call SetUnitFlyHeightBJ( lp, 0.00, 700.00 )
call TriggerSleepAction( 0.01 )
call ResetUnitAnimation( lp )
call CreateNUnitsAtLoc( 1, 'e00B', GetOwningPlayer(lp), GetUnitLoc(lp), bj_UNIT_FACING )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
call AddSpecialEffectLocBJ( GetUnitLoc(lp), "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitInvulnerable(lp,false)
call SetUnitPathing(lp,true)
call UnitRemoveAbilityBJ( 'A00Z', lp )
call SetUnitTimeScalePercent( lp, 100.00 )
call FlushHandleLocals(tl)
call PauseTimer(tl)
call DestroyTimer(tl)
set tl = null
endfunction
//===========================================================================
function InitTrig_TigerLeap1 takes nothing returns nothing
set gg_trg_TigerLeap1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_TigerLeap1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_TigerLeap1, Condition( function Trig_TigerLeap1_Conditions ) )
call TriggerAddAction( gg_trg_TigerLeap1, function Trig_TigerLeap1_Actions )
endfunction