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

Increasing and Decreasing Allstats per hit???

Status
Not open for further replies.
Level 4
Joined
Aug 13, 2010
Messages
60
how to make when we acquired a special item (example : Mask of Death ) with that item when we attack , hero allstats ( STR,AGI,INT) will +1000 per hit ass long as the hero has the item.
so every times the hero with special item attack any kind of enemis the stats of hero will increase 1000 to allstats/hit and the enemis that we attacking will decrease 1000 to allstats/hit (STR,AGI,INT -1000)
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
What the problem?
You should be able to do it yourself after looking on such egzample.

Requires Bribe's DamageEvent/Weep's GDD:

I've used first option (needs Unit Indexer too, but that saves your life)
  • init
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item type of (Item being manipulated)) Equal to Mask of Death
    • Actions
      • Unit Group - Add (Triggering unit) to MoDgroup
      • Set key = (Custom value of (Triggering unit))
      • Set bonus[key] = 0
DamageEvent trigger:
  • get bonus
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource is in MoDgroup) Equal to True
    • Actions
      • Set key = (Custom value of (DamageEventSource))
      • Set bonus[key] = bonus[key] + 1000
      • Hero - Modify Strengh of (Triggering unit): Add 1000
      • Hero - Modify Agility of (Triggering unit): Add 1000
      • Hero - Modify Intelligence of (Triggering unit): Add 1000
Now the 'item is lost' trigger:
  • call remove
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item type of (Item being manipulated)) Equal to Mask of Death
      • ((Triggering unit) is in MoDgroup) Equal to True
    • Actions
      • Set key = (Custom value of (DamageEventSource))
      • Hero - Modify Strengh of (Triggering unit): Subtract bonus[key]
      • Hero - Modify Agility of (Triggering unit): Subtract bonus[key]
      • Hero - Modify Intelligence of (Triggering unit): Subtract bonus[key]
      • Unit Group - Remove (Triggering unit) from MoDgroup
 
Level 9
Joined
Apr 23, 2010
Messages
312
Just do it like Spinnaker says. You can get Bribe's Damage Event system here. Before you import the system into your map make sure you have in file/preferences/general that the "Automatically create unknown variables" check box checked, once that's done go ahead and import the system, you don't have to create those variables.

For Spinnaker's triggers however, you will need to create 3 variables.
Spinnaker's Variables
Key = Integer
Bonus = Integer Array
MoD_Group = Unit Group
Spinnaker's trigger uses variables from Bribe's Damage Event system so don't worry about the ones I didn't mention, at least until you create these triggers.
 
Status
Not open for further replies.
Top