• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Need a Trigger

Status
Not open for further replies.
Level 12
Joined
Apr 26, 2008
Messages
830
Hi my name is Nightbrowler but my friends call me NB... well i need a trigger for my maps revive system since i am not so good with systems ...

well i try to explain it at the beginning of the game red can choose how many revives the heroes can have 3/5/8/10... if your hero die it will be revived in a region(the region that i will add) so when red choose 10 revives and your hero revives 10 times then the 11th time he dies so no revive^^.. sorry for my bad explanation if you don't understand something ask please and i will tell you again in an better way:thumbs_up:.
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
1) Check this tutorial on how to allow red to choose the amount of revives:
Dialog Box Tutorial - Choose a Hero
2) Make a trigger similar to this:
  • Events
    • A dialog button is clicked
  • Actions
  • If Clicked dialog button equal to Dialog10Revives then
    • Set X = 10
  • Else
    • If Clicked dialog button equal to Dialog5Revives then
      • Set X = 5
  • etc...
  • For each Integer A from 1 to 12 do:
    • loop - actions
      • Set Revives[Integer A] = X
Revives is an integer array

The 2nd trigger would decrease revives whenever a hero dies:
  • Events
    • Unit - a unit dies
  • Conditions
    • Boolean - Triggering unit is a hero equal to true
  • Actions
    • Set Revives[Player number of (owner of (triggering unit))] = Revives[Player number of (owner of (triggering unit))] - 1
    • If Revives[Player number of (owner of (triggering unit))] = 0 then
      • Game - defeat Owner of (triggering unit) with the message "noob"
 
Level 12
Joined
Apr 26, 2008
Messages
830
1) Check this tutorial on how to allow red to choose the amount of revives:
Dialog Box Tutorial - Choose a Hero
2) Make a trigger similar to this:
  • Events
    • A dialog button is clicked
  • Actions
  • If Clicked dialog button equal to Dialog10Revives then
    • Set X = 10
  • Else
    • If Clicked dialog button equal to Dialog5Revives then
      • Set X = 5
  • etc...
  • For each Integer A from 1 to 12 do:
    • loop - actions
      • Set Revives[Integer A] = X
Revives is an integer array

The 2nd trigger would decrease revives whenever a hero dies:
  • Events
    • Unit - a unit dies
  • Conditions
    • Boolean - Triggering unit is a hero equal to true
  • Actions
    • Set Revives[Player number of (owner of (triggering unit))] = Revives[Player number of (owner of (triggering unit))] - 1
    • If Revives[Player number of (owner of (triggering unit))] = 0 then
      • Game - defeat Owner of (triggering unit) with the message "noob"

can you make this in a map because i don't have time to learn it.. i will give +rep
 
Status
Not open for further replies.
Top