• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Bounty System Request

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
Heres my request - I need a system to keep track of bounty.

Basically what will happen is that a hero will use an item. On using that item, a code would be run like this

call BountyAdd(creepId, CountOfKilledNeeded, forPlayer)

and that will add the bounty.

Than it will basically add the bounty for whenever you kill a target.

When you kill a target with a bounty added, it will display

#ofKilled/#ofRequired NameOfUnit(if killed > required, print NameOfUnit's bounty may be turned in.)

than, another function

call BountyCheck(creepId, forPlayer, function ifComplete)

if killed < required, than print (You must kill required-killed more NameOfUnit to complete the quest)

if killed > required, undo anything done by AddBounty and run function ifComplete.

Heres a GUI example of how i did it before, which takes too much time to add a bounty.
  • Bounty Kill
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set TempLoc = (Position of (Dying unit))
      • Set Temp_UnitGroup = (Units within 2500.00 of (Position of (Dying unit)))
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Unit Group - Pick every unit in Temp_UnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Picked unit) is A Hero) Equal to True
                  • (Owner of (Dying unit)) Not equal to Player 12 (Brown)
                  • (Owner of (Dying unit)) Not equal to Player 11 (Dark Green)
                  • (Owner of (Dying unit)) Not equal to Player 10 (Light Blue)
                  • (Owner of (Dying unit)) Not equal to Neutral Hostile
                  • (Owner of (Dying unit)) Not equal to Neutral Victim
                  • (Owner of (Dying unit)) Not equal to Neutral Extra
                  • (Owner of (Dying unit)) Not equal to Neutral Passive
            • Then - Actions
              • Unit Group - Add (Picked unit) to Bounty_Kill_UnitGroup
            • Else - Actions
      • Custom script: call DestroyGroup(udg_Temp_UnitGroup)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Unit-type of (Triggering unit)) Equal to Rat) or (((Unit-type of (Triggering unit)) Equal to Mother Rat) or (((Unit-type of (Triggering unit)) Equal to Infested Rat) or ((Unit-type of (Triggering unit)) Equal to |cff800080[Elite]|r Mouseasourus - Rex)))
        • Then - Actions
          • Unit Group - Pick every unit in Bounty_Kill_UnitGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Bounty_Rats_Doing[(Player number of (Owner of (Picked unit)))] Equal to True
                • Then - Actions
                  • Set Bounty_Rats_Killed[(Player number of (Owner of (Picked unit)))] = (Bounty_Rats_Killed[(Player number of (Owner of (Picked unit)))] + 1)
                  • If (Bounty_Rats_Killed[(Player number of (Owner of (Picked unit)))] Greater than or equal to 10) then do (Game - Display to (Player group((Owner of (Picked unit)))) the text: Your bounty for Rat...) else do (Game - Display to (Player group((Owner of (Picked unit)))) the text: (<Empty String> + ((String((0 + Bounty_Rats_Killed[(Player number of (Owner of (Picked unit)))]))) + /10 Rats)))
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Triggering unit)) Equal to Kobold Slave
              • (Unit-type of (Triggering unit)) Equal to Kobold Warrior
              • (Unit-type of (Triggering unit)) Equal to Kobold Sorcerer
              • (Unit-type of (Triggering unit)) Equal to |cff3399ff[Elite]|r Kobold Head-Cheif
        • Then - Actions
          • Unit Group - Pick every unit in Bounty_Kill_UnitGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Bounty_Kobolds_Doing[(Player number of (Owner of (Picked unit)))] Equal to True
                • Then - Actions
                  • Set Bounty_Kobolds_Killed[(Player number of (Owner of (Picked unit)))] = (Bounty_Kobolds_Killed[(Player number of (Owner of (Picked unit)))] + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Bounty_Kobolds_Killed[(Player number of (Owner of (Picked unit)))] Greater than or equal to 10
                    • Then - Actions
                      • Game - Display to (Player group((Owner of (Picked unit)))) the text: Your bounty for Kob...
                    • Else - Actions
                      • Game - Display to (Player group((Owner of (Picked unit)))) the text: ((String((0 + Bounty_Kobolds_Killed[(Player number of (Owner of (Picked unit)))]))) + /10 Kobolds)
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Triggering unit)) Equal to Bandit Warrior
              • (Unit-type of (Triggering unit)) Equal to Bandit Spearthrower
              • (Unit-type of (Triggering unit)) Equal to |cf3399ff[Elite]|r Bandit Lord Assistant
              • (Unit-type of (Triggering unit)) Equal to Bandit Champion
              • (Unit-type of (Triggering unit)) Equal to Speedy Bandit Spearthrower
              • (Unit-type of (Triggering unit)) Equal to |cffff00[Mini-Boss]|r Bandit Lord (Female)
        • Then - Actions
          • Unit Group - Pick every unit in Bounty_Kill_UnitGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Bounty_Bandits_Doing[(Player number of (Owner of (Picked unit)))] Equal to True
                • Then - Actions
                  • Set Bounty_Bandits_Killed[(Player number of (Owner of (Picked unit)))] = (Bounty_Bandits_Killed[(Player number of (Owner of (Picked unit)))] + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Bounty_Bandits_Killed[(Player number of (Owner of (Picked unit)))] Greater than or equal to 20
                    • Then - Actions
                      • Game - Display to (Player group((Owner of (Picked unit)))) the text: Your bounty for Ban...
                    • Else - Actions
                      • Game - Display to (Player group((Owner of (Picked unit)))) the text: ((String((0 + Bounty_Bandits_Killed[(Player number of (Owner of (Picked unit)))]))) + /20 Bandits.)
                • Else - Actions
        • Else - Actions
      • Unit Group - Remove all units of Bounty_Kill_UnitGroup from Bounty_Kill_UnitGroup
  • Bounty Turn in
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Unit-type of (Triggering unit)) Not equal to Inventory Dummy
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Bounty Scroll - Rat
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Bounty_Rats_Killed[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 10
            • Then - Actions
              • Hero - Add 500 experience to PlayerUnit[(Player number of (Owner of (Triggering unit)))], Show level-up graphics
              • Player - Add 50 to (Owner of (Triggering unit)) Current gold
              • Set Bounty_Rats_Doing[(Player number of (Owner of (Triggering unit)))] = False
              • Set Bounty_Rats_Killed[(Player number of (Owner of (Triggering unit)))] = 0
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You have completed ...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Bounty_Rats_Killed[(Player number of (Owner of (Triggering unit)))] Less than or equal to 9
                  • Bounty_Rats_Killed[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 1
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You need to kill mo...
                • Else - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You have started th...
                  • Set Bounty_Rats_Doing[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Bounty Scroll - Kobold
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Bounty_Kobolds_Killed[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 10
            • Then - Actions
              • Hero - Add 850 experience to PlayerUnit[(Player number of (Owner of (Triggering unit)))], Show level-up graphics
              • Player - Add 75 to (Owner of (Triggering unit)) Current gold
              • Set Bounty_Kobolds_Doing[(Player number of (Owner of (Triggering unit)))] = False
              • Set Bounty_Kobolds_Killed[(Player number of (Owner of (Triggering unit)))] = 0
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You have completed ...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Bounty_Kobolds_Killed[(Player number of (Owner of (Triggering unit)))] Less than or equal to 9
                  • Bounty_Kobolds_Killed[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 1
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You need to kill mo...
                • Else - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You have started th...
                  • Set Bounty_Kobolds_Doing[(Player number of (Triggering player))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Bounty Scroll - Bandits
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Bounty_Bandits_Killed[(Player number of (Triggering player))] Greater than or equal to 20
            • Then - Actions
              • Hero - Add 2000 experience to PlayerUnit[(Player number of (Owner of (Triggering unit)))], Show level-up graphics
              • Player - Add 500 to (Owner of (Triggering unit)) Current gold
              • Set Bounty_Bandits_Doing[(Player number of (Triggering player))] = False
              • Set Bounty_Bandits_Killed[(Player number of (Triggering player))] = 0
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You have completed ...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Bounty_Bandits_Killed[(Player number of (Triggering player))] Less than or equal to 19
                  • Bounty_Bandits_Killed[(Player number of (Triggering player))] Greater than or equal to 1
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You need to kill mo...
                • Else - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You have started th...
                  • Set Bounty_Bandits_Doing[(Player number of (Triggering player))] = True
        • Else - Actions

tu comprende?

(note - must be able to run with multiple units in the same bounty, didnt really specify that too much)
 
Status
Not open for further replies.
Top