HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Replace Item

09-15-2008, 08:43 PM#1
Gwypaas
I tried to replace an item using this code but all it did was creating an item and then dropping it.
Collapse JASS:
private function BossDeath takes nothing returns boolean
    call RemoveItem(CATCHING_NET)
    call UnitAddItemById(ITEM_HOLDER, ESSENCE_ID)
    return false
endfunction

So now for my question, how can I remove the item called "CATHING_NET" and then replace it with "ESSENCE_ID"(It's the ID of an item.) without the item dropping onto the ground?
09-15-2008, 11:00 PM#2
Archmage Owenalacaster
I'm under the assumption that the BossDeath function is called when a "boss" dies and drops the CATCHING_NET on the ground and that your function intends to replace the item with ESSENCE_ID while still in the ITEM_HOLDER's inventory. Could you post more of your script for clarification?

It should only be dropping the item if the unit's inventory is full and you're using UnitAddItemByIdSwapped, which includes a call to create the item on the ground. More information would be helpful.
09-16-2008, 05:16 PM#3
Gwypaas
I found the error. The globals changed when it ran.