TriggerThat doesnt answer my question. What do you need it for? Just eyecandy or are you using it for a trigger?
library UnitClassification initializer init
globals
integer array class
integer array creep
integer array hard
integer array boss
integer array ancient
constant integer ANCIENT = 4
constant integer BOSS = 3
constant integer HARD = 2
constant integer CREEP = 1
endglobals
private function setClass takes nothing returns boolean
local integer i
set i = 0
loop
exitwhen i == 3
if GetUnitTypeId(udg_UDexUnits[udg_UDex]) == creep[i] then
set class[GetUnitUserData(udg_UDexUnits[udg_UDex])] = CREEP
call DisplayTextToPlayer(Player(0), 0, 0, GetUnitName(udg_UDexUnits[udg_UDex]) + " has entered as a creep type unit!")
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen i == 2
if GetUnitTypeId(udg_UDexUnits[udg_UDex]) == hard[i] then
set class[GetUnitUserData(udg_UDexUnits[udg_UDex])] = HARD
call DisplayTextToPlayer(Player(0), 0, 0, GetUnitName(udg_UDexUnits[udg_UDex]) + " has entered as a hard type unit!")
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen i == 2
if GetUnitTypeId(udg_UDexUnits[udg_UDex]) == boss[i] then
set class[GetUnitUserData(udg_UDexUnits[udg_UDex])] = BOSS
call DisplayTextToPlayer(Player(0), 0, 0, GetUnitName(udg_UDexUnits[udg_UDex]) + " has entered as a boss type unit!")
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen i == 2
if GetUnitTypeId(udg_UDexUnits[udg_UDex]) == ancient[i] then
set class[GetUnitUserData(udg_UDexUnits[udg_UDex])] = ANCIENT
call DisplayTextToPlayer(Player(0), 0, 0, GetUnitName(udg_UDexUnits[udg_UDex]) + " has entered as a ancient type unit!")
endif
set i = i + 1
endloop
return false
endfunction
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterVariableEvent(t, "udg_UnitIndexEvent", EQUAL, 1.00)
call TriggerAddCondition(t, function setClass)
set t = null
set creep[0] = 'opeo'
set creep[1] = 'ogru'
set hard[0] = 'ohun'
set hard[1] = 'orai'
set boss[0] = 'otau'
set boss[1] = 'okod'
set ancient[0] = 'owyv'
set ancient[1] = 'otbr'
endfunction
endlibrary
library ChangeDamage initializer init
globals
string array PLAYER_COLOR
endglobals
private function mod takes nothing returns boolean
if class[GetUnitUserData(udg_DamageEventSource)] == CREEP then
set udg_DamageEventAmount = udg_DamageEventAmount * .85
elseif class[GetUnitUserData(udg_DamageEventSource)] == HARD then
set udg_DamageEventAmount = udg_DamageEventAmount * 1.05
elseif class[GetUnitUserData(udg_DamageEventSource)] == BOSS then
set udg_DamageEventAmount = udg_DamageEventAmount * 1.25
elseif class[GetUnitUserData(udg_DamageEventSource)] == ANCIENT then
set udg_DamageEventAmount = udg_DamageEventAmount * 1.45
endif
return false
endfunction
private function dmgText takes nothing returns boolean
if class[GetUnitUserData(udg_DamageEventSource)] == CREEP then
call ArcingTextTag.create(PLAYER_COLOR[GetPlayerId(GetOwningPlayer(udg_DamageEventSource))] + "CREEP: " + I2S(R2I(udg_DamageEventAmount)), udg_DamageEventTarget)
elseif class[GetUnitUserData(udg_DamageEventSource)] == HARD then
call ArcingTextTag.create(PLAYER_COLOR[GetPlayerId(GetOwningPlayer(udg_DamageEventSource))] + "HARD: " + I2S(R2I(udg_DamageEventAmount)), udg_DamageEventTarget)
elseif class[GetUnitUserData(udg_DamageEventSource)] == BOSS then
call ArcingTextTag.create(PLAYER_COLOR[GetPlayerId(GetOwningPlayer(udg_DamageEventSource))] + "BOSS: " + I2S(R2I(udg_DamageEventAmount)), udg_DamageEventTarget)
elseif class[GetUnitUserData(udg_DamageEventSource)] == ANCIENT then
call ArcingTextTag.create(PLAYER_COLOR[GetPlayerId(GetOwningPlayer(udg_DamageEventSource))] + "ANCIENT: " + I2S(R2I(udg_DamageEventAmount)), udg_DamageEventTarget)
endif
return false
endfunction
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
local trigger t2 = CreateTrigger()
call TriggerRegisterVariableEvent(t, "udg_DamageModifierEvent", EQUAL, 1.00)
call TriggerAddCondition(t, function mod)
call TriggerRegisterVariableEvent(t2, "udg_DamageEvent", EQUAL, 1.00)
call TriggerAddCondition(t2, function dmgText)
set PLAYER_COLOR[0] = "|c00FF0303"
set PLAYER_COLOR[1] = "|c000042FF"
set PLAYER_COLOR[2] = "|c001CE6B9"
set PLAYER_COLOR[3] = "|c00540081"
set PLAYER_COLOR[4] = "|c00FFFC01"
set PLAYER_COLOR[5] = "|c00fEBA0E"
set PLAYER_COLOR[6] = "|c0020C000"
set PLAYER_COLOR[7] = "|c00E55BB0"
set PLAYER_COLOR[8] = "|c00959697"
set PLAYER_COLOR[9] = "|c007EBFF1"
set PLAYER_COLOR[10] = "|c00106246"
set PLAYER_COLOR[11] = "|c004E2A04"
set t = null
set t2 = null
endfunction
endlibrary
library ChangeDamage initializer init
globals
string array PLAYER_COLOR
endglobals
//! textmacro class_mod takes CLASS, VALUE
if class[GetUnitUserData(udg_DamageEventSource)] == $CLASS$ then
set udg_DamageEventAmount = udg_DamageEventAmount * $VALUE$
endif
//! endtextmacro
//! textmacro class_dmgText takes CLASS
if class[GetUnitUserData(udg_DamageEventSource)] == $CLASS$ then
call ArcingTextTag.create(PLAYER_COLOR[GetPlayerId(GetOwningPlayer(udg_DamageEventSource))] + "$CLASS$: " + I2S(R2I(udg_DamageEventAmount)), udg_DamageEventTarget)
endif
//! endtextmacro
private function mod takes nothing returns boolean
//! runtextmacro class_mod("CREEP","0.85")
//! runtextmacro class_mod("HARD","1.05")
//! runtextmacro class_mod("BOSS","1.25")
//! runtextmacro class_mod("ANCIENT","1.45")
return false
endfunction
private function dmgText takes nothing returns boolean
//! runtextmacro class_dmgText("CREEP")
//! runtextmacro class_dmgText("HARD")
//! runtextmacro class_dmgText("BOSS")
//! runtextmacro class_dmgText("ANCIENT")
return false
endfunction
private function init takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterVariableEvent(trig, "udg_DamageModifierEvent", EQUAL, 1.00)
call TriggerAddCondition(trig, function mod)
set trig = CreateTrigger()
call TriggerRegisterVariableEvent(trig, "udg_DamageEvent", EQUAL, 1.00)
call TriggerAddCondition(trig, function dmgText)
set trig = null
set PLAYER_COLOR[0] = "|c00FF0303"
set PLAYER_COLOR[1] = "|c000042FF"
set PLAYER_COLOR[2] = "|c001CE6B9"
set PLAYER_COLOR[3] = "|c00540081"
set PLAYER_COLOR[4] = "|c00FFFC01"
set PLAYER_COLOR[5] = "|c00fEBA0E"
set PLAYER_COLOR[6] = "|c0020C000"
set PLAYER_COLOR[7] = "|c00E55BB0"
set PLAYER_COLOR[8] = "|c00959697"
set PLAYER_COLOR[9] = "|c007EBFF1"
set PLAYER_COLOR[10] = "|c00106246"
set PLAYER_COLOR[11] = "|c004E2A04"
endfunction
endlibrary