• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Is there a way to give a hero a tome?

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
title is kinda misleading, but i want to put a tome in a heros inventory as if "Use Upon Pickup" was off but if you drop it and pick it up it will use it
 
then create a trigger which detects when a unit is ordered targeting an item, check if the order is to pick it up and check if the target item is a tome, if yes, put it into the inventory and make the hero use it...

or you can just make a trigger which runs when the unit picks up an item, check if it was a tome and order him to use it... now on the trigger where you give the unit a tome, disable the use trigger first before giving tome, then enable it afterwards

or you can create two versions of tome, one with the use auto turned on, one with it turned off... you give the hero the turned off version, then create a trigger such that when he drops it, you change it into the turned on version...

@SonofJay - if you read his post, he already knows that... but he wants it such that if he drops it and picks it up, it will be like the use automatically is on again
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Adikutz, your right and wrong

For technical reasons, i need the object editor to have Use on Pickup : True. This will be true for all items, even if they cant be used. If you try to pickup an item that has use on pickup true and actively used as false, than it will do nothing (yet the unit is ordered targeting an item will still function) but if i try to UnitAddItem(GetTriggerUnit(), GetOrderTargetItem()) than it puts the item at the heroes foot
 
Status
Not open for further replies.
Top