Warcraft III resources & community, 2003–2006 · archived

A Steal Ability

6 posts
#1

A Steal Ability

i need a steal ability to use in my FF9 Campaign, can it please be trigger, not JASS...thanks
#2

Re: A Steal Ability

Shadowz123i need a steal ability to use in my FF9 Campaign, can it please be trigger, not JASS...thanks

what do you mean by steal :?: I'll make you a trigger if you tell me what has to be stealed.
#3

Re: A Steal Ability

[quote="MeanMachine" what do you mean by steal :?: I'll make you a trigger if you tell me what has to be stealed.[/quote]

well, you press a button, and he runs to the enemy, then a random number between 1 and 20, but thats where it stuffs up...just put your own items, ill checnge them when i put it in my campaign.
#4
Here's a nice way of stealing a random item from a unit's inventory:
-----------------------------------------------------
Variables(2) :
Steal_Target - Unit
Steal_Item - Item
Triggers(2)
Steal

    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Steal 
    Actions
        Set Steal_Target = (Target unit of ability being cast)
        Trigger - Run GetItem <gen> (ignoring conditions)
        Wait until (Steal_Item Not equal to No item), checking every 0.10 seconds
        Hero - Give Steal_Item to (Casting unit)

-----
GetItem

    Events
    Conditions
    Actions
        Set Steal_Item = (Item carried by Steal_Target in slot (Random integer number between 1 and 6))
        If (Steal_Item Equal to No item) then do (Trigger - Run (This trigger) (ignoring conditions)) else do (Do nothing)

-----------------------------------------------------
Change the first trigger to add chance of getting an item.
#5
And if you want a random item drop:
-----------------------------------------------------
Variables(3):
Items - Item Type (Array)
Items_DropChance - Real
Items_Ammount - Integer
Triggers(2):
Random Item Drop Config

    Events
        Map initialization
    Conditions
    Actions
        Set Items_Ammount = 2
        Set Items_DropChance = 7.25
        Set Items[1] = Frostguard
        Set Items[2] = Searing Blade

Random Item Drop

    Events
        Unit - A unit Dies
    Conditions
    Actions
        If ((Random real number between 1.00 and 100.00) Less than or equal to Items_DropChance) then do (Item - Create Items[(Random integer number between 1 and Items_Ammount)] at (Position of (Dying unit))) else do (Do nothing)

Change the config trigger to add more items, change the drop chance and ammount of items. To add more items to the array:
set Items(3) = ????
set Items(4) = ????
etc.
Change the second trigger's events and add the conditions you want.
#6
Thanks MeanMachine, it has helped me!