- Joined
- Jul 14, 2011
- Messages
- 3,213
See, I have this. It's my combat system. I made it thinking of console RPG gameplay, where all the units are in battle, and all of them are always together.
When a unit enters a 'Danger' area, it's added to that area group (Wood[0]). And units in that group have a chance to engage combat with WoodCreeps.
The thing is, this system works with groups. If there's 1 hero standing in the combat area, the rest can walk through the Woods without engaging combat, since there's already people in combat. I can't think of a way to avoid that, so players can engage combat even if there's people already in combat without abusing this.
When a unit enters a 'Danger' area, it's added to that area group (Wood[0]). And units in that group have a chance to engage combat with WoodCreeps.
The thing is, this system works with groups. If there's 1 hero standing in the combat area, the rest can walk through the Woods without engaging combat, since there's already people in combat. I can't think of a way to avoid that, so players can engage combat even if there's people already in combat without abusing this.
-
Unit enters Wood
-
Events
- Unit - A unit enters WoodActv <gen>
-
Conditions
- ((Triggering unit) is A Hero) Equal to True
- ((Triggering unit) is in Wood[0]) Equal to False
-
Actions
- Set TempForce = (Player group((Triggering player)))
- Unit Group - Add (Triggering unit) to Wood[0]
- Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
- Custom script: call ClearTextMessages()
- Game - Display to TempForce the text: Entering: |cfffff70...
- Custom script: endif
- Custom script: call DestroyForce(udg_TempForce)
-
Events
-
Combat System
-
Events
- Time - SpawnTimer expires
- Conditions
-
Actions
- -------- WOOD --------
- Set Wood[1] = (Units in WoodCombat <gen> matching (((Owner of (Matching unit)) Equal to Neutral Hostile) and (((Matching unit) is alive) Equal to True)))
- Set Wood[2] = (Units in WoodCombat <gen> matching (((Matching unit) is A Hero) Equal to True))
- Set Wood[3] = (Units in WoodEscape <gen> matching (((Matching unit) is A Hero) Equal to True))
- Floating Text - Change text of TexTags[1] to (Creeps Left: + ( |cffffd700 + ((String((Number of units in Wood[1]))) + |r))) using font size 10.00
-
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 (Random integer number between 0 and (12 + (2 x (Number of units in Wood[0]))))
- (Number of units in Wood[2]) Equal to 0
-
Then - Actions
-
Unit Group - Pick every unit in Wood[0] and do (Actions)
-
Loop - Actions
- Set A = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (A has buff Safety ) Equal to False
- (A has buff Dead ) Equal to False
-
Then - Actions
- Set TempPlayer = (Owner of A)
- Set Temp_Int = (Player number of TempPlayer)
- Set Temp_HeroPos[Temp_Int] = (Position of A)
- Set Temp_RandomHeroSpawn[Temp_Int] = (Random point in WoodSpawn <gen>)
- Unit - Move A instantly to Temp_RandomHeroSpawn[Temp_Int]
- Custom script: if GetLocalPlayer() == udg_TempPlayer then
- Sound - Play DamnBeasts <gen>
- Custom script: endif
- Unit Group - Remove A from Wood[0]
- Unit Group - Add A to Wood[2]
- Else - Actions
-
If - Conditions
- Custom script: call RemoveLocation(udg_Temp_RandomHeroSpawn[udg_Temp_Int])
-
Loop - Actions
- -------- Spawning the Creeps --------
-
For each (Integer A) from 1 to (Random integer number between 1 and 3), do (Actions)
-
Loop - Actions
- Set Temp_PointArray[1] = (Random point in WoodSpawn <gen>)
- Unit - Create 1 WoodCreeps[(Random integer number between 1 and 9)] for Neutral Hostile at Temp_PointArray[1] facing Default building facing degrees
- Custom script: call RemoveLocation(udg_Temp_PointArray[1])
-
Loop - Actions
-
Unit Group - Pick every unit in Wood[0] and do (Actions)
- Else - Actions
-
If - Conditions
- -------- WOOD CLEANING --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Number of units in Wood[2]) Equal to (Number of units in Wood[3])
- (Number of units in Wood[2]) Equal to 0
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
-
Unit Group - Pick every unit in Wood[2] and do (Actions)
-
Loop - Actions
- Set A = (Picked unit)
- Set TempPlayer = (Owner of A)
- Set Temp_Int = (Player number of TempPlayer)
- Unit - Move A instantly to Temp_HeroPos[Temp_Int]
- Unit - Create 1 DummySafetyCaster for Neutral Passive at Temp_HeroPos[Temp_Int] facing Default building facing degrees
- Unit - Order (Last created unit) to Human Priest - Inner Fire A
- Unit - Remove (Last created unit) from the game
- Custom script: call RemoveLocation(udg_Temp_HeroPos[udg_Temp_Int])
- Unit Group - Remove A from Wood[2]
- Unit Group - Add A to Wood[0]
-
Loop - Actions
-
Unit Group - Pick every unit in Wood[1] and do (Actions)
-
Loop - Actions
- Unit - Remove (Picked unit) from the game
-
Loop - Actions
-
Item - Pick every item in WoodCombat <gen> and do (Actions)
-
Loop - Actions
- Item - Remove (Picked item)
-
Loop - Actions
- Destructible - Pick every destructible in WoodCombat <gen> and do (Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Hide birth animation)
-
Unit Group - Pick every unit in Wood[2] and do (Actions)
- Else - Actions
-
If - Conditions
- -------- WOOD LEAKS --------
- Custom script: call DestroyGroup(udg_Wood[1])
- Custom script: call DestroyGroup(udg_Wood[2])
- Custom script: call DestroyGroup(udg_Wood[3])
-
Events