• 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.

[Spell] How to get bonus str,agi,int of an item via trigger

Level 25
Joined
Mar 29, 2020
Messages
1,466
I think this is what you are trying to do
  • get item stats
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • tempItem Not equal to (Item being manipulated)
    • Actions
      • Set VariableSet tempItem = (Item being manipulated)
      • Set VariableSet stat = (Strength of (Triggering unit) (Include bonuses))
      • Hero - Drop tempItem from (Triggering unit).
      • Set VariableSet stat = (stat - (Strength of (Triggering unit) (Include bonuses)))
      • Hero - Give tempItem to (Triggering unit)
      • Game - Display to (All players) the text: (amount of strength added by item: + (String(stat)))
      • Set VariableSet tempItem = No item
you need the initial condition, to avoid recursion. And resetting tempItem at the end makes this fire on the same item consecutively despite that condition.

this is just for strength, but you should be able to use similar logic to get the other numbers you want too.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
^ Attach the bonuses to your items.
 
Top