Shockwave based on str of hero

Sivert

New Member
Reaction score
0
Okey, so I want my "Rexxar" to cast a shockwave that deals 50 (x lvl of ability) + 0.25 of str of hero, but I'm having trouble setting a point where the damage is done.

Code:
ShockWave
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Shockwave 
    Actions
        Set SW_Target_loc = (Target point of ability being cast)  ---- ?????
        Set SW_Caster = (Triggering unit)
        Set SW_Group[1] = (Units within 400.00 of (Target point of ability being cast) matching ((((Triggering unit) is A structure) Equal to False) and ((((Triggering unit) is alive) Equal to True) and (((Triggering unit) belongs to an enemy of (Owner of SW_Caster)) Equal to True)))) ???
        Unit - Cause (Triggering unit) to damage SW_Units[1], dealing (((Real((Strength of SW_Caster (Include bonuses)))) x 0.25) + (50.00 x (Real((Level of Shockwave  for SW_Caster))))) damage of attack type Spells and damage type Normal
        Custom script:   call RemoveLocation(udg_SW_Target_loc)
        Custom script:   call DestroyGroup(udg_SW_Group[1])

So I kinda didn't finish.. Pretty hopeless? This is pretty much nothing I think.. I can't imagine how selecting units in a line is done by triggers. I need a "pointing" in the right direction :S

You could just link to a similar spell-setup if you'd like :)
Ty for any help..
 

Furberg

Ultra Cool Member
Reaction score
45
Make a dummy unit that moves forward while damaging all unit of range (based on Shockwaves AoE) based on strength. trigger should be

First:

Code:
Events 
  Units starts effect of an abillity
COnditions
  Abillity being cast equal to Shockwave Strength Damage
Actions
  Create dummy unit at position of triggering unit
set unitShockwavedummy = last created unit
set unitCaster = triggering unit
set integerFacing = facing of triggering unit
Turn on trigger Move shockwave
Code:
Events
  Every 0.05 sec of game time
Conditions
Actions
  Pick every unit in range of unitShockwavedummy matching unit belongs to enemy equal to true - then Damage unit 50+strength of unitCaster

Move unitShockwavedummy to position of unitShockwavedummy with offset 10 facing integerFacing

Set unitShockwavedummy = Last created unit - The dummy unit that you creates in first trigger

Set unitCaster = triggering unit - so you can damage in strength

Set integerfacing = facing of triggering unit/unitCaster - so you know which direction the shockwave should go

Hope i helped you.

EDIT: yes this took a loooong time :p
 

FireBladesX

Eating my wings!
Reaction score
123
You need to add the units hit by the moving dummy unit in to a unit group, or else it will deal about 20x too much damage. In other words, make a condition for the unit group that the matching unit must not be in shockwavegroup, then add the unit to shockwavegroup.
 

Sivert

New Member
Reaction score
0
I tried some of your stuff Furberg, but I didn't figure everything out..

This almost makes some sense.
Code:
ShockWave Init
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Shockwave 
    Actions
        Set SW_Caster = (Triggering unit)
        Unit - Create 1 Dummy for (Owner of SW_Caster) at (Position of SW_Caster) facing (Facing of SW_Caster) degrees
        Set SW_Dummy = (Last created unit)
        Set SW_Facing = (Facing of SW_Caster)
        Trigger - Turn on ShockWave Effect <gen>

Now this one is .. not very logical.
Code:
ShockWave Effect
    Events
        Time - Every 0.05 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units within 300.00 of (Position of SW_Dummy) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Triggering unit) belongs to an enemy of (Owner of SW_Dummy)) Equal to True)))) and do (Unit - Cause SW_Caster to damage (Picked unit), dealing (((Real((Strength of SW_Caster (Exclude bonuses)))) x 0.25) + (50.00 + (Real((Level of Shockwave  for SW_Caster))))) damage of attack type Spells and damage type Normal)
        Unit - Move SW_Dummy instantly to (Position of SW_Dummy), facing SW_Facing degrees

Alltogether the spell now created a dummy that never dissapeared (of obvious reasons (no timer on dummy etc)) and killed everything that went close..

>> You need to add the units hit by the moving dummy unit in to a unit group, or else it will deal about 20x too much damage. In other words, make a condition for the unit group that the matching unit must not be in shockwavegroup, then add the unit to shockwavegroup.

I think I've done that once, but I don't remember how.. Something like this? (found somewhere in this forum I think) :
Code:
Smash Init
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Terra Crush 
    Actions
        Custom script:   set udg_TC_Group[2] = CreateGroup()
        Set TC_Caster = (Casting unit)
        Set TC_CasterLocation = (Position of TC_Caster)
        Set TC_Group[1] = (Units within 275.00 of TC_CasterLocation matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to an enemy of (Owner o
        Set TC_NumberOfUnits = (Number of units in TC_Group[1])
        Custom script:   call DestroyGroup(udg_TC_Group[1])
        For each (Integer A) from 1 to TC_NumberOfUnits, do (Actions)
            Loop - Actions
                Set TC_Group[1] = (Random 1 units from (Units within 275.00 of TC_CasterLocation matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to
                Unit Group - Pick every unit in TC_Group[1] and do (Actions)
                    Loop - Actions
                        Set TC_Units[(Integer A)] = (Picked unit)
                        Set TC_UnitsLocation[(Integer A)] = (Position of TC_Units[(Integer A)])
                        Set TC_Angle[(Integer A)] = (Angle from TC_CasterLocation to TC_UnitsLocation[(Integer A)])
                        Set TC_Distance[(Integer A)] = 300.00
                        Unit Group - Add TC_Units[(Integer A)] to TC_Group[2]
                        Unit - Cause TC_Caster to damage TC_Units[(Integer A)], dealing (3.50 x ((Real((Level of Showdown  for TC_Caster))) x (Real((Strength of TC_Caster (Include bonuses)))))) damage of attack type Hero and damage type Normal
                        Custom script:   call RemoveLocation(udg_TC_UnitsLocation[GetForLoopIndexA()])
        Custom script:   call DestroyGroup(udg_TC_Group[1])
        Trigger - Turn on Smash Effect <gen>



I guess this was harder than I expected, hehe. This is one of my first less easy spells, so please forgive me :p

I also guess I'll be giving +rep too.
 

WilliamPa

Active Member
Reaction score
51
Sorry, cannot write triggers atm so i just give help in my own words :p
Add to the second trigger in the unit group part matching, and then there check is the unit in, i give here handwrote action to help.
Unit Group - Pick every unit within 300 of SW_Dummy matching ((Matching Unit) is in SW_UGroup equal to False)
Then in the unit group loop make trigger Unit Group - Add Picked Unit to SW_UGroup
The unit-move sw_dummy action makes the dummy slide.

I now try to make unit group loop in code so u can read it even abit :D

Code:
Unit Group - Pick every unit within 300 of SW_Dummy matching ((Matching unit) is in SW_UGroup equal to (False))
    Unit - Set life of (Picked unit) to life of ((Picked unit)-(((Hero - Strenght of (SW_Caster))/0.25)x20)-((Hero - Level of (SW_Caster))x5)x20))
    Unit Group - Add (Picked unit) to (SW_UGroup)

The math might have a little bugs, as i tried to think it as in real math :/ Like 750(hp)-17(str)/0.25x20(base dmg)-7(lvl)x5(lvl x)x20(basedmg)
 

Sivert

New Member
Reaction score
0
So I've got this (again sorry for not being able to draw the remaining lines myself :S...):
Code:
ShockWave Init
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Shockwave 
    Actions
        Set SW_Caster = (Triggering unit)
        Unit - Create 1 Dummy for (Owner of SW_Caster) at (Position of SW_Caster) facing (Facing of SW_Caster) degrees
        Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        Set SW_Dummy = (Last created unit)
        Set SW_Facing = (Facing of SW_Caster)
        Trigger - Turn on ShockWave Effect <gen>


Code:
ShockWave Effect
    Events
        Time - Every 0.05 seconds of game time
    Conditions
    Actions
        Unit - Move SW_Dummy instantly to ((Position of SW_Dummy) offset by 10.00 towards SW_Facing degrees)
        Unit Group - Pick every unit in (Units within 300.00 of (Position of SW_Dummy) matching ((((Matching unit) belongs to an enemy of (Owner of SW_Caster)) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) and do (Actions)
            Loop - Actions
                Unit - Cause SW_Caster to damage (Picked unit), dealing (((Real((Strength of SW_Caster (Exclude bonuses)))) x 0.25) + (50.00 + (Real((Level of Shockwave  for SW_Caster))))) damage of attack type Spells and damage type Normal
                Unit Group - Add (Picked unit) to SW_Group
        Wait 2.00 seconds
        Custom script:   call DestroyGroup(udg_SW_Group)


So far the spell does not work as a shockwave, as the target area doesn't work properly. If it hits its only a little location (300 area i guess, sometimes not fitting if surrounded units that actually are missed by the shockwave get hit etc).

Would it work if I ordered the dummy unit to move to offsett point (and set the dummy's movement speed to max)?

I found the changing "life of unit - lvl of hero ability..." didn't work, so I replaced it with "unit - cause SW_Caster ..".
 
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