- Joined
- Jul 14, 2011
- Messages
- 3,213
EDIT 1: Leaks removed
EDIT 2: More fixing.
EDIT 3: Creep Spawn added
Hi!
I made this trigger for a combat system i'm making for a RPG map.
1) In another trigger:
1a) When a unit enters/leave the Wood, they're added/removed to/from "Wood_Group".
1b) When the hero dies it's removed from the WoodGroup or WoodCombat.
2) There's a 8% Chance to engage combat inside Wood_Group
3a) The position of the hero is saved
3d) The hero is removed from Wood_Group and added to WoodCombat.
EDIT 2: More fixing.
EDIT 3: Creep Spawn added
Hi!
I made this trigger for a combat system i'm making for a RPG map.
-
Combat System
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
- -------- Wood Group --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 100) Less than or equal to 8
- (Number of units in Wood_Group) Greater than 0
-
Then - Actions
-
Unit Group - Pick every unit in Wood_Group and do (Actions)
-
Loop - Actions
- Camera - Lock camera target for (Owner of (Picked unit)) to (Picked unit), offset by (0.00, 0.00) using Default rotation
- Set Temp_HeroPos[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
- Set Temp_RandomHeroSpawn[(Player number of (Owner of (Picked unit)))] = (Random point in WoodHeroSpawn <gen>)
- Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
- Unit - Move (Picked unit) instantly to Temp_RandomHeroSpawn[(Player number of (Owner of (Picked unit)))]
- Cinematic - Fade in over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
- Custom script: call RemoveLocation(udg_Temp_RandomHeroSpawn[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
- Unit Group - Add (Picked unit) to WoodCombat
- Unit Group - Remove (Picked unit) from Wood_Group
-
Loop - Actions
- Set Int_WC = ((Number of units in WoodCombat) x 2)
- Set Int_RWC = (Random integer number between 1 and Int_WC)
-
For each (Integer A) from 1 to Int_RWC, do (Actions)
-
Loop - Actions
- Set Temp_Point = (Random point in WoodCreepSpawn <gen>)
- Unit - Create 1 WoodCreeps[(Random integer number between 1 and 9)] for Neutral Hostile at Temp_Point facing Default building facing degrees
- Custom script: call RemoveLocation(udg_Temp_Point)
-
Loop - Actions
-
Unit Group - Pick every unit in Wood_Group and do (Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in (Units in WoodEscape <gen>)) Equal to (Number of units in WoodCombat)
-
Then - Actions
-
Unit Group - Pick every unit in WoodCombat and do (Actions)
-
Loop - Actions
- Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
- Unit - Move (Picked unit) instantly to Temp_HeroPos[(Player number of (Owner of (Picked unit)))]
- Cinematic - Fade in over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
- Custom script: call RemoveLocation(udg_Temp_HeroPos[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
- Unit Group - Remove (Picked unit) from WoodCombat
- Unit Group - Add (Picked unit) to Wood_Group
-
Loop - Actions
-
Unit Group - Pick every unit in WoodCombat and do (Actions)
- Else - Actions
-
If - Conditions
-
Events
1) In another trigger:
1a) When a unit enters/leave the Wood, they're added/removed to/from "Wood_Group".
1b) When the hero dies it's removed from the WoodGroup or WoodCombat.
2) There's a 8% Chance to engage combat inside Wood_Group
- (Random integer number between 1 and 100) Less than or equal to 8
3a) The position of the hero is saved
- Set Temp_HeroPos[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
- Set Temp_RandomHeroSpawn[(Player number of (Owner of (Picked unit)))] = (Random point in WoodHeroSpawn <gen>)
3d) The hero is removed from Wood_Group and added to WoodCombat.
- Unit Group - Add (Picked unit) to WoodCombat
- Unit Group - Remove (Picked unit) from Wood_Group
- (Number of units in (Units in WoodEscape <gen>)) Equal to (Number of units in WoodCombat)
- Unit - Move (Picked unit) instantly to Temp_HeroPos[(Player number of (Owner of (Picked unit)))]
- Unit Group - Remove (Picked unit) from WoodCombat
- Unit Group - Add (Picked unit) to Wood_Group
Last edited: