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

"Bounty" Spell

Status
Not open for further replies.
Level 2
Joined
Jun 5, 2005
Messages
22
I'm sort of new to trigger spells, so I could use a little help on this one. I'm trying to make a bounty-type spell that places a bounty on an enemy Hero's head. It just gives bonus gold to the player that killed the Hero with a bounty on it. I've already got my Dummy Caster made, and I gave him these spells:

-Bounty 1 (Based on Cripple)
-Bounty 2 (Based on Unholy Frenzy)
-Bounty 3 (Based on Bloodlust)
-Bounty 4 (Based on Curse)

They're just the buffs for each level of the bounty spell. I have it so when the Hero casts Bounty on another Hero, it places one of those buffs on them (Depending on what level the Bounty skill is). I'm pretty sure everything there is working correctly, so it must be a problem with the triggers. I have a trigger called "Bounty" that orders the Dummy Caster to put the Bounty (1, 2, 3, or 4) buff on the target Hero when it is cast. This is what it looks like:

Code:
"Bounty"
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Bounty 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of (Ability being cast) for (Triggering unit)) Equal to 1
            Then - Actions
                Unit - Order Dummy Caster 0002 <gen> to Undead Necromancer - Cripple (Target unit of ability being cast)
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Bounty  for (Triggering unit)) Equal to 2
            Then - Actions
                Unit - Order Dummy Caster 0002 <gen> to Undead Necromancer - Unholy Frenzy (Target unit of ability being cast)
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Bounty  for (Triggering unit)) Equal to 3
            Then - Actions
                Unit - Order Dummy Caster 0002 <gen> to Orc Shaman - Bloodlust (Target unit of ability being cast)
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Bounty  for (Triggering unit)) Equal to 4
            Then - Actions
                Unit - Order Dummy Caster 0002 <gen> to Undead Banshee - Curse (Target unit of ability being cast)
            Else - Actions
                Do nothing

I based each of the Bounty buffs on different spells so hopefully the Dummy Caster would cast the correct buff. There's probably a flaw in that ^ trigger, or the next one I made.

This next trigger I made just tells the game to give bonus gold to the player who killed a Hero with a Bounty buff. I don't know if I did anything wrong in it, but somethings not working.

Code:
"BountyKill"
    Events
        Unit - A unit Dies
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) has buff Bounty 1 ) Equal to True
            Then - Actions
                Player - Add 200 to (Owner of (Killing unit)) Current gold
                Animation - Play (Killing unit)'s victory animation
                Special Effect - Create a special effect attached to the overhead of (Killing unit) using UI\Feedback\GoldCredit\GoldCredit.mdl
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) has buff Bounty 2 ) Equal to True
            Then - Actions
                Player - Add 350 to (Owner of (Killing unit)) Current gold
                Animation - Play (Killing unit)'s victory animation
                Special Effect - Create a special effect attached to the overhead of (Killing unit) using UI\Feedback\GoldCredit\GoldCredit.mdl
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) has buff Bounty 3 ) Equal to True
            Then - Actions
                Player - Add 500 to (Owner of (Killing unit)) Current gold
                Animation - Play (Killing unit)'s victory animation
                Special Effect - Create a special effect attached to the overhead of (Killing unit) using UI\Feedback\GoldCredit\GoldCredit.mdl
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) has buff Bounty 4 ) Equal to True
            Then - Actions
                Player - Add 750 to (Owner of (Killing unit)) Current gold
                Animation - Play (Killing unit)'s victory animation
                Special Effect - Create a special effect attached to the overhead of (Killing unit) using UI\Feedback\GoldCredit\GoldCredit.mdl
            Else - Actions
                Do nothing

So after I made all that, I went into the game to test it out. When I casted Bounty on an enemy Hero, the buffs worked fine, but then when I killed him, I didnt get any bonus gold. In fact, I didnt get any gold.

So I guess my question here is: Why won't my Bounty spell work? Thank you VERY much to anyone who can help, and I'm sure there's plenty of people at this website who can! :D
 
Level 6
Joined
Feb 4, 2005
Messages
302
I'm not quite sure what's wrong. However, I would suggest that you replace the first trigger's "Triggering Unit" with "event response - casting unit".

Also, in the second trigger, replace "Triggering unit" with "Event Response - Dying Unit". This may be the problem, please try it.
 
Level 13
Joined
Dec 29, 2004
Messages
597
It maybe because you check the buff on 'action' section . It means, after the unit die, you check is the unit has bounty buff, of course not, since dead unit doesn't have buffs anymore.

Try to put it on 'condition' section, make 4 trigger, one for each buff. with condition:

Triggering unit has buff xxxxx

But, i haven't try that. Just think maybe the trigger is executed that way.
 
Level 2
Joined
Jun 5, 2005
Messages
22
I'm not quite sure what's wrong. However, I would suggest that you replace the first trigger's "Triggering Unit" with "event response - casting unit".

Also, in the second trigger, replace "Triggering unit" with "Event Response - Dying Unit". This may be the problem, please try it.

It maybe because you check the buff on 'action' section . It means, after the unit die, you check is the unit has bounty buff, of course not, since dead unit doesn't have buffs anymore.

Try to put it on 'condition' section, make 4 trigger, one for each buff. with condition:

Triggering unit has buff xxxxx

But, i haven't try that. Just think maybe the trigger is executed that way.

Thank you for your help, but my spell still doesn't work... :(

@shadow1500: Where is the Event to give a unit a buff?

Also, if anyone else can help, please do! Thanks.
 
Level 2
Joined
May 18, 2005
Messages
13
help

possibly a better option is to create a unit variable (call it "x"), and when you cast the bounty spell on that unit, x becomes = to this unit. Then who ever kills unit x gets a reward based on the level of the spell, which could done by using a variable function. If you want it to be possible for more than one unit to have a bounty on his head at any time make x an array.

Jimmie
 
Level 2
Joined
Jun 5, 2005
Messages
22
Hmm... good idea! It would take up a lot less space, but wouldn't I have to assign X[0], X[1], X[2], etc. to every unit that Bounty is cast on? Or is there a trigger that automatically does it for me?

Right now I just have it so it adds the target into the group Bounties, and if a unit in the group Bounties is killed, it rewards the killer with gold depending on the level of Bounty.
 
Level 6
Joined
Oct 23, 2006
Messages
223
set it to another variable integer so it would be varaible = X(integer+1). That way it would automatically give another variable array to the next unit. Though thsi would cost you creating tons of arrays, i highly recommend putting them in unit groups instead. Such as "if dying unit is in bountylevel4 group, give X gold to owner of killing unit".
 
Status
Not open for further replies.
Top