Need help to create chidori spell

lokili

New Member
Reaction score
0
i need help with creating a chidori spell i know a few things like to make the special effect in the units hand but i don't know how to make the unit run very fast towards the enemy and pushing the enemy a little backwards, i know how to make the unit run to his enemy but not how to change movement speed. Can anyone tell me how to do this?
 

Moon_Raven

New Member
Reaction score
8
You can change it via this action:
Trigger:
  • TEST
    • Events
    • Conditions
    • Actions
      • Unit - Set <WHICH UNIT'S> movement speed to <WHAT SPEED>

And knockback is a bit harder to make in GUI, can I make it for you in JASS?

EDIT: And don't forget that max unit movement speed is 522.
 

lokili

New Member
Reaction score
0
sure you can.

*****************EDIT*****************
oh wait make me the JASS thingy but first explain how do i use JASS because im trying to learn that but it's not going to well i just can't learn a thing by myself and i can't find a guide anywhere
 

Moon_Raven

New Member
Reaction score
8
Well this is the knockback which fires when a unit casts a spell, and you'll have to make 4 variables to make it work:
#1 :Name: cast
Type: unit
#2 :Name:targ
Type: unit
#3 :Name: loc
Type: Point
#4 :Name: bool
Type: Boolean
Here's the code(name the trigger "Knockback":
JASS:
function CheckSpell takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction

function Knock takes nothing returns nothing
call SetUnitPositionLoc(udg_targ, PolarProjectionBJ(udg_loc, DistanceBetweenPoints(udg_loc, GetUnitLoc(udg_targ))+1.5, AngleBetweenPoints(udg_loc, GetUnitLoc(udg_targ))))
endfunction

function Start takes nothing returns nothing
local timer clock
set udg_cast = GetTriggerUnit()
set udg_targ = GetSpellTargetUnit()
set udg_loc = GetUnitLoc(udg_cast)
set clock = CreateTimer()
call TimerStart(clock,0.03,true,function Knock)
call TriggerSleepAction(2)
call DestroyTimer(clock)
set udg_cast=null
set udg_targ=null
set clock = null
call RemoveLocation(udg_loc)
set udg_loc=null
endfunction

function InitTrig_Knockback takes nothing returns nothing
local trigger gg_trg_Knockback = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( gg_trg_Knockback, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Knockback, Condition(function CheckSpell))
call TriggerAddAction(gg_trg_Knockback, function Start)
endfunction

And in the condition part, the 'A000' should be replaced with spell code of your spell :)
 

lokili

New Member
Reaction score
0
ok tnx man. I need to learn how to create abilities with JASS because i used GUI all this time so it's kinda hard
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
i need help with creating a chidori spell i know a few things like to make the special effect in the units hand but i don't know how to make the unit run very fast towards the enemy and pushing the enemy a little backwards, i know how to make the unit run to his enemy but not how to change movement speed. Can anyone tell me how to do this?

Chidori dosen't push the enemy back, it is a peirceing attack. But you can create a item that is used when it is aquired with a speed boost ability on it, then just give the hero that item thru a trigger. Sence it is used when it is aquired it will be considered a tome and the hero will use it even if he has a full inventory, make sure to make it parishable.
 

Moon_Raven

New Member
Reaction score
8
JASS:
function CheckSpell takes nothing returns boolean
return GetSpellAbilityId() == 'A000' //Checks if the ability being cast is 'A000'
endfunction

function Knock takes nothing returns nothing
call SetUnitPositionLoc(udg_targ, PolarProjectionBJ(udg_loc, DistanceBetweenPoints(udg_loc, GetUnitLoc(udg_targ))+1.5, AngleBetweenPoints(udg_loc, GetUnitLoc(udg_targ)))) // Sets udg_targ's postition to be +1.5 distance away from the udg_cast. You can edit this to weaken or strenghten knockback power
endfunction

function Start takes nothing returns nothing
local timer clock
set udg_cast = GetTriggerUnit() //sets caster
set udg_targ = GetSpellTargetUnit()  //sets target
set udg_loc = GetUnitLoc(udg_cast)  //sets casters position
set clock = CreateTimer()
call TimerStart(clock,0.03,true,function Knock)  //does "Knock" action every 0.03 seconds
call TriggerSleepAction(2)  //How long you wait
call DestroyTimer(clock)    //until the timer is destroyed and function execution stops
set udg_cast=null //leak cleans
set udg_targ=null
set clock = null
call RemoveLocation(udg_loc)
set udg_loc=null
endfunction

function InitTrig_Knockback takes nothing returns nothing
local trigger gg_trg_Knockback = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( gg_trg_Knockback, EVENT_PLAYER_UNIT_SPELL_EFFECT) //registers "Unit starts the effect of an ability event
call TriggerAddCondition(gg_trg_Knockback, Condition(function CheckSpell)) //and condtition(The one that is at the top of this piece of code)
call TriggerAddAction(gg_trg_Knockback, function Start) //adds the action to this trigger(the action named Start)
endfunction

Hope the comments clear things a bit for you :)
 

lokili

New Member
Reaction score
0
nope not a thing. I know how to put a JASS skill in the editor but dunno how to make my own with JASS....i got some of it but it's still too difficult
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
JASS:
function CheckSpell takes nothing returns boolean
return GetSpellAbilityId() == 'A000' //Checks if the ability being cast is 'A000'
endfunction

function Knock takes nothing returns nothing
call SetUnitPositionLoc(udg_targ, PolarProjectionBJ(udg_loc, DistanceBetweenPoints(udg_loc, GetUnitLoc(udg_targ))+1.5, AngleBetweenPoints(udg_loc, GetUnitLoc(udg_targ)))) // Sets udg_targ's postition to be +1.5 distance away from the udg_cast. You can edit this to weaken or strenghten knockback power
endfunction

function Start takes nothing returns nothing
local timer clock
set udg_cast = GetTriggerUnit() //sets caster
set udg_targ = GetSpellTargetUnit()  //sets target
set udg_loc = GetUnitLoc(udg_cast)  //sets casters position
set clock = CreateTimer()
call TimerStart(clock,0.03,true,function Knock)  //does "Knock" action every 0.03 seconds
call TriggerSleepAction(2)  //How long you wait
call DestroyTimer(clock)    //until the timer is destroyed and function execution stops
set udg_cast=null //leak cleans
set udg_targ=null
set clock = null
call RemoveLocation(udg_loc)
set udg_loc=null
endfunction

function InitTrig_Knockback takes nothing returns nothing
local trigger gg_trg_Knockback = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( gg_trg_Knockback, EVENT_PLAYER_UNIT_SPELL_EFFECT) //registers "Unit starts the effect of an ability event
call TriggerAddCondition(gg_trg_Knockback, Condition(function CheckSpell)) //and condtition(The one that is at the top of this piece of code)
call TriggerAddAction(gg_trg_Knockback, function Start) //adds the action to this trigger(the action named Start)
endfunction

Hope the comments clear things a bit for you :)

It leaks badly. Use X and Y instead of locations.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top