Moderator
M
Moderator
11:53, 17th Jun 2010
TriggerHappy:
Works fine and could be useful.
TriggerHappy:
Works fine and could be useful.
(0 ratings)
type -evolve to open the dialog
Triggers
- EVO D init
- Ereignisse
- Map initialization
- Bedingungen
- Aktionen
- Custom script: set udg_EvoMaxPlayers=bj_MAX_PLAYER_SLOTS
- -------- ----------------------------------------------------------------------------------------------------- --------
- -------- ----- settings ----- --------
- Set EvoMorphEffect = Abilities\Spells\Other\Charm\CharmTarget.mdl
- -------- --------------------------------------- --------
- -------- NOTE: you should sort the following things from the EvoCost (min) to EvoCost (max) --------
- -------- --------------------------------------- --------
- Set EvoMaxUnits = (EvoMaxUnits + 1)
- Set EvoType[EvoMaxUnits] = Arbeiter
- Set EvoCost[EvoMaxUnits] = 0
- Set EvoName[EvoMaxUnits] = Worker
- -------- --------------------------------------- --------
- Set EvoMaxUnits = (EvoMaxUnits + 1)
- Set EvoType[EvoMaxUnits] = Soldat
- Set EvoCost[EvoMaxUnits] = 1
- Set EvoName[EvoMaxUnits] = Soldier
- -------- --------------------------------------- --------
- Set EvoMaxUnits = (EvoMaxUnits + 1)
- Set EvoType[EvoMaxUnits] = Scharfschütze
- Set EvoCost[EvoMaxUnits] = 1
- Set EvoName[EvoMaxUnits] = Sniper
- -------- --------------------------------------- --------
- Set EvoMaxUnits = (EvoMaxUnits + 1)
- Set EvoType[EvoMaxUnits] = Priester
- Set EvoCost[EvoMaxUnits] = 2
- Set EvoName[EvoMaxUnits] = Healer
- -------- --------------------------------------- --------
- Set EvoMaxUnits = (EvoMaxUnits + 1)
- Set EvoType[EvoMaxUnits] = Ritter
- Set EvoCost[EvoMaxUnits] = 3
- Set EvoName[EvoMaxUnits] = Knight
- -------- --------------------------------------- --------
- Set EvoUnit[1] = Arbeiter 0001 <gen>
- Set EvoUnit[2] = Arbeiter 0002 <gen>
- -------- ----- end of the settings ----- --------
- -------- ----------------------------------------------------------------------------------------------------- --------
- For each (Integer EvoInteger[1]) from 1 to EvoMaxPlayers, do (Actions)
- Schleifen - Aktionen
- Auslöser - Add to EVO D show <gen> the event (Spieler - (Player(EvoInteger[1])) types a chat message containing -evolve as Exakte Übereinstimmung)
- Auslöser - Add to EVO D select <gen> the event (Dialog - A dialog button is clicked for EvoDialog[EvoInteger[1]])
- -------- add events --------
- EVO D show
- Ereignisse
- Bedingungen
- Aktionen
- Set EvoInteger[0] = (Player number of (Triggering player))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- 'IF'-Bedingungen
- (EvoUnit[EvoInteger[0]] is alive) Gleich True
- 'THEN'-Aktionen
- Dialog - Clear EvoDialog[EvoInteger[0]]
- Dialog - Change the title of EvoDialog[EvoInteger[0]] to Evolution Tree
- -------- this get the number of the unit type --------
- -------- --------------------------------------- --------
- For each (Integer EvoInteger[1]) from 1 to EvoMaxUnits, do (Actions)
- Schleifen - Aktionen
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- 'IF'-Bedingungen
- EvoTempBoolean[0] Gleich False
- (Unit-type of EvoUnit[EvoInteger[0]]) Gleich EvoType[EvoInteger[1]]
- 'THEN'-Aktionen
- Set EvoTempBoolean[0] = True
- Set EvoInteger[2] = EvoInteger[1]
- 'ELSE'-Aktionen
- Set EvoTempBoolean[0] = False
- -------- --------------------------------------- --------
- For each (Integer EvoInteger[1]) from 1 to EvoMaxUnits, do (Actions)
- Schleifen - Aktionen
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- 'IF'-Bedingungen
- EvoCost[EvoInteger[1]] Größer gleich EvoCost[EvoInteger[2]]
- EvoInteger[1] Ungleich EvoInteger[2]
- 'THEN'-Aktionen
- Set EvoButtonString[0] = EvoName[EvoInteger[1]]
- Set EvoInteger[4] = (EvoCost[EvoInteger[1]] - EvoCost[EvoInteger[2]])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- 'IF'-Bedingungen
- EvoInteger[4] Gleich 0
- 'THEN'-Aktionen
- Set EvoButtonString[1] = <Leerer String>
- 'ELSE'-Aktionen
- Set EvoButtonString[1] = ( |c00008000 + ([ + ((String((EvoCost[EvoInteger[1]] - EvoCost[EvoInteger[2]]))) + ]|r)))
- Dialog - Create a dialog button for EvoDialog[EvoInteger[0]] labelled (EvoButtonString[0] + EvoButtonString[1])
- Set EvoButton[(EvoInteger[1] x EvoInteger[0])] = (Last created dialog Button)
- -------- set the name of the button and set the variable on it --------
- 'ELSE'-Aktionen
- -------- --------------------------------------- --------
- Dialog - Create a dialog button for EvoDialog[EvoInteger[0]] labelled |c00FF0000Exit|r
- Dialog - Zeigen EvoDialog[EvoInteger[0]] for (Player(EvoInteger[0]))
- -------- create the exit button --------
- 'ELSE'-Aktionen
- EVO D select
- Ereignisse
- Bedingungen
- Aktionen
- Set EvoInteger[0] = (Player number of (Triggering player))
- Set EvoInteger[2] = 0
- For each (Integer EvoInteger[1]) from (EvoMaxUnits x (EvoInteger[0] - 1)) to (EvoMaxUnits x EvoInteger[0]), do (Actions)
- Schleifen - Aktionen
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- 'IF'-Bedingungen
- EvoTempBoolean[0] Gleich False
- (Clicked dialog button) Gleich EvoButton[EvoInteger[1]]
- 'THEN'-Aktionen
- Set EvoTempBoolean[0] = True
- Set EvoInteger[2] = (EvoInteger[1] / EvoInteger[0])
- -------- get the unit number by the clicked dialog button --------
- 'ELSE'-Aktionen
- Set EvoTempBoolean[0] = False
- -------- --------------------------------------- --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- 'IF'-Bedingungen
- EvoInteger[2] Gleich 0
- 'THEN'-Aktionen
- Skip remaining actions
- -------- this regionice if you have clicked on the exit button --------
- 'ELSE'-Aktionen
- -------- --------------------------------------- --------
- For each (Integer EvoInteger[1]) from 1 to EvoMaxUnits, do (Actions)
- Schleifen - Aktionen
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- 'IF'-Bedingungen
- EvoTempBoolean[0] Gleich False
- (Unit-type of EvoUnit[EvoInteger[0]]) Gleich EvoType[EvoInteger[1]]
- 'THEN'-Aktionen
- Set EvoTempBoolean[0] = True
- Set EvoInteger[3] = EvoInteger[1]
- -------- get the unit number ot the curent unit --------
- 'ELSE'-Aktionen
- Set EvoTempBoolean[0] = False
- -------- --------------------------------------- --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- 'IF'-Bedingungen
- PlayerEvolutionPoints[EvoInteger[0]] Größer gleich (EvoCost[EvoInteger[2]] - EvoCost[EvoInteger[3]])
- 'THEN'-Aktionen
- Set EvoTempReal[0] = (Percentage life of EvoUnit[EvoInteger[0]])
- Set EvoTempReal[1] = (Percentage mana of EvoUnit[EvoInteger[0]])
- Set EvoTempReal[2] = (Facing of EvoUnit[EvoInteger[0]])
- Einheit - Remove EvoUnit[EvoInteger[0]] from the game
- Set EvoLeakPoint = (Position of EvoUnit[EvoInteger[0]])
- Einheit - Create 1 EvoType[EvoInteger[2]] for (Player(EvoInteger[0])) at EvoLeakPoint facing EvoTempReal[2] degrees
- Einheit - Set life of (Last created unit) to EvoTempReal[0]%
- Einheit - Set mana of (Last created unit) to EvoTempReal[1]%
- -------- --------------------------------------- --------
- -------- create the new unit --------
- Spezialeffekt - Create a special effect at EvoLeakPoint using EvoMorphEffect
- Spezialeffekt - Destroy (Last created special effect)
- -------- --------------------------------------- --------
- Set EvoUnit[EvoInteger[0]] = (Last created unit)
- -------- --------------------------------------- --------
- Set PlayerEvolutionPoints[EvoInteger[0]] = (PlayerEvolutionPoints[EvoInteger[0]] - (EvoCost[EvoInteger[2]] - EvoCost[EvoInteger[3]]))
- -------- --------------------------------------- --------
- Custom script: call RemoveLocation(udg_EvoLeakPoint)
- 'ELSE'-Aktionen
- Custom script: call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"|cfffed312Not enough Evolution Points!|r")