• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

How to make an item only usable once?

Status
Not open for further replies.
Level 6
Joined
Dec 9, 2014
Messages
176
Some of the items in my game are extremely rare. I'd like them to only be usable once and afterwards if you manage to find another and try to use it, it will instead give you a message saying that you already have it. I have a pet system that is very nearly complete save adding more pets and where you can find them. I just need to make it so you can't summon more if you already have one pet. I'll include the map so you can take a look at the system. After the naming and gender choosing parts, you'll find 2 items in front of your character. I need it so that if you already have the pet, you cannot summon it again. My pet menu system is working great, I just need the items to work as well. Thanks so much for any help!
 

Attachments

  • WoE - MC 0.1.w3x
    270.3 KB · Views: 35
Level 24
Joined
Sep 26, 2009
Messages
2,320
when you use item, you actually also fire the "Unit begins casting an ability" event, because your unit casts the ability that's in the item.

So all you need to do is actually make for example a unit group that is empty at the start of your map.
Now when any hero uses the rare item, check if he's in the unit group.
If he:
1) isn't in the unit group, then just add him in it. This will make him use the item.
2) is in the unit group, order the hero to stop (= Unit - issue order with no target).

So basically the unit group would contain all heroes who are forbidden to cast the ability again.
Also, don't destroy the group ever. If you were to destroy it, all your heroes would be able to use those rare items again.
 
Status
Not open for further replies.
Top