• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] damage of triggered spells (on impact)

Status
Not open for further replies.
Level 2
Joined
Mar 8, 2009
Messages
11
hey guys,
don't really know how to name this thread but i will explain my problem here

i just want to make a spell (based on stormbolt)
- the damage of the spell should be equal to the amout of str of the hero
- the spell projectile sould have a speed of 200
- and the damage type should be magic

well until now it isn't a real problem for me,
-> but now i want that the damage is dealed by the impact of the projectile

i think you can imagine that a 200 speed shot is very slow and if the targeted unit runs away it could take some time to reach it

i don't know really much about JASS so if there is a simple solution in JASS pls write it down 4 me

thx so far
 
Level 9
Joined
Aug 28, 2005
Messages
271
Just use this trigger, you don't need jass for something that simple
  • Events
  • Unit starts the effect of an ablility
  • Conditions
  • Ability being cast equal to Stormbolt
  • Actions
  • set Point_Var = position of target unit of ability being cast
  • Unit - damage area - Order triggering unit to damage *put you aoe here* of Point_Var dealing *damage* of time spells damage type normal.
  • call RemoveLocation(udg_Point_Var) // that's to clean the point leak
sory for the bad writing I don't have the editor in front of me
You can set projectile speed for the spell in the object editor.
 
You said you don't know JASS, so, i will give you the solution through GUI triggers:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <Your Spell>
    • Actions
      • Set Caster = (Triggering unit)
      • Set Target = (Target unit of ability being cast)
      • Set Point1 = (Position of Caster)
      • Set Point2 = (Position of Target)
      • Unit - Create 1 Dummy Projectile for (Owner of Caster) at Point1 facing (Facing of Caster) degrees
      • Set Unit_Dummy = (Last created unit)
      • Trigger - Turn on Untitled Trigger 002 <gen>
      • Custom script: call RemoveLocation (udg_Point1)
      • Custom script: call RemoveLocation (udg_Point2)
The following trigger is NOT initially enabled.
  • Untitled Trigger 002
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set Point2 = (Position of Target)
      • Set Point3 = (Position of Unit_Dummy)
      • Set Point4 = (Point3 offset by ((Distance between Point3 and Point2) / 40.00) towards (Angle from Point3 to Point2) degrees)
      • Unit - Move Unit_Dummy instantly to Point4, facing Point2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between Point3 and Point2) Less than or equal to 55.00
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Unit - Kill Unit_Dummy
          • Unit - Remove Unit_Dummy from the game
          • Unit - Create 1 Dummy Stunner for (Owner of Caster) at Point2 facing Default building facing degrees
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt Target
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Cause Caster to damage Target, dealing (Real((Strength of Caster (Include bonuses)))) damage of attack type Spells and damage type Normal
        • Else - Actions
      • Custom script: call RemoveLocation (udg_Point2)
      • Custom script: call RemoveLocation (udg_Point3)
      • Custom script: call RemoveLocation (udg_Point4)
Note: The "(Real((Strength of Caster (Include bonuses))))" is through "Convert Real to Integer" function.
 
Level 2
Joined
Mar 8, 2009
Messages
11
ok thx, i already thought that i would have to create a dummy unit 4 that

everything is clear so far except why u are moving the dummy unit instantly (i would have used a "unit - order move to" action) but anyway, i cant test it atm but i will test it at home - thx for the fast help guys
 
Well, it is because the "Move unit instantly" action looks like a projectile. The order "Move to" means that the unit will normally walk till that point, so, the maximum speed it can travel is 522. The good thing for the "Move unit instantly" combined with a 0.03 periodic event is the speed of the dummy. You will notice that the trigger i gave you is more of realistic as a projectile. Good luck..
 
Level 2
Joined
Mar 8, 2009
Messages
11
well i tested it now, works very well thx 2 you
the only thing i had to change was the value of point 4 you divided the distance by 40 and so the projectile will move faster at the beginning and will become slower after some time (i think in this case the speed should be saved in a variable at the beginning --> in the first trigger)
anyway i substituted ((Distance between P3 and P2) / 40 ) with 20 and it is working well


you helped me very well so i have to ask you another 3 little questions :D

1) Isn't it possible to stun a target via a JASS function (Custom Script)?

2) Can you maybe give me a short summerize what i have to do when using dummy units
the model change and simple things like that are not the problem, but i still see
- the life bar in top of the unit (when pressing ALT)
- i can select the dummy unit and so i also see
- the green selection circle around the unit,
but i think if i am not able to select it any more this problem should be solved aswell

3) When i use the spell again befor the projectile of the last cast reached his target, only the current projectile will behave as intended.

Of course i know why this is but maybe you got a fast solution for it. I think that i can implement this only by using arrays.

Anyway even if you don't have the time to reply to this I want to thank you, n1 and fast help


Problem 2) (dummy unit) doesn't exist any more, Quetzalcotl helped me via PM
 
Last edited:
1) Of course, but i can see no reason to have the whole trigger in GUI and the order of the stun in Jass language; it just doesn't make sense. Otherwise, why not having the whole trigger in Jass?

2) If you really knew the dummy unit model change, you wouldn't ask such thing; just replace the model of the unit to "Abilties -> Tree of Life upgrade ability", Art - Shadow to None, Abilities -> Invulnerable (Neutral), Locust, Combat - Attacks enabled -> None

3) I used normal and very default GUI. This is why you would need MUI = Multi unit instanceability. MUI is a GUI/Jass enhancer, that enables a spell to be cast by two units at the same time, without causing malfunctions or things like that you have mentioned. It also works for ocassions like this, when a trigger has this periodic event and the actions won't override the actions of the previous casting.
Know that MUI isn't that easy for your current knowledge. You can find many MUI tutorials around Hiveworkshop.com, but you can also, after reading a tutorial first, download from the "Spells" sections some spells that have this "MUI" sign on their title or check, if they are approved, to have the comment of the moderator review that states "It is MUI and bug free/ leakless".

Oh, didn't see the comment of "arrays". Yes, then you know, arrays will do the trick for you (meaning MUI).

I don't understand; the dummy doesn't exist? Meaning?
 
Level 2
Joined
Mar 8, 2009
Messages
11
I don't understand; the dummy doesn't exist? Meaning?

i meant the problems with the dummy unit doesn't exist any more
Quetzalcotl sent me a PM where he already mentioned the locutus ability wich was fixing my problems

1) Of course, but i can see no reason to have the whole trigger in GUI and the order of the stun in Jass language; it just doesn't make sense. Otherwise, why not having the whole trigger in Jass?

of course you are right, normally it would be easier to do everything in Jass then, but i don't know - i think i am just 2 stupid 4 jass
if i see a jass code i normally know what he is doing but i am not able to write one down on my own

however, i am just going to need a stun in many spells on my map and so i tought a stun system or something like that would be n1 - with such a stun system i would also be able to base the duration of the stun also on an hero attribute or level like:
23 str = 2,3 sec stun
31 str = 3,1 sec stun
and so on

but i will just make a dummy unit with a dummy spell like you did in your example

i tried to import such a stunsystem but i am too stupid 4 it :D

This is why you would need MUI = Multi unit instanceability

well i will take a look at that, thx for the information


overall you really helped me very much, thanks a lot!
 
Status
Not open for further replies.
Top