// ===========================
function H2I takes handle h returns integer
return h
return 0
endfunction
// ===========================
function LocalVars takes nothing returns gamecache
// Replace InitGameCache with a global variable!!
return InitGameCache("cache")
endfunction
function SetHandleHandle takes handle subject, string name, handle value returns nothing
if value==null then
call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
else
call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
endif
endfunction
function SetHandleInt takes handle subject, string name, integer value returns nothing
if value==0 then
call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
else
call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleBoolean takes handle subject, string name, boolean value returns nothing
if value==false then
call FlushStoredBoolean(LocalVars(),I2S(H2I(subject)),name)
else
call StoreBoolean(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleReal takes handle subject, string name, real value returns nothing
if value==0 then
call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
else
call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleString takes handle subject, string name, string value returns nothing
if value==null then
call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
else
call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function GetHandleHandle takes handle subject, string name returns handle
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleBoolean takes handle subject, string name returns boolean
return GetStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleString takes handle subject, string name returns string
return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleUnit takes handle subject, string name returns unit
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTrigger takes handle subject, string name returns trigger
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleGroup takes handle subject, string name returns group
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleLightning takes handle subject, string name returns lightning
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleWidget takes handle subject, string name returns widget
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function FlushHandleLocals takes handle subject returns nothing
call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
//===============================================================
function CreateDummy takes real x, real y returns unit
local unit dummy = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'u000', x, y, 0)
// call SetUnitVertexColor(dummy, 0, 0, 0, 0)
return dummy
endfunction
function AddDummyEffect takes unit dummy, string model returns nothing
local integer n = GetHandleInt(dummy, "effectCount")
call SetHandleInt(dummy, "dummyEffectCount", n+1)
call SetHandleHandle(dummy, "dummyEffect"+I2S(n+1), AddSpecialEffectTarget(model, dummy, "origin"))
endfunction
function RemoveDummy takes unit dummy returns nothing
local integer n = GetHandleInt(dummy, "effectCount")
loop
exitwhen n <= 0
call DestroyEffect(GetHandleEffect(dummy, "dummyEffect"+I2S(n)))
set n = n - 1
endloop
call FlushHandleLocals(dummy)
call RemoveUnit(dummy)
endfunction
function AddTimedLightning_Fade takes nothing returns nothing
local timer t = GetExpiredTimer()
local lightning li = GetHandleLightning(t, "lightning")
local real time = GetHandleReal(t, "time")
local real d = 0.1/time
local real r = GetLightningColorR(li)
local real g = GetLightningColorG(li)
local real b = GetLightningColorB(li)
local real a = GetLightningColorA(li)-d
call SetLightningColor(li, r, g, b, a)
if a <= 0 then
call DestroyLightning(li)
call FlushHandleLocals(t)
call DestroyTimer(t)
endif
endfunction
function AddTimedLightning_StartFade takes nothing returns nothing
call TimerStart(GetExpiredTimer(), 0.1, true, function AddTimedLightning_Fade)
endfunction
function AddTimedLightning takes string Code, real x1, real y1, real x2, real y2, real duration, real fadetime returns lightning
local timer t = CreateTimer()
local lightning li = AddLightning(Code, true, x1, y1, x2, y2)
call SetHandleHandle(t, "lightning", li)
call SetHandleReal(t, "time", fadetime)
call TimerStart(t, duration, false, function AddTimedLightning_StartFade)
return li
endfunction
function AddTimedLightningEx takes string Code, real x1, real y1, real z1, real x2, real y2, real z2, real duration, real fadetime returns lightning
local timer t = CreateTimer()
local lightning li = AddLightningEx(Code, true, x1, y1, z1, x2, y2, z2)
call SetHandleHandle(t, "lightning", li)
call SetHandleReal(t, "time", fadetime)
call TimerStart(t, duration, false, function AddTimedLightning_StartFade)
return li
endfunction
// ===========================
function TreeKill_child takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
function TreeKill takes real rad, unit u returns nothing
call EnumDestructablesInCircleBJ( rad, GetUnitLoc(u), function TreeKill_child )
call AddHeroXPSwapped( 5, gg_unit_Hmkg_0001, false )
endfunction
Name | Type | is_array | initial_value |
cache | gamecache | No | |
drowns | integer | No | |
escaped | integer | No | |
escapedcan | integer | No | 3 |
escapedcan2 | integer | No | 3 |
firsttimedrown | boolean | No | true |
kills | integer | No | |
r | integer | No | |
random | integer | No | |
run | boolean | No | |
spawnCount | integer | No | |
spawnCount2 | integer | No | |
spawnName | string | No | |
spawnName2 | string | No | |
spawntimer | timer | No | |
spawnType | unitcode | No | |
spawnType2 | unitcode | No | |
special | boolean | No | true |
wave | integer | No | 1 |
function Trig_Storm_Rage_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_Storm_Rage_Actions takes nothing returns nothing
local unit c = GetSpellAbilityUnit()
local unit t = GetSpellTargetUnit()
local integer lvl = GetUnitAbilityLevelSwapped('A000', c)
local group g
local unit u
local unit dumb
local real wait = DistanceBetweenPoints(GetUnitLoc(c),GetUnitLoc(t))
call PolledWait( wait / 950 )
set g = GetUnitsInRangeOfLocAll(400, GetUnitLoc(t))
set u = FirstOfGroup(g)
loop
exitwhen u==null
set u = FirstOfGroup(g)
if IsUnitEnemy(u, GetOwningPlayer(c))==true then
set dumb = CreateUnitAtLoc(GetOwningPlayer(c), 'u000', GetUnitLoc(t), 0)
call UnitAddAbility(dumb, 'A001')
call SetUnitAbilityLevel(dumb, 'A001', lvl)
call IssueTargetOrderBJ(dumb, "thunderbolt", u)
call UnitApplyTimedLifeBJ( 1, 'BTLF', dumb )
set dumb = null
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g = null
set u = null
set dumb = null
set c = null
set t = null
endfunction
//===========================================================================
function InitTrig_Storm_Rage takes nothing returns nothing
set gg_trg_Storm_Rage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Storm_Rage, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Storm_Rage, Condition( function Trig_Storm_Rage_Conditions ) )
call TriggerAddAction( gg_trg_Storm_Rage, function Trig_Storm_Rage_Actions )
endfunction
function Shield_Coat_Child takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit c = GetHandleUnit(t, "c")
local unit u = GetHandleUnit(t, "u")
local location current = GetUnitLoc(c)
local location loc = GetUnitLoc(u)
local real angle = I2R(GetUnitUserData(u)) + 30
call SetHandleReal(t, "runned", (GetHandleReal(t, "runned" ) + GetHandleReal(t, "time")))
if (GetHandleReal(t, "runned") > GetHandleReal(t, "duration")) then
if (GetUnitAbilityLevel(c,'A003')==1) then
call UnitRemoveAbilityBJ( 'A003',c )
else
call DecUnitAbilityLevelSwapped( 'A003', c )
endif
call AddSpecialEffectLocBJ( loc, "Abilities\\Weapons\\ColdArrow\\ColdArrowMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit(u)
call FlushHandleLocals(t)
call DestroyTimer(t)
else
call IssuePointOrderLocBJ( u, "move", PolarProjectionBJ(current, 250-(GetHandleReal(t, "runned")*2), angle) )
call SetUnitUserData(u,R2I(angle))
call SetUnitFlyHeight(u,100,20)
endif
call RemoveLocation(current)
set current = null
call RemoveLocation(loc)
set loc = null
set u = null
set c = null
set t = null
endfunction
function Shield_Coat_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A002' ) ) then
return false
endif
return true
endfunction
function Shield_Coat_Actions takes nothing returns nothing
local unit c = GetSpellAbilityUnit()
local integer lvl = GetUnitAbilityLevelSwapped('A002', c)
local integer times = 0
local unit dumb
local unit fx1
local unit fx2
local unit fx3
local real angle = 0.01
local real anglex = lvl*3
local location current
local timer t
local boolean plus = false
call IssueImmediateOrderBJ( c, "stop" )
call PauseUnit(c,true)
call SetUnitAnimation( c, "morph" )
set fx1 = CreateDummy(GetUnitX(c),GetUnitY(c))
call SetUnitFlyHeightBJ(fx1,500,999999)
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', fx1 )
call PolledWait( 0.05 )
set fx2 = CreateDummy(GetUnitX(c),GetUnitY(c))
call UnitApplyTimedLifeBJ( 10, 'BTLF', fx2 )
call AddTimedLightningEx("FORK", GetUnitX(fx2), GetUnitY(fx2), GetUnitFlyHeight(fx2), GetUnitX(fx1), GetUnitY(fx1), GetUnitFlyHeight(fx1), 0.5, 0.5)
call AddSpecialEffectTargetUnitBJ( "origin", fx1, "Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "origin", fx2, "Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitFlyHeightBJ(fx2,500,999999)
call UnitAddAbilityBJ( 'A003',c )
loop
exitwhen times >= anglex
set current = GetUnitLoc(c)
set fx3 = CreateDummy(GetLocationX(current)+Cos(angle)*300, GetLocationY(current)+Sin(angle)*300)
call SetUnitFlyHeightBJ(fx3,300,999999)
call AddTimedLightningEx("FORK", GetUnitX(fx3), GetUnitY(fx3), GetUnitFlyHeight(fx3), GetUnitX(fx2), GetUnitY(fx2), GetUnitFlyHeight(fx2), 0, 0.5)
call AddSpecialEffectTargetUnitBJ( "origin", fx3, "Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', fx3 )
set fx3 = null
set dumb = CreateUnitAtLoc(GetOwningPlayer(c), 'u000', PolarProjectionBJ(current, 300, angle), angle)
call AddDummyEffect(dumb, "shieldcoat.mdx")
call SetUnitFlyHeight(dumb,350,999999)
call SetUnitUserData(dumb,R2I(angle))
set t = CreateTimer( )
call SetHandleHandle(t, "u", dumb)
call SetHandleHandle(t, "c", c)
call SetHandleReal(t, "time", 0.5)
call SetHandleReal(t, "duration", 50 + (I2R(times)+1))
call TimerStart(t, 0.2, true, function Shield_Coat_Child)
set t = null
set dumb = null
set angle = angle + (360/anglex)
set times = times + 1
if plus == true then
call IncUnitAbilityLevelSwapped( 'A003', c )
endif
set plus = true
endloop
call PauseUnit(c,false)
call SetUnitAnimation( c, "stand" )
call RemoveLocation(current)
set current = null
set c = null
set dumb = null
set t = null
set fx1 = null
set fx2 = null
set fx3 = null
endfunction
//===========================================================================
function InitTrig_Shield_Coat takes nothing returns nothing
set gg_trg_Shield_Coat = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shield_Coat, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shield_Coat, Condition( function Shield_Coat_Conditions ) )
call TriggerAddAction( gg_trg_Shield_Coat, function Shield_Coat_Actions )
endfunction
//============================================================================================
// Final Uppercut Spell Configuration
//
constant function FinalUppercut_SpellId takes nothing returns integer
return 'A004' //// Final Uppercut rawcode
endfunction
constant function FinalUppercut_SpellId2 takes nothing returns integer
return 'A007' //// Final Uppercut rawcode
endfunction
constant function FinalUppercut_max takes real level returns real
return 500+200*level //// Maximum flying height
endfunction
constant function FinalUppercut_Duration takes real level returns real
return 0.75+level*0.25 //// Flying duration
endfunction
constant function FinalUppercut_InitialDamage takes real level returns real
return 30+level*15 //// First Damage
endfunction
constant function FinalUppercut_FinalDamage takes real level returns real
return 100+level*55 //// Landing damage
endfunction
constant function FinalUppercut_Speed takes real level, integer lvl returns real
return 800+level*50-(lvl*90-70) //// The movement speed of the knockback
endfunction
constant function FinalUppercut_DisablePathing takes nothing returns boolean
return true //// Determines if the knockback ignores pathing, makes the spell looks better, but allows the players to throw units outside a pathable area which is plain bad
endfunction
constant function FinalUppercut_Timer takes nothing returns real
return 0.04
endfunction
//============================================================================================
function Trig_Final_Uppercut_Conditions takes nothing returns boolean
// return GetSpellAbilityId() == FinalUppercut_SpellId()
if ( ( GetSpellAbilityId() == FinalUppercut_SpellId() ) ) then
return true
endif
if ( ( GetSpellAbilityId() == FinalUppercut_SpellId2() ) ) then
return true
endif
return false
endfunction
function FinalUppercut_Move takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit u=GetHandleUnit(t, "target")
local real a=GetHandleReal(t, "a")
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local real d=FinalUppercut_Timer()*FinalUppercut_Speed( GetHandleInt(t, "l" ), GetUnitLevel(u) )
local real tx= x+d*CosBJ(a)
local real ty= y+d*SinBJ(a)
call SetUnitFacing(u, GetRandomReal(0,360 ) )
call SetUnitPosition( u, tx,ty)
if SquareRoot( Pow( GetUnitX(u)-tx,2) + Pow( GetUnitY(u)-ty , 2) ) > 20 then
call SetUnitPosition( u, x,y)
endif
set t=null
set u=null
endfunction
function Trig_Final_Uppercut_Actions takes nothing returns nothing
local unit target=GetSpellTargetUnit()
local unit u=GetTriggerUnit()
local integer l=GetUnitAbilityLevel(u, GetSpellAbilityId() )
local real x=GetUnitX(target)
local real y=GetUnitY(target)
local real a=Atan2BJ( y-GetUnitY(u) , x-GetUnitX(u) )
local timer t=CreateTimer()
local real dur=FinalUppercut_Duration(l)
local effect e
call SetHandleHandle(t,"target",target)
call SetHandleReal(t, "a", a)
if (GetUnitAbilityLevel(target,'Amrf')<=0) then
call UnitAddAbility(target,'Amrf')
call UnitRemoveAbility(target,'Amrf')
endif
if FinalUppercut_DisablePathing() then
// if GetUnitLevel(target)<4 and IsUnitType(target, UNIT_TYPE_HERO)==FALSE then
call SetUnitPathing(target,false)
// endif
endif
call SetUnitFlyHeight( target, 0.01 ,0)
set e = AddSpecialEffectTargetUnitBJ( "chest", target, "Abilities\\Spells\\Other\\HealingSpray\\HealBottleMissile.mdl" )
call UnitDamageTargetBJ( u, target, FinalUppercut_InitialDamage(l), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FORCE )
call SetHandleInt(t, "l", l)
call TimerStart(t, FinalUppercut_Timer(), true, function FinalUppercut_Move )
call SetUnitFlyHeight(target, 1000000, FinalUppercut_max(l)/(dur/2) )
call PolledWait(dur/2)
call SetUnitFlyHeight(target, 0, 1400)
call PolledWait(dur/2)
call SetUnitFlyHeight(target, -1, 2000)
call FlushHandleLocals(t)
call DestroyTimer(t)
call DestroyEffect(e)
if (udg_run == TRUE) then
// if IsTerrainPathableBJ(GetUnitLoc(target), PATHING_TYPE_FLOATABILITY)==TRUE and IsTerrainPathableBJ(GetUnitLoc(target), PATHING_TYPE_WALKABILITY)==FALSE and GetTerrainCliffLevelBJ(GetUnitLoc(target)) > 2 then
// if IsTerrainPathableBJ(GetUnitLoc(target), PATHING_TYPE_FLOATABILITY)==TRUE and IsTerrainPathableBJ(GetUnitLoc(target), PATHING_TYPE_WALKABILITY)==FALSE then
if IsTerrainPathableBJ(GetUnitLoc(target), PATHING_TYPE_FLOATABILITY)==TRUE then
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(target), GetRandomReal(-100, 100), GetRandomReal(-100, 100)), "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(target), GetRandomReal(-100, 100), GetRandomReal(-100, 100)), "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(target), GetRandomReal(-100, 100), GetRandomReal(-100, 100)), "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(target), GetRandomReal(-100, 100), GetRandomReal(-100, 100)), "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(target), GetRandomReal(-100, 100), GetRandomReal(-100, 100)), "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(target), GetRandomReal(-100, 100), GetRandomReal(-100, 100)), "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitFlyHeight(target, -1, 2000)
call UnitDamageTargetBJ( u, target, FinalUppercut_FinalDamage(l), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FORCE )
call UnitDamagePointLoc( u, 0, 256, GetUnitLoc(target), 95, ATTACK_TYPE_SIEGE, DAMAGE_TYPE_NORMAL )
call AddSpecialEffectLocBJ( GetUnitLoc(target), "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
call TerrainDeformationRippleBJ( 3.00, false, GetUnitLoc(target), 128, 256, 64, 0.5, 1024 )
call TreeKill(200,target)
else
set udg_drowns = udg_drowns + 1
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 2, 2, I2S(udg_drowns) )
call AddHeroXPSwapped( 100, u, false )
call AddSpecialEffectLocBJ( GetUnitLoc(target), "Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl" )
call PolledWait(0.2)
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(target), GetRandomReal(-100, 100), GetRandomReal(-100, 100)), "Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(target), GetRandomReal(-100, 100), GetRandomReal(-100, 100)), "Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(target), GetRandomReal(-100, 100), GetRandomReal(-100, 100)), "Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(target), GetRandomReal(-100, 100), GetRandomReal(-100, 100)), "Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(target), GetRandomReal(-100, 100), GetRandomReal(-100, 100)), "Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(target), GetRandomReal(-100, 100), GetRandomReal(-100, 100)), "Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitFlyHeight(target, -200, 2000)
set e = AddSpecialEffectLocBJ( GetUnitLoc(target), "Doodads\\Ruins\\Water\\BubbleGeyser\\BubbleGeyser.mdl" )
call UnitDamageTargetBJ( u, target, 10000, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FORCE )
call KillUnit(target)
if udg_firsttimedrown == true then
call PlaySoundBJ( gg_snd_drown )
set udg_firsttimedrown = false
endif
call PolledWait(10)
call DestroyEffect(e)
endif
endif
if FinalUppercut_DisablePathing() then
call SetUnitPathing(target,true)
endif
set t=null
set e=null
set target=null
set u=null
endfunction
//===========================================================================
function InitTrig_Final_Uppercut takes nothing returns nothing
set gg_trg_Final_Uppercut = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Final_Uppercut, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Final_Uppercut, Condition( function Trig_Final_Uppercut_Conditions ) )
call TriggerAddAction( gg_trg_Final_Uppercut, function Trig_Final_Uppercut_Actions )
endfunction
function Trig_berserk_effect_Conditions takes nothing returns boolean
if ( not ( gg_unit_Hmkg_0001 == GetAttacker() ) ) then
return false
endif
if ( not ( UnitHasBuffBJ(gg_unit_Hmkg_0001, 'Bbsk') == true ) ) then
return false
endif
return true
endfunction
function Trig_berserk_effect_Actions takes nothing returns nothing
local effect e
set e = AddSpecialEffectTargetUnitBJ( "origin", GetAttacker(), "Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl" )
call TriggerSleepAction( 0.30 )
call DestroyEffectBJ( e )
set e = null
endfunction
//===========================================================================
function InitTrig_berserk_effect takes nothing returns nothing
set gg_trg_berserk_effect = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_berserk_effect, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_berserk_effect, Condition( function Trig_berserk_effect_Conditions ) )
call TriggerAddAction( gg_trg_berserk_effect, function Trig_berserk_effect_Actions )
endfunction
function Trig_spawn_time_Actions takes nothing returns nothing
local sound s
set udg_r = GetRandomInt(1, 5)
set udg_wave = udg_wave+1
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 2, 7, I2S(udg_wave) )
set udg_escapedcan2 = udg_escapedcan
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 3, 3, ( "/ " + I2S(udg_escapedcan2) ) )
if udg_r == 1 then
set s = gg_snd_ride1
endif
if udg_r == 2 then
set s = gg_snd_ride2
endif
if udg_r == 3 then
set s = gg_snd_ride3
endif
if udg_r == 4 then
set s = gg_snd_ride4
endif
if udg_r == 5 then
set s = gg_snd_ride5
endif
if udg_spawnType == 'o001' then
call PlaySoundBJ( gg_snd_BOSS )
else
call PlaySoundBJ( s )
endif
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = udg_spawnCount
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateNUnitsAtLoc( 1, udg_spawnType, Player(11), GetRandomLocInRect(gg_rct_orc_spawn), 270.00 )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", GetRandomLocInRect(gg_rct_orc_target) )
if udg_spawnType != 'o001' then
call UnitApplyTimedLifeBJ( 90, 'BTLF', GetLastCreatedUnit() )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = udg_spawnCount2
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateNUnitsAtLoc( 1, udg_spawnType2, Player(11), GetRandomLocInRect(gg_rct_orc_spawn), 270.00 )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", GetRandomLocInRect(gg_rct_orc_target) )
if udg_spawnType2 != 'o001' then
call UnitApplyTimedLifeBJ( 90, 'BTLF', GetLastCreatedUnit() )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_spawn_time takes nothing returns nothing
set gg_trg_spawn_time = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_spawn_time, udg_spawntimer )
call TriggerAddAction( gg_trg_spawn_time, function Trig_spawn_time_Actions )
endfunction
function Trig_spawn_message_Func007C takes nothing returns boolean
if ( not ( udg_spawnType2 == 0 ) ) then
return false
endif
return true
endfunction
function Trig_spawn_message_Actions takes nothing returns nothing
if ( udg_spawnType == 'ogru' ) then
set udg_spawnName = "Orc"
endif
if ( udg_spawnType2 == 'ogru' ) then
set udg_spawnName2 = "Orc"
endif
if ( udg_spawnType == 'o000' ) then
set udg_spawnName = "Orc Brute"
endif
if ( udg_spawnType2 == 'o000' ) then
set udg_spawnName2 = "Orc Brute"
endif
if ( udg_spawnType == 'ohun' ) then
set udg_spawnName = "Orc Spearman"
endif
if ( udg_spawnType2 == 'ohun' ) then
set udg_spawnName2 = "Orc Spearman"
endif
if ( udg_spawnType == 'o001' ) then
set udg_spawnName = "Orc Lord"
endif
if ( udg_spawnType2 == 'o001' ) then
set udg_spawnName2 = "Orc Lord"
endif
if ( udg_spawnType == 'o002' ) then
set udg_spawnName = "Orc Hero"
endif
if ( udg_spawnType2 == 'o002' ) then
set udg_spawnName2 = "Orc Hero"
endif
call TriggerSleepAction( 5.00 )
call DisplayTextToForce( GetPlayersAll(), ( "|cffffcc00Next Wave|r : " + I2S(udg_wave) ) )
call DisplayTextToForce( GetPlayersAll(), ( "|cffffcc00" + ( I2S(udg_spawnCount) + ( " " + (udg_spawnName) + "|r" ) ) ) )
if ( Trig_spawn_message_Func007C() ) then
call DoNothing( )
else
call DisplayTextToForce( GetPlayersAll(), ( "|cffffcc00" + ( I2S(udg_spawnCount2) + ( " " + (udg_spawnName2) + "|r" ) ) ) )
endif
endfunction
//===========================================================================
function InitTrig_spawn_message takes nothing returns nothing
set gg_trg_spawn_message = CreateTrigger( )
call TriggerAddAction( gg_trg_spawn_message, function Trig_spawn_message_Actions )
endfunction
function win_fx_letters takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit dumb=GetHandleUnit(t,"dumb")
local integer letter=GetHandleInt(t,"letter")
local string s
local unit dumb2
if letter == 1 then
set s = "A"
endif
if letter == 2 then
set s = "n"
endif
if letter == 3 then
set s = "d"
endif
if letter == 4 then
set s = "a"
endif
if letter == 5 then
set s = "r"
endif
if letter == 6 then
set s = "i"
endif
if letter == 7 then
set s = "a"
endif
if s != "" then
set dumb2 = CreateUnitAtLoc(Player(0), 'u000', GetUnitLoc(dumb), 0)
call SetUnitFlyHeight(dumb2,370,999999)
call AddDummyEffect(dumb2, "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl")
call UnitApplyTimedLifeBJ( 2, 'BTLF', dumb2 )
endif
call CreateTextTagUnitBJ( s, dumb, 5, 30, 100, 75, 0, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 90, 90 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 4.50 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 2.00 )
call SetHandleInt(t, "letter", letter+1)
set t=null
set dumb=null
set dumb2=null
endfunction
function win_fx_letters2 takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit dumb=GetHandleUnit(t,"dumb")
local integer letter=GetHandleInt(t,"letter")
local string s
local unit dumb2
if letter == 1 then
set s = "s"
endif
if letter == 2 then
set s = "t"
endif
if letter == 3 then
set s = "n"
endif
if letter == 4 then
set s = "e"
endif
if letter == 5 then
set s = "s"
endif
if letter == 6 then
set s = "e"
endif
if letter == 7 then
set s = "r"
endif
if letter == 8 then
set s = "P"
endif
if s != "" then
set dumb2 = CreateUnitAtLoc(Player(0), 'u000', GetUnitLoc(dumb), 0)
call SetUnitFlyHeight(dumb2,320,999999)
call AddDummyEffect(dumb2, "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl")
call UnitApplyTimedLifeBJ( 2, 'BTLF', dumb2 )
endif
call CreateTextTagUnitBJ( s, dumb, -5, 20, 100, 75, 0, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 90, 90 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 4.50 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 2.00 )
call SetHandleInt(t, "letter", letter+1)
set t=null
set dumb=null
set dumb2=null
endfunction
function win_fx_letters3 takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit dumb=GetHandleUnit(t,"dumb")
local integer letter=GetHandleInt(t,"letter")
local string s
local unit dumb2
if letter == 1 then
set s = "A"
endif
if letter == 2 then
set s = "n"
endif
if letter == 3 then
set s = "s"
endif
if letter == 4 then
set s = "i"
endif
if letter == 5 then
set s = "r"
endif
if letter == 6 then
set s = "i"
endif
if letter == 7 then
set s = "a"
endif
if s != "" then
set dumb2 = CreateUnitAtLoc(Player(0), 'u000', GetUnitLoc(dumb), 0)
call SetUnitFlyHeight(dumb2,340,999999)
call SetUnitScale(dumb,4,4,4)
call AddDummyEffect(dumb2, "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl")
call UnitApplyTimedLifeBJ( 2, 'BTLF', dumb2 )
endif
call CreateTextTagUnitBJ( s, dumb, 0, 50, 0, 50, 100, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 30, 90 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 6.50 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 3.00 )
call SetHandleInt(t, "letter", letter+1)
set t=null
set dumb=null
set dumb2=null
endfunction
function Trig_win_fx_Actions takes nothing returns nothing
local unit dumb
local timer t = CreateTimer()
set dumb = CreateUnitAtLoc(Player(0), 'u000', GetRectCenter(gg_rct_win_start), 0)
call AddDummyEffect(dumb, "Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl")
call SetUnitFlyHeight(dumb,510,999999)
call SetUnitScale(dumb,1.5,1.5,1.5)
call SetUnitMoveSpeed( dumb, 250 )
call IssuePointOrderLocBJ( dumb, "move", GetRectCenter(gg_rct_win_end) )
call UnitApplyTimedLifeBJ( 3, 'BTLF', dumb )
call TriggerSleepAction( 0.02 )
call SetHandleHandle(t,"dumb",dumb)
call SetHandleInt(t, "letter", 1)
call TimerStart(t, 0.25, true, function win_fx_letters )
call TriggerSleepAction( 2 )
set dumb = CreateUnitAtLoc(Player(0), 'u000', GetRectCenter(gg_rct_win_end), 180)
call AddDummyEffect(dumb, "Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl")
call SetUnitFlyHeight(dumb,400,999999)
call SetUnitScale(dumb,1.5,1.5,1.5)
call SetUnitMoveSpeed( dumb, 250 )
call IssuePointOrderLocBJ( dumb, "move", GetRectCenter(gg_rct_win_start) )
call UnitApplyTimedLifeBJ( 3, 'BTLF', dumb )
call TriggerSleepAction( 0.2 )
call SetHandleHandle(t,"dumb",dumb)
call SetHandleInt(t, "letter", 1)
call TimerStart(t, 0.25, true, function win_fx_letters2 )
call TriggerSleepAction( 6 )
set dumb = CreateUnitAtLoc(Player(0), 'u000', GetRectCenter(gg_rct_win_start), 0)
call AddDummyEffect(dumb, "Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl")
call SetUnitFlyHeight(dumb,420,999999)
call SetUnitScale(dumb,3,3,3)
call SetUnitMoveSpeed( dumb, 250 )
call IssuePointOrderLocBJ( dumb, "move", GetRectCenter(gg_rct_win_end) )
call UnitApplyTimedLifeBJ( 3, 'BTLF', dumb )
call TriggerSleepAction( 0.06 )
call SetHandleHandle(t,"dumb",dumb)
call SetHandleInt(t, "letter", 1)
call TimerStart(t, 0.3, true, function win_fx_letters3 )
call TriggerSleepAction( 3 )
call DestroyTimer(t)
set t = null
set dumb = CreateUnitAtLoc(Player(0), 'u000', GetRectCenter(gg_rct_hammer_start), 270)
call AddDummyEffect(dumb, "Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl")
call SetUnitFlyHeight(dumb,500,999999)
call SetUnitScale(dumb,1,1,1)
call SetUnitMoveSpeed( dumb, 500 )
call IssuePointOrderLocBJ( dumb, "move", GetRectCenter(gg_rct_hammer_end) )
call UnitApplyTimedLifeBJ( 3, 'BTLF', dumb )
set dumb = null
endfunction
//===========================================================================
function InitTrig_win_fx takes nothing returns nothing
set gg_trg_win_fx = CreateTrigger( )
call TriggerAddAction( gg_trg_win_fx, function Trig_win_fx_Actions )
endfunction