Help to code this skill

SkyXyden

New Member
Reaction score
3
Kunai Strike

Description: Tosses 5 kunai in 5 different direction infront of the hero. Dealing damage to those who got struck by the kunai.

Skill used - Shockwave

I think I ruined the code up >.>

I need help to code the skill to make the hero cast 5 shockwave skill at 5
direction.

1st throw being 80 degree on the left
2nd throw being 40 degree on the left
3rd throw being right infront of where the hero targeted
4th throw being 40 degree on the right
5th throw being 80 degree on the right

cast time between each throw is 0.2 sec


Code:
Kunai Storm
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Kunai Storm (Cast Point)
    Actions
        Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Position of (Triggering unit))
        Unit - Add Kunai Toss (Damage Point) to (Last created unit)
        Wait 0.20 game-time seconds
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave (Target point of ability being cast)
        Wait 0.20 game-time seconds
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave ((Target point of ability being cast) offset by (300.00, 0.00))
        Wait 0.20 game-time seconds
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave ((Target point of ability being cast) offset by (-300.00, 0.00))
        Wait 0.20 game-time seconds
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave ((Target point of ability being cast) offset by (600.00, 0.00))
        Wait 0.20 game-time seconds
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave ((Target point of ability being cast) offset by (-600.00, 0.00))
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
 

Fluffball

Well-Known Member
Reaction score
35
Firstly, it would be easier to Loop it (Make 5, then make them all cast it, making an angle variable different each time. And 90 is north in the world Editor, not 0 (It's east)
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
Firstly, it would be easier to Loop it (Make 5, then make them all cast it, making an angle variable different each time. And 90 is north in the world Editor, not 0 (It's east)

dude... that was X,Y axis.. respectively.
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
sorry for double post....


try this trigger.

Code:
Untitled Trigger 001
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to War Stomp
    Actions
        Set caster_point = (Position of (Triggering unit))
        -------- ------------ --------
        Unit - Create 1 Footman for (Owner of (Triggering unit)) at caster_point facing (Facing of (Triggering unit)) degrees
        Set temp_point = (caster_point offset by 300.00 towards (Facing of (Triggering unit)) degrees)
        Unit - Add Shockwave to (Last created unit)
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave temp_point
        Custom script:   call RemoveLocation(udg_temp_point)
        -------- ----------------- --------
        Unit - Create 1 Footman for (Owner of (Triggering unit)) at caster_point facing ((Facing of (Triggering unit)) - 40.00) degrees
        Set temp_point = (caster_point offset by 300.00 towards ((Facing of (Triggering unit)) - 40.00) degrees)
        Unit - Add Shockwave to (Last created unit)
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave temp_point
        Custom script:   call RemoveLocation(udg_temp_point)
        -------- ----------------- --------
        Unit - Create 1 Footman for (Owner of (Triggering unit)) at caster_point facing ((Facing of (Triggering unit)) - 80.00) degrees
        Set temp_point = (caster_point offset by 300.00 towards ((Facing of (Triggering unit)) - 80.00) degrees)
        Unit - Add Shockwave to (Last created unit)
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave temp_point
        Custom script:   call RemoveLocation(udg_temp_point)
        -------- ----------------- --------
        Unit - Create 1 Footman for (Owner of (Triggering unit)) at caster_point facing ((Facing of (Triggering unit)) + 80.00) degrees
        Set temp_point = (caster_point offset by 300.00 towards ((Facing of (Triggering unit)) + 80.00) degrees)
        Unit - Add Shockwave to (Last created unit)
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave temp_point
        Custom script:   call RemoveLocation(udg_temp_point)
        -------- ----------------- --------
        Unit - Create 1 Footman for (Owner of (Triggering unit)) at caster_point facing ((Facing of (Triggering unit)) + 40.00) degrees
        Set temp_point = (caster_point offset by 300.00 towards ((Facing of (Triggering unit)) + 40.00) degrees)
        Unit - Add Shockwave to (Last created unit)
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave temp_point
        Custom script:   call RemoveLocation(udg_temp_point)
        Custom script:   call RemoveLocation(udg_caster_point)


of course.. modify at will

and use "polar offset" and arithmetic.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
This is my version with a loop =)
Code:
Melee Initialization
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to (Your Ability)
    Actions
        Set Caster_Point = (Position of (Triggering unit))
        For each (Integer A) from 0 to 4, do (Actions)
            Loop - Actions
                Unit - Create 1 (Dummy Unit) for (Owner of (Triggering unit)) at Caster_Point facing (Facing of (Triggering unit)) degrees
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Set Temp_Point = (Caster_Point offset by 300.00 towards (0.00 + (40.00 x (Real((Integer A))))) degrees)
                Unit - Add Shockwave to (Last created unit)
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave Temp_Point
                Custom script:   call RemoveLocation (udg_Temp_Point)
        Custom script:   call RemoveLocation (udg_Caster_Point)
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
This is my version with a loop =)
Code:
Melee Initialization
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to (Your Ability)
    Actions
        Set Caster_Point = (Position of (Triggering unit))
        For each (Integer A) from 0 to 4, do (Actions)
            Loop - Actions
                Unit - Create 1 (Dummy Unit) for (Owner of (Triggering unit)) at Caster_Point facing (Facing of (Triggering unit)) degrees
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Set Temp_Point = (Caster_Point offset by 300.00 towards (0.00 + (40.00 x (Real((Integer A))))) degrees)
                Unit - Add Shockwave to (Last created unit)
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave Temp_Point
                Custom script:   call RemoveLocation (udg_Temp_Point)
        Custom script:   call RemoveLocation (udg_Caster_Point)

yeah.. and look it only shoots 4 shockwaves, when the skill description stated 5,

and also wrong direction 40*(integer a)?

it says 40 and 80 degree from left... 40 and 80 degree from right and one in the front (0 degree).. not 0,40,80,120,160.... nice try btw.
 

Cheddar

This is the way it was meant to be.
Reaction score
126
It just so happens I made a spell like this... it has a bit of a twist, though:

Code:
Spread Shot
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Spread Shot 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (GiantGlaivesOn Equal to True) and ((Mana of (Casting unit)) Greater than or equal to 200.00)
            Then - Actions
                Set TempPoint = (Position of (Casting unit))
                Set TempPoint2 = (TempPoint offset by 300.00 towards ((Facing of (Casting unit)) + 50.00) degrees)
                Unit - Create 1 Shade for (Owner of (Casting unit)) at TempPoint facing ((Facing of (Casting unit)) + 50.00) degrees
                Unit - Add Dummy Super Shockwave  to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Set level of Dummy Super Shockwave  for (Last created unit) to (Level of Spread Shot  for (Casting unit))
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave TempPoint2
                Custom script:   call RemoveLocation(udg_TempPoint2)
                Set TempPoint2 = (TempPoint offset by 300.00 towards ((Facing of (Casting unit)) + 25.00) degrees)
                Unit - Create 1 Shade for (Owner of (Casting unit)) at TempPoint facing ((Facing of (Casting unit)) + 25.00) degrees
                Unit - Add Dummy Super Shockwave  to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Set level of Dummy Super Shockwave  for (Last created unit) to (Level of Spread Shot  for (Casting unit))
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave TempPoint2
                Custom script:   call RemoveLocation(udg_TempPoint2)
                Set TempPoint2 = (TempPoint offset by 300.00 towards ((Facing of (Casting unit)) + 0.00) degrees)
                Unit - Create 1 Shade for (Owner of (Casting unit)) at TempPoint facing ((Facing of (Casting unit)) + 50.00) degrees
                Unit - Add Dummy Super Shockwave  to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Set level of Dummy Super Shockwave  for (Last created unit) to (Level of Spread Shot  for (Casting unit))
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave TempPoint2
                Custom script:   call RemoveLocation(udg_TempPoint2)
                Set TempPoint2 = (TempPoint offset by 300.00 towards ((Facing of (Casting unit)) - 25.00) degrees)
                Unit - Create 1 Shade for (Owner of (Casting unit)) at TempPoint facing ((Facing of (Casting unit)) + 50.00) degrees
                Unit - Add Dummy Super Shockwave  to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Set level of Dummy Super Shockwave  for (Last created unit) to (Level of Spread Shot  for (Casting unit))
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave TempPoint2
                Custom script:   call RemoveLocation(udg_TempPoint2)
                Set TempPoint2 = (TempPoint offset by 300.00 towards ((Facing of (Casting unit)) - 50.00) degrees)
                Unit - Create 1 Shade for (Owner of (Casting unit)) at TempPoint facing ((Facing of (Casting unit)) - 50.00) degrees
                Unit - Add Dummy Super Shockwave  to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Set level of Dummy Super Shockwave  for (Last created unit) to (Level of Spread Shot  for (Casting unit))
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave TempPoint2
                Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) - 60.00)
                Custom script:   call RemoveLocation(udg_TempPoint2)
                Custom script:   call RemoveLocation(udg_TempPoint)
            Else - Actions
                Set TempPoint = (Position of (Casting unit))
                Set TempPoint2 = (TempPoint offset by 300.00 towards ((Facing of (Casting unit)) + 50.00) degrees)
                Unit - Create 1 Shade for (Owner of (Casting unit)) at TempPoint facing ((Facing of (Casting unit)) + 50.00) degrees
                Unit - Add Dummy Normal Shockwave  to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Set level of Dummy Normal Shockwave  for (Last created unit) to (Level of Spread Shot  for (Casting unit))
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave TempPoint2
                Custom script:   call RemoveLocation(udg_TempPoint2)
                Set TempPoint2 = (TempPoint offset by 300.00 towards ((Facing of (Casting unit)) + 25.00) degrees)
                Unit - Create 1 Shade for (Owner of (Casting unit)) at TempPoint facing ((Facing of (Casting unit)) + 50.00) degrees
                Unit - Add Dummy Normal Shockwave  to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Set level of Dummy Normal Shockwave  for (Last created unit) to (Level of Spread Shot  for (Casting unit))
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave TempPoint2
                Custom script:   call RemoveLocation(udg_TempPoint2)
                Set TempPoint2 = (TempPoint offset by 300.00 towards ((Facing of (Casting unit)) + 0.00) degrees)
                Unit - Create 1 Shade for (Owner of (Casting unit)) at TempPoint facing ((Facing of (Casting unit)) + 50.00) degrees
                Unit - Add Dummy Normal Shockwave  to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Set level of Dummy Normal Shockwave  for (Last created unit) to (Level of Spread Shot  for (Casting unit))
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave TempPoint2
                Custom script:   call RemoveLocation(udg_TempPoint2)
                Set TempPoint2 = (TempPoint offset by 300.00 towards ((Facing of (Casting unit)) - 25.00) degrees)
                Unit - Create 1 Shade for (Owner of (Casting unit)) at TempPoint facing ((Facing of (Casting unit)) + 50.00) degrees
                Unit - Add Dummy Normal Shockwave  to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Set level of Dummy Normal Shockwave  for (Last created unit) to (Level of Spread Shot  for (Casting unit))
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave TempPoint2
                Custom script:   call RemoveLocation(udg_TempPoint2)
                Set TempPoint2 = (TempPoint offset by 300.00 towards ((Facing of (Casting unit)) - 50.00) degrees)
                Unit - Create 1 Shade for (Owner of (Casting unit)) at TempPoint facing ((Facing of (Casting unit)) + 50.00) degrees
                Unit - Add Dummy Normal Shockwave  to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Set level of Dummy Normal Shockwave  for (Last created unit) to (Level of Spread Shot  for (Casting unit))
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave TempPoint2
                Custom script:   call RemoveLocation(udg_TempPoint2)
                Custom script:   call RemoveLocation(udg_TempPoint)
        Set RandomInteger = (Random integer number between 1 and 2)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (RandomInteger Equal to 1) and ((Level of Rage (Dargin) for (Casting unit)) Not equal to 0)
            Then - Actions
                Set TempPoint = (Position of (Casting unit))
                Unit - Create 1 Shade for (Owner of (Casting unit)) at TempPoint facing ((Facing of (Casting unit)) - 50.00) degrees
                Unit - Add Rage  to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Set level of Rage  for (Last created unit) to (Level of Rage (Dargin) for (Casting unit))
                Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Casting unit)
                Floating Text - Create floating text that reads Enragement! at TempPoint with Z offset 0.00, using font size 10.00, color (35.00%, 0.00%, 35.00%), and 0.00% transparency
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Show (Last created floating text) for (All players)
                Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
                Custom script:   call RemoveLocation(udg_TempPoint)
                Set RandomInteger = 0
            Else - Actions
                Set RandomInteger = 0
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Casting unit) has buff Vampiric Fury ) Equal to True
            Then - Actions
                Set TempPoint = (Position of (Casting unit))
                Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + (20.00 x (Real((Level of Spread Shot  for (Casting unit))))))
                Special Effect - Create a special effect attached to the head of (Casting unit) using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
                Special Effect - Destroy (Last created special effect)
                Floating Text - Create floating text that reads (+ + ((String(((Level of Spread Shot  for (Casting unit)) x 20))) + !)) at TempPoint with Z offset 0.00, using font size 10.00, color (35.00%, 0.00%, 35.00%), and 0.00% transparency
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Show (Last created floating text) for (All players)
                Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
                Custom script:   call RemoveLocation(udg_TempPoint)
            Else - Actions

Code:
Condition On
    Events
        Unit - A unit Is issued an order with no target
    Conditions
        (Issued order) Equal to (Order(flamingarrows))
    Actions
        Set GiantGlaivesOn = True

Code:
Condition Off
    Events
        Unit - A unit Is issued an order with no target
    Conditions
        (Issued order) Equal to (Order(unflamingarrows))
    Actions
        Set GiantGlaivesOn = False



Spread Shot was made for my total-synergy hero. In short, it thrrows 5 glaives as you described; if he has Giant Glaives (Searing Arrows) autocasted it throws more damaging and larger ones. The other two parts are for his other spells... disregard those.
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
sorry for double post....


try this trigger.

Code:
Untitled Trigger 001
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to War Stomp
    Actions
        Set caster_point = (Position of (Triggering unit))
        -------- ------------ --------
        Unit - Create 1 Footman for (Owner of (Triggering unit)) at caster_point facing (Facing of (Triggering unit)) degrees
        Set temp_point = (caster_point offset by 300.00 towards (Facing of (Triggering unit)) degrees)
        Unit - Add Shockwave to (Last created unit)
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave temp_point
        Custom script:   call RemoveLocation(udg_temp_point)
        -------- ----------------- --------
        Unit - Create 1 Footman for (Owner of (Triggering unit)) at caster_point facing ((Facing of (Triggering unit)) - 40.00) degrees
        Set temp_point = (caster_point offset by 300.00 towards ((Facing of (Triggering unit)) - 40.00) degrees)
        Unit - Add Shockwave to (Last created unit)
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave temp_point
        Custom script:   call RemoveLocation(udg_temp_point)
        -------- ----------------- --------
        Unit - Create 1 Footman for (Owner of (Triggering unit)) at caster_point facing ((Facing of (Triggering unit)) - 80.00) degrees
        Set temp_point = (caster_point offset by 300.00 towards ((Facing of (Triggering unit)) - 80.00) degrees)
        Unit - Add Shockwave to (Last created unit)
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave temp_point
        Custom script:   call RemoveLocation(udg_temp_point)
        -------- ----------------- --------
        Unit - Create 1 Footman for (Owner of (Triggering unit)) at caster_point facing ((Facing of (Triggering unit)) + 80.00) degrees
        Set temp_point = (caster_point offset by 300.00 towards ((Facing of (Triggering unit)) + 80.00) degrees)
        Unit - Add Shockwave to (Last created unit)
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave temp_point
        Custom script:   call RemoveLocation(udg_temp_point)
        -------- ----------------- --------
        Unit - Create 1 Footman for (Owner of (Triggering unit)) at caster_point facing ((Facing of (Triggering unit)) + 40.00) degrees
        Set temp_point = (caster_point offset by 300.00 towards ((Facing of (Triggering unit)) + 40.00) degrees)
        Unit - Add Shockwave to (Last created unit)
        Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave temp_point
        Custom script:   call RemoveLocation(udg_temp_point)
        Custom script:   call RemoveLocation(udg_caster_point)


of course.. modify at will

and use "polar offset" and arithmetic.

thats what i made too.. without the set level of ability part.
 
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