Im Trying to make an arena FFA Style map. and im gaving some trouble witht he revive/Item Systems im currently attempting to use. these triggers are shaky and dont work as intended
Basically when a unit dies it cant be revived by triggers via "hero revive"
so i have it create a new unit and set it to "Character(player number)"
items randomly appear on the map from nowhere. plz help!
Basically when a unit dies it cant be revived by triggers via "hero revive"
so i have it create a new unit and set it to "Character(player number)"
items randomly appear on the map from nowhere. plz help!
Trigger:
- Revive Hero
- Events
- Unit - A unit Dies
- Conditions
- (Dying unit) Equal to Character[(Player number of (Owner of (Dying unit)))]
- ((Dying unit) is A Hero) Equal to False
- Actions
- Set SpreeCount[(Player number of (Owner of (Dying unit)))] = 0
- Game - Display to (Player group((Owner of (Dying unit)))) for 10.00 seconds the text: (Player_Colors[7] + (You have died, you will be revived in 15 seconds + |r))
- Unit Group - Add (Dying unit) to RevivableUnits
- Countdown Timer - Start Timer[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in 15.00 seconds
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Then - Actions
- Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Owner of (Dying unit)))
- Countdown Timer - Hide (Last created timer window)
- Countdown Timer - Show (Last created timer window) for (Owner of (Dying unit))
- Set TimerWindow[(Player number of (Owner of (Dying unit)))] = (Last created timer window)
- Else - Actions
- Events
Trigger:
- Revive Hero Timer
- Events
- Time - Timer[1] expires
- Time - Timer[2] expires
- Time - Timer[3] expires
- Time - Timer[4] expires
- Time - Timer[5] expires
- Time - Timer[6] expires
- Time - Timer[7] expires
- Time - Timer[8] expires
- Time - Timer[9] expires
- Time - Timer[10] expires
- Time - Timer[11] expires
- Time - Timer[12] expires
- Conditions
- Actions
- Unit Group - Pick every unit in RevivableUnits and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Remaining time for Timer[(Player number of (Owner of (Picked unit)))]) Less than 1.00
- Then - Actions
- Unit - Create 1 (Unit-type of Character[(Player number of (Owner of (Picked unit)))]) for (Owner of (Picked unit)) at (Center of Revive[(Player number of (Owner of (Picked unit)))]) facing Default building facing degrees
- Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
- Set Effect[(Player number of (Owner of (Picked unit)))] = (Last created special effect)
- Set Character[(Player number of (Owner of (Picked unit)))] = (Last created unit)
- Camera - Pan camera for (Owner of (Picked unit)) to (Center of Revive[(Player number of (Owner of (Picked unit)))]) over 0.00 seconds
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Character[(Player number of (Owner of (Dying unit)))] is alive) Equal to True
- Then - Actions
- For each (Integer A) from 1 to 6, do (Hero - Create (Item-type of (Item carried by ItemDummy[(Player number of (Owner of (Dying unit)))] in slot (Integer A))) and give it to Character[(Player number of (Owner of (Dying unit)))])
- Else - Actions
- Do nothing
- If - Conditions
- Unit Group - Pick every unit in (Units owned by (Owner of (Last created unit)) of type (Unit-type of (Last created unit))) and do (Actions)
- Loop - Actions
- Unit Group - Remove (Picked unit) from RevivableUnits
- Loop - Actions
- Countdown Timer - Destroy TimerWindow[(Player number of (Owner of (Picked unit)))]
- Countdown Timer - Start EffectTimer[(Player number of (Owner of (Picked unit)))] as a One-shot timer that will expire in 2.00 seconds
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Unit Group - Pick every unit in RevivableUnits and do (Actions)
- Events
Trigger:
- ItemAquire
- Events
- Unit - A unit Acquires an item
- Conditions
- (Item-class of (Item being manipulated)) Not equal to Powerup
- (Hero manipulating item) Equal to Character[(Player number of (Owner of (Hero manipulating item)))]
- (Revive[(Player number of (Owner of (Hero manipulating item)))] contains (Hero manipulating item)) Equal to False
- (Hero manipulating item) Not equal to ItemDummy[(Player number of (Owner of (Hero manipulating item)))]
- Actions
- Hero - Create (Item-type of (Item being manipulated)) and give it to ItemDummy[(Player number of (Owner of (Hero manipulating item)))]
- Events
Trigger:
- ItemLose
- Events
- Unit - A unit Loses an item
- Conditions
- (Item-class of (Item being manipulated)) Not equal to Powerup
- (Revive[(Player number of (Owner of (Hero manipulating item)))] contains (Hero manipulating item)) Equal to False
- (Hero manipulating item) Equal to Character[(Player number of (Owner of (Hero manipulating item)))]
- (Hero manipulating item) Not equal to ItemDummy[(Player number of (Owner of (Hero manipulating item)))]
- Actions
- Hero - Drop (Item carried by ItemDummy[(Player number of (Owner of (Hero manipulating item)))] of type (Item-type of (Item being manipulated))) from ItemDummy[(Player number of (Owner of (Hero manipulating item)))]
- Item - Remove (Last dropped item)
- Events