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

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: 60
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