Aller au contenu

Photo

Destroy Casted item


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Buddywarrior

Buddywarrior
  • Members
  • 256 messages
I have an item that a player can cast. When they do, it sets a variable to 1. If said variable is already 1, it does nothing.
What I would like to do is have the item destroy itself if var != 1. i.e. when it sets var to 1.

I've tried using DestroyObject(OBJECT_SELF, 0.0); , and that was the only option I thought I had. 

So I guess my question is, what function can I use to destroy the item a player just casted without the risk of destroying another item in the players inventory with the same resref/tag?

#2
Shadooow

Shadooow
  • Members
  • 4 471 messages
in spellscript, casted item is GetSpellCastItem();OBJECT_SELF is player using this item

#3
The Amethyst Dragon

The Amethyst Dragon
  • Members
  • 1 882 messages
For the item property, set the item to "single use", rather than unlimited uses, uses per day, or charges per use.

Such an item will function once and be destroyed in the process. It affects only that single item, and even works for items in a stack (such as potions, scrolls, etc.), removing a single one each time. No special scripting required.