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

Item removed from hero and returned to the same inventory slot?

Status
Not open for further replies.
Level 2
Joined
Nov 18, 2010
Messages
7
I can't figure this one out. I want to make something like the Blink item in DotA. When you take damage the item should be replaced by another item that does nothing and has different icon and after a few seconds the real item is returned so the player can once again use the item.
The problem here is:

Hero has item in slot 3.
Hero takes damage the item is removed from slot 3
A new item is created for hero and is given to him in slot 1? (this is the problem)

How can i give the item to the hero in the same slot where the previous item was?
 
Level 2
Joined
Nov 18, 2010
Messages
7
How can i move it? I don't see an action in world editor that can manipulate with items in inventory slots :/

EDIT: OK found it :)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
JASS:
// makes a new item and adds it to the item slot (0-5) and returns sucess
native UnitAddItemToSlotById takes unit whichUnit,integer itemId,integer itemSlot returns boolean
// returns the item carried in the slot of a unit (0-5 and returns null if no item is in slot)
native UnitItemInSlot takes unit whichUnit,integer itemSlot returns item
// I forget exact use functionality, I think it drops the item in the slot (0-5) of a unit directly to the ground instantly and returns the item
native UnitRemoveItemFromSlot takes unit whichUnit,integer itemSlot returns item
// use this to move items inside a unit, get the item (one native above does this) and then drop it on the new slot you want it to have
native UnitDropItemSlot takes unit whichUnit,item whichItem,integer slot returns boolean
If GUI does not have them, complain to blizzard.
 
Status
Not open for further replies.
Top