[trigger=Bribe’s resource:]Damage Engine
Events
Game - UnitIndexEvent becomes Equal to 1.00
Game - UnitIndexEvent becomes Equal to 2.00
Conditions
Actions
-------- Copy the Cheat Death Ability from Object Editor into your map and set the following variable respectively: --------
Set DamageBlockingAbility = Unknown (A001)
-------- - --------
Set DamageTypeSpell = 1
Set DamageTypeDOT = 2
Set DamageTypeRanged = 3
-------- - --------
Custom script: call ExecuteFunc("InitDamageEvent")
Custom script: endfunction
Custom script:
Custom script: function DmgEvFilter takes nothing returns boolean
-------- - --------
-------- The next conditions let you filter out unwanted units. By default, units with Locust will not pass the check. --------
-------- - --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit is A structure) Equal to False
Then - Actions
Custom script: return true
Else - Actions
Custom script: return false
Custom script: endfunction
Custom script:
Custom script: function DmgEvRemoveAbilities takes nothing returns nothing
Custom script: local real r
Custom script: loop
Set DmgEvN = (DmgEvN - 1)
Custom script: set r = GetWidgetLife(udg_DmgEvStack[udg_DmgEvN])
Unit - Remove DamageBlockingAbility from DmgEvStack[DmgEvN]
Custom script: call SetWidgetLife(udg_DmgEvStack[udg_DmgEvN], r)
Set DmgEvStack[DmgEvN] = No unit
Custom script: exitwhen udg_DmgEvN == 0
Custom script: endloop
Custom script: endfunction
Custom script:
Custom script: function DmgEvSetVars takes nothing returns nothing
Set DamageEventAmount = (Damage taken)
Set DamageEventSource = (Damage source)
Set DamageEventTarget = (Triggering unit)
Custom script: endfunction
Custom script:
Custom script: function FireDmgEv takes nothing returns nothing
Custom script: local boolean b = GetUnitAbilityLevel(udg_DamageEventTarget, udg_DamageBlockingAbility) > 0
Custom script: local real life = 0
Custom script: local real pain = 0
Custom script: if b then
Custom script: set life = GetWidgetLife(udg_DamageEventTarget)
Unit - Remove DamageBlockingAbility from DamageEventTarget
Custom script: call SetWidgetLife(udg_DamageEventTarget, life)
Custom script: set pain = GetWidgetLife(udg_DamageEventTarget)
Custom script: endif
Set DamageEventPrevAmt = DamageEventAmount
Set DamageEventExplodesUnit = False
Set DamageEventOverride = False
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DamageEventAmount Equal to 0.00
Then - Actions
Set DamageEvent = 2.00
Else - Actions
Set DamageModifierEvent = 1.00
Set DamageEvent = 1.00
Custom script: if b then
Unit - Add DamageBlockingAbility to DamageEventTarget
Custom script: call SetWidgetLife(udg_DamageEventTarget, life + GetWidgetLife(udg_DamageEventTarget) - pain)
Custom script: endif
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DamageEventAmount Not equal to DamageEventPrevAmt
Then - Actions
Set DmgEvLife = ((Life of DamageEventTarget) + (DamageEventPrevAmt - DamageEventAmount))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DamageEventAmount Greater than DamageEventPrevAmt
Then - Actions
Unit - Set life of DamageEventTarget to (Max(0.41, DmgEvLife))
Custom script: if udg_DmgEvLife <= .405 then
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DamageEventExplodesUnit Equal to True
Then - Actions
Unit - Make DamageEventTarget Explode on death
Else - Actions
Trigger - Turn off DamageEventTrigger
Custom script: call UnitDamageTarget(udg_DamageEventSource, udg_DamageEventTarget, 999, false, false, null, null, null)
Trigger - Turn on DamageEventTrigger
Custom script: endif
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Max life of DamageEventTarget) Less than DmgEvLife
Then - Actions
Unit - Add DamageBlockingAbility to DamageEventTarget
Set DmgEvStack[DmgEvN] = DamageEventTarget
Set DmgEvN = (DmgEvN + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DmgEvN Equal to 1
Then - Actions
Custom script: call TimerStart(udg_DmgEvTimer, 0, false, function DmgEvRemoveAbilities)
Else - Actions
Else - Actions
Unit - Set life of DamageEventTarget to DmgEvLife
Else - Actions
Custom script: endfunction
Custom script:
Custom script: function FireRecursiveDmgEv takes nothing returns nothing
Custom script: local real d = udg_DamageEventAmount
Custom script: local unit s = udg_DamageEventSource
Custom script: local unit t = udg_DamageEventTarget
Custom script: local integer ptype = udg_DmgTypPrev
Custom script: local boolean explode = udg_DamageEventExplodesUnit
Custom script: local boolean override = udg_DamageEventOverride
Custom script: local real prev = udg_DamageEventPrevAmt
Custom script: call DmgEvSetVars()
Custom script: if udg_DamageEventTarget != t or udg_DamageEventSource != s or udg_DamageEventAmount != d or udg_DamageEventType != ptype then
Set DamageEvent = 0.00
Set DamageModifierEvent = 0.00
Custom script: call FireDmgEv()
-------- - --------
-------- Delete the next three lines to disable the in-game recursion crash warnings --------
-------- - --------
Custom script: else
Cinematic - Clear the screen of text messages for (All players)
Game - Display to (All players) for 999.00 seconds the text: WARNING: Recursion ...
-------- - --------
Custom script: endif
Custom script: set udg_DamageEventOverride = override
Custom script: set udg_DamageEventExplodesUnit = explode
Custom script: set udg_DamageEventPrevAmt = prev
Custom script: set udg_DmgTypPrev = ptype
Custom script: set udg_DamageEventAmount = d
Custom script: set udg_DamageEventSource = s
Custom script: set udg_DamageEventTarget = t
Custom script: set s = null
Custom script: set t = null
Custom script: endfunction
Custom script:
Custom script: function OnDmgEv takes nothing returns boolean
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DamageEvent Equal to 0.00
Then - Actions
Set DmgTypPrev = DamageEventType
Custom script: call DmgEvSetVars()
Custom script: call FireDmgEv()
Set DamageModifierEvent = 0.00
Set DamageEvent = 0.00
Set DamageEventType = 0
Else - Actions
Custom script: call FireRecursiveDmgEv()
Custom script: return false
Custom script: endfunction
Custom script:
Custom script: function CreateDmgEv takes nothing returns nothing
Custom script: set udg_DamageEventTrigger = CreateTrigger()
Custom script: call TriggerAddCondition(udg_DamageEventTrigger, Filter(function OnDmgEv))
Custom script: endfunction
Custom script:
Custom script: function SetupDmgEv takes nothing returns boolean
Custom script: local integer pdex = udg_UDex
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
UnitIndexEvent Equal to 1.00
Then - Actions
Set TempUnit = UDexUnits[UDex]
Custom script: if GetUnitAbilityLevel(udg_TempUnit, 'Aloc') == 0 and DmgEvFilter() then
Set UnitDamageRegistered[UDex] = True
Trigger - Add to DamageEventTrigger the event (Unit - TempUnit Takes damage)
Custom script: endif
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
UnitDamageRegistered[UDex] Equal to True
Then - Actions
Set UnitDamageRegistered[UDex] = False
Set DamageEventsWasted = (DamageEventsWasted + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DamageEventsWasted Equal to 15
Then - Actions
Set DamageEventsWasted = 0
Custom script: call DestroyTrigger(udg_DamageEventTrigger)
Custom script: call CreateDmgEv()
Set UDex = UDexNext[0]
Custom script: loop
Custom script: exitwhen udg_UDex == 0
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
UnitDamageRegistered[UDex] Equal to True
Then - Actions
Trigger - Add to DamageEventTrigger the event (Unit - UDexUnits[UDex] Takes damage)
Else - Actions
Set UDex = UDexNext[UDex]
Custom script: endloop
Custom script: set udg_UDex = pdex
Else - Actions
Else - Actions
Custom script: return false
Custom script: endfunction
Custom script:
Custom script: function InitDamageEvent takes nothing returns nothing
Custom script: call CreateDmgEv()
Custom script: call TriggerAddCondition(GetTriggeringTrigger(), Filter(function SetupDmgEv))
Set UnitIndexerEnabled = False
Custom script: set udg_TempUnit = CreateUnit(Player(15), 'uloc', 0, 0, 0)
Set UnitIndexerEnabled = True
Unit - Add DamageBlockingAbility to TempUnit
Unit - Remove TempUnit from the game
Countdown Timer - Start DmgEvTimer as a One-shot timer that will expire in 0.00 seconds
Trigger - Run (This trigger) (checking conditions) [/trigger] [trigger=Bribe’s Resource] Unit Indexer
Events
Map initialization
Conditions
Actions
Custom script: call ExecuteFunc("InitializeUnitIndexer")
Custom script: endfunction
Custom script:
Custom script: function ClearUnitIndex takes nothing returns nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Custom value of UDexUnits[UDex]) Equal to 0
Then - Actions
Set UnitIndexLock[UDex] = (UnitIndexLock[UDex] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
UnitIndexLock[UDex] Equal to 0
Then - Actions
Set UDexNext[UDexPrev[UDex]] = UDexNext[UDex]
Set UDexPrev[UDexNext[UDex]] = UDexPrev[UDex]
Set UDexPrev[UDex] = 0
Set UnitIndexEvent = 0.00
Set UnitIndexEvent = 2.00
Set UnitIndexEvent = 0.00
Set UDexUnits[UDex] = No unit
Set UDexNext[UDex] = UDexRecycle
Set UDexRecycle = UDex
Else - Actions
Else - Actions
Custom script: endfunction
Custom script:
Custom script: function IndexUnit takes nothing returns boolean
Custom script: local integer pdex = udg_UDex
Custom script: local integer ndex
-------- - --------
-------- You can customize the following block - if conditions are false the (Matching unit) won't be indexed. --------
-------- - --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
UnitIndexerEnabled Equal to True
(Custom value of (Matching unit)) Equal to 0
Then - Actions
Set UDexWasted = (UDexWasted + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
UDexWasted Equal to 15
Then - Actions
Set UDexWasted = 0
Set UDex = UDexNext[0]
Custom script: loop
Custom script: exitwhen udg_UDex == 0
Custom script: set ndex = udg_UDexNext[udg_UDex]
Custom script: call ClearUnitIndex()
Custom script: set udg_UDex = ndex
Custom script: endloop
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
UDexRecycle Equal to 0
Then - Actions
Set UDex = (UDexGen + 1)
Set UDexGen = UDex
Else - Actions
Set UDex = UDexRecycle
Set UDexRecycle = UDexNext[UDex]
Set UDexUnits[UDex] = (Matching unit)
Unit - Set the custom value of UDexUnits[UDex] to UDex
Set UDexPrev[UDexNext[0]] = UDex
Set UDexNext[UDex] = UDexNext[0]
Set UDexNext[0] = UDex
Set UnitIndexLock[UDex] = 1
Set UnitIndexEvent = 0.00
Set UnitIndexEvent = 1.00
Set UnitIndexEvent = 0.00
Custom script: set udg_UDex = pdex
Else - Actions
Custom script: return false
Custom script: endfunction
Custom script:
Custom script: function InitializeUnitIndexer takes nothing returns nothing
Custom script: local integer i = 16
Custom script: local boolexpr b = Filter(function IndexUnit)
Custom script: local region re = CreateRegion()
Custom script: local trigger t = GetTriggeringTrigger()
Custom script: local rect r = GetWorldBounds()
Custom script: call RegionAddRect(re, r)
Custom script: call TriggerRegisterEnterRegion(t, re, b)
Custom script: call TriggerClearActions(t)
Custom script: call TriggerAddAction(t, function ClearUnitIndex)
Set UnitIndexerEnabled = True
Custom script: loop
Custom script: set i = i - 1
Custom script: call GroupEnumUnitsOfPlayer(bj_lastCreatedGroup, Player(i), b)
Custom script: exitwhen i == 0
Custom script: endloop
Custom script: call RemoveRect(r)
Custom script: set re = null
Custom script: set r = null
Custom script: set t = null
Custom script: set b = null
Set UnitIndexEvent = 3.00
Set UnitIndexEvent = 0.00 [/trigger] [trigger=Losam’s resource] Example Setup
Events
Map initialization
Conditions
Actions
-------- If you want to see the floating text during the game check the following variable to true: --------
Set Regeneration_FloatingText = True
-------- The variable then it means that every second, the unit that is out of action recovering their points of health and / or mana. --------
Set Regeneration_Speed_Basic = 1.00
-------- A basic configuration for the example of regeneration: --------
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
-------- Custom value of the unit belonging to this group: --------
Set Regeneration_CVU = (Custom value of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Max mana of (Picked unit)) Greater than 0.00
Then - Actions
-------- The following Boolean used to determine that the unit has mana: --------
Set Regeneration_Mana[Regeneration_CVU] = True
-------- Number of regenerated health points: --------
Set Regeneration_Amount_HP[Regeneration_CVU] = (Real((Random integer number between 1 and 10)))
-------- Amount of mana regenerated points: --------
Set Regeneration_Amount_MP[Regeneration_CVU] = (Real((Random integer number between 1 and 10)))
Else - Actions
-------- Number of regenerated health points: --------
Set Regeneration_Amount_HP[Regeneration_CVU] = (Real((Random integer number between 1 and 10)))
Unit Group - Add (Picked unit) to Regeneration_Group_Loop
Trigger - Turn on Regeration loop <gen>
-------- Destroy the trigger to reduce the leg: --------
Custom script: call DestroyTrigger ( GetTriggeringTrigger()) [/trigger] [trigger= Losam’s resource] System damage taken
Events
Game - DamageEvent becomes Equal to 1.00
Conditions
DamageEventAmount Greater than or equal to 0.00
Actions
-------- This trigger is responsible for analyzing units that may or may not engage in combat if they are punished (by any form of punishment): --------
-------- Simply add the units of the group (CS Group) for the rest of the shares is done by Trigger "System". --------
-------- Note that the unit "Damage Source" is the unit that causes a punishment (no matter the form, but punished). --------
Unit Group - Add DamageEventSource to CS_Group
-------- Note that the unit "DamageTarget" is the drive that was punished (no matter how). --------
Unit Group - Add DamageEventTarget to CS_Group
-------- Do not forget to connect the Trigger (if not the system does not work). --------
Trigger - Run System <gen> (checking conditions)
-------- Do not confuse: CS_Group with CS_Group_Loop despite equal between them, the 1st serves to add to the combat units, the second (CS_Group_Loop) serves to take the combat units. = D -------- [/trigger]
[trigger=Losam’s resource’] System spell cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to (Ability being cast)
Actions
-------- Do not confuse: CS_Group with CS_Group_Loop despite semelhançe between them, the 1st serves to add to the combat units, the second (CS_Group_Loop) serves to take the combat units. = D --------
-------- This trigger is responsible for analyzing units that may or may not engage in combat if they are targets of spells. --------
-------- Source: --------
Set CS_Source = (Triggering unit)
-------- Target: --------
Set CS_Target = (Target unit of ability being cast)
-------- The following step analyzes the main function of this Trigger already mentioned: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_Target Equal to No unit
Then - Actions
-------- In case the condition above is false, it is not necessary to do some thing. --------
-------- If there is no target, no need to do anything. --------
Else - Actions
-------- If there is a target for the spell triggered: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(CS_Target belongs to an enemy of (Owner of CS_Source)) Equal to True
Then - Actions
Unit Group - Add CS_Source to CS_Group
Unit Group - Add CS_Target to CS_Group
Trigger - Run System <gen> (checking conditions)
-------- Do not forget to connect the Trigger (if not the system does not work). = D --------
Else - Actions
-------- If the target is friend: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(CS_Source is in CS_Group_Loop) Equal to True
(CS_Target is in CS_Group_Loop) Equal to True
Then - Actions
Unit Group - Add CS_Source to CS_Group
Unit Group - Add CS_Target to CS_Group
Trigger - Run System <gen> (checking conditions)
-------- Do not forget to connect the Trigger (if not the system does not work). = D --------
Else - Actions
-------- If in case any of the units involved (Target and Trigger) are not in combat, you do not need (and should not) do anything. --------
-------- In case the condition above is false, it is not necessary to do some thing. --------
-------- Once added to the group (CS Group), Unprovisions units: --------
Set CS_Source = No unit
Set CS_Target = No unit[/trigger]
[trigger=Losam’s resource] Regeration loop
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
-------- Pick all units in group (Regeneration_Group_Loop): --------
Unit Group - Pick every unit in Regeneration_Group_Loop and do (Actions)
Loop - Actions
-------- Custom value of the unit belonging to this group: --------
Set Regeneration_CVU = (Custom value of (Picked unit))
-------- Periodic functions: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Regeneration_Total[Regeneration_CVU] Equal to True
Then - Actions
-------- To avoid leaks: --------
Set Regeneration_Speed_X[Regeneration_CVU] = 0.00
Unit Group - Remove (Picked unit) from Regeneration_Group_Loop
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Regeneration_Group_Loop is empty) Equal to True
Then - Actions
-------- If there is no unit in combat or in group (Regeneration_Group_Loop), disconnect the trigger to reduce leg: --------
-------- If there is no unity in this group, turn the Trigger: --------
Trigger - Turn off (This trigger)
Else - Actions
-------- In case the condition above is false, it is not necessary to do some thing. --------
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
((Picked unit) is in CS_Group_Loop) Equal to True
((Picked unit) is dead) Equal to True
Then - Actions
-------- If above condition is true,set to false,the fallowing variable: --------
Set Regeneration_Total[Regeneration_CVU] = True
Else - Actions
-------- Effects periodicals: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Regeneration_Speed_X[Regeneration_CVU] Greater than or equal to Regeneration_Speed_Basic
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Regeneration_Mana[Regeneration_CVU] Equal to True
Then - Actions
-------- This section is regenerated for units that have mana, your health and mana (of course): --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Percentage life of (Picked unit)) Greater than or equal to 100.00
(Percentage mana of (Picked unit)) Greater than or equal to 100.00
Then - Actions
-------- If the percentage of health and mana unit equals 100% (ie all) is no longer necessary to recover the health and flowing this unit. --------
Set Regeneration_Total[Regeneration_CVU] = True
-------- Note that the above variable when determining whether or not the unit to recover health and / or mana. --------
Else - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + Regeneration_Amount_HP[Regeneration_CVU])
Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + Regeneration_Amount_MP[Regeneration_CVU])
-------- The two actions above recover health and mana unit. --------
-------- To view the health points and mana recovered: --------
-------- With these new functions in the creation of flotation texts, just the player on control of the unit that entered, is or he left combat that can see the flotation texts. (I thank Maker for the clue) --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_FloatingText Equal to True
Then - Actions
-------- Determine who is the player that is goes up the control of the caught unit: --------
Set CS_PlayerGroup = (Player group((Owner of (Picked unit))))
-------- Creating the flotation text: --------
Floating Text - Create floating text that reads ((|cff00FF00+ + ((String((Integer(Regeneration_Amount_HP[Regeneration_CVU])))) + |r/)) + (|cff00FFFF+ + (String((Integer(Regeneration_Amount_MP[Regeneration_CVU])))))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-------- Hide: --------
Floating Text - Hide (Last created floating text) for (All players)
-------- Show to CS_PlayerGroup: --------
Floating Text - Show (Last created floating text) for CS_PlayerGroup
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
-------- The actions above before the visualization of the flotation text for the player (CS_PLayerGroup) it is for passive removal of the text without leaks. --------
-------- Speaking in leaks, don't forget to remove these with the custom scripts to proceed: --------
Custom script: call DestroyForce(udg_CS_PlayerGroup)
Custom script: set udg_CS_PlayerGroup=null
Else - Actions
-------- In case the condition above is false, it is not necessary to do some thing. --------
Else - Actions
-------- Already this other section, only to units that only have health that will have their points reset: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Percentage life of (Picked unit)) Greater than or equal to 100.00
Then - Actions
-------- If the percentage of health of the drive amounts to 100% (ie all) is no longer necessary to recover the health of the unit. --------
Set Regeneration_Total[Regeneration_CVU] = True
-------- Note that the above variable when determining whether or not the unit to recover health and / or mana. --------
-------- With these new functions in the creation of flotation texts, just the player on control of the unit that entered, is or he left combat that can see the flotation texts. (I thank Maker for the clue) --------
Else - Actions
-------- With this action, the health unit is recovered: --------
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + Regeneration_Amount_HP[Regeneration_CVU])
-------- To view the health points recovered: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_FloatingText Equal to True
Then - Actions
-------- Determine who is the player that is goes up the control of the caught unit: --------
Set CS_PlayerGroup = (Player group((Owner of (Picked unit))))
-------- Creating the flotation text: --------
Floating Text - Create floating text that reads (|cff00FF00+ + (String((Integer(Regeneration_Amount_HP[Regeneration_CVU]))))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-------- Hide: --------
Floating Text - Hide (Last created floating text) for (All players)
-------- Show to CS_PlayerGroup: --------
Floating Text - Show (Last created floating text) for CS_PlayerGroup
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
-------- The actions above before the visualization of the flotation text for the player (CS_PLayerGroup) it is for passive removal of the text without leaks. --------
-------- Speaking in leaks, don't forget to remove these with the custom scripts to proceed: --------
Custom script: call DestroyForce(udg_CS_PlayerGroup)
Custom script: set udg_CS_PlayerGroup=null
Else - Actions
-------- In case the condition above is false, it is not necessary to do some thing. --------
-------- Make zero, the value of the variable below to the unit can recover points of health and / or mana: --------
Set Regeneration_Speed_X[Regeneration_CVU] = 0.00
Else - Actions
-------- Increases the variable's value by 0,05 every 0,05 second(s): --------
Set Regeneration_Speed_X[Regeneration_CVU] = (Regeneration_Speed_X[Regeneration_CVU] + 0.05)[/trigger]
[trigger=Losam’s resource] Regeration
Events
Conditions
Actions
-------- Pick all units in group (Regeneration_Group): --------
Unit Group - Pick every unit in Regeneration_Group and do (Actions)
Loop - Actions
-------- Custom value of the unit belonging to this group: --------
Set Regeneration_CVU = (Custom value of (Picked unit))
-------- Determine the following variable to false so that the unit can regenerate: --------
Set Regeneration_Total[Regeneration_CVU] = False
-------- Functions to add the unit to the regeneration group: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Regeneration_Group_Loop is empty) Equal to True
Then - Actions
-------- Add the unit to fallowing group: --------
Unit Group - Add (Picked unit) to Regeneration_Group_Loop
-------- Turn on this trigger: --------
Trigger - Turn on Regeration loop <gen>
-------- ======== --------
Else - Actions
-------- Add the unit to fallowing group: --------
Unit Group - Add (Picked unit) to Regeneration_Group_Loop
-------- After the settings, remove the drive this group to prevent leaks: --------
Unit Group - Remove (Picked unit) from Regeneration_Group[/trigger] [trigger=Losam’s resource] System setup
Events
Map initialization
Conditions
Actions
-------- If you want to see the floating text during the game check the following variable to true: --------
Set CS_FloatingText = True
-------- Stack: --------
Set CS_Stack = False
-------- Stack is to increase the duration that a certain unit has to leave from combat to every moment that this attacks. --------
-------- Time to leave the basic combat: --------
Set CS_Duration_Basic = 10.00
-------- The variable above (CS_Duration_Basic) equals ten seconds. --------
-------- Destroy the trigger to reduce the leg: --------
Custom script: call DestroyTrigger ( GetTriggeringTrigger())[/trigger]
[trigger=Losam’s resource] System loop
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
-------- Pick all units in group (CS_Group_Loop) --------
Unit Group - Pick every unit in CS_Group_Loop and do (Actions)
Loop - Actions
-------- Custom value of the unit belonging to this group: --------
Set CS_CVU = (Custom value of (Picked unit))
-------- Periodic functions: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_Duration_X[CS_CVU] Less than or equal to 0.00
Then - Actions
-------- If the above condition is true, it means that the unit came out of the fight. --------
-------- Floating texts: --------
-------- With these new functions in the creation of flotation texts, just the player on control of the unit that entered, is or he left combat that can see the flotation texts. (I thank Maker for the clue) --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_FloatingText Equal to True
Then - Actions
-------- Determine who is the player that is goes up the control of the caught unit: --------
Set CS_PlayerGroup = (Player group((Owner of (Picked unit))))
-------- Creating the flotation text: --------
Floating Text - Create floating text that reads |cffFF0000Leaving o... above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-------- Hide: --------
Floating Text - Hide (Last created floating text) for (All players)
-------- Show to CS_PlayerGroup: --------
Floating Text - Show (Last created floating text) for CS_PlayerGroup
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
-------- The actions above before the visualization of the flotation text for the player (CS_PLayerGroup) it is for passive removal of the text without leaks. --------
-------- Speaking in leaks, don't forget to remove these with the custom scripts to proceed: --------
Custom script: call DestroyForce(udg_CS_PlayerGroup)
Custom script: set udg_CS_PlayerGroup=null
Else - Actions
-------- In case the condition above is false, it is not necessary to do some thing. --------
-------- Add the unit to a group of regeneration: --------
Unit Group - Add (Picked unit) to Regeneration_Group
Trigger - Run Regeration <gen> (checking conditions)
-------- Connect the Trigger (Regen Loop): --------
-------- Remove the drive footprint combat group: --------
Unit Group - Remove (Picked unit) from CS_Group_Loop
-------- To turn off the trigger if there is no unit in combat: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(CS_Group_Loop is empty) Equal to True
Then - Actions
-------- If there is no unit in combat or in group (CS_Group_Loop), disconnect the trigger to reduce leg: --------
Trigger - Turn off (This trigger)
Else - Actions
-------- In case the condition above is false, it is not necessary to do some thing. --------
Else - Actions
-------- Effects periodicals: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is dead) Equal to True
Then - Actions
-------- If above condition is true,set to zero,the fallowing variable: --------
Set CS_Duration_X[CS_CVU] = 0.00
Else - Actions
-------- Decreases the value of variable (CS_Duration_X) by 0,05 every 0,05 seconds: --------
Set CS_Duration_X[CS_CVU] = (CS_Duration_X[CS_CVU] - 0.05)
-------- Floating texts: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_Text_Speed[CS_CVU] Greater than or equal to 1.00
Then - Actions
-------- With these new functions in the creation of flotation texts, just the player on control of the unit that entered, is or he left combat that can see the flotation texts. (I thank Maker for the clue) --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_FloatingText Equal to True
Then - Actions
-------- Determine who is the player that is goes up the control of the caught unit: --------
Set CS_PlayerGroup = (Player group((Owner of (Picked unit))))
-------- Creating the flotation text: --------
Floating Text - Create floating text that reads (|cffFF0000 + (String(((Integer(CS_Duration_X[CS_CVU])) + 1)))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-------- Hide: --------
Floating Text - Hide (Last created floating text) for (All players)
-------- Show to CS_PlayerGroup: --------
Floating Text - Show (Last created floating text) for CS_PlayerGroup
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
-------- The actions above before the visualization of the flotation text for the player (CS_PLayerGroup) it is for passive removal of the text without leaks. --------
-------- Speaking in leaks, don't forget to remove these with the custom scripts to proceed: --------
Custom script: call DestroyForce(udg_CS_PlayerGroup)
Custom script: set udg_CS_PlayerGroup=null
Else - Actions
-------- In case the condition above is false, it is not necessary to do some thing. --------
-------- For new texts appear: --------
Set CS_Text_Speed[CS_CVU] = 0.00
Else - Actions
-------- Increase the value of the variable below to the texts that appear floating: --------
Set CS_Text_Speed[CS_CVU] = (CS_Text_Speed[CS_CVU] + 0.05)[/trigger]
[trigger=Losam’s resource] System
Events
Conditions
Actions
-------- Pick all units in group (CS_Group): --------
Unit Group - Pick every unit in CS_Group and do (Actions)
Loop - Actions
-------- Custom value of the unit belonging to this group: --------
Set CS_CVU = (Custom value of (Picked unit))
-------- Functions to add the drive to combat: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is in CS_Group_Loop) Equal to True
Then - Actions
-------- If the unit's footprint already in combat: --------
-------- To determine the length of time the unit has to come out fighting: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_Stack Equal to True
Then - Actions
-------- In this section, every time you go into battle, leave it for the duration increases: --------
Set CS_Duration_X[CS_CVU] = (CS_Duration_X[CS_CVU] + CS_Duration_Basic)
Else - Actions
-------- In this section, every time you go into battle, the duration to exit it prevails the same length variable "CS_Duration_Basic." --------
Set CS_Duration_X[CS_CVU] = CS_Duration_Basic
Else - Actions
-------- If the unit is not in combat footprint: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(CS_Group_Loop is empty) Equal to True
Then - Actions
-------- Floating text: --------
-------- With these new functions in the creation of flotation texts, just the player on control of the unit that entered, is or he left combat that can see the flotation texts. (I thank Maker for the clue) --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_FloatingText Equal to True
Then - Actions
-------- Determine who is the player that is goes up the control of the caught unit: --------
Set CS_PlayerGroup = (Player group((Owner of (Picked unit))))
-------- Creating the flotation text: --------
Floating Text - Create floating text that reads |cffFF0000Entering ... above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-------- Hide: --------
Floating Text - Hide (Last created floating text) for (All players)
-------- Show to CS_PlayerGroup: --------
Floating Text - Show (Last created floating text) for CS_PlayerGroup
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
-------- The actions above before the visualization of the flotation text for the player (CS_PLayerGroup) it is for passive removal of the text without leaks. --------
-------- Speaking in leaks, don't forget to remove these with the custom scripts to proceed: --------
Custom script: call DestroyForce(udg_CS_PlayerGroup)
Custom script: set udg_CS_PlayerGroup=null
Else - Actions
-------- In case the condition above is false, it is not necessary to do some thing. --------
-------- To determine the length of time the unit has to come out fighting: --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_Stack Equal to True
Then - Actions
-------- In this section, every time you go into battle, leave it for the duration increases: --------
Set CS_Duration_X[CS_CVU] = (CS_Duration_X[CS_CVU] + CS_Duration_Basic)
Else - Actions
-------- In this section, every time you go into battle, the duration to exit it prevails the same length variable "CS_Duration_Basic." --------
Set CS_Duration_X[CS_CVU] = CS_Duration_Basic
-------- Add the unit below to the group: --------
Unit Group - Add (Picked unit) to CS_Group_Loop
-------- Turn on this trigger: --------
Trigger - Turn on System loop <gen>
-------- ======== --------
Else - Actions
-------- Floating text: --------
-------- With these new functions in the creation of flotation texts, just the player on control of the unit that entered, is or he left combat that can see the flotation texts. (I thank Maker for the clue) --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_FloatingText Equal to True
Then - Actions
-------- Determine who is the player that is goes up the control of the caught unit: --------
Set CS_PlayerGroup = (Player group((Owner of (Picked unit))))
-------- Creating the flotation text: --------
Floating Text - Create floating text that reads |cffFF0000Entering ... above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-------- Hide: --------
Floating Text - Hide (Last created floating text) for (All players)
-------- Show to CS_PlayerGroup: --------
Floating Text - Show (Last created floating text) for CS_PlayerGroup
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
-------- The actions above before the visualization of the flotation text for the player (CS_PLayerGroup) it is for passive removal of the text without leaks. --------
-------- Speaking in leaks, don't forget to remove these with the custom scripts to proceed: --------
Custom script: call DestroyForce(udg_CS_PlayerGroup)
Custom script: set udg_CS_PlayerGroup=null
Else - Actions
-------- In case the condition above is false, it is not necessary to do some thing. --------
-------- To determine the length of time the unit will have to come out fighting --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_Stack Equal to True
Then - Actions
-------- In this section, every time you go into battle, leave it for the duration increases: --------
Set CS_Duration_X[CS_CVU] = (CS_Duration_X[CS_CVU] + CS_Duration_Basic)
Else - Actions
-------- In this section, every time you go into battle, the duration to exit it prevails the same length variable "CS_Duration_Basic." --------
Set CS_Duration_X[CS_CVU] = CS_Duration_Basic
-------- Add the unit below to the group: --------
Unit Group - Add (Picked unit) to CS_Group_Loop
-------- After the settings, remove the drive this group to prevent leaks: --------
Unit Group - Remove (Picked unit) from CS_Group [/trigger]
[trigger=Losam’s resource] Test Setup
Events
Map initialization
Conditions
Actions
-------- Next, I am configuring the messages that are displayed during the game: --------
Set Test_Message[1] = Information - When a unit enters combat (on my system) this unit can not regenerate their points of health and / or mana.
Set Test_Message[2] = Information - For a unit engaged in combat is necessary to punish and / or help an allied unit already in combat.
Set Test_Message[3] = Information - To get out of combat, the unit must cease / stop punishing or helping an ally in combat.
Set Test_Message[4] = Information - When a unit dies, it automatically comes out fighting (why has no one to fight).
Set Test_Message[5] = (Information - If a unit is killed, she leaves combat, however, the unit that killed can only leave in + ((String((Integer(CS_Duration_Basic)))) + seconds or the length you want this skirt.))
Set Test_Message[6] = nformation - This combat system, and is ideal for focused ORPGS / RPGs, for that is very handy for strategy games.
Set Test_Message[7] = Information - For units that are in this map can regenerate your health and / or mana, preicos is that they are out of combat (it is valid to remember that this type of regeneration is passive and does not include skills / spells / auras ... )
Set Test_Message[8] = Information - The text flutantes Arabic numerals (1,2,3,4 ...) red color that is displayed when a unit enters combat is the duration that this unit has (in seconds) to get out of combat.
-------- Destroy the trigger to reduce the leg: --------
Custom script: call DestroyTrigger ( GetTriggeringTrigger())[/trigger]
[trigger=Losam’s resource] Game Text
Events
Game - DamageEvent becomes Equal to 1.00
Conditions
DamageEventAmount Greater than or equal to 0.00
Actions
-------- Trigger This serves to assist you during gameplay or test this feature (no need to copy this). --------
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 5
Then - Actions
-------- The following variable is used to display text with a random array aleartoria: --------
Set Test_X = (Random integer number between 1 and 8)
-------- Demonstrate the text messages to help you: --------
Game - Display to (Player group((Owner of DamageEventSource))) for 4.00 seconds the text: Test_Message[Test_X]
Else - Actions
-------- If the above conditions are false, it is not necessary to do anything. -------- [/trigger]