• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Player Hero buys item from shop, trigger removes item but item bonuses stay?

Status
Not open for further replies.
Level 5
Joined
Feb 1, 2009
Messages
111
So, I have a trigger that removes an item from a player unit when he purchases it from a shop but the stat bonus remains on the hero, any reason why this is?

So, I have a stat boosting item like such as armor or agi/int/str/hp/mana and the bonuses remain even though the trigger removed the item from the hero. The item is not in the hero's inventory either so I know it's been removed.


Odd ??
 
Yeah.
That is a general bug in the game. I have encountered it plenty of times.

One way to circumvent it is to make the bought item a power up. Then run a trigger checking what you need to check. And if everything is in order then create the actual item and give it to the buying unit.

I know if you use this method you will have to create two of every item sold. But it works.
 
well i have about 200 unique items in my game so far so ill have to do without this =(

Can units only carry one of every type of item?
Because you only need to make a power up item for those which are unique equipped.

Anyway. That's the only work around I know of unless you want to change your whole item system.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I would prefer a 0.00 timer before removing the item.
  • Untitled Trigger 005
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
    • Actions
      • Set sellInt = (sellInt + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • sellInt Equal to 1
        • Then - Actions
          • Countdown Timer - Start sellTimer as a One-shot timer that will expire in 0.00 seconds
        • Else - Actions
      • Set sellItems[sellInt] = (Sold Item)
  • Untitled Trigger 002
    • Events
      • Time - sellTimer expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to sellInt, do (Actions)
        • Loop - Actions
          • Item - Remove sellItems[(Integer A)]
      • Set sellInt = 0
 
Status
Not open for further replies.
Top