Combat system (v1.2)

This bundle is marked as approved. It works and satisfies the submission rules.
Note
[COLOR=”Red”]Before accomplishing the unloading of this map, please, read all of the information on this.
Besides, if it uses my work (in any way), feel credits for my work.[/COLOR]

Presentation
I designed this system because it's a great resource and employee by Blizzard on World of Warcraft (relax, have no knowledge if I explain it) and that would be very handy for ORPGS it creates a new environment for anyone who enjoys. Note that there is a similar system (but is not approved) here in HiveWorkShop - The Warcraft III Modding Site.

Characteristics
Version 1.2;
GUI/Triggers;
MUI;
Function
Manage fighting between any unit.
Explanation
Combat
When a threat unit, cancan spells or attacks any one unit (no matter what kind of punishment) or even help a unit that is coupled in combat, this unit enters combat (sort of confrontation or struggle) because of its action . With this, the units involved in combat tend to offend (attack, punish, injure ...), cast spells and defeat your opponent in battle. It was with this in mind, I drafted this system, because it allows utliza who manipulate the combat (which this unit have time to get out of combat, as she makes out ...)
Soon, my system allows you to determine what it takes to get into a fight and / or leave it, this is cool because you can create new ways for your map. One other form of enternder this system is as follows: suiponha attacks you physically / verbally a person, and estta, treats you the same way, why, you went into battle, and then, if they made peace out of combat. Simple, no?
Also, some people were left with questions about the texts flutantes that appear when a unit enters and / or leaves combat, relax, these texts indicate the time that these units are out of combat (do not worry!, More information during the game and the map).
Examples
Well, you can use this feature in any way, but do not be so blind as to firefight (brincadereinas part), see my exeplos:
Points
On my system, the units are qu map only god can recover health points (healt power / hp) and / or mana (mana power / mp) if they are out of combat and if your health and / or mana not match 100% health and / or mana this maximum.
Mounts
You can determine which units can use mounts out of combat (as used in World of Warcraft).
Abilities
You can build skills that can be used outside of combat (with a healing ability) or detroit combat (with an offensive skill).
Combat
To enter combat unit must punish (causing damage) and / or help a alido who is in combat (which is the case of my system). To see them in action, test this system by having a unit punish an ally and / or enemy.These are some examples of how you can use this feature on your map, but your creativity can expand it.
Triggers
[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]

Importing
For this system to work, you must copy the folder Requeriment (as the name sufere) it contains the work of the Bribe (Engine Damage and Unit indexer) are important because:
Damage Engine - Allows you to manage (identify, manipulate, edit ...) the damage caused by anything (drive, hex ...);
Unit Indexer - Besides being a requirement of the above work (Engine Damage) is required to identify which unit exits and / or enters combat);

So the folder requeriments is essential for this feature (I advise you to copy and paste this in your map first than Sysrem folder).
Also, you must copy the System folder that contains (of course) my appeal. This contains the ability to manage the combat between units.
If case you want to add to the combat units as in the case of the examples you have on my map (Points and Combat), you can copy the folder Examples. Already this folder contains the classical forms that unity can enter combat and a regeneration system of health points and / or mana.
Thanks
Firstly, I want to thank my lovely God, Jesus Christ and the Holy Spirit of God. For all he has done for us.
I can not forget the Blizzard Warcraft III and its recuros;
To all the HiveWorkShop - The Warcraft III Modding Site;
When moderator who evaluated my appeal;
Damage to bribe the Engine Indexer and Unit;
Maker;
And you! (Who gave me reputation opnion and participated in general)
Contact:
In case of anything (a doubt, criticism, suggestion ...) do not forget to send me there (Losam) via a message (preferably private) on this site and / or by email (Losam @ hotmail. com.br).
Hope you enjoy!

My resource:
[thread=224367]Stun System[/thread]
Keywords:
Lunatic's Warchief,Losam,Spells,System,Combat
Contents

Combat system (Map)

Reviews
Combat system v1.2 | Reviewed by Maker | 18th Feb 2013 APPROVED The system can be useful. It works as intended. The regeneration belongs to the system I suppose, so move it to the system folder. I found two bugs If a unit is regenerating...

Moderator

M

Moderator


Combat system v1.2 | Reviewed by Maker | 18th Feb 2013
APPROVED

The system can be useful. It works as intended. The regeneration belongs
to the system I suppose, so move it to the system folder.

I found two bugs
  • If a unit is regenerating mana but has full health, the floating
    text still shows the unit regenerates health
  • Sometimes the in combat timer seems to skip numbers, it
    shows 5 seconds left, then the next number is 3 for example.
[td]
[/td]


23:39, 2nd Jan 2013
Magtheridon96:

I'm not rejecting this, it's actually very, very well written, but I'm going to have to ask you to give it a better description, because not everyone plays WoW, so a lot of people don't really know what exactly it does.

From what I can see in the triggers, it detects In/Out-of-Combat events and regenerates units accordingly.

There are some anomalies (weird things) in your trigger setup.
The regeneration trigger appears to be called from within your main system trigger, but it's inside the Examples/Tests category.

I think writing up a description that tells users /exactly/ what this system does and organizing the triggers into better categories should be a good change.

I would then be able to review the code more accurately.
 
Level 11
Joined
Mar 27, 2011
Messages
293
Floating texts can be seen thorugh fog of war revealing the location of enemy units. Display the floating texts only to the owning player or player who have vision over the unit's position.

Remove the Do nothing functions.


Thank you for tip.
The action (Do nothing) has been removed, not just put it for viewing.
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
i made long ago similiar in my orpg template about unit combat in/out determine the mana/hp regen (at me regen in combat stat reduced to 1/4) but that was mpi (the regen not the combat stat systemm that was mui) and it was before i rewroted the whole item handleing :D

if i opened your map i see u use unit group, for check the unit who are in combat stat, i used unit array and 1 integer array for keep tracking the index, also i used 1 sec periodic trigger for regen (i told it only because ur solution also interesting), you have low periods, mixed with floating text and group this dont cause lagg if have 100 unit same time in attack (so not full hp) with regen or unit in combat state absolute dont have regen?


but overall u made a nice job :)
 
Top