Leap - Just like Mirana Nightshade in DotA

Leazy

You can change this now in User CP.
Reaction score
50
Hello!

Im making a raider hero and I want him to be able to leap in the exact same way as the Priestess of the Moon (Mirana Nightshade) in DotA. I want him to cast the spell and then leap forward in the direction he is facing for 200/300/400/500 range depending on the skill level. I supose you should base the skill on Berserk as it doesent interupt moving, oh and I want him to keep running forward in the direction he is facing after he casted the spell. He should have a spellshield with 100% chance to block spells while he is leaping <- (but I can add that later unless you need jass for this) and should not be able to move (paused?)

Now the whole problem with making this spell is that I got NO clue about how to make it, I searched some but no leaps were like this, or if there is some please link me it :) I would be most grateful if someone could give me the honor to do this spell for me!

Regards / Leazy!
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Check out Tinki3's Toss here and see if you can just somehow make that a skill with active usage. I hasn't checked the code myself so I have no idea but I guess yuo'd have to change any "target point of ability being cast" etc to (100+(100*Level of ability)) range from the position of caster etc. Might be too much work, I have no idea.
 

Xapphire

Liberty, Simply said; a lie.
Reaction score
45
Well, I'm not sure if that's against the rules, but you can copy the triggers and base spells from our Helper Provided Site's uploaded Dota Template.

Dota Template Link
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Does that template include any spell-triggers at all? I thought it was nothing but systems and basic AoS functions.
 

xericho

New Member
Reaction score
0
been looking for the same spell for weeks :D, the DotA template doesnt have spells templates i think...
 

Leazy

You can change this now in User CP.
Reaction score
50
im building a flawless jump system in pure GUI, it's not done yet but you can check it out (attached)

This leap spell is exactly what im looking for m8! But, can you make the caster move faster when he is in the air? And keep running in the same direction as before after he casted the spell :) Would be perfect!

+rep
 

Cokemonkey11

New Member
Reaction score
18
look at the second trigger where it says

Code:
Unit - Move unitJumpCaster instantly to ((Position of unitJumpCaster) offset by 20.00 towards (Facing of unitJumpCaster) degrees)

Change 20.00 to whatever you want - it will still look good because it has a set interpolation time (and therefor an FPS rate)

I'm not making the ability move in the direction as it was before, but you can make it yourself and I'll explain how.

At the end of the first trigger add the action:

Code:
Unit - Order unitJumpCaster to Move To ((Position of unitJumpCaster) offset by 500.00 towards (Facing of unitJumpCaster) degrees)

Enjoy :D
 

Leazy

You can change this now in User CP.
Reaction score
50
awesome m8 :D Know how to do that keep running thing now, however. If I increase what you told me, the leap will reach longer aswell. I want it to be 200/300/400/500 range depending on the lvls and go very fast, you know how to do that? If anyone knows jass, this is the code they use in DotA for the spell:

Code:
// Objects used:
// 'A0LN' = Leap (Priestess of the Moon : Mirana Nightshade)
// 'e01R' = Buff Placer
// 'A0LO' = Leap (effect)
// 'Amrf' = Crow Form (Medivh)

// DEBUG Trigger Number : 56
function Leap_Spell takes nothing returns boolean
	return GetSpellAbilityId()=='A0LN'
endfunction

function Leap_ReturnOrder takes unit pfU returns nothing
	local string lf5=H2Tx(pfU)
	local string lpG=GetString(lf5,"OrderType")
	local string lph=OrderId2String(GetInteger(lf5,"OrderId"))
	local real lEv
	local real lEV
	local unit lFB
	local trigger ltt=GetTrigger(lf5,"Trigger_TrackOrder")
	local boolean lpH=not GetBoolean(lf5,"Idle")
	local boolean lpi=GetBoolean(lf5,"SuperOrder")
	call DisableTrigger(ltt)
	call IssueImmediateOrderById(pfU,OrderId("stop"))
	if lpG=="Target"and(lpH or lpi)then
		set lFB=GetUnit(lf5,"OrderTarget")
		call IssueTargetOrder(pfU,lph,lFB)
	elseif lpG=="Point"and(lpH or lpi)then
		set lEv=GetReal(lf5,"OrderPointX")
		set lEV=GetReal(lf5,"OrderPointY")
		call IssuePointOrder(pfU,lph,lEv,lEV)
	elseif(lpH or lpi)then
		call IssueImmediateOrder(pfU,"OrderString")
	endif
	call SetBoolean(lf5,"SuperOrder",false)
	call EnableTrigger(ltt)
endfunction

function Leap_SpeedBonusCheck takes nothing returns boolean
	return IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO) and IsUnitAlly(GetFilterUnit(),GetOwningPlayer(udg_u_DTAX_temp))
endfunction

function Leap_DoSpeedBonus takes nothing returns nothing
	local unit lfU=GetEnumUnit()
	local unit lJV=CreateUnit(GetOwningPlayer(lfU),'e01R',0,0,0)
	call UnitAddAbility(lJV,'A0LO')
	call SetUnitAbilityLevel(lJV,'A0LO',GetUnitAbilityLevel(udg_u_DTAX_temp,'A0LN'))
	call UnitApplyTimedLife(lJV,'BTLF',10)
endfunction

function Leap_EndRoar takes unit pfU returns nothing
	local group lEw=CreateGroup()
	local boolexpr lEW=Condition(function Leap_SpeedBonusCheck)
	set udg_u_DTAX_temp=pfU
	call GroupEnumUnitsInRange(lEw,GetUnitX(pfU),GetUnitY(pfU),800,lEW)
	call ForGroup(lEw,function Leap_DoSpeedBonus)
	call DestroyBoolExpr(lEW)
	call DestroyGroup(lEw)
endfunction

function Leap_JumpMoving takes nothing returns nothing
	local timer ltt=GetExpiredTimer()
	local string lf5=H2Tx(ltt)
	local unit lfU=GetUnit(lf5,"Hero")
	local real lpj=GetReal(lf5,"DistanceRemaining")
	local real lpJ=GetReal(lf5,"OriginalDistance")
	local real lnM=GetReal(lf5,"Angle")
	local real lpC=GetUnitX(lfU)+30*Cos(lnM*bj_DEGTORAD)
	local real lpd=GetUnitY(lfU)+30*Sin(lnM*bj_DEGTORAD)
	local real lpk=200
	local real lpK=(1-lpj/lpJ)*lpk*2
	if lpK>lpk then
		set lpK=lpk*2-lpK
	endif
	call SetUnitFlyHeight(lfU,ReturnMaxReal(lpK,0),0)
	call SetUnitX(lfU,SafeX(lpC))
	call SetUnitY(lfU,SafeY(lpd))
	call SetUnitFacing(lfU,lnM)
	call SetReal(lf5,"DistanceRemaining",lpj-20)
	if lpK<1 and lpj-lpJ!=0 then
		call SetBoolean(H2Tx(lfU),"InAir",false)
		call SetUnitFacing(lfU,lnM)
		call SetUnitAnimation(lfU,"stand")
		call SetUnitPathing(lfU,true)
		call SetUnitInvulnerable(lfU,false)
		call Leap_ReturnOrder(lfU)
		call Leap_EndRoar(lfU)
		call PauseTimer(ltt)
		call FastFlush(lf5)
		call DestroyTimer(ltt)
	endif
endfunction

function Leap_JumpSetting takes nothing returns nothing
	local unit lfU=GetTriggerUnit()
	local integer lmZ=GetUnitAbilityLevel(lfU,'A0LN')
	local real lFc=350+50*lmZ
	local real lnM=GetUnitFacing(lfU)
	local real lFC=GetUnitX(lfU)
	local real lFd=GetUnitY(lfU)
	local real lEv=SafeX(lFC+lFc*Cos(lnM*bj_DEGTORAD))
	local real lEV=SafeY(lFd+lFc*Sin(lnM*bj_DEGTORAD))
	local timer ltt=CreateTimer()
	local string lf5=H2Tx(ltt)
	local trigger lpL=GetTrigger(H2Tx(lfU),"Trigger_TrackOrder")
	set lFc=SquareRoot((lFC-lEv)*(lFC-lEv)+(lFd-lEV)*(lFd-lEV))
	if lFc>100 then
		call UnitAddAbility(lfU,'Amrf')
		call UnitRemoveAbility(lfU,'Amrf')
		call SetUnitPathing(lfU,false)
		call SetUnitInvulnerable(lfU,true)
		call SetUnitAnimationByIndex(lfU,6)
		call DisableTrigger(lpL)
		call IssueImmediateOrderById(lfU,OrderId("stop"))
		call EnableTrigger(lpL)
		call SetReal(lf5,"DistanceRemaining",lFc)
		call SetReal(lf5,"OriginalDistance",lFc)
		call SetReal(lf5,"Angle",lnM)
		call SetHandle(lf5,"Hero",lfU)
		call TimerStart(ltt,.025,true,function Leap_JumpMoving)
		call SetBoolean(H2Tx(lfU),"Leap_InAir",true)
		call SetBoolean(H2Tx(lfU),"SuperOrder",false)
	endif
	call PolledWait(5)
	call SetUnitPathing(lfU,true)
	call SetUnitInvulnerable(lfU,false)
endfunction

function Leap_DoNothing takes nothing returns nothing
endfunction

function Leap_SaveOrders takes nothing returns nothing
	local unit lfU=GetTriggerUnit()
	local string lf5=H2Tx(lfU)
	local boolean lpN=GetBoolean(lf5,"Leap_InAir")
	call SetInteger(lf5,"OrderId",GetIssuedOrderId())
	call SetBoolean(lf5,"Idle",false)
	if GetTriggerEventId()==EVENT_UNIT_ISSUED_TARGET_ORDER then
		call SetString(lf5,"OrderType","Target")
		call SetHandle(lf5,"OrderTarget",GetOrderTarget())
	elseif GetTriggerEventId()==EVENT_UNIT_ISSUED_POINT_ORDER then
		if lpN or GetRange(GetUnitX(lfU),GetUnitY(lfU),GetOrderPointX(),GetOrderPointY())>800 then
			call SetString(lf5,"OrderType","Point")
			call SetReal(lf5,"OrderPointX",GetOrderPointX())
			call SetReal(lf5,"OrderPointY",GetOrderPointY())
		else
			call SetBoolean(lf5,"Idle",true)
		endif
	else
		call SetString(lf5,"OrderType","Instant")
	endif
	if lpN then
		call SetBoolean(lf5,"SuperOrder",true)
	endif
endfunction

function Leap_SpellOrder takes nothing returns boolean
	return OrderId2String(GetIssuedOrderId())!="windwalk"
endfunction

function Leap_IsHeroMoves takes nothing returns nothing
	local unit lfU=GetUnit(H2Tx(GetExpiredTimer()),"Hero")
	local string lf5=H2Tx(lfU)
	local real lxx=GetUnitX(lfU)
	local real lyy=GetUnitY(lfU)
	local string lpG=GetString(lf5,"OrderType")
	if lpG=="Point"and GetRange(GetUnitX(lfU),GetUnitY(lfU),GetReal(lf5,"OrderPointX"),GetReal(lf5,"OrderPointY"))<100 then
		call SetBoolean(lf5,"Idle",true)
	endif
endfunction

function Leap_TrackOrdersStart takes nothing returns nothing
	local unit lfU=GetTriggerUnit()
	local trigger ltt=CreateTrigger()
	local timer lt2
	call TriggerRegisterUnitEvent(ltt,lfU,EVENT_UNIT_ISSUED_TARGET_ORDER)
	call TriggerRegisterUnitEvent(ltt,lfU,EVENT_UNIT_ISSUED_POINT_ORDER)
	call TriggerRegisterUnitEvent(ltt,lfU,EVENT_UNIT_ISSUED_ORDER)
	call TriggerAddAction(ltt,function Leap_SaveOrders)
	call TriggerAddCondition(ltt,Condition(function Leap_SpellOrder))
	call SetHandle(H2Tx(lfU),"Trigger_TrackOrder",ltt)
	set lt2=CreateTimer()
	call SetHandle(H2Tx(lt2),"Hero",lfU)
	call TimerStart(lt2,.3,true,function Leap_IsHeroMoves)
	call SetHandle(H2Tx(lfU),"Timer_CheckIdle",lt2)
endfunction

function Leap_LearnFirst takes nothing returns nothing
	if GetUnitAbilityLevel(GetTriggerUnit(),'A0LN')==1 then
		call Leap_TrackOrdersStart()
	endif
endfunction

function Leap_Init takes nothing returns nothing
	local trigger ltt=CreateTrigger()
	call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_UNIT_SPELL_EFFECT)
	call TriggerAddCondition(ltt,Condition(function Leap_Spell))
	call TriggerAddAction(ltt,function Leap_JumpSetting)
	set ltt=CreateTrigger()
	call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_UNIT_SPELL_CAST)
	call TriggerAddCondition(ltt,Condition(function Leap_Spell))
	call TriggerAddAction(ltt,function Leap_DoNothing)
	set ltt=CreateTrigger()
	call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_HERO_SKILL)
	call TriggerAddAction(ltt,function Leap_LearnFirst)
endfunction


function InitTrig_Leap takes nothing returns nothing
endfunction
 

Flare

Stops copies me!
Reaction score
662
im building a flawless jump system in pure GUI

Code:
Move unitJumpCaster instantly to ((Position of unitJumpCaster) offset by 20.00

--------------------------------------------------

Order unitJumpCaster to Move To ((Position of unitJumpCaster) offset by 500.00

Hmmm, flawless indeed.... How many times does the periodic event occur to move the hero while the hero is in flight? Leak potential could be fairly significant.
 

cowmenace

New Member
Reaction score
22
Its really very simple, make a dummy unit throw an attack at another dummy unit with projectile of the unit u want to throw, then put in the arc, move the unit really far away, then in x seconds move the unit to position of dummy unit, the order unit to "moce to" location 800 in front of it when boolean is true. Turn the boolean to false when the casting unit (store in a variable) is ordered to move to follow hold position or attack. Use or, or, or, or for conditions, not and, and, and , and (saying if it ordered a command. Hope you followed it =)

basically the jump is performed by a missle with an arc, and when the missles is done moving, you move the casting unit to the dummy the other dummy attacked with the projectile. Then the casting unit is told to move forward unless told to do anything else by the player.good luck, this is leakless if done correctly.
 

vypur85

Hibernate
Reaction score
803
Hmm... Seems like you haven't got what you want yet. I'll try to do one for you then (have nothing much to do now). Give me some time.

Ps: No promises. Just try.

Edit
Done. Each level will increase leap distance by 100. For the spell immunity, add it yourself. It's MPI.

Please say you like it~~~~ :eek:

Implementation
Code:
Map Init
    Events
        Map initialization
    Conditions
    Actions
        Set Abi_Leap = Leap

Casting variables
Code:
Cast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Abi_Leap
    Actions
        Unit Group - Add (Triggering unit) to Unitgp_LeapUnit
        Set Int_PeriodicCheck[(Player number of (Owner of (Triggering unit)))] = 0
        Unit - Turn collision for (Triggering unit) Off
        Unit - Add Storm Crow Form to (Triggering unit)
        Unit - Remove Storm Crow Form from (Triggering unit)
        Trigger - Turn on Periodic Movement <gen>

Sliding movement + Flight
Code:
Periodic Movement
    Events
        Time - Every 0.02 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in Unitgp_LeapUnit and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Int_PeriodicCheck[(Player number of (Owner of (Picked unit)))] Less than 40
                    Then - Actions
                        Set Int_PeriodicCheck[(Player number of (Owner of (Picked unit)))] = (Int_PeriodicCheck[(Player number of (Owner of (Picked unit)))] + 1)
                        Set Pt_LeapUnitPos = (Position of (Picked unit))
                        Set Pt_TargetPos = (Pt_LeapUnitPos offset by (5.00 + (2.50 x ((Real((Level of Abi_Leap for (Picked unit)))) - 1.00))) towards (Facing of (Picked unit)) degrees)
                        Unit - Move (Picked unit) instantly to Pt_TargetPos
                        Set Real_FlyHeight = (400.00 - (Power((20.00 - (Real(Int_PeriodicCheck[(Player number of (Owner of (Picked unit)))]))), 2.00)))
                        Animation - Change (Picked unit) flying height to Real_FlyHeight at 0.00
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Int_PeriodicCheck[(Player number of (Owner of (Picked unit)))] Equal to 40
                            Then - Actions
                                Special Effect - Create a special effect at Pt_LeapUnitPos using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
                                Special Effect - Destroy (Last created special effect)
                                Animation - Change (Picked unit) flying height to 0.00 at 0.00
                                Unit - Turn collision for (Picked unit) On
                                Unit Group - Remove (Picked unit) from Unitgp_LeapUnit
                            Else - Actions
                        Custom script:   call RemoveLocation (udg_Pt_LeapUnitPos)
                        Custom script:   call RemoveLocation (udg_Pt_TargetPos)
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in Unitgp_LeapUnit) Equal to 0
            Then - Actions
                Trigger - Turn off (This trigger)
            Else - Actions
 

Attachments

  • Leap.w3x
    18.4 KB · Views: 655

Leazy

You can change this now in User CP.
Reaction score
50
Hmm... Seems like you haven't got what you want yet. I'll try to do one for you then (have nothing much to do now). Give me some time.

Ps: No promises. Just try.

Edit
Done. Each level will increase leap distance by 100. For the spell immunity, add it yourself. It's MPI.

Please say you like it~~~~ :eek:

Implementation
Code:
Map Init
    Events
        Map initialization
    Conditions
    Actions
        Set Abi_Leap = Leap

Casting variables
Code:
Cast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Abi_Leap
    Actions
        Unit Group - Add (Triggering unit) to Unitgp_LeapUnit
        Set Int_PeriodicCheck[(Player number of (Owner of (Triggering unit)))] = 0
        Unit - Turn collision for (Triggering unit) Off
        Unit - Add Storm Crow Form to (Triggering unit)
        Unit - Remove Storm Crow Form from (Triggering unit)
        Trigger - Turn on Periodic Movement <gen>

Sliding movement + Flight
Code:
Periodic Movement
    Events
        Time - Every 0.02 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in Unitgp_LeapUnit and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Int_PeriodicCheck[(Player number of (Owner of (Picked unit)))] Less than 40
                    Then - Actions
                        Set Int_PeriodicCheck[(Player number of (Owner of (Picked unit)))] = (Int_PeriodicCheck[(Player number of (Owner of (Picked unit)))] + 1)
                        Set Pt_LeapUnitPos = (Position of (Picked unit))
                        Set Pt_TargetPos = (Pt_LeapUnitPos offset by (5.00 + (2.50 x ((Real((Level of Abi_Leap for (Picked unit)))) - 1.00))) towards (Facing of (Picked unit)) degrees)
                        Unit - Move (Picked unit) instantly to Pt_TargetPos
                        Set Real_FlyHeight = (400.00 - (Power((20.00 - (Real(Int_PeriodicCheck[(Player number of (Owner of (Picked unit)))]))), 2.00)))
                        Animation - Change (Picked unit) flying height to Real_FlyHeight at 0.00
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Int_PeriodicCheck[(Player number of (Owner of (Picked unit)))] Equal to 40
                            Then - Actions
                                Special Effect - Create a special effect at Pt_LeapUnitPos using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
                                Special Effect - Destroy (Last created special effect)
                                Animation - Change (Picked unit) flying height to 0.00 at 0.00
                                Unit - Turn collision for (Picked unit) On
                                Unit Group - Remove (Picked unit) from Unitgp_LeapUnit
                            Else - Actions
                        Custom script:   call RemoveLocation (udg_Pt_LeapUnitPos)
                        Custom script:   call RemoveLocation (udg_Pt_TargetPos)
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in Unitgp_LeapUnit) Equal to 0
            Then - Actions
                Trigger - Turn off (This trigger)
            Else - Actions

Thank you very much this is exactly what I want its perfect m8!! Thx thx thx :D +rep!
 

Cokemonkey11

New Member
Reaction score
18
Code:
Move unitJumpCaster instantly to ((Position of unitJumpCaster) offset by 20.00

--------------------------------------------------

Order unitJumpCaster to Move To ((Position of unitJumpCaster) offset by 500.00

Hmmm, flawless indeed.... How many times does the periodic event occur to move the hero while the hero is in flight? Leak potential could be fairly significant.

958check.png


Thanks for reading the whole post also, I wrote down that it wasn't finished yet. Need to get it MUI.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top