• 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] Something is missing??

Status
Not open for further replies.
Level 15
Joined
Jul 19, 2007
Messages
824
I'm very noobish at triggering and I've tried to make a spell in my map to cause damage based on the casting hero's agility and is this the way to go? The spell is a melee attack that causes the hero to attack a single target enemy and cause damage based on the agility..
  • Mighty Stab
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mighty Stab
    • Actions
      • Set MS_Level = (Level of (Ability being cast) for (Triggering unit))
      • Wait 0.00 seconds
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing ((2.00 x (Real(MS_Level))) x ((Real((Agility of (Casting unit) (Include bonuses)))) + 0.00)) damage of attack type Spells and damage type Normal
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
I have triggers for ya! I didn't tested them yet, but try! :)
  • Learn SPell trigg
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Mighty Stab
    • Actions
      • Set SpellUnits[0] = (Triggering unit)
      • Set AbilityLevel = (Level of Mighty Stab for SpellUnits[0])
      • Trigger - Turn on The spell <gen>
  • The spell
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to SpellUnits[0]
    • Actions
      • Set SpellUnits[1] = (Attacked unit)
      • Unit - Cause SpellUnits[0] to damage SpellUnits[1], dealing YourWantedDamage of attack type Spells and damage type Normal
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
@Cold_Bon: I think "Mighty Stab" is supposed to be an active ability, not a passive one :p

(Additional notes: your triggers can be abused by mashing the "stop"-button and please, use 2 separate variables instead of the array).

@ Pharaoh: I think the 0.00 wait is for the unit to finish his animation or something? I don't know... but without the wait, the damage would be dealt instantly from the moment it is cast, way before the unit seemingly damages the target (according to the model animation).
For the time being, he either has to deal with that and remove the wait, or use a (non-arrayed) variable for the target unit of ability being cast (a 0.00 wait is low enough to be nearly MUI).
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
Triggers, fixed & for active, not passive ability! :)
  • Learn Spell trigg
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Human Mighty Stab
    • Actions
      • Set Caster = (Triggering unit)
      • Set AbilityLevel = (Level of Mighty Stab for Caster)
      • Trigger - Turn on The spell <gen>
  • The spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mighty Stab
    • Actions
      • Set Target = (Target unit of ability being cast)
      • Unit - Cause Caster to damage Target, dealing DaDamageUWant of attack type Spells and damage type Normal
 
Level 15
Joined
Jul 19, 2007
Messages
824
Thanks for all respons and helps but I've tested the triggers I posted and it seems working like I want. It causes damage based on the agility of the Hero and the damage is caused exactly when the attack-animation plays, like I want it so I see no reason to change it and yes it's an active ability that only 1 hero in the map has so it can't be bugged by others..
 
Status
Not open for further replies.
Top