//*********************************************************************************************
//*
//* Handle Variables
//*
//*********************************************************************************************
//=============================================================================================
// Return Bug Exploiters
//=============================================================================================
function HandleVars_GetInt takes handle h returns integer
return h
return 0
endfunction
//=============================================================================================
function LocalVars takes nothing returns gamecache
return InitGameCache("jasslocalvars.w3v")
endfunction
function SetHandleHandle takes handle subject, string name, handle value returns nothing
if value==null then
call FlushStoredInteger(LocalVars(),I2S(HandleVars_GetInt(subject)),name)
else
call StoreInteger(LocalVars(), I2S(HandleVars_GetInt(subject)), name, HandleVars_GetInt(value) )
endif
endfunction
function SetHandleInt takes handle subject, string name, integer value returns nothing
if value==0 then
call FlushStoredInteger(LocalVars(),I2S(HandleVars_GetInt(subject)),name)
else
call StoreInteger(LocalVars(), I2S(HandleVars_GetInt(subject)), name, value)
endif
endfunction
function SetHandleReal takes handle subject, string name, real value returns nothing
if value==0 then
call FlushStoredReal(LocalVars(), I2S(HandleVars_GetInt(subject)), name)
else
call StoreReal(LocalVars(), I2S(HandleVars_GetInt(subject)), name, value)
endif
endfunction
function GetHandleHandle takes handle subject, string name returns handle
return GetStoredInteger(LocalVars(), I2S(HandleVars_GetInt(subject)), name)
return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
return GetStoredInteger(LocalVars(), I2S(HandleVars_GetInt(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
return GetStoredReal(LocalVars(), I2S(HandleVars_GetInt(subject)), name)
endfunction
function FlushHandleLocals takes handle subject returns nothing
call FlushStoredMission(LocalVars(), I2S(HandleVars_GetInt(subject)) )
endfunction
function PylonCondition takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'hhou' )
endfunction
//##Start##
//==================================================================================================
function PoolClass takes nothing returns gamecache
return InitGameCache( "pool.vx")
endfunction
//===================================================================================
function PoolGetItem takes integer poolid, integer itemn returns integer
return GetStoredInteger( PoolClass(), I2S(poolid), I2S(itemn))
endfunction
//===================================================================================
function CountItemsInPool takes integer poolid returns integer
return GetStoredInteger( PoolClass(), I2S(poolid), "n")
endfunction
//===================================================================================
function GetEnumPoolItem takes nothing returns integer
return GetStoredInteger( PoolClass(), "Class", "Enum")
endfunction
//===================================================================================
function ForPool takes integer poolid, code callback returns nothing
local trigger t=CreateTrigger()
local integer a=1
local integer n=CountItemsInPool( poolid)
local gamecache pc=PoolClass()
call TriggerAddAction( t, callback)
call TriggerWaitOnSleeps( t, true)
loop
exitwhen a>n
call StoreInteger( pc, "Class", "Enum", PoolGetItem( poolid, a))
call TriggerExecute(t)
set a=a+1
endloop
call FlushStoredInteger( pc, "Class", "Enum")
call DestroyTrigger( t)
set t=null
set pc=null
endfunction
//===================================================================================
// Uses a the function's name instead of a code argumment, it is better than ForPool
// because ForPool Creates Triggers to run the callback
//
function ForPool2 takes integer poolid, string callbackfuncname returns nothing
local integer a=1
local integer n=CountItemsInPool( poolid)
local gamecache pc=PoolClass()
loop
exitwhen a>n
call StoreInteger( pc, "Class", "Enum", PoolGetItem( poolid, a))
call ExecuteFunc(callbackfuncname)
set a=a+1
endloop
set pc=null
endfunction
//===================================================================================
function GetFirstOfPool takes integer poolid returns integer
return GetStoredInteger( PoolClass(), I2S(poolid), "1")
endfunction
//===================================================================================
function PoolPickRandomItem takes integer poolid returns integer
return GetStoredInteger( PoolClass(), I2S(poolid), I2S( GetRandomInt( 1, GetStoredInteger( PoolClass(), I2S(poolid), "n" ) ) ))
endfunction
//===================================================================================
function GetItemPositionInPool takes integer poolid, integer it returns integer
return GetStoredInteger( PoolClass(), I2S(poolid), "i"+I2S(it))
endfunction
//===================================================================================
function IsItemInPool takes integer poolid, integer it returns boolean
return GetItemPositionInPool( poolid, it) != 0
endfunction
//===================================================================================
function PoolAddItem takes integer poolid, integer value returns nothing
local integer n
local gamecache pc=PoolClass()
if not IsItemInPool( poolid, value) then
set n=GetStoredInteger( pc, I2S(poolid), "n") + 1
call StoreInteger( pc, I2S(poolid), "n", n)
call StoreInteger( pc, I2S(poolid), I2S(n), value)
call StoreInteger( pc, I2S(poolid) , "i"+I2S(value), n )
endif
set pc=null
endfunction
//===================================================================================
function PoolRemoveItem takes integer poolid, integer value returns nothing
local integer p=GetItemPositionInPool( poolid, value)
local integer n=GetStoredInteger( PoolClass(), I2S(poolid), "n")
local gamecache pc=PoolClass()
if p!=0 then
call FlushStoredInteger( pc, I2S(poolid), I2S(p))
call FlushStoredInteger( pc, I2S(poolid), "i"+I2S(value))
if n > p then
call StoreInteger( pc, I2S(poolid), I2S(p), GetStoredInteger( pc, I2S(poolid), I2S(n)))
call StoreInteger( pc, I2S(poolid), "i"+I2S( GetStoredInteger( pc, I2S(poolid), I2S(n))), p)
call FlushStoredInteger( pc, I2S(poolid), I2S(n))
endif
call StoreInteger( pc, I2S(poolid), "n", n - 1)
endif
set pc=null
endfunction
//===================================================================================
function PoolAddPool takes integer sourcepoolid, integer destpoolid returns nothing
local integer a=1
local integer n=CountItemsInPool( sourcepoolid)
loop
exitwhen a>n
call PoolAddItem( destpoolid, PoolGetItem( sourcepoolid, a))
set a=a+1
endloop
endfunction
//===================================================================================
function PoolRemovePool takes integer sourcepoolid, integer destpoolid returns nothing
local integer a=1
local integer n=CountItemsInPool( sourcepoolid)
loop
exitwhen a>n
call PoolRemoveItem( destpoolid, PoolGetItem( sourcepoolid, a))
set a=a+1
endloop
endfunction
//===================================================================================
function DestroyPool takes integer poolid returns nothing
call FlushStoredMission( PoolClass(), I2S(poolid))
endfunction
//===================================================================================
function CreatePool takes nothing returns integer
local integer N=GetStoredInteger( PoolClass(), "Class", "N") + 1
call StoreInteger( PoolClass(), "Class", "N", N)
return N
endfunction
//===================================================================================
// Converts a tokenized string into a pool,
// Example: S2Pool( "1;2;3;4") will return a pool that has 1,2,3 and 4 inside
//===================================================================================
function S2Pool takes string s returns integer
local integer spool= CreatePool()
local string current=""
local integer i=0
set s=s+";"
loop
exitwhen SubString(s, i, i+1) == "" or SubString(s, i, i+1) == null
if SubString(s, i, i+1) == ";" then
call PoolAddItem( spool, S2I(current))
set current=""
else
set current=current+SubString(s, i, i+1)
endif
set i=i+1
endloop
return spool
endfunction
//##End##
Name | Type | is_array | initial_value |
FoodTemp | real | Yes |
//***************************************************************************************************
//* *
//* Passive Mana Shield (Unit) *
//* *
//* Requires: *
//* - The Handle Variables Functions (See this map Custom Script Section) *
//* - The Passive Mana Shield Ability *
//* - This Trigger (make sure the Configuration Section is pointing *
//* to the right ability rawcodes) *
//* *
//* Note: The spell's target art can be changed with the object editor *
//* *
//***************************************************************************************************
//===================================================================================================
// Passive Mana Shield Spell Configuration:
//
constant function UnitPermanentManaShield_AbilityId takes nothing returns integer
return 'A00E' //// The ability's Rawcode (chages between maps)
endfunction
constant function UnitPermanentManaShield_MaxHP takes integer level returns real
return 0.00+level*0.00 //// Mana shield won't work if the unit has more hitpoints than this,
//// leave 0.00 here if you want manashield to always work
endfunction
constant function UnitPermanentManaShield_BufferMana takes integer level returns real
return 0.00+level*0.00 //// Mana shield won't work if the hero has less mana than this value
endfunction
constant function UnitPermanentManaShield_HPperMana takes integer level returns real
return 0.00+level*1.00 //// How much HP is blocked per mana point
endfunction
//===================================================================================================
function SetLifeDelayed_GetUnit takes timer t returns widget
return GetHandleHandle(t, "u")
endfunction
function SetLifeDelayed_child takes nothing returns nothing
local timer t=GetExpiredTimer()
call SetWidgetLife( SetLifeDelayed_GetUnit(t), GetHandleReal( t, "life"))
call FlushHandleLocals(t)
call DestroyTimer(t)
set t=null
endfunction
function SetLifeDelayed takes widget u, real life returns nothing
local timer t=CreateTimer()
call SetHandleHandle( t, "u", u)
call SetHandleReal( t, "life", life)
call TimerStart( t, 0, false, function SetLifeDelayed_child)
endfunction
function UnitPermanentManaShield_GetActions takes trigger t returns triggeraction
return GetHandleHandle( t, "actions")
endfunction
function Trig_UnitPermanentManaShield_BlockDamage takes nothing returns nothing
local unit u=GetTriggerUnit()
local real a
local integer l=GetUnitAbilityLevel(u, UnitPermanentManaShield_AbilityId() )
if GetTriggerEventId() == EVENT_UNIT_DEATH then
// This is to avoid trigger/event leaks, each unit has a trigger for it, and if a unit dies
// I'll have to wait till it is removed, (a good way to know that a unit no longer exists
// Is checking its Maximum life ), I could just destroy trigger once the unit dies, but
// Spells like ressurection would mess this.
loop
if GetUnitState( u, UNIT_STATE_MAX_LIFE) == 0 then
call TriggerRemoveAction( GetTriggeringTrigger(), UnitPermanentManaShield_GetActions(GetTriggeringTrigger()) )
call DestroyTrigger( GetTriggeringTrigger() )
set u=null
return
endif
call TriggerSleepAction(5)
exitwhen GetWidgetLife(u) > 0
endloop
elseif l <= 0 then
call DestroyTrigger( GetTriggeringTrigger())
else
if UnitPermanentManaShield_MaxHP(l) != 0 then
set a=RMinBJ( UnitPermanentManaShield_MaxHP(l)-( GetWidgetLife(u) - GetEventDamage() ), ( GetUnitState(u,UNIT_STATE_MANA) - UnitPermanentManaShield_BufferMana(l) )* UnitPermanentManaShield_HPperMana(l))
else
set a=RMinBJ( GetEventDamage(),( GetUnitState(u,UNIT_STATE_MANA) - UnitPermanentManaShield_BufferMana(l) )* UnitPermanentManaShield_HPperMana(l) )
endif
if a>0 then
call SetUnitManaBJ( u, GetUnitState(u,UNIT_STATE_MANA) - a/UnitPermanentManaShield_HPperMana(l))
call SetLifeDelayed( u, (GetWidgetLife(u)-GetEventDamage())+a )
if GetUnitState(u,UNIT_STATE_MANA) >= UnitPermanentManaShield_BufferMana(l)+1 then
call DestroyEffect( AddSpellEffectTargetById( UnitPermanentManaShield_AbilityId(), EFFECT_TYPE_TARGET, u, "chest" ) )
endif
endif
endif
set u=null
endfunction
function UnitPermanentManaShield_Start takes unit u returns nothing
local trigger dmg=CreateTrigger()
call TriggerRegisterUnitEvent( dmg, u, EVENT_UNIT_DAMAGED )
call TriggerRegisterUnitEvent( dmg, u, EVENT_UNIT_DEATH )
call SetHandleHandle( dmg, "actions", TriggerAddAction( dmg, function Trig_UnitPermanentManaShield_BlockDamage ) )
set u=null
set dmg=null
endfunction
function Trig_UnitPermanentManaShield_Actions takes nothing returns nothing
if GetUnitAbilityLevel( GetTriggerUnit(), UnitPermanentManaShield_AbilityId() ) > 0 then
call UnitPermanentManaShield_Start(GetTriggerUnit() )
endif
endfunction
//===================================================================================================
function UnitPermanentManaShield_Filter takes nothing returns boolean
if GetUnitAbilityLevel( GetFilterUnit() , UnitPermanentManaShield_AbilityId() ) >0 then
call UnitPermanentManaShield_Start( GetFilterUnit() )
endif
return false
endfunction
function Trig_UnitPermanentManaShield_InitEnum takes nothing returns nothing
local group g=CreateGroup()
local unit picked=null
local boolexpr b=Condition( function UnitPermanentManaShield_Filter )
call GroupEnumUnitsInRect(g, GetPlayableMapRect(), b )
call DestroyGroup(g)
call DestroyBoolExpr(b)
set g=null
set b=null
set picked=null
endfunction
function InitTrig_UnitPermanent_Mana_Shield takes nothing returns nothing
set gg_trg_UnitPermanent_Mana_Shield = CreateTrigger( )
call TriggerAddAction( gg_trg_UnitPermanent_Mana_Shield, function Trig_UnitPermanentManaShield_InitEnum )
call TriggerExecute(gg_trg_UnitPermanent_Mana_Shield)
call DestroyTrigger( gg_trg_UnitPermanent_Mana_Shield )
set gg_trg_UnitPermanent_Mana_Shield = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_UnitPermanent_Mana_Shield, GetPlayableMapRect() )
call TriggerAddAction( gg_trg_UnitPermanent_Mana_Shield, function Trig_UnitPermanentManaShield_Actions )
endfunction//===========================================================================
//**********************************************************************************************
//*
//* Optical Flare
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯
//* Requires:
//* - The Pool Class functions
//* - The Handle Variables functions
//* - The Optical Flare Ability
//* - The Optical Flare Buff
//* - The Optical Flare Sight Destruction Ability
//* - The Flare Vision unit type
//* - This Trigger (make sure it points to the right rawcodes)
//* Note:
//* - If you have any custom detector ability in your map, you have to add it to the
//* SetupDetectionPool function at the end of this configuration section.
//*
//**********************************************************************************************
//==============================================================================================
// Optical Flare Configuration
//
constant function OpticalFlare_SpellId takes nothing returns integer
return 'A00I' //// The Rawcode of the Optical Flare Ability In your map
endfunction
constant function OpticalFlare_BuffId takes nothing returns integer
return 'B000' //// The Rawcode of the Optical Flare Buff In your map
endfunction
constant function OpticalFlare_SightDestructorSpellId takes nothing returns integer
return 'A00R' //// The Rawcode of the Optical Flare Sight Destructor ability In your map
endfunction
constant function OpticalFlare_FakeSightUnit takes nothing returns integer
return 'n002' //// The Rawcode of the Optical Flare Vision unit type In your map
endfunction
constant function OpticalFlare_MissileSpeed takes nothing returns integer
return 1500 //// The missile speed, should be exactly the same as the one used by the ability
endfunction
function SetupDetectionPool takes integer spells returns nothing
call PoolAddItem(spells,'Agyv') //True Sight (Flying Machine)
call PoolAddItem(spells,'Atru') //True Sight (Shade)
call PoolAddItem(spells,'Adtg') //True Sight (Neutral 1)
call PoolAddItem(spells,'ANtr') //True Sight (Neutral 2)
call PoolAddItem(spells,'Adts') //Magic Sentry
call PoolAddItem(spells,'Adt1') //Detector (Sentry Ward)
call PoolAddItem(spells,'Abdt') //Burrow Detection (fliers)
call PoolAddItem(spells,'A000') //Detector
endfunction
//===================================================================================================
function OpticalFlareDetectDetector takes unit u, integer p returns integer
local integer n=CountItemsInPool(p)
local integer i
loop
exitwhen n==0
set i=PoolGetItem(p,n)
if GetUnitAbilityLevel(u,i)>0 then
return i
endif
set n=n-1
endloop
return 0
endfunction
function OpticalFlare_GetUnit takes timer t, string s returns unit
return GetHandleHandle(t,s)
endfunction
function OpticalFlare_Timer takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit b=OpticalFlare_GetUnit(t,"b")
local unit sh=OpticalFlare_GetUnit(t,"sh")
local real x=GetHandleReal(t,"x")
local real y=GetHandleReal(t,"y")
local real nx=GetUnitX(b)
local real ny=GetUnitY(b)
local real a=ModuloReal( Atan2(ny-y,nx-x) , 2*bj_PI)
local real d= SquareRoot(Pow(x-nx,2) +Pow(y-ny,2)) //*0.02
if ModuloReal(a+bj_PI/4,bj_PI*2)<=bj_PI then
set d=d*40
endif
call SetUnitPosition(sh,nx+d*Cos(a),ny+d*Sin(a) )
call SetHandleReal(t,"x",nx)
call SetHandleReal(t,"y",ny)
call SetUnitFacing(sh,GetUnitFacing(b))
call SetUnitFlyHeight(sh, GetUnitFlyHeight(b)+120,0)
set t=null
set b=null
set sh=null
endfunction
function OpticalFlare_Effect takes unit b, integer l returns nothing
local real ac=GetUnitAcquireRange(b)
local unit sh=CreateUnit( GetOwningPlayer(b), OpticalFlare_FakeSightUnit(), GetUnitX(b), GetUnitY(b), 0)
local integer abi=OpticalFlareDetectDetector(b, GetStoredInteger(InitGameCache("opticalflare"),"opt","pool") )
local timer t=CreateTimer()
call SetUnitPathing(sh,false)
call UnitRemoveAbility(b, abi )
call UnitAddAbility(b, OpticalFlare_SightDestructorSpellId() )
call UnitMakeAbilityPermanent(b,true,OpticalFlare_SightDestructorSpellId())
call UnitMakeAbilityPermanent(b,true,OpticalFlare_BuffId())
call SetHandleHandle(t,"b",b)
call SetHandleHandle(t,"sh",sh)
call TimerStart(t,0.01,true, function OpticalFlare_Timer )
loop
exitwhen IsUnitDeadBJ(b)
call TriggerSleepAction(0)
exitwhen not UnitHasBuffBJ(b, OpticalFlare_BuffId() )
endloop
call UnitRemoveAbility(b, OpticalFlare_SightDestructorSpellId() )
call UnitAddAbility(b, abi )
call RemoveUnit(sh)
call FlushHandleLocals(t)
call DestroyTimer(t)
set t=null
set sh=null
endfunction
function Trig_Optical_Flare_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local unit blind=GetSpellTargetUnit()
local integer l=GetUnitAbilityLevel(u,GetSpellAbilityId() )
call PolledWait( SquareRoot(Pow(GetUnitX(u)-GetUnitX(blind),2) + Pow(GetUnitY(u)-GetUnitY(blind),2) ) / OpticalFlare_MissileSpeed() )
call OpticalFlare_Effect(blind,l)
set u=null
set blind=null
endfunction
function Trig_Optical_Flare_Conditions takes nothing returns boolean
return GetSpellAbilityId() == OpticalFlare_SpellId()
endfunction
function InitTrig_Optical_Flare takes nothing returns nothing
local integer i=CreatePool()
call StoreInteger(InitGameCache("opticalflare"),"opt","pool",i)
call SetupDetectionPool(i)
set gg_trg_Optical_Flare = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Optical_Flare, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Optical_Flare, Condition( function Trig_Optical_Flare_Conditions ) )
call TriggerAddAction( gg_trg_Optical_Flare, function Trig_Optical_Flare_Actions )
endfunction
//===========================================================================
// Trigger: Stim Pack Player 1
//===========================================================================
function Trig_Stim_Pack_Player_1_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("berserk") ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_1_Func001C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) > 10 ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_1_Actions takes nothing returns nothing
if ( Trig_Stim_Pack_Player_1_Func001C() ) then
call SetUnitLifeBJ( GetOrderedUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) - 10.00 ) )
else
call PolledWait( 0.01 )
call UnitRemoveBuffBJ( 'Bbsk', GetOrderedUnit() )
endif
endfunction
//===========================================================================
function InitTrig_Stim_Pack_Player_1 takes nothing returns nothing
set gg_trg_Stim_Pack_Player_1 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Stim_Pack_Player_1, Player(0), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Stim_Pack_Player_1, Condition( function Trig_Stim_Pack_Player_1_Conditions ) )
call TriggerAddAction( gg_trg_Stim_Pack_Player_1, function Trig_Stim_Pack_Player_1_Actions )
endfunction
//===========================================================================
// Trigger: Stim Pack Player 2
//===========================================================================
function Trig_Stim_Pack_Player_2_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("berserk") ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_2_Func001C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) > 10 ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_2_Actions takes nothing returns nothing
if ( Trig_Stim_Pack_Player_2_Func001C() ) then
call SetUnitLifeBJ( GetOrderedUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) - 10.00 ) )
else
call PolledWait( 0.01 )
call UnitRemoveBuffBJ( 'Bbsk', GetOrderedUnit() )
endif
endfunction
//===========================================================================
function InitTrig_Stim_Pack_Player_2 takes nothing returns nothing
set gg_trg_Stim_Pack_Player_2 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Stim_Pack_Player_2, Player(1), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Stim_Pack_Player_2, Condition( function Trig_Stim_Pack_Player_2_Conditions ) )
call TriggerAddAction( gg_trg_Stim_Pack_Player_2, function Trig_Stim_Pack_Player_2_Actions )
endfunction
//===========================================================================
// Trigger: Stim Pack Player 3
//===========================================================================
function Trig_Stim_Pack_Player_3_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("berserk") ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_3_Func001C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) > 10 ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_3_Actions takes nothing returns nothing
if ( Trig_Stim_Pack_Player_3_Func001C() ) then
call SetUnitLifeBJ( GetOrderedUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) - 10.00 ) )
else
call PolledWait( 0.01 )
call UnitRemoveBuffBJ( 'Bbsk', GetOrderedUnit() )
endif
endfunction
//===========================================================================
function InitTrig_Stim_Pack_Player_3 takes nothing returns nothing
set gg_trg_Stim_Pack_Player_3 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Stim_Pack_Player_3, Player(2), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Stim_Pack_Player_3, Condition( function Trig_Stim_Pack_Player_3_Conditions ) )
call TriggerAddAction( gg_trg_Stim_Pack_Player_3, function Trig_Stim_Pack_Player_3_Actions )
endfunction
//===========================================================================
// Trigger: Stim Pack Player 4
//===========================================================================
function Trig_Stim_Pack_Player_4_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("berserk") ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_4_Func001C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) > 10 ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_4_Actions takes nothing returns nothing
if ( Trig_Stim_Pack_Player_4_Func001C() ) then
call SetUnitLifeBJ( GetOrderedUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) - 10.00 ) )
else
call PolledWait( 0.01 )
call UnitRemoveBuffBJ( 'Bbsk', GetOrderedUnit() )
endif
endfunction
//===========================================================================
function InitTrig_Stim_Pack_Player_4 takes nothing returns nothing
set gg_trg_Stim_Pack_Player_4 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Stim_Pack_Player_4, Player(3), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Stim_Pack_Player_4, Condition( function Trig_Stim_Pack_Player_4_Conditions ) )
call TriggerAddAction( gg_trg_Stim_Pack_Player_4, function Trig_Stim_Pack_Player_4_Actions )
endfunction
//===========================================================================
// Trigger: Stim Pack Player 5
//===========================================================================
function Trig_Stim_Pack_Player_5_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("berserk") ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_5_Func001C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) > 10 ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_5_Actions takes nothing returns nothing
if ( Trig_Stim_Pack_Player_5_Func001C() ) then
call SetUnitLifeBJ( GetOrderedUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) - 10.00 ) )
else
call PolledWait( 0.01 )
call UnitRemoveBuffBJ( 'Bbsk', GetOrderedUnit() )
endif
endfunction
//===========================================================================
function InitTrig_Stim_Pack_Player_5 takes nothing returns nothing
set gg_trg_Stim_Pack_Player_5 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Stim_Pack_Player_5, Player(4), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Stim_Pack_Player_5, Condition( function Trig_Stim_Pack_Player_5_Conditions ) )
call TriggerAddAction( gg_trg_Stim_Pack_Player_5, function Trig_Stim_Pack_Player_5_Actions )
endfunction
//===========================================================================
// Trigger: Stim Pack Player 6
//===========================================================================
function Trig_Stim_Pack_Player_6_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("berserk") ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_6_Func001C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) > 10 ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_6_Actions takes nothing returns nothing
if ( Trig_Stim_Pack_Player_6_Func001C() ) then
call SetUnitLifeBJ( GetOrderedUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) - 10.00 ) )
else
call PolledWait( 0.01 )
call UnitRemoveBuffBJ( 'Bbsk', GetOrderedUnit() )
endif
endfunction
//===========================================================================
function InitTrig_Stim_Pack_Player_6 takes nothing returns nothing
set gg_trg_Stim_Pack_Player_6 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Stim_Pack_Player_6, Player(5), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Stim_Pack_Player_6, Condition( function Trig_Stim_Pack_Player_6_Conditions ) )
call TriggerAddAction( gg_trg_Stim_Pack_Player_6, function Trig_Stim_Pack_Player_6_Actions )
endfunction
//===========================================================================
// Trigger: Stim Pack Player 7
//===========================================================================
function Trig_Stim_Pack_Player_7_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("berserk") ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_7_Func001C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) > 10 ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_7_Actions takes nothing returns nothing
if ( Trig_Stim_Pack_Player_7_Func001C() ) then
call SetUnitLifeBJ( GetOrderedUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) - 10.00 ) )
else
call PolledWait( 0.01 )
call UnitRemoveBuffBJ( 'Bbsk', GetOrderedUnit() )
endif
endfunction
//===========================================================================
function InitTrig_Stim_Pack_Player_7 takes nothing returns nothing
set gg_trg_Stim_Pack_Player_7 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Stim_Pack_Player_7, Player(6), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Stim_Pack_Player_7, Condition( function Trig_Stim_Pack_Player_7_Conditions ) )
call TriggerAddAction( gg_trg_Stim_Pack_Player_7, function Trig_Stim_Pack_Player_7_Actions )
endfunction
//===========================================================================
// Trigger: Stim Pack Player 8
//===========================================================================
function Trig_Stim_Pack_Player_8_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("berserk") ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_8_Func001C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) > 10 ) ) then
return false
endif
return true
endfunction
function Trig_Stim_Pack_Player_8_Actions takes nothing returns nothing
if ( Trig_Stim_Pack_Player_8_Func001C() ) then
call SetUnitLifeBJ( GetOrderedUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit()) - 10.00 ) )
else
call PolledWait( 0.01 )
call UnitRemoveBuffBJ( 'Bbsk', GetOrderedUnit() )
endif
endfunction
//===========================================================================
function InitTrig_Stim_Pack_Player_8 takes nothing returns nothing
set gg_trg_Stim_Pack_Player_8 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Stim_Pack_Player_8, Player(7), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Stim_Pack_Player_8, Condition( function Trig_Stim_Pack_Player_8_Conditions ) )
call TriggerAddAction( gg_trg_Stim_Pack_Player_8, function Trig_Stim_Pack_Player_8_Actions )
endfunction