• 🏆 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!

[Trigger] Something is missing??

Status
Not open for further replies.
Level 14
Joined
Jul 19, 2007
Messages
772
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 14
Joined
Jul 19, 2007
Messages
772
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