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

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,219
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