Name | Type | is_array | initial_value |
BlueTeam | force | No | |
Circle1 | timer | No | |
Circle2 | timer | No | |
Circle3 | timer | No | |
ControlleurCircle1 | integer | No | 0 |
ControlleurCircle2 | integer | No | 0 |
ControlleurCircle3 | integer | No | 0 |
Panneauscore | leaderboard | No | |
Player1 | unit | No | |
Player10 | unit | No | |
Player11 | unit | No | |
Player12 | unit | No | |
Player2 | unit | No | |
Player3 | unit | No | |
Player4 | unit | No | |
Player5 | unit | No | |
Player6 | unit | No | |
Player7 | unit | No | |
Player8 | unit | No | |
Player9 | unit | No | |
RedTeam | force | No | |
ScoreTeam1 | integer | No | 0 |
ScoreTeam2 | integer | No | 0 |
//##Start##
constant function HeroGlow_SpellId takes nothing returns integer
return 'A017'
endfunction
//============================================================================================================
function HeroGlow_Do takes nothing returns nothing
call DestroyTimer(GetExpiredTimer())
call SetUnitColor( bj_ghoul[100], GetPlayerColor(GetOwningPlayer(bj_ghoul[100])))
endfunction
function HeroGlow_Control takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer t
local integer i
local eventid e
if GetWidgetLife(u)<1 then
loop
exitwhen GetWidgetLife(u)>=1
if GetUnitState(u,UNIT_STATE_MAX_LIFE)==0 then
call ResetTrigger(GetTriggeringTrigger())
call DestroyTrigger(GetTriggeringTrigger())
set u=null
return
endif
call TriggerSleepAction(0)
endloop
return
endif
set e=GetTriggerEventId()
if e==EVENT_UNIT_SPELL_ENDCAST then
set i=GetUnitTypeId(u)
call SetUnitColor( u, GetPlayerColor(GetOwningPlayer(u)))
elseif e==EVENT_UNIT_SPELL_EFFECT then
set t=GetUnitTypeId(u)
set i=GetTriggerExecCount(GetTriggeringTrigger() )
loop
exitwhen GetTriggerExecCount( GetTriggeringTrigger() ) > i
call TriggerSleepAction(0)
endloop
if t!=GetUnitTypeId(u) and GetUnitState(u,UNIT_STATE_MAX_LIFE)!=0 then
set t=GetUnitTypeId(u)
loop
exitwhen GetUnitTypeId(u)!=t
call TriggerSleepAction(0)
endloop
call SetUnitColor( u, GetPlayerColor(GetOwningPlayer(u)))
endif
else
set bj_ghoul[100]=u
call TimerStart( CreateTimer(),0,false, function HeroGlow_Do)
endif
set u=null
set e=null
endfunction
function StartHeroGlow takes unit u returns nothing
local trigger t=CreateTrigger()
call SetUnitColor( u, GetPlayerColor(GetOwningPlayer(u)))
call TriggerRegisterUnitStateEvent(t,u,UNIT_STATE_LIFE,LESS_THAN,1)
call TriggerRegisterUnitStateEvent(t,u,UNIT_STATE_LIFE,GREATER_THAN_OR_EQUAL,1)
call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_SPELL_ENDCAST)
call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_SPELL_EFFECT)
call TriggerAddAction(t,function HeroGlow_Control)
set t=null
endfunction
function HeroGlowEnter_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
if GetUnitAbilityLevel(u,HeroGlow_SpellId())>0 then
call StartHeroGlow(u)
endif
set u=null
endfunction
//===========================================================================
function InitTrig_Hero_Glow takes nothing returns nothing
local group g=CreateGroup()
local unit u
call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if GetUnitAbilityLevel(u,HeroGlow_SpellId())>0 then
call StartHeroGlow(u)
endif
call GroupRemoveUnit(g,u)
endloop
set gg_trg_Hero_Glow = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_Glow, bj_mapInitialPlayableArea )
call TriggerAddAction( gg_trg_Hero_Glow, function HeroGlowEnter_Actions )
call DestroyGroup(g)
set g=null
set u=null
endfunction
//##End## :
function GetSiphonGoldCache takes nothing returns gamecache
return gg_trg_Siphon_Gold
return null
endfunction
function Initialize_SiphonGold_Variables takes nothing returns nothing
local gamecache g = GetSiphonGoldCache()
local integer array gold
local integer SiphonGoldAbility = 'A01A'
set gold[1] = 20 // Level 1 this value is per second
set gold[2] = 80 // Level 2 this value is per second
set gold[3] = 120 // Level 3 this value is per second
call StoreIntegerBJ( SiphonGoldAbility, "Ability", "Ability", g )
call StoreIntegerBJ( gold[1], "Level1", "Gold", g )
call StoreIntegerBJ( gold[2], "Level2", "Gold", g )
call StoreIntegerBJ( gold[3], "Level3", "Gold", g )
endfunction
function SiphonGoldAbility takes nothing returns integer
return GetStoredInteger(GetSiphonGoldCache(), "Ability", "Ability")
endfunction
function SiphonGoldGameCache2Trigger takes gamecache g returns trigger
return g
return null
endfunction
function SiphonGoldHandle2Integer takes handle h returns integer
return h
return 0
endfunction
function SiphonGoldInteger2Effect takes integer i returns effect
return i
return null
endfunction
function SiphonGoldInteger2Unit takes integer i returns unit
return i
return null
endfunction
function SiphonGoldInteger2Timer takes integer i returns timer
return i
return null
endfunction
function SiphonGoldInteger2Trigger takes integer i returns trigger
return i
return null
endfunction
function SiphonGoldInteger2TextTag takes integer i returns texttag
return i
return null
endfunction
function Trig_Siphon_Gold_Floating takes nothing returns nothing
local gamecache g = GetSiphonGoldCache()
local texttag text1 = SiphonGoldInteger2TextTag( GetStoredInteger(g, I2S(SiphonGoldHandle2Integer(GetExpiredTimer())), "text1") )
local texttag text2 = SiphonGoldInteger2TextTag( GetStoredInteger(g, I2S(SiphonGoldHandle2Integer(GetExpiredTimer())), "text2") )
local integer transp = GetStoredInteger(g, I2S(SiphonGoldHandle2Integer(GetExpiredTimer())), "transp")
if (transp < 100) then
set transp = transp + 5
call SetTextTagColorBJ( text1, 100, 100, 0.00, transp )
call SetTextTagColorBJ( text2, 100, 100, 0.00, transp )
call StoreIntegerBJ( transp, "transp", I2S(SiphonGoldHandle2Integer(GetExpiredTimer())), g )
else
call DestroyTextTag(text1)
call DestroyTextTag(text2)
call DestroyTimer(GetExpiredTimer())
call DestroyTrigger(GetTriggeringTrigger())
endif
endfunction
function Trig_Siphon_Gold_Timer takes nothing returns nothing
local gamecache g = GetSiphonGoldCache()
local unit caster = SiphonGoldInteger2Unit( GetStoredInteger(g, I2S(SiphonGoldHandle2Integer(GetExpiredTimer())), "caster") )
local unit target = SiphonGoldInteger2Unit( GetStoredInteger(g, I2S(SiphonGoldHandle2Integer(GetExpiredTimer())), "target") )
local integer max = GetStoredInteger(g, I2S(SiphonGoldHandle2Integer(GetExpiredTimer())), "max")
local integer floating = GetStoredInteger(g, I2S(SiphonGoldHandle2Integer(GetExpiredTimer())), "counter")
local integer on = GetStoredInteger(g, I2S(SiphonGoldHandle2Integer(caster)), "on")
local integer floatgold = 0
local trigger t
local timer c
if (on == 0) then
if (floating > 1) then
set floatgold = floating*2
call StoreIntegerBJ( 0, "counter", I2S(SiphonGoldHandle2Integer(GetExpiredTimer())), g )
endif
call DestroyEffect( SiphonGoldInteger2Effect( GetStoredInteger(g, I2S(SiphonGoldHandle2Integer(caster)), "Effect1") ) )
call DestroyEffect( SiphonGoldInteger2Effect( GetStoredInteger(g, I2S(SiphonGoldHandle2Integer(caster)), "Effect2") ) )
call DestroyTimer( SiphonGoldInteger2Timer( GetStoredInteger(g, I2S(SiphonGoldHandle2Integer(caster)), "timer") ) )
call DestroyTrigger( SiphonGoldInteger2Trigger( GetStoredInteger(g, I2S(SiphonGoldHandle2Integer(caster)), "trigger") ) )
else
if ( GetPlayerState(GetOwningPlayer(target), PLAYER_STATE_RESOURCE_GOLD) > 1 ) then
call AdjustPlayerStateBJ( 2, GetOwningPlayer(caster), PLAYER_STATE_RESOURCE_GOLD )
call AdjustPlayerStateBJ( -2, GetOwningPlayer(target), PLAYER_STATE_RESOURCE_GOLD )
if (floating == (max/4)) then
set floatgold = max*2/4
set floating = 0
endif
call StoreIntegerBJ( floating + 1, "counter", I2S(SiphonGoldHandle2Integer(GetExpiredTimer())), g )
elseif (floating > 1) then
set floatgold = (floating-1)*2
call StoreIntegerBJ( 0, "counter", I2S(SiphonGoldHandle2Integer(GetExpiredTimer())), g )
endif
endif
if (floatgold > 0) then
set t = CreateTrigger( )
set c = CreateTimer()
call TriggerRegisterTimerExpireEventBJ( t, c )
call TriggerAddAction( t, function Trig_Siphon_Gold_Floating )
call StartTimerBJ( c, true, 0.07 )
call CreateTextTagUnitBJ( "+" + I2S(floatgold), caster, 0, 10, 100, 100, 100, 0 )
call SetTextTagColorBJ( GetLastCreatedTextTag(), 100, 100, 0.00, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 100, 90 )
call StoreIntegerBJ( SiphonGoldHandle2Integer(GetLastCreatedTextTag()), "text1", I2S(SiphonGoldHandle2Integer(c)), g )
call CreateTextTagUnitBJ( "-" + I2S(floatgold), target, 0, 10, 100, 100, 100, 0 )
call SetTextTagColorBJ( GetLastCreatedTextTag(), 100, 100, 0.00, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 100, 90 )
call StoreIntegerBJ( SiphonGoldHandle2Integer(GetLastCreatedTextTag()), "text2", I2S(SiphonGoldHandle2Integer(c)), g )
call StoreIntegerBJ( 0, "transp", I2S(SiphonGoldHandle2Integer(c)), g )
endif
endfunction
function Trig_Siphon_Gold_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == SiphonGoldAbility() )
endfunction
function Trig_Siphon_Gold_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local effect e
local gamecache g = GetSiphonGoldCache()
local trigger t = CreateTrigger( )
local timer c = CreateTimer()
local integer level = GetUnitAbilityLevelSwapped(SiphonGoldAbility(), caster)
set e = AddSpecialEffectTarget("war3mapImported\\goldout.mdx",GetSpellTargetUnit(),"origin")
call StoreIntegerBJ( SiphonGoldHandle2Integer(e), "Effect1", I2S(SiphonGoldHandle2Integer(caster)), g )
set e = AddSpecialEffectTarget("war3mapImported\\goldin.mdx",caster,"origin")
call StoreIntegerBJ( SiphonGoldHandle2Integer(e), "Effect2", I2S(SiphonGoldHandle2Integer(caster)), g )
call TriggerRegisterTimerExpireEventBJ( t, c )
call TriggerAddAction( t, function Trig_Siphon_Gold_Timer )
call StoreIntegerBJ( 1, "on", I2S(SiphonGoldHandle2Integer(caster)), g )
call StoreIntegerBJ( SiphonGoldHandle2Integer(c), "timer", I2S(SiphonGoldHandle2Integer(caster)), g )
call StoreIntegerBJ( SiphonGoldHandle2Integer(t), "trigger", I2S(SiphonGoldHandle2Integer(caster)), g )
call StoreIntegerBJ( SiphonGoldHandle2Integer(GetSpellTargetUnit()), "target", I2S(SiphonGoldHandle2Integer(c)), g )
call StoreIntegerBJ( SiphonGoldHandle2Integer(caster), "caster", I2S(SiphonGoldHandle2Integer(c)), g )
call StoreIntegerBJ( 1, "counter", I2S(SiphonGoldHandle2Integer(c)), g )
call StoreIntegerBJ( GetStoredInteger(g, "Gold", "Level" + I2S(level)), "max", I2S(SiphonGoldHandle2Integer(c)), g )
call StartTimerBJ( c, true, (I2R(2) / I2R(GetStoredInteger(g, "Gold", "Level" + I2S(level)) )) )
endfunction
function Trig_Siphon_Gold_End_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local effect e
local gamecache g = GetSiphonGoldCache()
call StoreIntegerBJ( 0, "on", I2S(SiphonGoldHandle2Integer(caster)), g )
endfunction
//===========================================================================
function InitTrig_Siphon_Gold takes nothing returns nothing
local integer i = 0
local trigger t1 = CreateTrigger( )
local trigger t2 = CreateTrigger( )
local trigger g = CreateTrigger( )
set gg_trg_Siphon_Gold = SiphonGoldGameCache2Trigger(InitGameCache( "SiphonGold.w3v" ))
call Initialize_SiphonGold_Variables()
loop
exitwhen i > 11
if ( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call TriggerRegisterPlayerUnitEventSimple( t1, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( t2, Player(i), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
endif
set i = i + 1
endloop
call TriggerAddCondition( t1, Condition( function Trig_Siphon_Gold_Conditions ) )
call TriggerAddAction( t1, function Trig_Siphon_Gold_Actions )
call TriggerAddCondition( t2, Condition( function Trig_Siphon_Gold_Conditions ) )
call TriggerAddAction( t2, function Trig_Siphon_Gold_End_Actions )
endfunction