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

Unit with inventory buying a tome

Status
Not open for further replies.
Level 9
Joined
May 22, 2009
Messages
276
I think most of you(or atleast some) have experienced the error message when you buy a tome with a unit that has an inventory (the unit can't use items but carry them).

So is there a way to stop this from happening, either by making it unable for the tome to be bought, or maybe with a trigger so the error doesn't happen?

thx
 
Yes, you need a trigger like this:
  • Trigger
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Target item of issued order) Not equal to No item
      • ((Triggering unit) is A Hero) Equal to False
      • (Item-class of (Target item of issued order)) Equal to Powerup
    • Actions
      • Custom script: call IssuePointOrderById (GetTriggerUnit(), 851971, GetItemX (GetOrderTargetItem()), GetItemY (GetOrderTargetItem()))
The "buying items" issue uses a fake item; if the buying unit is a hero, it will give them the normal tome; if not, a tome will be created on the ground instead.
 

Attachments

  • Units PowerUp Prevention.w3x
    17.8 KB · Views: 56
I think most of you(or atleast some) have experienced the error message when you buy a tome with a unit that has an inventory (the unit can't use items but carry them).

So is there a way to stop this from happening, either by making it unable for the tome to be bought, or maybe with a trigger so the error doesn't happen?

thx

I think it happens if the tome's effect cannot affect the buying unit... example buying Tome of Power on a non-hero unit...

and Pharaoh_'s trigger seems good...
 
Status
Not open for further replies.
Top