• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Trigger for ability help please!

Status
Not open for further replies.
Level 5
Joined
Mar 17, 2005
Messages
135
Ok, this ability is really fustrating me and i can't figure out why it will not work. When you cast it, the ability (acid bomb) takes away defence and the triggers i set up will remove strength and agility based on the ability level.

My problem: i can't figure out how to add the stats back to the hero after 15 seconds or whenever the modified acid bomb wears off.

Here is my trigger setup:

Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Rabies
Actions
Floating Text - Create floating text that reads |CFFFF0000-Strength... at (Position of (Target unit of ability being cast)) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Hero - Modify Strength of (Target unit of ability being cast): Subtract (5 x (Integer((Real((Level of Rabies for (Triggering unit)))))))
Hero - Modify Agility of (Target unit of ability being cast): Subtract (5 x (Integer((Real((Level of Rabies for (Triggering unit)))))))
Wait 2.00 seconds
Floating Text - Destroy (Last created floating text)
Hero - Modify Strength of (Target unit of ability being cast): Add (5 x (Integer((Real((Level of Rabies for (Triggering unit)))))))
Hero - Modify Agility of (Target unit of ability being cast): Add (5 x (Integer((Real((Level of Rabies for (Triggering unit)))))))
 
Level 5
Joined
Jun 17, 2006
Messages
114
you will need variables to store the amount of strength and agility removed, and also a variable to store the unit that lost the stats. after the 15 seconds are up you give rabiesTarget(player number of [owner of triggering unit)] rabiesStatsTaken[player number of (owner of triggering unit)] strength and agility. these two variables are arrays of units and integers respectively. notice how you can use the player number to access the correct variables in the array and how each player has exactly variable in each array.

one thing to watch out for is accidentally giving the targeted unit additional stats if his origanal strength or agility was 15 or below (heroes cannot have 0 of any attribute so if a hero had 15 strength he would lose 14 but gain 15 back).
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
I actually think he came up with the strength/agility idea and then made a name he thought that could fit this ability... at least that's how I make ailities... I get an idea and then make a name, instead of having a name and making the ability (if I'd do that, I would only make abilities that already exist...)

anyway, let's not get off topic... so does it work now?
 
Status
Not open for further replies.
Top