• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Problem

Status
Not open for further replies.
Level 9
Joined
Feb 20, 2014
Messages
409
Here is my trigger to turn the intelligence of my hero (integer) to real.

Event-
Temps - Every 2.00 seconds of game time

Action-
Set intellE = (Intelligence of Myhero[1] (Inclure bonuses))
Wait 0.10 seconds
Set intell = (Real(intellE))

Here is my trigger to use the intelligence as extra dammage :

Event-
Unit - A unit owned by Player 1 (Red) starts to cast an ability
Condition-
(Casting unit) equal to Myhero[1]
Action-
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing intell damage of attack type Sorts and damage type Normal

But it doesn't work. I don't know why. the dammage dealt are just the spell base dammage.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Wrong event.

Event
Unit - Unit starts the effect of an ability

Also, you do not need to store the attribute beforehand, you can do:
Actions:
Set intellE = (Intelligence of Myhero[1] (Inclure bonuses))
Set intell = (Real(intellE))
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing intell damage of attack type Sorts and damage type Normal

Saves you a highly unrequired second trigger. Except if Myhero[1] is not the unit that is casting the spell ?
 
Level 9
Joined
Feb 20, 2014
Messages
409
Wrong event.

Event
Unit - Unit starts the effect of an ability

Also, you do not need to store the attribute beforehand, you can do:
Actions:
Set intellE = (Intelligence of Myhero[1] (Inclure bonuses))
Set intell = (Real(intellE))
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing intell damage of attack type Sorts and damage type Normal

Saves you a highly unrequired second trigger. Except if Myhero[1] is not the unit that is casting the spell ?
That's weird. It doesn't work with flame strike. and it doesn't work if the spell hits several units (with breath of fire)
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Flame strike & Breath of fire do not have target unit. They are target point.

You will have to do:
  • Set TempPoint = Target point of ability being cast
  • Set TempUnitGroup = Units in XXX range of TempPoint
  • Loop - For each unit in TempUnitGroup
    • IF
      • Do some checks like picked unit is alive, is not building, is enemy, etc,
    • THEN actions
      • Damage picked unit

PS: You have double-posted this thread.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
It is under "Unit" and has no prefix,
e.g "Triggering Unit" has prefix "Event Response" so when you are looking for it it looks like "Event Response - Triggering Unit".
"Picked unit" is just "Picked Unit"

It should look like this

  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
      • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
Of course, replace with your variables and stats.
 
Status
Not open for further replies.
Top