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

Pickpocket

Status
Not open for further replies.
Level 9
Joined
Oct 28, 2004
Messages
533
Ok, I need help to develop a pickpocket ability, mainly, the part where a random item is selected from the slots.

EX: Level 1: Random item from the top 2 slots.
Level 2: Random item from the top 3 slots.
ETC.

Any help will be appreciated,
Aark
 
Level 4
Joined
Apr 13, 2006
Messages
83
I think that if you create a variable, that would make reference to the random item slot you could use a trigger that would go like:

Event:
Unit begins casting an ability


Condition:
Ability being cast equal to "pick pocket"


Actions:
Make "target unit of ability being cast" drop item on item slot "variable"
Give "casting unit" last dropped item.


That would be the way I solve it, but Im not sure about the possibility of making that variable. Ill check it out and confirm the exact steps as soon as Im got a chance.

And as an advice, restrict the level of the item being stolen so the user cant abuse of that ability, or restrict the time of the item managed, for instance, add an action that would be like:

wait "x" seconds
Make casting unit drop item
Give last droped item to target unit of ability being cast.
 
Level 9
Joined
Oct 28, 2004
Messages
533
Thanks, I'll try that ASAP.

As for the whole restriction thing, higher-end items are placed at the bottom of the inventory, needing the max level to be taken, and only high-end enemies will carry powerful items in the first place.

I *hope* that it will work out.

EDIT: Ugh, hit a snag allready... What is the Variable made up of? Is it Item, Item-Class, etc., and what are the values?

Thanks,
Aark
 
Level 9
Joined
Oct 28, 2004
Messages
533
Ok, this is the level 1 trigger:

Pickpocket
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Pickpocket
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Equal to 45
(Level of Pickpocket for (Casting unit)) Equal to 1
Then - Actions
Player - Add 50 to (Owner of (Casting unit)) Current gold
Unit - Order (Target unit of ability being cast) to drop (Random item in (Region centered at (Position of (Casting unit)) with size (200.00, 200.00)) matching ((Random integer number between 1 and 2) Equal to 2)) on (Casting unit)
 
Status
Not open for further replies.
Top