- Joined
- Jul 14, 2011
- Messages
- 3,213
-
Spawn System / Loot system.[/b]
-
Hi!
-
I made a basic creep spawn system for RPG purpose, but i'm having trouble setting the custom drops for each unit.
-
[TRIGGER]Spawn
-

Events
-


Time - Every 1.00 seconds of game time
-
-

Conditions
-


(Number of units in (Units in (Region centered at (Position of Spawner) with size (1000.00, 1000.00)) owned by Neutral Hostile)) Less than or equal to 2
-
-

Actions
-


-------- ----------------------------------------------------------------------------------------- --------
-


-------- Position of the Hero (Spawner) and the Creep (Spawned) --------
-


-------- ----------------------------------------------------------------------------------------- --------
-


Set Point1 = (Position of Spawner)
-


Set CreepPosition = (Position of (Last created unit))
-


-------- ----------------------------------------------------------------------- --------
-


-------- SpawnRegions and Creeps that spawn there. --------
-


-------- ----------------------------------------------------------------------- --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




((WoodA1to3 <gen> contains Spawner) Equal to True) or (((WoodB1to3 <gen> contains Spawner) Equal to True) or ((WoodC1to3 <gen> contains Spawner) Equal to True))
-




(Random integer number between 1 and 100) Less than or equal to 15
-
-



Then - Actions
-




Unit - Create 1 (Random level (Random integer number between 1 and 3) creep unit-type) for Neutral Hostile at (Random point in (Region centered at (Position of Spawner) with size (600.00, 600.00))) facing Default building facing degrees
-




Special Effect - Create a special effect at Point2 using Objects\Spawnmodels\NightElf\EntBirthTarget\EntBirthTarget.mdl
-




Unit - Order (Last created unit) to Attack-Move To (Position of Spawner)
-
-



Else - Actions
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Spawner is in (Units in WoodD1to5 <gen>)) Equal to True
-
-



Then - Actions
-




Unit - Create 1 (Random level (Random integer number between 1 and 5) creep unit-type) for Neutral Hostile at (Random point in (Region centered at (Position of Spawner) with size (600.00, 600.00))) facing Default building facing degrees
-




Special Effect - Create a special effect at Point2 using Objects\Spawnmodels\NightElf\EntBirthTarget\EntBirthTarget.mdl
-




Unit - Order (Last created unit) to Attack-Move To (Position of Spawner)
-
-



Else - Actions
-
-


-------- -------------------------------------------------------------- --------
-


-------- Removing Creeps Outside Spawn Area --------
-


-------- -------------------------------------------------------------- --------
-


Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






((Region centered at (Position of Spawner) with size (800.00, 800.00)) contains (Picked unit)) Equal to False
-






((Picked unit) is in (Units in Fire extinct <gen>)) Equal to False
-
-





Then - Actions
-






Unit - Remove (Picked unit) from the game
-
-





Else - Actions
-
-
-
-


-------- --------------------- --------
-


-------- Leak remove --------
-


-------- --------------------- --------
-


Custom script: call RemoveLocation (udg_Point1)
-


Custom script: call RemoveLocation (udg_Point2)
-
-
If any unit is outside the 800 range, They will be removed. If the unit is in Region D of the wood, the range increases to lvl 5 (including some stronger mobs).
Its pretty basic, if someone want to suggest a better way to do it, or to fix some issue, i would be please, but what i'm really asking for is for a way to set the drops that each creep drop.
Last edited:




