• 💀 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!

Disable Inventory/Buy/Transfer/Sell items.

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
Hi!

I'm making an RPG where dead units are Ethereal Units. I already disable attack and skills, but I don't know how to prevent item sell/transfer/drop/pick/buy/use during this state.
 
Level 8
Joined
Dec 9, 2009
Messages
397
  • Do Multiple ActionsFor each (Integer A) from 1 to 6, do (Actions)
    • Loop - Actions
      • Item - Make (Item carried by HeroSave[(Player number of (Owner of (Dying unit)))] in slot (Integer A)) Undroppable
Something like that?
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
it does, i think it will drop the items on the ground.

use this if you want it completely removed

  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Item - Remove (Item carried by (Picked unit) in slot (Integer A))
      • Unit - Remove Inventory (Hero) from (Picked unit)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
OK. Using 'Player - Disable Inventory (Hero) for (Owner of (Triggering unit))' works, but then I can't buy 'Revive', since it's an item :)

How can I do this? Selling a Unit and removing it?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Edit:

Ok, when I disable the inventory, items remain in the unit though the inventory dissapears. That's no problem.

I was selling an item that was triggering the resurrection of the unit (reversing al the death effects), but since the dead unit has no inventory, there was no way for them to revive that way, so I changed the Revive item, for a Revive Unit. (Revive Item is just a Dispell that removes the banish effect from the unit. The rest of the dead/revive effects are triggered: Inventory removal, disable attack an skills, etc.)

Now, when I enable the inventory again, all the items that were on the unit are droped.

I'd like to know a way to save the items the Dead Unit has, and give it those items when it revives. I tough about making a Item-Type variable array for each player (5), but I think using hashtables would make it a lot easier.. but I don't know how to use them :(.
 
Last edited:
Status
Not open for further replies.
Top