Hello again, I made a work around with items while setting a unit armor using custom stats with triggering. Adding the armor ability to the item after setting the armor works like a charm.
Now the issue is that I didn't take into count that what if the unit is already holding items with armor, while getting stat bonus from item that increases the base armor of the unit.
On my previous thread about setting unit armor, I made a workaround in the level up system to order drop all items and then give them back.
Sadly using only triggers to set the stats turned out to be a bit of a pain.
The current map size is near 30mb, but I can share it from the pastebin, if it is easier to fix the triggers that way.
Cheers!
Now the issue is that I didn't take into count that what if the unit is already holding items with armor, while getting stat bonus from item that increases the base armor of the unit.
On my previous thread about setting unit armor, I made a workaround in the level up system to order drop all items and then give them back.
Sadly using only triggers to set the stats turned out to be a bit of a pain.
The current map size is near 30mb, but I can share it from the pastebin, if it is easier to fix the triggers that way.
Cheers!
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to |cff00ff00Jade Ring|r
-
-
Then - Actions
-
Set VariableSet StatsPlayerNumber = (Player number of (Owner of (Triggering unit)))
-
-------- Item bonus --------
-
Set VariableSet Agility[StatsPlayerNumber] = (Agility[StatsPlayerNumber] + 1)
-
-------- Adjust stats --------
-
-------- Armor --------
-
Unit - Set Armor of HeroUnit[StatsPlayerNumber] to ((Real(Agility[StatsPlayerNumber])) + ((Real(Toughness[StatsPlayerNumber])) / 2.00))
-
-------- Attack Speed --------
-
Unit - Set level of Attack Speed (1% for each level) for HeroUnit[StatsPlayerNumber] to Agility[StatsPlayerNumber]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Zombie Mask
-
-
Then - Actions
-
Set VariableSet StatsPlayerNumber = (Player number of (Owner of (Triggering unit)))
-
-------- Item bonus --------
-
Set VariableSet Toughness[StatsPlayerNumber] = (Toughness[StatsPlayerNumber] + 1)
-
Set VariableSet Intelligence[StatsPlayerNumber] = (Intelligence[StatsPlayerNumber] + 1)
-
-------- Adjust stats --------
-
-------- HP --------
-
Unit - Set Max HP of HeroUnit[StatsPlayerNumber] to (HitPoints[StatsPlayerNumber] + (Toughness[StatsPlayerNumber] x 7))
-
-------- Armor --------
-
Unit - Set Armor of HeroUnit[StatsPlayerNumber] to ((Real(Agility[StatsPlayerNumber])) + ((Real(Toughness[StatsPlayerNumber])) / 2.00))
-
Item - For Item: (Item being manipulated), Add Ability: Item Armor Bonus (+7)
-
-------- Mana --------
-
Unit - Set Max Mana of HeroUnit[StatsPlayerNumber] to (Intelligence[StatsPlayerNumber] x (4 + (Focus[StatsPlayerNumber] / 2)))
-
-
Else - Actions
-