// ********************************************************************************
// DAMAGETEXT-EINSTELLUNGEN
// ********************************************************************************
function DisplayDamageText takes unit target, real value, real lifetime, real scaler, real rot, real grun, real blau, boolean iscrit returns nothing
local location loc = PolarProjectionBJ(GetUnitLoc(target), GetRandomReal(0, 30.00), GetRandomReal(45.00, 135.00))
if ( iscrit ) then
call CreateTextTagLocBJ( I2S(R2I(value)) + "!", loc, GetRandomReal(10.00, 25.00), 8 + (scaler * GetRandomReal(4.00, 6.00)), rot, grun, blau, 0 )
else
call CreateTextTagLocBJ( I2S(R2I(value)), loc, GetRandomReal(10.00, 25.00), 8 + (scaler * GetRandomReal(4.00, 6.00)), rot, grun, blau, 0 )
endif
call ShowTextTagForceBJ( true, GetLastCreatedTextTag(), GetPlayersAll() )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), lifetime )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 30.00, 90 )
call RemoveLocation(loc)
set loc = null
endfunction
// ********************************************************************************
// MAGIC DMG (BLAU)
// Funktion zur Schädigung und Floatingtexterstellung bei magischem Schaden.
// Magischer Schaden kann critten mit Chance critchance*INT und Multiplikator critmulti.
// Des weiteren kann Lebenszeit (lifetime) direkt geändert werden. Andere sachen sollten optimal sein!
// Crits "leben" länger.
// Critchance ist höher, wenn Unit "totally wasted" ist.
// ********************************************************************************
function DamageTargetWithTextMagic takes unit caster, unit target, real damage, real scaler, boolean crit returns nothing
local real critchance = 0.2
local real critwert
local real critmulti = 2
local real critsize = 1.5
local real lifetime = 1.25
local boolean iscrit = false
local player p = GetOwningPlayer(caster)
// Voll Besoffen-Bonus
if ( UnitHasBuffBJ(caster, 'B018') ) then
set damage = 1.3 * damage
endif
// Bonus durch Items (Rüstung + Waffe + Trinket) und Critchance
set damage = damage * ( 1 + (0.01 * GetUnitAbilityLevel(udg_HeroID[GetPlayerId(p)+1], 'A06R')) + (0.01 * GetUnitAbilityLevel(udg_HeroID[GetPlayerId(p)+1], 'A071')) + (0.01 * GetUnitAbilityLevel(udg_HeroID[GetPlayerId(p)+1], 'A07U')))
set critwert = critchance * I2R(GetHeroStatBJ(bj_HEROSTAT_INT, udg_HeroID[GetPlayerId(p)+1], false)) + I2R(GetUnitAbilityLevel(udg_HeroID[GetPlayerId(p)+1], 'A06Q'))
// Arcane Power Bonus
if ( UnitHasBuffBJ(caster, 'B01W') )then
set damage = damage * 2
set critwert = critwert * 3
endif
if ( ( GetRandomReal(0, 100.00) <= critwert ) and crit ) then
set damage = damage * critmulti
set scaler = scaler * critsize
set lifetime = lifetime + 0.25
set iscrit = true
endif
call UnitDamageTargetBJ( caster, target, damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING )
call DisplayDamageText(target, damage, lifetime, scaler, 25, 25, 100, iscrit)
set caster = null
set target = null
set p = null
endfunction
// ********************************************************************************
// MAGIC HEAL (GRÜN)
// Funktion zur Heilung und Floatingtexterstellung.
// Heilung kann critten mit Chance critchance*INT und Multiplikator critmulti.
// Des weiteren kann Lebenszeit (lifetime) direkt geändert werden. Andere sachen sollten optimal sein!
// Crits "leben" länger.
// Critchance ist höher, wenn Unit "totally wasted" ist.
// ********************************************************************************
function HealTargetWithTextMagic takes unit caster, unit target, real heal, real scaler, boolean crit returns nothing
local real critchance = 0.2
local real critwert
local real critmulti = 2
local real critsize = 1.5
local real lifetime = 1.25
local boolean iscrit = false
local player p = GetOwningPlayer(caster)
local player p1 = GetOwningPlayer(target)
// Voll Besoffen-Bonus
if ( UnitHasBuffBJ(caster, 'B018') )then
set heal = 1.3 * heal
endif
// Bonus durch Items (Waffe + Trinket) und Critchance
set heal = heal * ( 1 + (0.01 * GetUnitAbilityLevel(udg_HeroID[GetPlayerId(p)+1], 'A06S')) + (0.01 * GetUnitAbilityLevel(udg_HeroID[GetPlayerId(p)+1], 'A06Z')) + (0.01 * GetUnitAbilityLevel(udg_HeroID[GetPlayerId(p1)+1], 'A070')) )
set critwert = critchance * I2R(GetHeroStatBJ(bj_HEROSTAT_INT, udg_HeroID[GetPlayerId(p)+1], false)) + I2R(GetUnitAbilityLevel(udg_HeroID[GetPlayerId(p)+1], 'A06T'))
// Arcane Power Bonus
if ( UnitHasBuffBJ(caster, 'B01W') )then
set heal = heal * 2
set critwert = critwert * 3
endif
if ( ( GetRandomReal(0, 100.00) <= critwert ) and crit ) then
set heal = heal * critmulti
set scaler = scaler * critsize
set lifetime = lifetime + 0.25
set iscrit = true
endif
call SetUnitLifeBJ( target, ( GetUnitStateSwap(UNIT_STATE_LIFE, target) + heal ) )
call DisplayDamageText(target, heal, lifetime, scaler, 0, 100, 0, iscrit)
set caster = null
set target = null
set p = null
set p1 = null
endfunction
// ********************************************************************************
// PHYSISCH DMG (ROT)
// Funktion zur Schädigung und Floatingtexterstellung bei physischem Schaden.
// Physischer Schaden kann critten mit Chance critchance*AGI und Multiplikator critmulti
// Des weiteren kann Lebenszeit (lifetime) direkt geändert werden. Andere sachen sollten optimal sein!
// Crits "leben" länger.
// Critchance steigt mit entsprechender Trinket/Armor-Ability
// ********************************************************************************
function DamageTargetWithTextPhysical takes unit caster, unit target, real damage, real scaler, boolean crit returns nothing
local real critchance = 0.1
local real critmulti = 2
local real critsize = 1.5
local real lifetime = 1.25
local boolean iscrit = false
local player p = GetOwningPlayer(caster)
// Voll Besoffen-Bonus
if ( UnitHasBuffBJ(caster, 'B018') )then
set damage = 1.3 * damage
endif
if ( ( GetRandomReal(0, 100.00) <= ( critchance * I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, caster, false)) + I2R(GetUnitAbilityLevel(udg_HeroID[GetPlayerId(p)+1], 'A08G')) ) ) and crit ) then
set damage = damage * critmulti
set scaler = scaler * critsize
set lifetime = lifetime + 0.25
set iscrit = true
endif
call UnitDamageTargetBJ( caster, target, damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call DisplayDamageText(target, damage, lifetime, scaler, 100, 25, 25, iscrit)
set caster = null
set target = null
set p = null
endfunction
// ********************************************************************************
// HOST-BESTIMMUNG
// ********************************************************************************
function GetHost takes nothing returns nothing
local gamecache g = InitGameCache("Map.w3v")
call StoreInteger ( g, "Map", "Host", GetPlayerId(GetLocalPlayer ())+1)
call TriggerSyncStart ()
call SyncStoredInteger ( g, "Map", "Host" )
call TriggerSyncReady ()
set udg_Host = Player( GetStoredInteger ( g, "Map", "Host" )-1)
call FlushGameCache( g )
set g = null
endfunction
// ********************************************************************************
// KILLPERMINUTE-HANDLEVARBESTIMMUNG
// ********************************************************************************
function KPMUpdater takes nothing returns nothing
local timer t = GetExpiredTimer()
local player p = LoadPlayerHandle(udg_methorn, GetHandleId(t), 5)
local integer i = GetConvertedPlayerId(p)
call FlushChildHashtable(udg_methorn, GetHandleId(t))
call DestroyTimer(t)
set t = null
set udg_kills60[i] = udg_kills60[i] - 1
set udg_kills60[0] = udg_kills60[0] - 1
call MultiboardSetItemValueBJ( udg_Multiboard, 5, udg_MultiboardRow[i], I2S(udg_kills60[i]) )
call MultiboardSetItemValueBJ( udg_Multiboard, 5, udg_MultiboardRow[13], I2S(udg_kills60[0]) )
call MultiboardSetItemValueBJ( udg_Multiboard, 5, udg_MultiboardRow[14], I2S(R2I(( I2R(udg_kills60[0]) / ( I2R(udg_MultiboardRow[13]) - 3.00 ) ))) )
set p = null
endfunction
// ********************************************************************************
// Boss Disengage
// ********************************************************************************
function BossDisengageGroupcond takes nothing returns boolean
if ( ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(GetFilterUnit()) == true ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), Player(0)) ) and ( GetUnitTypeId(GetFilterUnit()) != 'u002' ) ) then
return true
endif
return false
endfunction
function BossDisengage takes unit boss returns boolean
local location loc = GetUnitLoc(boss)
local group g = GetUnitsInRangeOfLocMatching(1000.00, loc, Condition(function BossDisengageGroupcond))
local integer i = CountUnitsInGroup(g)
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set boss = null
if ( i == 0 ) then
return true
endif
return false
endfunction
// ********************************************************************************
// Funktion zur Bestimmung des Helden mit niedrigster/höchster HP in Reichweite "r" von Caster-Unit "u"
// ********************************************************************************
function LeaderboardPlayerCond takes nothing returns boolean
return ( GetPlayerController(GetFilterPlayer()) == MAP_CONTROL_USER )
endfunction
function LeaderboardPlayerAddCond takes nothing returns boolean
local location loc = GetUnitLoc(udg_g_unit[20])
local location loc2 = GetUnitLoc(udg_HeroID[GetConvertedPlayerId(GetEnumPlayer())])
if ( ( DistanceBetweenPoints(loc, loc2) <= udg_g_real[5] ) and ( IsUnitAliveBJ(udg_HeroID[GetConvertedPlayerId(GetEnumPlayer())]) == true ) and ( UnitHasBuffBJ(udg_HeroID[GetConvertedPlayerId(GetEnumPlayer())], 'B001') == false ) ) then
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
return true
endif
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
return false
endfunction
function LeaderboardPlayerAdd takes nothing returns nothing
if ( LeaderboardPlayerAddCond() ) then
call LeaderboardAddItemBJ( GetEnumPlayer(), GetLastCreatedLeaderboard(), GetPlayerName(GetEnumPlayer()), R2I(GetUnitStateSwap(UNIT_STATE_LIFE, udg_HeroID[GetConvertedPlayerId(GetEnumPlayer())])) )
endif
endfunction
function ReturnLowestHpHero takes unit u, real r returns unit
set udg_g_unit[20] = u
set udg_g_real[5] = r
call CreateLeaderboardBJ( GetPlayersMatching(Condition(function LeaderboardPlayerCond)), "Dummyboard" )
call LeaderboardDisplayBJ( false, GetLastCreatedLeaderboard() )
call ForForce( GetPlayersMatching(Condition(function LeaderboardPlayerCond)), function LeaderboardPlayerAdd )
call LeaderboardSortItemsBJ( GetLastCreatedLeaderboard(), bj_SORTTYPE_SORTBYVALUE, false )
set udg_g_unit[20] = udg_HeroID[GetConvertedPlayerId(LeaderboardGetIndexedPlayerBJ(1, GetLastCreatedLeaderboard()))]
call DestroyLeaderboardBJ( GetLastCreatedLeaderboard() )
return udg_g_unit[20]
endfunction
function ReturnHighestHpHero takes unit u, real r returns unit
set udg_g_unit[20] = u
set udg_g_real[5] = r
call CreateLeaderboardBJ( GetPlayersMatching(Condition(function LeaderboardPlayerCond)), "Dummyboard" )
call LeaderboardDisplayBJ( false, GetLastCreatedLeaderboard() )
call ForForce( GetPlayersMatching(Condition(function LeaderboardPlayerCond)), function LeaderboardPlayerAdd )
call LeaderboardSortItemsBJ( GetLastCreatedLeaderboard(), bj_SORTTYPE_SORTBYVALUE, true )
set udg_g_unit[20] = udg_HeroID[GetConvertedPlayerId(LeaderboardGetIndexedPlayerBJ(1, GetLastCreatedLeaderboard()))]
call DestroyLeaderboardBJ( GetLastCreatedLeaderboard() )
return udg_g_unit[20]
endfunction
// ********************************************************************************
// Funktion zur Bestimmung der Uhrzeit in Form m:ss
// ********************************************************************************
function Uhrzeitumrechnung takes integer zeit returns string
local string minuten
local string sekunden
local string ausgabe
set minuten = I2S(R2I(I2R(zeit)/60))
set sekunden = I2S(zeit - (60*S2I(minuten)))
if ( StringLength(sekunden) == 1 ) then
set sekunden = ("0" + sekunden)
endif
set ausgabe = (minuten + ":" + sekunden)
return ausgabe
endfunction
// ********************************************************************************
//Funktion, um Einheit u über i 100-tel-Sekunden verschwinden zu lassen, wenn gewünscht auch am Ende entfernen.
// ********************************************************************************
function FadeUnitOutDo takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(udg_methorn, GetHandleId(t), 6)
local real r = LoadReal(udg_methorn, GetHandleId(t), 7)
local real g = LoadReal(udg_methorn, GetHandleId(t), 8)
local real b = LoadReal(udg_methorn, GetHandleId(t), 9)
local integer iter = LoadInteger(udg_methorn, GetHandleId(t), 10)
local integer imax = LoadInteger(udg_methorn, GetHandleId(t), 11)
local boolean remove = LoadBoolean(udg_methorn, GetHandleId(t), 12)
local real alpha = LoadReal(udg_methorn, GetHandleId(t), 13)
set iter = iter + 1
if ( iter <= imax ) then
call SetUnitVertexColorBJ(u, r, g, b, alpha + (I2R(iter)/I2R(imax)*(100-alpha)))
call SaveInteger(udg_methorn, GetHandleId(t), 10, iter)
else
call PauseTimer(t)
call FlushChildHashtable(udg_methorn, GetHandleId(t))
call DestroyTimer(t)
if ( remove ) then
call RemoveUnit(u)
endif
endif
set t = null
set u = null
endfunction
function FadeUnitOut takes unit u, real r, real g, real b, real alpha, integer i, boolean remove returns nothing
local timer t = CreateTimer()
call SaveUnitHandle(udg_methorn, GetHandleId(t), 6, u)
call SaveReal(udg_methorn, GetHandleId(t), 7, r)
call SaveReal(udg_methorn, GetHandleId(t), 8, g)
call SaveReal(udg_methorn, GetHandleId(t), 9, b)
call SaveInteger(udg_methorn, GetHandleId(t), 10, 0)
call SaveInteger(udg_methorn, GetHandleId(t), 11, i)
call SaveBoolean(udg_methorn, GetHandleId(t), 12, remove)
call SaveReal(udg_methorn, GetHandleId(t), 13, alpha)
call TimerStart(t, 0.01, true, function FadeUnitOutDo)
set t = null
set u = null
endfunction
// ********************************************************************************
// Funktion, um Floatingtext "txt" an für "iter" 100stel-Sekunden an Unit "u" anzuhängen.
// ********************************************************************************
function MoveAttachedFloattext takes nothing returns nothing
local timer t = GetExpiredTimer()
local texttag text = LoadTextTagHandle(udg_methorn, GetHandleId(t), 2)
local unit u = LoadUnitHandle(udg_methorn, GetHandleId(t), 3)
local integer iter = LoadInteger(udg_methorn, GetHandleId(t), 4) - 1
local location loc = GetUnitLoc(u)
call SaveInteger(udg_methorn, GetHandleId(t), 4, iter)
if ( ( iter >= 0 ) and ( IsUnitAliveBJ(u) ) ) then
call SetTextTagPosBJ(text, loc, 50.00 + GetUnitFlyHeight(u))
else
call SaveTimerHandle(udg_methorn, GetHandleId(u), 1, null)
call SaveTextTagHandle(udg_methorn, GetHandleId(u), 2, null)
call DestroyTextTag(text)
call PauseTimer(t)
call FlushChildHashtable(udg_methorn, GetHandleId(t))
call DestroyTimer(t)
endif
call RemoveLocation(loc)
set loc = null
set u = null
set text = null
set t = null
endfunction
function AttachFloattext takes unit u, integer iter, string txt returns nothing
local timer t = LoadTimerHandle(udg_methorn, GetHandleId(u), 1)
local location loc = GetUnitLoc(u)
local texttag text = LoadTextTagHandle(udg_methorn, GetHandleId(u), 2)
call SaveTimerHandle(udg_methorn, GetHandleId(u), 1, null)
call SaveTextTagHandle(udg_methorn, GetHandleId(u), 2, null)
call DestroyTextTag(text)
call PauseTimer(t)
call FlushChildHashtable(udg_methorn, GetHandleId(t))
call DestroyTimer(t)
set t = CreateTimer()
set text = CreateTextTagLocBJ( txt, loc, 50.00 + GetUnitFlyHeight(u), 9.00, 100, 100, 100, 0 )
call SetTextTagPermanent( text, false )
call SetTextTagLifespan( text, I2R(iter/100) )
call SaveTimerHandle(udg_methorn, GetHandleId(u), 1, t)
call SaveTextTagHandle(udg_methorn, GetHandleId(u), 2, text)
call SaveTextTagHandle(udg_methorn, GetHandleId(t), 2, text)
call SaveUnitHandle(udg_methorn, GetHandleId(t), 3, u)
call SaveInteger(udg_methorn, GetHandleId(t), 4, iter)
call TimerStart(t, 0.01, true, function MoveAttachedFloattext)
call RemoveLocation(loc)
set loc = null
set u = null
set t = null
set text = null
endfunction
// ********************************************************************************
// Funktion, um Gold mit Floatingtext und Sound an alle Spieler zu verteilen (Bosse)
// ********************************************************************************
function WaveBountyBossText takes integer betrag, player p, location loc returns nothing
local texttag txt = CreateTextTagLocBJ( "+" + I2S(betrag), loc, 25, 11, 255, 200, 0, 0 )
call ShowTextTagForceBJ( false, txt, GetPlayersAll() )
call ShowTextTagForceBJ( true, txt, GetForceOfPlayer(p) )
call SetTextTagPermanentBJ( txt, false )
call SetTextTagLifespanBJ( txt, 1.8 )
call SetTextTagVelocityBJ( txt, 35.00, 90 )
set p = null
set loc = null
endfunction
function BountyGiver takes integer geld, location loc returns nothing
local integer iter = 3
loop
exitwhen iter > 11
if (UnitHasBuffBJ(udg_HeroID[iter+1], 'B029')) then
call SetPlayerState(Player(iter), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(iter), PLAYER_STATE_RESOURCE_GOLD) + R2I(1.35 * geld))
call WaveBountyBossText(R2I(1.35*geld), Player(iter), loc)
else
call SetPlayerState(Player(iter), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(iter), PLAYER_STATE_RESOURCE_GOLD) + geld)
call WaveBountyBossText(geld, Player(iter), loc)
endif
set iter = iter + 1
endloop
call PlaySoundBJ( gg_snd_ReceiveGold )
call RemoveLocation(loc)
set loc = null
endfunction
// ********************************************************************************
// Funktionen, um Gold mit Floatingtext an Spieler entsprechend Verteilungsquote zu verteilen (Waves)
// ********************************************************************************
function WaveBountyText takes integer betrag, player p, location loc returns nothing
local texttag txt = CreateTextTagLocBJ( "+" + I2S(betrag), loc, 25, 8, 255, 200, 0, 0 )
call ShowTextTagForceBJ( false, txt, GetPlayersAll() )
call ShowTextTagForceBJ( true, txt, GetForceOfPlayer(p) )
call SetTextTagPermanentBJ( txt, false )
call SetTextTagLifespanBJ( txt, 1.8 )
call SetTextTagVelocityBJ( txt, 35.00, 90 )
set p = null
set loc = null
endfunction
function WaveBountyDetermination takes integer utype returns real
local real bounty = 0
// Peon
if ( utype == 'o002' ) then
set bounty = R2I(GetRandomInt(1,3))
return bounty
endif
if ( utype == 'o003' ) then
set bounty = R2I(GetRandomInt(3,5))
return bounty
endif
// Grunt
if ( utype == 'o000' ) then
set bounty = R2I(GetRandomInt(4,6))
return bounty
endif
if ( utype == 'o001' ) then
set bounty = R2I(GetRandomInt(8,12))
return bounty
endif
// Raider
if ( utype == 'o004' ) then
set bounty = R2I(GetRandomInt(5,10))
return bounty
endif
if ( utype == 'o005' ) then
set bounty = R2I(GetRandomInt(10,20))
return bounty
endif
// Headhunter
if ( utype == 'o006' ) then
set bounty = R2I(GetRandomInt(5,8))
return bounty
endif
if ( utype == 'o007' ) then
set bounty = R2I(GetRandomInt(10,16))
return bounty
endif
// Witch Doctor
if ( utype == 'o008' ) then
set bounty = R2I(GetRandomInt(4,6))
endif
if ( utype == 'o009' ) then
set bounty = R2I(GetRandomInt(10,15))
return bounty
endif
// Ogres
if ( utype == 'n00L' ) then
set bounty = R2I(GetRandomInt(10,20))
return bounty
endif
if ( utype == 'n00M' ) then
set bounty = R2I(GetRandomInt(20,35))
return bounty
endif
if ( utype == 'n00N' ) then
set bounty = R2I(GetRandomInt(10,20))
return bounty
endif
// Goblins
if ( utype == 'n00K' ) then
set bounty = R2I(GetRandomInt(1,2))
return bounty
endif
if ( utype == 'n00H' ) then
set bounty = R2I(GetRandomInt(1,5))
return bounty
endif
if ( utype == 'n00J' ) then
set bounty = R2I(GetRandomInt(15,25))
return bounty
endif
if ( utype == 'n00I' ) then
set bounty = R2I(GetRandomInt(15,25))
return bounty
endif
// Shaman
if ( utype == 'o00O' ) then
set bounty = R2I(GetRandomInt(10,20))
return bounty
endif
// Katapult und Tower
if ( (utype == 'o00Q') or (utype == 'o00R') ) then
set bounty = 25
return bounty
endif
// Skelette
if ( utype == 'u00F' ) then
set bounty = R2I(GetRandomInt(5,10))
return bounty
endif
if ( utype == 'u00G' ) then
set bounty = R2I(GetRandomInt(5,10))
return bounty
endif
if ( utype == 'n00R' ) then
set bounty = R2I(GetRandomInt(5,10))
endif
// Ghoul
if ( utype == 'u00D' ) then
set bounty = R2I(GetRandomInt(10,15))
return bounty
endif
// Abo
if ( utype == 'u00E' ) then
set bounty = R2I(GetRandomInt(25,35))
return bounty
endif
// Eredar Sorcerer
if ( utype == 'n010' ) then
set bounty = R2I(GetRandomInt(15,20))
return bounty
endif
if ( utype == 'n011' ) then
set bounty = R2I(GetRandomInt(30,50))
return bounty
endif
// Felguard
if ( utype == 'n00S' ) then
set bounty = R2I(GetRandomInt(10,15))
return bounty
endif
if ( utype == 'n00T' ) then
set bounty = R2I(GetRandomInt(20,30))
return bounty
endif
// Felguard
if ( utype == 'n00U' ) then
set bounty = R2I(GetRandomInt(15,25))
return bounty
endif
if ( utype == 'n00V' ) then
set bounty = R2I(GetRandomInt(30,50))
return bounty
endif
// Succubus
if ( utype == 'n00W' ) then
set bounty = R2I(GetRandomInt(10,20))
return bounty
endif
if ( utype == 'n00X' ) then
set bounty = R2I(GetRandomInt(25,40))
return bounty
endif
// Nether Drake
if ( utype == 'n00Y' ) then
set bounty = R2I(GetRandomInt(15,30))
return bounty
endif
// Void Walker
if ( utype == 'n00Z' ) then
set bounty = R2I(GetRandomInt(15,30))
return bounty
endif
return bounty
endfunction
function WaveBountyGiver takes unit u, player p returns nothing
local integer utype = GetUnitTypeId(u)
local location loc = GetUnitLoc(u)
local real bounty = WaveBountyDetermination(utype)
local real shareanteil = udg_g_real[8]
local real killerbounty
local real killerbountygreed
local real allybounty
local real allybountygreed
local real uberhang
local integer intkillerbounty
local integer intallybounty
local integer killeri = GetPlayerId(p) + 1
local integer iter = 4
// Berechnung der jeweiligen Bounties und call der Floattexts
set allybounty = shareanteil * bounty / I2R(udg_g_integer[2])
set allybountygreed = 1.35 * allybounty
set killerbounty = (1-shareanteil) * bounty + allybounty
set killerbountygreed = 1.35 * killerbounty
loop
exitwhen iter > 12
if ( GetPlayerSlotState(Player(iter-1)) == PLAYER_SLOT_STATE_PLAYING ) then
if ( Player(iter-1) == p ) then
if ( UnitHasBuffBJ(udg_HeroID[iter], 'B029') ) then
set intkillerbounty = R2I(killerbountygreed)
set uberhang = killerbountygreed - R2I(killerbountygreed)
else
set intkillerbounty = R2I(killerbounty)
set uberhang = killerbounty - R2I(killerbounty)
endif
set uberhang = uberhang + udg_bountyuberhang[iter]
set intkillerbounty = intkillerbounty + R2I(uberhang)
set udg_bountyuberhang[iter] = uberhang - R2I(uberhang)
if ( intkillerbounty >= 1 ) then
call WaveBountyText(intkillerbounty,Player(iter-1),loc)
call SetPlayerState(Player(iter-1), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(iter-1), PLAYER_STATE_RESOURCE_GOLD) + intkillerbounty)
endif
else
if ( UnitHasBuffBJ(udg_HeroID[iter], 'B029') ) then
set intallybounty = R2I(allybountygreed)
set uberhang = allybountygreed - R2I(allybountygreed)
else
set intallybounty = R2I(allybounty)
set uberhang = allybounty - R2I(allybounty)
endif
set uberhang = uberhang + udg_bountyuberhang[iter]
set intallybounty = intallybounty + R2I(uberhang)
set udg_bountyuberhang[iter] = uberhang - R2I(uberhang)
if ( intallybounty >= 1 ) then
call WaveBountyText(intallybounty,Player(iter-1),loc)
call SetPlayerState(Player(iter-1), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(iter-1), PLAYER_STATE_RESOURCE_GOLD) + intallybounty)
endif
endif
endif
set iter = iter + 1
endloop
// Unleak
set u = null
set p = null
call RemoveLocation(loc)
set loc = null
endfunction
// ********************************************************************************
// Funktion zum Entfernen eines Helden bei Dissipate
// ********************************************************************************
function DissipateHero takes integer i returns nothing
call DestroyTimerDialogBJ( udg_death_window[i] )
call PauseTimerBJ( true, udg_death_timer[i] )
call DestroyTimer(udg_death_timer[i])
call AddSpecialEffectTargetUnitBJ( "origin", udg_death_unit[i], "Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl" )
call KillUnit( udg_death_unit[i] )
call SetUnitAnimation( udg_death_unit[i], "decay" )
call DisplayTimedTextToForce( GetForceOfPlayer(ConvertedPlayer(i)), 15.00, "Your hero dissipated and cannot be resurrected any more. It's lost forever!" )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[i], "ReplaceableTextures\\CommandButtons\\BTNShade.blp" )
call MultiboardSetItemValueBJ( udg_Multiboard, 1, udg_MultiboardRow[i], " -" )
call PolledWait( 3.00 )
call RemoveUnit( udg_death_unit[i] )
endfunction
// ********************************************************************************
// Funktion die prüft, ob Einheit Untot oder Dämon ist
// ********************************************************************************
function IsUnitDemonOrUndead takes unit u returns boolean
if ( IsUnitIdType(GetUnitTypeId(u), UNIT_TYPE_UNDEAD) ) then
set u = null
return true
endif
if ( ( GetUnitTypeId(u) == 'N00P' ) or ( GetUnitTypeId(u) == 'U00C' ) or ( GetUnitTypeId(u) == 'n00Y' ) or ( GetUnitTypeId(u) == 'n010' ) or ( GetUnitTypeId(u) == 'n011' ) or ( GetUnitTypeId(u) == 'n00U' ) or ( GetUnitTypeId(u) == 'n00V' ) or ( GetUnitTypeId(u) == 'n00S' ) or ( GetUnitTypeId(u) == 'n00T' ) or ( GetUnitTypeId(u) == 'n00W' ) or ( GetUnitTypeId(u) == 'n00X' ) or ( GetUnitTypeId(u) == 'n00Z' ) ) then
set u = null
return true
endif
set u = null
return false
endfunction
// ********************************************************************************
// Funktion, die bei Evolution Dauer-Buffs (Met usw.) bzw. deren Effekte (Itemabilities)
// übernimmt wenn vorhanden.
// ********************************************************************************
function BuffAdoption takes unit u returns nothing
local player p = GetOwningPlayer(u)
local timer mett = LoadTimerHandle(udg_methorn, GetHandleId(p), 100)
local unit metdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 101)
local unit mettrinker = LoadUnitHandle(udg_methorn, GetHandleId(mett), 102)
local timer dext = LoadTimerHandle(udg_methorn, GetHandleId(p), 120)
local unit dexdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 121)
local integer dexlvl = LoadInteger(udg_methorn, GetHandleId(p), 122)
local unit dextarget = LoadUnitHandle(udg_methorn, GetHandleId(dext), 129)
local timer mightt = LoadTimerHandle(udg_methorn, GetHandleId(p), 123)
local unit mightdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 124)
local integer mightlvl = LoadInteger(udg_methorn, GetHandleId(p), 125)
local unit mighttarget = LoadUnitHandle(udg_methorn, GetHandleId(mightt), 129)
local timer wisdomt = LoadTimerHandle(udg_methorn, GetHandleId(p), 126)
local unit wisdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 127)
local integer wislvl = LoadInteger(udg_methorn, GetHandleId(p), 128)
local unit wistarget = LoadUnitHandle(udg_methorn, GetHandleId(wisdomt), 129)
if ( metdummy != null ) then
call UnitAddAbilityBJ( 'A047', u )
// call SetHandleHandle(u, "metdummy", metdummy) <- müsste eigentlich unnötig sein, da metdummy jetzt an player attached wird
call SaveUnitHandle(udg_methorn, GetHandleId(mett), 102, u)
endif
if ( dexdummy != null ) then
if ( dexlvl == 1 ) then
call UnitAddAbilityBJ( 'A05Q', u )
else
call UnitAddAbilityBJ( 'A05R', u )
endif
// call SetHandleHandle(u, "dexdummy", dexdummy) s. o.
call SaveUnitHandle(udg_methorn, GetHandleId(dext), 129, u)
endif
if ( mightdummy != null ) then
if ( mightlvl == 1 ) then
call UnitAddAbilityBJ( 'A05T', u )
else
call UnitAddAbilityBJ( 'A05U', u )
endif
// call SetHandleHandle(u, "mightdummy", mightdummy)
call SaveUnitHandle(udg_methorn, GetHandleId(mightt), 129, u)
endif
if ( wisdummy != null ) then
if ( wislvl == 1 ) then
call UnitAddAbilityBJ( 'A05V', u )
else
call UnitAddAbilityBJ( 'A05W', u )
endif
// call SetHandleHandle(u, "wisdummy", wisdummy)
call SaveUnitHandle(udg_methorn, GetHandleId(wisdomt), 129, u)
endif
set p = null
set mett = null
set mettrinker = null
set metdummy = null
set dext = null
set dextarget = null
set dexdummy = null
set mightt = null
set mighttarget = null
set mightdummy = null
set wisdomt = null
set wistarget = null
set wisdummy = null
endfunction
// ********************************************************************************
// ATTACKMOVE RICHTUNG KING FÜR UNIT AUS GRUPPE + COND
// ********************************************************************************
function WaveAttackmoveGroupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) and ( GetOwningPlayer(GetFilterUnit()) == Player(0) ) ) ) then
return true
endif
return false
endfunction
function WaveAttackmove takes nothing returns nothing
local location loc = Location(-600.00, 1300.00)
call IssuePointOrderLoc( GetEnumUnit(), "attack", loc )
call RemoveLocation(loc)
set loc = null
endfunction
// ********************************************************************************
// Funktion, die beim Kauf eines Items bzw. -typs die dem Unittyp (Heroklasse) entsprechenden
// Abilities hinzufügt.
// ********************************************************************************
function AddItemAbilitiesToHero takes unit u, integer i returns nothing
local integer utyp = GetUnitTypeId(u)
local integer damage = 'A06N'
local integer attspeed = 'A06O'
local integer leech = 'A06P'
local integer spellcrit = 'A06Q'
local integer spelldmg = 'A06R'
local integer armorspelldmg = 'A07U'
local integer heal = 'A06S'
local integer healcrit = 'A06T'
local integer trinketheal = 'A06Z'
local integer trinketspelldmg = 'A071'
local integer trinkethp = 'A072'
local integer trinketrheal = 'A070'
local integer movespeed = 'A089'
local integer bonushp = 'A08B'
local boolean acolyte = false
local boolean adept = false
local boolean battlemage = false
local boolean cannoneer = false
local boolean captain = false
local boolean champion = false
local boolean cleric = false
local boolean guard = false
local boolean gunner = false
local boolean kingsguard = false
local boolean mage = false
local boolean marksman = false
local boolean mortarteam = false
local boolean rifleman = false
local boolean paladin = false
local boolean priest = false
local boolean shadowpriest = false
local boolean sorcerer = false
local boolean warlock = false
local boolean warrior = false
local boolean wizard = false
if ( utyp == 'H00P' ) then
set acolyte = true
endif
if ( utyp == 'H005' ) then
set adept = true
endif
if ( utyp == 'H00U' ) then
set battlemage = true
endif
if ( utyp == 'H00B' ) then
set cannoneer = true
endif
if ( utyp == 'H003' ) then
set captain = true
endif
if ( utyp == 'H002' ) then
set champion = true
endif
if ( utyp == 'H009' ) then
set cleric = true
endif
if ( utyp == 'H000' ) then
set guard = true
endif
if ( utyp == 'H00C' ) then
set gunner = true
endif
if ( utyp == 'H004' ) then
set kingsguard = true
endif
if ( utyp == 'H006' ) then
set mage = true
endif
if ( utyp == 'H00E' ) then
set marksman = true
endif
if ( utyp == 'H00D' ) then
set mortarteam = true
endif
if ( utyp == 'H00F' ) then
set rifleman = true
endif
if ( utyp == 'H00H' ) then
set paladin = true
endif
if ( utyp == 'H008' ) then
set priest = true
endif
if ( utyp == 'H00Q' ) then
set shadowpriest = true
endif
if ( utyp == 'H00A' ) then
set sorcerer = true
endif
if ( utyp == 'H00N' ) then
set warlock = true
endif
if ( utyp == 'H001' ) then
set warrior = true
endif
if ( utyp == 'H007' ) then
set wizard = true
endif
// Wand of Light
if ( i == 'I02D' ) then
if ( adept or cleric or paladin or priest or shadowpriest ) then
call UnitAddAbility(u, heal)
call SetUnitAbilityLevel(u, heal, 10)
call UnitAddAbility(u, healcrit)
call SetUnitAbilityLevel(u, healcrit, 5)
endif
if ( acolyte or adept or cleric or mage or priest or sorcerer or shadowpriest or warlock or wizard ) then
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 4)
endif
return
endif
// Staff of the Eclipse
if ( i == 'I02L' ) then
if ( acolyte or adept or battlemage or cleric or mage or priest or sorcerer or shadowpriest or warlock or wizard ) then
call UnitAddAbility(u, spelldmg)
call SetUnitAbilityLevel(u, spelldmg, 20)
call UnitAddAbility(u, spellcrit)
call SetUnitAbilityLevel(u, spellcrit, 15)
endif
return
endif
// Archmagi Wand
if ( i == 'I02N' ) then
if ( acolyte or adept or cleric or mage or priest or sorcerer or shadowpriest or warlock or wizard ) then
call UnitAddAbility(u, spelldmg)
call SetUnitAbilityLevel(u, spelldmg, 15)
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 10)
endif
if ( battlemage ) then
call UnitAddAbility(u, spelldmg)
call SetUnitAbilityLevel(u, spelldmg, 15)
endif
if ( acolyte or adept or battlemage or cleric or mage or paladin or priest or sorcerer or shadowpriest or warlock or wizard ) then
call UnitAddAbility(u, spellcrit)
call SetUnitAbilityLevel(u, spellcrit, 8)
call UnitAddAbility(u, healcrit)
call SetUnitAbilityLevel(u, healcrit, 8)
endif
if ( adept or cleric or paladin or priest or shadowpriest ) then
call UnitAddAbility(u, heal)
call SetUnitAbilityLevel(u, heal, 10)
endif
return
endif
// Wand of Power
if ( i == 'I02P' ) then
if ( acolyte or adept or cleric or mage or priest or sorcerer or shadowpriest or warlock or wizard ) then
call UnitAddAbility(u, spelldmg)
call SetUnitAbilityLevel(u, spelldmg, 15)
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 7)
call UnitAddAbility(u, spellcrit)
call SetUnitAbilityLevel(u, spellcrit, 3)
endif
return
endif
// Staff of Unstable Might
if ( i == 'I02R' ) then
if ( acolyte or adept or battlemage or cleric or mage or priest or sorcerer or shadowpriest or warlock or wizard ) then
call UnitAddAbility(u, spelldmg)
call SetUnitAbilityLevel(u, spelldmg, 5)
call UnitAddAbility(u, spellcrit)
call SetUnitAbilityLevel(u, spellcrit, 12)
endif
return
endif
// Staff of the Diviner
if ( i == 'I02T' ) then
if ( acolyte or adept or battlemage or cleric or mage or priest or sorcerer or shadowpriest or warlock or wizard ) then
call UnitAddAbility(u, spelldmg)
call SetUnitAbilityLevel(u, spelldmg, 5)
call UnitAddAbility(u, spellcrit)
call SetUnitAbilityLevel(u, spellcrit, 5)
endif
if ( adept or cleric or paladin or priest or shadowpriest ) then
call UnitAddAbility(u, heal)
call SetUnitAbilityLevel(u, heal, 20)
call UnitAddAbility(u, healcrit)
call SetUnitAbilityLevel(u, healcrit, 20)
endif
return
endif
// Sturdy Mace
if ( i == 'I031' ) then
if ( battlemage or captain or champion or guard or kingsguard or paladin or warrior ) then
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 12)
endif
if ( captain or kingsguard or paladin ) then
call UnitAddAbility(u, attspeed)
call SetUnitAbilityLevel(u, attspeed, 3)
endif
return
endif
// Fine Longsword
if ( i == 'I033' ) then
if ( battlemage or captain or champion or guard or kingsguard or paladin or warrior ) then
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 8)
endif
if ( battlemage or captain or guard or kingsguard or paladin ) then
call UnitAddAbility(u, attspeed)
call SetUnitAbilityLevel(u, attspeed, 2)
endif
if ( champion or warrior ) then
call UnitAddAbility(u, attspeed)
call SetUnitAbilityLevel(u, attspeed, 4)
endif
return
endif
// Templar's Blade
if ( i == 'I02V' ) then
if ( battlemage or captain or champion or guard or kingsguard or paladin or warrior ) then
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 15)
call UnitAddAbility(u, attspeed)
call SetUnitAbilityLevel(u, attspeed, 2)
endif
if ( adept or cleric or paladin or priest or shadowpriest ) then
call UnitAddAbility(u, heal)
call SetUnitAbilityLevel(u, heal, 20)
call UnitAddAbility(u, healcrit)
call SetUnitAbilityLevel(u, healcrit, 5)
endif
return
endif
// Battle Axe
if ( i == 'I02X' ) then
if ( battlemage or captain or champion or guard or kingsguard or paladin or warrior ) then
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 20)
endif
if ( champion or kingsguard or warrior ) then
call UnitAddAbility(u, attspeed)
call SetUnitAbilityLevel(u, attspeed, 4)
endif
return
endif
// Sorcerer's Edge
if ( i == 'I04Y' ) then
if ( battlemage or captain or champion or guard or kingsguard or paladin or warrior ) then
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 12)
call UnitAddAbility(u, attspeed)
call SetUnitAbilityLevel(u, attspeed, 2)
endif
if ( champion or kingsguard or warrior ) then
call UnitAddAbility(u, spellcrit)
call SetUnitAbilityLevel(u, spellcrit, 10)
endif
return
endif
// Vampiric Edge
if ( i == 'I02Z' ) then
if ( battlemage or captain or champion or guard or kingsguard or paladin or warrior ) then
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 16)
call UnitAddAbility(u, attspeed)
call SetUnitAbilityLevel(u, attspeed, 3)
endif
if ( captain or champion or guard or kingsguard or warrior ) then
call UnitAddAbility(u, leech)
call SetUnitAbilityLevel(u, leech, 20)
endif
if ( champion or warrior ) then
call SetUnitAbilityLevel(u, attspeed, 5)
endif
return
endif
// Ordinary Boomstick
if ( i == 'I035' ) then
if ( cannoneer or gunner or marksman or rifleman or mortarteam ) then
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 10)
call UnitAddAbility(u, attspeed)
call SetUnitAbilityLevel(u, attspeed, 1)
endif
return
endif
// Long Rifle
if ( i == 'I037' ) then
if ( cannoneer or gunner or marksman or rifleman or mortarteam ) then
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 15)
call UnitAddAbility(u, attspeed)
call SetUnitAbilityLevel(u, attspeed, 2)
endif
return
endif
// Blunderbuss
if ( i == 'I039' ) then
if ( cannoneer or gunner or marksman or rifleman or mortarteam ) then
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 30)
call UnitAddAbility(u, attspeed)
call SetUnitAbilityLevel(u, attspeed, 3)
endif
return
endif
// Halfautomatic Gun
if ( i == 'I03B' ) then
if ( cannoneer or gunner or marksman or mortarteam or rifleman ) then
call UnitAddAbility(u, damage)
call SetUnitAbilityLevel(u, damage, 7)
call UnitAddAbility(u, attspeed)
call SetUnitAbilityLevel(u, attspeed, 10)
endif
return
endif
// Charm of Healing
if ( i == 'I03P' ) then
if ( adept or cleric or paladin or priest or shadowpriest ) then
call UnitAddAbility(u, trinketheal)
call SetUnitAbilityLevel(u, trinketheal, 10)
endif
return
endif
// Divine Relic
if ( i == 'I03Q' ) then
call UnitAddAbility(u, trinketrheal)
call SetUnitAbilityLevel(u, trinketrheal, 10)
return
endif
// Orb of Spellpower
if ( i == 'I03S' ) then
if ( acolyte or adept or battlemage or cleric or mage or priest or sorcerer or shadowpriest or warlock or wizard ) then
call UnitAddAbility(u, trinketspelldmg)
call SetUnitAbilityLevel(u, trinketspelldmg, 15)
endif
return
endif
// Talisman of Cunning
if ( i == 'I05H' ) then
call UnitAddAbility(u, 'A08G')
return
endif
// Gem of Health
if ( i == 'I03R' ) then
call UnitAddAbility(u, bonushp)
return
endif
// Encyclopedia
if ( i == 'I057' ) then
call UnitAddAbility(u, 'A08C')
return
endif
// Lucky Charm
if ( i == 'I05J' ) then
call SaveBoolean(udg_bierfass, GetHandleId(u), 43, true)
return
endif
// Book of Mnemonic Tricks => Direkt bei Barleybrew wegen Unleaks
// Vampire Teeth
if ( i == 'I051' ) then
if ( battlemage or captain or champion or guard or kingsguard or paladin or warrior ) then
call SaveBoolean(udg_bierfass, GetHandleId(u), 42, true)
endif
return
endif
// Boots of Speed
if ( i == 'I050' ) then
call UnitAddAbility(u, movespeed)
call SetUnitAbilityLevel(u, movespeed, 14)
endif
// Boots of Celerity
if ( i == 'I055' ) then
call UnitAddAbility(u, movespeed)
call SetUnitAbilityLevel(u, movespeed, 20)
endif
// Iceman's Cape
if ( i == 'I04F' ) then
call SaveBoolean(udg_bierfass, GetHandleId(u), 31, true)
call SaveBoolean(udg_bierfass, GetHandleId(u), 33, true)
if ( acolyte or adept or battlemage or cleric or mage or priest or sorcerer or shadowpriest or warlock or wizard ) then
call UnitAddAbility(u, armorspelldmg)
call SetUnitAbilityLevel(u, armorspelldmg, 5)
endif
return
endif
// Tempest Robe
if ( i == 'I04W' ) then
call SaveBoolean(udg_bierfass, GetHandleId(u), 34, true)
call SaveBoolean(udg_bierfass, GetHandleId(u), 37, true)
if ( battlemage or sorcerer or warlock or wizard ) then
call SaveBoolean(udg_bierfass, GetHandleId(u), 35, true)
call SaveBoolean(udg_bierfass, GetHandleId(u), 38, true)
endif
endif
set u = null
endfunction
function RemoveItemWeaponAbilities takes unit u returns nothing
call UnitRemoveAbility(u, 'A06N')
call UnitRemoveAbility(u, 'A06O')
call UnitRemoveAbility(u, 'A06P')
call UnitRemoveAbility(u, 'A06Q')
call UnitRemoveAbility(u, 'A06R')
call UnitRemoveAbility(u, 'A06S')
call UnitRemoveAbility(u, 'A06T')
set u = null
endfunction
function RemoveItemArmorAbilities takes unit u returns nothing
call SaveBoolean(udg_bierfass, GetHandleId(u), 31, false)
call SaveBoolean(udg_bierfass, GetHandleId(u), 33, false)
call SaveBoolean(udg_bierfass, GetHandleId(u), 34, false)
call SaveBoolean(udg_bierfass, GetHandleId(u), 35, false)
call SaveBoolean(udg_bierfass, GetHandleId(u), 37, false)
call SaveBoolean(udg_bierfass, GetHandleId(u), 38, false)
call UnitRemoveAbility(u, 'A07U')
call UnitRemoveAbility(u, 'A089')
set u = null
endfunction
function RemoveItemTrinketAbilities takes unit u returns nothing
local player p = GetOwningPlayer(u)
call SaveBoolean(udg_bierfass, GetHandleId(u), 42, false)
call SaveBoolean(udg_bierfass, GetHandleId(u), 43, false)
call UnitRemoveAbility(u, 'A06Z')
call UnitRemoveAbility(u, 'A070')
call UnitRemoveAbility(u, 'A071')
call UnitRemoveAbility(u, 'A072')
call UnitRemoveAbility(u, 'A08B')
call UnitRemoveAbility(u, 'A08C')
call UnitRemoveAbility(u, 'A08G')
call SetPlayerHandicapXPBJ( p, udg_g_real[9] )
set u = null
set p = null
endfunction
Name | Type | is_array | initial_value |
bierfass | hashtable | No | |
bierkonsum | integer | Yes | |
bountyuberhang | real | Yes | |
death_bool | boolean | Yes | |
death_timer | timer | Yes | |
death_unit | unit | Yes | |
death_window | timerdialog | Yes | |
DfficultyMode | integer | No | |
dialog_bounty | dialog | No | |
dialog_bounty_button | button | Yes | |
dialog_diff | dialog | No | |
dialog_diff_button | button | Yes | |
evolutions | integer | Yes | |
ft_lifetime | real | No | 1.25 |
g_group | group | Yes | |
g_integer | integer | Yes | |
g_point | location | Yes | |
g_real | real | Yes | |
g_SFX | effect | Yes | |
g_string | string | Yes | |
g_timer | timer | Yes | |
g_unit | unit | Yes | |
gametime | integer | No | |
handlevars | gamecache | No | |
HeroID | unit | Yes | |
Host | player | No | |
itemdummy | unit | Yes | |
kills | integer | Yes | |
kills60 | integer | Yes | |
kills60max | integer | Yes | |
methorn | hashtable | No | |
Multiboard | multiboard | No | |
MultiboardRow | integer | Yes | |
MultiboardRowNumber | integer | No | |
stat_spent | integer | Yes |
function Trig_Periodics_Actions takes nothing returns nothing
local integer iter = 4
// Zeitupdate
set udg_gametime = ( udg_gametime + 1 )
call MultiboardSetItemValueBJ( udg_Multiboard, 3, udg_MultiboardRow[15], Uhrzeitumrechnung(udg_gametime) )
if ( udg_g_integer[4] >= 1 ) then
set udg_g_integer[4] = ( udg_g_integer[4] - 1 )
call MultiboardSetItemValueBJ( udg_Multiboard, 3, udg_MultiboardRow[16], Uhrzeitumrechnung(udg_g_integer[4]) )
endif
// Dissipate-Timer-Update, Hero-Mana-Anzeige (bei Food), King-HP-Anzeige (bei Lumb)
loop
exitwhen iter > 12
if ( IsUnitAliveBJ(udg_HeroID[iter]) ) then
call SetPlayerState( ConvertedPlayer(iter), PLAYER_STATE_RESOURCE_FOOD_USED, R2I(GetUnitStateSwap(UNIT_STATE_MANA, udg_HeroID[iter])) )
call SetPlayerState( ConvertedPlayer(iter), PLAYER_STATE_RESOURCE_LUMBER, R2I(GetUnitStateSwap(UNIT_STATE_LIFE, gg_unit_n007_0023)) )
endif
if ( ( GetPlayerSlotState(ConvertedPlayer(iter)) == PLAYER_SLOT_STATE_PLAYING ) and ( udg_death_bool[iter] ) ) then
if ( ( TimerGetRemaining(udg_death_timer[iter]) >= 1.00 ) ) then
call MultiboardSetItemValueBJ( udg_Multiboard, 3, udg_MultiboardRow[iter], Uhrzeitumrechnung(R2I(TimerGetRemaining(udg_death_timer[iter]))) )
else
call MultiboardSetItemValueBJ( udg_Multiboard, 3, udg_MultiboardRow[iter], "" )
endif
endif
set iter = iter + 1
endloop
endfunction
//===========================================================================
function InitTrig_Periodics takes nothing returns nothing
set gg_trg_Periodics = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Periodics, 1.00 )
call TriggerAddAction( gg_trg_Periodics, function Trig_Periodics_Actions )
endfunction
function Trig_Friendly_Attack_Disable_Conditions takes nothing returns boolean
if ( ( GetIssuedOrderIdBJ() == String2OrderIdBJ("attack") ) and ( GetPlayerController(GetOwningPlayer(GetOrderedUnit())) == MAP_CONTROL_USER ) and ( GetOwningPlayer(GetOrderTargetUnit()) != Player(0) ) ) then
return true
endif
return false
endfunction
function Trig_Friendly_Attack_Disable_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetOrderTargetUnit())
call IssuePointOrderLocBJ( GetOrderedUnit(), "smart", loc )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Friendly_Attack_Disable takes nothing returns nothing
set gg_trg_Friendly_Attack_Disable = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Friendly_Attack_Disable, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerAddCondition( gg_trg_Friendly_Attack_Disable, Condition( function Trig_Friendly_Attack_Disable_Conditions ) )
call TriggerAddAction( gg_trg_Friendly_Attack_Disable, function Trig_Friendly_Attack_Disable_Actions )
endfunction
function Trig_Unit_Preload_Actions takes nothing returns nothing
local location loc = Location(6750.00, 750.00)
local unit u
set u = CreateUnitAtLoc( Player(0), 'H000', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H001', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H002', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H003', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H004', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H005', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H006', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H007', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H008', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H009', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00A', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00B', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00C', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00D', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00E', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00F', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00H', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00N', loc, 0)
call RemoveUnit(u)
// set u = CreateUnitAtLoc( Player(0), 'H00O', loc, 0)
// call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00P', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00Q', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00U', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00V', loc, 0)
call RemoveUnit(u)
set u = CreateUnitAtLoc( Player(0), 'H00W', loc, 0)
call RemoveUnit(u)
call RemoveLocation(loc)
set loc = null
set u = null
endfunction
//===========================================================================
function InitTrig_Unit_Preload takes nothing returns nothing
set gg_trg_Unit_Preload = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Unit_Preload, 3.00 )
call TriggerAddAction( gg_trg_Unit_Preload, function Trig_Unit_Preload_Actions )
endfunction
function Trig_Death_Init_Conditions takes nothing returns boolean
if ( ( GetPlayerController(GetOwningPlayer(GetDyingUnit())) == MAP_CONTROL_USER ) and ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true ) and ( GetUnitTypeId(GetDyingUnit()) != 'H00O' ) and ( udg_death_bool[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))] == false ) ) then
return true
endif
return false
endfunction
function Trig_Death_Init_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local player p = GetOwningPlayer(u)
local location loc = GetUnitLoc(u)
local timer t = LoadTimerHandle(udg_methorn, GetHandleId(p), 100)
local unit metdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 101)
local unit ghost
local unit dummy
call ReviveHeroLoc( u, loc, false )
call SetUnitInvulnerable( u, true )
call SetUnitPathing( u, false )
call SetUnitAnimation( u, "death" )
call PauseUnitBJ( true, u )
call SetUnitLifePercentBJ( u, 100 )
call SetUnitManaPercentBJ( u, 0.00 )
call SuspendHeroXPBJ( false, u )
set dummy = CreateUnitAtLoc( GetOwningPlayer(u), 'u000', loc, 0 )
call UnitApplyTimedLife( dummy, 'BTLF', 3 )
call UnitAddAbility( dummy, 'A01C' )
call IssueTargetOrderBJ( dummy, "cripple", u )
set ghost = CreateUnitAtLoc( GetOwningPlayer(u), 'u002', loc, bj_UNIT_FACING )
call SetUnitPathing( ghost, false )
call SelectUnitForPlayerSingle(ghost, GetOwningPlayer(u))
call DisplayTimedTextToForce( GetPlayersAll(), 15.00, ( ( "|c00FF0000" + GetPlayerName(GetOwningPlayer(u)) ) + "|r's hero has died. It can be resurrected by a Cleric or the Spirit Healer within " + Uhrzeitumrechnung(R2I(TimerGetRemaining(udg_death_timer[GetConvertedPlayerId(GetOwningPlayer(u))]))) + " minutes before it will dissipate forever." ) )
set loc = Location(4475.00, 5400.00)
call PingMinimapLocForForce( GetForceOfPlayer(GetOwningPlayer(u)), loc, 10.00 )
call PauseTimerBJ( false, udg_death_timer[GetConvertedPlayerId(GetOwningPlayer(u))] )
call CreateTimerDialogBJ( udg_death_timer[GetConvertedPlayerId(GetOwningPlayer(u))], "Dissipation in:" )
set udg_death_window[GetConvertedPlayerId(GetOwningPlayer(u))] = GetLastCreatedTimerDialogBJ()
set udg_death_unit[GetConvertedPlayerId(GetOwningPlayer(u))] = u
set udg_death_bool[GetConvertedPlayerId(GetOwningPlayer(u))] = true
call TimerDialogDisplayBJ( false, GetLastCreatedTimerDialogBJ() )
call TimerDialogDisplayForPlayerBJ( true, GetLastCreatedTimerDialogBJ(), GetOwningPlayer(u) )
call SaveTimerHandle(udg_methorn, GetHandleId(u), 100, null)
call DestroyTimer(t)
call SaveUnitHandle(udg_methorn, GetHandleId(u), 101, null)
call RemoveUnit(metdummy)
call UnitRemoveAbilityBJ( 'A047', u )
call UnitRemoveBuffBJ( 'B00X', u )
call RemoveLocation(loc)
set loc = null
set u = null
set p = null
set dummy = null
set ghost = null
set metdummy = null
set t = null
endfunction
//===========================================================================
function InitTrig_Death_Init takes nothing returns nothing
set gg_trg_Death_Init = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Death_Init, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Death_Init, Condition( function Trig_Death_Init_Conditions ) )
call TriggerAddAction( gg_trg_Death_Init, function Trig_Death_Init_Actions )
endfunction
function Trig_Rezz_Cast_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A00W' ) and ( UnitHasBuffBJ(GetSpellTargetUnit(), 'B004') ) ) then
return true
endif
return false
endfunction
function Trig_Rezz_Cast_Groupkill takes nothing returns nothing
call KillUnit( GetEnumUnit() )
endfunction
function Trig_Rezz_Cast_Actions takes nothing returns nothing
local unit target = GetSpellTargetUnit()
call PauseUnitBJ( false, target )
call SetUnitLifePercentBJ( target, 25.00 )
call SetUnitManaPercentBJ( target, 25.00 )
call SetUnitInvulnerable( target, false )
call UnitRemoveBuffBJ( 'B004', target )
call SuspendHeroXPBJ( true, target )
call SetUnitAnimation( target, "stand" )
call SetUnitPathing( target, true )
call ForGroupBJ( GetUnitsOfPlayerAndTypeId(GetOwningPlayer(target), 'u002'), function Trig_Rezz_Cast_Groupkill )
call DestroyTimerDialogBJ( udg_death_window[GetConvertedPlayerId(GetOwningPlayer(target))] )
call PauseTimerBJ( true, udg_death_timer[GetConvertedPlayerId(GetOwningPlayer(target))] )
call MultiboardSetItemValueBJ( udg_Multiboard, 3, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(target))], "" )
set udg_death_bool[GetConvertedPlayerId(GetOwningPlayer(target))] = false
set target = null
endfunction
//===========================================================================
function InitTrig_Rezz_Cast takes nothing returns nothing
set gg_trg_Rezz_Cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rezz_Cast, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Rezz_Cast, Condition( function Trig_Rezz_Cast_Conditions ) )
call TriggerAddAction( gg_trg_Rezz_Cast, function Trig_Rezz_Cast_Actions )
endfunction
function Trig_Rezz_Spirithealer_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetEnteringUnit()) == 'u002' ) then
return true
endif
return false
endfunction
function Trig_Rezz_Spirithealer_Sfx takes nothing returns nothing
call SetUnitAnimation( GetEnumUnit(), "spell" )
call QueueUnitAnimationBJ( GetEnumUnit(), "stand" )
endfunction
function Trig_Rezz_Spirithealer_Actions takes nothing returns nothing
local unit target = udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))]
local location loc = GetUnitLoc(GetEnteringUnit())
local group g = GetUnitsOfTypeIdAll('u00I')
if ( IsUnitAliveBJ(target) ) then
if ( GetUnitTypeId(GetEnteringUnit()) == 'u002' ) then
call ForGroupBJ( g, function Trig_Rezz_Spirithealer_Sfx )
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Undead\\DeathPact\\DeathPactTarget.mdl" )
call SetUnitPositionLoc( target, loc )
call PauseUnitBJ( false, target )
call SetUnitLifePercentBJ( target, 25.00 )
call SetUnitManaPercentBJ( target, 25.00 )
call SetUnitInvulnerable( target, false )
call UnitRemoveBuffBJ( 'B004', target )
call SuspendHeroXPBJ( true, target )
call SetUnitAnimation( target, "stand" )
call SetUnitPathing( target, true )
call SelectUnitForPlayerSingle(target, GetOwningPlayer(target))
call ForGroupBJ( GetUnitsOfPlayerAndTypeId(GetOwningPlayer(target), 'u002'), function Trig_Rezz_Cast_Groupkill )
call DestroyTimerDialogBJ( udg_death_window[GetConvertedPlayerId(GetOwningPlayer(target))] )
call PauseTimerBJ( true, udg_death_timer[GetConvertedPlayerId(GetOwningPlayer(target))] )
call MultiboardSetItemValueBJ( udg_Multiboard, 3, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(target))], "" )
set udg_death_bool[GetConvertedPlayerId(GetOwningPlayer(target))] = false
else
call QuestMessageBJ( GetForceOfPlayer(GetOwningPlayer(GetEnteringUnit())), bj_QUESTMESSAGE_WARNING, " |cffffcc00Must use Resurrection on a Ghost." )
endif
else
call QuestMessageBJ( GetForceOfPlayer(GetOwningPlayer(GetEnteringUnit())), bj_QUESTMESSAGE_WARNING, " |cffffcc00Your hero dissipated already." )
endif
set target = null
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Rezz_Spirithealer takes nothing returns nothing
set gg_trg_Rezz_Spirithealer = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Rezz_Spirithealer, gg_rct_Friedhof )
call TriggerAddCondition( gg_trg_Rezz_Spirithealer, Condition( function Trig_Rezz_Spirithealer_Conditions ) )
call TriggerAddAction( gg_trg_Rezz_Spirithealer, function Trig_Rezz_Spirithealer_Actions )
endfunction
function Trig_Dissipate_4_Actions takes nothing returns nothing
call DissipateHero(4)
endfunction
//===========================================================================
function InitTrig_Dissipate_4 takes nothing returns nothing
set gg_trg_Dissipate_4 = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Dissipate_4, udg_death_timer[4] )
call TriggerAddAction( gg_trg_Dissipate_4, function Trig_Dissipate_4_Actions )
endfunction
function Trig_Dissipate_5_Actions takes nothing returns nothing
call DissipateHero(5)
endfunction
//===========================================================================
function InitTrig_Dissipate_5 takes nothing returns nothing
set gg_trg_Dissipate_5 = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Dissipate_5, udg_death_timer[5] )
call TriggerAddAction( gg_trg_Dissipate_5, function Trig_Dissipate_5_Actions )
endfunction
function Trig_Dissipate_6_Actions takes nothing returns nothing
call DissipateHero(6)
endfunction
//===========================================================================
function InitTrig_Dissipate_6 takes nothing returns nothing
set gg_trg_Dissipate_6 = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Dissipate_6, udg_death_timer[6] )
call TriggerAddAction( gg_trg_Dissipate_6, function Trig_Dissipate_6_Actions )
endfunction
function Trig_Dissipate_7_Actions takes nothing returns nothing
call DissipateHero(7)
endfunction
//===========================================================================
function InitTrig_Dissipate_7 takes nothing returns nothing
set gg_trg_Dissipate_7 = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Dissipate_7, udg_death_timer[7] )
call TriggerAddAction( gg_trg_Dissipate_7, function Trig_Dissipate_7_Actions )
endfunction
function Trig_Dissipate_8_Actions takes nothing returns nothing
call DissipateHero(8)
endfunction
//===========================================================================
function InitTrig_Dissipate_8 takes nothing returns nothing
set gg_trg_Dissipate_8 = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Dissipate_8, udg_death_timer[8] )
call TriggerAddAction( gg_trg_Dissipate_8, function Trig_Dissipate_8_Actions )
endfunction
function Trig_Dissipate_9_Actions takes nothing returns nothing
call DissipateHero(9)
endfunction
//===========================================================================
function InitTrig_Dissipate_9 takes nothing returns nothing
set gg_trg_Dissipate_9 = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Dissipate_9, udg_death_timer[9] )
call TriggerAddAction( gg_trg_Dissipate_9, function Trig_Dissipate_9_Actions )
endfunction
function Trig_Dissipate_10_Actions takes nothing returns nothing
call DissipateHero(10)
endfunction
//===========================================================================
function InitTrig_Dissipate_10 takes nothing returns nothing
set gg_trg_Dissipate_10 = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Dissipate_10, udg_death_timer[10] )
call TriggerAddAction( gg_trg_Dissipate_10, function Trig_Dissipate_10_Actions )
endfunction
function Trig_Dissipate_11_Actions takes nothing returns nothing
call DissipateHero(11)
endfunction
//===========================================================================
function InitTrig_Dissipate_11 takes nothing returns nothing
set gg_trg_Dissipate_11 = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Dissipate_11, udg_death_timer[11] )
call TriggerAddAction( gg_trg_Dissipate_11, function Trig_Dissipate_11_Actions )
endfunction
function Trig_Dissipate_12_Actions takes nothing returns nothing
call DissipateHero(12)
endfunction
//===========================================================================
function InitTrig_Dissipate_12 takes nothing returns nothing
set gg_trg_Dissipate_12 = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Dissipate_12, udg_death_timer[12] )
call TriggerAddAction( gg_trg_Dissipate_12, function Trig_Dissipate_12_Actions )
endfunction
function Trig_Kill_Conditions takes nothing returns boolean
if ( ( GetOwningPlayer(GetDyingUnit()) == Player(0) ) and ( GetPlayerController(GetOwningPlayer(GetKillingUnitBJ())) == MAP_CONTROL_USER ) ) then
return true
endif
return false
endfunction
function Trig_Kill_Actions takes nothing returns nothing
local player p = GetOwningPlayer(GetKillingUnitBJ())
local integer i = GetConvertedPlayerId(p)
call WaveBountyGiver(GetDyingUnit(),p)
set udg_kills[i] = ( udg_kills[i] + 1 )
call MultiboardSetItemValueBJ( udg_Multiboard, 4, udg_MultiboardRow[i], I2S(udg_kills[i]) )
set udg_kills[0] = udg_kills[0] + 1
call MultiboardSetItemValueBJ( udg_Multiboard, 4, udg_MultiboardRow[13], I2S(udg_kills[0]) )
call MultiboardSetItemValueBJ( udg_Multiboard, 4, udg_MultiboardRow[14], I2S(R2I(( I2R(udg_kills[0]) / ( I2R(udg_MultiboardRow[13]) - 3.00 ) ))) )
set p = null
endfunction
//===========================================================================
function InitTrig_Kill takes nothing returns nothing
set gg_trg_Kill = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Kill, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Kill, Condition( function Trig_Kill_Conditions ) )
call TriggerAddAction( gg_trg_Kill, function Trig_Kill_Actions )
endfunction
function Trig_Barleybrew_Items_Actions takes nothing returns nothing
local unit buyer = GetBuyingUnit()
local location loc = GetUnitLoc(buyer)
local player p = GetOwningPlayer(buyer)
local integer i = GetPlayerId(p)+1
// WAFFEN
// STAFF OF LIGHT
if ( GetItemTypeId(GetSoldItem()) == 'I02K' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I02D', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I02D', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// STAFF OF THE ECLIPSE
if ( GetItemTypeId(GetSoldItem()) == 'I02M' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I02L', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I02L', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// WAND OF THE ARCHMAGI
if ( GetItemTypeId(GetSoldItem()) == 'I02O' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I02N', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I02N', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// WAND OF POWER
if ( GetItemTypeId(GetSoldItem()) == 'I02Q' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I02P', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I02P', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// STAFF OF UNSTABLE MIGHT
if ( GetItemTypeId(GetSoldItem()) == 'I02S' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I02R', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I02R', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// STAFF OF THE DIVINER
if ( GetItemTypeId(GetSoldItem()) == 'I02U' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I02T', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I02T', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// TEMPLAR BLADE
if ( GetItemTypeId(GetSoldItem()) == 'I02W' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I02V', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I02V', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// BATTLE AXE
if ( GetItemTypeId(GetSoldItem()) == 'I02Y' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I02X', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I02X', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// SORCERER'S EDGE
if ( GetItemTypeId(GetSoldItem()) == 'I04X' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I04Y', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I04Y', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// VAMPIRIC EDGE
if ( GetItemTypeId(GetSoldItem()) == 'I030' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I02Z', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I02Z', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// STURDY MACE
if ( GetItemTypeId(GetSoldItem()) == 'I032' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I031', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I031', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// FINE LONGSWORD
if ( GetItemTypeId(GetSoldItem()) == 'I034' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I033', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I033', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// ORDINARY BOOMSTICK
if ( GetItemTypeId(GetSoldItem()) == 'I036' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I035', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I035', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// LONG RIFLE
if ( GetItemTypeId(GetSoldItem()) == 'I038' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I037', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I037', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// BLUNDERBUSS
if ( GetItemTypeId(GetSoldItem()) == 'I03A' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I039', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I039', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// HALFAUTOMATIC GUN
if ( GetItemTypeId(GetSoldItem()) == 'I03C' ) then
call RemoveItemWeaponAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 2) )
call CreateItemLoc( 'I03B', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 2) )
call CreateItemLoc( 'I03B', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// TRINKETS
// CHARM OF HEALING
if ( GetItemTypeId(GetSoldItem()) == 'I03K' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I03P', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I03P', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// DIVINE RELIC
if ( GetItemTypeId(GetSoldItem()) == 'I03J' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I03Q', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I03Q', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// DOLLAR-CHAIN
if ( GetItemTypeId(GetSoldItem()) == 'I05E' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I05D', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I05D', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
endif
// LIFE STONE
if ( GetItemTypeId(GetSoldItem()) == 'I041' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I042', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I042', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
endif
// BIG BOOK OF PIRATE INSULTS
if ( GetItemTypeId(GetSoldItem()) == 'I03M' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I03V', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I03V', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
endif
// PENDANT OF WARDING
if ( GetItemTypeId(GetSoldItem()) == 'I03H' ) then
call RemoveItemTrinketAbilities(buyer)
if ( (GetUnitTypeId(buyer)=='H009') or (GetUnitTypeId(buyer)=='H00H') or (GetUnitTypeId(buyer)=='H008') or (GetUnitTypeId(buyer)=='H00Q') ) then
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I040', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I040', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
else
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I03Z', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I03Z', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
endif
endif
// ORB OF OBLIVION
if ( GetItemTypeId(GetSoldItem()) == 'I03I' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I03X', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I03X', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
endif
// ORB OF SPELLPOWER
if ( GetItemTypeId(GetSoldItem()) == 'I03L' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I03S', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I03S', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// TALISMAN OF LUCK
if ( GetItemTypeId(GetSoldItem()) == 'I05G' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I05H', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I05H', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// TALISMAN OF UNSTABLE MIGHT
if ( GetItemTypeId(GetSoldItem()) == 'I03N' ) then
call RemoveItemTrinketAbilities(buyer)
if ( (GetUnitTypeId(buyer)=='H009') or (GetUnitTypeId(buyer)=='H00Q') or (GetUnitTypeId(buyer)=='H00A') or (GetUnitTypeId(buyer)=='H00N') or (GetUnitTypeId(buyer)=='H007') ) then
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I03U', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I03U', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
else
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I03T', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I03T', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
endif
endif
// THUNDERSTONE
if ( GetItemTypeId(GetSoldItem()) == 'I03O' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I03W', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I03W', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
endif
// KEY TO THE CITY
if ( GetItemTypeId(GetSoldItem()) == 'I059' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I05A', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I05A', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
endif
// YOUTUBE-LEDGER
if ( GetItemTypeId(GetSoldItem()) == 'I04R' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I04S', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I04S', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
endif
// HEARTHSTONE
if ( GetItemTypeId(GetSoldItem()) == 'I05B' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I05C', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I05C', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
endif
// LUCKY CHARM
if ( GetItemTypeId(GetSoldItem()) == 'I05I' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I05J', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I05J', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
endif
// BOOK OF MNEMONICS
if ( GetItemTypeId(GetSoldItem()) == 'I05K' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I05L', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I05L', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
endif
call SetPlayerHandicapXPBJ( p, udg_g_real[9] + 15.00 )
endif
// VAMPIRE TEETH
if ( GetItemTypeId(GetSoldItem()) == 'I052' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I051', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I051', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// GEM OF HEALTH
if ( GetItemTypeId(GetSoldItem()) == 'I056' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I03R', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I03R', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// ENCYCLOPEDIA
if ( GetItemTypeId(GetSoldItem()) == 'I058' ) then
call RemoveItemTrinketAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 1) )
call CreateItemLoc( 'I057', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 1) )
call CreateItemLoc( 'I057', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// ARMORS
// BOOTS OF SPEED
if ( GetItemTypeId(GetSoldItem()) == 'I04Z' ) then
call RemoveItemArmorAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 3) )
call CreateItemLoc( 'I050', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 3) )
call CreateItemLoc( 'I050', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// BOOTS OF CELERITY
if ( GetItemTypeId(GetSoldItem()) == 'I054' ) then
call RemoveItemArmorAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 3) )
call CreateItemLoc( 'I055', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 3) )
call CreateItemLoc( 'I055', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// ICEMAN'S CAPE
if ( GetItemTypeId(GetSoldItem()) == 'I04T' ) then
call RemoveItemArmorAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 3) )
call CreateItemLoc( 'I04F', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 3) )
call CreateItemLoc( 'I04F', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
// TEMPEST ROBE
if ( GetItemTypeId(GetSoldItem()) == 'I04V' ) then
call RemoveItemArmorAbilities(buyer)
if ( GetItemTypeId(UnitItemInSlot(buyer, 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetBuyingUnit(), 3) )
call CreateItemLoc( 'I04W', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), buyer )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[i], 3) )
call CreateItemLoc( 'I04W', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[i] )
call AddItemAbilitiesToHero(buyer, GetItemTypeId(GetLastCreatedItem()))
endif
endif
call RemoveLocation(loc)
set loc = null
set buyer = null
set p = null
endfunction
//===========================================================================
function InitTrig_Barleybrew_Items takes nothing returns nothing
set gg_trg_Barleybrew_Items = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Barleybrew_Items, EVENT_PLAYER_UNIT_SELL_ITEM )
call TriggerAddAction( gg_trg_Barleybrew_Items, function Trig_Barleybrew_Items_Actions )
endfunction
function Trig_Barleybrew_Chat_Conditions takes nothing returns boolean
if ( ( GetUnitTypeId(GetSellingUnit()) == 'n019' ) or ( GetUnitTypeId(GetSellingUnit()) == 'n01A' ) or ( GetUnitTypeId(GetSellingUnit()) == 'n015' ) or ( GetUnitTypeId(GetSellingUnit()) == 'n013' ) or ( GetUnitTypeId(GetSellingUnit()) == 'n014' ) or ( GetUnitTypeId(GetSellingUnit()) == 'n01D' ) and ( GetItemTypeId(GetSoldItem()) != 'I02G' ) ) then
return true
endif
return false
endfunction
function Trig_Barleybrew_Chat_Actions takes nothing returns nothing
call AttachFloattext(gg_unit_n005_0112, GetRandomInt(600,750), udg_g_string[GetRandomInt(47,50)])
endfunction
//===========================================================================
function InitTrig_Barleybrew_Chat takes nothing returns nothing
set gg_trg_Barleybrew_Chat = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Barleybrew_Chat, EVENT_PLAYER_UNIT_SELL_ITEM )
call TriggerAddCondition( gg_trg_Barleybrew_Chat, Condition( function Trig_Barleybrew_Chat_Conditions ) )
call TriggerAddAction( gg_trg_Barleybrew_Chat, function Trig_Barleybrew_Chat_Actions )
endfunction
function Trig_Counsellor_Flucht_Conditions takes nothing returns boolean
if ( GetUnitLifePercent(GetAttackedUnitBJ()) <= 98.00 ) then
return true
endif
return false
endfunction
function Trig_Counsellor_Flucht_Actions takes nothing returns nothing
local location loc = Location(-2130, 700)
call DisableTrigger( GetTriggeringTrigger() )
call SetUnitMoveSpeed( gg_unit_n01E_0051, 350.00 )
call AttachFloattext(gg_unit_n01E_0051, 750, udg_g_string[GetRandomInt(21, 23)] )
call IssuePointOrderLoc( gg_unit_n01E_0051, "move", loc )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Counsellor_Flucht takes nothing returns nothing
set gg_trg_Counsellor_Flucht = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Counsellor_Flucht, gg_unit_n007_0023, EVENT_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Counsellor_Flucht, Condition( function Trig_Counsellor_Flucht_Conditions ) )
call TriggerAddAction( gg_trg_Counsellor_Flucht, function Trig_Counsellor_Flucht_Actions )
endfunction
function Trig_Councellor_Bandage_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetSoldItem()) == 'I04N' ) then
return true
endif
return false
endfunction
function Trig_Councellor_Bandage_Actions takes nothing returns nothing
local location loc = Location(-2130, 700)
call UnitAddAbilityBJ( 'A04S', gg_unit_n01E_0051 )
call UnitRemoveAbilityBJ( 'Aneu', gg_unit_n01E_0051 )
call CreateItemLoc( 'I04O', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), gg_unit_n01E_0051 )
call SavePlayerHandle(udg_methorn, GetHandleId(gg_unit_n01E_0051), 112, GetOwningPlayer(GetBuyingUnit()))
call SaveInteger(udg_methorn, GetHandleId(gg_unit_n01E_0051), 111, 50)
call AttachFloattext(gg_unit_n01E_0051, 500, udg_g_string[GetRandomInt(24, 27)] )
call UnitUseItemTarget( gg_unit_n01E_0051, GetLastCreatedItem(), gg_unit_n007_0023 )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Councellor_Bandage takes nothing returns nothing
set gg_trg_Councellor_Bandage = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Councellor_Bandage, gg_unit_n01E_0051, EVENT_UNIT_SELL_ITEM )
call TriggerAddCondition( gg_trg_Councellor_Bandage, Condition( function Trig_Councellor_Bandage_Conditions ) )
call TriggerAddAction( gg_trg_Councellor_Bandage, function Trig_Councellor_Bandage_Actions )
endfunction
function Trig_Counsellor_Return_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I04O' ) then
return true
endif
return false
endfunction
function Trig_Counsellor_Return_Actions takes nothing returns nothing
local location loc = Location(-2130, 700)
local player p = LoadPlayerHandle(udg_methorn, GetHandleId(gg_unit_n01E_0051), 112)
call AttachFloattext(gg_unit_n007_0023, 1000, "Thank you,|n"+GetPlayerName(p)+"!" )
call RemoveItem( UnitItemInSlot(gg_unit_n01E_0051, 0) )
call UnitRemoveAbility( gg_unit_n01E_0051, 'A04S' )
call IssuePointOrderLoc( gg_unit_n01E_0051, "move", loc )
call FlushChildHashtable(udg_methorn, GetHandleId(gg_unit_n01E_0051))
call RemoveLocation(loc)
set loc = null
set p = null
endfunction
//===========================================================================
function InitTrig_Counsellor_Return takes nothing returns nothing
set gg_trg_Counsellor_Return = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Counsellor_Return, gg_unit_n01E_0051, EVENT_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Counsellor_Return, Condition( function Trig_Counsellor_Return_Conditions ) )
call TriggerAddAction( gg_trg_Counsellor_Return, function Trig_Counsellor_Return_Actions )
endfunction
function Trig_Counsellor_Return_Flucht_Conditions takes nothing returns boolean
if ( GetEnteringUnit() == gg_unit_n01E_0051 ) then
return true
endif
return false
endfunction
function Trig_Counsellor_Return_Flucht_Groupcond takes nothing returns boolean
if ( (IsUnitAliveBJ(GetFilterUnit()) == true) and (RectContainsUnit(gg_rct_Town_Centre, GetFilterUnit()) == true) ) then
return true
endif
return false
endfunction
function Trig_Counsellor_Return_Flucht_Actions takes nothing returns nothing
local group g = GetUnitsOfPlayerMatching(Player(0), Condition(function Trig_Counsellor_Return_Flucht_Groupcond))
local player p = LoadPlayerHandle(udg_methorn, GetHandleId(gg_unit_n01E_0051), 112)
local location loc
if ( CountUnitsInGroup(g) >= 1 ) then
set loc = Location(-2130, 700)
call SetUnitMoveSpeed( gg_unit_n01E_0051, 350.00 )
call AttachFloattext(gg_unit_n01E_0051, 600, udg_g_string[GetRandomInt(28, 30)] )
call RemoveItem( UnitItemInSlot(gg_unit_n01E_0051, 0) )
call UnitRemoveAbility( gg_unit_n01E_0051, 'A04S' )
call IssuePointOrderLoc( gg_unit_n01E_0051, "move", loc )
call QuestMessageBJ( GetForceOfPlayer(p), bj_QUESTMESSAGE_ALWAYSHINT, "Clovis has run away, but he was fair enough to return your gold." )
call AdjustPlayerStateBJ( LoadInteger(udg_methorn, GetHandleId(gg_unit_n01E_0051), 111), p, PLAYER_STATE_RESOURCE_GOLD )
call FlushChildHashtable(udg_methorn, GetHandleId(gg_unit_n01E_0051))
endif
call DestroyGroup(g)
set g = null
call RemoveLocation(loc)
set loc = null
set p = null
endfunction
//===========================================================================
function InitTrig_Counsellor_Return_Flucht takes nothing returns nothing
set gg_trg_Counsellor_Return_Flucht = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Counsellor_Return_Flucht, gg_rct_Town_Centre )
call TriggerAddCondition( gg_trg_Counsellor_Return_Flucht, Condition( function Trig_Counsellor_Return_Flucht_Conditions ) )
call TriggerAddAction( gg_trg_Counsellor_Return_Flucht, function Trig_Counsellor_Return_Flucht_Actions )
endfunction
function Trig_Warrior_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I00N' ) then
return true
endif
return false
endfunction
function Trig_Warrior_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H001', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 10 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 5 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A00Y' )
call SetUnitAbilityLevel( hero, 'A00Y', 3 )
call SelectHeroSkill( hero, 'A011' )
call SetUnitAbilityLevel( hero, 'A011', 3 )
call SelectHeroSkill( hero, 'A00C' )
call SetUnitAbilityLevel( hero, 'A00C', 3 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 9 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNBloodelvenWarrior.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
endfunction
//===========================================================================
function InitTrig_Warrior takes nothing returns nothing
set gg_trg_Warrior = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Warrior, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Warrior, Condition( function Trig_Warrior_Conditions ) )
call TriggerAddAction( gg_trg_Warrior, function Trig_Warrior_Actions )
endfunction
function Trig_Champion_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I00Q' ) then
return true
endif
return false
endfunction
function Trig_Champion_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H002', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 15 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 10 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A00Z' )
call SetUnitAbilityLevel( hero, 'A00Z', 6 )
call SelectHeroSkill( hero, 'A00D' )
call SetUnitAbilityLevel( hero, 'A00D', 6 )
call SelectHeroSkill( hero, 'A012' )
call SetUnitAbilityLevel( hero, 'A012', 6 )
call SelectHeroSkill( hero, 'A02O' )
call SetUnitAbilityLevel( hero, 'A02O', 1 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 19 ) )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
endfunction
//===========================================================================
function InitTrig_Champion takes nothing returns nothing
set gg_trg_Champion = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Champion, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Champion, Condition( function Trig_Champion_Conditions ) )
call TriggerAddAction( gg_trg_Champion, function Trig_Champion_Actions )
endfunction
function Trig_Battlemage_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I04P' ) then
return true
endif
return false
endfunction
function Trig_Battlemage_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H00U', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 10 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int + 10 )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 5 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A07M' )
call SetUnitAbilityLevel( hero, 'A07M', 6 )
call SelectHeroSkill( hero, 'A07P' )
call SetUnitAbilityLevel( hero, 'A07P', 1 )
call SelectHeroSkill( hero, 'A07N' )
call SetUnitAbilityLevel( hero, 'A07N', 6 )
call SelectHeroSkill( hero, 'A07Q' )
call SetUnitAbilityLevel( hero, 'A07Q', 6 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 19 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNDragonHawk.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
endfunction
//===========================================================================
function InitTrig_Battlemage takes nothing returns nothing
set gg_trg_Battlemage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Battlemage, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Battlemage, Condition( function Trig_Battlemage_Conditions ) )
call TriggerAddAction( gg_trg_Battlemage, function Trig_Battlemage_Actions )
endfunction
function Trig_Captain_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I00O' ) then
return true
endif
return false
endfunction
function Trig_Captain_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H003', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 5 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 10 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A00P' )
call SetUnitAbilityLevel( hero, 'A00P', 3 )
call SelectHeroSkill( hero, 'A001' )
call SetUnitAbilityLevel( hero, 'A001', 3 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 9 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNTheCaptain.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
endfunction
//===========================================================================
function InitTrig_Captain takes nothing returns nothing
set gg_trg_Captain = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Captain, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Captain, Condition( function Trig_Captain_Conditions ) )
call TriggerAddAction( gg_trg_Captain, function Trig_Captain_Actions )
endfunction
function Trig_Kingsguard_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I00R' ) then
return true
endif
return false
endfunction
function Trig_Kingsguard_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H004', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 5 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 20 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A00Q' )
call SetUnitAbilityLevel( hero, 'A00Q', 6 )
call SelectHeroSkill( hero, 'A00J' )
call SetUnitAbilityLevel( hero,'A00J', 6 )
call SelectHeroSkill( hero, 'A059' )
call SetUnitAbilityLevel( hero, 'A059', 3 )
call SelectHeroSkill( hero, 'A00T' )
call SetUnitAbilityLevel( hero, 'A00T', 1 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 19 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNSpellBreaker.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
endfunction
//===========================================================================
function InitTrig_Kingsguard takes nothing returns nothing
set gg_trg_Kingsguard = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Kingsguard, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Kingsguard, Condition( function Trig_Kingsguard_Conditions ) )
call TriggerAddAction( gg_trg_Kingsguard, function Trig_Kingsguard_Actions )
endfunction
function Trig_Paladin_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I01Y' ) then
return true
endif
return false
endfunction
function Trig_Paladin_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local timer t = LoadTimerHandle(udg_bierfass, GetHandleId(hero), 197)
local unit dummy = LoadUnitHandle(udg_bierfass, GetHandleId(hero), 198)
local location loc = GetUnitLoc(hero)
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call RemoveUnit(dummy)
set dummy = null
call SaveTimerHandle(udg_bierfass, GetHandleId(hero), 197, null)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
call ReplaceUnitBJ( hero, 'H00H', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 10 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int + 5 )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 10 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A04V' )
call SetUnitAbilityLevel( hero, 'A04V', 6 )
call SelectHeroSkill( hero, 'A07I' )
call SetUnitAbilityLevel( hero, 'A07I', 6 )
call SelectHeroSkill( hero, 'A054' )
call SetUnitAbilityLevel( hero, 'A054', 6 )
call SelectHeroSkill( hero, 'A053' )
call SetUnitAbilityLevel( hero, 'A053', 1 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 19 ) )
call SaveBoolean(udg_bierfass, GetHandleId(hero), 190, true)
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNKnight.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
if ( GetItemTypeId(UnitItemInSlot(hero, 1)) == 'I03Z' ) then
call RemoveItem( UnitItemInSlot(hero, 1) )
call CreateItemLoc( 'I040', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), hero )
endif
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Paladin takes nothing returns nothing
set gg_trg_Paladin = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Paladin, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Paladin, Condition( function Trig_Paladin_Conditions ) )
call TriggerAddAction( gg_trg_Paladin, function Trig_Paladin_Actions )
endfunction
function Trig_Rifleman_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I00S' ) then
return true
endif
return false
endfunction
function Trig_Rifleman_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H00F', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 15 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A00M' )
call SetUnitAbilityLevel( hero, 'A00M', 3 )
call SelectHeroSkill( hero, 'A05N' )
call SetUnitAbilityLevel( hero, 'A05N', 3 )
call SelectHeroSkill( hero, 'A05O' )
call SetUnitAbilityLevel( hero, 'A05O', 3 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 9 ) )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
endfunction
//===========================================================================
function InitTrig_Rifleman takes nothing returns nothing
set gg_trg_Rifleman = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rifleman, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Rifleman, Condition( function Trig_Rifleman_Conditions ) )
call TriggerAddAction( gg_trg_Rifleman, function Trig_Rifleman_Actions )
endfunction
function Trig_Marksman_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I00T' ) then
return true
endif
return false
endfunction
function Trig_Marksman_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H00E', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 20 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 5 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A00N' )
call SetUnitAbilityLevel( hero, 'A00N', 6 )
call SelectHeroSkill( hero, 'A01R' )
call SetUnitAbilityLevel( hero, 'A01R', 6 )
call SelectHeroSkill( hero, 'A05P' )
call SetUnitAbilityLevel( hero, 'A05P', 6 )
call SelectHeroSkill( hero, 'A06V' )
call SetUnitAbilityLevel( hero, 'A06V', 1 )
call SetUnitAbilityLevel( hero, 'A06W', 2 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 19 ) )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
endfunction
//===========================================================================
function InitTrig_Marksman takes nothing returns nothing
set gg_trg_Marksman = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Marksman, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Marksman, Condition( function Trig_Marksman_Conditions ) )
call TriggerAddAction( gg_trg_Marksman, function Trig_Marksman_Actions )
endfunction
function Trig_Cannoneer_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I00U' ) then
return true
endif
return false
endfunction
function Trig_Cannoneer_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H00B', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call SetUnitTimeScalePercent( hero, 125.00 )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 10 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 5 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SetUnitAbilityLevel( hero, 'A07G', 2 )
call SelectHeroSkill( hero, 'A06F' )
call SetUnitAbilityLevel( hero, 'A06F', 3 )
call SelectHeroSkill( hero, 'A06H' )
call SetUnitAbilityLevel( hero, 'A06H', 3 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 9 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNMortarTeam.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
endfunction
//===========================================================================
function InitTrig_Cannoneer takes nothing returns nothing
set gg_trg_Cannoneer = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Cannoneer, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Cannoneer, Condition( function Trig_Cannoneer_Conditions ) )
call TriggerAddAction( gg_trg_Cannoneer, function Trig_Cannoneer_Actions )
endfunction
function Trig_Mortarteam_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I00V' ) then
return true
endif
return false
endfunction
function Trig_Mortarteam_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H00D', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call SetUnitTimeScalePercent( hero, 125.00 )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 15 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 10 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SetUnitAbilityLevel( hero, 'A07G', 3 )
call SelectHeroSkill( hero, 'A06C' )
call SetUnitAbilityLevel( hero, 'A06C', 1 )
call SelectHeroSkill( hero, 'A06E' )
call SetUnitAbilityLevel( hero, 'A06E', 3 )
call SelectHeroSkill( hero, 'A06I' )
call SetUnitAbilityLevel( hero, 'A06I', 6 )
call SelectHeroSkill( hero, 'A06G' )
call SetUnitAbilityLevel( hero, 'A06G', 6 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 19 ) )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
endfunction
//===========================================================================
function InitTrig_Mortarteam takes nothing returns nothing
set gg_trg_Mortarteam = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mortarteam, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Mortarteam, Condition( function Trig_Mortarteam_Conditions ) )
call TriggerAddAction( gg_trg_Mortarteam, function Trig_Mortarteam_Actions )
endfunction
function Trig_Priest_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I00W' ) then
return true
endif
return false
endfunction
function Trig_Priest_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local location loc = GetUnitLoc(hero)
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H008', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 5 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int + 5 )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 5 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A05M' )
call SetUnitAbilityLevel( hero, 'A05M', 3 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 9 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNBloodElfPeasant.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
if ( GetItemTypeId(UnitItemInSlot(hero, 1)) == 'I03Z' ) then
call RemoveItem( UnitItemInSlot(hero, 1) )
call CreateItemLoc( 'I040', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), hero )
endif
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Priest takes nothing returns nothing
set gg_trg_Priest = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Priest, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Priest, Condition( function Trig_Priest_Conditions ) )
call TriggerAddAction( gg_trg_Priest, function Trig_Priest_Actions )
endfunction
function Trig_Cleric_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I00X' ) then
return true
endif
return false
endfunction
function Trig_Cleric_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local location loc = GetUnitLoc(hero)
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H009', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 5 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int + 10 )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 10 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A052' )
call SetUnitAbilityLevel( hero, 'A052', 6 )
call SelectHeroSkill( hero, 'A01H' )
call SetUnitAbilityLevel( hero, 'A01H', 3 )
call SelectHeroSkill( hero, 'A07L' )
call SetUnitAbilityLevel( hero, 'A07L', 1 )
call SelectHeroSkill( hero, 'A01I' )
call SetUnitAbilityLevel( hero, 'A01I', 3 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 19 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNPriest.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
if ( GetItemTypeId(UnitItemInSlot(hero, 1)) == 'I03T' ) then
call RemoveItem( UnitItemInSlot(hero, 1) )
call CreateItemLoc( 'I03U', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), hero )
endif
if ( GetItemTypeId(UnitItemInSlot(hero, 1)) == 'I03Z' ) then
call RemoveItem( UnitItemInSlot(hero, 1) )
call CreateItemLoc( 'I040', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), hero )
endif
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Cleric takes nothing returns nothing
set gg_trg_Cleric = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Cleric, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Cleric, Condition( function Trig_Cleric_Conditions ) )
call TriggerAddAction( gg_trg_Cleric, function Trig_Cleric_Actions )
endfunction
function Trig_Mage_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I00Y' ) then
return true
endif
return false
endfunction
function Trig_Mage_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H006', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int + 15 )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A049' )
call SetUnitAbilityLevel( hero, 'A049', 3 )
call SelectHeroSkill( hero, 'A01M' )
call SetUnitAbilityLevel( hero, 'A01M', 3 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 9 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNMedivh.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
endfunction
//===========================================================================
function InitTrig_Mage takes nothing returns nothing
set gg_trg_Mage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mage, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Mage, Condition( function Trig_Mage_Conditions ) )
call TriggerAddAction( gg_trg_Mage, function Trig_Mage_Actions )
endfunction
function Trig_Sorcerer_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I00Z' ) then
return true
endif
return false
endfunction
function Trig_Sorcerer_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local location loc = GetUnitLoc(hero)
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H00A', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int + 15 )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 10 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A01V' )
call SetUnitAbilityLevel( hero, 'A01V', 6 )
call SelectHeroSkill( hero, 'A02G' )
call SetUnitAbilityLevel( hero, 'A02G', 1 )
call SelectHeroSkill( hero, 'A022' )
call SetUnitAbilityLevel( hero, 'A022', 3 )
call SelectHeroSkill( hero, 'A04D' )
call SetUnitAbilityLevel( hero, 'A04D', 6 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 19 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNHeroPaladin.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
if ( GetItemTypeId(UnitItemInSlot(hero, 1)) == 'I03T' ) then
call RemoveItem( UnitItemInSlot(hero, 1) )
call CreateItemLoc( 'I03U', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), hero )
endif
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Sorcerer takes nothing returns nothing
set gg_trg_Sorcerer = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Sorcerer, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Sorcerer, Condition( function Trig_Sorcerer_Conditions ) )
call TriggerAddAction( gg_trg_Sorcerer, function Trig_Sorcerer_Actions )
endfunction
function Trig_Wizard_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I010' ) then
return true
endif
return false
endfunction
function Trig_Wizard_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local location loc = GetUnitLoc(hero)
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H007', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 5 )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int + 15 )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 5 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A02L' )
call SetUnitAbilityLevel( hero, 'A02L', 6 )
call SelectHeroSkill( hero, 'A04B' )
call SetUnitAbilityLevel( hero, 'A04B', 6 )
call SelectHeroSkill( hero, 'A02H' )
call SetUnitAbilityLevel( hero, 'A02H', 1 )
call SelectHeroSkill( hero, 'A020' )
call SetUnitAbilityLevel( hero, 'A020', 3 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 19 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNDruidOfTheTalon.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
if ( GetItemTypeId(UnitItemInSlot(hero, 1)) == 'I03T' ) then
call RemoveItem( UnitItemInSlot(hero, 1) )
call CreateItemLoc( 'I03U', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), hero )
endif
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wizard takes nothing returns nothing
set gg_trg_Wizard = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Wizard, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Wizard, Condition( function Trig_Wizard_Conditions ) )
call TriggerAddAction( gg_trg_Wizard, function Trig_Wizard_Actions )
endfunction
function Trig_Acolyte_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I01V' ) then
return true
endif
return false
endfunction
function Trig_Acolyte_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H00P', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int + 10 )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 5 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A04J' )
call SetUnitAbilityLevel( hero, 'A04J', 3 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 9 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNAcolyte.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
endfunction
//===========================================================================
function InitTrig_Acolyte takes nothing returns nothing
set gg_trg_Acolyte = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Acolyte, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Acolyte, Condition( function Trig_Acolyte_Conditions ) )
call TriggerAddAction( gg_trg_Acolyte, function Trig_Acolyte_Actions )
endfunction
function Trig_Warlock_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I01W' ) then
return true
endif
return false
endfunction
function Trig_Warlock_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local location loc = GetUnitLoc(hero)
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H00N', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int + 10 )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 15 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A04L' )
call SetUnitAbilityLevel( hero, 'A04L', 6 )
call SelectHeroSkill( hero, 'A04M' )
call SetUnitAbilityLevel( hero, 'A04M', 3 )
call SelectHeroSkill( hero, 'A04N' )
call SetUnitAbilityLevel( hero, 'A04N', 1 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 19 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNNecromancer.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
if ( GetItemTypeId(UnitItemInSlot(hero, 1)) == 'I03T' ) then
call RemoveItem( UnitItemInSlot(hero, 1) )
call CreateItemLoc( 'I03U', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), hero )
endif
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Warlock takes nothing returns nothing
set gg_trg_Warlock = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Warlock, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Warlock, Condition( function Trig_Warlock_Conditions ) )
call TriggerAddAction( gg_trg_Warlock, function Trig_Warlock_Actions )
endfunction
function Trig_Shadow_Priest_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I01X' ) then
return true
endif
return false
endfunction
function Trig_Shadow_Priest_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local location loc = GetUnitLoc(hero)
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H00Q', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
call SetUnitVertexColor( hero, 102, 102, 102, 127 )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi )
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int + 15 )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 10 )
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A04L' )
call SetUnitAbilityLevel( hero, 'A04L', 6 )
call SelectHeroSkill( hero, 'A01I' )
call SetUnitAbilityLevel( hero, 'A01I', 3 )
call SelectHeroSkill( hero, 'A04W' )
call SetUnitAbilityLevel( hero, 'A04W', 1 )
call SelectHeroSkill( hero, 'A04V' )
call SetUnitAbilityLevel( hero, 'A04V', 6 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 19 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNShadowpriest.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
if ( GetItemTypeId(UnitItemInSlot(hero, 1)) == 'I03T' ) then
call RemoveItem( UnitItemInSlot(hero, 1) )
call CreateItemLoc( 'I03U', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), hero )
endif
if ( GetItemTypeId(UnitItemInSlot(hero, 1)) == 'I03Z' ) then
call RemoveItem( UnitItemInSlot(hero, 1) )
call CreateItemLoc( 'I040', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), hero )
endif
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Shadow_Priest takes nothing returns nothing
set gg_trg_Shadow_Priest = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shadow_Priest, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Shadow_Priest, Condition( function Trig_Shadow_Priest_Conditions ) )
call TriggerAddAction( gg_trg_Shadow_Priest, function Trig_Shadow_Priest_Actions )
endfunction
function Trig_Shaman_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetManipulatedItem()) == 'I04U' ) then
return true
endif
return false
endfunction
function Trig_Shaman_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer iter
local integer agi = GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false)
local integer int = GetHeroStatBJ(bj_HEROSTAT_INT, hero, false)
local integer str = GetHeroStatBJ(bj_HEROSTAT_STR, hero, false)
call ReplaceUnitBJ( hero, 'H00V', bj_UNIT_STATE_METHOD_RELATIVE )
set hero = GetLastReplacedUnitBJ()
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
set iter = 1
loop
exitwhen iter > 6
call RemoveItem(UnitItemInSlot(hero, iter-1))
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > 6
call UnitAddItem(hero, UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(hero))], iter-1) )
set iter = iter + 1
endloop
call SetItemCharges( GetItemOfTypeFromUnitBJ(hero, 'I00F'), ( ( ( GetHeroLevel(hero) - 1 ) * 5 ) - udg_stat_spent[GetConvertedPlayerId(GetOwningPlayer(hero))] ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, hero, bj_MODIFYMETHOD_SET, agi + 5)
call ModifyHeroStat( bj_HEROSTAT_INT, hero, bj_MODIFYMETHOD_SET, int + 10 )
call ModifyHeroStat( bj_HEROSTAT_STR, hero, bj_MODIFYMETHOD_SET, str + 10)
call SelectUnitForPlayerSingle( hero, GetOwningPlayer(hero) )
call SelectHeroSkill( hero, 'A07W' )
call SetUnitAbilityLevel( hero, 'A07W', 6 )
call ModifyHeroSkillPoints( hero, bj_MODIFYMETHOD_SET, ( GetHeroLevel(hero) - 19 ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 2, udg_MultiboardRow[GetConvertedPlayerId(GetOwningPlayer(hero))], "ReplaceableTextures\\CommandButtons\\BTNMedivh.blp" )
set udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(hero))] = hero
call SaveBoolean(udg_bierfass, GetHandleId(hero), 206, true)
call BuffAdoption(hero)
call RemoveItemWeaponAbilities(hero)
call RemoveItemArmorAbilities(hero)
call RemoveItemTrinketAbilities(hero)
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 1)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 2)))
call AddItemAbilitiesToHero(hero,GetItemTypeId(UnitItemInSlot(hero, 3)))
set hero = null
endfunction
//===========================================================================
function InitTrig_Shaman takes nothing returns nothing
set gg_trg_Shaman = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shaman, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Shaman, Condition( function Trig_Shaman_Conditions ) )
call TriggerAddAction( gg_trg_Shaman, function Trig_Shaman_Actions )
endfunction
function Trig_Enter_Item_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetSoldItem()) == 'I01Q' ) ) then
return false
endif
return true
endfunction
function Trig_Enter_Item_Actions takes nothing returns nothing
local unit dtower = GetSellingUnit()
local unit tower
local location loc
if ( LoadUnitHandle(udg_methorn, GetHandleId(dtower), 53) == null ) then
set loc = GetUnitLoc(dtower)
call CreateNUnitsAtLoc( 1, 'h00J', GetOwningPlayer(dtower), loc, bj_UNIT_FACING )
set tower = GetLastCreatedUnit()
call SaveUnitHandle(udg_methorn, GetHandleId(dtower), 53, tower)
set loc = GetUnitLoc(tower)
call CreateItemLoc( 'I01S', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), tower )
call CreateItemLoc( 'I01R', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), tower )
call CreateItemLoc( 'I01T', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), tower )
else
set tower = LoadUnitHandle(udg_methorn, GetHandleId(dtower), 53)
call SetUnitOwner( tower, GetOwningPlayer(GetBuyingUnit()), false )
call SetUnitOwner( dtower, GetOwningPlayer(GetBuyingUnit()), false )
call IssueTargetOrderBJ( dtower, "load", GetBuyingUnit() )
call SelectUnitForPlayerSingle( tower, GetOwningPlayer(dtower) )
endif
call RemoveLocation(loc)
set loc = null
set tower = null
set dtower = null
endfunction
//===========================================================================
function InitTrig_Enter_Item takes nothing returns nothing
set gg_trg_Enter_Item = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Enter_Item, EVENT_PLAYER_UNIT_SELL_ITEM )
call TriggerAddCondition( gg_trg_Enter_Item, Condition( function Trig_Enter_Item_Conditions ) )
call TriggerAddAction( gg_trg_Enter_Item, function Trig_Enter_Item_Actions )
endfunction
function Trig_Enter_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetTransportUnitBJ()) == 'h00J' ) then
return true
endif
return false
endfunction
function Trig_Enter_Actions takes nothing returns nothing
local unit target
local unit dtower = GetTransportUnitBJ()
local unit tower = LoadUnitHandle(udg_methorn, GetHandleId(dtower), 53)
local real winkel = LoadReal(udg_methorn, GetHandleId(tower), 51)
local real distanz = LoadReal(udg_methorn, GetHandleId(tower), 52)
local location loc
set loc = GetUnitLoc(tower)
call PanCameraToTimedLocForPlayer( GetOwningPlayer(tower), loc, 0 )
call SetCameraTargetControllerNoZForPlayer( GetOwningPlayer(tower), target, 0, 0, true )
call SetCameraFieldForPlayer( GetOwningPlayer(tower), CAMERA_FIELD_TARGET_DISTANCE, 2000.00, 0 )
call SetCameraFieldForPlayer( GetOwningPlayer(tower), CAMERA_FIELD_FARZ, 2500.00, 0 )
call SetCameraFieldForPlayer( GetOwningPlayer(tower), CAMERA_FIELD_ANGLE_OF_ATTACK, 340, 0 )
call SetCameraFieldForPlayer( GetOwningPlayer(tower), CAMERA_FIELD_FIELD_OF_VIEW, 120.00, 0 )
call SetCameraFieldForPlayer( GetOwningPlayer(tower), CAMERA_FIELD_ROLL, 0.00, 0 )
call SetCameraFieldForPlayer( GetOwningPlayer(tower), CAMERA_FIELD_ROTATION, winkel, 0 )
call SetCameraFieldForPlayer( GetOwningPlayer(tower), CAMERA_FIELD_ZOFFSET, 50.00, 0 )
call RemoveLocation(loc)
set loc = null
set tower = null
set dtower = null
endfunction
//===========================================================================
function InitTrig_Enter takes nothing returns nothing
set gg_trg_Enter = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Enter, EVENT_PLAYER_UNIT_LOADED )
call TriggerAddCondition( gg_trg_Enter, Condition( function Trig_Enter_Conditions ) )
call TriggerAddAction( gg_trg_Enter, function Trig_Enter_Actions )
endfunction
function Trig_Unload_Conditions takes nothing returns boolean
if ( ( GetUnitTypeId(GetOrderedUnit()) == 'h00J' ) and ( ( GetIssuedOrderIdBJ() == String2OrderIdBJ("standdown") ) or ( GetIssuedOrderIdBJ() == String2OrderIdBJ("unload") ) ) ) then
return true
endif
return false
endfunction
function Trig_Unload_Actions takes nothing returns nothing
local unit tower = GetOrderedUnit()
local location loc = GetUnitLoc(tower)
local location loc2 = LoadLocationHandle(udg_methorn, GetHandleId(tower), 50)
local real winkel = AngleBetweenPoints(loc, loc2)
local real distanz = DistanceBetweenPoints(loc, loc2)
call ResetToGameCameraForPlayer( GetOwningPlayer(tower), 0 )
call PanCameraToTimedLocForPlayer( GetOwningPlayer(tower), loc, 0 )
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.00, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
call SaveReal(udg_methorn, GetHandleId(tower), 51, winkel)
call SaveReal(udg_methorn, GetHandleId(tower), 52, distanz)
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
set tower = null
endfunction
//===========================================================================
function InitTrig_Unload takes nothing returns nothing
set gg_trg_Unload = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Unload, EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Unload, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerAddCondition( gg_trg_Unload, Condition( function Trig_Unload_Conditions ) )
call TriggerAddAction( gg_trg_Unload, function Trig_Unload_Actions )
endfunction
function Trig_Cannon_Tower_Attack_Conditions takes nothing returns boolean
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I01S' ) or ( GetItemTypeId(GetManipulatedItem()) == 'I01R' ) ) then
return true
endif
return false
endfunction
function Trig_Cannon_Tower_Attack_Actions takes nothing returns nothing
local unit tower = GetManipulatingUnit()
local location loc = GetUnitLoc(tower)
local location loc2 = LoadLocationHandle(udg_methorn, GetHandleId(tower), 50)
if ( GetItemTypeId(GetManipulatedItem()) == 'I01S' ) then
call CreateNUnitsAtLoc( 1, 'u008', GetOwningPlayer(tower), loc, bj_UNIT_FACING )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attackground", loc2 )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
else
endif
if ( GetItemTypeId(GetManipulatedItem()) == 'I01R' ) then
call CreateNUnitsAtLoc( 1, 'u007', GetOwningPlayer(tower), loc, bj_UNIT_FACING )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attackground", loc2 )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
else
endif
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
endfunction
//===========================================================================
function InitTrig_Cannon_Tower_Attack takes nothing returns nothing
set gg_trg_Cannon_Tower_Attack = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Cannon_Tower_Attack, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Cannon_Tower_Attack, Condition( function Trig_Cannon_Tower_Attack_Conditions ) )
call TriggerAddAction( gg_trg_Cannon_Tower_Attack, function Trig_Cannon_Tower_Attack_Actions )
endfunction
function Trig_Pint_Slot_Upgrade_Conditions takes nothing returns boolean
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I047' ) or ( GetItemTypeId(GetManipulatedItem()) == 'I048' ) ) then
return true
endif
return false
endfunction
function Trig_Pint_Slot_Upgrade_Actions takes nothing returns nothing
local location loc
if ( GetItemTypeId(GetManipulatedItem()) == 'I047' ) then
if ( GetItemTypeId(UnitItemInSlot(GetManipulatingUnit(), 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetManipulatingUnit(), 0) )
set loc = GetUnitLoc(GetManipulatingUnit())
call CreateItemLoc( 'I043', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), GetManipulatingUnit() )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[GetPlayerId(GetOwningPlayer(GetManipulatingUnit()))+1], 0) )
set loc = GetUnitLoc(udg_itemdummy[GetPlayerId(GetOwningPlayer(GetManipulatingUnit()))+1])
call CreateItemLoc( 'I043', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[GetPlayerId(GetOwningPlayer(GetManipulatingUnit()))+1] )
endif
endif
if ( GetItemTypeId(GetManipulatedItem()) == 'I048' ) then
if ( GetItemTypeId(UnitItemInSlot(GetManipulatingUnit(), 4)) == 'I00H' ) then
call RemoveItem( UnitItemInSlot(GetManipulatingUnit(), 0) )
set loc = GetUnitLoc(GetManipulatingUnit())
call CreateItemLoc( 'I046', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), GetManipulatingUnit() )
else
call RemoveItem( UnitItemInSlot(udg_itemdummy[GetPlayerId(GetOwningPlayer(GetManipulatingUnit()))+1], 0) )
set loc = GetUnitLoc(udg_itemdummy[GetPlayerId(GetOwningPlayer(GetManipulatingUnit()))+1])
call CreateItemLoc( 'I046', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[GetPlayerId(GetOwningPlayer(GetManipulatingUnit()))+1] )
endif
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Pint_Slot_Upgrade takes nothing returns nothing
set gg_trg_Pint_Slot_Upgrade = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Pint_Slot_Upgrade, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Pint_Slot_Upgrade, Condition( function Trig_Pint_Slot_Upgrade_Conditions ) )
call TriggerAddAction( gg_trg_Pint_Slot_Upgrade, function Trig_Pint_Slot_Upgrade_Actions )
endfunction
function Trig_Trinken_Conditions takes nothing returns boolean
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I011' ) or ( GetItemTypeId(GetManipulatedItem()) == 'I043' ) or ( GetItemTypeId(GetManipulatedItem()) == 'I046' ) ) then
return true
endif
return false
endfunction
function Trig_Trinken_Groupcond takes nothing returns boolean
if ( ( GetUnitTypeId(GetFilterUnit()) != 'H00O' ) and ( GetFilterUnit() != udg_g_unit[47] ) and ( IsPlayerAlly(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[47])) == true ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true ) and ( IsUnitAliveBJ(GetFilterUnit()) ) and not( UnitHasBuffBJ(GetFilterUnit(), 'B004') ) and not( UnitHasBuffBJ(GetFilterUnit(), 'B015') ) ) then
return true
endif
return false
endfunction
function Trig_Trinken_Groupaction takes nothing returns nothing
local location loc = GetUnitLoc(udg_g_unit[47])
local unit dummy = CreateUnitAtLoc( GetOwningPlayer(udg_g_unit[47]), 'u000', loc, bj_UNIT_FACING )
local player p = GetOwningPlayer(GetEnumUnit())
local integer i = GetConvertedPlayerId(p)
set udg_bierkonsum[i] = udg_bierkonsum[i] + 1
call MultiboardSetItemValueBJ( udg_Multiboard, 5, udg_MultiboardRow[i], I2S(udg_bierkonsum[i]) )
set udg_bierkonsum[0] = udg_bierkonsum[0] + 1
call MultiboardSetItemValueBJ( udg_Multiboard, 5, udg_MultiboardRow[13], I2S(udg_bierkonsum[0]) )
call MultiboardSetItemValueBJ( udg_Multiboard, 5, udg_MultiboardRow[14], I2S(R2I(udg_bierkonsum[0]/(udg_MultiboardRow[13]-3))) )
call UnitApplyTimedLife( dummy, 'BTLF', 3.00 )
call UnitAddAbility( dummy, 'A072' )
call IssueTargetOrder( dummy, "shadowstrike", GetEnumUnit() )
set loc = GetUnitLoc(dummy)
call CreateItemLoc( 'I049', loc )
call UnitAddItem( GetEnumUnit(), GetLastCreatedItem() )
call AttachFloattext(GetEnumUnit(), GetRandomInt(450, 500), udg_g_string[GetRandomInt(41, 43)])
call RemoveLocation(loc)
set loc = null
set dummy = null
set p = null
endfunction
function Trig_Trinken_Actions takes nothing returns nothing
local location loc
local group g
local player p = GetOwningPlayer(GetManipulatingUnit())
local integer i = GetConvertedPlayerId(p)
set udg_bierkonsum[i] = udg_bierkonsum[i] + 1
call MultiboardSetItemValueBJ( udg_Multiboard, 5, udg_MultiboardRow[i], I2S(udg_bierkonsum[i]) )
set udg_bierkonsum[0] = udg_bierkonsum[0] + 1
call MultiboardSetItemValueBJ( udg_Multiboard, 5, udg_MultiboardRow[13], I2S(udg_bierkonsum[0]) )
call MultiboardSetItemValueBJ( udg_Multiboard, 5, udg_MultiboardRow[14], I2S(R2I(udg_bierkonsum[0]/(udg_MultiboardRow[13]-3))) )
call PlaySoundOnUnitBJ( gg_snd_trinken1, 100, GetManipulatingUnit() )
if ( GetItemTypeId(GetManipulatedItem()) == 'I011' ) then
if ( RectContainsUnit(gg_rct_BierLadestation, GetManipulatingUnit()) == true ) then
call SetItemCharges( GetManipulatedItem(), 1 )
else
call RemoveItem( GetManipulatedItem() )
set loc = GetUnitLoc(GetManipulatingUnit())
call CreateItemLoc( 'I012', loc )
call UnitAddItem( GetManipulatingUnit(), GetLastCreatedItem() )
endif
call AttachFloattext(GetManipulatingUnit(), GetRandomInt(275, 325), udg_g_string[GetRandomInt(44, 46)])
endif
if ( GetItemTypeId(GetManipulatedItem()) == 'I043' ) then
if ( RectContainsUnit(gg_rct_BierLadestation, GetManipulatingUnit()) == true ) then
call SetItemCharges( GetManipulatedItem(), 1 )
else
call RemoveItem( GetManipulatedItem() )
set loc = GetUnitLoc(GetManipulatingUnit())
call CreateItemLoc( 'I044', loc )
call UnitAddItem( GetManipulatingUnit(), GetLastCreatedItem() )
endif
call AttachFloattext(GetManipulatingUnit(), GetRandomInt(275, 325), udg_g_string[GetRandomInt(44, 46)])
endif
if ( GetItemTypeId(GetManipulatedItem()) == 'I046' ) then
if ( RectContainsUnit(gg_rct_BierLadestation, GetManipulatingUnit()) == true ) then
call SetItemCharges( GetManipulatedItem(), 1 )
else
call RemoveItem( GetManipulatedItem() )
set loc = GetUnitLoc(GetManipulatingUnit())
call CreateItemLoc( 'I045', loc )
call UnitAddItem( GetManipulatingUnit(), GetLastCreatedItem() )
endif
set udg_g_unit[47] = GetManipulatingUnit()
set loc = GetUnitLoc(udg_g_unit[47])
set g = GetUnitsInRangeOfLocMatching(500.00, loc, Condition(function Trig_Trinken_Groupcond))
call ForGroupBJ( g, function Trig_Trinken_Groupaction )
call AttachFloattext(GetManipulatingUnit(), 500, "Have a drink|non the house!")
endif
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set p = null
endfunction
//===========================================================================
function InitTrig_Trinken takes nothing returns nothing
set gg_trg_Trinken = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Trinken, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Trinken, Condition( function Trig_Trinken_Conditions ) )
call TriggerAddAction( gg_trg_Trinken, function Trig_Trinken_Actions )
endfunction
function Trig_Tavernengetraenke_Conditions takes nothing returns boolean
if ( ( GetItemTypeId(GetSoldItem()) == 'I013' ) or ( GetItemTypeId(GetSoldItem()) == 'I014' ) ) then
return true
endif
return false
endfunction
function Trig_Tavernengetraenke_Actions takes nothing returns nothing
local player p = GetOwningPlayer(GetBuyingUnit())
local integer i = GetConvertedPlayerId(p)
set udg_bierkonsum[i] = udg_bierkonsum[i] + 1
call MultiboardSetItemValueBJ( udg_Multiboard, 5, udg_MultiboardRow[i], I2S(udg_bierkonsum[i]) )
set udg_bierkonsum[0] = udg_bierkonsum[0] + 1
call MultiboardSetItemValueBJ( udg_Multiboard, 5, udg_MultiboardRow[13], I2S(udg_bierkonsum[0]) )
call MultiboardSetItemValueBJ( udg_Multiboard, 5, udg_MultiboardRow[14], I2S(R2I(udg_bierkonsum[0]/(udg_MultiboardRow[13]-3))) )
set p = null
endfunction
//===========================================================================
function InitTrig_Tavernengetraenke takes nothing returns nothing
set gg_trg_Tavernengetraenke = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Tavernengetraenke, gg_unit_n001_0017, EVENT_UNIT_SELL_ITEM )
call TriggerAddCondition( gg_trg_Tavernengetraenke, Condition( function Trig_Tavernengetraenke_Conditions ) )
call TriggerAddAction( gg_trg_Tavernengetraenke, function Trig_Tavernengetraenke_Actions )
endfunction
function Trig_Alkohollevel_Effekte_Actions takes nothing returns nothing
local integer iter = 4
local location loc = Location(6500.00, -6500.00)
local unit bierbuffdummy
local unit bierdebuffdummy
local real alkoholsumme = 0
local real alkoholmax = 0
loop
exitwhen iter > 12
if ( GetPlayerSlotState(Player(iter-1)) == PLAYER_SLOT_STATE_PLAYING ) then
if (GetUnitStateSwap(UNIT_STATE_MANA, udg_HeroID[iter]) >= 750.00) then
call MultiboardSetItemValueBJ( udg_Multiboard, 6, udg_MultiboardRow[iter], "|Cff00ff00"+I2S(R2I(100*GetUnitState(udg_HeroID[iter],UNIT_STATE_MANA)/GetUnitState(udg_HeroID[iter],UNIT_STATE_MAX_MANA)))+"%|r" )
else
if (GetUnitStateSwap(UNIT_STATE_MANA, udg_HeroID[iter]) >= 100.00) then
call MultiboardSetItemValueBJ( udg_Multiboard, 6, udg_MultiboardRow[iter], I2S(R2I(100*GetUnitState(udg_HeroID[iter],UNIT_STATE_MANA)/GetUnitState(udg_HeroID[iter],UNIT_STATE_MAX_MANA)))+"%|r" )
else
call MultiboardSetItemValueBJ( udg_Multiboard, 6, udg_MultiboardRow[iter], "|Cffff0000"+I2S(R2I(100*GetUnitState(udg_HeroID[iter],UNIT_STATE_MANA)/GetUnitState(udg_HeroID[iter],UNIT_STATE_MAX_MANA)))+"%|r" )
endif
endif
set alkoholsumme = alkoholsumme + GetUnitState(udg_HeroID[iter],UNIT_STATE_MANA)
set alkoholmax = alkoholmax + GetUnitState(udg_HeroID[iter],UNIT_STATE_MAX_MANA)
set bierbuffdummy = LoadUnitHandle(udg_methorn, GetHandleId(ConvertedPlayer(iter)), 103)
set bierdebuffdummy = LoadUnitHandle(udg_methorn, GetHandleId(ConvertedPlayer(iter)), 104)
if ( ( GetUnitStateSwap(UNIT_STATE_MANA, udg_HeroID[iter]) >= 750.00 ) and not( UnitHasBuffBJ(udg_HeroID[iter], 'B004') ) ) then
if ( bierbuffdummy == null ) then
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(udg_HeroID[iter]), loc, bj_UNIT_FACING )
set bierbuffdummy = GetLastCreatedUnit()
call SaveUnitHandle(udg_methorn, GetHandleId(ConvertedPlayer(iter)), 103, bierbuffdummy)
call UnitAddAbilityBJ( 'A04Y', bierbuffdummy )
endif
else
call SaveUnitHandle(udg_methorn, GetHandleId(ConvertedPlayer(iter)), 103, null)
call RemoveUnit(bierbuffdummy)
call UnitRemoveBuffBJ( 'B018', udg_HeroID[iter] )
endif
if ( ( GetUnitStateSwap(UNIT_STATE_MANA, udg_HeroID[iter]) <= 1.00 ) and not( UnitHasBuffBJ(udg_HeroID[iter], 'B004') ) ) then
if ( UnitHasBuffBJ(udg_HeroID[iter], 'B015') ) then
call IssueImmediateOrderBJ( udg_HeroID[iter], "stop" )
endif
if ( GetUnitStatePercent(udg_HeroID[iter], UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE) <= 5 ) then
call SetUnitState(udg_HeroID[iter], UNIT_STATE_LIFE, 1)
else
call SetUnitLifeBJ( udg_HeroID[iter], ( GetUnitStateSwap(UNIT_STATE_LIFE, udg_HeroID[iter]) - ( 0.05 * GetUnitStateSwap(UNIT_STATE_MAX_LIFE, udg_HeroID[iter]) ) ) )
endif
if ( bierdebuffdummy == null ) then
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(udg_HeroID[iter]), loc, bj_UNIT_FACING )
set bierdebuffdummy = GetLastCreatedUnit()
call SaveUnitHandle(udg_methorn, GetHandleId(ConvertedPlayer(iter)), 104, bierdebuffdummy)
call UnitAddAbilityBJ( 'A04Z', bierdebuffdummy )
endif
else
call SaveUnitHandle(udg_methorn, GetHandleId(ConvertedPlayer(iter)), 104, null)
call RemoveUnit(bierdebuffdummy)
call UnitRemoveBuffBJ( 'B019', udg_HeroID[iter] )
endif
endif
set iter = iter + 1
endloop
call MultiboardSetItemValueBJ( udg_Multiboard, 6, udg_MultiboardRow[14], I2S(R2I(100*alkoholsumme/alkoholmax))+"%" )
call RemoveLocation(loc)
set loc = null
set bierbuffdummy = null
set bierdebuffdummy = null
endfunction
//===========================================================================
function InitTrig_Alkohollevel_Effekte takes nothing returns nothing
set gg_trg_Alkohollevel_Effekte = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Alkohollevel_Effekte, 1.00 )
call TriggerAddAction( gg_trg_Alkohollevel_Effekte, function Trig_Alkohollevel_Effekte_Actions )
endfunction
function Trig_Fuellen_Actions takes nothing returns nothing
local location loc
if ( GetItemTypeId(UnitItemInSlot(GetEnteringUnit(), 4)) == 'I00H' ) then
set loc = GetUnitLoc(GetEnteringUnit())
if ( GetItemTypeId(UnitItemInSlot(GetEnteringUnit(), 0)) == 'I012' ) then
call RemoveItem( UnitItemInSlot(GetEnteringUnit(), 0) )
call CreateItemLoc( 'I011', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), GetEnteringUnit() )
else
if ( GetItemTypeId(UnitItemInSlot(GetEnteringUnit(), 0)) == 'I044' ) then
call RemoveItem( UnitItemInSlot(GetEnteringUnit(), 0) )
call CreateItemLoc( 'I043', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), GetEnteringUnit() )
else
if ( GetItemTypeId(UnitItemInSlot(GetEnteringUnit(), 0)) == 'I045' ) then
call RemoveItem( UnitItemInSlot(GetEnteringUnit(), 0) )
call CreateItemLoc( 'I046', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), GetEnteringUnit() )
else
endif
endif
endif
else
set loc = GetUnitLoc(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))])
if ( GetItemTypeId(UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))], 0)) == 'I012' ) then
call RemoveItem( UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))], 0) )
call CreateItemLoc( 'I011', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] )
else
if ( GetItemTypeId(UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))], 0)) == 'I044' ) then
call RemoveItem( UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))], 0) )
call CreateItemLoc( 'I043', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] )
else
if ( GetItemTypeId(UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))], 0)) == 'I045' ) then
call RemoveItem( UnitItemInSlot(udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))], 0) )
call CreateItemLoc( 'I046', loc )
call UnitAddItemSwapped( GetLastCreatedItem(), udg_itemdummy[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] )
else
endif
endif
endif
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Fuellen takes nothing returns nothing
set gg_trg_Fuellen = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Fuellen, gg_rct_BierLadestation )
call TriggerAddAction( gg_trg_Fuellen, function Trig_Fuellen_Actions )
endfunction
function Trig_Met_Conditions takes nothing returns boolean
if ( GetItemTypeId(GetSoldItem()) == 'I01U' ) then
return true
endif
return false
endfunction
function Trig_Met_Timeout takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit trinker = LoadUnitHandle(udg_methorn, GetHandleId(t), 102)
local player p = GetOwningPlayer(trinker)
local unit metdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 101)
call FlushChildHashtable(udg_methorn, GetHandleId(t))
call SaveTimerHandle(udg_methorn, GetHandleId(p), 100, null)
call DestroyTimer(t)
call SaveUnitHandle(udg_methorn, GetHandleId(p), 101, null)
call RemoveUnit(metdummy)
call UnitRemoveAbilityBJ( 'A047', trinker )
call UnitRemoveBuffBJ( 'B00X', trinker )
set trinker = null
set p = null
set metdummy = null
set t = null
endfunction
function Trig_Met_Actions takes nothing returns nothing
local timer t
local unit trinker = GetBuyingUnit()
local player p = GetOwningPlayer(trinker)
local unit metdummy
local location loc = Location(7250.00, -7250.00)
set t = LoadTimerHandle(udg_methorn, GetHandleId(p), 100)
set metdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 101)
if ( t != null ) then
call FlushChildHashtable(udg_methorn, GetHandleId(t))
call DestroyTimer(t)
endif
call SaveUnitHandle(udg_methorn, GetHandleId(p), 101, null)
call RemoveUnit(metdummy)
call UnitRemoveAbilityBJ( 'A047', trinker )
call UnitRemoveBuffBJ( 'B00X', trinker )
call CreateNUnitsAtLoc( 1, 'u000', p, loc, bj_UNIT_FACING )
set metdummy = GetLastCreatedUnit()
set t = CreateTimer()
call UnitAddAbilityBJ( 'A046', metdummy )
call UnitAddAbilityBJ( 'A047', trinker )
call SaveTimerHandle(udg_methorn, GetHandleId(p), 100, t)
call SaveUnitHandle(udg_methorn, GetHandleId(p), 101, metdummy)
call SaveUnitHandle(udg_methorn, GetHandleId(t), 102, trinker)
call TimerStart( t, 300.00, false, function Trig_Met_Timeout )
set t = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Met takes nothing returns nothing
set gg_trg_Met = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Met, EVENT_PLAYER_UNIT_SELL_ITEM )
call TriggerAddCondition( gg_trg_Met, Condition( function Trig_Met_Conditions ) )
call TriggerAddAction( gg_trg_Met, function Trig_Met_Actions )
endfunction
function Trig_Teleport_Conditions takes nothing returns boolean
if (GetItemTypeId(GetSoldItem()) == 'I03G' ) then
return true
endif
return false
endfunction
function Trig_Teleport_Actions takes nothing returns nothing
local unit s = GetSellingUnit()
local unit b = GetBuyingUnit()
local location loc = Location(-2600.00, 633.00)
local effect sfx
local effect sfx2
call SetUnitAnimation( s, "spell" )
call QueueUnitAnimationBJ( s, "stand" )
set sfx = AddSpecialEffectLoc( "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTo.mdl", loc )
call TriggerSleepAction( 0.50 )
set sfx2 = AddSpecialEffectLoc( "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl", loc )
call TriggerSleepAction( 0.25 )
call SetUnitPositionLoc( b, loc )
call TriggerSleepAction( 0.75 )
call DestroyEffect(sfx)
set sfx = null
call DestroyEffect(sfx2)
set sfx2 = null
call RemoveLocation(loc)
set loc = null
set s = null
set b = null
endfunction
//===========================================================================
function InitTrig_Teleport takes nothing returns nothing
set gg_trg_Teleport = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Teleport, EVENT_PLAYER_UNIT_SELL_ITEM )
call TriggerAddCondition( gg_trg_Teleport, Condition( function Trig_Teleport_Conditions ) )
call TriggerAddAction( gg_trg_Teleport, function Trig_Teleport_Actions )
endfunction
function Trig_Dexterity_Conditions takes nothing returns boolean
if ( ( GetItemTypeId(GetSoldItem()) == 'I021' ) or ( GetItemTypeId(GetSoldItem()) == 'I022' ) )then
return true
endif
return false
endfunction
function Trig_Dexterity_Timeout takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit target = LoadUnitHandle(udg_methorn, GetHandleId(t), 129)
local player p = GetOwningPlayer(target)
local unit dexdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 121)
call FlushChildHashtable(udg_methorn, GetHandleId(t))
call SaveTimerHandle(udg_methorn, GetHandleId(p), 120, null)
call DestroyTimer(t)
call SaveUnitHandle(udg_methorn, GetHandleId(p), 121, null)
call RemoveUnit(dexdummy)
call UnitRemoveAbilityBJ( 'A05Q', target )
call UnitRemoveAbilityBJ( 'A05R', target )
call UnitRemoveBuffBJ( 'B01M', target )
set target = null
set dexdummy = null
set t = null
set p = null
endfunction
function Trig_Dexterity_Actions takes nothing returns nothing
local timer t
local unit target = GetBuyingUnit()
local player p = GetOwningPlayer(target)
local unit dexdummy
local location loc = Location(7250.00, -7250.00)
set t = LoadTimerHandle(udg_methorn, GetHandleId(p), 120)
set dexdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 121)
if ( t != null ) then
call FlushChildHashtable(udg_methorn, GetHandleId(t))
call DestroyTimer(t)
endif
call SaveUnitHandle(udg_methorn, GetHandleId(p), 121, null)
call RemoveUnit(dexdummy)
call UnitRemoveAbilityBJ( 'A05Q', target )
call UnitRemoveAbilityBJ( 'A05R', target )
call UnitRemoveBuffBJ( 'B01M', target )
call CreateNUnitsAtLoc( 1, 'u000', p, loc, bj_UNIT_FACING )
set dexdummy = GetLastCreatedUnit()
set t = CreateTimer()
call UnitAddAbilityBJ( 'A05S', dexdummy )
if ( GetItemTypeId(GetSoldItem()) == 'I021' ) then
call UnitAddAbilityBJ( 'A05Q', target )
call SaveInteger(udg_methorn, GetHandleId(p), 122, 1)
else
call UnitAddAbilityBJ( 'A05R', target )
call SaveInteger(udg_methorn, GetHandleId(p), 122, 2)
endif
call SaveTimerHandle(udg_methorn, GetHandleId(p), 120, t)
call SaveUnitHandle(udg_methorn, GetHandleId(p), 121, dexdummy)
call SaveUnitHandle(udg_methorn, GetHandleId(t), 129, target)
call TimerStart( t, 180.00, false, function Trig_Dexterity_Timeout )
set t = null
call RemoveLocation(loc)
set loc = null
set p = null
set dexdummy = null
endfunction
//===========================================================================
function InitTrig_Dexterity takes nothing returns nothing
set gg_trg_Dexterity = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dexterity, EVENT_PLAYER_UNIT_SELL_ITEM )
call TriggerAddCondition( gg_trg_Dexterity, Condition( function Trig_Dexterity_Conditions ) )
call TriggerAddAction( gg_trg_Dexterity, function Trig_Dexterity_Actions )
endfunction
function Trig_Might_Conditions takes nothing returns boolean
if ( ( GetItemTypeId(GetSoldItem()) == 'I025' ) or ( GetItemTypeId(GetSoldItem()) == 'I026' ) )then
return true
endif
return false
endfunction
function Trig_Might_Timeout takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit target = LoadUnitHandle(udg_methorn, GetHandleId(t), 129)
local player p = GetOwningPlayer(target)
local unit mightdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 124)
call FlushChildHashtable(udg_methorn, GetHandleId(t))
call SaveTimerHandle(udg_methorn, GetHandleId(p), 123, null)
call DestroyTimer(t)
call SaveUnitHandle(udg_methorn, GetHandleId(p), 124, null)
call RemoveUnit(mightdummy)
call UnitRemoveAbilityBJ( 'A05T', target )
call UnitRemoveAbilityBJ( 'A05U', target )
call UnitRemoveBuffBJ( 'B01N', target )
set target = null
set mightdummy = null
set t = null
set p = null
endfunction
function Trig_Might_Actions takes nothing returns nothing
local timer t
local unit target = GetBuyingUnit()
local player p = GetOwningPlayer(target)
local unit mightdummy
local location loc = Location(7250.00, -7250.00)
set t = LoadTimerHandle(udg_methorn, GetHandleId(p), 123)
set mightdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 124)
if ( t != null ) then
call FlushChildHashtable(udg_methorn, GetHandleId(t))
call DestroyTimer(t)
endif
call SaveUnitHandle(udg_methorn, GetHandleId(p), 124, null)
call RemoveUnit(mightdummy)
call UnitRemoveAbilityBJ( 'A05T', target )
call UnitRemoveAbilityBJ( 'A05U', target )
call UnitRemoveBuffBJ( 'B01N', target )
call CreateNUnitsAtLoc( 1, 'u000', p, loc, bj_UNIT_FACING )
set mightdummy = GetLastCreatedUnit()
set t = CreateTimer()
call UnitAddAbilityBJ( 'A05Y', mightdummy )
if ( GetItemTypeId(GetSoldItem()) == 'I025' ) then
call UnitAddAbilityBJ( 'A05T', target )
call SaveInteger(udg_methorn, GetHandleId(p), 125, 1)
else
call UnitAddAbilityBJ( 'A05U', target )
call SaveInteger(udg_methorn, GetHandleId(p), 125, 2)
endif
call SaveTimerHandle(udg_methorn, GetHandleId(p), 123, t)
call SaveUnitHandle(udg_methorn, GetHandleId(p), 124, mightdummy)
call SaveUnitHandle(udg_methorn, GetHandleId(t), 129, target)
call TimerStart( t, 180.00, false, function Trig_Might_Timeout )
set t = null
call RemoveLocation(loc)
set loc = null
set p = null
set mightdummy = null
endfunction
//===========================================================================
function InitTrig_Might takes nothing returns nothing
set gg_trg_Might = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Might, EVENT_PLAYER_UNIT_SELL_ITEM )
call TriggerAddCondition( gg_trg_Might, Condition( function Trig_Might_Conditions ) )
call TriggerAddAction( gg_trg_Might, function Trig_Might_Actions )
endfunction
function Trig_Wisdom_Conditions takes nothing returns boolean
if ( ( GetItemTypeId(GetSoldItem()) == 'I023' ) or ( GetItemTypeId(GetSoldItem()) == 'I024' ) )then
return true
endif
return false
endfunction
function Trig_Wisdom_Timeout takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit target = LoadUnitHandle(udg_methorn, GetHandleId(t), 129)
local player p = GetOwningPlayer(target)
local unit wisdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 127)
call FlushChildHashtable(udg_methorn, GetHandleId(t))
call SaveTimerHandle(udg_methorn, GetHandleId(p), 126, null)
call DestroyTimer(t)
call SaveUnitHandle(udg_methorn, GetHandleId(p), 127, null)
call RemoveUnit(wisdummy)
call UnitRemoveAbilityBJ( 'A05V', target )
call UnitRemoveAbilityBJ( 'A05W', target )
call UnitRemoveBuffBJ( 'B01O', target )
set target = null
set wisdummy = null
set t = null
set p = null
endfunction
function Trig_Wisdom_Actions takes nothing returns nothing
local timer t
local unit target = GetBuyingUnit()
local player p = GetOwningPlayer(target)
local unit wisdummy
local location loc = Location(7250.00, -7250.00)
set t = LoadTimerHandle(udg_methorn, GetHandleId(p), 126)
set wisdummy = LoadUnitHandle(udg_methorn, GetHandleId(p), 127)
if ( t != null ) then
call FlushChildHashtable(udg_methorn, GetHandleId(t))
call DestroyTimer(t)
endif
call SaveUnitHandle(udg_methorn, GetHandleId(p), 127, null)
call RemoveUnit(wisdummy)
call UnitRemoveAbilityBJ( 'A05V', target )
call UnitRemoveAbilityBJ( 'A05W', target )
call UnitRemoveBuffBJ( 'B01O', target )
call CreateNUnitsAtLoc( 1, 'u000', p, loc, bj_UNIT_FACING )
set wisdummy = GetLastCreatedUnit()
set t = CreateTimer()
call UnitAddAbilityBJ( 'A05X', wisdummy )
if ( GetItemTypeId(GetSoldItem()) == 'I023' ) then
call UnitAddAbilityBJ( 'A05V', target )
call SaveInteger(udg_methorn, GetHandleId(p), 128, 1)
else
call UnitAddAbilityBJ( 'A05W', target )
call SaveInteger(udg_methorn, GetHandleId(p), 128, 2)
endif
call SaveTimerHandle(udg_methorn, GetHandleId(p), 126, t)
call SaveUnitHandle(udg_methorn, GetHandleId(p), 127, wisdummy)
call SaveUnitHandle(udg_methorn, GetHandleId(t), 129, target)
call TimerStart( t, 180.00, false, function Trig_Wisdom_Timeout )
set t = null
call RemoveLocation(loc)
set loc = null
set p = null
set wisdummy = null
endfunction
//===========================================================================
function InitTrig_Wisdom takes nothing returns nothing
set gg_trg_Wisdom = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Wisdom, EVENT_PLAYER_UNIT_SELL_ITEM )
call TriggerAddCondition( gg_trg_Wisdom, Condition( function Trig_Wisdom_Conditions ) )
call TriggerAddAction( gg_trg_Wisdom, function Trig_Wisdom_Actions )
endfunction
function Trig_Arcane_Power_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A075' ) then
return true
endif
return false
endfunction
function Trig_Arcane_Power_Timeout takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(udg_bierfass, GetHandleId(t), 26)
local location loc = GetUnitLoc(u)
local unit caster = CreateUnitAtLoc(GetOwningPlayer(u), 'u000', loc, 0.00)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', caster )
call UnitAddAbility(caster, 'A077')
call IssueTargetOrder( caster, "soulburn", u )
set u = null
set t = null
set caster = null
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Arcane_Power_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit u = GetSpellAbilityUnit()
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 26, u)
call TimerStart( t, 10.00, false, function Trig_Arcane_Power_Timeout )
set t = null
endfunction
//===========================================================================
function InitTrig_Arcane_Power takes nothing returns nothing
set gg_trg_Arcane_Power = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Arcane_Power, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Arcane_Power, Condition( function Trig_Arcane_Power_Conditions ) )
call TriggerAddAction( gg_trg_Arcane_Power, function Trig_Arcane_Power_Actions )
endfunction
function Trig_Big_Book_of_Pirate_Insults_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A07A' ) then
return true
endif
return false
endfunction
function Trig_Big_Book_of_Pirate_Insults_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == false ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[46])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Big_Book_of_Pirate_Insults_Groupaction takes nothing returns nothing
local location loc = GetUnitLoc(GetEnumUnit())
local unit dummy = CreateUnitAtLoc( GetOwningPlayer(udg_g_unit[46]), 'u000', loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', dummy )
call UnitAddAbilityBJ( 'A07B', dummy )
call IssueTargetOrderBJ( dummy, "sleep", GetEnumUnit() )
call RemoveLocation(loc)
set loc = null
set dummy = null
endfunction
function Trig_Big_Book_of_Pirate_Insults_Textmove takes nothing returns nothing
local timer t = GetExpiredTimer()
local texttag text = LoadTextTagHandle(udg_bierfass, GetHandleId(t), 27)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 28) + 1
local unit u = LoadUnitHandle(udg_bierfass, GetHandleId(t), 29)
local location loc = GetUnitLoc(u)
call SaveInteger(udg_bierfass, GetHandleId(t), 28, iter)
if ( ( iter <= 500 ) and ( IsUnitAliveBJ(u) ) ) then
call SetTextTagPosBJ(text, loc, 50.00)
else
call DestroyTextTag(text)
call PauseTimer(t)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
call RemoveLocation(loc)
set loc = null
set u = null
set text = null
set t = null
endfunction
function Trig_Big_Book_of_Pirate_Insults_TextmoveA takes nothing returns nothing
local timer t = GetExpiredTimer()
local texttag text = LoadTextTagHandle(udg_bierfass, GetHandleId(t), 27)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 28) - 1
local unit u = LoadUnitHandle(udg_bierfass, GetHandleId(t), 29)
local location loc = GetUnitLoc(u)
call SaveInteger(udg_bierfass, GetHandleId(t), 28, iter)
if ( ( iter >= 0 ) and ( IsUnitAliveBJ(u) ) and UnitHasBuffBJ(u, 'B01Y') ) then
call SetTextTagPosBJ(text, loc, 50.00)
else
call DestroyTextTag(text)
call PauseTimer(t)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
call RemoveLocation(loc)
set loc = null
set u = null
set text = null
set t = null
endfunction
function Trig_Big_Book_of_Pirate_Insults_Actions takes nothing returns nothing
local location loc = GetSpellTargetLoc()
local group g
local unit u = GetSpellAbilityUnit()
local real r
local timer t = CreateTimer()
local timer t1
local timer t2
local timer t3
local timer t4
set udg_g_unit[46] = u
set g = GetUnitsInRangeOfLocMatching(250.00, loc, Condition(function Trig_Big_Book_of_Pirate_Insults_Groupcond))
set loc = GetUnitLoc(u)
call CreateTextTagLocBJ( udg_g_string[GetRandomInt(13, 17)], loc, 50.00, 9.00, 100, 100, 100, 0 )
call SetTextTagPermanent( GetLastCreatedTextTag(), false )
call SetTextTagLifespan( GetLastCreatedTextTag(), 5.00 )
call SaveTextTagHandle(udg_bierfass, GetHandleId(t), 27, GetLastCreatedTextTag())
call SaveInteger(udg_bierfass, GetHandleId(t), 28, 0)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 29, u)
call TimerStart(t, 0.01, true, function Trig_Big_Book_of_Pirate_Insults_Textmove)
call ForGroupBJ( g, function Trig_Big_Book_of_Pirate_Insults_Groupaction )
set u = GroupPickRandomUnit(g)
set loc = GetUnitLoc(u)
call CreateTextTagLocBJ( udg_g_string[GetRandomInt(18, 20)], loc, 50.00, 9.00, 100, 100, 100, 0 )
set t1 = CreateTimer()
set r = GetRandomReal(3.50, 4.50)
call SetTextTagPermanent( GetLastCreatedTextTag(), false )
call SetTextTagLifespan( GetLastCreatedTextTag(), r )
call SaveTextTagHandle(udg_bierfass, GetHandleId(t1), 27, GetLastCreatedTextTag())
call SaveInteger(udg_bierfass, GetHandleId(t1), 28, R2I(r*100))
call SaveUnitHandle(udg_bierfass, GetHandleId(t1), 29, u)
call TimerStart(t1, 0.01, true, function Trig_Big_Book_of_Pirate_Insults_TextmoveA)
call GroupRemoveUnitSimple( u, g )
if ( CountUnitsInGroup(g) >= 4 ) then
set u = GroupPickRandomUnit(g)
set loc = GetUnitLoc(u)
call CreateTextTagLocBJ( udg_g_string[GetRandomInt(18, 20)], loc, 50.00, 9.00, 100, 100, 100, 0 )
set t2 = CreateTimer()
set r = GetRandomReal(3.50, 4.50)
call SetTextTagPermanent( GetLastCreatedTextTag(), false )
call SaveTextTagHandle(udg_bierfass, GetHandleId(t2), 27, GetLastCreatedTextTag())
call SaveInteger(udg_bierfass, GetHandleId(t2), 28, R2I(r*100))
call SaveUnitHandle(udg_bierfass, GetHandleId(t2), 29, u)
call TimerStart(t2, 0.01, true, function Trig_Big_Book_of_Pirate_Insults_TextmoveA)
call GroupRemoveUnitSimple( u, g )
if ( CountUnitsInGroup(g) >= 7 ) then
set u = GroupPickRandomUnit(g)
set loc = GetUnitLoc(u)
call CreateTextTagLocBJ( udg_g_string[GetRandomInt(18, 20)], loc, 50.00, 9.00, 100, 100, 100, 0 )
set t2 = CreateTimer()
set r = GetRandomReal(3.50, 4.50)
call SetTextTagPermanent( GetLastCreatedTextTag(), false )
call SetTextTagLifespan( GetLastCreatedTextTag(), r )
call SaveTextTagHandle(udg_bierfass, GetHandleId(t3), 27, GetLastCreatedTextTag())
call SaveInteger(udg_bierfass, GetHandleId(t3), 28, R2I(r*100))
call SaveUnitHandle(udg_bierfass, GetHandleId(t3), 29, u)
call TimerStart(t2, 0.01, true, function Trig_Big_Book_of_Pirate_Insults_TextmoveA)
call GroupRemoveUnitSimple( u, g )
if ( CountUnitsInGroup(g) >= 10 ) then
set u = GroupPickRandomUnit(g)
set loc = GetUnitLoc(u)
call CreateTextTagLocBJ( udg_g_string[GetRandomInt(18, 20)], loc, 50.00, 9.00, 100, 100, 100, 0 )
set t4 = CreateTimer()
set r = GetRandomReal(3.50, 4.50)
call SetTextTagPermanent( GetLastCreatedTextTag(), false )
call SetTextTagLifespan( GetLastCreatedTextTag(), r )
call SaveTextTagHandle(udg_bierfass, GetHandleId(t4), 27, GetLastCreatedTextTag())
call SaveInteger(udg_bierfass, GetHandleId(t4), 28, R2I(r*100))
call SaveUnitHandle(udg_bierfass, GetHandleId(t4), 29, u)
call TimerStart(t4, 0.01, true, function Trig_Big_Book_of_Pirate_Insults_TextmoveA)
call GroupRemoveUnitSimple( u, g )
endif
endif
endif
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set u = null
set t = null
set t1 = null
set t2 = null
set t3 = null
set t4 = null
endfunction
//===========================================================================
function InitTrig_Big_Book_of_Pirate_Insults takes nothing returns nothing
set gg_trg_Big_Book_of_Pirate_Insults = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Big_Book_of_Pirate_Insults, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Big_Book_of_Pirate_Insults, Condition( function Trig_Big_Book_of_Pirate_Insults_Conditions ) )
call TriggerAddAction( gg_trg_Big_Book_of_Pirate_Insults, function Trig_Big_Book_of_Pirate_Insults_Actions )
endfunction
function Trig_Healward_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A07C' ) then
return true
endif
return false
endfunction
function Trig_Healward_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) == true ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerAlly(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[45])) == true ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_MECHANICAL) == false ) and ( GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) < GetUnitState(GetFilterUnit(), UNIT_STATE_MAX_LIFE) ) ) then
return true
endif
return false
endfunction
function Trig_Healward_Groupaction takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetEnumUnit()
local real heal
local real scaler
local boolean crit = false
set heal = GetRandomReal(0.045, 0.055) * GetUnitState(target, UNIT_STATE_MAX_LIFE)
set scaler = heal / (0.055 * GetUnitState(target, UNIT_STATE_MAX_LIFE))
call HealTargetWithTextMagic(caster, target, heal, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Healward_Periodic_Actions takes nothing returns nothing
local timer t = GetExpiredTimer()
local location loc
local group g
local unit ward = LoadUnitHandle(udg_bierfass, GetHandleId(t), 30)
if ( IsUnitDeadBJ(ward) == true ) then
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
else
set loc = GetUnitLoc(ward)
set udg_g_unit[45] = ward
set g = GetUnitsInRangeOfLocMatching(250.00, loc, Condition(function Trig_Healward_Groupcond))
call ForGroupBJ( g, function Trig_Healward_Groupaction )
call TimerStart(t, 2.00, false, function Trig_Healward_Periodic_Actions)
endif
set ward = null
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set t = null
endfunction
function Trig_Healward_Actions takes nothing returns nothing
local timer t = CreateTimer()
local location loc = GetSpellTargetLoc()
local unit ward = CreateUnitAtLoc( GetOwningPlayer(GetSpellAbilityUnit()), 'o00N', loc, bj_UNIT_FACING )
call UnitApplyTimedLife( ward, 'A07B', 15.00 )
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 30, ward)
call TimerStart(t, 1.00, false, function Trig_Healward_Periodic_Actions)
set t = null
set ward = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Healward takes nothing returns nothing
set gg_trg_Healward = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Healward, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Healward, Condition( function Trig_Healward_Conditions ) )
call TriggerAddAction( gg_trg_Healward, function Trig_Healward_Actions )
endfunction
function Trig_Hearthstone_Item_Begin_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A08E' ) then
return true
endif
return false
endfunction
function Trig_Hearthstone_Item_Begin_Actions takes nothing returns nothing
local location loc = Location(-2600.00, 633.00)
call SetUnitInvulnerable( GetSpellAbilityUnit(), true )
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTo.mdl" )
call SaveEffectHandle(udg_bierfass, GetHandleId(GetSpellAbilityUnit()), 212, GetLastCreatedEffectBJ())
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Hearthstone_Item_Begin takes nothing returns nothing
set gg_trg_Hearthstone_Item_Begin = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hearthstone_Begin, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Hearthstone_Begin, Condition( function Trig_Hearthstone_Item_Begin_Conditions ) )
call TriggerAddAction( gg_trg_Hearthstone_Begin, function Trig_Hearthstone_Item_Begin_Actions )
endfunction
function Trig_Hearthstone_Item_Cancel_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A08E' ) then
return true
endif
return false
endfunction
function Trig_Hearthstone_Item_Cancel_Actions takes nothing returns nothing
call SetUnitInvulnerable( GetSpellAbilityUnit(), false )
call DestroyEffectBJ( LoadEffectHandle(udg_bierfass, GetHandleId(GetSpellAbilityUnit()), 212) )
call SaveEffectHandle(udg_bierfass, GetHandleId(GetSpellAbilityUnit()), 212, null)
endfunction
//===========================================================================
function InitTrig_Hearthstone_Item_Cancel takes nothing returns nothing
set gg_trg_Hearthstone_Item_Cancel = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hearthstone_Item_Cancel, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_Hearthstone_Item_Cancel, Condition( function Trig_Hearthstone_Item_Cancel_Conditions ) )
call TriggerAddAction( gg_trg_Hearthstone_Item_Cancel, function Trig_Hearthstone_Item_Cancel_Actions )
endfunction
function Trig_Hearthstone_Item_Finish_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A08E' ) then
return true
endif
return false
endfunction
function Trig_Hearthstone_Item_Finish_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetSpellAbilityUnit())
local unit u = GetSpellAbilityUnit()
call SetUnitInvulnerable( u, false )
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
if ( IsTriggerEnabled(gg_trg_Schlussfight_Ende) == true ) then
set loc = Location(-6193.00, 5485.00)
else
set loc = Location(-2600.00, 633.00)
endif
call SetUnitPositionLoc( u, loc )
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl" )
call DestroyEffectBJ( LoadEffectHandle(udg_bierfass, GetHandleId(u), 212) )
call SaveEffectHandle(udg_bierfass, GetHandleId(u), 212, null)
set u = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Hearthstone_Item_Finish takes nothing returns nothing
set gg_trg_Hearthstone_Item_Finish = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hearthstone_Item_Finish, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Hearthstone_Item_Finish, Condition( function Trig_Hearthstone_Item_Finish_Conditions ) )
call TriggerAddAction( gg_trg_Hearthstone_Item_Finish, function Trig_Hearthstone_Item_Finish_Actions )
endfunction
function Trig_Icemans_Cape_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetAttackedUnitBJ(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetAttackedUnitBJ()) != Player(0) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetAttackedUnitBJ()) != Player(1) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetAttackedUnitBJ()) != Player(2) ) ) then
return false
endif
return true
endfunction
function Icemans_Cape_CD takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(udg_bierfass, GetHandleId(t), 32)
call SaveBoolean(udg_bierfass, GetHandleId(u), 31, true)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
set t = null
set u = null
endfunction
function Trig_Icemans_Cape_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit t = GetAttacker()
local unit dummy
local real heal
local real scaler
local real damage
local location loc = GetUnitLoc(u)
local location loc1 = GetUnitLoc(t)
local timer cd
if ( (LoadBoolean(udg_bierfass, GetHandleId(u), 31) == true) and (LoadBoolean(udg_bierfass, GetHandleId(u), 33) == true) and (DistanceBetweenPoints(loc, loc1) <= 125) ) then
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(u), loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A07V', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "entanglingroots", t )
call SaveBoolean(udg_bierfass, GetHandleId(u), 31, false)
set cd = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(cd), 32, u)
call TimerStart(cd, 1, false, function Icemans_Cape_CD)
endif
call RemoveLocation(loc)
call RemoveLocation(loc1)
set u = null
set t = null
set loc = null
set loc1 = null
set cd = null
endfunction
//===========================================================================
function InitTrig_Icemans_Cape takes nothing returns nothing
set gg_trg_Icemans_Cape = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Icemans_Cape, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Icemans_Cape, Condition( function Trig_Icemans_Cape_Conditions ) )
call TriggerAddAction( gg_trg_Icemans_Cape, function Trig_Icemans_Cape_Actions )
endfunction
function Trig_Key_to_the_City_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A08D' ) then
return true
endif
return false
endfunction
function Trig_CityKey_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[55])) == true ) ) then
return true
endif
return false
endfunction
function Trig_CityKey_Groupaction takes nothing returns nothing
call IssueTargetOrderBJ( GetEnumUnit(), "attack", udg_g_unit[55] )
if ( GetRandomInt(1,6) == 1 ) then
call AttachFloattext(GetEnumUnit(), GetRandomInt(350, 400), udg_g_string[GetRandomInt(56, 58)])
endif
endfunction
function Trig_Key_to_the_City_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetUnitLoc(caster)
local group g
call AttachFloattext(caster, GetRandomInt(425, 500), udg_g_string[GetRandomInt(51, 55)])
set udg_g_unit[55] = caster
set g = GetUnitsInRangeOfLocMatching(600.00, loc, Condition(function Trig_CityKey_Groupcond))
call ForGroupBJ( g, function Trig_CityKey_Groupaction )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Key_to_the_City takes nothing returns nothing
set gg_trg_Key_to_the_City = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Key_to_the_City, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Key_to_the_City, Condition( function Trig_Key_to_the_City_Conditions ) )
call TriggerAddAction( gg_trg_Key_to_the_City, function Trig_Key_to_the_City_Actions )
endfunction
function Trig_Life_Stone_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A073' ) then
return true
endif
return false
endfunction
function Trig_Life_Stone_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local real heal
local real scaler
local boolean crit = true
set heal = ( GetRandomReal(0.20, 0.30) * GetUnitState(u, UNIT_STATE_MAX_LIFE) )
set scaler = ( heal / (0.30 * GetUnitState(u, UNIT_STATE_MAX_LIFE)) )
call HealTargetWithTextMagic(u, u, heal, scaler, crit)
set u = null
endfunction
//===========================================================================
function InitTrig_Life_Stone takes nothing returns nothing
set gg_trg_Life_Stone = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Life_Stone, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Life_Stone, Condition( function Trig_Life_Stone_Conditions ) )
call TriggerAddAction( gg_trg_Life_Stone, function Trig_Life_Stone_Actions )
endfunction
function Trig_Lucky_Charm_Conditions takes nothing returns boolean
if ( LoadBoolean(udg_bierfass, GetHandleId(GetKillingUnit()), 43) == true ) then
return true
endif
return false
endfunction
function Trig_Lucky_Charm_Actions takes nothing returns nothing
local unit u = GetKillingUnit()
local integer i = GetHeroLevel(u)
local real chance = SquareRoot(10*i*i)
local location loc = PolarProjectionBJ(GetUnitLoc(GetDyingUnit()), GetRandomReal(1.00, 3.00), GetRandomReal(0.00, 45.00))
local player p = GetOwningPlayer(u)
if ( GetRandomReal(0.00,100.00) <= chance ) then
call WaveBountyText(1, p, loc)
endif
set u = null
set p = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Lucky_Charm takes nothing returns nothing
set gg_trg_Lucky_Charm = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Lucky_Charm, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Lucky_Charm, Condition( function Trig_Lucky_Charm_Conditions ) )
call TriggerAddAction( gg_trg_Lucky_Charm, function Trig_Lucky_Charm_Actions )
endfunction
function Trig_Tempest_Robe_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetAttackedUnitBJ(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetAttackedUnitBJ()) != Player(0) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetAttackedUnitBJ()) != Player(1) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetAttackedUnitBJ()) != Player(2) ) ) then
return false
endif
return true
endfunction
function Trig_Tempest_Robe_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[52])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Tempest_Robe_SFXmove takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 36)
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(t), 39)
local location loc = GetUnitLoc(caster)
local location loc1 = GetUnitLoc(target)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 40) + 1
local lightning sfx = LoadLightningHandle(udg_bierfass, GetHandleId(t), 41)
if ( ( GetUnitState(caster, UNIT_STATE_LIFE) > 0 ) and ( GetUnitState(target, UNIT_STATE_LIFE) > 0 ) and (iter <= 50) ) then
call MoveLightningEx( sfx, true, GetLocationX(loc), GetLocationY(loc), GetLocationZ(loc) + GetUnitFlyHeight(caster) + 50.00, GetLocationX(loc1), GetLocationY(loc1), GetLocationZ(loc1) + GetUnitFlyHeight(target) + 50.00 )
else
if ( iter <= 50 ) then
set iter = 51
endif
endif
if ( (iter > 50) and (iter <= 75) ) then
call MoveLightningEx( sfx, true, GetLocationX(loc), GetLocationY(loc), GetLocationZ(loc) + GetUnitFlyHeight(caster) + 50.00, GetLocationX(loc1), GetLocationY(loc1), GetLocationZ(loc1) + GetUnitFlyHeight(target) + 50.00 )
endif
call SaveInteger(udg_bierfass, GetHandleId(t), 40, iter)
if ( iter > 75 ) then
call DisplayTextToForce( GetPlayersAll(), "Blitz entfernen" )
call DestroyLightning(sfx)
call PauseTimer(t)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
call RemoveLocation(loc)
call RemoveLocation(loc1)
set loc = null
set loc1 = null
set caster = null
set target = null
set t = null
set sfx = null
endfunction
function Trig_Tempest_Robe_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[52]
local unit target
local boolean crit = true
set damage = GetRandomReal(250.00, 300.00)
set scaler = damage / 500
set target = GetEnumUnit()
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Tempest_Robe_CDNova takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(udg_bierfass, GetHandleId(t), 36)
call SaveBoolean(udg_bierfass, GetHandleId(u), 35, true)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
set t = null
set u = null
endfunction
function Trig_Tempest_Robe_CDFlash takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(udg_bierfass, GetHandleId(t), 36)
call SaveBoolean(udg_bierfass, GetHandleId(u), 34, true)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
set t = null
set u = null
endfunction
function Trig_Tempest_Robe_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit t = GetAttacker()
local real heal
local real scaler
local real damage
local location loc = GetUnitLoc(u)
local location loc1 = GetUnitLoc(t)
local timer cd
local timer movet
local group g
local lightning sfx
if ( (LoadBoolean(udg_bierfass, GetHandleId(u), 34) == true) and (LoadBoolean(udg_bierfass, GetHandleId(u), 37) == true) and (DistanceBetweenPoints(loc, loc1) > 150) and (DistanceBetweenPoints(loc, loc1) <= 650) and (GetRandomInt(1,3) == 1) ) then
set sfx = AddLightningEx( "CLPB", true, GetLocationX(loc), GetLocationY(loc), GetLocationZ(loc) + GetUnitFlyHeight(u) + 50.00, GetLocationX(loc1), GetLocationY(loc1), GetLocationZ(loc1) + GetUnitFlyHeight(u) + 50 )
set damage = GetRandomReal( 150.00, 250.00 )
set scaler = damage / 250
call DamageTargetWithTextMagic(u, t, damage, scaler, true)
set movet = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(movet), 36, u)
call SaveUnitHandle(udg_bierfass, GetHandleId(movet), 39, t)
call SaveInteger(udg_bierfass, GetHandleId(movet), 40, 0)
call SaveLightningHandle(udg_bierfass, GetHandleId(movet), 41, sfx)
call TimerStart(movet, 0.01, true, function Trig_Tempest_Robe_SFXmove)
call SaveBoolean(udg_bierfass, GetHandleId(u), 34, false)
set cd = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(cd), 36, u)
call TimerStart(cd, 0.75, false, function Trig_Tempest_Robe_CDFlash)
endif
if ( (LoadBoolean(udg_bierfass, GetHandleId(u), 35) == true) and (LoadBoolean(udg_bierfass, GetHandleId(u), 38) == true) and (DistanceBetweenPoints(loc, loc1) <= 150) and (GetRandomInt(1,5) == 1) ) then
call AddSpecialEffectTargetUnitBJ( "chest", u, "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" )
call AddSpecialEffectTargetUnitBJ( "chest", u, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
set udg_g_unit[52] = u
set g = GetUnitsInRangeOfLocMatching(150.00, loc, Condition(function Trig_Tempest_Robe_Groupcond))
call ForGroupBJ( g, function Trig_Tempest_Robe_Groupaction )
call SaveBoolean(udg_bierfass, GetHandleId(u), 35, false)
set cd = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(cd), 36, u)
call TimerStart(cd, 4, false, function Trig_Tempest_Robe_CDNova)
endif
call RemoveLocation(loc)
call RemoveLocation(loc1)
call DestroyGroup(g)
set g = null
set u = null
set t = null
set loc = null
set loc1 = null
set cd = null
set movet = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_Tempest_Robe takes nothing returns nothing
set gg_trg_Tempest_Robe = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Tempest_Robe, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Tempest_Robe, Condition( function Trig_Tempest_Robe_Conditions ) )
call TriggerAddAction( gg_trg_Tempest_Robe, function Trig_Tempest_Robe_Actions )
endfunction
function Trig_Thunderstone_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A076' ) then
return true
endif
return false
endfunction
function Trig_Thunderstone_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[44])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Thunderstone_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[44]
local unit target = GetEnumUnit()
local boolean crit = false
set damage = ( 0.75 * GetUnitState(target, UNIT_STATE_LIFE) )
set scaler = GetRandomReal(0.80, 1.00)
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
call AddSpecialEffectTarget( "Abilities\\Spells\\Orc\\Purge\\PurgeBuffTarget.mdl", target, "chest" )
set caster = null
set target = null
endfunction
function Trig_Thunderstone_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetUnitLoc(caster)
local group g
set udg_g_unit[44] = caster
set g = GetUnitsInRangeOfLocMatching(250.00, loc, Condition(function Trig_Thunderstone_Groupcond))
call ForGroupBJ( g, function Trig_Thunderstone_Groupaction )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Thunderstone takes nothing returns nothing
set gg_trg_Thunderstone = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Thunderstone, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Thunderstone, Condition( function Trig_Thunderstone_Conditions ) )
call TriggerAddAction( gg_trg_Thunderstone, function Trig_Thunderstone_Actions )
endfunction
function Trig_Vampire_Teeth_Conditions takes nothing returns boolean
if ( LoadBoolean(udg_bierfass, GetHandleId(GetKillingUnit()), 42) == true ) then
return true
endif
return false
endfunction
function Trig_Vampire_Teeth_Actions takes nothing returns nothing
local real heal = 0.10 * GetUnitStateSwap(UNIT_STATE_MAX_LIFE, GetDyingUnit())
local real scaler = GetRandomReal(0.50,0.60)
local unit target = GetKillingUnit()
local unit caster = GetKillingUnit()
local boolean crit = false
local location loc = GetUnitLoc(GetDyingUnit())
call AddSpecialEffectLocBJ( loc, "Objects\\Spawnmodels\\Orc\\OrcSmallDeathExplode\\OrcSmallDeathExplode.mdl" )
call HealTargetWithTextMagic(caster, target, heal, scaler, crit)
set target = null
set caster = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Vampire_Teeth takes nothing returns nothing
set gg_trg_Vampire_Teeth = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Vampire_Teeth, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Vampire_Teeth, Condition( function Trig_Vampire_Teeth_Conditions ) )
call TriggerAddAction( gg_trg_Vampire_Teeth, function Trig_Vampire_Teeth_Actions )
endfunction
function Trig_Captain_Yell_Actions takes nothing returns nothing
local group g = GetUnitsOfPlayerAndTypeId(Player(1), 'hcth')
local unit u = GroupPickRandomUnit(g)
if not ( IsUnitGroupDeadBJ(GetUnitsOfTypeIdAll('hcth')) ) then
call AttachFloattext(gg_unit_n007_0023, 500, udg_g_string[GetRandomInt(4, 12)] )
call StartTimerBJ( udg_g_timer[13], false, ( 30.00 / I2R(CountUnitsInGroup(g)) ) )
endif
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Captain_Yell takes nothing returns nothing
set gg_trg_Captain_Yell = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Captain_Yell, udg_g_timer[13] )
call TriggerAddAction( gg_trg_Captain_Yell, function Trig_Captain_Yell_Actions )
endfunction
function Trig_Dani_Patrol_N_Conditions takes nothing returns boolean
if ( GetEnteringUnit() == gg_unit_n01F_0146 ) then
return true
endif
return false
endfunction
function Trig_Dani_Patrol_N_Actions takes nothing returns nothing
local location loc
call TriggerSleepAction( GetRandomReal(5.00, 10.00) )
set loc = GetRectCenter(gg_rct_DaniPatrolS)
call IssuePointOrderLocBJ( GetEnteringUnit(), "move", loc )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Dani_Patrol_N takes nothing returns nothing
set gg_trg_Dani_Patrol_N = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Dani_Patrol_N, gg_rct_DaniPatrolN )
call TriggerAddCondition( gg_trg_Dani_Patrol_N, Condition( function Trig_Dani_Patrol_N_Conditions ) )
call TriggerAddAction( gg_trg_Dani_Patrol_N, function Trig_Dani_Patrol_N_Actions )
endfunction
function Trig_Dani_Patrol_S_Conditions takes nothing returns boolean
if ( GetEnteringUnit() == gg_unit_n01F_0146 ) then
return true
endif
return false
endfunction
function Trig_Dani_Patrol_S_Actions takes nothing returns nothing
local location loc
call TriggerSleepAction( GetRandomReal(5.00, 10.00) )
set loc = GetRectCenter(gg_rct_DaniPatrolN)
call IssuePointOrderLocBJ( GetEnteringUnit(), "move", loc )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Dani_Patrol_S takes nothing returns nothing
set gg_trg_Dani_Patrol_S = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Dani_Patrol_S, gg_rct_DaniPatrolS )
call TriggerAddCondition( gg_trg_Dani_Patrol_S, Condition( function Trig_Dani_Patrol_S_Conditions ) )
call TriggerAddAction( gg_trg_Dani_Patrol_S, function Trig_Dani_Patrol_S_Actions )
endfunction
function Trig_Dani_Message_Conditions takes nothing returns boolean
if ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_HERO) == true ) then
return true
endif
return false
endfunction
function Trig_Dani_Message_Actions takes nothing returns nothing
if (GetRandomInt(1,2) == 1) then
call AttachFloattext(gg_unit_n01F_0146, 1000, "Oh, hello! I just patrol|nthe seaside walls.")
else
call AttachFloattext(gg_unit_n01F_0146, 1000, "You never know when those|nscoundrels will attack here!")
endif
endfunction
//===========================================================================
function InitTrig_Dani_Message takes nothing returns nothing
set gg_trg_Dani_Message = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Dani_Message, gg_rct_Danimessage )
call TriggerAddCondition( gg_trg_Dani_Message, Condition( function Trig_Dani_Message_Conditions ) )
call TriggerAddAction( gg_trg_Dani_Message, function Trig_Dani_Message_Actions )
endfunction
function Trig_Rita_Message_Actions takes nothing returns nothing
if (GetRandomInt(1,3) == 1) then
call AttachFloattext(gg_unit_e003_0053, 500, "Help, where am I?")
else
if (GetRandomInt(1,2) == 1) then
call AttachFloattext(gg_unit_e003_0053, 600, "Where are the fairies?")
else
call AttachFloattext(gg_unit_e003_0053, 500, "Help, I'm lost!")
endif
endif
endfunction
//===========================================================================
function InitTrig_Rita_Message takes nothing returns nothing
set gg_trg_Rita_Message = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Rita_Message, gg_unit_e003_0053, EVENT_UNIT_SELECTED )
call TriggerAddAction( gg_trg_Rita_Message, function Trig_Rita_Message_Actions )
endfunction
function Trig_Rita_Reorder_Actions takes nothing returns nothing
local location loc = PolarProjectionBJ(GetUnitLoc(gg_unit_e003_0053), 1500.00, GetRandomReal(0,360))
call IssuePointOrderLocBJ( gg_unit_e003_0053, "move", loc )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Rita_Reorder takes nothing returns nothing
set gg_trg_Rita_Reorder = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Rita_Reorder, 4.00 )
call TriggerAddAction( gg_trg_Rita_Reorder, function Trig_Rita_Reorder_Actions )
endfunction
function Trig_Unit_Reorders_Conditions takes nothing returns boolean
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(0) ) and ( GetUnitTypeId(GetEnteringUnit()) != 'u000' ) and ( GetUnitTypeId(GetEnteringUnit()) != 'h00X' ) and ( GetUnitTypeId(GetEnteringUnit()) != 'o00O' ) and ( GetUnitTypeId(GetEnteringUnit()) != 'O00P' ) and ( GetUnitTypeId(GetEnteringUnit()) != 'o00R' ) ) then
return true
endif
return false
endfunction
function Trig_Unit_Reorders_Actions takes nothing returns nothing
local location loc = Location(-600.00, 1300.00)
call IssuePointOrderLocBJ( GetEnteringUnit(), "attack", loc )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Unit_Reorders takes nothing returns nothing
set gg_trg_Unit_Reorders = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect01 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect02 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect03 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect04 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect05 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect06 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect07 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect08 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect09 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect10 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect11 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect12 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect13 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_Redirect14 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_RedirectKing01 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_RedirectKing02 )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Reorders, gg_rct_RedirectKing03 )
call TriggerAddCondition( gg_trg_Unit_Reorders, Condition( function Trig_Unit_Reorders_Conditions ) )
call TriggerAddAction( gg_trg_Unit_Reorders, function Trig_Unit_Reorders_Actions )
endfunction
function Trig_King_Reorder_Conditions takes nothing returns boolean
if ( GetEnteringUnit() == gg_unit_n007_0023 ) then
return true
endif
return false
endfunction
function Trig_King_Reorder_Actions takes nothing returns nothing
local location loc = Location(-631.00, 1431.00)
call IssuePointOrderLocBJ( GetEnteringUnit(), "move", loc )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_King_Reorder takes nothing returns nothing
set gg_trg_King_Reorder = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_King_Reorder, gg_rct_RedirectKing01 )
call TriggerRegisterEnterRectSimple( gg_trg_King_Reorder, gg_rct_RedirectKing02 )
call TriggerRegisterEnterRectSimple( gg_trg_King_Reorder, gg_rct_RedirectKing03 )
call TriggerRegisterEnterRectSimple( gg_trg_King_Reorder, gg_rct_Redirect14 )
call TriggerAddCondition( gg_trg_King_Reorder, Condition( function Trig_King_Reorder_Conditions ) )
call TriggerAddAction( gg_trg_King_Reorder, function Trig_King_Reorder_Actions )
endfunction
function Wave1Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Peons
local integer unit1 = 15
// Anzahl Einheiten: Elite Peons
local integer unit2 = 2 * udg_g_integer[1]
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'o002', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'o003', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_1_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 1|r - Peons" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Scouting Aura" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 1 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave1Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave1Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave1Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_1 takes nothing returns nothing
set gg_trg_Wave_1 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_1, function Trig_Wave_1_Actions )
endfunction
function Wave2Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Sapper
local integer unit1 = 10
// Anzahl Einheiten: Clockwerks
local integer unit2 = 25
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'n00H', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00K', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_2_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 2|r - Clockwerk Goblins, Kamikaze Goblins" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Kaboom!" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 2 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave2Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave2Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave2Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_2 takes nothing returns nothing
set gg_trg_Wave_2 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_2, function Trig_Wave_2_Actions )
endfunction
function Wave3Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Peon
local integer unit1 = 5
// Anzahl Einheiten: Elitepeon
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Grunt
local integer unit3 = 10
// Anzahl Einheiten: Elitegrunt
local integer unit4 = 2 * udg_g_integer[1]
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'o002', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'o003', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'o000', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'o001', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_3_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 3|r - Peons, Grunts" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Scouting Aura, Command Aura" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 3 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave3Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave3Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave3Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_3 takes nothing returns nothing
set gg_trg_Wave_3 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_3, function Trig_Wave_3_Actions )
endfunction
function Wave4Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Peon
local integer unit1 = 5
// Anzahl Einheiten: Elitepeon
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Grunt
local integer unit3 = 10
// Anzahl Einheiten: Elitegrunt
local integer unit4 = 2 * udg_g_integer[1]
// Anzahl Einheiten: Troll
local integer unit5 = 5
// Anzahl Einheiten: Elitetroll
local integer unit6 = 1 * udg_g_integer[1]
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'o002', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'o003', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'o000', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'o001', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit5
call CreateUnitAtLoc( Player(0), 'o006', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit6
call CreateUnitAtLoc( Player(0), 'o007', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_4_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 4|r - Peons, Grunts, Headhunters" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Scouting Aura, Command Aura, Trueshot Aura" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 4 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave4Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave4Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave4Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_4 takes nothing returns nothing
set gg_trg_Wave_4 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_4, function Trig_Wave_4_Actions )
endfunction
function Wave5Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Tinker
local integer unit1 = 3
// Anzahl Einheiten: Shredder
local integer unit2 = 5
// Anzahl Einheiten: Sapper
local integer unit3 = 5
// Anzahl Einheiten: Clockwerk
local integer unit4 = 25
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'n00J', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00I', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'n00H', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'n00K', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_5_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 5|r - Goblin Engineers, Goblin Shredders, Goblin Kamikazes, Clockwerk Goblins" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Cluster Rockets, Pocket Factory, Spell Immunity, Kaboom!" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 5 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave5Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave5Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave5Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_5 takes nothing returns nothing
set gg_trg_Wave_5 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_5, function Trig_Wave_5_Actions )
endfunction
function Wave6Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Peon
local integer unit1 = 5
// Anzahl Einheiten: Elitepeon
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Grunt
local integer unit3 = 10
// Anzahl Einheiten: Elitegrunt
local integer unit4 = 2 * udg_g_integer[1]
// Anzahl Einheiten: Troll
local integer unit5 = 5
// Anzahl Einheiten: Elitetroll
local integer unit6 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Raider
local integer unit7 = 5
// Anzahl Einheiten: Eliteraider
local integer unit8 = 1 * udg_g_integer[1]
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'o002', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'o003', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'o000', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'o001', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit5
call CreateUnitAtLoc( Player(0), 'o006', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit6
call CreateUnitAtLoc( Player(0), 'o007', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit7
call CreateUnitAtLoc( Player(0), 'o004', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit8
call CreateUnitAtLoc( Player(0), 'o005', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_6_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 6|r - Peons, Grunts, Headhunters, Raiders" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Scouting Aura, Command Aura, Trueshot Aura, Rage Aura, Ensnare" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 6 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave6Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave6Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave6Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_6 takes nothing returns nothing
set gg_trg_Wave_6 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_6, function Trig_Wave_6_Actions )
endfunction
function Wave7Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Peon
local integer unit1 = 5
// Anzahl Einheiten: Elitepeon
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Grunt
local integer unit3 = 10
// Anzahl Einheiten: Elitegrunt
local integer unit4 = 2 * udg_g_integer[1]
// Anzahl Einheiten: Troll
local integer unit5 = 5
// Anzahl Einheiten: Elitetroll
local integer unit6 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Raider
local integer unit7 = 5
// Anzahl Einheiten: Eliteraider
local integer unit8 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Healer
local integer unit9 = 5
// Anzahl Einheiten: Elitehealer
local integer unit10 = 1 * udg_g_integer[1]
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'o002', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'o003', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'o000', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'o001', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit5
call CreateUnitAtLoc( Player(0), 'o006', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit6
call CreateUnitAtLoc( Player(0), 'o007', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit7
call CreateUnitAtLoc( Player(0), 'o004', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit8
call CreateUnitAtLoc( Player(0), 'o005', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit9
call CreateUnitAtLoc( Player(0), 'o008', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit10
call CreateUnitAtLoc( Player(0), 'o009', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_7_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 7|r - Peons, Grunts, Headhunters, Raiders, Witch Doctors" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Scouting Aura, Command Aura, Trueshot Aura, Rage Aura, Ensnare, Heal, Healing Ward" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 7 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave7Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave7Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave7Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_7 takes nothing returns nothing
set gg_trg_Wave_7 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_7, function Trig_Wave_7_Actions )
endfunction
function Wave8Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Peon
local integer unit1 = 5
// Anzahl Einheiten: Elitepeon
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Grunt
local integer unit3 = 10
// Anzahl Einheiten: Elitegrunt
local integer unit4 = 2 * udg_g_integer[1]
// Anzahl Einheiten: Troll
local integer unit5 = 5
// Anzahl Einheiten: Elitetroll
local integer unit6 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Raider
local integer unit7 = 5
// Anzahl Einheiten: Eliteraider
local integer unit8 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Healer
local integer unit9 = 5
// Anzahl Einheiten: Elitehealer
local integer unit10 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Warlocks
local integer unit11 = 5
// Anzahl Einheiten: Elitewarlocks
local integer unit12 = 1 * udg_g_integer[1]
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'o002', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'o003', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'o000', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'o001', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit5
call CreateUnitAtLoc( Player(0), 'o006', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit6
call CreateUnitAtLoc( Player(0), 'o007', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit7
call CreateUnitAtLoc( Player(0), 'o004', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit8
call CreateUnitAtLoc( Player(0), 'o005', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit9
call CreateUnitAtLoc( Player(0), 'o008', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit10
call CreateUnitAtLoc( Player(0), 'o009', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit11
call CreateUnitAtLoc( Player(0), 'n000', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit12
call CreateUnitAtLoc( Player(0), 'n00G', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_8_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 8|r - Peons, Grunts, Headhunters, Raiders, Witch Doctors, Warlocks" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Scouting Aura, Command Aura, Trueshot Aura, Rage Aura, Ensnare, Heal, Healing Ward, Shadow Bolt" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 8 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave8Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave8Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave8Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_8 takes nothing returns nothing
set gg_trg_Wave_8 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_8, function Trig_Wave_8_Actions )
endfunction
function Wave9Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Ogre
local integer unit1 = 10
// Anzahl Einheiten: Eliteogre
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Ogremagi
local integer unit3 = 3
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'n00L', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00M', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'n00N', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_9_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 9|r - Ogre Warriors, Ogre Magi" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Bash, Might Aura, Bloodlust" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 9 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave9Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave9Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave9Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_9 takes nothing returns nothing
set gg_trg_Wave_9 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_9, function Trig_Wave_9_Actions )
endfunction
function Wave10Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Peon
local integer unit1 = 3
// Anzahl Einheiten: Elitepeon
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Grunt
local integer unit3 = 5
// Anzahl Einheiten: Elitegrunt
local integer unit4 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Raider
local integer unit5 = 5
// Anzahl Einheiten: Eliteraider
local integer unit6 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Troll
local integer unit7 = 5
// Anzahl Einheiten: Elitetroll
local integer unit8 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Healer
local integer unit9 = 5
// Anzahl Einheiten: Elitehealer
local integer unit10 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Warlocks
local integer unit11 = 3
// Anzahl Einheiten: Elitetlocks
local integer unit12 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Oger
local integer unit13 = 3
// Anzahl Einheiten: Eliteoger
local integer unit14 = 2 * udg_g_integer[1]
// Anzahl Einheiten: Ogre Magi
local integer unit15 = 3
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'o002', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'o003', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'o000', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'o001', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit5
call CreateUnitAtLoc( Player(0), 'o004', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit6
call CreateUnitAtLoc( Player(0), 'o005', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit7
call CreateUnitAtLoc( Player(0), 'o006', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit8
call CreateUnitAtLoc( Player(0), 'o007', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit9
call CreateUnitAtLoc( Player(0), 'o008', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit10
call CreateUnitAtLoc( Player(0), 'o009', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit11
call CreateUnitAtLoc( Player(0), 'n000', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit12
call CreateUnitAtLoc( Player(0), 'n00G', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit13
call CreateUnitAtLoc( Player(0), 'n00L', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit14
call CreateUnitAtLoc( Player(0), 'n00M', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit15
call CreateUnitAtLoc( Player(0), 'n00N', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_10_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 10|r - Peons, Grunts, Headhunters, Raiders, Witch Doctors, Warlocks, Ogre Warriors, Ogre Magi" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Scouting Aura, Command Aura, Trueshot Aura, Rage Aura, Ensnare, Heal, Healing Ward, Shadow Bolt, Bash, Might Aura, Bloodlust" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 10 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave10Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave10Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave10Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_10 takes nothing returns nothing
set gg_trg_Wave_10 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_10, function Trig_Wave_10_Actions )
endfunction
function Wave11Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Skeletonwarris
local integer unit1 = 10
// Anzahl Einheiten: Skeletonarcher
local integer unit2 = 10
// Anzahl Einheiten: Ghoule
local integer unit3 = 5
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'u00F', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00R', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'u00D', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_11_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 11|r - Ghouls, Skeleton Warrios, Skeleton Archers" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Cannibalize, Magic Resistance" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 11 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave11Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave11Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave11Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_11 takes nothing returns nothing
set gg_trg_Wave_11 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_11, function Trig_Wave_11_Actions )
endfunction
function Wave12Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Skeletonwarris
local integer unit1 = 10
// Anzahl Einheiten: Skeletonarcher
local integer unit2 = 10
// Anzahl Einheiten: Skeletonmage
local integer unit3 = 5
// Anzahl Einheiten: Ghoule
local integer unit4 = 5
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'u00F', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00R', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'u00G', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'u00D', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_12_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 12|r - Ghouls, Skeleton Warrios, Skeleton Archers, Skeletal Mages" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Cannibalize, Magic Resistance" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 12 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave12Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave12Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave12Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_12 takes nothing returns nothing
set gg_trg_Wave_12 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_12, function Trig_Wave_12_Actions )
endfunction
function Wave13Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Ghoule
local integer unit1 = 10
// Anzahl Einheiten: Zombies
local integer unit2 = 10
// Anzahl Einheiten: Abos
local integer unit3 = 2
// Anzahl Einheiten: Skeletonwarris
local integer unit4 = 5
// Anzahl Einheiten: Skeletonarcher
local integer unit5 = 5
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'u00D', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00Q', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'u00E', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'u00F', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit5
call CreateUnitAtLoc( Player(0), 'n00R', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_13_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 13|r - Ghouls, Zombies, Skeleton Warriors, Skeleton Archers, Abominations" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Cannibalize, Disease Cloud, Feast Aura, Magic Resistance" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 13 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave13Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave13Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave13Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_13 takes nothing returns nothing
set gg_trg_Wave_13 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_13, function Trig_Wave_13_Actions )
endfunction
function Wave14Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Ghoule
local integer unit1 = 10
// Anzahl Einheiten: Zombies
local integer unit2 = 10
// Anzahl Einheiten: Abos
local integer unit3 = 3
// Anzahl Einheiten: SkelWarri
local integer unit4 = 10
// Anzahl Einheiten: SkelArcher
local integer unit5 = 10
// Anzahl Einheiten: SkelMage
local integer unit6 = 5
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'u00D', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00Q', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'u00E', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'u00F', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit5
call CreateUnitAtLoc( Player(0), 'n00R', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit6
call CreateUnitAtLoc( Player(0), 'u00G', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_14_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 14|r - Skeleton Warrios, Skeleton Archers, Skeletal Mages, Ghouls, Zombies, Abominations" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Magic Resistance, Cannibalize, Disease Cloud, Feast Aura" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 14 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave14Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave14Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave14Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_14 takes nothing returns nothing
set gg_trg_Wave_14 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_14, function Trig_Wave_14_Actions )
endfunction
function Wave15Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Hound
local integer unit1 = 10
// Anzahl Einheiten: Elitehound
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Guard
local integer unit3 = 10
// Anzahl Einheiten: Eliteguard
local integer unit4 = 1 * udg_g_integer[1]
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'n00S', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00T', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'n00U', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'n00V', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_15_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 15|r - Fel Hounds, Felguards" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Unholy Aura, Demonic Aura" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 15 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave15Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave15Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave15Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_15 takes nothing returns nothing
set gg_trg_Wave_15 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_15, function Trig_Wave_15_Actions )
endfunction
function Wave16Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Hound
local integer unit1 = 10
// Anzahl Einheiten: Elitehound
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Guard
local integer unit3 = 10
// Anzahl Einheiten: Eliteguard
local integer unit4 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Succu
local integer unit5 = 5
// Anzahl Einheiten: Elitesuccu
local integer unit6 = 1 * udg_g_integer[1]
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'n00S', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00T', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'n00U', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'n00V', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit5
call CreateUnitAtLoc( Player(0), 'n00W', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit6
call CreateUnitAtLoc( Player(0), 'n00X', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_16_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 16|r - Fel Hounds, Felguards, Succubi" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Unholy Aura, Demonic Aura, Raise Demon" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 16 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave16Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave16Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave16Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_16 takes nothing returns nothing
set gg_trg_Wave_16 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_16, function Trig_Wave_16_Actions )
endfunction
function Wave17Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Hound
local integer unit1 = 10
// Anzahl Einheiten: Elitehound
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Guard
local integer unit3 = 10
// Anzahl Einheiten: Eliteguard
local integer unit4 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Succu
local integer unit5 = 5
// Anzahl Einheiten: Elitesuccu
local integer unit6 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Eredar
local integer unit7 = 3
// Anzahl Einheiten: Eliteeredar
local integer unit8 = 1 * udg_g_integer[1]
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'n00S', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00T', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'n00U', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'n00V', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit5
call CreateUnitAtLoc( Player(0), 'n00W', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit6
call CreateUnitAtLoc( Player(0), 'n00X', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit7
call CreateUnitAtLoc( Player(0), 'n010', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit8
call CreateUnitAtLoc( Player(0), 'n011', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_17_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 17|r - Fel Hounds, Felguards, Succubi, Eredar Sorcerers" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Unholy Aura, Demonic Aura, Raise Demon, Meteor" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 17 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave17Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave17Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave17Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_17 takes nothing returns nothing
set gg_trg_Wave_17 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_17, function Trig_Wave_17_Actions )
endfunction
function Wave18Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Voidwalker
local integer unit1 = 10
// Anzahl Einheiten: Netherdragons
local integer unit2 = 5
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'n00Z', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00Y', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_18_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 18|r - Voidwalkers, Nether Drakes" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Energy Shield" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 18 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave18Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave18Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave18Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_18 takes nothing returns nothing
set gg_trg_Wave_18 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_18, function Trig_Wave_18_Actions )
endfunction
function Wave19Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Hound
local integer unit1 = 5
// Anzahl Einheiten: Elitehound
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Guard
local integer unit3 = 10
// Anzahl Einheiten: Eliteguard
local integer unit4 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Succu
local integer unit5 = 5
// Anzahl Einheiten: Elitesuccu
local integer unit6 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Eredar
local integer unit7 = 3
// Anzahl Einheiten: Eliteeredar
local integer unit8 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Voidwalker
local integer unit9 = 3
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'n00S', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00T', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'n00U', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'n00V', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit5
call CreateUnitAtLoc( Player(0), 'n00W', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit6
call CreateUnitAtLoc( Player(0), 'n00X', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit7
call CreateUnitAtLoc( Player(0), 'n010', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit8
call CreateUnitAtLoc( Player(0), 'n011', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit9
call CreateUnitAtLoc( Player(0), 'n00Z', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_19_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 19|r - Fel Hounds, Felguards, Succubi, Eredar Sorcerers, Voidwalkers" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Unholy Aura, Demonic Aura, Raise Demon, Meteor, Energy Shield" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 19 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave19Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave19Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave19Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_19 takes nothing returns nothing
set gg_trg_Wave_19 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_19, function Trig_Wave_19_Actions )
endfunction
function Wave20Unitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Hound
local integer unit1 = 5
// Anzahl Einheiten: Elitehound
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Guard
local integer unit3 = 10
// Anzahl Einheiten: Eliteguard
local integer unit4 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Succu
local integer unit5 = 5
// Anzahl Einheiten: Elitesuccu
local integer unit6 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Eredar
local integer unit7 = 3
// Anzahl Einheiten: Eliteeredar
local integer unit8 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Voidwalker
local integer unit9 = 3
// Anzahl Einheiten: NetherDrake
local integer unit10 = 3
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'n00S', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00T', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'n00U', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'n00V', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit5
call CreateUnitAtLoc( Player(0), 'n00W', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit6
call CreateUnitAtLoc( Player(0), 'n00X', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit7
call CreateUnitAtLoc( Player(0), 'n010', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit8
call CreateUnitAtLoc( Player(0), 'n011', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit9
call CreateUnitAtLoc( Player(0), 'n00Y', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
loop
exitwhen iter > unit10
call CreateUnitAtLoc( Player(0), 'n00Z', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Wave_20_Actions takes nothing returns nothing
local location loc
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffLEVEL 20|r - Fel Hounds, Felguards, Succubi, Eredar Sorcerers, Voidwalkers, Nether Drakes" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Unholy Aura, Demonic Aura, Raise Demon, Meteor, Energy Shield" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Level 20 - " + udg_g_string[1] ) )
// Immer
set loc = Location(6750.00, 750.00)
call Wave20Unitspawn(loc)
// Playerzahl > 3
if ( udg_g_integer[2] > 3 ) then
call PolledWait(0.50)
set loc = Location(300.00, -7000.00)
call Wave20Unitspawn(loc)
else
endif
// Playerzahl > 6
if ( udg_g_integer[2] > 6 ) then
call PolledWait(0.50)
set loc = Location(800.00, 6740.00)
call Wave20Unitspawn(loc)
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Wave_20 takes nothing returns nothing
set gg_trg_Wave_20 = CreateTrigger( )
call TriggerAddAction( gg_trg_Wave_20, function Trig_Wave_20_Actions )
endfunction
function Trig_Warchief_Spawn_Actions takes nothing returns nothing
local location loc = Location(6900.00, 800.00)
local location loc2
local integer i
local integer iter = 1
local unit u
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffBoss|r - Orc Warchief" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Forked Lightning, Bloodbound" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Be careful! The extremely evil enemies are setting up a siege perimeter!" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Boss II - " + udg_g_string[1] ) )
if ( IsDestructableAliveBJ(gg_dest_DTg7_0003) ) then
call ModifyGateBJ( bj_GATEOPERATION_OPEN, gg_dest_DTg7_0003 )
call ShowUnitHide( gg_unit_h00K_0049 )
call SetUnitPathing( gg_unit_h00K_0049, false )
endif
if ( IsDestructableAliveBJ(gg_dest_LTg3_0002) ) then
call ModifyGateBJ( bj_GATEOPERATION_OPEN, gg_dest_LTg3_0002 )
call ShowUnitHide( gg_unit_h00L_0050 )
call SetUnitPathing( gg_unit_h00L_0050, false )
endif
call EnableTrigger( gg_trg_Warchief_Death_Trigger )
set u = CreateUnitAtLoc( Player(0), 'h00X', loc, bj_UNIT_FACING )
set loc2 = GetRectCenter(gg_rct_EVENTO2)
call IssueBuildOrderByIdLocBJ( u, 'o00Q', loc2 )
set u = CreateUnitAtLoc( Player(0), 'o00R', loc, bj_UNIT_FACING )
set loc2 = OffsetLocation(GetRectCenter(gg_rct_EVENTO2), 150.00, 0)
call IssuePointOrderLocBJ( u, "move", loc2 )
set u = CreateUnitAtLoc( Player(0), 'h00X', loc, bj_UNIT_FACING )
set loc2 = GetRectCenter(gg_rct_EVENTO5)
call IssueBuildOrderByIdLocBJ( u, 'o00Q', loc2 )
set u = CreateUnitAtLoc( Player(0), 'o00R', loc, bj_UNIT_FACING )
set loc2 = OffsetLocation(GetRectCenter(gg_rct_EVENTO5), 150.00, 0)
call IssuePointOrderLocBJ( u, "move", loc2 )
if ( udg_g_integer[2] > 3 ) then
set u = CreateUnitAtLoc( Player(0), 'h00X', loc, bj_UNIT_FACING )
set loc2 = GetRectCenter(gg_rct_EVENTO1)
call IssueBuildOrderByIdLocBJ( u, 'o00Q', loc2 )
set u = CreateUnitAtLoc( Player(0), 'o00R', loc, bj_UNIT_FACING )
set loc2 = OffsetLocation(GetRectCenter(gg_rct_EVENTO1), 150.00, 0)
call IssuePointOrderLocBJ( u, "move", loc2 )
set u = CreateUnitAtLoc( Player(0), 'h00X', loc, bj_UNIT_FACING )
set loc2 = GetRectCenter(gg_rct_EVENTO3)
call IssueBuildOrderByIdLocBJ( u, 'o00Q', loc2 )
set u = CreateUnitAtLoc( Player(0), 'o00R', loc, bj_UNIT_FACING )
set loc2 = OffsetLocation(GetRectCenter(gg_rct_EVENTO3), 150.00, 0)
call IssuePointOrderLocBJ( u, "move", loc2 )
endif
if ( udg_g_integer[2] > 6 ) then
set u = CreateUnitAtLoc( Player(0), 'h00X', loc, bj_UNIT_FACING )
set loc2 = GetRectCenter(gg_rct_EVENTO4)
call IssueBuildOrderByIdLocBJ( u, 'o00Q', loc2 )
set u = CreateUnitAtLoc( Player(0), 'o00R', loc, bj_UNIT_FACING )
set loc2 = OffsetLocation(GetRectCenter(gg_rct_EVENTO4), 150.00, 0)
call IssuePointOrderLocBJ( u, "move", loc2 )
set u = CreateUnitAtLoc( Player(0), 'h00X', loc, bj_UNIT_FACING )
set loc2 = GetRectCenter(gg_rct_EVENTO6)
call IssueBuildOrderByIdLocBJ( u, 'o00Q', loc2 )
set u = CreateUnitAtLoc( Player(0), 'o00R', loc, bj_UNIT_FACING )
set loc2 = OffsetLocation(GetRectCenter(gg_rct_EVENTO6), 150.00, 0)
call IssuePointOrderLocBJ( u, "move", loc2 )
endif
call StartTimerBJ( udg_g_timer[26], false, 10.00 )
set udg_g_unit[54] = CreateUnitAtLoc( Player(0), 'O00P', loc, bj_UNIT_FACING )
set loc = Location(6000.00, 800.00)
call IssuePointOrderLocBJ( udg_g_unit[54], "move", loc )
call SetUnitAbilityLevelSwapped( 'A082', udg_g_unit[54], ( udg_DfficultyMode + 1 ) )
call UnitAddAbilityBJ( 'A021', udg_g_unit[54] )
call SetHeroLevelBJ( udg_g_unit[54], 15, false )
set i = 2*udg_g_integer[2] - 5
if ( i < 1 ) then
set i = 1
endif
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[54], i )
call SuspendHeroXPBJ( false, udg_g_unit[54] )
set i = udg_g_integer[2]
if ( i < 3) then
set i = 3
endif
loop
exitwhen iter > i
set loc = Location(6900.00, 800.00)
set u = CreateUnitAtLoc( Player(0), 'o00O', loc, bj_UNIT_FACING )
set loc = PolarProjectionBJ(Location(6000.00, 800.00), 200,270 + I2R(iter)*40)
call IssuePointOrderLocBJ( u, "move", loc )
set iter = iter + 1
endloop
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
set u = null
endfunction
//===========================================================================
function InitTrig_Warchief_Spawn takes nothing returns nothing
set gg_trg_Warchief_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Warchief_Spawn, function Trig_Warchief_Spawn_Actions )
endfunction
function Trig_Warchief_Catapult_Attack_Reorder_Attack takes nothing returns nothing
local location loc = GetRandomLocInRect(gg_rct_Town_Centre)
call IssuePointOrderLocBJ( GetEnumUnit(), "attackground", loc )
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Warchief_Catapult_Attack_Reorder_Actions takes nothing returns nothing
local group g = GetUnitsOfTypeIdAll('o00R')
call ForGroupBJ( g, function Trig_Warchief_Catapult_Attack_Reorder_Attack )
call StartTimerBJ( udg_g_timer[26], false, 5.00 )
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Warchief_Catapult_Attack_Reorder takes nothing returns nothing
set gg_trg_Warchief_Catapult_Attack_Reorder = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Warchief_Catapult_Attack_Reorder, udg_g_timer[26] )
call TriggerAddAction( gg_trg_Warchief_Catapult_Attack_Reorder, function Trig_Warchief_Catapult_Attack_Reorder_Actions )
endfunction
function Trig_Warchief_Disengage takes nothing returns nothing
local location loc = Location(6000.00, 800.00)
call PauseTimerBJ( true, udg_g_timer[24] )
call PauseTimerBJ( true, udg_g_timer[27] )
call IssuePointOrderLocBJ( udg_g_unit[54], "move", loc )
call EnableTrigger( gg_trg_Warchief_Engage )
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Warchief_Earthquake_Cond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[54])) == true ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == false ) and ( GetUnitTypeId(GetFilterUnit()) != 'u002' ) and ( GetOwningPlayer(GetFilterUnit()) != Player(2) ) ) then
return true
endif
return false
endfunction
function Trig_Warchief_Earthquake_Actions takes nothing returns nothing
local location loc = GetUnitLoc(udg_g_unit[54])
local group g = GetUnitsInRangeOfLocMatching(750.00, loc, Condition(function Trig_Warchief_Earthquake_Cond))
local unit u = CreateUnitAtLoc( Player(0), 'u000', loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'S003', u )
call UnitApplyTimedLifeBJ( (GetRandomReal(5.00, 10.00) + I2R(udg_g_integer[2])), 'BTLF', u )
set loc = GetUnitLoc(GroupPickRandomUnit(g))
call IssuePointOrderLocBJ( u, "earthquake", loc )
if ( BossDisengage(udg_g_unit[54]) ) then
call Trig_Warchief_Disengage()
endif
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Warchief_Earthquake takes nothing returns nothing
set gg_trg_Warchief_Earthquake = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Warchief_Earthquake, udg_g_timer[27] )
call TriggerAddAction( gg_trg_Warchief_Earthquake, function Trig_Warchief_Earthquake_Actions )
endfunction
function Trig_Warchief_Redirect_Conditions takes nothing returns boolean
if ( GetEnteringUnit() == udg_g_unit[54] ) then
return true
endif
return false
endfunction
function Trig_Warchief_Redirect_Actions takes nothing returns nothing
local location loc = Location(6000.00, 800.00)
call IssuePointOrderLocBJ( udg_g_unit[54], "move", loc )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Warchief_Redirect takes nothing returns nothing
set gg_trg_Warchief_Redirect = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Warchief_Redirect, gg_rct_RedirectWarchief01 )
call TriggerRegisterEnterRectSimple( gg_trg_Warchief_Redirect, gg_rct_RedirectWarchief02 )
call TriggerAddCondition( gg_trg_Warchief_Redirect, Condition( function Trig_Warchief_Redirect_Conditions ) )
call TriggerAddAction( gg_trg_Warchief_Redirect, function Trig_Warchief_Redirect_Actions )
endfunction
function WarchiefUnitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Grunt
local integer unit1 = 1
// Anzahl Einheiten: Troll
local integer unit2 = 1
// Anzahl Einheiten: Healer
local integer unit3 = 1
// Anzahl Einheiten: Oger
local integer unit4 = 1
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'o000', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'o006', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'o008', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'n00L', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Warchief_Adds_Spawn_Conditions takes nothing returns boolean
if ( (IsUnitAliveBJ(GetFilterUnit()) == true) and (GetUnitTypeId(GetFilterUnit()) != 'o00O') and (GetUnitTypeId(GetFilterUnit()) != 'O00P') ) then
return true
endif
return false
endfunction
function Trig_Warchief_Adds_Spawn_Actions takes nothing returns nothing
local location loc = Location(6750.00, 750.00)
local group g = GetUnitsOfPlayerMatching(Player(0), Condition(function Trig_Warchief_Adds_Spawn_Conditions))
if ( CountUnitsInGroup(g) <= 10 + udg_g_integer[2] * udg_DfficultyMode ) then
call WarchiefUnitspawn(loc)
if ( udg_g_integer[2] > 3 ) then
call WarchiefUnitspawn(loc)
endif
if ( udg_g_integer[2] > 6 ) then
call WarchiefUnitspawn(loc)
endif
endif
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Warchief_Adds_Spawn takes nothing returns nothing
set gg_trg_Warchief_Adds_Spawn = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Warchief_Adds_Spawn, udg_g_timer[24] )
call TriggerAddAction( gg_trg_Warchief_Adds_Spawn, function Trig_Warchief_Adds_Spawn_Actions )
endfunction
function Trig_Pitlord_Spawn_Actions takes nothing returns nothing
local location loc = Location(6800.00, 700.00)
local integer i = udg_g_integer[2]
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffFinal Boss|r - Pit Lord" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Cleave, Dark Summoning, Knockback" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Boss V - " + udg_g_string[1] ) )
set udg_g_unit[35] = CreateUnitAtLoc(Player(0), 'N016', loc, bj_UNIT_FACING )
set loc = Location(-500.00, 1300.00)
call IssuePointOrderLocBJ( udg_g_unit[35], "attack", loc )
call UnitAddAbilityBJ( 'A021', udg_g_unit[35] )
call SetHeroLevelBJ( udg_g_unit[35], 30, false )
if ( i >= 4 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[35], 16 )
endif
if ( i >= 7 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[35], 30 )
endif
call SuspendHeroXPBJ( false, udg_g_unit[35] )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Pitlord_Spawn takes nothing returns nothing
set gg_trg_Pitlord_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Pitlord_Spawn, function Trig_Pitlord_Spawn_Actions )
endfunction
function Trig_Pitlord_Minion_Spawn_Banish takes nothing returns nothing
local location loc = GetUnitLoc(udg_g_unit[35])
local unit dummy = CreateUnitAtLoc(Player(0), 'u000', loc, bj_UNIT_FACING )
call SetUnitMoveSpeed( GetEnumUnit(), 0.00 )
call UnitApplyTimedLifeBJ( 1.50, 'BTLF', dummy )
call UnitAddAbilityBJ( 'A06L', dummy )
call IssueTargetOrderBJ( dummy, "banish", GetEnumUnit() )
call UnitAddAbilityBJ( 'Avul', GetEnumUnit() )
call UnitAddAbilityBJ( 'A06K', GetEnumUnit() )
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Pitlord_Minions_Periodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 50)
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(t), 51)
local lightning sfx = LoadLightningHandle(udg_bierfass, GetHandleId(t), 52)
local location loc = GetUnitLoc(caster)
local location loc1 = GetUnitLoc(target)
if ( ( GetUnitState(target, UNIT_STATE_LIFE) > 0 ) and ( GetUnitState(caster, UNIT_STATE_LIFE) > 0 ) ) then
call MoveLightningEx( sfx, true, GetLocationX(loc), GetLocationY(loc), GetLocationZ(loc) + GetUnitFlyHeight(caster) + 100.00, GetLocationX(loc1), GetLocationY(loc1), GetLocationZ(loc1) + GetUnitFlyHeight(target) + 50.00 )
else
call DestroyLightning(sfx)
call PauseTimer(t)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
call RemoveLocation(loc)
call RemoveLocation(loc1)
set loc = null
set loc1 = null
set caster = null
set target = null
set t = null
set sfx = null
endfunction
function Trig_Pitlord_Minion_Spawn_Unbanish takes nothing returns nothing
local timer t = CreateTimer()
local unit caster = udg_g_unit[35]
local unit target = GetEnumUnit()
local location loc = GetUnitLoc(caster)
local location loc1 = GetUnitLoc(target)
local location loc2 = Location(-500.00, 1300.00)
local lightning sfx = AddLightningEx( "SPLK", true, GetLocationX(loc), GetLocationY(loc), GetLocationZ(loc) + GetUnitFlyHeight(caster) + 100.00, GetLocationX(loc1), GetLocationY(loc1), GetLocationZ(loc1) + GetUnitFlyHeight(target) + 50.00 )
call SetLightningColor( sfx, 0.20, 1.00, 0.20, 1.00 )
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 50, caster)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 51, target)
call SaveLightningHandle(udg_bierfass, GetHandleId(t), 52, sfx)
call TimerStart(t, 0.01, true, function Trig_Pitlord_Minions_Periodic)
call SetUnitMoveSpeed( GetEnumUnit(), GetUnitDefaultMoveSpeed(GetEnumUnit()) )
call UnitRemoveBuffBJ( 'BHbn', GetEnumUnit() )
call UnitRemoveAbilityBJ( 'Avul', GetEnumUnit() )
call IssuePointOrderLocBJ( GetEnumUnit(), "attack", loc2 )
call RemoveLocation(loc)
call RemoveLocation(loc1)
call RemoveLocation(loc2)
set loc = null
set loc1 = null
set loc2 = null
set caster = null
set target = null
set t = null
set sfx = null
endfunction
function Trig_Pitlord_Minion_Spawn_Actions takes nothing returns nothing
local location pitloc = GetUnitLoc(udg_g_unit[35])
local location loc
local real facing
local unit demon1
local unit demon2
local unit demon3
local unit demon4
local unit demon5
local unit dummy
local group g = CreateGroup()
call PauseTimer(udg_g_timer[21])
call UnitAddAbilityBJ( 'Avul', udg_g_unit[35] )
call IssueImmediateOrderBJ( udg_g_unit[35], "starfall" )
call DestroyEffectBJ( udg_g_SFX[1] )
call AddSpecialEffectTargetUnitBJ( "overhead", udg_g_unit[35], "Abilities\\Spells\\Undead\\AntiMagicShell\\AntiMagicShell.mdl" )
set udg_g_SFX[1] = GetLastCreatedEffectBJ()
call PolledWait( 0.50 )
set loc = PolarProjectionBJ(GetUnitLoc(udg_g_unit[35]), 290.00, 306.00)
set facing = AngleBetweenPoints(loc, pitloc)
set demon1 = CreateUnitAtLoc(Player(0), 'n017', loc, facing)
set loc = PolarProjectionBJ(GetUnitLoc(udg_g_unit[35]), 290.00, 234.00)
set facing = AngleBetweenPoints(loc, pitloc)
set demon2 = CreateUnitAtLoc(Player(0), 'n017', loc, facing)
set loc = PolarProjectionBJ(GetUnitLoc(udg_g_unit[35]), 290.00, 162.00)
set facing = AngleBetweenPoints(loc, pitloc)
set demon3 = CreateUnitAtLoc(Player(0), 'n017', loc, facing)
set loc = PolarProjectionBJ(GetUnitLoc(udg_g_unit[35]), 290.00, 90.00)
set facing = AngleBetweenPoints(loc, pitloc)
set demon4 = CreateUnitAtLoc(Player(0), 'n017', loc, facing)
set loc = PolarProjectionBJ(GetUnitLoc(udg_g_unit[35]), 290.00, 18.00)
set facing = AngleBetweenPoints(loc, pitloc)
set demon5 = CreateUnitAtLoc(Player(0), 'n017', loc, facing)
call GroupAddUnit(g, demon1)
call GroupAddUnit(g, demon2)
call GroupAddUnit(g, demon3)
call GroupAddUnit(g, demon4)
call GroupAddUnit(g, demon5)
call ForGroupBJ( g, function Trig_Pitlord_Minion_Spawn_Banish )
set loc = GetUnitLoc(demon4)
set dummy = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE), 'u00S', loc, bj_UNIT_FACING )
call UnitApplyTimedLife( dummy, 'A07B', 10.00 )
call IssueTargetOrderBJ( demon1, "drain", dummy )
call PolledWait( 0.70 )
set loc = GetUnitLoc(demon2)
set dummy = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE), 'u00S', loc, bj_UNIT_FACING )
call UnitApplyTimedLife( dummy, 'A07B', 10.00 )
call IssueTargetOrderBJ( demon4, "drain", dummy )
call PolledWait( 0.70 )
set loc = GetUnitLoc(demon5)
set dummy = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE), 'u00S', loc, bj_UNIT_FACING )
call UnitApplyTimedLife( dummy, 'A07B', 10.00 )
call IssueTargetOrderBJ( demon2, "drain", dummy )
call PolledWait( 0.70 )
set loc = GetUnitLoc(demon3)
set dummy = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE), 'u00S', loc, bj_UNIT_FACING )
call UnitApplyTimedLife( dummy, 'A07B', 10.00 )
call IssueTargetOrderBJ( demon5, "drain", dummy )
call PolledWait( 0.70 )
set loc = GetUnitLoc(demon1)
set dummy = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE), 'u00S', loc, bj_UNIT_FACING )
call UnitApplyTimedLife( dummy, 'A07B', 10.00 )
call IssueTargetOrderBJ( demon3, "drain", dummy )
call PolledWait( 1.50 )
set loc = GetUnitLoc(demon1)
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl" )
set loc = GetUnitLoc(demon2)
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl" )
set loc = GetUnitLoc(demon3)
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl" )
set loc = GetUnitLoc(demon4)
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl" )
set loc = GetUnitLoc(demon5)
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl" )
call ForGroupBJ( g, function Trig_Pitlord_Minion_Spawn_Unbanish )
call ResumeTimer(udg_g_timer[21])
set loc = Location(-500.00, 1300.00)
call IssuePointOrderLocBJ( udg_g_unit[35], "attack", loc )
call RemoveLocation(pitloc)
call RemoveLocation(loc)
set pitloc = null
set loc = null
set demon1 = null
set demon2 = null
set demon3 = null
set demon4 = null
set demon5 = null
set dummy = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Pitlord_Minion_Spawn takes nothing returns nothing
set gg_trg_Pitlord_Minion_Spawn = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Pitlord_Minion_Spawn, udg_g_timer[20] )
call TriggerAddAction( gg_trg_Pitlord_Minion_Spawn, function Trig_Pitlord_Minion_Spawn_Actions )
endfunction
function Trig_Pitlord_Knockback_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A06J' ) then
return true
endif
return false
endfunction
//Conditions für Gruppe, die weggestoßen wird.
function Trig_Pitlord_Knockback_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( GetOwningPlayer(GetFilterUnit()) != Player(2) ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[35])) == true ) ) then
return true
endif
return false
endfunction
// Movement der Units, die zurückgeschleudert werden.
function Trig_Pitlord_Knockback_Move takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(t), 53)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 54)
local integer wende = LoadInteger(udg_bierfass, GetHandleId(t), 55)
local real tempo = LoadReal(udg_bierfass, GetHandleId(t), 56)
local real winkel = LoadReal(udg_bierfass, GetHandleId(t), 57)
local real strecke = LoadReal(udg_bierfass, GetHandleId(t), 58)
local location loc
set iter = iter + 1
call SaveInteger(udg_bierfass, GetHandleId(t), 54, iter)
if ( IsUnitAliveBJ(target) ) then
if ( iter <= wende ) then
set tempo = tempo - (4 / I2R(wende))
call SaveReal(udg_bierfass, GetHandleId(t), 56, tempo)
call SetUnitFlyHeightBJ( target, SquareRoot( 2500 * iter ), 10000 )
else
set tempo = tempo - (4 / I2R(wende))
call SaveReal(udg_bierfass, GetHandleId(t), 56, tempo)
call SetUnitFlyHeightBJ( target, SquareRoot( 2500 * ((2*wende) - iter) ), 10000 )
endif
set loc = PolarProjectionBJ(GetUnitLoc(target), tempo, winkel )
call SetUnitPositionLoc( target, loc )
if ( iter == 2*wende ) then
call SetUnitFlyHeightBJ( target, 0, 10000 )
call SetUnitPathing( target, true )
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
else
call SetUnitFlyHeightBJ( target, 0, 10000 )
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
call RemoveLocation(loc)
set loc = null
set t = null
set target = null
endfunction
// einmaliger Schaden an Gruppe direkt nach Knockback und Knockback-Timer-Start
function Trig_Pitlord_Knockback_Damage takes nothing returns nothing
local real damage
local integer int = udg_DfficultyMode + 1
local real scaler
local unit caster = udg_g_unit[35]
local unit target = GetEnumUnit()
local unit dummy
local boolean crit = true
local location loc = GetUnitLoc(target)
local location loc2 = GetUnitLoc(caster)
local location loc3
local timer t = CreateTimer()
local integer iter = 0
local real strecke
local integer wende
local real tempo = 10.00
local real winkel
set strecke = (550-(DistanceBetweenPoints(loc, loc2))) + GetRandomReal(0,100)
set winkel = AngleBetweenPoints(loc2, loc)
set loc3 = PolarProjectionBJ(loc, strecke, winkel)
set dummy = CreateUnitAtLoc( Player(2), 'uabo', loc3, bj_UNIT_FACING )
set loc3 = GetUnitLoc(dummy)
call RemoveUnit(dummy)
set strecke = DistanceBetweenPoints(loc, loc3)
set winkel = AngleBetweenPoints(loc, loc3)
set wende = R2I(strecke / 12)
set damage = GetRandomReal((175+int*75), (200+int*100))
set scaler = damage / (400+int*200)
call UnitAddAbilityBJ( 'Amrf', target )
call UnitRemoveAbilityBJ( 'Amrf', target )
call SetUnitPathing( target, false )
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 53, target)
call SaveInteger(udg_bierfass, GetHandleId(t), 54, iter)
call SaveInteger(udg_bierfass, GetHandleId(t), 55, wende)
call SaveReal(udg_bierfass, GetHandleId(t), 56, tempo)
call SaveReal(udg_bierfass, GetHandleId(t), 57, winkel)
call SaveReal(udg_bierfass, GetHandleId(t), 58, strecke)
call TimerStart(t, 0.01, true, function Trig_Pitlord_Knockback_Move)
call UnitDamageTargetBJ( caster, target, damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING )
call RemoveLocation(loc)
call RemoveLocation(loc2)
call RemoveLocation(loc3)
set loc = null
set loc2 = null
set loc3 = null
set caster = null
set target = null
set dummy = null
endfunction
function Trig_Pitlord_Knockback_Actions takes nothing returns nothing
local unit caster = udg_g_unit[35]
local location loc = GetUnitLoc(caster)
local group g
local effect sfx
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Orc\\EarthQuake\\EarthQuakeTarget.mdl" )
set sfx = GetLastCreatedEffectBJ()
set g = GetUnitsInRangeOfLocMatching(450.00, loc, Condition(function Trig_Pitlord_Knockback_Groupcond))
call ForGroupBJ( g, function Trig_Pitlord_Knockback_Damage )
call PolledWait(2)
call DestroyEffect( sfx )
set sfx = null
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Pitlord_Knockback takes nothing returns nothing
set gg_trg_Pitlord_Knockback = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Pitlord_Knockback, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Pitlord_Knockback, Condition( function Trig_Pitlord_Knockback_Conditions ) )
call TriggerAddAction( gg_trg_Pitlord_Knockback, function Trig_Pitlord_Knockback_Actions )
endfunction
function Trig_Pitlord_Adds_Spawn_Conditions takes nothing returns boolean
if ( GetUnitLifePercent(udg_g_unit[35]) <= 50.00 ) then
return true
endif
return false
endfunction
function PitlordUnitspawn takes location loc returns nothing
local group g = CreateGroup()
local integer iter
// Anzahl Einheiten: Hound
local integer unit1 = 5
// Anzahl Einheiten: Elitehound
local integer unit2 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Guard
local integer unit3 = 5
// Anzahl Einheiten: Eliteguard
local integer unit4 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Succu
local integer unit5 = 3
// Anzahl Einheiten: Eliteeredar
local integer unit6 = 1 * udg_g_integer[1]
// Anzahl Einheiten: Eredar
local integer unit7 = 2
set iter = 1
loop
exitwhen iter > unit1
call CreateUnitAtLoc( Player(0), 'n00S', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit2
call CreateUnitAtLoc( Player(0), 'n00T', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit3
call CreateUnitAtLoc( Player(0), 'n00U', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit4
call CreateUnitAtLoc( Player(0), 'n00V', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit5
call CreateUnitAtLoc( Player(0), 'n00W', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit6
call CreateUnitAtLoc( Player(0), 'n011', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set iter = 1
loop
exitwhen iter > unit7
call CreateUnitAtLoc( Player(0), 'n010', loc, bj_UNIT_FACING )
set iter = iter + 1
endloop
set g = GetUnitsInRangeOfLocMatching(500, loc, Condition(function WaveAttackmoveGroupcond))
call ForGroupBJ( g, function WaveAttackmove )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Pitlord_Adds_Spawn_GroupConditions takes nothing returns boolean
if ( (IsUnitAliveBJ(GetFilterUnit()) == true) and (GetUnitTypeId(GetFilterUnit()) != 'n017') and (GetUnitTypeId(GetFilterUnit()) != 'N016') ) then
return true
endif
return false
endfunction
function Trig_Pitlord_Adds_Spawn_Actions takes nothing returns nothing
local location loc = Location(6750.00, 750.00)
local group g = GetUnitsOfPlayerMatching(Player(0), Condition(function Trig_Pitlord_Adds_Spawn_GroupConditions))
call PauseTimerBJ( true, udg_g_timer[23] )
call PitlordUnitspawn(loc)
if ( udg_g_integer[2] > 3 ) then
call PitlordUnitspawn(loc)
endif
if ( udg_g_integer[2] > 6 ) then
call PitlordUnitspawn(loc)
endif
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Pitlord_Adds_Spawn takes nothing returns nothing
set gg_trg_Pitlord_Adds_Spawn = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Pitlord_Adds_Spawn, udg_g_timer[23] )
call TriggerAddCondition( gg_trg_Pitlord_Adds_Spawn, Condition( function Trig_Pitlord_Adds_Spawn_Conditions ) )
call TriggerAddAction( gg_trg_Pitlord_Adds_Spawn, function Trig_Pitlord_Adds_Spawn_Actions )
endfunction
function Trig_Pitlord_Attack_Reorder_Conditions takes nothing returns boolean
if ( GetSpellAbilityUnit() == udg_g_unit[35] ) then
return true
endif
return false
endfunction
function Trig_Pitlord_Attack_Reorder_Func001002 takes nothing returns nothing
local location loc = Location(-500.00, 1300.00)
call IssuePointOrderLocBJ( GetEnumUnit(), "attack", loc )
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Pitlord_Attack_Reorder_Actions takes nothing returns nothing
local group g = GetUnitsOfPlayerAll(Player(0))
call ForGroupBJ( g, function Trig_Pitlord_Attack_Reorder_Func001002 )
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Pitlord_Attack_Reorder takes nothing returns nothing
set gg_trg_Pitlord_Attack_Reorder = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Pitlord_Attack_Reorder, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Pitlord_Attack_Reorder, Condition( function Trig_Pitlord_Attack_Reorder_Conditions ) )
call TriggerAddAction( gg_trg_Pitlord_Attack_Reorder, function Trig_Pitlord_Attack_Reorder_Actions )
endfunction
function Trig_HalfOgre_Spawn_Actions takes nothing returns nothing
local location loc = Location(6900.00, 800.00)
local integer i = udg_g_integer[2]
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffBoss|r - Half-Ogre" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Enrage, Anger" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Boss I - " + udg_g_string[1] ) )
call CreateNUnitsAtLoc( 1, 'O00D', Player(0), loc, bj_UNIT_FACING )
set udg_g_unit[18] = GetLastCreatedUnit()
set loc = Location(-600.00, 1300.00)
call IssuePointOrderLocBJ( udg_g_unit[18], "attack", loc )
call UnitAddAbilityBJ( 'A021', udg_g_unit[18] )
call SetHeroLevelBJ( udg_g_unit[18], 6, false )
if ( i >= 4 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[18], 12 )
call SetHeroLevelBJ( udg_g_unit[18], 13, false )
endif
if ( i >= 7 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[18], 23 )
call SetHeroLevelBJ( udg_g_unit[18], 15, false )
endif
call SuspendHeroXPBJ( false, udg_g_unit[18] )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_HalfOgre_Spawn takes nothing returns nothing
set gg_trg_HalfOgre_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_HalfOgre_Spawn, function Trig_HalfOgre_Spawn_Actions )
endfunction
// Disengage
function Trig_HalfOgre_Disengage takes nothing returns nothing
local location loc = Location(-600.00, 1300.00)
call PauseTimerBJ( true, udg_g_timer[9] )
call IssuePointOrderLocBJ( udg_g_unit[18], "attack", loc )
call EnableTrigger( gg_trg_HalfOgre_Engage )
call RemoveLocation(loc)
set loc = null
endfunction
// Enrage
function HalfOgre_Enrage takes nothing returns nothing
local location loc = GetUnitLoc(udg_g_unit[18])
call SetUnitAnimation( udg_g_unit[18], "spell slam" )
call CreateNUnitsAtLoc( 1, 'u000', Player(0), loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A03T', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A03T', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "bloodlust", udg_g_unit[18] )
call CreateTextTagUnitBJ( "ROOAAR ò_ó", udg_g_unit[18], 0, 20.00, 100, 100, 100, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 1.50 )
if ( BossDisengage(udg_g_unit[18]) ) then
call Trig_HalfOgre_Disengage()
endif
endfunction
function Trig_HalfOgre_Engage_Conditions takes nothing returns boolean
if ( GetAttackedUnitBJ() == udg_g_unit[18] ) then
return true
endif
return false
endfunction
function Trig_HalfOgre_Engage_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call TimerStart( udg_g_timer[9], 15, true, function HalfOgre_Enrage )
endfunction
//===========================================================================
function InitTrig_HalfOgre_Engage takes nothing returns nothing
set gg_trg_HalfOgre_Engage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_HalfOgre_Engage, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_HalfOgre_Engage, Condition( function Trig_HalfOgre_Engage_Conditions ) )
call TriggerAddAction( gg_trg_HalfOgre_Engage, function Trig_HalfOgre_Engage_Actions )
endfunction
function Trig_HalfOgre_Angry_Conditions takes nothing returns boolean
if ( ( GetAttackedUnitBJ() == udg_g_unit[18] ) and ( GetUnitLifePercent(udg_g_unit[18]) <= 33.00 ) ) then
return true
endif
return false
endfunction
function Trig_HalfOgre_Angry_Actions takes nothing returns nothing
call UnitAddAbilityBJ( 'A03S', udg_g_unit[18] )
call SetUnitAbilityLevelSwapped( 'A03S', udg_g_unit[18], ( udg_DfficultyMode + 1 ) )
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_HalfOgre_Angry takes nothing returns nothing
set gg_trg_HalfOgre_Angry = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_HalfOgre_Angry, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_HalfOgre_Angry, Condition( function Trig_HalfOgre_Angry_Conditions ) )
call TriggerAddAction( gg_trg_HalfOgre_Angry, function Trig_HalfOgre_Angry_Actions )
endfunction
// Ability: Banish + Firebreath
function Trig_Ogre_Firebreath takes nothing returns nothing
if ( IsUnitDeadBJ(udg_g_unit[15]) ) then
call PauseTimerBJ( true, udg_g_timer[5] )
else
call IssueImmediateOrderBJ( udg_g_unit[15], "roar" )
endif
endfunction
// Spawn
function Trig_Oger_Spawn_Actions takes nothing returns nothing
local location loc = Location(6900.00, 800.00)
local integer i = udg_g_integer[2]
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffBoss|r - Elite Ogre Pack" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Bash, Banish, Breath of Fire, Slumber" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Boss I - " + udg_g_string[1] ) )
call CreateNUnitsAtLoc( 1, 'O00B', Player(0), loc, bj_UNIT_FACING )
call SetUnitAbilityLevelSwapped( 'A03F', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
set udg_g_unit[14] = GetLastCreatedUnit()
call CreateNUnitsAtLoc( 1, 'H00M', Player(0), loc, bj_UNIT_FACING )
call AddSpecialEffectTargetUnitBJ( "hand, left", GetLastCreatedUnit(), "Abilities\\Spells\\Items\\AIfb\\AIfbTarget.mdl" )
call SetUnitAbilityLevelSwapped( 'A03J', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
set udg_g_unit[15] = GetLastCreatedUnit()
call CreateNUnitsAtLoc( 1, 'O00C', Player(0), loc, bj_UNIT_FACING )
set udg_g_unit[16] = GetLastCreatedUnit()
call TimerStart( udg_g_timer[5], GetRandomReal(8.00, 12.00), true, function Trig_Ogre_Firebreath )
call PauseTimerBJ( true, udg_g_timer[5] )
set loc = Location(-600.00, 1300.00)
call UnitAddAbilityBJ( 'A021', udg_g_unit[14] )
call UnitAddAbilityBJ( 'A021', udg_g_unit[15] )
call UnitAddAbilityBJ( 'A021', udg_g_unit[16] )
call IssuePointOrderLocBJ( udg_g_unit[14], "attack", loc )
call IssuePointOrderLocBJ( udg_g_unit[15], "attack", loc )
call IssuePointOrderLocBJ( udg_g_unit[16], "attack", loc )
call SetHeroLevelBJ( udg_g_unit[14], 5, false )
call SetHeroLevelBJ( udg_g_unit[15], 5, false )
call SetHeroLevelBJ( udg_g_unit[16], 5, false )
if ( i >= 4 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[14], 6 )
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[15], 4 )
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[16], 2 )
call SetHeroLevelBJ( udg_g_unit[14], 8, false )
call SetHeroLevelBJ( udg_g_unit[15], 8, false )
call SetHeroLevelBJ( udg_g_unit[16], 8, false )
endif
if ( i >= 7 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[14], 12 )
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[15], 8 )
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[16], 3 )
call SetHeroLevelBJ( udg_g_unit[14], 10, false )
call SetHeroLevelBJ( udg_g_unit[15], 10, false )
call SetHeroLevelBJ( udg_g_unit[16], 10, false )
endif
call SuspendHeroXPBJ( false, udg_g_unit[14] )
call SuspendHeroXPBJ( false, udg_g_unit[15] )
call SuspendHeroXPBJ( false, udg_g_unit[16] )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Oger_Spawn takes nothing returns nothing
set gg_trg_Oger_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Oger_Spawn, function Trig_Oger_Spawn_Actions )
endfunction
// Disengage
function Ogre_Disengage takes nothing returns nothing
local location loc = Location(-600.00, 1300.00)
if ( BossDisengage(udg_g_unit[14]) ) then
call IssuePointOrderLocBJ( udg_g_unit[14], "attack", loc )
call EnableTrigger( gg_trg_Oger_Engage )
endif
if ( BossDisengage(udg_g_unit[15]) ) then
call PauseTimerBJ( true, udg_g_timer[5] )
call IssuePointOrderLocBJ( udg_g_unit[15], "attack", loc )
call EnableTrigger( gg_trg_Oger_Engage )
endif
if ( BossDisengage(udg_g_unit[16]) ) then
call IssuePointOrderLocBJ( udg_g_unit[31], "attack", loc )
call SetUnitMoveSpeed( udg_g_unit[16], GetUnitDefaultMoveSpeed(udg_g_unit[16]) )
call EnableTrigger( gg_trg_Oger_Engage )
endif
if ( ( BossDisengage(udg_g_unit[14]) ) and ( BossDisengage(udg_g_unit[15]) ) and ( BossDisengage(udg_g_unit[16]) ) ) then
call PauseTimerBJ( true, udg_g_timer[19] )
endif
call RemoveLocation(loc)
set loc = null
endfunction
//Engage
function Trig_Oger_Engage_Conditions takes nothing returns boolean
if ( ( GetAttackedUnitBJ() == udg_g_unit[14] ) or ( GetAttackedUnitBJ() == udg_g_unit[15] ) or ( GetAttackedUnitBJ() == udg_g_unit[16] ) ) then
return true
endif
return false
endfunction
function Trig_Oger_Engage_Actions takes nothing returns nothing
call PauseTimerBJ( false, udg_g_timer[5] )
call TimerStart( udg_g_timer[19], 5.00, true, function Ogre_Disengage )
call SetUnitMoveSpeed( udg_g_unit[16], 522.00 )
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Oger_Engage takes nothing returns nothing
set gg_trg_Oger_Engage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Oger_Engage, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Oger_Engage, Condition( function Trig_Oger_Engage_Conditions ) )
call TriggerAddAction( gg_trg_Oger_Engage, function Trig_Oger_Engage_Actions )
endfunction
function Trig_Twins_Spawn_Actions takes nothing returns nothing
local location loc = Location(6900.00, 800.00)
local integer i = udg_g_integer[2]
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffBoss|r - Twin Blademasters" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Critical Strike, Spin, Swordcrusher's Revenge, Mageslayer's Bane" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Boss I - " + udg_g_string[1] ) )
call CreateNUnitsAtLoc( 1, 'N00O', Player(0), loc, bj_UNIT_FACING )
call SetUnitAbilityLevelSwapped( 'A036', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A037', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
set udg_g_unit[12] = GetLastCreatedUnit()
call CreateNUnitsAtLoc( 1, 'O00A', Player(0), loc, bj_UNIT_FACING )
call SetUnitAbilityLevelSwapped( 'A036', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A03A', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
set udg_g_unit[13] = GetLastCreatedUnit()
set loc = Location(-600.00, 1300.00)
call IssuePointOrderLocBJ( udg_g_unit[12], "attack", GetRectCenter(GetPlayableMapRect()) )
call IssuePointOrderLocBJ( udg_g_unit[13], "attack", GetRectCenter(GetPlayableMapRect()) )
call UnitAddAbilityBJ( 'A021', udg_g_unit[12] )
call UnitAddAbilityBJ( 'A021', udg_g_unit[13] )
call SetHeroLevelBJ( udg_g_unit[12], 7, false )
call SetHeroLevelBJ( udg_g_unit[13], 7, false )
if ( i >= 4 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[12], 5 )
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[13], 9 )
call SetHeroLevelBJ( udg_g_unit[12], 9, false )
call SetHeroLevelBJ( udg_g_unit[13], 9, false )
endif
if ( i >= 7 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[12], 7 )
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[13], 13 )
call SetHeroLevelBJ( udg_g_unit[12], 12, false )
call SetHeroLevelBJ( udg_g_unit[13], 12, false )
endif
call SuspendHeroXPBJ( false, udg_g_unit[12] )
call SuspendHeroXPBJ( false, udg_g_unit[13] )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Twins_Spawn takes nothing returns nothing
set gg_trg_Twins_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Twins_Spawn, function Trig_Twins_Spawn_Actions )
endfunction
// Spin
function Trig_Twins_Spin_Actions takes nothing returns nothing
local location loc
if ( ( IsUnitAliveBJ(udg_g_unit[12]) ) and ( IsUnitAliveBJ(udg_g_unit[13]) ) ) then
call UnitAddAbilityBJ( 'Amim', udg_g_unit[12] )
call UnitAddAbilityBJ( 'Amim', udg_g_unit[13] )
call UnitAddAbilityBJ( 'A038', udg_g_unit[12] )
call UnitAddAbilityBJ( 'A038', udg_g_unit[13] )
call SetUnitAbilityLevelSwapped( 'A038', udg_g_unit[12], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A038', udg_g_unit[13], ( udg_DfficultyMode + 1 ) )
call IssueImmediateOrderBJ( udg_g_unit[12], "starfall" )
call IssueImmediateOrderBJ( udg_g_unit[13], "starfall" )
else
call TimerStart( udg_g_timer[4], 5, false, function Trig_Twins_Spin_Actions )
set loc = Location(-600.00, 1300.00)
if ( BossDisengage(udg_g_unit[12]) ) then
call IssuePointOrderLocBJ( udg_g_unit[12], "attack", loc )
endif
if ( BossDisengage(udg_g_unit[13]) ) then
call IssuePointOrderLocBJ( udg_g_unit[13], "attack", loc )
endif
endif
endfunction
// Engage
function Trig_Twins_Engage_Conditions takes nothing returns boolean
if ( ( GetUnitTypeId(GetAttackedUnitBJ()) == 'O00A' ) or ( GetUnitTypeId(GetAttackedUnitBJ()) == 'N00O' ) ) then
return true
endif
return false
endfunction
function Trig_Twins_Engage_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call TimerStart( udg_g_timer[4], 14, true, function Trig_Twins_Spin_Actions )
endfunction
//===========================================================================
function InitTrig_Twins_Engage takes nothing returns nothing
set gg_trg_Twins_Engage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Twins_Engage, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Twins_Engage, Condition( function Trig_Twins_Engage_Conditions ) )
call TriggerAddAction( gg_trg_Twins_Engage, function Trig_Twins_Engage_Actions )
endfunction
function Trig_Twins_Silence_Conditions takes nothing returns boolean
if ( ( UnitHasBuffBJ(GetTriggerUnit(), 'B00K') ) and ( GetUnitTypeId(GetSpellAbilityUnit()) != 'H00F' ) and ( GetUnitTypeId(GetSpellAbilityUnit()) != 'H00C' ) and ( GetUnitTypeId(GetSpellAbilityUnit()) != 'H00D' ) and ( GetUnitTypeId(GetSpellAbilityUnit()) != 'H00E' ) and ( GetUnitTypeId(GetSpellAbilityUnit()) != 'H00B' ) and ( GetUnitTypeId(GetSpellAbilityUnit()) != 'H002' ) and ( GetUnitTypeId(GetSpellAbilityUnit()) != 'H001' ) and ( GetUnitTypeId(GetSpellAbilityUnit()) != 'H000' ) and ( GetUnitTypeId(GetSpellAbilityUnit()) != 'H004' ) and ( GetUnitTypeId(GetSpellAbilityUnit()) != 'H003' ) ) then
return true
endif
return false
endfunction
function Trig_Twins_Silence_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetSpellAbilityUnit())
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(GetSpellAbilityUnit()), loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A039', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A039', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "soulburn", GetSpellAbilityUnit() )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Twins_Silence takes nothing returns nothing
set gg_trg_Twins_Silence = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Twins_Silence, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Twins_Silence, Condition( function Trig_Twins_Silence_Conditions ) )
call TriggerAddAction( gg_trg_Twins_Silence, function Trig_Twins_Silence_Actions )
endfunction
function Trig_Twins_Swap_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A038' ) then
return true
endif
return false
endfunction
function Trig_Twins_Swap_Actions takes nothing returns nothing
local location loc
local location loc2
call UnitRemoveAbilityBJ( 'Amim', udg_g_unit[12] )
call UnitRemoveAbilityBJ( 'Amim', udg_g_unit[13] )
if ( IsUnitDeadBJ(udg_g_unit[12]) or IsUnitDeadBJ(udg_g_unit[13]) ) then
return
endif
set loc = GetUnitLoc(udg_g_unit[12])
set loc2 = GetUnitLoc(udg_g_unit[13])
call SetUnitPathing( udg_g_unit[12], false )
call SetUnitPathing( udg_g_unit[13], false )
call SetUnitPositionLoc( udg_g_unit[12], loc2 )
call SetUnitPositionLoc( udg_g_unit[13], loc )
call SetUnitPathing( udg_g_unit[12], true )
call SetUnitPathing( udg_g_unit[13], true )
set loc = Location(-600.00, 1300.00)
call IssuePointOrderLocBJ( udg_g_unit[12], "attack", loc )
call IssuePointOrderLocBJ( udg_g_unit[13], "attack", loc )
call RemoveLocation(loc)
call RemoveLocation(loc2)
set loc = null
set loc2 = null
endfunction
//===========================================================================
function InitTrig_Twins_Swap takes nothing returns nothing
set gg_trg_Twins_Swap = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Twins_Swap, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_Twins_Swap, Condition( function Trig_Twins_Swap_Conditions ) )
call TriggerAddAction( gg_trg_Twins_Swap, function Trig_Twins_Swap_Actions )
endfunction
function Trig_Orc_Berserker_Spawn_Actions takes nothing returns nothing
local location loc = Location(6900.00, 800.00)
local integer i = -1 + 2 * udg_g_integer[2]
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffBoss|r - Orc Berserker" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Mirror Image, Leap Strike, Enrage" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Boss III - " + udg_g_string[1] ) )
call CreateNUnitsAtLoc( 1, 'O00K', Player(0), loc, bj_UNIT_FACING )
set udg_g_unit[27] = GetLastCreatedUnit()
set loc = Location(-600.00, 1300.00)
call IssuePointOrderLocBJ( udg_g_unit[27], "attack", loc )
call UnitAddAbilityBJ( 'A021', udg_g_unit[27] )
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[27], i )
call SetHeroLevelBJ( udg_g_unit[27], 10, false )
if ( i >= 4 ) then
call SetHeroLevelBJ( udg_g_unit[27], 15, false )
endif
if ( i >= 7 ) then
call SetHeroLevelBJ( udg_g_unit[27], 20, false )
endif
call SuspendHeroXPBJ( false, udg_g_unit[27] )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Orc_Berserker_Spawn takes nothing returns nothing
set gg_trg_Orc_Berserker_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Orc_Berserker_Spawn, function Trig_Orc_Berserker_Spawn_Actions )
endfunction
// Disengage
function Trig_Orc_Berserker_Disengage takes nothing returns nothing
local location loc = Location(-600.00, 1300.00)
call PauseTimerBJ( true, udg_g_timer[17] )
call PauseTimerBJ( true, udg_g_timer[18] )
call IssuePointOrderLocBJ( udg_g_unit[27], "attack", loc )
set loc = GetUnitLoc(udg_g_unit[28])
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl" )
call RemoveUnit(udg_g_unit[28])
call EnableTrigger( gg_trg_Orc_Berserker_Engage )
call RemoveLocation(loc)
set loc = null
endfunction
// Allgemeine Conditions für Spell-Unitgroups
function Orc_Berserker_Group_Cond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[27])) == true ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == false ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B00S') == false ) ) then
return true
endif
return false
endfunction
// Leap Strike
function Trig_Orc_Sprungangriff_Move takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 59)
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(t), 60)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 61)
local integer wende = LoadInteger(udg_bierfass, GetHandleId(t), 62)
local real tempo = LoadReal(udg_bierfass, GetHandleId(t), 63)
local real winkel = LoadReal(udg_bierfass, GetHandleId(t), 64)
local real strecke = LoadReal(udg_bierfass, GetHandleId(t), 65)
local location loc
local location loc2
set iter = iter + 1
call SaveInteger(udg_bierfass, GetHandleId(t), 61, iter)
if ( IsUnitAliveBJ(caster) ) then
if ( iter <= wende ) then
set tempo = tempo - (5 / I2R(wende))
call SaveReal(udg_bierfass, GetHandleId(t), 63, tempo)
call SetUnitFlyHeightBJ( caster, SquareRoot( 2500 * iter ), 10000 )
else
set tempo = tempo - (5 / I2R(wende))
call SaveReal(udg_bierfass, GetHandleId(t), 63, tempo)
call SetUnitFlyHeightBJ( caster, SquareRoot( 2500 * ((2*wende) - iter) ), 10000 )
endif
set loc = PolarProjectionBJ(GetUnitLoc(caster), tempo, winkel )
call SetUnitPositionLoc( caster, loc )
if ( iter == 2*wende ) then
call SetUnitFlyHeightBJ( caster, 0, 10000 )
call SetUnitPathing( caster, true )
call SetUnitFacingToFaceUnitTimed( caster, target, 0 )
call SetUnitAnimation( caster, "attack" )
call QueueUnitAnimationBJ( caster, "stand" )
set loc = GetUnitLoc(caster)
set loc2 = GetUnitLoc(target)
if ( DistanceBetweenPoints(loc, loc2) <= 100 ) then
call AddSpecialEffectTargetUnitBJ( "chest", target, "Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodLarge0.mdl" )
call UnitDamageTargetBJ( caster, target, ( 300.00 + ( I2R(udg_DfficultyMode) * 250.00 ) ), ATTACK_TYPE_MELEE, DAMAGE_TYPE_NORMAL )
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A018', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", target )
endif
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call RemoveLocation(loc2)
set loc2 = null
endif
else
call SetUnitFlyHeightBJ( caster, 0, 10000 )
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
call RemoveLocation(loc)
set loc = null
set t = null
set caster = null
set target = null
endfunction
function Trig_Leapstrike_Actions takes unit caster returns nothing
local timer t = CreateTimer()
local location loc = GetUnitLoc(caster)
local unit target
local location loc2
local integer iter = 0
local real strecke
local integer wende
local real tempo
local real winkel
local group g
set target = ReturnLowestHpHero(caster, 750.00)
if ( target == null ) then
set g = GetUnitsInRangeOfLocMatching(750.00, loc, Condition(function Orc_Berserker_Group_Cond))
set target = GroupPickRandomUnit(g)
endif
set loc2 = GetUnitLoc(target)
set strecke = DistanceBetweenPoints(loc, loc2)
set wende = R2I(strecke / 14)
set tempo = 12.00
set winkel = AngleBetweenPoints(loc, loc2)
call UnitAddAbilityBJ( 'Amrf', caster )
call UnitRemoveAbilityBJ( 'Amrf', caster )
call SetUnitPathing( caster, false )
call SetUnitFacingTimed( caster, winkel, 0 )
call SetUnitAnimation( caster, "slam" )
call QueueUnitAnimationBJ( caster, "stand" )
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 59, caster)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 60, target)
call SaveInteger(udg_bierfass, GetHandleId(t), 61, iter)
call SaveInteger(udg_bierfass, GetHandleId(t), 62, wende)
call SaveReal(udg_bierfass, GetHandleId(t), 63, tempo)
call SaveReal(udg_bierfass, GetHandleId(t), 64, winkel)
call SaveReal(udg_bierfass, GetHandleId(t), 65, strecke)
call TimerStart( t, 0.01, true, function Trig_Orc_Sprungangriff_Move )
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
call DestroyGroup(g)
set g = null
set t = null
set caster = null
set target = null
endfunction
function Orc_Berserker_Leap_Actions takes nothing returns nothing
local group g
local location loc
if ( (BossDisengage(udg_g_unit[27])) or (BossDisengage(udg_g_unit[28])) ) then
call Trig_Orc_Berserker_Disengage()
else
set loc = GetUnitLoc(udg_g_unit[27])
set g = GetUnitsInRangeOfLocMatching(750.00, loc, Condition(function Orc_Berserker_Group_Cond))
if ( CountUnitsInGroup(g) != 0 ) then
call Trig_Leapstrike_Actions(udg_g_unit[27])
endif
set loc = GetUnitLoc(udg_g_unit[28])
set g = GetUnitsInRangeOfLocMatching(750.00, loc, Condition(function Orc_Berserker_Group_Cond))
if ( CountUnitsInGroup(g) != 0 ) then
call Trig_Leapstrike_Actions(udg_g_unit[28])
endif
endif
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
// Enrage
function Orc_Berserker_Enrage_Actions takes nothing returns nothing
local location loc
local integer iter = 27
loop
exitwhen iter > 28
set loc = GetUnitLoc(udg_g_unit[iter])
call CreateNUnitsAtLoc( 1, 'u000', Player(0), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A062', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A062', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "bloodlust", udg_g_unit[iter] )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
set iter = iter + 1
endloop
if ( (BossDisengage(udg_g_unit[27])) or (BossDisengage(udg_g_unit[28])) ) then
call Trig_Orc_Berserker_Disengage()
endif
call RemoveLocation(loc)
endfunction
// Engage
function Trig_Orc_Berserker_Engage_Conditions takes nothing returns boolean
if ( GetAttackedUnitBJ() == udg_g_unit[27] ) then
return true
endif
return false
endfunction
function Trig_Orc_Berserker_Engage_Actions takes nothing returns nothing
local location loc
call DisableTrigger( GetTriggeringTrigger() )
call UnitResetCooldown( udg_g_unit[27] )
call IssueImmediateOrderBJ( udg_g_unit[27], "mirrorimage" )
call TimerStart( udg_g_timer[17], 6.00, true, function Orc_Berserker_Leap_Actions )
call TimerStart( udg_g_timer[18], 11.00, true, function Orc_Berserker_Enrage_Actions )
endfunction
//===========================================================================
function InitTrig_Orc_Berserker_Engage takes nothing returns nothing
set gg_trg_Orc_Berserker_Engage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Orc_Berserker_Engage, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Orc_Berserker_Engage, Condition( function Trig_Orc_Berserker_Engage_Conditions ) )
call TriggerAddAction( gg_trg_Orc_Berserker_Engage, function Trig_Orc_Berserker_Engage_Actions )
endfunction
function Trig_Mirror_Image_Death_Conditions takes nothing returns boolean
if ( ( GetDyingUnit() == udg_g_unit[27] ) or ( GetDyingUnit() == udg_g_unit[28] ) ) then
return true
endif
return false
endfunction
function Trig_Mirror_Image_Death_Actions takes nothing returns nothing
local location loc
local location loc2
local real facing
local real facing1
if ( GetDyingUnit() == udg_g_unit[27] ) then
call KillUnit( udg_g_unit[28] )
endif
if ( GetDyingUnit() == udg_g_unit[28] ) then
set loc = GetUnitLoc(udg_g_unit[27])
set loc2 = GetUnitLoc(udg_g_unit[28])
set facing = GetUnitFacing(udg_g_unit[27])
set facing1 = GetUnitFacing(udg_g_unit[28])
call SetUnitPathing( udg_g_unit[27], false )
call SetUnitPathing( udg_g_unit[28], false )
call SetUnitPositionLoc( udg_g_unit[27], loc2 )
call SetUnitFacingTimed( udg_g_unit[28], facing1, 0 )
call SetUnitPositionLoc( udg_g_unit[27], loc )
call SetUnitFacingTimed( udg_g_unit[28], facing, 0 )
call UnitDamageTargetBJ( GetKillingUnit(), udg_g_unit[27], 500000, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING )
endif
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
endfunction
//===========================================================================
function InitTrig_Mirror_Image_Death takes nothing returns nothing
set gg_trg_Mirror_Image_Death = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mirror_Image_Death, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Mirror_Image_Death, Condition( function Trig_Mirror_Image_Death_Conditions ) )
call TriggerAddAction( gg_trg_Mirror_Image_Death, function Trig_Mirror_Image_Death_Actions )
endfunction
function Trig_Mirror_Image_Spawn_Conditions takes nothing returns boolean
if ( ( GetUnitTypeId(GetSummoningUnit()) == 'O00K' ) and ( GetUnitTypeId(GetSummonedUnit()) == 'O00K' ) ) then
return true
endif
return false
endfunction
function Trig_Mirror_Image_Spawn_Actions takes nothing returns nothing
local location loc = Location(-600.00, 1300.00)
set udg_g_unit[28] = GetSummonedUnit()
call IssuePointOrderLocBJ( udg_g_unit[28], "attack", loc )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Mirror_Image_Spawn takes nothing returns nothing
set gg_trg_Mirror_Image_Spawn = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mirror_Image_Spawn, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Mirror_Image_Spawn, Condition( function Trig_Mirror_Image_Spawn_Conditions ) )
call TriggerAddAction( gg_trg_Mirror_Image_Spawn, function Trig_Mirror_Image_Spawn_Actions )
endfunction
// Ability: Death and Decay
function Undead_Champions_DnD_Cond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[31])) == true ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == false ) and ( GetOwningPlayer(GetFilterUnit()) != Player(2) ) ) then
return true
endif
return false
endfunction
function Undead_Champions_DnD_Actions takes nothing returns nothing
local location loc = GetUnitLoc(udg_g_unit[31])
local group g = GetUnitsInRangeOfLocMatching(750.00, loc, Condition(function Undead_Champions_DnD_Cond))
set loc = GetUnitLoc(GroupPickRandomUnit(g))
call IssuePointOrderLocBJ( udg_g_unit[31], "deathanddecay", loc )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
// Spawn
function Trig_Undead_Champions_Spawn_Actions takes nothing returns nothing
local location loc = Location(6900.00, 800.00)
local integer i = udg_g_integer[2]
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffBoss|r - Undead Champions" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Unholy Armor, Death Coil, Death Pact, Black Arrow, Unholy Frenzy, Death and Decay, Spawn Zombie" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Boss III - " + udg_g_string[1] ) )
call CreateNUnitsAtLoc( 1, 'U00L', Player(0), loc, bj_UNIT_FACING )
set udg_g_unit[29] = GetLastCreatedUnit()
call CreateNUnitsAtLoc( 1, 'N012', Player(0), loc, bj_UNIT_FACING )
set udg_g_unit[30] = GetLastCreatedUnit()
call CreateNUnitsAtLoc( 1, 'U00M', Player(0), loc, bj_UNIT_FACING )
set udg_g_unit[31] = GetLastCreatedUnit()
set loc = Location(-600.00, 1300.00)
call TimerStart( udg_g_timer[15], 20.00, true, function Undead_Champions_DnD_Actions )
call PauseTimerBJ( true, udg_g_timer[15] )
call IssuePointOrderLocBJ( udg_g_unit[29], "attack", loc )
call IssuePointOrderLocBJ( udg_g_unit[30], "attack", loc )
call IssuePointOrderLocBJ( udg_g_unit[31], "attack", loc )
call SetUnitAbilityLevelSwapped( 'A05F', udg_g_unit[29], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A05I', udg_g_unit[29], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A05J', udg_g_unit[29], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A05F', udg_g_unit[30], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A05G', udg_g_unit[30], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A05H', udg_g_unit[30], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A05F', udg_g_unit[31], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A05K', udg_g_unit[31], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A05L', udg_g_unit[31], ( udg_DfficultyMode + 1 ) )
call SetHeroLevelBJ( udg_g_unit[29], 10, false )
call SetHeroLevelBJ( udg_g_unit[30], 10, false )
call SetHeroLevelBJ( udg_g_unit[31], 10, false )
call UnitAddAbilityBJ( 'A021', udg_g_unit[29] )
call UnitAddAbilityBJ( 'A021', udg_g_unit[30] )
call UnitAddAbilityBJ( 'A021', udg_g_unit[31] )
if ( i >= 4 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[29], 6 )
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[30], 5 )
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[31], 3 )
call SetHeroLevelBJ( udg_g_unit[29], 13, false )
call SetHeroLevelBJ( udg_g_unit[30], 13, false )
call SetHeroLevelBJ( udg_g_unit[31], 13, false )
endif
if ( i >= 7 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[29], 11 )
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[30], 9 )
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[31], 6 )
call SetHeroLevelBJ( udg_g_unit[29], 15, false )
call SetHeroLevelBJ( udg_g_unit[30], 15, false )
call SetHeroLevelBJ( udg_g_unit[31], 15, false )
endif
call SuspendHeroXPBJ( false, udg_g_unit[29] )
call SuspendHeroXPBJ( false, udg_g_unit[30] )
call SuspendHeroXPBJ( false, udg_g_unit[31] )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Undead_Champions_Spawn takes nothing returns nothing
set gg_trg_Undead_Champions_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Undead_Champions_Spawn, function Trig_Undead_Champions_Spawn_Actions )
endfunction
// Disengage
function Undead_Champions_Disengage takes nothing returns nothing
local location loc = Location(-600.00, 1300.00)
if ( BossDisengage(udg_g_unit[29]) ) then
call IssuePointOrderLocBJ( udg_g_unit[29], "attack", loc )
call EnableTrigger( gg_trg_Undead_Champions_Engage )
endif
if ( BossDisengage(udg_g_unit[30]) ) then
call IssuePointOrderLocBJ( udg_g_unit[30], "attack", loc )
call EnableTrigger( gg_trg_Undead_Champions_Engage )
endif
if ( BossDisengage(udg_g_unit[31]) ) then
call PauseTimerBJ( true, udg_g_timer[15] )
call IssuePointOrderLocBJ( udg_g_unit[31], "attack", loc )
call EnableTrigger( gg_trg_Undead_Champions_Engage )
endif
if ( ( BossDisengage(udg_g_unit[29]) ) and ( BossDisengage(udg_g_unit[30]) ) and ( BossDisengage(udg_g_unit[31]) ) ) then
call PauseTimerBJ( true, udg_g_timer[16] )
endif
call RemoveLocation(loc)
set loc = null
endfunction
// Engage
function Trig_Undead_Champions_Engage_Conditions takes nothing returns boolean
if ( ( GetAttackedUnitBJ() == udg_g_unit[29] ) or ( GetAttackedUnitBJ() == udg_g_unit[30] ) or ( GetAttackedUnitBJ() == udg_g_unit[31] ) )then
return true
endif
return false
endfunction
function Trig_Undead_Champions_Engage_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
if ( IsUnitAliveBJ(udg_g_unit[31]) ) then
call PauseTimerBJ( false, udg_g_timer[15] )
endif
call TimerStart( udg_g_timer[16], 5.00, true, function Undead_Champions_Disengage )
endfunction
//===========================================================================
function InitTrig_Undead_Champions_Engage takes nothing returns nothing
set gg_trg_Undead_Champions_Engage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Undead_Champions_Engage, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Undead_Champions_Engage, Condition( function Trig_Undead_Champions_Engage_Conditions ) )
call TriggerAddAction( gg_trg_Undead_Champions_Engage, function Trig_Undead_Champions_Engage_Actions )
endfunction
function Trig_Undead_Champions_Spawned_Zombie_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetSummonedUnit()) == 'n00Q' ) then
return true
endif
return false
endfunction
function Trig_Undead_Champions_Spawned_Zombie_Actions takes nothing returns nothing
local location loc = Location(-600.00, 1300.00)
call IssuePointOrderLocBJ( udg_g_unit[11], "attack", loc )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Undead_Champions_Spawned_Zombie takes nothing returns nothing
set gg_trg_Undead_Champions_Spawned_Zombie = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Undead_Champions_Spawned_Zombie, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Undead_Champions_Spawned_Zombie, Condition( function Trig_Undead_Champions_Spawned_Zombie_Conditions ) )
call TriggerAddAction( gg_trg_Undead_Champions_Spawned_Zombie, function Trig_Undead_Champions_Spawned_Zombie_Actions )
endfunction
function Trig_Firelord_Spawn_Actions takes nothing returns nothing
local location loc = Location(6900.00, 800.00)
local integer i = udg_g_integer[2]
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffBoss|r - Firelord" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Immolation, Incinerate, Flame Strike, Rain of Fire" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Boss IV - " + udg_g_string[1] ) )
call CreateNUnitsAtLoc( 1, 'N00P', Player(0), loc, bj_UNIT_FACING )
set udg_g_unit[11] = GetLastCreatedUnit()
set loc = Location(-600.00, 1300.00)
call SetUnitAbilityLevelSwapped( 'A03E', udg_g_unit[11], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A03C', udg_g_unit[11], ( udg_DfficultyMode + 1 ) )
call UnitAddAbilityBJ( 'A021', udg_g_unit[11] )
call SetHeroLevelBJ( udg_g_unit[11], 20, false )
if ( i >= 4 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[17], 15 )
call SetHeroLevelBJ( udg_g_unit[11], 25, false )
endif
if ( i >= 7 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[17], 30 )
call SetHeroLevelBJ( udg_g_unit[11], 30, false )
endif
call IssuePointOrderLocBJ( udg_g_unit[11], "attack", loc )
call SuspendHeroXPBJ( false, udg_g_unit[11] )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Firelord_Spawn takes nothing returns nothing
set gg_trg_Firelord_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Firelord_Spawn, function Trig_Firelord_Spawn_Actions )
endfunction
function Trig_Firelord_Engage_Conditions takes nothing returns boolean
if ( GetAttackedUnitBJ() == udg_g_unit[11] ) then
return true
endif
return false
endfunction
function Trig_Firelord_Engage_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
set udg_g_unit[11] = GetAttackedUnitBJ()
call StartTimerBJ( udg_g_timer[2], true, 10.00 )
call StartTimerBJ( udg_g_timer[3], true, 3.00 )
call TriggerExecute( gg_trg_Firelord_Flamestrike )
endfunction
//===========================================================================
function InitTrig_Firelord_Engage takes nothing returns nothing
set gg_trg_Firelord_Engage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Firelord_Engage, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Firelord_Engage, Condition( function Trig_Firelord_Engage_Conditions ) )
call TriggerAddAction( gg_trg_Firelord_Engage, function Trig_Firelord_Engage_Actions )
endfunction
function Trig_Firelord_Disengage takes nothing returns nothing
local location loc = Location(-600.00, 1300.00)
call PauseTimerBJ( true, udg_g_timer[2] )
call PauseTimerBJ( true, udg_g_timer[3] )
call IssuePointOrderLocBJ( udg_g_unit[11], "attack", loc )
call EnableTrigger( gg_trg_Firelord_Engage )
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Firelord_Flamestrike_Cond takes nothing returns boolean
local location loc = GetUnitLoc(udg_g_unit[11])
local location loc2 = GetUnitLoc(GetFilterUnit())
local real r = DistanceBetweenPoints(loc, loc2)
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[11])) == true ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == false ) and ( r >= 240.00 ) and ( GetUnitTypeId(GetFilterUnit()) != 'u002' ) and ( GetOwningPlayer(GetFilterUnit()) != Player(2) ) ) then
return true
endif
return false
endfunction
function Trig_Firelord_Disengange_Groupcond takes nothing returns boolean
if ( ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(GetFilterUnit()) == true ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[11])) ) ) then
return true
endif
return false
endfunction
function Trig_Firelord_Disengange_Cond takes nothing returns boolean
local location loc = GetUnitLoc(udg_g_unit[11])
local group g = GetUnitsInRangeOfLocMatching(1000.00, loc, Condition(function Trig_Firelord_Disengange_Groupcond))
local integer i = CountUnitsInGroup(g)
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
if ( i == 0 ) then
return true
endif
return false
endfunction
function Trig_Firelord_Flamestrike_Actions takes nothing returns nothing
local location loc = GetUnitLoc(udg_g_unit[11])
local group g = GetUnitsInRangeOfLocMatching(1000.00, loc, Condition(function Trig_Firelord_Flamestrike_Cond))
call UnitResetCooldown( udg_g_unit[11] )
set loc = GetUnitLoc(GroupPickRandomUnit(g))
call IssuePointOrderLocBJ( udg_g_unit[11], "flamestrike", loc )
if ( Trig_Firelord_Disengange_Cond() ) then
call Trig_Firelord_Disengage()
endif
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Firelord_Flamestrike takes nothing returns nothing
set gg_trg_Firelord_Flamestrike = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Firelord_Flamestrike, udg_g_timer[2] )
call TriggerAddAction( gg_trg_Firelord_Flamestrike, function Trig_Firelord_Flamestrike_Actions )
endfunction
function Trig_Firelord_Rain_of_Fire_Cond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[11])) == true ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == false ) and ( GetUnitTypeId(GetFilterUnit()) != 'u002' ) and ( GetOwningPlayer(GetFilterUnit()) != Player(2) ) ) then
return true
endif
return false
endfunction
function Trig_Firelord_Rain_of_Fire_Actions takes nothing returns nothing
local location loc = GetUnitLoc(udg_g_unit[11])
local group g = GetUnitsInRangeOfLocMatching(750.00, loc, Condition(function Trig_Firelord_Rain_of_Fire_Cond))
call CreateNUnitsAtLoc( 1, 'u000', Player(3), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A03D', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A03D', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
call UnitApplyTimedLifeBJ( GetRandomReal(5.00, 20.00), 'BTLF', GetLastCreatedUnit() )
set loc = GetUnitLoc(GroupPickRandomUnit(g))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "rainoffire", loc )
if ( Trig_Firelord_Disengange_Cond() ) then
call Trig_Firelord_Disengage()
endif
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Firelord_Rain_of_Fire takes nothing returns nothing
set gg_trg_Firelord_Rain_of_Fire = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Firelord_Rain_of_Fire, udg_g_timer[3] )
call TriggerAddAction( gg_trg_Firelord_Rain_of_Fire, function Trig_Firelord_Rain_of_Fire_Actions )
endfunction
function Trig_Frostwyrm_Spawn_Actions takes nothing returns nothing
local location loc = Location(6900.00, 800.00)
local integer i = udg_g_integer[2]
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffBoss|r - Frost Wyrm" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Freezing Aura, Frost Breath, Frost Bolts, Blizzard" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Boss IV - " + udg_g_string[1] ) )
call CreateNUnitsAtLoc( 1, 'U00A', Player(0), loc, bj_UNIT_FACING )
set udg_g_unit[17] = GetLastCreatedUnit()
set loc = Location(-600.00, 1300.00)
call IssuePointOrderLocBJ( udg_g_unit[17], "attack", loc )
call SetUnitAbilityLevelSwapped( 'A03N', udg_g_unit[17], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A03Q', udg_g_unit[17], ( udg_DfficultyMode + 1 ) )
call UnitAddAbilityBJ( 'A021', udg_g_unit[17] )
call SetHeroLevelBJ( udg_g_unit[17], 20, false )
if ( i >= 4 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[17], 13 )
call SetHeroLevelBJ( udg_g_unit[17], 25, false )
endif
if ( i >= 7 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[17], 25 )
call SetHeroLevelBJ( udg_g_unit[17], 30, false )
endif
call SuspendHeroXPBJ( false, udg_g_unit[17] )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Frostwyrm_Spawn takes nothing returns nothing
set gg_trg_Frostwyrm_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Frostwyrm_Spawn, function Trig_Frostwyrm_Spawn_Actions )
endfunction
// Disengage
function Trig_Frostwyrm_Disengage takes nothing returns nothing
local location loc = Location(-600.00, 1300.00)
call PauseTimerBJ( true, udg_g_timer[6] )
call PauseTimerBJ( true, udg_g_timer[7] )
call PauseTimerBJ( true, udg_g_timer[8] )
call IssuePointOrderLocBJ( udg_g_unit[17], "attack", loc )
call EnableTrigger( gg_trg_Frostwyrm_Engage )
call RemoveLocation(loc)
set loc = null
endfunction
// Frost Missiles
function Frostwyrm_Frostmissile_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[17])) == true ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == false ) ) then
return true
endif
return false
endfunction
function Frostwyrm_Frostmissile_Groupaction takes nothing returns nothing
local location loc = GetUnitLoc(udg_g_unit[17])
call CreateNUnitsAtLoc( 1, 'u00B', Player(0), loc, GetUnitFacing(udg_g_unit[17]) )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A03O', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", GetEnumUnit() )
call RemoveLocation(loc)
set loc = null
endfunction
function Frostwyrm_Frostmissile_Actions takes nothing returns nothing
local location loc = GetUnitLoc(udg_g_unit[17])
local group g = GetUnitsInRangeOfLocMatching(850.00, loc, Condition(function Frostwyrm_Frostmissile_Groupcond))
call SetUnitAnimation( udg_g_unit[17], "slam" )
call QueueUnitAnimationBJ( udg_g_unit[17], "stand" )
call ForGroupBJ( g, function Frostwyrm_Frostmissile_Groupaction )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
// Breath of Frost
function Frostwyrm_Breath_Actions takes nothing returns nothing
local location loc = PolarProjectionBJ(GetUnitLoc(udg_g_unit[17]), 300.00, GetUnitFacing(udg_g_unit[17]))
call IssuePointOrderLocBJ( udg_g_unit[17], "breathoffrost", loc )
call RemoveLocation(loc)
set loc = null
endfunction
// Blizzard
function Frostwyrm_Blizzard_Cond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[17])) == true ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == false ) and ( GetUnitTypeId(GetFilterUnit()) != 'u002' ) and ( GetOwningPlayer(GetFilterUnit()) != Player(2) ) ) then
return true
endif
return false
endfunction
function Frostwyrm_Blizzard_Actions takes nothing returns nothing
local location loc = GetUnitLoc(udg_g_unit[17])
local group g = GetUnitsInRangeOfLocMatching(750.00, loc, Condition(function Frostwyrm_Blizzard_Cond))
set loc = GetUnitLoc(GroupPickRandomUnit(g))
call CreateNUnitsAtLoc( 1, 'u000', Player(3), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A03R', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A03M', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A03R', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
call UnitApplyTimedLifeBJ( GetRandomReal(5.00, 20.00), 'BTLF', GetLastCreatedUnit() )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "blizzard", loc )
if ( BossDisengage(udg_g_unit[17]) ) then
call Trig_Frostwyrm_Disengage()
endif
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
// Engage
function Trig_Frostwyrm_Engage_Conditions takes nothing returns boolean
if ( GetAttackedUnitBJ() == udg_g_unit[17] ) then
return true
endif
return false
endfunction
function Trig_Frostwyrm_Engage_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call TimerStart( udg_g_timer[6], 10.00, true, function Frostwyrm_Breath_Actions )
call TimerStart( udg_g_timer[7], 15.00, true, function Frostwyrm_Frostmissile_Actions )
call TimerStart( udg_g_timer[8], 4.00, true, function Frostwyrm_Blizzard_Actions )
endfunction
//===========================================================================
function InitTrig_Frostwyrm_Engage takes nothing returns nothing
set gg_trg_Frostwyrm_Engage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frostwyrm_Engage, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Frostwyrm_Engage, Condition( function Trig_Frostwyrm_Engage_Conditions ) )
call TriggerAddAction( gg_trg_Frostwyrm_Engage, function Trig_Frostwyrm_Engage_Actions )
endfunction
function Trig_Frostwyrm_Breath_Cast_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A03Q' ) then
return true
endif
return false
endfunction
function Trig_Frostwyrm_Breath_Groupcond takes nothing returns boolean
return ( UnitHasBuffBJ(GetFilterUnit(), 'BCbf') == true )
endfunction
function Trig_Frostwyrm_Breath_Groupaction takes nothing returns nothing
local location loc = GetUnitLoc(GetEnumUnit())
call UnitRemoveBuffBJ( 'BCbf', GetEnumUnit() )
call CreateNUnitsAtLoc( 1, 'u000', Player(0), loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A03P', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A03P', GetLastCreatedUnit(), ( udg_DfficultyMode + 1 ) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "entanglingroots", GetEnumUnit() )
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Frostwyrm_Breath_Cast_Actions takes nothing returns nothing
local group g
call TriggerSleepAction( 0.30 )
set g = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Frostwyrm_Breath_Groupcond))
call ForGroupBJ( g, function Trig_Frostwyrm_Breath_Groupaction )
if ( BossDisengage(udg_g_unit[17]) ) then
call Trig_Frostwyrm_Disengage()
endif
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Frostwyrm_Breath_Cast takes nothing returns nothing
set gg_trg_Frostwyrm_Breath_Cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frostwyrm_Breath_Cast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Frostwyrm_Breath_Cast, Condition( function Trig_Frostwyrm_Breath_Cast_Conditions ) )
call TriggerAddAction( gg_trg_Frostwyrm_Breath_Cast, function Trig_Frostwyrm_Breath_Cast_Actions )
endfunction
function Trig_Warlock_Spawn_Actions takes nothing returns nothing
local location loc = Location(6900.00, 800.00)
local integer i = udg_g_integer[2]
call DisplayTimedTextToForce( GetPlayersAll(), 15, "|cff0000ffBoss|r - Eredar Warlock" )
call DisplayTimedTextToForce( GetPlayersAll(), 15, "Special: Shadow Shock, Drain Life, Impending Doom, Dark Portal" )
call MultiboardSetTitleText( udg_Multiboard, ( "BEER BEER - Boss IV - " + udg_g_string[1] ) )
call CreateNUnitsAtLoc( 1, 'U00C', Player(0), loc, bj_UNIT_FACING )
set udg_g_unit[19] = GetLastCreatedUnit()
set loc = Location(-600.00, 1300.00)
call IssuePointOrderLocBJ( udg_g_unit[19], "attack", loc )
call SetUnitAbilityLevelSwapped( 'A03W', udg_g_unit[19], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A03X', udg_g_unit[19], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A03V', udg_g_unit[19], ( udg_DfficultyMode + 1 ) )
call SetUnitAbilityLevelSwapped( 'A03U', udg_g_unit[19], ( udg_DfficultyMode + 1 ) )
call UnitAddAbilityBJ( 'A021', udg_g_unit[19] )
call SetHeroLevelBJ( udg_g_unit[19], 20, false )
if ( i >= 4 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[19], 12 )
call SetHeroLevelBJ( udg_g_unit[19], 25, false )
endif
if ( i >= 7 ) then
call SetUnitAbilityLevelSwapped( 'A021', udg_g_unit[19], 20 )
call SetHeroLevelBJ( udg_g_unit[19], 30, false )
endif
call SuspendHeroXPBJ( false, udg_g_unit[19] )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Warlock_Spawn takes nothing returns nothing
set gg_trg_Warlock_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Warlock_Spawn, function Trig_Warlock_Spawn_Actions )
endfunction
// Disengage
function Trig_Warlock_Disengage takes nothing returns nothing
local location loc = Location(-600.00, 1300.00)
call PauseTimerBJ( true, udg_g_timer[10] )
call PauseTimerBJ( true, udg_g_timer[11] )
call PauseTimerBJ( true, udg_g_timer[12] )
call IssuePointOrderLocBJ( udg_g_unit[19], "attack", loc )
call EnableTrigger( gg_trg_Warlock_Engage )
call RemoveLocation(loc)
set loc = null
endfunction
// Allgemeine Conditions für Spell-Unitgroups
function Warlock_Group_Cond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[19])) == true ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == false ) ) then
return true
endif
return false
endfunction
function Warlock_Group_Cond2 takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[19])) == true ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == false ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B00S') == false ) ) then
return true
endif
return false
endfunction
// Impending Doom
function Warlock_ImpendingDoom_Actions takes nothing returns nothing
local unit target = ReturnLowestHpHero(udg_g_unit[19], 750.00)
local group g
local location loc
if ( ( target == null ) or ( UnitHasBuffBJ(target, 'B00S') ) ) then
set loc = GetUnitLoc(udg_g_unit[19])
set g = GetUnitsInRangeOfLocMatching(750.00, loc, Condition(function Warlock_Group_Cond2))
set target = GroupPickRandomUnit(g)
endif
call IssueTargetOrderBJ( udg_g_unit[19], "unholyfrenzy", target )
if ( BossDisengage(udg_g_unit[19]) ) then
call Trig_Warlock_Disengage()
endif
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set target = null
endfunction
// Shadow Shock
function Warlock_Shadowshock_Actions takes nothing returns nothing
local unit target = ReturnHighestHpHero(udg_g_unit[19], 750.00)
local group g
local location loc = GetUnitLoc(udg_g_unit[19])
if ( target == null ) then
set loc = GetUnitLoc(udg_g_unit[19])
set g = GetUnitsInRangeOfLocMatching(750.00, loc, Condition(function Warlock_Group_Cond))
set target = GroupPickRandomUnit(g)
endif
call IssueTargetOrderBJ( udg_g_unit[19], "chainlightning", GroupPickRandomUnit(g) )
if ( BossDisengage(udg_g_unit[19]) ) then
call Trig_Warlock_Disengage()
endif
call DestroyGroup(g)
set g = null
call RemoveLocation(loc)
set loc = null
endfunction
// Dark Portal
function Warlock_Portal_Actions takes nothing returns nothing
call UnitResetCooldown( udg_g_unit[19] )
call IssueImmediateOrderBJ( udg_g_unit[19], "starfall" )
call TimerStart( udg_g_timer[11], 6.00, true, function Warlock_Shadowshock_Actions )
call TimerStart( udg_g_timer[12], 8.00, true, function Warlock_ImpendingDoom_Actions )
endfunction
// Engage
function Trig_Warlock_Engage_Conditions takes nothing returns boolean
if ( GetAttackedUnitBJ() == udg_g_unit[19] ) then
return true
endif
return false
endfunction
function Trig_Warlock_Engage_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call TimerStart( udg_g_timer[10], 20.00, true, function Warlock_Portal_Actions )
call TimerStart( udg_g_timer[11], 4.00, true, function Warlock_Shadowshock_Actions )
call TimerStart( udg_g_timer[12], 6.00, true, function Warlock_ImpendingDoom_Actions )
endfunction
//===========================================================================
function InitTrig_Warlock_Engage takes nothing returns nothing
set gg_trg_Warlock_Engage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Warlock_Engage, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Warlock_Engage, Condition( function Trig_Warlock_Engage_Conditions ) )
call TriggerAddAction( gg_trg_Warlock_Engage, function Trig_Warlock_Engage_Actions )
endfunction
function Trig_Warlock_Impending_Doom_Effect_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A03V' ) then
return true
endif
return false
endfunction
function Warlock_ImpendingDoom_Damage takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(t), 66)
if ( UnitHasBuffBJ(target, 'B00S') ) then
call UnitDamageTargetBJ( udg_g_unit[19], target, (600 + (250 * I2R(udg_DfficultyMode))), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING )
call UnitRemoveBuffBJ( 'B00S', target )
call AddSpecialEffectTargetUnitBJ( "origin", target, "Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl" )
endif
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
set t = null
set target = null
endfunction
function Trig_Warlock_Impending_Doom_Effect_Actions takes nothing returns nothing
local unit target = GetSpellTargetUnit()
local timer t = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 66, target)
call TimerStart( t, (10.00 - I2R(udg_DfficultyMode)), false, function Warlock_ImpendingDoom_Damage )
set target = null
set t = null
endfunction
//===========================================================================
function InitTrig_Warlock_Impending_Doom_Effect takes nothing returns nothing
set gg_trg_Warlock_Impending_Doom_Effect = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Warlock_Impending_Doom_Effect, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Warlock_Impending_Doom_Effect, Condition( function Trig_Warlock_Impending_Doom_Effect_Conditions ) )
call TriggerAddAction( gg_trg_Warlock_Impending_Doom_Effect, function Trig_Warlock_Impending_Doom_Effect_Actions )
endfunction
function Trig_Warlock_Dark_Portal_Effect_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A03X' ) then
return true
endif
return false
endfunction
function Trig_Warlock_Dark_Portal_Effect_Actions takes nothing returns nothing
local location loc
set loc = PolarProjectionBJ(GetUnitLoc(udg_g_unit[19]), GetRandomReal(50.00, 150.00), GetRandomDirectionDeg())
if ( GetRandomInt(1, 5) == 1 ) then
call CreateNUnitsAtLoc( 1, 'n00V', Player(0), loc, bj_UNIT_FACING )
else
call CreateNUnitsAtLoc( 1, 'n00U', Player(0), loc, bj_UNIT_FACING )
endif
set loc = GetUnitLoc(GetLastCreatedUnit())
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl" )
set loc = PolarProjectionBJ(GetUnitLoc(udg_g_unit[19]), GetRandomReal(50.00, 150.00), GetRandomDirectionDeg())
if ( GetRandomInt(1, 5) == 1 ) then
call CreateNUnitsAtLoc( 1, 'n00X', Player(0), loc, bj_UNIT_FACING )
else
call CreateNUnitsAtLoc( 1, 'n00W', Player(0), loc, bj_UNIT_FACING )
endif
set loc = GetUnitLoc(GetLastCreatedUnit())
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl" )
set loc = PolarProjectionBJ(GetUnitLoc(udg_g_unit[19]), GetRandomReal(50.00, 150.00), GetRandomDirectionDeg())
if ( GetRandomInt(1, 5) == 1 ) then
call CreateNUnitsAtLoc( 1, 'n00T', Player(0), loc, bj_UNIT_FACING )
else
call CreateNUnitsAtLoc( 1, 'n00S', Player(0), loc, bj_UNIT_FACING )
endif
set loc = GetUnitLoc(GetLastCreatedUnit())
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl" )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Warlock_Dark_Portal_Effect takes nothing returns nothing
set gg_trg_Warlock_Dark_Portal_Effect = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Warlock_Dark_Portal_Effect, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Warlock_Dark_Portal_Effect, Condition( function Trig_Warlock_Dark_Portal_Effect_Conditions ) )
call TriggerAddAction( gg_trg_Warlock_Dark_Portal_Effect, function Trig_Warlock_Dark_Portal_Effect_Actions )
endfunction
function Trig_Warlock_Drain_Life_Effect_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A03U' ) then
return true
endif
return false
endfunction
function Trig_Warlock_Drain_Life_Effect_Heal takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 67)
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(t), 68)
local real damage = I2R(175 + (25 * udg_DfficultyMode * udg_g_integer[2]))
local timer kontrollt = LoadTimerHandle(udg_bierfass, GetHandleId(target), 70)
if ( ( t == kontrollt ) and ( UnitHasBuffBJ(target, 'B00R') ) ) then
call UnitDamageTargetBJ( caster, target, (damage/5), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING )
call SetUnitLifeBJ( caster, ( GetUnitStateSwap(UNIT_STATE_LIFE, caster) + damage ) )
else
call PauseTimer(t)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
set t = null
set kontrollt = null
set caster = null
set target = null
endfunction
function Trig_Warlock_Drain_Life_Effect_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local boolean crit = false
local timer t = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 67, caster)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 68, target)
call SaveBoolean(udg_bierfass, GetHandleId(t), 69, crit)
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 70, t)
call TimerStart(t, 1.00, true, function Trig_Warlock_Drain_Life_Effect_Heal)
call PolledWait(10.00)
if ( UnitHasBuffBJ(target, 'B00R') == false ) then
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 70, null)
endif
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Warlock_Drain_Life_Effect takes nothing returns nothing
set gg_trg_Warlock_Drain_Life_Effect = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Warlock_Drain_Life_Effect, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Warlock_Drain_Life_Effect, Condition( function Trig_Warlock_Drain_Life_Effect_Conditions ) )
call TriggerAddAction( gg_trg_Warlock_Drain_Life_Effect, function Trig_Warlock_Drain_Life_Effect_Actions )
endfunction
function Trig_Succubus_Revive_Reorder_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A044' ) then
return true
endif
return false
endfunction
function Trig_Succubus_Revive_Reorder_Actions takes nothing returns nothing
local location loc = Location(-600.00, 1300.00)
call IssuePointOrderLoc( GetSpellTargetUnit(), "attack", loc )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Succubus_Revive_Reorder takes nothing returns nothing
set gg_trg_Succubus_Revive_Reorder = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Succubus_Revive_Reorder, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Succubus_Revive_Reorder, Condition( function Trig_Succubus_Revive_Reorder_Conditions ) )
call TriggerAddAction( gg_trg_Succubus_Revive_Reorder, function Trig_Succubus_Revive_Reorder_Actions )
endfunction
function Trig_Abolish_Magic_Conditions takes nothing returns boolean
if ( not ( ( GetSpellAbilityId() == 'A019' ) or ( GetSpellAbilityId() == 'A01I' ) or ( GetSpellAbilityId() == 'A01J' ) ) ) then
return false
endif
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetSpellAbilityUnit()), GetOwningPlayer(GetSpellTargetUnit())) == true ) ) then
return false
endif
return true
endfunction
function Trig_Abolish_Magic_Actions takes nothing returns nothing
local real damage
local real scaler
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local boolean crit = true
// Hier: DMG = geburntes Mana
set damage = ( GetRandomReal(1.00, 2.00) * I2R(GetHeroStatBJ(bj_HEROSTAT_INT, caster, false)) )
set scaler = damage / ( 2.00 * I2R(GetHeroStatBJ(bj_HEROSTAT_INT, caster, false)) )
if ( damage >= GetUnitStateSwap(UNIT_STATE_MANA, target) ) then
set damage = GetUnitStateSwap(UNIT_STATE_MANA, target)
else
endif
if ( damage != 0.00 ) then
// DMG wird erhöht, macht 1x mehr Schaden als Mana verbrannt wird.
set damage = 2*damage
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
call SetUnitManaBJ( target, ( GetUnitStateSwap(UNIT_STATE_MANA, target) - damage ) )
call AddSpecialEffectTargetUnitBJ( "origin", target, "Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl" )
else
endif
set target = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Abolish_Magic takes nothing returns nothing
set gg_trg_Abolish_Magic = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Abolish_Magic, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Abolish_Magic, Condition( function Trig_Abolish_Magic_Conditions ) )
call TriggerAddAction( gg_trg_Abolish_Magic, function Trig_Abolish_Magic_Actions )
endfunction
function Trig_Annihilation_Cast_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A07O' ) then
return true
endif
return false
endfunction
function Annihilation_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[50])) == true ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == false ) ) then
return true
endif
return false
endfunction
function Annihilation_Groupaction takes nothing returns nothing
local location loc = GetUnitLoc(GetEnumUnit())
local location loc1 = udg_g_point[4]
local location loc2
local real e = DistanceBetweenPoints(loc, loc1)
local real d = 0.025 * SquareRoot(RAbsBJ(e))
local real w = AngleBetweenPoints(loc, loc1)
local group g = LoadGroupHandle(udg_bierfass, GetHandleId(udg_g_unit[50]), 106)
set loc2 = PolarProjectionBJ(loc, d, w+45)
call SetUnitPositionLoc(GetEnumUnit(), loc2)
if not ( IsUnitInGroup(GetEnumUnit(), g) ) then
call GroupAddUnit(g, GetEnumUnit())
call SetUnitPathing(GetEnumUnit(), false)
call SaveGroupHandle(udg_bierfass, GetHandleId(udg_g_unit[50]), 106, g)
endif
call RemoveLocation(loc)
call RemoveLocation(loc2)
set loc = null
set loc1 = null
set loc2 = null
set g = null
endfunction
function Annihilation_Periodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 103)
local location loc = LoadLocationHandle(udg_bierfass, GetHandleId(t), 104)
local group g
local group totalg = LoadGroupHandle(udg_bierfass, GetHandleId(caster), 106)
set udg_g_unit[50] = caster
set udg_g_point[4] = loc
set g = GetUnitsInRangeOfLocMatching(250, loc, Condition(function Annihilation_Groupcond))
call ForGroup(g, function Annihilation_Groupaction)
set loc = null
set caster = null
set t = null
call DestroyGroup(g)
set g = null
set totalg = null
endfunction
function Trig_Annihilation_Cast_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetSpellTargetLoc()
local unit dummy = CreateUnitAtLoc(GetOwningPlayer(caster), 'u00W', loc, GetRandomReal(0,360))
local timer t = CreateTimer()
local group g = CreateGroup()
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 103, caster)
call SaveLocationHandle(udg_bierfass, GetHandleId(t), 104, loc)
call SaveUnitHandle(udg_bierfass, GetHandleId(caster), 105, dummy)
call SaveGroupHandle(udg_bierfass, GetHandleId(caster), 106, g)
call SaveTimerHandle(udg_bierfass, GetHandleId(caster), 107, t)
call TimerStart(t, 0.01, true, function Annihilation_Periodic)
set loc = null
set caster = null
set dummy = null
set t = null
set g = null
endfunction
//===========================================================================
function InitTrig_Annihilation_Cast takes nothing returns nothing
set gg_trg_Annihilation_Cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Annihilation_Cast, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Annihilation_Cast, Condition( function Trig_Annihilation_Cast_Conditions ) )
call TriggerAddAction( gg_trg_Annihilation_Cast, function Trig_Annihilation_Cast_Actions )
endfunction
function Trig_Annihilation_Cancel_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A07O' ) then
return true
endif
return false
endfunction
function Annihilation_Cancel_Groupaction takes nothing returns nothing
call SetUnitPathing(GetEnumUnit(), true)
endfunction
function Trig_Annihilation_Cancel_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local unit sfx = LoadUnitHandle(udg_bierfass, GetHandleId(u), 105)
local group g = LoadGroupHandle(udg_bierfass, GetHandleId(u), 106)
local timer t = LoadTimerHandle(udg_bierfass, GetHandleId(u), 107)
call ForGroup(g, function Annihilation_Cancel_Groupaction)
call PauseTimer(t)
call KillUnit(sfx)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call SaveTimerHandle(udg_bierfass, GetHandleId(u), 107, null)
call SaveGroupHandle(udg_bierfass, GetHandleId(u), 106, null)
call SaveUnitHandle(udg_bierfass, GetHandleId(u), 105, null)
call DestroyGroup(g)
set sfx = null
set u = null
set t = null
set g = null
endfunction
//===========================================================================
function InitTrig_Annihilation_Cancel takes nothing returns nothing
set gg_trg_Annihilation_Cancel = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Annihilation_Cancel, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_Annihilation_Cancel, Condition( function Trig_Annihilation_Cancel_Conditions ) )
call TriggerAddAction( gg_trg_Annihilation_Cancel, function Trig_Annihilation_Cancel_Actions )
endfunction
function Trig_Annihilation_Finish_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A07O' ) then
return true
endif
return false
endfunction
function Trig_Annihilation_Finish_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[50])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Annihilation_Finish_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[50]
local unit target = GetEnumUnit()
local boolean crit = false
set damage = GetRandomReal(750,1250)
set scaler = damage / 1250
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Annihilation_Finish_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit sfx = LoadUnitHandle(udg_bierfass, GetHandleId(caster), 105)
local location loc = GetUnitLoc(sfx)
local location loc1
local group g
local integer iter = 1
local group timerg = LoadGroupHandle(udg_bierfass, GetHandleId(caster), 106)
local timer t = LoadTimerHandle(udg_bierfass, GetHandleId(caster), 107)
loop
exitwhen iter > 40
set loc1 = PolarProjectionBJ(loc, GetRandomReal(25,225), GetRandomReal(0,360))
call AddSpecialEffectLoc("Abilities\\Spells\\NightElf\\Starfall\\StarfallTarget.mdl", loc1)
set iter = iter + 1
endloop
call PolledWait(0.35)
set udg_g_unit[50] = caster
set g = GetUnitsInRangeOfLocMatching(250.00, loc, Condition(function Trig_Annihilation_Finish_Groupcond))
call ForGroupBJ( g, function Trig_Annihilation_Finish_Groupaction )
call PauseTimer(t)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call SaveTimerHandle(udg_bierfass, GetHandleId(caster), 107, null)
call SaveGroupHandle(udg_bierfass, GetHandleId(caster), 106, null)
call SaveUnitHandle(udg_bierfass, GetHandleId(caster), 105, null)
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc1)
set loc1 = null
call DestroyGroup(g)
set g = null
set caster = null
call KillUnit(sfx)
set sfx = null
call DestroyGroup(timerg)
set timerg = null
set t = null
endfunction
//===========================================================================
function InitTrig_Annihilation_Finish takes nothing returns nothing
set gg_trg_Annihilation_Finish = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Annihilation_Finish, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Annihilation_Finish, Condition( function Trig_Annihilation_Finish_Conditions ) )
call TriggerAddAction( gg_trg_Annihilation_Finish, function Trig_Annihilation_Finish_Actions )
endfunction
function Trig_AoEChannel_Cancel_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A01W' ) or ( GetSpellAbilityId() == 'A02H' ) or ( GetSpellAbilityId() == 'A02G' ) ) then
return true
endif
return false
endfunction
function Trig_AoEChannel_Cancel_Avalanche takes nothing returns nothing
call KillUnit( GetEnumUnit() )
endfunction
function Trig_AoEChannel_Cancel_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local timer aoet = LoadTimerHandle(udg_bierfass, GetHandleId(u), 108)
local location loc = LoadLocationHandle(udg_bierfass, GetHandleId(aoet), 109)
local group g
if ( GetSpellAbilityId() == 'A01W' ) then
set g = GetUnitsOfPlayerAndTypeId(GetOwningPlayer(GetSpellAbilityUnit()), 'u004')
call ForGroupBJ( g, function Trig_AoEChannel_Cancel_Avalanche )
else
endif
call RemoveLocation(loc)
set loc = null
call PauseTimerBJ( true, aoet )
call FlushChildHashtable(udg_bierfass, GetHandleId(aoet))
call SaveTimerHandle(udg_bierfass, GetHandleId(u), 108, null)
call DestroyTimer(aoet)
set aoet = null
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_AoEChannel_Cancel takes nothing returns nothing
set gg_trg_AoEChannel_Cancel = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_AoEChannel_Cancel, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerRegisterAnyUnitEventBJ( gg_trg_AoEChannel_Cancel, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_AoEChannel_Cancel, Condition( function Trig_AoEChannel_Cancel_Conditions ) )
call TriggerAddAction( gg_trg_AoEChannel_Cancel, function Trig_AoEChannel_Cancel_Actions )
endfunction
function Trig_Avalanche_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A01W' ) then
return true
endif
return false
endfunction
function Trig_Avalanche_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[3])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Avalanche_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[3]
local unit target = GetEnumUnit()
local boolean crit = false
set damage = ( GetRandomReal(50.00, 100.00) * GetUnitAbilityLevelSwapped('A01W', caster) )
set scaler = damage / (100.00 * GetUnitAbilityLevelSwapped('A01W', caster) )
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Avalanche_Wave takes nothing returns nothing
local timer aoet = GetExpiredTimer()
local location loc = LoadLocationHandle(udg_bierfass, GetHandleId(aoet), 109)
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(aoet), 110)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(aoet), 111)
local integer waves = LoadInteger(udg_bierfass, GetHandleId(aoet), 112)
local group g
set iter = iter + 1
call SaveInteger(udg_bierfass, GetHandleId(aoet), 111, iter)
set udg_g_unit[3] = caster
set g = GetUnitsInRangeOfLocMatching(200.00, loc, Condition(function Trig_Avalanche_Groupcond))
call ForGroupBJ( g, function Trig_Avalanche_Groupaction )
if ( iter == waves ) then
call PauseTimerBJ( true, aoet )
call FlushChildHashtable(udg_bierfass, GetHandleId(aoet))
call SaveTimerHandle(udg_bierfass, GetHandleId(caster), 108, null)
call DestroyTimer(aoet)
call RemoveLocation(loc)
endif
set loc = null
call DestroyGroup(g)
set g = null
set aoet = null
set caster = null
endfunction
function Trig_Avalanche_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetSpellTargetLoc()
local integer iter = 1
// Anzahl der Wellen - evt levelabhängig!!!
local integer waves = 10
local timer aoet = CreateTimer()
local location loc2
call SaveTimerHandle(udg_bierfass, GetHandleId(caster), 108, aoet)
call SaveLocationHandle(udg_bierfass, GetHandleId(aoet), 109, loc)
call SaveUnitHandle(udg_bierfass, GetHandleId(aoet), 110, caster)
call SaveInteger(udg_bierfass, GetHandleId(aoet), 111, iter)
call SaveInteger(udg_bierfass, GetHandleId(aoet), 112, waves)
call TimerStart(aoet, 1.00, true, function Trig_Avalanche_Wave)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set loc2 = PolarProjectionBJ(loc, GetRandomReal(0, 250.00), GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'u004', GetOwningPlayer(GetSpellAbilityUnit()), loc2, bj_UNIT_FACING )
call SetUnitAnimation( GetLastCreatedUnit(), "stand" )
set bj_forLoopBIndex = 1
set bj_forLoopBIndexEnd = 10
loop
exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
call QueueUnitAnimationBJ( GetLastCreatedUnit(), "stand" )
set bj_forLoopBIndex = bj_forLoopBIndex + 1
endloop
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set loc = null
call RemoveLocation(loc2)
set loc2 = null
set aoet = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Avalanche takes nothing returns nothing
set gg_trg_Avalanche = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Avalanche, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Avalanche, Condition( function Trig_Avalanche_Conditions ) )
call TriggerAddAction( gg_trg_Avalanche, function Trig_Avalanche_Actions )
endfunction
function Trig_Blizzard_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A02H' ) then
return true
endif
return false
endfunction
function Trig_Blizzard_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[5])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Blizzard_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[5]
local unit target
local boolean crit = false
set damage = ( GetRandomReal(0.00, 50.00) + ( 50 * GetUnitAbilityLevelSwapped('A02H', caster) ) )
set scaler = damage / (50.00 + ( 50 * GetUnitAbilityLevelSwapped('A02H', caster) ) )
set target = GetEnumUnit()
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Blizzard_Wave takes nothing returns nothing
local timer aoet = GetExpiredTimer()
local location loc = LoadLocationHandle(udg_bierfass, GetHandleId(aoet), 109)
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(aoet), 110)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(aoet), 111)
local integer waves = LoadInteger(udg_bierfass, GetHandleId(aoet), 112)
local group g
set iter = iter + 1
call SaveInteger(udg_bierfass, GetHandleId(aoet), 111, iter)
set udg_g_unit[5] = caster
set g = GetUnitsInRangeOfLocMatching(200.00, loc, Condition(function Trig_Blizzard_Groupcond))
call ForGroupBJ( g, function Trig_Blizzard_Groupaction )
if ( iter == waves ) then
call PauseTimerBJ( true, aoet )
call FlushChildHashtable(udg_bierfass, GetHandleId(aoet))
call SaveTimerHandle(udg_bierfass, GetHandleId(caster), 108, null)
call DestroyTimer(aoet)
call RemoveLocation(loc)
else
endif
set loc = null
call DestroyGroup(g)
set g = null
set aoet = null
set caster = null
endfunction
function Trig_Blizzard_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetSpellTargetLoc()
local integer iter = 1
// Anzahl der Wellen - evt levelabhängig!!!
local integer waves = 10
local timer aoet = CreateTimer()
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 10, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A02I', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A02I', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A02H', caster) )
call SaveTimerHandle(udg_bierfass, GetHandleId(caster), 108, aoet)
call SaveLocationHandle(udg_bierfass, GetHandleId(aoet), 109, loc)
call SaveUnitHandle(udg_bierfass, GetHandleId(aoet), 110, caster)
call SaveInteger(udg_bierfass, GetHandleId(aoet), 111, iter)
call SaveInteger(udg_bierfass, GetHandleId(aoet), 112, waves)
call TimerStart(aoet, 1.00, true, function Trig_Blizzard_Wave)
set loc = null
set aoet = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Blizzard takes nothing returns nothing
set gg_trg_Blizzard = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Blizzard, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Blizzard, Condition( function Trig_Blizzard_Conditions ) )
call TriggerAddAction( gg_trg_Blizzard, function Trig_Blizzard_Actions )
endfunction
function Trig_Corruption_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A04K' ) then
return true
endif
return false
endfunction
function Trig_Corruption_Tick takes nothing returns nothing
local timer cort = GetExpiredTimer()
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(cort), 114)
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(cort), 115)
local real damage = LoadReal(udg_bierfass, GetHandleId(cort), 116) + GetRandomReal(35,45)
local real scaler
local boolean crit = false
if ( UnitHasBuffBJ(target, 'B012') ) then
set scaler = damage / (LoadReal(udg_bierfass, GetHandleId(cort), 116) + 45)
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
else
call PauseTimer(cort)
call FlushChildHashtable(udg_bierfass, GetHandleId(cort))
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 113, null)
call DestroyTimer(cort)
endif
set cort = null
set target = null
set caster = null
endfunction
function Trig_Corruption_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local timer cort = LoadTimerHandle(udg_bierfass, GetHandleId(target), 113)
local real damage = 15 * GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)
call PauseTimer(cort)
call FlushChildHashtable(udg_bierfass, GetHandleId(cort))
call DestroyTimer(cort)
set cort = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(cort), 114, target)
call SaveUnitHandle(udg_bierfass, GetHandleId(cort), 115, caster)
call SaveReal(udg_bierfass, GetHandleId(cort), 116, damage)
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 113, cort)
call TimerStart(cort, 1.00, true, function Trig_Corruption_Tick)
set cort = null
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Corruption takes nothing returns nothing
set gg_trg_Corruption = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Corruption, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Corruption, Condition( function Trig_Corruption_Conditions ) )
call TriggerAddAction( gg_trg_Corruption, function Trig_Corruption_Actions )
endfunction
function Trig_Corpse_Explosion_Run_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A08H' ) then
return true
endif
return false
endfunction
function Trig_Corpse_Explosion_Run_Corpsecond takes nothing returns boolean
if ( (IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false) and (IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == false) and (IsUnitDeadBJ(GetFilterUnit())) ) then
return true
endif
return false
endfunction
function Trig_Corpse_Explosion_Run_Dmgcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[56])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Corpse_Explosion_Run_Dmgaction takes nothing returns nothing
local real damage = GetRandomReal(udg_g_real[10],udg_g_real[11])
local real scaler
local unit caster = udg_g_unit[56]
local unit target = GetEnumUnit()
local boolean crit = false
set scaler = damage / udg_g_real[11]
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Corpse_Explosion_Run_Corpseaction takes nothing returns nothing
local unit u = GetEnumUnit()
local location loc = GetUnitLoc(u)
call AddSpecialEffectLocBJ( loc, "Objects\\Spawnmodels\\Orc\\OrcLargeDeathExplode\\OrcLargeDeathExplode.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set loc = PolarProjectionBJ(loc, 75.00, GetRandomReal(0,360))
call AddSpecialEffectLocBJ( loc, "Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set loc = PolarProjectionBJ(loc, 75.00, GetRandomReal(0,360))
call AddSpecialEffectLocBJ( loc, "Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveLocation(loc)
set loc = null
call RemoveUnit(u)
set u = null
endfunction
function Trig_Corpse_Explosion_Run_Actions takes nothing returns nothing
local location loc = GetSpellTargetLoc()
local group corpseg = GetUnitsInRangeOfLocMatching(175.00, loc, Condition(function Trig_Corpse_Explosion_Run_Corpsecond))
local real dmgl = 60.00 * I2R(CountUnitsInGroup(corpseg))
local real dmgu = 75.00 * I2R(CountUnitsInGroup(corpseg))
local group dmgg
set udg_g_unit[56] = GetSpellAbilityUnit()
set dmgg = GetUnitsInRangeOfLocMatching(250.00, loc, Condition(function Trig_Corpse_Explosion_Run_Dmgcond))
if (dmgl > 450) then
set dmgl = 450
endif
if (dmgu > 600) then
set dmgu = 600
endif
set udg_g_real[10] = dmgl
set udg_g_real[11] = dmgu
call ForGroupBJ( dmgg, function Trig_Corpse_Explosion_Run_Dmgaction )
call ForGroupBJ( corpseg, function Trig_Corpse_Explosion_Run_Corpseaction )
call DestroyGroup(corpseg)
call DestroyGroup(dmgg)
set corpseg = null
set dmgg = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Corpse_Explosion_Run takes nothing returns nothing
set gg_trg_Corpse_Explosion_Run = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Corpse_Explosion_Run, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Corpse_Explosion_Run, Condition( function Trig_Corpse_Explosion_Run_Conditions ) )
call TriggerAddAction( gg_trg_Corpse_Explosion_Run, function Trig_Corpse_Explosion_Run_Actions )
endfunction
function Trig_Curse_of_Agony_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A04M' ) then
return true
endif
return false
endfunction
function Trig_Curse_of_Agony_Tick takes nothing returns nothing
local timer coat = GetExpiredTimer()
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(coat), 114)
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(coat), 115)
local real dmg = LoadReal(udg_bierfass, GetHandleId(coat), 116)
local real scaler
local boolean crit = false
if ( UnitHasBuffBJ(target, 'B013') ) then
set scaler = GetRandomReal(0.80, 1)
call DamageTargetWithTextMagic(caster, target, dmg, scaler, crit)
else
call PauseTimer(coat)
call FlushChildHashtable(udg_bierfass, GetHandleId(coat))
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 117, null)
call DestroyTimer(coat)
endif
set dmg = dmg + GetRandomReal(20,30)
call SaveReal(udg_bierfass, GetHandleId(coat), 116, dmg)
set coat = null
set target = null
set caster = null
endfunction
function Trig_Curse_of_Agony_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local timer coat = LoadTimerHandle(udg_bierfass, GetHandleId(target), 117)
local real dmg = 10 * GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster) + GetRandomReal(50,60)
call PauseTimer(coat)
call FlushChildHashtable(udg_bierfass, GetHandleId(coat))
call DestroyTimer(coat)
set coat = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(coat), 114, target)
call SaveUnitHandle(udg_bierfass, GetHandleId(coat), 115, caster)
call SaveReal(udg_bierfass, GetHandleId(coat), 116, dmg)
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 117, coat)
call TimerStart(coat, 1.00, true, function Trig_Curse_of_Agony_Tick)
set coat = null
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Curse_of_Agony takes nothing returns nothing
set gg_trg_Curse_of_Agony = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Curse_of_Agony, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Curse_of_Agony, Condition( function Trig_Curse_of_Agony_Conditions ) )
call TriggerAddAction( gg_trg_Curse_of_Agony, function Trig_Curse_of_Agony_Actions )
endfunction
function Trig_Dominate_Demon_Cast_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A04P' ) then
return true
endif
return false
endfunction
function Trig_Dominate_Demon_Cast_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetSpellAbilityUnit())
call SetUnitInvulnerable( GetSpellAbilityUnit(), true )
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(GetSpellAbilityUnit()), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A04Q', GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 5.00, 'BTLF', GetLastCreatedUnit() )
set loc = GetSpellTargetLoc()
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "dreadlordinferno", loc )
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Dominate_Demon_Cast takes nothing returns nothing
set gg_trg_Dominate_Demon_Cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dominate_Demon_Cast, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Dominate_Demon_Cast, Condition( function Trig_Dominate_Demon_Cast_Conditions ) )
call TriggerAddAction( gg_trg_Dominate_Demon_Cast, function Trig_Dominate_Demon_Cast_Actions )
endfunction
function Trig_Infernal_Death_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetDyingUnit()) == 'H00O' ) then
return true
endif
return false
endfunction
function Trig_Infernal_Death_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetDyingUnit())
call ReviveHeroLoc( GetDyingUnit(), loc, false )
call RemoveLocation(loc)
set loc = null
call KillUnit( udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))] )
endfunction
//===========================================================================
function InitTrig_Infernal_Death takes nothing returns nothing
set gg_trg_Infernal_Death = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Infernal_Death, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Infernal_Death, Condition( function Trig_Infernal_Death_Conditions ) )
call TriggerAddAction( gg_trg_Infernal_Death, function Trig_Infernal_Death_Actions )
endfunction
function Trig_Infernal_Enter_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetEnteringUnit()) == 'H00O' ) then
return true
endif
return false
endfunction
function Trig_Infernal_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(GetEnteringUnit())) == true ) ) then
return true
endif
return false
endfunction
function Trig_Infernal_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = GetEnteringUnit()
local unit target = GetEnumUnit()
local boolean crit = false
set damage = GetRandomReal(250.00, 350.00)
set scaler = damage / 350
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Infernal_Updater takes nothing returns nothing
local timer infernalt = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(infernalt), 118)
local unit infernal = LoadUnitHandle(udg_bierfass, GetHandleId(infernalt), 119)
call SetUnitLifePercentBJ( caster, GetUnitLifePercent(infernal) )
call SuspendHeroXPBJ( true, caster )
call SetHeroXP( caster, GetHeroXP(infernal), false )
call SuspendHeroXPBJ( false, caster )
call SetUnitManaPercentBJ( infernal, GetUnitManaPercent(caster) )
set infernalt = null
set caster = null
set infernal = null
endfunction
function Trig_Infernal_Enter_Actions takes nothing returns nothing
local timer infernalt = CreateTimer()
local unit caster = udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))]
local unit infernal = GetEnteringUnit()
local location loc = GetUnitLoc(infernal)
local group g = GetUnitsInRangeOfLocMatching(260.00, loc, Condition(function Trig_Infernal_Groupcond))
set loc = GetUnitLoc(caster)
call SuspendHeroXPBJ( false, caster )
call SetHeroLevelBJ( infernal, GetHeroLevel(caster), false )
call SetHeroXP( infernal, GetHeroXP(caster), false )
call SetUnitLifePercentBJ( infernal, GetUnitLifePercent(caster) )
call SetUnitManaPercentBJ( infernal, GetUnitManaPercent(caster) )
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A04R', GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "banish", caster )
call SaveUnitHandle(udg_bierfass, GetHandleId(infernalt), 118, caster)
call SaveUnitHandle(udg_bierfass, GetHandleId(infernalt), 119, infernal)
call SaveTimerHandle(udg_bierfass, GetHandleId(caster), 120, infernalt)
call SaveUnitHandle(udg_bierfass, GetHandleId(caster), 119, infernal)
call TimerStart(infernalt, 0.50, true, function Trig_Infernal_Updater)
call PolledWait( 1 )
call ForGroupBJ( g, function Trig_Infernal_Groupaction )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set caster = null
set infernal = null
endfunction
//===========================================================================
function InitTrig_Infernal_Enter takes nothing returns nothing
set gg_trg_Infernal_Enter = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Infernal_Enter, GetPlayableMapRect() )
call TriggerAddCondition( gg_trg_Infernal_Enter, Condition( function Trig_Infernal_Enter_Conditions ) )
call TriggerAddAction( gg_trg_Infernal_Enter, function Trig_Infernal_Enter_Actions )
endfunction
function Trig_Infernal_Devour_Magic_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A07Y' ) then
return true
endif
return false
endfunction
function Trig_Infernal_Devour_Magic_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[53])) == true ) and ( GetUnitState(GetFilterUnit(), UNIT_STATE_MANA) >= 5.00 ) ) then
return true
endif
return false
endfunction
function Trig_Infernal_Devour_Magic_Groupaction takes nothing returns nothing
local unit target = GetEnumUnit()
local location loc = GetUnitLoc(target)
local unit dummy = CreateUnitAtLoc(GetOwningPlayer(udg_g_unit[53]), 'u000', loc, 0.00 )
local real mana = GetUnitState(target, UNIT_STATE_MANA)
local real manadrain = GetRandomReal(100.00, 150.00)
if ( manadrain > mana ) then
set manadrain = mana
endif
call AddSpecialEffectTargetUnitBJ( "chest", target, "Abilities\\Spells\\NightElf\\ManaBurn\\ManaBurnTarget.mdl" )
call DestroyEffect(GetLastCreatedEffectBJ())
call SetUnitManaBJ(target, mana - manadrain)
call SaveReal(udg_bierfass, GetHandleId(dummy), 208, manadrain)
call UnitAddAbilityBJ( 'A07Z', dummy )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', dummy )
call IssueTargetOrderBJ( dummy, "shadowstrike", udg_g_unit[53] )
set target = null
set dummy = null
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Infernal_Devour_Magic_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetUnitLoc(caster)
local group g
set udg_g_unit[53] = caster
set g = GetUnitsInRangeOfLocMatching(500.00, loc, Condition(function Trig_Infernal_Devour_Magic_Groupcond))
call ForGroupBJ( g, function Trig_Infernal_Devour_Magic_Groupaction )
call DestroyGroup(g)
set g = null
call RemoveLocation(loc)
set loc = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Infernal_Devour_Magic takes nothing returns nothing
set gg_trg_Infernal_Devour_Magic = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Infernal_Devour_Magic, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Infernal_Devour_Magic, Condition( function Trig_Infernal_Devour_Magic_Conditions ) )
call TriggerAddAction( gg_trg_Infernal_Devour_Magic, function Trig_Infernal_Devour_Magic_Actions )
endfunction
function Trig_Infernal_Devour_Magic_Heal_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A07Z' ) then
return true
endif
return false
endfunction
function Trig_Infernal_Devour_Magic_Heal_Actions takes nothing returns nothing
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local location loc = GetUnitLoc(target)
local location loc1 = GetUnitLoc(caster)
local real heal = LoadReal(udg_bierfass, GetHandleId(caster), 208)
local real scaler = GetRandomReal(0.80, 1.00)
local boolean crit = false
call HealTargetWithTextMagic(caster, target, heal, scaler, crit)
call FlushChildHashtable(udg_bierfass, GetHandleId(caster))
set target = null
set caster = null
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc1)
set loc1 = null
endfunction
//===========================================================================
function InitTrig_Infernal_Devour_Magic_Heal takes nothing returns nothing
set gg_trg_Infernal_Devour_Magic_Heal = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Infernal_Devour_Magic_Heal, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Infernal_Devour_Magic_Heal, Condition( function Trig_Infernal_Devour_Magic_Heal_Conditions ) )
call TriggerAddAction( gg_trg_Infernal_Devour_Magic_Heal, function Trig_Infernal_Devour_Magic_Heal_Actions )
endfunction
function Trig_Dominate_Demon_Spelllende_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A04P' ) then
return true
endif
return false
endfunction
function Trig_Dominate_Demon_Spelllende_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit infernal = LoadUnitHandle(udg_bierfass, GetHandleId(caster), 119)
local timer infernalt = LoadTimerHandle(udg_bierfass, GetHandleId(caster), 120)
call PauseTimer(infernalt)
call FlushChildHashtable(udg_bierfass, GetHandleId(infernalt))
call DestroyTimer(infernalt)
set infernalt = null
call SaveUnitHandle(udg_bierfass, GetHandleId(caster), 119, null)
call SaveTimerHandle(udg_bierfass, GetHandleId(caster), 120, null)
call SetUnitLifePercentBJ( caster, GetUnitLifePercent(infernal) )
call SuspendHeroXPBJ( true, caster )
call SetHeroXP( caster, GetHeroXP(infernal), false )
call UnitRemoveBuffBJ( 'B015', caster )
call SetUnitInvulnerable( caster, false )
set caster = null
call SetUnitOwner( infernal, Player(PLAYER_NEUTRAL_PASSIVE), false )
call SuspendHeroXPBJ( false, infernal )
call UnitAddAbilityBJ( 'Aloc', infernal )
call SetUnitInvulnerable( infernal, true )
call SetUnitAnimation( infernal, "death" )
call PolledWait( 5 )
call RemoveUnit( infernal )
set infernal = null
endfunction
//===========================================================================
function InitTrig_Dominate_Demon_Spelllende takes nothing returns nothing
set gg_trg_Dominate_Demon_Spelllende = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dominate_Demon_Spelllende, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dominate_Demon_Spelllende, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Dominate_Demon_Spelllende, Condition( function Trig_Dominate_Demon_Spelllende_Conditions ) )
call TriggerAddAction( gg_trg_Dominate_Demon_Spelllende, function Trig_Dominate_Demon_Spelllende_Actions )
endfunction
function Trig_Fear_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A04G' ) or ( GetSpellAbilityId() == 'A04H' ) ) then
return true
endif
return false
endfunction
function Trig_Fear_Move takes nothing returns nothing
local timer feart = GetExpiredTimer()
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(feart), 122)
local location loc
if ( UnitHasBuffBJ(target, 'B011') ) then
set loc = PolarProjectionBJ(GetUnitLoc(target), 500, GetRandomDirectionDeg())
call IssuePointOrderLocBJ( target, "move", loc )
call RemoveLocation(loc)
else
set loc = Location(6900.00, 800.00)
call IssuePointOrderLocBJ( target, "attack", loc)
call PauseTimer(feart)
call FlushChildHashtable(udg_bierfass, GetHandleId(feart))
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 121, null)
call DestroyTimer(feart)
endif
set feart = null
set target = null
set loc = null
endfunction
function Trig_Fear_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local timer feart = LoadTimerHandle(udg_bierfass, GetHandleId(target), 121)
call PauseTimer(feart)
call FlushChildHashtable(udg_bierfass, GetHandleId(feart))
call DestroyTimer(feart)
set feart = CreateTimer()
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 121, feart)
call SaveUnitHandle(udg_bierfass, GetHandleId(feart), 122, target)
call TimerStart(feart, 0.50, true, function Trig_Fear_Move)
set feart = null
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Fear takes nothing returns nothing
set gg_trg_Fear = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Fear, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Fear, Condition( function Trig_Fear_Conditions ) )
call TriggerAddAction( gg_trg_Fear, function Trig_Fear_Actions )
endfunction
function Trig_AoE_Fear_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A04I' ) or ( GetSpellAbilityId() == 'A08I' ) ) then
return true
endif
return false
endfunction
function Trig_AoE_Fear_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(GetSpellAbilityUnit())) ) ) then
return true
endif
return false
endfunction
function Trig_AoE_Fear_Groupaction takes nothing returns nothing
local location loc = GetUnitLoc(GetEnumUnit())
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(udg_g_unit[25]), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A04H', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A04H', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A04I', udg_g_unit[25]) )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "unholyfrenzy", GetEnumUnit() )
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_AoE_Fear_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetSpellAbilityUnit())
local group g = GetUnitsInRangeOfLocMatching(350.00, loc, Condition(function Trig_AoE_Fear_Groupcond))
set udg_g_unit[25] = GetSpellAbilityUnit()
call ForGroupBJ( g, function Trig_AoE_Fear_Groupaction )
call RemoveLocation(loc)
call DestroyGroup(g)
set g = null
set loc = null
endfunction
//===========================================================================
function InitTrig_AoE_Fear takes nothing returns nothing
set gg_trg_AoE_Fear = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_AoE_Fear, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_AoE_Fear, Condition( function Trig_AoE_Fear_Conditions ) )
call TriggerAddAction( gg_trg_AoE_Fear, function Trig_AoE_Fear_Actions )
endfunction
function Trig_Fireblast_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A01V' ) then
return true
endif
return false
endfunction
function Trig_Fireblast_Damage takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 123)
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(t), 124)
local real damage
local real scaler
local boolean crit = false
local timer kontrollt = LoadTimerHandle(udg_bierfass, GetHandleId(target), 125)
local location loc = GetUnitLoc(target)
local integer lvl = LoadInteger(udg_bierfass, GetHandleId(t), 126)
if ( ( t == kontrollt ) and ( UnitHasBuffBJ(target, 'B007') ) and ( IsUnitAliveBJ(target) ) ) then
set damage = GetRandomReal( (5 * I2R(lvl) - 10 ), ( 10 * I2R(lvl) - 30) )
set scaler = damage / ( 10 * I2R(lvl) - 30)
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
else
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 125, null)
call DestroyTimer(t)
set t = null
endif
call RemoveLocation(loc)
set loc = null
set t = null
set caster = null
set target = null
set kontrollt = null
endfunction
function Trig_Fireblast_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local boolean crit = true
local timer t = CreateTimer()
local integer lvl = GetUnitAbilityLevelSwapped('A01V', caster)
local real damage
local real scaler
local location loc = GetUnitLoc(caster)
local location loc2 = GetUnitLoc(target)
call PolledWait(DistanceBetweenPoints(loc,loc2)/1000)
set damage = GetRandomReal( ( 50.00 + ( 50.00 * I2R(lvl) ) ), ( 100.00 + ( 100.00 * I2R(lvl) ) ) )
set scaler = damage / ( 100.00 + ( 100.00 * I2R(lvl) ) )
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 123, caster)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 124, target)
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 125, t)
call SaveInteger(udg_bierfass, GetHandleId(t), 126, lvl)
call TimerStart(t, 1.00, true, function Trig_Fireblast_Damage)
call PolledWait(10.00)
if ( UnitHasBuffBJ(target, 'B007') == false ) then
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 125, null)
endif
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call RemoveLocation(loc)
call RemoveLocation(loc2)
set loc = null
set loc2 = null
set t = null
set target = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Fireblast takes nothing returns nothing
set gg_trg_Fireblast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Fireblast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Fireblast, Condition( function Trig_Fireblast_Conditions ) )
call TriggerAddAction( gg_trg_Fireblast, function Trig_Fireblast_Actions )
endfunction
function Trig_Fire_Shield_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A04D' ) then
return true
endif
return false
endfunction
function Trig_Fire_Shield_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[23])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Fire_Shield_Groupactions takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[23]
local unit target = GetEnumUnit()
local boolean crit = false
set damage = GetRandomReal((udg_g_integer[6] + 1) * 10, 10 + (udg_g_integer[6] * 15))
set scaler = damage / (10 + (udg_g_integer[6] * 15))
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Fire_Shield_Damage takes nothing returns nothing
local timer fireshieldt = GetExpiredTimer()
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(fireshieldt), 128)
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(fireshieldt), 129)
local location loc = GetUnitLoc(target)
local integer lvl = LoadInteger(udg_bierfass, GetHandleId(fireshieldt), 130)
local group g
if ( UnitHasBuffBJ(target, 'B010') ) then
set udg_g_unit[23] = caster
set udg_g_integer[6] = lvl - 5
set g = GetUnitsInRangeOfLocMatching(150.00, loc, Condition(function Trig_Fire_Shield_Groupcond) )
call ForGroupBJ( g, function Trig_Fire_Shield_Groupactions )
else
call PauseTimer(fireshieldt)
call FlushChildHashtable(udg_bierfass, GetHandleId(fireshieldt))
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 127, null)
call DestroyTimer(fireshieldt)
endif
call RemoveLocation(loc)
set loc = null
set target = null
set fireshieldt = null
set caster = null
call DestroyGroup(g)
set g = null
endfunction
function Trig_Fire_Shield_Actions takes nothing returns nothing
local timer fireshieldt
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local integer lvl = GetUnitAbilityLevelSwapped('A04D', caster)
set fireshieldt = LoadTimerHandle(udg_bierfass, GetHandleId(target), 127)
call PauseTimer(fireshieldt)
call FlushChildHashtable(udg_bierfass, GetHandleId(fireshieldt))
call DestroyTimer(fireshieldt)
set fireshieldt = CreateTimer()
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 127, fireshieldt)
call SaveUnitHandle(udg_bierfass, GetHandleId(fireshieldt), 128, target)
call SaveUnitHandle(udg_bierfass, GetHandleId(fireshieldt), 129, caster)
call SaveInteger(udg_bierfass, GetHandleId(fireshieldt), 130, lvl)
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(GetSpellAbilityUnit()), GetUnitLoc(GetSpellTargetUnit()), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A04E', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A04E', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "innerfire", GetSpellTargetUnit() )
call TimerStart(fireshieldt, 1.00, true, function Trig_Fire_Shield_Damage)
set fireshieldt = null
set target = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Fire_Shield takes nothing returns nothing
set gg_trg_Fire_Shield = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Fire_Shield, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Fire_Shield, Condition( function Trig_Fire_Shield_Conditions ) )
call TriggerAddAction( gg_trg_Fire_Shield, function Trig_Fire_Shield_Actions )
endfunction
function Trig_Frost_Armor_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A04B' ) then
return true
endif
return false
endfunction
function Trig_Frost_Armor_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetSpellTargetUnit())
local unit dummy = CreateUnitAtLoc( GetOwningPlayer(GetSpellAbilityUnit()), 'u000', loc, bj_UNIT_FACING )
call UnitAddAbility( dummy, 'A04C' )
call SetUnitAbilityLevel( dummy, 'A04C', GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) )
call UnitApplyTimedLife( dummy, 'BTLF', 3.00 )
call IssueTargetOrder( dummy, "frostarmor", GetSpellTargetUnit() )
call RemoveLocation(loc)
set loc = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Frost_Armor takes nothing returns nothing
set gg_trg_Frost_Armor = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frost_Armor, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Frost_Armor, Condition( function Trig_Frost_Armor_Conditions ) )
call TriggerAddAction( gg_trg_Frost_Armor, function Trig_Frost_Armor_Actions )
endfunction
function Trig_Frost_Nova_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A02K' ) then
return true
endif
return false
endfunction
function Trig_Frost_Nova_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[6])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Frost_Nova_Groupactions takes nothing returns nothing
local unit caster = udg_g_unit[6]
local unit target = GetEnumUnit()
local location loc = GetUnitLoc(target)
local real damage
local real scaler
local boolean crit = true
set damage = ( GetRandomReal(250, 1000) * GetUnitAbilityLevelSwapped('A02K', caster) )
set scaler = damage / ( 1000 * GetUnitAbilityLevelSwapped('A02K', caster) )
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A02J', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "entanglingroots", target )
call RemoveLocation(loc)
set loc = null
set caster = null
set target = null
endfunction
function Trig_Frost_Nova_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetSpellAbilityUnit())
local location loc2
local group g
local unit caster = GetSpellAbilityUnit()
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 20
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateNUnitsAtLoc( 1, 'u009', GetOwningPlayer(caster), loc, ( 20.00 * I2R(GetForLoopIndexA()) ) )
set loc2 = PolarProjectionBJ(loc, 350.00, GetUnitFacing(GetLastCreatedUnit()))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attackground", loc2 )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 0.20 )
set udg_g_unit[6] = caster
set g = GetUnitsInRangeOfLocMatching(350.00, loc, Condition(function Trig_Frost_Nova_Groupcond))
call ForGroupBJ( g, function Trig_Frost_Nova_Groupactions )
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
call DestroyGroup(g)
set g = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Frost_Nova takes nothing returns nothing
set gg_trg_Frost_Nova = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frost_Nova, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Frost_Nova, Condition( function Trig_Frost_Nova_Conditions ) )
call TriggerAddAction( gg_trg_Frost_Nova, function Trig_Frost_Nova_Actions )
endfunction
function Trig_Frost_Shock_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A02L' ) then
return true
endif
return false
endfunction
function Trig_Frost_Shock_Actions takes nothing returns nothing
local real damage
local real scaler
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local boolean crit = true
set damage = GetRandomReal( ( 50 + ( ( GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster) - 3 ) * 100 ) ), ( 400 + ( GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster) * 50 ) ))
set scaler = damage / ( 400 + ( GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster) * 50 ) )
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set target = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Frost_Shock takes nothing returns nothing
set gg_trg_Frost_Shock = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frost_Shock, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Frost_Shock, Condition( function Trig_Frost_Shock_Conditions ) )
call TriggerAddAction( gg_trg_Frost_Shock, function Trig_Frost_Shock_Actions )
endfunction
function Trig_Heal_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A016' ) or ( GetSpellAbilityId() == 'A05M' ) or ( GetSpellAbilityId() == 'A04V' ) or ( GetSpellAbilityId() == 'A052' ) )then
return true
endif
return false
endfunction
function Trig_Heal_Actions takes nothing returns nothing
local real heal
local real scaler
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local boolean crit = true
if ( ( GetSpellAbilityId() == 'A05M' ) or ( GetSpellAbilityId() == 'A052' ) ) then
set heal = ( GetRandomReal(0.00, 100.00) + ( 50 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)) ) )
set scaler = heal / ( 100 + ( 50 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)) ) )
else
set heal = ( GetRandomReal(15.00, 40.00) + ( 35 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)) ) )
set scaler = heal / ( 40 + ( 35 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)) ) )
endif
call HealTargetWithTextMagic(caster, target, heal, scaler, crit)
set target = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Heal takes nothing returns nothing
set gg_trg_Heal = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Heal, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Heal, Condition( function Trig_Heal_Conditions ) )
call TriggerAddAction( gg_trg_Heal, function Trig_Heal_Actions )
endfunction
function Trig_Hellfire_Cancel_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A04N' ) then
return true
endif
return false
endfunction
function Trig_Hellfire_Cancel_Actions takes nothing returns nothing
local timer hellft = LoadTimerHandle(udg_bierfass, GetHandleId(GetSpellAbilityUnit()), 131)
call PauseTimer(hellft)
call FlushChildHashtable(udg_bierfass, GetHandleId(hellft))
call SaveTimerHandle(udg_bierfass, GetHandleId(GetSpellAbilityUnit()), 131, null)
call DestroyTimer(hellft)
set hellft = null
endfunction
//===========================================================================
function InitTrig_Hellfire_Cancel takes nothing returns nothing
set gg_trg_Hellfire_Cancel = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hellfire_Cancel, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hellfire_Cancel, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Hellfire_Cancel, Condition( function Trig_Hellfire_Cancel_Conditions ) )
call TriggerAddAction( gg_trg_Hellfire_Cancel, function Trig_Hellfire_Cancel_Actions )
endfunction
function Trig_Hellfire_Cast_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A04N' ) then
return true
endif
return false
endfunction
function Trig_Hellfire_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[24])) ) ) then
return true
endif
return false
endfunction
function Trig_Hellfire_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[24]
local unit target = GetEnumUnit()
local boolean crit = false
set damage = GetRandomReal((50+(150*GetUnitAbilityLevelSwapped('A04N', caster))),(100+(200*GetUnitAbilityLevelSwapped('A04N', caster))))
set scaler = damage / (100+(200*GetUnitAbilityLevelSwapped('A04N', caster)))
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set target = null
set caster = null
endfunction
function Trig_Hellfire_Wave takes nothing returns nothing
local timer hellft = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(hellft), 132)
local location loc = GetUnitLoc(caster)
local group g = GetUnitsInRangeOfLocMatching(250.00, loc, Condition(function Trig_Hellfire_Groupcond))
local real damage = 0.25 * GetRandomReal((50+(150*GetUnitAbilityLevelSwapped('A04N', caster))),(100+(200*GetUnitAbilityLevelSwapped('A04N', caster))))
local real scaler = 4*damage / (100+(200*GetUnitAbilityLevelSwapped('A04N', caster)))
local boolean crit = false
set udg_g_unit[24] = caster
call ForGroupBJ( g, function Trig_Hellfire_Groupaction )
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl" )
call DamageTargetWithTextMagic(caster, caster, damage, scaler, crit)
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set caster = null
set hellft = null
endfunction
function Trig_Hellfire_Cast_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetUnitLoc(caster)
local timer hellft = CreateTimer()
local group g = GetUnitsInRangeOfLocMatching(250.00, loc, Condition(function Trig_Hellfire_Groupcond))
set udg_g_unit[24] = caster
call ForGroupBJ( g, function Trig_Hellfire_Groupaction )
call SaveUnitHandle(udg_bierfass, GetHandleId(hellft), 132, caster)
call SaveTimerHandle(udg_bierfass, GetHandleId(caster), 131, hellft)
call TimerStart(hellft, 1.00, true, function Trig_Hellfire_Wave)
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set caster = null
set hellft = null
endfunction
//===========================================================================
function InitTrig_Hellfire_Cast takes nothing returns nothing
set gg_trg_Hellfire_Cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hellfire_Cast, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Hellfire_Cast, Condition( function Trig_Hellfire_Cast_Conditions ) )
call TriggerAddAction( gg_trg_Hellfire_Cast, function Trig_Hellfire_Cast_Actions )
endfunction
function Trig_Holy_Fire_Init_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A07K' ) or ( GetSpellAbilityId() == 'A07L' ) ) then
return true
endif
return false
endfunction
function SpawnExplosion_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[48])) == true ) ) then
return true
endif
return false
endfunction
function SpawnExplosion_Damage takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[48]
local unit target = GetEnumUnit()
local boolean crit = true
local group kontrollgruppe = LoadGroupHandle(udg_bierfass, GetHandleId(caster), 138)
local integer lvl = udg_g_integer[14]
if not ( IsUnitInGroup(target, kontrollgruppe) ) then
set damage = GetRandomReal((150+100*lvl), (50+250*lvl))
set scaler = damage / (50 + 250*lvl)
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
call GroupAddUnit(kontrollgruppe, target)
endif
set caster = null
set target = null
set kontrollgruppe = null
endfunction
function SpawnExplosion takes location loc, unit caster, integer lvl returns nothing
local group g
local effect sfx = AddSpecialEffectLoc( "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", loc)
set udg_g_unit[48] = caster
set udg_g_integer[14] = lvl
set g = GetUnitsInRangeOfLocMatching(175.00, loc, Condition(function SpawnExplosion_Groupcond))
call ForGroup(g, function SpawnExplosion_Damage)
call RemoveLocation(loc)
call DestroyGroup(g)
set loc = null
set caster = null
set sfx = null
set g = null
endfunction
function Holy_Fire_Periodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 135)
local unit sfx = LoadUnitHandle(udg_bierfass, GetHandleId(t), 136)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 133) + 1
local real face = GetUnitFacing(sfx)
local location loc = GetUnitLoc(sfx)
local location target
local real range = LoadReal(udg_bierfass, GetHandleId(t), 137)
local integer lvl = LoadInteger(udg_bierfass, GetHandleId(t), 134)
call SaveInteger(udg_bierfass, GetHandleId(t), 133, iter)
if ( iter == 87 ) then
set target = PolarProjectionBJ(loc, range, face - 15 )
call SpawnExplosion(target, caster, lvl)
endif
if ( iter == 90 ) then
set target = PolarProjectionBJ(loc, range, face )
call SpawnExplosion(target, caster, lvl)
endif
if ( iter == 93 ) then
set target = PolarProjectionBJ(loc, range, face + 15 )
call SpawnExplosion(target, caster, lvl)
endif
if ( iter == 96 ) then
set target = PolarProjectionBJ(loc, range, face + 30 )
call SpawnExplosion(target, caster, lvl)
call PauseTimer(t)
call TimerStart( t, 3.08, true, function Holy_Fire_Periodic )
endif
if ( iter == 97 ) then
call RemoveUnit(sfx)
call PauseTimer(t)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call DestroyGroup(LoadGroupHandle(udg_bierfass, GetHandleId(caster), 138))
call SaveGroupHandle(udg_bierfass, GetHandleId(caster), 138, null)
endif
call RemoveLocation(loc)
call RemoveLocation(target)
set loc = null
set target = null
set t = null
set caster = null
set sfx = null
endfunction
function Trig_Holy_Fire_Init_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc1 = GetUnitLoc(caster)
local location loc2 = GetSpellTargetLoc()
local unit dummy = CreateUnitAtLoc(GetOwningPlayer(caster), 'u00V', loc1, AngleBetweenPoints(loc1, loc2))
local real range = DistanceBetweenPoints(loc1, loc2)
local real timerinterval = 0.02
local timer t = CreateTimer()
local integer iter = 0
local group g = CreateGroup()
local integer lvl = GetUnitAbilityLevel(caster, GetSpellAbilityId())
call SaveInteger(udg_bierfass, GetHandleId(t), 133, iter)
call SaveInteger(udg_bierfass, GetHandleId(t), 134, lvl)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 135, caster)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 136, dummy)
call SaveReal(udg_bierfass, GetHandleId(t), 137, range)
call SaveGroupHandle(udg_bierfass, GetHandleId(caster), 138, g)
call TimerStart( t, timerinterval, true, function Holy_Fire_Periodic )
call RemoveLocation(loc1)
call RemoveLocation(loc2)
set loc1 = null
set loc2 = null
set caster = null
set dummy = null
set g = null
set t = null
endfunction
//===========================================================================
function InitTrig_Holy_Fire_Init takes nothing returns nothing
set gg_trg_Holy_Fire_Init = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Holy_Fire_Init, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Holy_Fire_Init, Condition( function Trig_Holy_Fire_Init_Conditions ) )
call TriggerAddAction( gg_trg_Holy_Fire_Init, function Trig_Holy_Fire_Init_Actions )
endfunction
function Trig_Inferno_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A02M' ) then
return true
endif
return false
endfunction
function Trig_Inferno_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[7])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Inferno_Groupcond2 takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[7])) == true ) and ( IsUnitInGroup(GetFilterUnit(), udg_g_group[1]) == false ) ) then
return true
endif
return false
endfunction
function Trig_Inferno_Groupaction takes nothing returns nothing
local unit caster = udg_g_unit[7]
local unit target = GetEnumUnit()
local real damage
local real scaler
local boolean crit = false
set damage = ( GetRandomReal(750.00, 1500.00) * GetUnitAbilityLevelSwapped('A02M', caster) )
set scaler = damage / (1500.00 * GetUnitAbilityLevelSwapped('A02M', caster) )
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Inferno_Groupaction2 takes nothing returns nothing
local unit caster = udg_g_unit[7]
local unit target = GetEnumUnit()
local real damage
local real scaler
local boolean crit = false
set damage = ( GetRandomReal(500.00, 1000.00) * GetUnitAbilityLevelSwapped('A02M', caster) )
set scaler = damage / (1000.00 * GetUnitAbilityLevelSwapped('A02M', caster) )
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Inferno_Actions takes nothing returns nothing
local location loc
local location loc2 = GetUnitLoc(GetSpellAbilityUnit())
local group g
local group g2
set udg_g_unit[7] = GetSpellAbilityUnit()
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 4
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set loc = PolarProjectionBJ(GetUnitLoc(GetSpellAbilityUnit()), 150.00, ( I2R(GetForLoopIndexA()) * 90.00 ))
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl" )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 0.40 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 8
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set loc = PolarProjectionBJ(GetUnitLoc(GetSpellAbilityUnit()), 250.00, ( I2R(GetForLoopIndexA()) * 45.00 ))
call AddSpecialEffectLocBJ( loc, "Objects\\Spawnmodels\\Human\\SmallFlameSpawn\\SmallFlameSpawn.mdl" )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set g = GetUnitsInRangeOfLocMatching(250.00, loc2, Condition(function Trig_Inferno_Groupcond))
call ForGroupBJ( g, function Trig_Inferno_Groupaction )
set udg_g_group[1] = g
set g2 = GetUnitsInRangeOfLocMatching(350.00, loc2, Condition(function Trig_Inferno_Groupcond2))
call ForGroupBJ( g2, function Trig_Inferno_Groupaction2 )
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
call DestroyGroup(g)
set g = null
call DestroyGroup(g)
set g2= null
endfunction
//===========================================================================
function InitTrig_Inferno takes nothing returns nothing
set gg_trg_Inferno = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Inferno, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Inferno, Condition( function Trig_Inferno_Conditions ) )
call TriggerAddAction( gg_trg_Inferno, function Trig_Inferno_Actions )
endfunction
function Trig_Lay_on_Hands_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A01K' ) then
return true
endif
return false
endfunction
function Trig_Lay_on_Hands_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true ) and ( IsPlayerAlly(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[1])) == true ) and not( UnitHasBuffBJ(GetFilterUnit(), 'B004') ) and not( UnitHasBuffBJ(GetFilterUnit(), 'B015') ) ) then
return true
endif
return false
endfunction
function Trig_Lay_on_Hands_Groupact takes nothing returns nothing
local real heal
local real scaler
local unit caster = udg_g_unit[1]
local unit target = GetEnumUnit()
local boolean crit = true
set heal = ( 200 + ( GetRandomReal(3.00, 5.00) * I2R(GetHeroStatBJ(bj_HEROSTAT_INT, udg_g_unit[1], true)) ) )
set scaler = heal / ( 200 + ( 5 * I2R(GetHeroStatBJ(bj_HEROSTAT_INT, udg_g_unit[1], true)) ) )
call HealTargetWithTextMagic(caster, target, heal, scaler, crit)
call AddSpecialEffectTargetUnitBJ( "origin", target, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
set caster = null
set target = null
endfunction
function Trig_Lay_on_Hands_Actions takes nothing returns nothing
local group g
set udg_g_unit[1] = GetSpellAbilityUnit()
set g = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Lay_on_Hands_Groupcond))
call ForGroupBJ( g, function Trig_Lay_on_Hands_Groupact )
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Lay_on_Hands takes nothing returns nothing
set gg_trg_Lay_on_Hands = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Lay_on_Hands, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Lay_on_Hands, Condition( function Trig_Lay_on_Hands_Conditions ) )
call TriggerAddAction( gg_trg_Lay_on_Hands, function Trig_Lay_on_Hands_Actions )
endfunction
function Trig_Lightning_Shock_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A015' ) or ( GetSpellAbilityId() == 'A01M' ) ) then
return true
endif
return false
endfunction
function Trig_Lightning_Shock_Actions takes nothing returns nothing
local real damage
local real scaler
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local boolean crit = true
set damage = GetRandomReal( ( 50.00 + ( 50.00 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)) ) ), ( 100.00 + ( 100.00 * I2R(GetUnitAbilityLevelSwapped('A015', caster)) ) ) )
set scaler = damage / ( 100.00 + ( 100.00 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)) ) )
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Lightning_Shock takes nothing returns nothing
set gg_trg_Lightning_Shock = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Lightning_Shock, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Lightning_Shock, Condition( function Trig_Lightning_Shock_Conditions ) )
call TriggerAddAction( gg_trg_Lightning_Shock, function Trig_Lightning_Shock_Actions )
endfunction
function Trig_Magic_Shield_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A01G' ) or ( GetSpellAbilityId() == 'A01A' ) or ( GetSpellAbilityId() == 'A07Q' ) ) then
return true
endif
return false
endfunction
function Trig_Magic_Shield_Actions takes nothing returns nothing
local location loc
local unit shield
local real time
set loc = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'u003', GetOwningPlayer(GetSpellAbilityUnit()), loc, bj_UNIT_FACING )
set shield = GetLastCreatedUnit()
call UnitAddAbilityBJ( 'A01B', shield )
call SetUnitAbilityLevelSwapped( 'A01B', shield, GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) )
call UnitApplyTimedLifeBJ( ( 30.00 + ( 0.25 * I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetSpellAbilityUnit(), false)) ) ), 'BTLF', shield )
call TriggerSleepAction( 0.30 )
call SetUnitTimeScalePercent( shield, 0.00 )
set time = (9.00 + ( 0.25 * I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetSpellAbilityUnit(), false)) ) )
if ( time > 60 ) then
set time = 60
endif
call PolledWait( time )
call SetUnitTimeScalePercent( shield, 100.00 )
call RemoveLocation(loc)
set loc = null
set shield = null
endfunction
//===========================================================================
function InitTrig_Magic_Shield takes nothing returns nothing
set gg_trg_Magic_Shield = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Magic_Shield, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Magic_Shield, Condition( function Trig_Magic_Shield_Conditions ) )
call TriggerAddAction( gg_trg_Magic_Shield, function Trig_Magic_Shield_Actions )
endfunction
function Trig_Mind_Control_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A04T' ) then
return true
endif
return false
endfunction
function Trig_Mind_Control_Periodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 139)
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(t), 140)
local lightning sfx = LoadLightningHandle(udg_bierfass, GetHandleId(t), 141)
local player p = LoadPlayerHandle(udg_bierfass, GetHandleId(t), 142)
local location loc = GetUnitLoc(caster)
local location loc1 = GetUnitLoc(target)
if ( ( GetUnitState(target, UNIT_STATE_LIFE) > 0 ) and ( GetUnitState(caster, UNIT_STATE_LIFE) > 0 ) and ( GetUnitAbilityLevel(target, 'B016') > 0 ) and ( DistanceBetweenPoints(loc, loc1) <= 1500 ) ) then
call MoveLightningEx( sfx, true, GetLocationX(loc), GetLocationY(loc), GetLocationZ(loc) + GetUnitFlyHeight(caster) + 50.00, GetLocationX(loc1), GetLocationY(loc1), GetLocationZ(loc1) + GetUnitFlyHeight(target) + 50.00 )
else
call UnitRemoveAbility(target, 'B016')
call DestroyLightning(sfx)
call PauseTimer(t)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call SetUnitOwner( target, p, true )
endif
call RemoveLocation(loc)
call RemoveLocation(loc1)
set loc = null
set loc1 = null
set caster = null
set target = null
set t = null
set sfx = null
set p = null
endfunction
function Trig_Mind_Control_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit caster = udg_HeroID[GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))]
local unit target = GetSpellTargetUnit()
local player p = GetOwningPlayer(target)
local location loc = GetUnitLoc(caster)
local location loc1 = GetUnitLoc(target)
local lightning sfx = AddLightningEx( "MFPB", true, GetLocationX(loc), GetLocationY(loc), GetLocationZ(loc) + GetUnitFlyHeight(caster) + 50.00, GetLocationX(loc1), GetLocationY(loc1), GetLocationZ(loc1) + GetUnitFlyHeight(target) + 50.00 )
call SetLightningColor( sfx, 0.65, 0.20, 0.60, 1.00 )
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 139, caster)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 140, target)
call SaveLightningHandle(udg_bierfass, GetHandleId(t), 141, sfx)
call SavePlayerHandle(udg_bierfass, GetHandleId(t), 142, p)
call SetUnitOwner( target, GetOwningPlayer(caster), true )
call TimerStart(t, 0.01, true, function Trig_Mind_Control_Periodic)
call RemoveLocation(loc)
call RemoveLocation(loc1)
set loc = null
set loc1 = null
set caster = null
set target = null
set t = null
set sfx = null
set p = null
endfunction
//===========================================================================
function InitTrig_Mind_Control takes nothing returns nothing
set gg_trg_Mind_Control = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mind_Control, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Mind_Control, Condition( function Trig_Mind_Control_Conditions ) )
call TriggerAddAction( gg_trg_Mind_Control, function Trig_Mind_Control_Actions )
endfunction
function Trig_Mind_Control_Cast_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A064' ) then
return true
endif
return false
endfunction
function Trig_Mind_Control_Cast_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local location loc = GetUnitLoc(target)
local unit dummy = CreateUnitAtLoc(GetOwningPlayer(caster), 'u000', loc, 0.00)
call UnitAddAbility(dummy, 'A04T')
call UnitApplyTimedLife( dummy, 'BTLF', 3 )
call IssueTargetOrder(dummy, "cripple", target)
call RemoveLocation(loc)
set loc = null
set caster = null
set target = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Mind_Control_Cast takes nothing returns nothing
set gg_trg_Mind_Control_Cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mind_Control_Cast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Mind_Control_Cast, Condition( function Trig_Mind_Control_Cast_Conditions ) )
call TriggerAddAction( gg_trg_Mind_Control_Cast, function Trig_Mind_Control_Cast_Actions )
endfunction
function Trig_Mini_Minion_Detonate_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetDyingUnit()) == 'n00B' ) then
return true
endif
return false
endfunction
function Trig_Mini_Minion_Detonate_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[33])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Mini_Minion_Detonate_Groupaction takes nothing returns nothing
local unit caster = udg_g_unit[33]
local unit target = GetEnumUnit()
local real damage
local real scaler
local boolean crit = false
set damage = GetRandomReal(100.00, 150.00)
set scaler = damage / 150
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Mini_Minion_Detonate_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetDyingUnit())
local group g
set udg_g_unit[33] = GetDyingUnit()
set g = GetUnitsInRangeOfLocMatching(150.00, loc, Condition(function Trig_Mini_Minion_Detonate_Groupcond))
call ForGroupBJ( g, function Trig_Mini_Minion_Detonate_Groupaction )
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl" )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Mini_Minion_Detonate takes nothing returns nothing
set gg_trg_Mini_Minion_Detonate = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mini_Minion_Detonate, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Mini_Minion_Detonate, Condition( function Trig_Mini_Minion_Detonate_Conditions ) )
call TriggerAddAction( gg_trg_Mini_Minion_Detonate, function Trig_Mini_Minion_Detonate_Actions )
endfunction
function Trig_Phase_Conditions takes nothing returns boolean
if ( ( GetUnitTypeId(GetSummonedUnit()) == 'u000' ) and ( GetUnitTypeId(GetSummoningUnit()) == 'H00U' ) ) then
return true
endif
return false
endfunction
//Conditions für Gruppe, die Schaden bekommt
function Trig_Phase_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[51])) ) ) then
return true
endif
return false
endfunction
// Schaden an nahen Units
function Trig_Phase_Damage takes nothing returns nothing
local real damage
local integer lvl = udg_g_integer[15]
local real scaler
local unit caster = udg_g_unit[51]
local unit target = GetEnumUnit()
local boolean crit = false
local location loc = GetUnitLoc(target)
local group kontrollgruppe = LoadGroupHandle(udg_bierfass, GetHandleId(caster), 143)
if not ( IsUnitInGroup(target, kontrollgruppe) ) then
set damage = GetRandomReal((200+75*lvl),(300+50*lvl))
set scaler = damage / (300+50*lvl)
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
call AddSpecialEffectTarget("Abilities\\Spells\\Human\\ManaFlare\\ManaFlareBoltImpact.mdl", target, "origin")
call GroupAddUnit(kontrollgruppe, target)
endif
call RemoveLocation(loc)
set loc = null
set caster = null
set target = null
set kontrollgruppe = null
endfunction
// Bewegung, Fade etc.
function Phase_Dummy_FadeoutDo takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer i = LoadInteger(udg_bierfass, GetHandleId(t), 152)
local unit u = LoadUnitHandle(udg_bierfass, GetHandleId(t), 151)
set i = i - 1
if ( i >= 0 ) then
call SetUnitVertexColorBJ(u, 0, 0, 0, I2R(100-i))
call SaveInteger(udg_bierfass, GetHandleId(t), 152, i)
else
call PauseTimer(t)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call RemoveUnit(u)
endif
set t = null
set u = null
endfunction
function Phase_Dummy_Fadeout takes unit u returns nothing
local timer t = CreateTimer()
local integer i = 100
call SetUnitFlyHeight( u, 0.00, 0.00 )
call SetUnitPathing( u, false )
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 151, u)
call SaveInteger(udg_bierfass, GetHandleId(t), 152, i)
call TimerStart(t, 0.01, true, function Phase_Dummy_FadeoutDo)
set t = null
set u = null
endfunction
function Trig_Phase_ReFade takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(udg_bierfass, GetHandleId(t), 144)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 145) + 1
local real r = R2I(iter)
if ( iter <= 100 ) then
call SetUnitVertexColorBJ(u, r, r, r, 50-r/2)
call SaveInteger(udg_bierfass, GetHandleId(t), 145, iter)
else
call PauseTimer(t)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
set t = null
set u = null
endfunction
function Trig_Phase_Fade takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(udg_bierfass, GetHandleId(t), 144)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 145) + 1
local real r = 100-R2I(iter)
if ( iter <= 100 ) then
call SetUnitVertexColorBJ(u, r, r, r, r/2)
call SaveInteger(udg_bierfass, GetHandleId(t), 145, iter)
else
call PauseTimer(t)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
set t = null
set u = null
endfunction
function Trig_Phase_Move takes nothing returns nothing
local timer t = GetExpiredTimer()
local timer fadet
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 144)
local unit dummy
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 145)
local integer max = LoadInteger(udg_bierfass, GetHandleId(t), 146)
local integer lvl = LoadInteger(udg_bierfass, GetHandleId(t), 147)
local real tempo = LoadReal(udg_bierfass, GetHandleId(t), 148)
local real winkel = LoadReal(udg_bierfass, GetHandleId(t), 149)
local real strecke = LoadReal(udg_bierfass, GetHandleId(t), 150)
local location loc
local group g
local group kontrollg
set udg_g_unit[51] = caster
set udg_g_integer[15] = lvl
set iter = iter + 1
call SaveInteger(udg_bierfass, GetHandleId(t), 145, iter)
if ( (IsUnitAliveBJ(caster)) and (iter<=max) ) then
set loc = PolarProjectionBJ(GetUnitLoc(caster), tempo, winkel )
call SetUnitPositionLoc(caster, loc)
set g = GetUnitsInRangeOfLocMatching(130.00, loc, Condition(function Trig_Phase_Groupcond))
call ForGroupBJ( g, function Trig_Phase_Damage )
if ( I2R(iter)/10 == R2I(iter/10) ) then
set dummy = CreateUnitAtLoc(GetOwningPlayer(caster), 'u00X', loc, winkel)
call SetUnitTimeScalePercent(dummy, 0)
call SetUnitPositionLoc(dummy, loc)
call Phase_Dummy_Fadeout(dummy)
endif
else
set fadet = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(fadet), 144, caster)
call SaveInteger(udg_bierfass, GetHandleId(fadet), 145, 0)
call TimerStart(fadet, 0.01, true, function Trig_Phase_ReFade)
call SetUnitPathing( caster, true )
call SetUnitTimeScale(caster, 1)
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
set kontrollg = LoadGroupHandle(udg_bierfass, GetHandleId(caster), 143)
call SaveGroupHandle(udg_bierfass, GetHandleId(caster), 143, null)
call DestroyGroup(kontrollg)
endif
call RemoveLocation(loc)
set loc = null
set t = null
set fadet = null
set caster = null
set g = null
set dummy = null
set kontrollg = null
endfunction
function Trig_Phase_Actions takes nothing returns nothing
local timer t = CreateTimer()
local timer fadet = CreateTimer()
local unit caster = GetSummoningUnit()
local location loc = GetUnitLoc(caster)
local location loc2 = GetUnitLoc(GetSummonedUnit())
local integer iter = 0
local real strecke = DistanceBetweenPoints(loc, loc2)
local real tempo = 7.50
local real winkel = AngleBetweenPoints(loc, loc2)
local integer max = R2I(strecke/tempo)
local integer lvl = GetUnitAbilityLevel(caster, 'A07P')
local group kontrollgruppe = CreateGroup()
call SetUnitPathing( caster, false )
call SetUnitTimeScale(caster, 0)
call SaveGroupHandle(udg_bierfass, GetHandleId(caster), 143, kontrollgruppe)
call SaveUnitHandle(udg_bierfass, GetHandleId(fadet), 144, caster)
call SaveInteger(udg_bierfass, GetHandleId(fadet), 145, iter)
call TimerStart(fadet, 0.01, true, function Trig_Phase_Fade)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 144, caster)
call SaveInteger(udg_bierfass, GetHandleId(t), 145, iter)
call SaveInteger(udg_bierfass, GetHandleId(t), 146, max)
call SaveInteger(udg_bierfass, GetHandleId(t), 147, lvl)
call SaveReal(udg_bierfass, GetHandleId(t), 148, tempo)
call SaveReal(udg_bierfass, GetHandleId(t), 149, winkel)
call SaveReal(udg_bierfass, GetHandleId(t), 150, strecke)
call TimerStart(t, 0.01, true, function Trig_Phase_Move)
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
set t = null
set fadet = null
set caster = null
set kontrollgruppe = null
endfunction
//===========================================================================
function InitTrig_Phase takes nothing returns nothing
set gg_trg_Phase = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Phase, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Phase, Condition( function Trig_Phase_Conditions ) )
call TriggerAddAction( gg_trg_Phase, function Trig_Phase_Actions )
endfunction
function Trig_Rain_of_Fire_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A02G' ) then
return true
endif
return false
endfunction
function Trig_Rain_of_Fire_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[4])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Rain_of_Fire_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[4]
local unit target = GetEnumUnit()
local boolean crit = false
set damage = ( GetRandomReal(50.00, 100.00) * ( 1 + GetUnitAbilityLevelSwapped('A02G', caster) ) )
set scaler = damage / (100.00 * ( 1 + GetUnitAbilityLevelSwapped('A02G', caster) ) )
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Rain_of_Fire_Wave takes nothing returns nothing
local timer aoet = GetExpiredTimer()
local location loc = LoadLocationHandle(udg_bierfass, GetHandleId(aoet), 109)
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(aoet), 110)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(aoet), 111)
local integer waves = LoadInteger(udg_bierfass, GetHandleId(aoet), 112)
local group g
set iter = iter + 1
call SaveInteger(udg_bierfass, GetHandleId(aoet), 111, iter)
set udg_g_unit[4] = caster
set g = GetUnitsInRangeOfLocMatching(200.00, loc, Condition(function Trig_Rain_of_Fire_Groupcond))
call ForGroupBJ( g, function Trig_Rain_of_Fire_Groupaction )
if ( iter == waves ) then
call PauseTimerBJ( true, aoet )
call FlushChildHashtable(udg_bierfass, GetHandleId(aoet))
call SaveTimerHandle(udg_bierfass, GetHandleId(caster), 108, null)
call DestroyTimer(aoet)
call RemoveLocation(loc)
else
endif
set loc = null
call DestroyGroup(g)
set g = null
set aoet = null
set caster = null
endfunction
function Trig_Rain_of_Fire_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetSpellTargetLoc()
local integer iter = 1
// Anzahl der Wellen - evt levelabhängig!!!
local integer waves = 10
local timer aoet = CreateTimer()
call SaveTimerHandle(udg_bierfass, GetHandleId(caster), 108, aoet)
call SaveLocationHandle(udg_bierfass, GetHandleId(aoet), 109, loc)
call SaveUnitHandle(udg_bierfass, GetHandleId(aoet), 110, caster)
call SaveInteger(udg_bierfass, GetHandleId(aoet), 111, iter)
call SaveInteger(udg_bierfass, GetHandleId(aoet), 112, waves)
call TimerStart(aoet, 1.00, true, function Trig_Rain_of_Fire_Wave)
set loc = null
set aoet = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Rain_of_Fire takes nothing returns nothing
set gg_trg_Rain_of_Fire = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rain_of_Fire, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Rain_of_Fire, Condition( function Trig_Rain_of_Fire_Conditions ) )
call TriggerAddAction( gg_trg_Rain_of_Fire, function Trig_Rain_of_Fire_Actions )
endfunction
function Trig_Renew_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A014' ) or ( GetSpellAbilityId() == 'A01H' ) ) then
return true
endif
return false
endfunction
function Trig_Renew_Heal takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 153)
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(t), 154)
local real heal
local real scaler
local boolean crit = LoadBoolean(udg_bierfass, GetHandleId(t), 155)
local timer kontrollt = LoadTimerHandle(udg_bierfass, GetHandleId(target), 157)
local location loc = GetUnitLoc(target)
local integer lvl = LoadInteger(udg_bierfass, GetHandleId(t), 156)
if ( ( t == kontrollt ) and ( UnitHasBuffBJ(target, 'B005') ) ) then
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A017', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A017', GetLastCreatedUnit(), lvl )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "healingwave", target )
else
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
set t = null
endif
call RemoveLocation(loc)
set loc = null
set t = null
set caster = null
set target = null
set kontrollt = null
endfunction
function Trig_Renew_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local boolean crit = false
local timer t = CreateTimer()
local integer lvl = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)
local real heal
local real scaler
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 153, caster)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 154, target)
call SaveBoolean(udg_bierfass, GetHandleId(t), 155, crit)
call SaveInteger(udg_bierfass, GetHandleId(t), 156, lvl)
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 157, t)
call TimerStart(t, 1.00, true, function Trig_Renew_Heal)
set heal = ( GetRandomReal(1.00, 2.00) * I2R(GetHeroStatBJ(bj_HEROSTAT_INT, caster, false)) )
set scaler = heal / ( 2.00 * I2R(GetHeroStatBJ(bj_HEROSTAT_INT, caster, false)) )
call HealTargetWithTextMagic(caster, target, heal, scaler, crit)
call PolledWait(10.00)
if ( UnitHasBuffBJ(target, 'Brej') == false ) then
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 157, null)
endif
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
set t = null
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Renew takes nothing returns nothing
set gg_trg_Renew = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Renew, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Renew, Condition( function Trig_Renew_Conditions ) )
call TriggerAddAction( gg_trg_Renew, function Trig_Renew_Actions )
endfunction
function Trig_Renew_Dummy_Heal_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A017' ) then
return true
endif
return false
endfunction
function Trig_Renew_Dummy_Heal_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local real heal
local real scaler
local boolean crit = false
set heal = ( 7.5 + ( GetRandomReal(2.5, 7.5) * I2R(GetUnitAbilityLevelSwapped('A017', caster)) ) )
set scaler = heal / ( 7.5 + (7.5 * I2R(GetUnitAbilityLevelSwapped('A017', caster)) ) )
call HealTargetWithTextMagic(caster, target, heal, scaler, crit)
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Renew_Dummy_Heal takes nothing returns nothing
set gg_trg_Renew_Dummy_Heal = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Renew_Dummy_Heal, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Renew_Dummy_Heal, Condition( function Trig_Renew_Dummy_Heal_Conditions ) )
call TriggerAddAction( gg_trg_Renew_Dummy_Heal, function Trig_Renew_Dummy_Heal_Actions )
endfunction
function Trig_Shadow_Shock_Conditions takes nothing returns boolean
if ( (GetSpellAbilityId() == 'A04J') or (GetSpellAbilityId() == 'A04L') ) then
return true
endif
return false
endfunction
function Trig_Shadow_Shock_Actions takes nothing returns nothing
local real damage
local real scaler
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local boolean crit = true
set damage = GetUnitStateSwap(UNIT_STATE_LIFE, target) * (0.10 + (0.04 * GetUnitAbilityLevel(caster, GetSpellAbilityId())))
if ( damage < ( 15*(1+GetUnitAbilityLevel(caster, GetSpellAbilityId())) ) ) then
set damage = GetRandomReal((15*(1+GetUnitAbilityLevel(caster, GetSpellAbilityId()))),(20*(1+GetUnitAbilityLevel(caster, GetSpellAbilityId()))-5))
endif
if ( IsUnitType(GetSpellTargetUnit(), UNIT_TYPE_HERO) ) then
set damage = damage / 6
endif
set scaler = GetRandomReal(0.75,1)
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set target = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Shadow_Shock takes nothing returns nothing
set gg_trg_Shadow_Shock = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shadow_Shock, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shadow_Shock, Condition( function Trig_Shadow_Shock_Conditions ) )
call TriggerAddAction( gg_trg_Shadow_Shock, function Trig_Shadow_Shock_Actions )
endfunction
function Trig_Shadow_Word_Pain_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A04W' ) then
return true
endif
return false
endfunction
function Trig_Shadow_Word_Pain_Tick takes nothing returns nothing
local timer swpt = GetExpiredTimer()
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(swpt), 114)
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(swpt), 115)
local real damage = LoadReal(udg_bierfass, GetHandleId(swpt), 116) + GetRandomReal(0,60)
local real scaler
local boolean crit = false
if ( UnitHasBuffBJ(target, 'B017') ) then
set scaler = damage / (LoadReal(udg_bierfass, GetHandleId(swpt), 116) + 60)
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
else
call PauseTimer(swpt)
call FlushChildHashtable(udg_bierfass, GetHandleId(swpt))
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 158, null)
call DestroyTimer(swpt)
endif
set swpt = null
set target = null
set caster = null
endfunction
function Trig_Shadow_Word_Pain_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local timer swpt = LoadTimerHandle(udg_bierfass, GetHandleId(target), 158)
local real damage = 120 + (60 * GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))
call PauseTimer(swpt)
call FlushChildHashtable(udg_bierfass, GetHandleId(swpt))
call DestroyTimer(swpt)
set swpt = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(swpt), 114, target)
call SaveUnitHandle(udg_bierfass, GetHandleId(swpt), 115, caster)
call SaveReal(udg_bierfass, GetHandleId(swpt), 116, damage)
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 158, swpt)
call TimerStart(swpt, 1.00, true, function Trig_Shadow_Word_Pain_Tick)
set swpt = null
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Shadow_Word_Pain takes nothing returns nothing
set gg_trg_Shadow_Word_Pain = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shadow_Word_Pain, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shadow_Word_Pain, Condition( function Trig_Shadow_Word_Pain_Conditions ) )
call TriggerAddAction( gg_trg_Shadow_Word_Pain, function Trig_Shadow_Word_Pain_Actions )
endfunction
function Trig_Shielding_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A048' ) or ( GetSpellAbilityId() == 'A049' ) ) then
return true
endif
return false
endfunction
function Trig_Shielding_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetSpellTargetUnit())
local unit dummy = CreateUnitAtLoc( GetOwningPlayer(GetSpellAbilityUnit()), 'u000', loc, bj_UNIT_FACING )
call UnitAddAbility( dummy, 'A04A' )
call SetUnitAbilityLevel( dummy, 'A04A', GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) )
call UnitApplyTimedLife( dummy, 'BTLF', 3.00 )
call IssueTargetOrder( dummy, "innerfire", GetSpellTargetUnit() )
call RemoveLocation(loc)
set loc = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Shielding takes nothing returns nothing
set gg_trg_Shielding = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shielding, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shielding, Condition( function Trig_Shielding_Conditions ) )
call TriggerAddAction( gg_trg_Shielding, function Trig_Shielding_Actions )
endfunction
function Trig_Siphon_Life_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A04O' ) then
return true
endif
return false
endfunction
function Trig_Siphon_Life_Tick takes nothing returns nothing
local timer siphont = GetExpiredTimer()
local unit target = LoadUnitHandle(udg_bierfass, GetHandleId(siphont), 114)
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(siphont), 115)
local integer lvl = LoadInteger(udg_bierfass, GetHandleId(siphont), 116)
local real damage = GetRandomReal(((lvl*15)+35),((lvl*20)+40))
local real scaler
local boolean crit = false
if ( UnitHasBuffBJ(target, 'B014') ) then
set scaler = damage / ((lvl*20)+40)
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
call AddSpecialEffectTargetUnitBJ( "origin", caster, "Abilities\\Spells\\Human\\Heal\\HealTarget.mdl" )
call HealTargetWithTextMagic(caster, caster, damage, scaler, crit)
else
call PauseTimer(siphont)
call FlushChildHashtable(udg_bierfass, GetHandleId(siphont))
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 159, null)
call DestroyTimer(siphont)
endif
set siphont = null
set target = null
set caster = null
endfunction
function Trig_Siphon_Life_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local timer siphont = LoadTimerHandle(udg_bierfass, GetHandleId(target), 159)
local integer lvl = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)
call PauseTimer(siphont)
call FlushChildHashtable(udg_bierfass, GetHandleId(siphont))
call DestroyTimer(siphont)
set siphont = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(siphont), 114, target)
call SaveUnitHandle(udg_bierfass, GetHandleId(siphont), 115, caster)
call SaveInteger(udg_bierfass, GetHandleId(siphont), 116, lvl)
call SaveTimerHandle(udg_bierfass, GetHandleId(target), 159, siphont)
call TimerStart(siphont, 1.00, true, function Trig_Siphon_Life_Tick)
set siphont = null
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Siphon_Life takes nothing returns nothing
set gg_trg_Siphon_Life = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Siphon_Life, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Siphon_Life, Condition( function Trig_Siphon_Life_Conditions ) )
call TriggerAddAction( gg_trg_Siphon_Life, function Trig_Siphon_Life_Actions )
endfunction
function Trig_Static_Shock_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A07N' ) then
return true
endif
return false
endfunction
function Trig_Staticshock_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[48])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Staticshock_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[48]
local unit target = GetEnumUnit()
local boolean crit = false
set damage = ( 0.025 * GetUnitAbilityLevel(caster, 'A07N') - 0.025 ) * GetUnitState(target, UNIT_STATE_LIFE)
set scaler = GetRandomReal(0.80, 1.00)
if ( IsUnitType(target, UNIT_TYPE_HERO) ) then
set damage = damage / 6
endif
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
call AddSpecialEffectTarget( "Abilities\\Spells\\Orc\\FeralSpirit\\feralspirittarget.mdl", target, "chest" )
set caster = null
set target = null
endfunction
function Trig_Static_Shock_Actions takes nothing returns nothing
local real damage
local real scaler
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local unit dummy
local location loc = GetUnitLoc(target)
local group g
local boolean crit = true
set damage = GetRandomReal( ( 75.00 + ( 50.00 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)) ) ), ( 0.00 + ( 100.00 * I2R(GetUnitAbilityLevelSwapped('A015', caster)) ) ) )
set scaler = damage / ( 0.00 + ( 100.00 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)) ) )
set udg_g_unit[48] = caster
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
set dummy = CreateUnitAtLoc( GetOwningPlayer(caster), 'u001', loc, 0 )
call UnitAddAbility( dummy, 'A00X' )
call IssueTargetOrderBJ( dummy, "magicleash", target )
call UnitApplyTimedLifeBJ( (1 * GetUnitAbilityLevel(caster, 'A07N')) - 3, 'BTLF', dummy )
set g = GetUnitsInRangeOfLocMatching(150.00, loc, Condition(function Trig_Staticshock_Groupcond))
call GroupRemoveUnit(g, target)
call ForGroupBJ( g, function Trig_Staticshock_Groupaction )
set g = null
call RemoveLocation(loc)
set loc = null
set caster = null
set target = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Static_Shock takes nothing returns nothing
set gg_trg_Static_Shock = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Static_Shock, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Static_Shock, Condition( function Trig_Static_Shock_Conditions ) )
call TriggerAddAction( gg_trg_Static_Shock, function Trig_Static_Shock_Actions )
endfunction
function Trig_Uber_Molyporph_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A01N' ) then
return true
endif
return false
endfunction
function Trig_Uber_Molyporph_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[10])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Uber_Molyporph_Groupaction takes nothing returns nothing
local location loc = GetUnitLoc(GetEnumUnit())
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(udg_g_unit[10]), loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A02P', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "hex", GetEnumUnit() )
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Uber_Molyporph_Actions takes nothing returns nothing
local location loc = GetSpellTargetLoc()
local group g
set udg_g_unit[10] = GetSpellAbilityUnit()
set g = GetUnitsInRangeOfLocMatching(160.00, loc, Condition(function Trig_Uber_Molyporph_Groupcond))
call ForGroupBJ( g, function Trig_Uber_Molyporph_Groupaction )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Uber_Molyporph takes nothing returns nothing
set gg_trg_Uber_Molyporph = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Uber_Molyporph, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Uber_Molyporph, Condition( function Trig_Uber_Molyporph_Conditions ) )
call TriggerAddAction( gg_trg_Uber_Molyporph, function Trig_Uber_Molyporph_Actions )
endfunction
function Trig_Dog_Summon_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A067' ) then
return true
endif
return false
endfunction
function Trig_Dog_Summon_Groupcond takes nothing returns boolean
if ( (GetUnitTypeId(GetFilterUnit()) == 'o00M') or (GetUnitTypeId(GetFilterUnit()) == 'o00L') or (GetUnitTypeId(GetFilterUnit()) == 'o00J') or (GetUnitTypeId(GetFilterUnit()) == 'o00I') or (GetUnitTypeId(GetFilterUnit()) == 'o00H') or (GetUnitTypeId(GetFilterUnit()) == 'o00G') or (GetUnitTypeId(GetFilterUnit()) == 'o00F') or (GetUnitTypeId(GetFilterUnit()) == 'o00E') ) then
return true
endif
return false
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == false )
endfunction
function Trig_Dog_Summon_Groupaction takes nothing returns nothing
local location loc = GetUnitLoc(GetEnumUnit())
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call RemoveUnit( GetEnumUnit() )
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Dog_Summon_Actions takes nothing returns nothing
local location loc = PolarProjectionBJ(GetUnitLoc(GetSpellAbilityUnit()), 150.00, GetUnitFacing(GetSpellAbilityUnit()))
local player p = GetOwningPlayer(GetSpellAbilityUnit())
local group g = GetUnitsOfPlayerMatching(p, Condition(function Trig_Dog_Summon_Groupcond))
local unit wolf
local unit dummy = LoadUnitHandle(udg_bierfass, GetHandleId(p), 160)
call RemoveUnit(dummy)
call ForGroupBJ( g, function Trig_Dog_Summon_Groupaction )
if ( GetUnitAbilityLevelSwapped('A067', GetSpellAbilityUnit()) == 1 ) then
set wolf = CreateUnitAtLoc( p, 'o00E', loc, (GetUnitFacing(GetSpellAbilityUnit())+180) )
endif
if ( GetUnitAbilityLevelSwapped('A067', GetSpellAbilityUnit()) == 2 ) then
set wolf = CreateUnitAtLoc( p, 'o00F', loc, (GetUnitFacing(GetSpellAbilityUnit())+180) )
call SetUnitAbilityLevelSwapped( 'A05A', wolf, 2 )
call SetUnitAbilityLevelSwapped( 'A05D', wolf, 2 )
endif
if ( GetUnitAbilityLevelSwapped('A067', GetSpellAbilityUnit()) == 3 ) then
set wolf = CreateUnitAtLoc( p, 'o00H', loc, (GetUnitFacing(GetSpellAbilityUnit())+180) )
call SetUnitAbilityLevelSwapped( 'A05A', wolf, 3 )
call SetUnitAbilityLevelSwapped( 'A05D', wolf, 3 )
endif
if ( GetUnitAbilityLevelSwapped('A067', GetSpellAbilityUnit()) == 4 ) then
set wolf = CreateUnitAtLoc( p, 'o00I', loc, (GetUnitFacing(GetSpellAbilityUnit())+180) )
call SetUnitAbilityLevelSwapped( 'A05A', wolf, 4 )
call SetUnitAbilityLevelSwapped( 'A05D', wolf, 4 )
call SetUnitAbilityLevelSwapped( 'A069', wolf, 2 )
endif
if ( GetUnitAbilityLevelSwapped('A067', GetSpellAbilityUnit()) == 5 ) then
set wolf = CreateUnitAtLoc( p, 'o00J', loc, (GetUnitFacing(GetSpellAbilityUnit())+180) )
call SetUnitAbilityLevelSwapped( 'A05A', wolf, 5 )
call SetUnitAbilityLevelSwapped( 'A05D', wolf, 5 )
call SetUnitAbilityLevelSwapped( 'A069', wolf, 3 )
endif
set loc = Location(7000.00, -7000.00)
set dummy = CreateUnitAtLoc( p, 'u00T', loc, (GetUnitFacing(GetSpellAbilityUnit())+180) )
call SaveUnitHandle(udg_bierfass, GetHandleId(p), 160, dummy)
call AddSpecialEffectTargetUnitBJ( "origin", wolf, "Abilities\\Spells\\NightElf\\BattleRoar\\RoarCaster.mdl" )
call SetUnitAnimation( wolf, "slam" )
call QueueUnitAnimationBJ( wolf, "stand" )
set loc = OffsetLocation(GetUnitLoc(wolf), -50.00, 0)
call CreateTextTagLocBJ( "woof woof", loc, 0, 8.00, 100, 100, 100, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 1.00 )
call RemoveLocation(loc)
call DestroyGroup(g)
set loc = null
set g = null
set wolf = null
set dummy = null
set p = null
endfunction
//===========================================================================
function InitTrig_Dog_Summon takes nothing returns nothing
set gg_trg_Dog_Summon = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dog_Summon, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dog_Summon, Condition( function Trig_Dog_Summon_Conditions ) )
call TriggerAddAction( gg_trg_Dog_Summon, function Trig_Dog_Summon_Actions )
endfunction
function Trig_Dog_Death_Dummy_Remove_Conditions takes nothing returns boolean
if ( ( GetUnitTypeId(GetDyingUnit()) == 'H00F' ) or ( GetUnitTypeId(GetDyingUnit()) == 'H00E' ) or ( GetUnitTypeId(GetDyingUnit()) == 'o00M' ) or ( GetUnitTypeId(GetDyingUnit()) == 'o00J' ) or ( GetUnitTypeId(GetDyingUnit()) == 'o00L' ) or ( GetUnitTypeId(GetDyingUnit()) == 'o00I' ) or ( GetUnitTypeId(GetDyingUnit()) == 'o00G' ) or ( GetUnitTypeId(GetDyingUnit()) == 'o00H' ) or ( GetUnitTypeId(GetDyingUnit()) == 'o00F' ) or ( GetUnitTypeId(GetDyingUnit()) == 'o00E' ) ) then
return true
endif
return false
endfunction
function Trig_Dog_Death_Dummy_Remove_Actions takes nothing returns nothing
local player p = GetOwningPlayer(GetDyingUnit())
if not( ( GetUnitTypeId(GetDyingUnit()) == 'H00F' ) and ( GetUnitTypeId(GetDyingUnit()) == 'H00E' ) ) then
call RemoveUnit(LoadUnitHandle(udg_bierfass, GetHandleId(p), 160))
call SaveUnitHandle(udg_bierfass, GetHandleId(p), 160, null)
endif
call RemoveUnit(LoadUnitHandle(udg_bierfass, GetHandleId(p), 161))
call SaveUnitHandle(udg_bierfass, GetHandleId(p), 161, null)
set p = null
endfunction
//===========================================================================
function InitTrig_Dog_Death_Dummy_Remove takes nothing returns nothing
set gg_trg_Dog_Death_Dummy_Remove = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dog_Death_Dummy_Remove, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Dog_Death_Dummy_Remove, Condition( function Trig_Dog_Death_Dummy_Remove_Conditions ) )
call TriggerAddAction( gg_trg_Dog_Death_Dummy_Remove, function Trig_Dog_Death_Dummy_Remove_Actions )
endfunction
function Trig_Feral_Heart_Cast_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A06W' ) then
return true
endif
return false
endfunction
function Trig_Feral_Heart_Cast_Actions takes nothing returns nothing
local location loc = Location(6500.00, -6500.00)
local player p = GetOwningPlayer(GetSpellAbilityUnit())
local unit dummy = CreateUnitAtLoc( p, 'u000', loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A06X', dummy )
call UnitAddAbilityBJ( 'S002', dummy )
if ( GetUnitAbilityLevelSwapped('A06W', GetSpellAbilityUnit()) == 3 ) then
call SetUnitAbilityLevelSwapped( 'A06X', dummy, 2 )
call SetUnitAbilityLevelSwapped( 'S002', dummy, 2 )
endif
call UnitApplyTimedLifeBJ( 15.00, 'BTLF', dummy )
call SaveUnitHandle(udg_bierfass, GetHandleId(p), 161, dummy)
call RemoveLocation(loc)
set loc = null
set dummy = null
set p = null
endfunction
//===========================================================================
function InitTrig_Feral_Heart_Cast takes nothing returns nothing
set gg_trg_Feral_Heart_Cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Feral_Heart_Cast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Feral_Heart_Cast, Condition( function Trig_Feral_Heart_Cast_Conditions ) )
call TriggerAddAction( gg_trg_Feral_Heart_Cast, function Trig_Feral_Heart_Cast_Actions )
endfunction
function Trig_Feral_Heart_Learn_Conditions takes nothing returns boolean
if ( ( GetLearnedSkillBJ() == 'A06U' ) or ( GetLearnedSkillBJ() == 'A06V' ) ) then
return true
endif
return false
endfunction
function Trig_Feral_Heart_Learn_Actions takes nothing returns nothing
if ( GetLearnedSkillBJ() == 'A06U' ) then
call UnitAddAbilityBJ( 'A06W', GetLearningUnit() )
call SetUnitAbilityLevelSwapped( 'A06W', GetLearningUnit(), 1 )
else
call SetUnitAbilityLevelSwapped( 'A06W', GetLearningUnit(), 3 )
endif
endfunction
//===========================================================================
function InitTrig_Feral_Heart_Learn takes nothing returns nothing
set gg_trg_Feral_Heart_Learn = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Feral_Heart_Learn, EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_Feral_Heart_Learn, Condition( function Trig_Feral_Heart_Learn_Conditions ) )
call TriggerAddAction( gg_trg_Feral_Heart_Learn, function Trig_Feral_Heart_Learn_Actions )
endfunction
function Trig_Flashbangboom_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A05P') or ( GetSpellAbilityId() == 'A05O') ) then
return true
endif
return false
endfunction
function Trig_Flashbangboom_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[32]
local unit target = GetEnumUnit()
local boolean crit = false
set damage = ( GetRandomReal(15.00, 40.00) + ( 35 * udg_g_integer[8] ) )
set scaler = damage / ( 40 + ( 35 * udg_g_integer[8] ) )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Flashbangboom_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[32])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Flashbangboom_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetSpellTargetLoc()
local location loc2 = GetUnitLoc(caster)
local group g
local integer i = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)
call CreateNUnitsAtLoc( 1, 'u00N', GetOwningPlayer(caster), loc2, bj_UNIT_FACING )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attackground", loc )
call UnitApplyTimedLifeBJ( 1.50, 'BTLF', GetLastCreatedUnit() )
call PolledWait( ( DistanceBetweenPoints(loc2, loc ) / 900.00 ) )
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(caster), loc2, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.50, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A01T', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01T', GetLastCreatedUnit(), i )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "silence", loc )
call AddSpecialEffectLocBJ( loc , "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call AddSpecialEffectLocBJ( loc , "Abilities\\Spells\\NightElf\\Taunt\\TauntCaster.mdl" )
set udg_g_integer[8] = i
set udg_g_unit[32] = caster
set g = GetUnitsInRangeOfLocMatching(200.00, loc, Condition(function Trig_Flashbangboom_Groupcond))
call ForGroupBJ( g, function Trig_Flashbangboom_Groupaction )
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
set caster = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Flashbangboom takes nothing returns nothing
set gg_trg_Flashbangboom = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flashbangboom, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Flashbangboom, Condition( function Trig_Flashbangboom_Conditions ) )
call TriggerAddAction( gg_trg_Flashbangboom, function Trig_Flashbangboom_Actions )
endfunction
function Trig_Grenade_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A01S' ) ) then
return true
endif
return false
endfunction
function Trig_Grenade_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[32]
local unit target = GetEnumUnit()
local boolean crit = false
set damage = ( GetRandomReal(15.00, 40.00) + ( 35 * udg_g_integer[8] ) )
set scaler = damage / ( 40 + ( 35 * udg_g_integer[8] ) )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Grenade_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[32])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Grenade_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetSpellTargetLoc()
local location loc2 = GetUnitLoc(caster)
local group g
local integer i = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)
call CreateNUnitsAtLoc( 1, 'u00O', GetOwningPlayer(caster), loc2, bj_UNIT_FACING )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attackground", loc )
call UnitApplyTimedLifeBJ( 1.50, 'BTLF', GetLastCreatedUnit() )
call PolledWait( ( DistanceBetweenPoints(loc2, loc ) / 900.00 ) )
call AddSpecialEffectLocBJ( loc , "Objects\\Spawnmodels\\Human\\FragmentationShards\\FragBoomSpawn.mdl" )
set udg_g_integer[8] = i
set udg_g_unit[32] = caster
set g = GetUnitsInRangeOfLocMatching(200.00, loc, Condition(function Trig_Grenade_Groupcond))
call ForGroupBJ( g, function Trig_Grenade_Groupaction )
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
set caster = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Grenade takes nothing returns nothing
set gg_trg_Grenade = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Grenade, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Grenade, Condition( function Trig_Grenade_Conditions ) )
call TriggerAddAction( gg_trg_Grenade, function Trig_Grenade_Actions )
endfunction
function Trig_Cluster_Grenade_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A06F' ) or ( GetSpellAbilityId() == 'A06G' ) ) then
return true
endif
return false
endfunction
function Trig_Cluster_Grenade_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[37])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Cluster_Grenade_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[37]
local unit target = GetEnumUnit()
local boolean crit = false
set damage = ( GetRandomReal(-10.00, 25.00) + ( 60 * udg_g_integer[12] ) )
set scaler = damage / ( 25 + ( 60 * udg_g_integer[12] ) )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Cluster_Grenade_Cluster_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[37]
local unit target = GetEnumUnit()
local boolean crit = false
set damage = 0.3 * ( GetRandomReal(-10.00, 25.00) + ( 60 * udg_g_integer[12] ) )
set scaler = damage / (0.3*( 25 + ( 60 * udg_g_integer[12] ) ))
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function ClusterGrenadeClusterImpact takes nothing returns nothing
local timer t = GetExpiredTimer()
local location loc = LoadLocationHandle(udg_bierfass, GetHandleId(t), 177)
local group g
set g = GetUnitsInRangeOfLocMatching(75.00, loc, Condition(function Trig_Cluster_Grenade_Groupcond))
call ForGroupBJ( g, function Trig_Cluster_Grenade_Cluster_Groupaction )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call DestroyGroup(g)
call RemoveLocation(loc)
set t = null
set g = null
set loc = null
endfunction
function ClusterGrenadeClusterSpawn takes location loc, unit caster returns nothing
local timer t = CreateTimer()
local location targetloc
local unit dummyattacker = CreateUnitAtLoc(GetOwningPlayer(caster), 'u00R', loc, 0)
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', dummyattacker )
set targetloc = PolarProjectionBJ(loc, GetRandomReal(100,300), GetRandomReal(0,360))
call IssuePointOrderLocBJ( dummyattacker, "attackground", targetloc )
call SaveLocationHandle(udg_bierfass, GetHandleId(t), 177, targetloc)
call TimerStart(t, (DistanceBetweenPoints(loc,targetloc)/500), false, function ClusterGrenadeClusterImpact)
set targetloc = null
endfunction
function ClusterGrenadeImpact takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer lvl = LoadInteger(udg_bierfass, GetHandleId(t), 175)
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 176)
local location loc = LoadLocationHandle(udg_bierfass, GetHandleId(t), 177)
local group g
local integer iter = 1
set udg_g_integer[12] = lvl
set udg_g_unit[37] = caster
set g = GetUnitsInRangeOfLocMatching(200.00, loc, Condition(function Trig_Cluster_Grenade_Groupcond))
call ForGroupBJ( g, function Trig_Cluster_Grenade_Groupaction )
set lvl = lvl + 2
set udg_g_point[3] = loc
loop
exitwhen (iter > lvl)
call ClusterGrenadeClusterSpawn(udg_g_point[3], caster)
set iter = iter + 1
endloop
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call DestroyGroup(g)
set t = null
set g = null
set caster = null
set loc = null
endfunction
function Trig_Cluster_Grenade_Actions takes nothing returns nothing
local timer t = CreateTimer()
local location loc = GetUnitLoc(GetSpellAbilityUnit())
local location loc2 = GetSpellTargetLoc()
local unit dummy = CreateUnitAtLoc(GetOwningPlayer(GetSpellAbilityUnit()), 'u00Q', loc, GetUnitFacing(GetSpellAbilityUnit()))
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', dummy )
call IssuePointOrderLocBJ( dummy, "attackground", loc2 )
call SaveInteger(udg_bierfass, GetHandleId(t), 175, GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()))
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 176, GetSpellAbilityUnit())
call SaveLocationHandle(udg_bierfass, GetHandleId(t), 177, loc2)
call TimerStart(t, (DistanceBetweenPoints(loc,loc2)/800), false, function ClusterGrenadeImpact )
call RemoveLocation(loc)
set loc = null
set loc2 = null
set t = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Cluster_Grenade takes nothing returns nothing
set gg_trg_Cluster_Grenade = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Cluster_Grenade, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Cluster_Grenade, Condition( function Trig_Cluster_Grenade_Conditions ) )
call TriggerAddAction( gg_trg_Cluster_Grenade, function Trig_Cluster_Grenade_Actions )
endfunction
function Trig_Gyrobomben_Damage_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetDyingUnit()) == 'h00R' ) then
return true
endif
return false
endfunction
function Trig_Gyrobomben_Damage_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[33])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Gyrobomben_Damage_Groupaction takes nothing returns nothing
local unit caster = udg_g_unit[33]
local unit target = GetEnumUnit()
local real damage
local real scaler
local boolean crit = false
set damage = GetRandomReal(150.00, 200.00)
set scaler = damage / 250
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Gyrobomben_Damage_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetDyingUnit())
local group g
set udg_g_unit[33] = GetDyingUnit()
set g = GetUnitsInRangeOfLocMatching(100.00, loc, Condition(function Trig_Gyrobomben_Damage_Groupcond))
call ForGroupBJ( g, function Trig_Gyrobomben_Damage_Groupaction )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Gyrobomben_Damage takes nothing returns nothing
set gg_trg_Gyrobomben_Damage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Gyrobomben_Damage, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Gyrobomben_Damage, Condition( function Trig_Gyrobomben_Damage_Conditions ) )
call TriggerAddAction( gg_trg_Gyrobomben_Damage, function Trig_Gyrobomben_Damage_Actions )
endfunction
function Trig_Gyrostrike_Setup_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A066' ) then
return true
endif
return false
endfunction
function Gyrostrike_Bombenspawn takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 162)
local unit bomber1 = LoadUnitHandle(udg_bierfass, GetHandleId(t), 163)
local unit bomber2 = LoadUnitHandle(udg_bierfass, GetHandleId(t), 164)
local unit bomber3 = LoadUnitHandle(udg_bierfass, GetHandleId(t), 165)
local player p = GetOwningPlayer(bomber1)
local location loc
local unit bombe
set iter = iter + 1
set loc = PolarProjectionBJ(GetUnitLoc(bomber1), 50.00, GetRandomDirectionDeg())
set bombe = CreateUnitAtLoc(p, 'h00R', loc, bj_UNIT_FACING )
set loc = GetUnitLoc(bomber1)
call IssuePointOrderLoc( bombe, "move", loc )
call SetUnitFlyHeight( bombe, 50.00, 300.00 )
set loc = PolarProjectionBJ(GetUnitLoc(bomber2), 50.00, GetRandomDirectionDeg())
set bombe = CreateUnitAtLoc(p, 'h00R', loc, bj_UNIT_FACING )
set loc = GetUnitLoc(bomber2)
call IssuePointOrderLoc( bombe, "move", loc )
call SetUnitFlyHeight( bombe, 50.00, 300.00 )
set loc = PolarProjectionBJ(GetUnitLoc(bomber3), 50.00, GetRandomDirectionDeg())
set bombe = CreateUnitAtLoc(p, 'h00R', loc, bj_UNIT_FACING )
set loc = GetUnitLoc(bomber3)
call IssuePointOrderLoc( bombe, "move", loc )
call SetUnitFlyHeight( bombe, 50.00, 300.00 )
if ( iter == 10 ) then
call PauseTimer(t)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
set t = null
call SetUnitFlyHeight( bomber1, 1000.00, 150.00 )
call SetUnitFlyHeight( bomber2, 1000.00, 150.00 )
call SetUnitFlyHeight( bomber3, 1000.00, 150.00 )
call UnitApplyTimedLife(bomber1, 'BTLF', 5.00)
call UnitApplyTimedLife(bomber2, 'BTLF', 5.00)
call UnitApplyTimedLife(bomber3, 'BTLF', 5.00)
else
call SaveInteger(udg_bierfass, GetHandleId(t), 162, iter)
endif
call RemoveLocation(loc)
set loc = null
set t = null
set bombe = null
set bomber1 = null
set bomber2 = null
set bomber3 = null
set p = null
endfunction
function Trig_Gyrostrike_Setup_Actions takes nothing returns nothing
local timer t = CreateTimer()
local integer iter = 0
local player p = GetOwningPlayer(GetSpellAbilityUnit())
local real winkel = GetRandomReal(0, 360)
local location loc = GetSpellTargetLoc()
local location loc2
local location loc3
local unit bomber1
local unit bomber2
local unit bomber3
local location spawnloc
local location targetloc
if ( GetLocationX(loc) <= -6500 ) then
set winkel = GetRandomReal(270,450)
endif
if ( GetLocationX(loc) >= 6300 ) then
set winkel = GetRandomReal(90,270)
endif
if ( GetLocationY(loc) >= 6100 ) then
set winkel = GetRandomReal(180,360)
endif
if ( GetLocationY(loc) <= -6600 ) then
set winkel = GetRandomReal(0,180)
endif
if ( ( GetLocationX(loc) <= -6500 ) and ( GetLocationY(loc) >= 6100 ) ) then
set winkel = GetRandomReal(270,360)
endif
if ( ( GetLocationX(loc) <= -6500 ) and ( GetLocationY(loc) <= -6600 ) ) then
set winkel = GetRandomReal(0,90)
endif
if ( ( GetLocationX(loc) >= 6300 ) and ( GetLocationY(loc) >= 6100 ) ) then
set winkel = GetRandomReal(180,270)
endif
if ( ( GetLocationX(loc) >= 6300 ) and ( GetLocationY(loc) <= -6600 ) ) then
set winkel = GetRandomReal(90,180)
endif
set loc2 = PolarProjectionBJ(loc, 200.00, winkel)
set loc3 = PolarProjectionBJ(loc, 200.00, (winkel+180))
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Human\\Flare\\FlareTarget.mdl" )
set winkel = winkel + 90
set spawnloc = PolarProjectionBJ(loc, 1000, winkel)
set bomber1 = CreateUnitAtLoc( p, 'h00S', spawnloc, bj_UNIT_FACING )
call SetUnitFlyHeight( bomber1, 200.00, 450.00 )
set targetloc = PolarProjectionBJ(spawnloc, 4000.00, (winkel+180))
call IssuePointOrderLoc( bomber1, "move", targetloc )
set spawnloc = PolarProjectionBJ(loc2, 1000, winkel)
set bomber2 = CreateUnitAtLoc( p, 'h00S', spawnloc, bj_UNIT_FACING )
call SetUnitFlyHeight( bomber2, 200.00, 450.00 )
set targetloc = PolarProjectionBJ(spawnloc, 4000.00, (winkel+180))
call IssuePointOrderLoc( bomber2, "move", targetloc )
set spawnloc = PolarProjectionBJ(loc3, 1000, winkel)
set bomber3 = CreateUnitAtLoc( p, 'h00S', spawnloc, bj_UNIT_FACING )
call SetUnitFlyHeight( bomber3, 200.00, 450.00 )
set targetloc = PolarProjectionBJ(spawnloc, 4000.00, (winkel+180))
call IssuePointOrderLoc( bomber3, "move", targetloc )
call PolledWait(1.9)
call SaveInteger(udg_bierfass, GetHandleId(t), 162, iter)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 163, bomber1)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 164, bomber2)
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 165, bomber3)
call TimerStart(t, 0.1, true, function Gyrostrike_Bombenspawn)
call RemoveLocation(loc)
call RemoveLocation(loc2)
call RemoveLocation(loc3)
call RemoveLocation(spawnloc)
call RemoveLocation(targetloc)
set loc = null
set loc2 = null
set loc3 = null
set spawnloc = null
set targetloc = null
set bomber1 = null
set bomber2 = null
set bomber3 = null
set t = null
set p = null
endfunction
//===========================================================================
function InitTrig_Gyrostrike_Setup takes nothing returns nothing
set gg_trg_Gyrostrike_Setup = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Gyrostrike_Setup, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Gyrostrike_Setup, Condition( function Trig_Gyrostrike_Setup_Conditions ) )
call TriggerAddAction( gg_trg_Gyrostrike_Setup, function Trig_Gyrostrike_Setup_Actions )
endfunction
function Trig_Air_Strike_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A06B' ) or ( GetSpellAbilityId() == 'A06C' ) ) then
return true
endif
return false
endfunction
function Trig_Air_Strike_Actions takes nothing returns nothing
local location loc = PolarProjectionBJ(GetUnitLoc(GetSpellTargetUnit()), 1000, GetRandomReal(0,360))
local unit hunter = CreateUnitAtLoc( GetOwningPlayer(GetSpellAbilityUnit()), 'h00T', loc, bj_UNIT_FACING )
call SetUnitAbilityLevelSwapped( 'A06A', hunter, GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) )
call SetUnitFlyHeight( hunter, 150.00, 450.00 )
call IssueTargetOrderBJ( hunter, "chainlightning", GetSpellTargetUnit() )
call PolledWait(3)
set loc = PolarProjectionBJ(GetUnitLoc(hunter), 5000, GetRandomReal(0,360))
call IssuePointOrderLoc( hunter, "move", loc )
call SetUnitFlyHeight( hunter, 1000.00, 150.00 )
call UnitApplyTimedLife(hunter, 'BTLF', 5.00)
call RemoveLocation(loc)
set loc = null
set hunter = null
endfunction
//===========================================================================
function InitTrig_Air_Strike takes nothing returns nothing
set gg_trg_Air_Strike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Air_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Air_Strike, Condition( function Trig_Air_Strike_Conditions ) )
call TriggerAddAction( gg_trg_Air_Strike, function Trig_Air_Strike_Actions )
endfunction
function Trig_Air_Strike_Damage_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A06A' ) then
return true
endif
return false
endfunction
function Trig_Air_Strike_Damage_Actions takes nothing returns nothing
local real damage
local real damage2
local real scaler
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local boolean crit = false
local location loc = PolarProjectionBJ(GetUnitLoc(GetSpellAbilityUnit()), 3000, GetRandomReal(0,360))
call PlaySoundOnUnitBJ( gg_snd_FlakCannon, 100, caster )
call KillSoundWhenDone( GetLastPlayedSound() )
set damage = GetRandomReal(((I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))*750)+250),((I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))*1000)+500))
set scaler = damage / ((I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))*1000)+500)
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
call IssuePointOrderLoc( caster, "move", loc )
call SetUnitFlyHeight( caster, 1000.00, 150.00 )
set target = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Air_Strike_Damage takes nothing returns nothing
set gg_trg_Air_Strike_Damage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Air_Strike_Damage, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Air_Strike_Damage, Condition( function Trig_Air_Strike_Damage_Conditions ) )
call TriggerAddAction( gg_trg_Air_Strike_Damage, function Trig_Air_Strike_Damage_Actions )
endfunction
function Trig_Rocketjump_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A06D' ) or ( GetSpellAbilityId() == 'A06E' ) )then
return true
endif
return false
endfunction
//Conditions für Gruppe, die bei Landung weggestoßen wird.
function Trig_Rocketjump_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[36])) == true ) ) then
return true
endif
return false
endfunction
// Bewegung der einzelnen Einheiten der Gruppe.
function Trig_Rocketjump_Groupmove takes nothing returns nothing
local location loc
local real winkel = AngleBetweenPoints(GetUnitLoc(udg_g_unit[36]), GetUnitLoc(GetEnumUnit()))
local real distanz = udg_g_real[6]
if ( IsUnitAliveBJ(GetEnumUnit()) ) then
set loc = PolarProjectionBJ(GetUnitLoc(GetEnumUnit()), distanz, ( winkel + GetRandomReal(-10.00, 10.00) ))
call SetUnitPositionLoc( GetEnumUnit(), loc )
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
// Timer-Expire vor Gruppenmove.
function Trig_Rocketjump_Moveunit takes nothing returns nothing
local timer t = GetExpiredTimer()
local real distanz = LoadReal(udg_bierfass, GetHandleId(t), 172)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 173)
local group g = LoadGroupHandle(udg_bierfass, GetHandleId(t), 174)
set iter = iter + 1
call SaveInteger(udg_bierfass, GetHandleId(t), 173, iter)
set udg_g_real[6] = distanz
call ForGroupBJ( g, function Trig_Rocketjump_Groupmove )
set distanz = distanz - 0.10
call SaveReal(udg_bierfass, GetHandleId(t), 172, distanz)
if ( iter == 50 ) then
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call DestroyGroup(g)
endif
set t = null
set g = null
endfunction
// einmaliger Schaden an Gruppe direkt nach Landung
function Trig_Rocketjump_Damage takes nothing returns nothing
local real damage
local integer int = udg_g_integer[11]
local real scaler
local unit caster = udg_g_unit[36]
local unit target = GetEnumUnit()
local boolean crit = true
local location loc = GetUnitLoc(target)
set damage = GetRandomReal((150+int*50), (175+int*75))
set scaler = damage / (175+int*75)
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A018', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", target )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
call RemoveLocation(loc)
set loc = null
set caster = null
set target = null
endfunction
// Actions ab Absprung: Timer, Gruppenerkennung, Schaden usw.
function Trig_Rocketjump_Absprung takes nothing returns nothing
local unit caster = udg_g_unit[36]
local location loc = GetUnitLoc(caster)
local real distanz = 5.00
local timer t = CreateTimer()
local integer iter = 0
local group g
local unit explosionssfx
local real damage
local integer int = udg_g_integer[11]
local real scaler
local unit target = GetEnumUnit()
local boolean crit = true
set g = GetUnitsInRangeOfLocMatching(200.00, loc, Condition(function Trig_Rocketjump_Groupcond))
call AddSpecialEffectLocBJ( loc, "Objects\\Spawnmodels\\Human\\HCancelDeath\\HCancelDeath.mdl" )
set explosionssfx = CreateUnitAtLoc( GetOwningPlayer(caster), 'u00P', loc, bj_UNIT_FACING )
call KillUnit(explosionssfx)
call ForGroupBJ( g, function Trig_Rocketjump_Damage )
set damage = GetRandomReal(0.1,0.5) * GetRandomReal((150+int*50), (175+int*75))
set scaler = damage / (0.5*(175+int*75))
call DamageTargetWithTextPhysical(caster, caster, damage, scaler, crit)
call SaveReal(udg_bierfass, GetHandleId(t), 172, distanz)
call SaveInteger(udg_bierfass, GetHandleId(t), 173, iter)
call SaveGroupHandle(udg_bierfass, GetHandleId(t), 174, g)
call TimerStart(t, 0.01, true, function Trig_Rocketjump_Moveunit)
call RemoveLocation(loc)
set loc = null
set caster = null
set t = null
set explosionssfx = null
set g = null
endfunction
function Trig_Rocketjump_Move takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 166)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 167)
local integer wende = LoadInteger(udg_bierfass, GetHandleId(t), 168)
local real tempo = LoadReal(udg_bierfass, GetHandleId(t), 169)
local real winkel = LoadReal(udg_bierfass, GetHandleId(t), 170)
local real strecke = LoadReal(udg_bierfass, GetHandleId(t), 171)
local location loc
set iter = iter + 1
call SaveInteger(udg_bierfass, GetHandleId(t), 167, iter)
if ( IsUnitAliveBJ(caster) ) then
if ( iter <= wende ) then
set tempo = tempo - (4 / I2R(wende))
call SaveReal(udg_bierfass, GetHandleId(t), 169, tempo)
call SetUnitFlyHeightBJ( caster, SquareRoot( 6000 * iter ), 10000 )
else
set tempo = tempo - (4 / I2R(wende))
call SaveReal(udg_bierfass, GetHandleId(t), 169, tempo)
call SetUnitFlyHeightBJ( caster, SquareRoot( 6000 * ((2*wende) - iter) ), 10000 )
endif
set loc = PolarProjectionBJ(GetUnitLoc(caster), tempo, winkel )
call SetUnitPositionLoc( caster, loc )
if ( iter == 2*wende ) then
call SetUnitFlyHeightBJ( caster, 0, 10000 )
call SetUnitPathing( caster, true )
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
else
call SetUnitFlyHeightBJ( caster, 0, 10000 )
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
call RemoveLocation(loc)
set loc = null
set t = null
set caster = null
endfunction
function Trig_Rocketjump_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit caster = GetSpellAbilityUnit()
local location loc = GetUnitLoc(caster)
local location loc2 = PolarProjectionBJ(loc, 450.00, ( GetUnitFacing(caster) + 180.00 ))
local integer iter = 0
local real strecke
local integer wende
local real tempo = 10.00
local real winkel
local unit dummy
set dummy = CreateUnitAtLoc( Player(2), 'uabo', loc2, bj_UNIT_FACING )
set loc2 = GetUnitLoc(dummy)
call RemoveUnit(dummy)
set strecke = DistanceBetweenPoints(loc, loc2)
set wende = R2I(strecke / 12)
set winkel = AngleBetweenPoints(loc, loc2)
call UnitAddAbilityBJ( 'Amrf', caster )
call UnitRemoveAbilityBJ( 'Amrf', caster )
call SetUnitPathing( caster, false )
set udg_g_integer[11] = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit())
set udg_g_unit[36] = caster
call Trig_Rocketjump_Absprung()
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 166, caster)
call SaveInteger(udg_bierfass, GetHandleId(t), 167, iter)
call SaveInteger(udg_bierfass, GetHandleId(t), 168, wende)
call SaveReal(udg_bierfass, GetHandleId(t), 169, tempo)
call SaveReal(udg_bierfass, GetHandleId(t), 170, winkel)
call SaveReal(udg_bierfass, GetHandleId(t), 171, strecke)
call TimerStart(t, 0.01, true, function Trig_Rocketjump_Move)
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
set t = null
set caster = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Rocketjump takes nothing returns nothing
set gg_trg_Rocketjump = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rocketjump, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Rocketjump, Condition( function Trig_Rocketjump_Conditions ) )
call TriggerAddAction( gg_trg_Rocketjump, function Trig_Rocketjump_Actions )
endfunction
function Trig_Rocket_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A06H' ) or ( GetSpellAbilityId() == 'A06I' ) ) then
return true
endif
return false
endfunction
function Trig_Rocket_Actions takes nothing returns nothing
local real damage
local real scaler
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local boolean crit = true
local location loc = GetUnitLoc(caster)
local location loc2 = GetUnitLoc(target)
call PolledWait(DistanceBetweenPoints(loc,loc2)/1000)
set damage = GetRandomReal((100 + 50 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))),(50 + 75 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))))
set scaler = damage / (50 + 75 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)))
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
set caster = null
set target = null
call RemoveLocation(loc)
call RemoveLocation(loc2)
set loc = null
set loc2 = null
endfunction
//===========================================================================
function InitTrig_Rocket takes nothing returns nothing
set gg_trg_Rocket = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rocket, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Rocket, Condition( function Trig_Rocket_Conditions ) )
call TriggerAddAction( gg_trg_Rocket, function Trig_Rocket_Actions )
endfunction
function Trig_Nutshot_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A03G' ) then
return true
endif
return false
endfunction
function Trig_Nutshot_Actions takes nothing returns nothing
local real damage
local real scaler
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local boolean crit = false
if ( ( GetUnitTypeId(target) != 'n00X' ) and ( GetUnitTypeId(target) != 'n00M' ) and ( GetUnitTypeId(target) != 'n00V' ) and ( GetUnitTypeId(target) != 'n011' ) and ( GetUnitTypeId(target) != 'u00E' ) and ( GetUnitTypeId(target) != 'n00G' ) and ( GetUnitTypeId(target) != 'o009' ) and ( GetUnitTypeId(target) != 'o007' ) and ( GetUnitTypeId(target) != 'o005' ) and ( GetUnitTypeId(target) != 'o003' ) and ( GetUnitTypeId(target) != 'o001' ) and ( IsUnitType(target, UNIT_TYPE_HERO) == false ) ) then
set damage = GetUnitState(target, UNIT_STATE_LIFE)
set scaler = GetRandomReal(0.8, 1)
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
call UnitDamageTargetBJ( caster, target, 10000.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
set damage = GetRandomReal(2000, 3000)
set scaler = damage/3000
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
endif
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Nutshot takes nothing returns nothing
set gg_trg_Nutshot = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Nutshot, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Nutshot, Condition( function Trig_Nutshot_Conditions ) )
call TriggerAddAction( gg_trg_Nutshot, function Trig_Nutshot_Actions )
endfunction
function Trig_Thrash_Conditions takes nothing returns boolean
if ( (GetUnitTypeId(GetAttacker()) == 'H00V') or (GetUnitTypeId(GetAttacker()) == 'H00W') ) then
return true
endif
return false
endfunction
function Trig_Thrash_Move takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(udg_bierfass, GetHandleId(t), 200)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 201)
local integer wende = LoadInteger(udg_bierfass, GetHandleId(t), 202)
local real tempo = LoadReal(udg_bierfass, GetHandleId(t), 203)
local real winkel = LoadReal(udg_bierfass, GetHandleId(t), 204)
local real strecke = LoadReal(udg_bierfass, GetHandleId(t), 205)
local location loc
set iter = iter + 1
call SaveInteger(udg_bierfass, GetHandleId(t), 201, iter)
if ( IsUnitAliveBJ(u) ) then
if ( iter <= wende ) then
set tempo = tempo - (4 / I2R(wende))
call SaveReal(udg_bierfass, GetHandleId(t), 203, tempo)
call SetUnitFlyHeightBJ( u, SquareRoot( 2500 * iter ), 10000 )
else
set tempo = tempo - (4 / I2R(wende))
call SaveReal(udg_bierfass, GetHandleId(t), 203, tempo)
call SetUnitFlyHeightBJ( u, SquareRoot( 2500 * ((2*wende) - iter) ), 10000 )
endif
set loc = PolarProjectionBJ(GetUnitLoc(u), tempo, winkel )
call SetUnitPositionLoc( u, loc )
if ( iter == 2*wende ) then
call SetUnitFlyHeightBJ( u, 0, 10000 )
call SetUnitPathing( u, true )
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
else
call SetUnitFlyHeightBJ( u, 0, 10000 )
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
call RemoveLocation(loc)
set loc = null
set t = null
set u = null
endfunction
function Trig_Thrash_CD takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(udg_bierfass, GetHandleId(t), 207)
call SaveBoolean(udg_bierfass, GetHandleId(u), 206, true)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
set t = null
set u = null
endfunction
function Trig_Thrash_Actions takes nothing returns nothing
local unit u = GetAttacker()
local unit target = GetTriggerUnit()
local location loc
local location loc2
local integer iter = 0
local real strecke
local integer wende
local real tempo = 7.00
local real winkel
local unit dummy
local real damage
local real scaler
local timer cd
local timer t
call DisplayTextToForce( GetPlayersAll(), "Trigger laeuft" )
if ( (LoadBoolean(udg_bierfass, GetHandleId(u), 206) == true) and ( ((GetRandomInt(1, 20) <= 5) and (GetUnitTypeId(GetAttacker()) == 'H00V')) or ((GetRandomInt(1, 10) <= 5) and (GetUnitTypeId(GetAttacker()) == 'H00W')) ) ) then
call DisplayTextToForce( GetPlayersAll(), "conditions erfuellt" )
call SaveBoolean(udg_bierfass, GetHandleId(u), 206, false)
set cd = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(cd), 207, u)
call TimerStart(cd, 0.75, false, function Trig_Thrash_CD)
if (GetUnitTypeId(GetAttacker()) == 'H00V') then
call PolledWait( 0.33 )
else
call PolledWait( 0.50 )
endif
set loc = GetUnitLoc(target)
set loc2 = PolarProjectionBJ(loc, 300.00, GetUnitFacing(u))
set dummy = CreateUnitAtLoc( Player(2), 'uabo', loc2, bj_UNIT_FACING )
set loc2 = GetUnitLoc(dummy)
call RemoveUnit(dummy)
set strecke = DistanceBetweenPoints(loc, loc2)
set wende = R2I(strecke / 12)
set winkel = AngleBetweenPoints(loc, loc2)
call UnitAddAbilityBJ( 'Amrf', target )
call UnitRemoveAbilityBJ( 'Amrf', target )
call SetUnitPathing( target, false )
call AddSpecialEffectTargetUnitBJ( "chest", target, "Objects\\Spawnmodels\\Orc\\Orcblood\\OrcBloodHeroFarSeer.mdl" )
set t = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 200, target)
call SaveInteger(udg_bierfass, GetHandleId(t), 201, iter)
call SaveInteger(udg_bierfass, GetHandleId(t), 202, wende)
call SaveReal(udg_bierfass, GetHandleId(t), 203, tempo)
call SaveReal(udg_bierfass, GetHandleId(t), 204, winkel)
call SaveReal(udg_bierfass, GetHandleId(t), 205, strecke)
call TimerStart(t, 0.01, true, function Trig_Thrash_Move)
set damage = ((GetUnitAbilityLevel(u, 'A07W')-1)*25) + GetRandomReal(0, ((GetUnitAbilityLevel(u, 'A07W')-5)*25))
set scaler = 0.85 * damage / (25*(GetUnitAbilityLevel(u, 'A07W')-1) + ((GetUnitAbilityLevel(u, 'A07W')-5)))
call DamageTargetWithTextPhysical(u, target, damage, scaler, true)
endif
call RemoveLocation(loc)
call RemoveLocation(loc2)
set u = null
set target = null
set t = null
set dummy = null
set loc = null
set loc2 = null
set cd = null
endfunction
//===========================================================================
function InitTrig_Thrash takes nothing returns nothing
set gg_trg_Thrash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Thrash, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Thrash, Condition( function Trig_Thrash_Conditions ) )
call TriggerAddAction( gg_trg_Thrash, function Trig_Thrash_Actions )
endfunction
function Trig_Turn_Undead_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A00B' ) then
return true
endif
return false
endfunction
function Trig_Turn_Undead_Groupcond takes nothing returns boolean
if ( ( IsUnitDemonOrUndead(GetFilterUnit()) ) and ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(GetSpellAbilityUnit())) == true ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == false ) and not( GetUnitAbilityLevelSwapped('A02V', GetFilterUnit()) == 1 ) ) then
return true
endif
return false
endfunction
function Trig_Turn_Undead_Groupaction takes nothing returns nothing
call SetUnitOwner( GetEnumUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE), true )
call UnitApplyTimedLifeBJ( 15.00, 'BUan', GetEnumUnit() )
call AddSpecialEffectTargetUnitBJ( "overhead", GetEnumUnit(), "Abilities\\Spells\\NightElf\\FaerieDragonInvis\\FaerieDragon_Invis.mdl" )
endfunction
function Trig_Turn_Undead_Actions takes nothing returns nothing
local location loc = GetSpellTargetLoc()
local group g = GetUnitsInRangeOfLocMatching(250.00, loc, Condition(function Trig_Turn_Undead_Groupcond))
call ForGroupBJ( g, function Trig_Turn_Undead_Groupaction )
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Turn_Undead takes nothing returns nothing
set gg_trg_Turn_Undead = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Turn_Undead, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Turn_Undead, Condition( function Trig_Turn_Undead_Conditions ) )
call TriggerAddAction( gg_trg_Turn_Undead, function Trig_Turn_Undead_Actions )
endfunction
function Trig_Hearthstone_Begin_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A053' ) then
return true
endif
return false
endfunction
function Trig_Hearthstone_Begin_Actions takes nothing returns nothing
local location loc = Location(-2600.00, 633.00)
call SetUnitInvulnerable( GetSpellAbilityUnit(), true )
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTo.mdl" )
call SaveEffectHandle(udg_bierfass, GetHandleId(GetSpellAbilityUnit()), 178, GetLastCreatedEffectBJ())
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Hearthstone_Begin takes nothing returns nothing
set gg_trg_Hearthstone_Begin = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hearthstone_Begin, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Hearthstone_Begin, Condition( function Trig_Hearthstone_Begin_Conditions ) )
call TriggerAddAction( gg_trg_Hearthstone_Begin, function Trig_Hearthstone_Begin_Actions )
endfunction
function Trig_Hearthstone_Cancel_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A053' ) then
return true
endif
return false
endfunction
function Trig_Hearthstone_Cancel_Actions takes nothing returns nothing
call SetUnitInvulnerable( GetSpellAbilityUnit(), false )
call DestroyEffectBJ( LoadEffectHandle(udg_bierfass, GetHandleId(GetSpellAbilityUnit()), 178) )
call SaveEffectHandle(udg_bierfass, GetHandleId(GetSpellAbilityUnit()), 178, null)
endfunction
//===========================================================================
function InitTrig_Hearthstone_Cancel takes nothing returns nothing
set gg_trg_Hearthstone_Cancel = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hearthstone_Cancel, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_Hearthstone_Cancel, Condition( function Trig_Hearthstone_Cancel_Conditions ) )
call TriggerAddAction( gg_trg_Hearthstone_Cancel, function Trig_Hearthstone_Cancel_Actions )
endfunction
function Trig_Hearthstone_Finish_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A053' ) then
return true
endif
return false
endfunction
function Trig_Hearthstone_Finish_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetSpellAbilityUnit())
local unit u = GetSpellAbilityUnit()
local real heal
local real scaler
local boolean crit = false
call SetUnitInvulnerable( u, false )
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
if ( IsTriggerEnabled(gg_trg_Schlussfight_Ende) == true ) then
set loc = Location(-6193.00, 5485.00)
else
set loc = Location(-2600.00, 633.00)
endif
call SetUnitPositionLoc( u, loc )
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl" )
call DestroyEffectBJ( LoadEffectHandle(udg_bierfass, GetHandleId(u), 178) )
call SaveEffectHandle(udg_bierfass, GetHandleId(u), 178, null)
set heal = ( (((GetUnitAbilityLevel(u, GetSpellAbilityId())-1)*0.10) + GetRandomReal(0.15, 0.2)) * GetUnitState(u, UNIT_STATE_MAX_LIFE) )
set scaler = ( heal / ( (((GetUnitAbilityLevel(u, GetSpellAbilityId())-1)*0.10) + 0.2) * GetUnitState(u, UNIT_STATE_MAX_LIFE) ) )
call HealTargetWithTextMagic(u, u, heal, scaler, crit)
set u = null
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Hearthstone_Finish takes nothing returns nothing
set gg_trg_Hearthstone_Finish = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hearthstone_Finish, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Hearthstone_Finish, Condition( function Trig_Hearthstone_Finish_Conditions ) )
call TriggerAddAction( gg_trg_Hearthstone_Finish, function Trig_Hearthstone_Finish_Actions )
endfunction
function Trig_Sprungangriff_Conditions takes nothing returns boolean
if ( ( GetUnitTypeId(GetSummonedUnit()) == 'u000' ) and ( ( GetUnitTypeId(GetSummoningUnit()) == 'H001' ) or ( GetUnitTypeId(GetSummoningUnit()) == 'H002' ) ) ) then
return true
endif
return false
endfunction
//Conditions für Gruppe, die bei Landung weggestoßen wird.
function Trig_Sprungangriff_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[8])) ) ) then
return true
endif
return false
endfunction
// Bewegung der einzelnen Einheiten der Gruppe.
function Trig_Sprungangriff_Groupmove takes nothing returns nothing
local location loc
local real winkel = AngleBetweenPoints(GetUnitLoc(udg_g_unit[8]), GetUnitLoc(GetEnumUnit()))
local real distanz = udg_g_real[1]
if ( IsUnitAliveBJ(GetEnumUnit()) ) then
set loc = PolarProjectionBJ(GetUnitLoc(GetEnumUnit()), distanz, ( winkel + GetRandomReal(-10.00, 10.00) ))
call SetUnitPositionLoc( GetEnumUnit(), loc )
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
// Timer-Expire vor Gruppenmove.
function Trig_Sprungangriff_Moveunit takes nothing returns nothing
local timer t = GetExpiredTimer()
local real distanz = LoadReal(udg_bierfass, GetHandleId(t), 187)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 188)
local group g = LoadGroupHandle(udg_bierfass, GetHandleId(t), 189)
set iter = iter + 1
call SaveInteger(udg_bierfass, GetHandleId(t), 188, iter)
set udg_g_real[1] = distanz
call ForGroupBJ( g, function Trig_Sprungangriff_Groupmove )
set distanz = distanz - 0.10
call SaveReal(udg_bierfass, GetHandleId(t), 187, distanz)
if ( iter == 25 ) then
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call DestroyGroup(g)
endif
set t = null
set g = null
endfunction
// einmaliger Schaden an Gruppe direkt nach Landung
function Trig_Sprungangriff_Damage takes nothing returns nothing
local real damage
local integer int = udg_g_integer[13]
local real scaler
local unit caster = udg_g_unit[8]
local unit target = GetEnumUnit()
local boolean crit = true
local location loc = GetUnitLoc(target)
local unit dummy
set damage = GetRandomReal((50+150*int),(250*int))
set scaler = damage / (250*int)
set dummy = CreateUnitAtLoc( GetOwningPlayer(caster), 'u000', loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1, 'BTLF', dummy )
call UnitAddAbilityBJ( 'A018', dummy )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", target )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
call RemoveLocation(loc)
set loc = null
set caster = null
set target = null
set dummy = null
endfunction
// Actions ab Landung: Timer, Gruppenerkennung, Schaden usw.
function Trig_Sprungangriff_Landung takes unit caster, integer lvl returns nothing
local location loc = GetUnitLoc(caster)
local real distanz = 2.50
local timer t = CreateTimer()
local integer iter = 0
local group g
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" )
call AddSpecialEffectLocBJ( loc, "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" )
set udg_g_integer[13] = lvl
set udg_g_unit[8] = caster
set g = GetUnitsInRangeOfLocMatching(150.00, loc, Condition(function Trig_Sprungangriff_Groupcond))
call ForGroupBJ( g, function Trig_Sprungangriff_Damage )
call SaveReal(udg_bierfass, GetHandleId(t), 187, distanz)
call SaveInteger(udg_bierfass, GetHandleId(t), 188, iter)
call SaveGroupHandle(udg_bierfass, GetHandleId(t), 189, g)
call TimerStart(t, 0.01, true, function Trig_Sprungangriff_Moveunit)
call RemoveLocation(loc)
set loc = null
set caster = null
set t = null
set g = null
endfunction
function Trig_Sprungangriff_Move takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = LoadUnitHandle(udg_bierfass, GetHandleId(t), 180)
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 181)
local integer wende = LoadInteger(udg_bierfass, GetHandleId(t), 182)
local real tempo = LoadReal(udg_bierfass, GetHandleId(t), 184)
local real winkel = LoadReal(udg_bierfass, GetHandleId(t), 185)
local real strecke = LoadReal(udg_bierfass, GetHandleId(t), 186)
local location loc
set iter = iter + 1
call SaveInteger(udg_bierfass, GetHandleId(t), 181, iter)
if ( IsUnitAliveBJ(caster) ) then
if ( iter <= wende ) then
set tempo = tempo - (4 / I2R(wende))
call SaveReal(udg_bierfass, GetHandleId(t), 184, tempo)
call SetUnitFlyHeightBJ( caster, SquareRoot( 2000 * iter ), 10000 )
else
set tempo = tempo - (4 / I2R(wende))
call SaveReal(udg_bierfass, GetHandleId(t), 184, tempo)
call SetUnitFlyHeightBJ( caster, SquareRoot( 2000 * ((2*wende) - iter) ), 10000 )
endif
set loc = PolarProjectionBJ(GetUnitLoc(caster), tempo, winkel )
call SetUnitPositionLoc( caster, loc )
if ( iter == 2*wende ) then
call SetUnitFlyHeightBJ( caster, 0, 10000 )
call Trig_Sprungangriff_Landung(caster, LoadInteger(udg_bierfass, GetHandleId(t), 183))
call SetUnitPathing( caster, true )
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
else
call SetUnitFlyHeightBJ( caster, 0, 10000 )
call SetUnitPathing( caster, true )
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
endif
call RemoveLocation(loc)
set loc = null
set t = null
set caster = null
endfunction
function Trig_Sprungangriff_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit caster = GetSummoningUnit()
local location loc = GetUnitLoc(caster)
local location loc2 = GetUnitLoc(GetSummonedUnit())
local integer iter = 0
local real strecke = DistanceBetweenPoints(loc, loc2)
local integer wende = R2I(strecke / 12)
local real tempo = 10.00
local real winkel = AngleBetweenPoints(loc, loc2)
local integer lvl
if ( (GetUnitAbilityLevel(caster, 'A02N') == 1) or (GetUnitAbilityLevel(caster, 'A02O') == 1) ) then
set lvl = 1
endif
if (GetUnitAbilityLevel(caster, 'A02O') == 2) then
set lvl = 2
endif
call UnitAddAbilityBJ( 'Amrf', caster )
call UnitRemoveAbilityBJ( 'Amrf', caster )
call SetUnitPathing( caster, false )
call SaveUnitHandle(udg_bierfass, GetHandleId(t), 180, caster)
call SaveInteger(udg_bierfass, GetHandleId(t), 181, iter)
call SaveInteger(udg_bierfass, GetHandleId(t), 182, wende)
call SaveInteger(udg_bierfass, GetHandleId(t), 183, lvl)
call SaveReal(udg_bierfass, GetHandleId(t), 184, tempo)
call SaveReal(udg_bierfass, GetHandleId(t), 185, winkel)
call SaveReal(udg_bierfass, GetHandleId(t), 186, strecke)
call TimerStart(t, 0.01, true, function Trig_Sprungangriff_Move)
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
set t = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Sprungangriff takes nothing returns nothing
set gg_trg_Sprungangriff = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Sprungangriff, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Sprungangriff, Condition( function Trig_Sprungangriff_Conditions ) )
call TriggerAddAction( gg_trg_Sprungangriff, function Trig_Sprungangriff_Actions )
endfunction
function Trig_Bash_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A00O' ) or ( GetSpellAbilityId() == 'A00Q' ) or ( GetSpellAbilityId() == 'A00Z' ) or ( GetSpellAbilityId() == 'A00P' ) or ( GetSpellAbilityId() == 'A00Y' ) or ( GetSpellAbilityId() == 'A054' ) or ( GetSpellAbilityId() == 'A07M' ) or ( GetSpellAbilityId() == 'A08J' ) )then
return true
endif
return false
endfunction
function Trig_Bash_Actions takes nothing returns nothing
local real damage
local real damage2
local real scaler
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local location loc = GetUnitLoc(GetSpellTargetUnit())
local boolean crit = true
// Level 1-3 Beide
if ( GetSpellAbilityId() == 'A00O' ) then
set damage = ( 50 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)) ) + GetRandomReal(0,50)
set scaler = damage / ( ( 50 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)) ) + 50 )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
call CreateNUnitsAtLoc( 1, 'u001', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A00X', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "magicleash", target )
call UnitApplyTimedLifeBJ( ( 0.10 * I2R(GetHeroStatBJ(bj_HEROSTAT_STR, caster, false)) ), 'BTLF', GetLastCreatedUnit() )
endif
// Level 3-9 Def
if ( ( GetSpellAbilityId() == 'A00P' ) or ( GetSpellAbilityId() == 'A00Q' ) ) then
set damage = ( 50 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)) ) + GetRandomReal(0,50)
set scaler = damage / ( ( 50 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)) ) + 50 )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
call CreateNUnitsAtLoc( 1, 'u001', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A055', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "magicleash", target )
call UnitApplyTimedLifeBJ( ( 0.20 * I2R(GetHeroStatBJ(bj_HEROSTAT_STR, caster, false)) ), 'BTLF', GetLastCreatedUnit() )
endif
// Level 3-9 Off
if ( ( GetSpellAbilityId() == 'A00Y' ) or ( GetSpellAbilityId() == 'A00Z' ) )then
set damage = ( 75 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster) - 1) ) + GetRandomReal(0,50)
set scaler = damage / ( 75 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster) - 1) + 50 )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
call CreateNUnitsAtLoc( 1, 'u001', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A00X', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "magicleash", target )
call UnitApplyTimedLifeBJ( ( 0.10 * I2R(GetHeroStatBJ(bj_HEROSTAT_STR, caster, false)) ), 'BTLF', GetLastCreatedUnit() )
endif
// Level 6-9 Pala
if ( GetSpellAbilityId() == 'A054' ) then
set damage = ( 25 * I2R(GetUnitAbilityLevel(caster,GetSpellAbilityId())) ) + GetRandomReal(0,25)
set scaler = damage / ( ( 25 * I2R(GetUnitAbilityLevel(caster, GetSpellAbilityId())) ) + 25 )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
if ( IsUnitDemonOrUndead(target) ) then
set damage2 = GetRandomReal(2,3) * damage
set scaler = damage2 / (damage * 3)
call DamageTargetWithTextMagic(caster, target, damage2, scaler, crit)
call AddSpecialEffectTargetUnitBJ( "origin", caster, "Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl" )
endif
call CreateNUnitsAtLoc( 1, 'u001', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A00X', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "magicleash", target )
call UnitApplyTimedLifeBJ( ( 0.10 * I2R(GetHeroStatBJ(bj_HEROSTAT_STR, caster, false)) ), 'BTLF', GetLastCreatedUnit() )
endif
// Level 6-9 Battlemage
if ( GetSpellAbilityId() == 'A07M' ) then
set damage = GetRandomReal(I2R(25 * GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))+75,I2R(50 * GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))-50)
set scaler = damage / ( I2R(50 * GetUnitAbilityLevel(caster, GetSpellAbilityId()))-50 )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
set damage = GetRandomReal(I2R(25 * GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))+75,I2R(50 * GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))-50)
set scaler = damage / ( I2R(50 * GetUnitAbilityLevel(caster, GetSpellAbilityId()))-50 )
call DamageTargetWithTextMagic(caster, target, damage, scaler, crit)
call AddSpecialEffectTargetUnitBJ( "origin", caster, "Abilities\\Spells\\Items\\AIim\\AIimTarget.mdl" )
call CreateNUnitsAtLoc( 1, 'u001', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A00X', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "magicleash", target )
call UnitApplyTimedLifeBJ( ( 0.10 * I2R(GetHeroStatBJ(bj_HEROSTAT_STR, caster, false)) ), 'BTLF', GetLastCreatedUnit() )
endif
// Warlock's Slave - Pummel
if ( GetSpellAbilityId() == 'A08J' )then
set damage = GetRandomReal(500,1000)
set scaler = GetRandomReal(0.80,1.00)
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
call CreateNUnitsAtLoc( 1, 'u001', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A00X', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "magicleash", target )
call UnitApplyTimedLifeBJ( ( 0.10 * I2R(GetHeroStatBJ(bj_HEROSTAT_STR, caster, false)) ), 'BTLF', GetLastCreatedUnit() )
endif
call RemoveLocation(loc)
set loc = null
set target = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Bash takes nothing returns nothing
set gg_trg_Bash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Bash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Bash, Condition( function Trig_Bash_Conditions ) )
call TriggerAddAction( gg_trg_Bash, function Trig_Bash_Actions )
endfunction
function Trig_Battle_Shout_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A011' ) or ( GetSpellAbilityId() == 'A012' ) ) then
return true
endif
return false
endfunction
function Trig_Battle_Shout_Actions takes nothing returns nothing
local location loc = GetUnitLoc(GetSpellAbilityUnit())
local unit dummy = CreateUnitAtLoc( GetOwningPlayer(GetSpellAbilityUnit()), 'u000', loc, bj_UNIT_FACING )
call UnitAddAbility( dummy, 'A013' )
call SetUnitAbilityLevel( dummy, 'A013', GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) )
call IssueImmediateOrder( dummy, "howlofterror" )
call UnitApplyTimedLife( dummy, 'BTLF', 3.00 )
call RemoveLocation(loc)
set loc = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Battle_Shout takes nothing returns nothing
set gg_trg_Battle_Shout = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Battle_Shout, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Battle_Shout, Condition( function Trig_Battle_Shout_Conditions ) )
call TriggerAddAction( gg_trg_Battle_Shout, function Trig_Battle_Shout_Actions )
endfunction
function Trig_Guardian_Angel_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetTriggerUnit()) == 'H00H' ) then
return true
endif
return false
endfunction
function Guardian_Angel_CD takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(udg_bierfass, GetHandleId(t), 191)
call SaveBoolean(udg_bierfass, GetHandleId(u), 190, true)
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
set t = null
set u = null
endfunction
function Trig_Guardian_Angel_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit t = GetAttacker()
local unit dummy
local real heal
local real scaler
local real damage
local location loc = GetUnitLoc(u)
local location loc1 = GetUnitLoc(t)
local timer cd
if ( LoadBoolean(udg_bierfass, GetHandleId(u), 190) == true ) then
if ( LoadBoolean(udg_bierfass, GetHandleId(u), 179) == true ) then
if ( GetRandomInt(1, 10) <= 7 ) then
set heal = (GetUnitAbilityLevel(u, 'A07I')*10) - GetRandomReal(25,35)
set scaler = 0.75 * heal / ( (GetUnitAbilityLevel(u, 'A07I')*10) - 25 )
call HealTargetWithTextMagic(u, u, heal, scaler, false)
set dummy = CreateUnitAtLoc(GetOwningPlayer(u), 'u000', loc, 0)
call UnitAddAbility(dummy, 'A07J')
call UnitApplyTimedLife(dummy, 'BTLF', 3)
call IssueTargetOrder(dummy, "purge", u)
call SaveBoolean(udg_bierfass, GetHandleId(u), 190, false)
set cd = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(cd), 191, u)
call TimerStart(cd, 0.75, false, function Guardian_Angel_CD)
endif
if ( ( GetRandomInt(1, 2) == 5 ) and ( DistanceBetweenPoints(loc, loc1) <= 350 ) ) then
set damage = 2*((GetUnitAbilityLevel(u, 'A07I')*25) - GetRandomReal(25,50))
set scaler = 0.75 * damage / (2*((GetUnitAbilityLevel(u, 'A07I')*25) - 25))
call DamageTargetWithTextMagic(u, t, damage, scaler, false)
call SaveBoolean(udg_bierfass, GetHandleId(u), 190, false)
set cd = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(cd), 191, u)
call TimerStart(cd, 0.75, false, function Guardian_Angel_CD)
endif
else
if ( GetRandomInt(1, 20) <= 7 ) then
set heal = (GetUnitAbilityLevel(u, 'A07I')*10) - GetRandomReal(25,35)
set scaler = 0.75 * heal / ( (GetUnitAbilityLevel(u, 'A07I')*10) - 25 )
call HealTargetWithTextMagic(u, u, heal, scaler, false)
set loc = GetUnitLoc(u)
set dummy = CreateUnitAtLoc(GetOwningPlayer(u), 'u000', loc, 0)
call UnitAddAbility(dummy, 'A07J')
call UnitApplyTimedLife(dummy, 'BTLF', 3)
call IssueTargetOrder(dummy, "purge", u)
call SaveBoolean(udg_bierfass, GetHandleId(u), 190, false)
set cd = CreateTimer()
call SaveUnitHandle(udg_bierfass, GetHandleId(cd), 191, u)
call TimerStart(cd, 0.75, false, function Guardian_Angel_CD)
endif
endif
endif
call RemoveLocation(loc)
call RemoveLocation(loc1)
set u = null
set t = null
set dummy = null
set loc = null
set loc1 = null
set cd = null
endfunction
//===========================================================================
function InitTrig_Guardian_Angel takes nothing returns nothing
set gg_trg_Guardian_Angel = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Guardian_Angel, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Guardian_Angel, Condition( function Trig_Guardian_Angel_Conditions ) )
call TriggerAddAction( gg_trg_Guardian_Angel, function Trig_Guardian_Angel_Actions )
endfunction
function Trig_Shieldbash_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A00V' ) then
return true
endif
return false
endfunction
function Trig_Shieldbash_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[2])) == true ) and ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == false ) ) then
return true
endif
return false
endfunction
function Trig_Shieldbash_Groupmove takes nothing returns nothing
local location loc
local real winkel = udg_g_real[2]
local real distanz = udg_g_real[3]
if ( IsUnitAliveBJ(GetEnumUnit()) ) then
set loc = PolarProjectionBJ(GetUnitLoc(GetEnumUnit()), distanz, ( winkel + GetRandomReal(-10.00, 10.00) ))
call SetUnitPositionLoc( GetEnumUnit(), loc )
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Shieldbash_Move takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer iter = LoadInteger(udg_bierfass, GetHandleId(t), 194)
local real winkel = LoadReal(udg_bierfass, GetHandleId(t), 193)
local real distanz = LoadReal(udg_bierfass, GetHandleId(t), 192)
local group g = LoadGroupHandle(udg_bierfass, GetHandleId(t), 195)
set iter = iter + 1
call SaveInteger(udg_bierfass, GetHandleId(t), 194, iter)
set udg_g_real[2] = winkel
set udg_g_real[3] = distanz
call ForGroupBJ( g, function Trig_Shieldbash_Groupmove )
set distanz = distanz - 0.10
call SaveReal(udg_bierfass, GetHandleId(t), 192, distanz)
if ( iter == 50 ) then
call PauseTimerBJ( true, t )
call FlushChildHashtable(udg_bierfass, GetHandleId(t))
call DestroyTimer(t)
call DestroyGroup(g)
endif
set t = null
set g = null
endfunction
function Trig_Shieldbash_Damage takes nothing returns nothing
local real damage
local integer int
local real scaler
local unit caster = udg_g_unit[2]
local unit target = GetEnumUnit()
local boolean crit = true
local location loc = GetUnitLoc(caster)
set damage = GetRandomReal(200.00, 300.00)
set scaler = damage / 300
set damage = damage + ( 3 * I2R(GetHeroStatBJ(bj_HEROSTAT_STR, caster, true)) )
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A018', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", target )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
call RemoveLocation(loc)
set loc = null
set target = null
set caster = null
endfunction
function Trig_Shieldbash_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetUnitLoc(caster)
local location loc2 = GetSpellTargetLoc()
local real distanz = 5.00
local real winkel = AngleBetweenPoints(loc, loc2)
local timer t = CreateTimer()
local integer iter = 0
local group g
set udg_g_unit[2] = GetSpellAbilityUnit()
set g = GetUnitsInRangeOfLocMatching(150.00, loc2, Condition(function Trig_Shieldbash_Groupcond))
call AddSpecialEffectLocBJ( loc2, "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" )
call AddSpecialEffectLocBJ( PolarProjectionBJ(loc2, 25.00, winkel), "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" )
call ForGroupBJ( g, function Trig_Shieldbash_Damage )
call SaveReal(udg_bierfass, GetHandleId(t), 192, distanz)
call SaveReal(udg_bierfass, GetHandleId(t), 193, winkel)
call SaveInteger(udg_bierfass, GetHandleId(t), 194, iter)
call SaveGroupHandle(udg_bierfass, GetHandleId(t), 195, g)
call TimerStart(t, 0.01, true, function Trig_Shieldbash_Move)
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
set g = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Shieldbash takes nothing returns nothing
set gg_trg_Shieldbash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shieldbash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shieldbash, Condition( function Trig_Shieldbash_Conditions ) )
call TriggerAddAction( gg_trg_Shieldbash, function Trig_Shieldbash_Actions )
endfunction
function Trig_Vengeance_Dummys_Conditions takes nothing returns boolean
local location loc
local location loc2
if ( GetUnitTypeId(GetAttackedUnitBJ()) == 'H002' ) then
set loc = GetUnitLoc(GetAttackedUnitBJ())
set loc2 = GetUnitLoc(GetAttacker())
if ( ( UnitHasBuffBJ(GetAttackedUnitBJ(), 'B009') ) and ( DistanceBetweenPoints(loc, loc2) <= 200.00 ) ) then
call RemoveLocation(loc)
call RemoveLocation(loc2)
set loc = null
set loc2 = null
return true
endif
endif
call RemoveLocation(loc)
call RemoveLocation(loc2)
set loc = null
set loc2 = null
return false
endfunction
function Trig_Vengeance_Dummys_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetAttacker()
local unit dummy
local real damage
local real scaler
local boolean crit = true
local location loc = GetUnitLoc(caster)
local location loc2 = GetUnitLoc(target)
local real winkel = AngleBetweenPoints(loc, loc2)
set damage = ( GetHeroStatBJ(bj_HEROSTAT_AGI, caster, true) * GetRandomReal(2,3) )
set scaler = damage / ( GetHeroStatBJ(bj_HEROSTAT_AGI, caster, true) * 3 )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
set dummy = CreateUnitAtLoc( GetOwningPlayer(caster), 'h00I', loc, winkel )
call SetUnitVertexColorBJ(dummy, 100, 100, 100, 80)
call SetUnitTimeScalePercent( dummy, 175.00 )
call SetUnitAnimation( dummy, "attack" )
call PolledWait(0.50)
call FadeUnitOut(dummy, 100, 100, 100, 80, 50, true)
call RemoveLocation(loc)
call RemoveLocation(loc2)
set loc = null
set loc2 = null
set caster = null
set target = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Vengeance_Dummys takes nothing returns nothing
set gg_trg_Vengeance_Dummys = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Vengeance_Dummys, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Vengeance_Dummys, Condition( function Trig_Vengeance_Dummys_Conditions ) )
call TriggerAddAction( gg_trg_Vengeance_Dummys, function Trig_Vengeance_Dummys_Actions )
endfunction
function Trig_Vengeance_Off_Conditions2 takes nothing returns boolean
if ( ( GetIssuedOrderIdBJ() == String2OrderIdBJ("stop") ) ) then
return true
endif
if ( ( GetIssuedOrderIdBJ() == String2OrderIdBJ("move") ) ) then
return true
endif
if ( ( GetIssuedOrderIdBJ() == String2OrderIdBJ("smart") ) ) then
return true
endif
if ( ( GetIssuedOrderIdBJ() == String2OrderIdBJ("attack") ) ) then
return true
endif
if ( ( GetIssuedOrderIdBJ() == String2OrderIdBJ("ward") ) ) then
return true
endif
return false
endfunction
function Trig_Vengeance_Off_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetOrderedUnit()) == 'H002' ) ) then
return false
endif
if ( not ( UnitHasBuffBJ(GetOrderedUnit(), 'B009') == true ) ) then
return false
endif
if ( not (DistanceBetweenPoints(GetUnitLoc(GetOrderedUnit()), GetUnitLoc(GetOrderTargetUnit())) > 100) ) then
return false
endif
if ( not Trig_Vengeance_Off_Conditions2() ) then
return false
endif
return true
endfunction
function Trig_Vengeance_Off_Actions takes nothing returns nothing
local unit u = GetOrderedUnit()
call UnitRemoveBuffBJ( 'B009', u )
set u = null
endfunction
//===========================================================================
function InitTrig_Vengeance_Off takes nothing returns nothing
set gg_trg_Vengeance_Off = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Vengeance_Off, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Vengeance_Off, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Vengeance_Off, EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Vengeance_Off, Condition( function Trig_Vengeance_Off_Conditions ) )
call TriggerAddAction( gg_trg_Vengeance_Off, function Trig_Vengeance_Off_Actions )
endfunction
function Trig_Last_Stand_Requirement_Conditions takes nothing returns boolean
if ( ( GetLearnedSkillBJ() == 'A00U' ) or ( GetLearnedSkillBJ() == 'A00T' ) ) then
return true
endif
return false
endfunction
function Trig_Last_Stand_Check takes nothing returns nothing
local timer t = GetExpiredTimer()
local player p = LoadPlayerHandle(udg_bierfass, GetHandleId(t), 196)
local unit hero = udg_HeroID[GetConvertedPlayerId(p)]
local unit dummy = LoadUnitHandle(udg_bierfass, GetHandleId(p), 198)
local location loc = Location(7250.00, -7250.00)
if ( ( dummy == null ) and ( GetUnitLifePercent(hero) < 50 ) ) then
set dummy = CreateUnitAtLoc(p, 'u00K', loc, 0)
call SaveUnitHandle(udg_bierfass, GetHandleId(p), 198, dummy)
endif
if ( ( dummy != null ) and ( GetUnitLifePercent(hero) >= 50 ) ) then
call RemoveUnit(dummy)
call SaveUnitHandle(udg_bierfass, GetHandleId(p), 198, null)
endif
set t = null
set hero = null
set dummy = null
call RemoveLocation(loc)
set loc = null
set p = null
endfunction
function Trig_Last_Stand_Requirement_Actions takes nothing returns nothing
local timer t = CreateTimer()
local player p = GetOwningPlayer(GetLearningUnit())
if ( GetLearnedSkillBJ() == 'A00U' ) then
call UnitAddAbilityBJ( 'A056', GetLearningUnit() )
call SetUnitAbilityLevelSwapped( 'A056', GetLearningUnit(), 1 )
endif
if ( ( GetLearnedSkillBJ() == 'A00T' ) and ( GetUnitAbilityLevel(GetLearningUnit(), 'A056') != 1 ) )then
call UnitAddAbilityBJ( 'A056', GetLearningUnit() )
call SetUnitAbilityLevelSwapped( 'A056', GetLearningUnit(), 1 )
endif
call SavePlayerHandle(udg_bierfass, GetHandleId(t), 196, p)
call SaveTimerHandle(udg_bierfass, GetHandleId(p), 197, t)
call TimerStart(t, 1.00, true, function Trig_Last_Stand_Check)
set t = null
set p = null
endfunction
//===========================================================================
function InitTrig_Last_Stand_Requirement takes nothing returns nothing
set gg_trg_Last_Stand_Requirement = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Last_Stand_Requirement, EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_Last_Stand_Requirement, Condition( function Trig_Last_Stand_Requirement_Conditions ) )
call TriggerAddAction( gg_trg_Last_Stand_Requirement, function Trig_Last_Stand_Requirement_Actions )
endfunction
function Trig_Last_Stand_Cast_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A056' ) then
return true
endif
return false
endfunction
function Trig_Last_Stand_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[26])) == true ) ) then
return true
endif
return false
endfunction
function Trig_Last_Stand_Groupaction takes nothing returns nothing
local real damage
local real scaler
local unit caster = udg_g_unit[26]
local unit target = GetEnumUnit()
local boolean crit = false
set damage = GetRandomReal( (50+(100*GetUnitAbilityLevelSwapped('A056', caster))), (250*GetUnitAbilityLevelSwapped('A056', caster)))
set scaler = damage / (250*GetUnitAbilityLevelSwapped('A056', caster))
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
set caster = null
set target = null
endfunction
function Trig_Last_Stand_Cast_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetUnitLoc(GetSpellAbilityUnit())
local real heal
local group g
set udg_g_unit[26] = caster
set g = GetUnitsInRangeOfLocMatching(260.00, loc, Condition(function Trig_Last_Stand_Groupcond))
call ForGroupBJ( g, function Trig_Last_Stand_Groupaction )
set heal = ( 0.1 + (0.2 * GetUnitAbilityLevelSwapped('A056', caster) ) ) * ( GetUnitStateSwap(UNIT_STATE_MAX_LIFE, caster) - GetUnitStateSwap(UNIT_STATE_LIFE, caster) )
call HealTargetWithTextMagic(caster, caster, heal, 1, false)
call RemoveLocation(loc)
set loc = null
call DestroyGroup(g)
set g = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Last_Stand_Cast takes nothing returns nothing
set gg_trg_Last_Stand_Cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Last_Stand_Cast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Last_Stand_Cast, Condition( function Trig_Last_Stand_Cast_Conditions ) )
call TriggerAddAction( gg_trg_Last_Stand_Cast, function Trig_Last_Stand_Cast_Actions )
endfunction
function Trig_Disarm_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A00S' ) or ( GetSpellAbilityId() == 'A059' ) ) then
return true
endif
return false
endfunction
function Trig_Disarm_Actions takes nothing returns nothing
local integer i
local real damage
local real scaler
local boolean crit = true
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local location loc = GetUnitLoc(target)
set damage = GetRandomReal( (65 + 10 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))), (85 + 15 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))) )
set scaler = damage / (85 + 15 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster)))
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
if ( UnitHasBuffBJ(target, 'B01H') ) then
set i = LoadInteger(udg_bierfass, GetHandleId(target), 199)
else
set i = 0
endif
set i = i + 1
if ( i > ( 4 + GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster) ) ) then
set i = ( 4 + GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster) )
endif
call SaveInteger(udg_bierfass, GetHandleId(target), 199, i)
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A057', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A057', GetLastCreatedUnit(), i )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "innerfire", target )
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A058', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A058', GetLastCreatedUnit(), i )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "acidbomb", target )
call RemoveLocation(loc)
set loc = null
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Disarm takes nothing returns nothing
set gg_trg_Disarm = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Disarm, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Disarm, Condition( function Trig_Disarm_Conditions ) )
call TriggerAddAction( gg_trg_Disarm, function Trig_Disarm_Actions )
endfunction
function Trig_Disarm_Handleremove_Conditions takes nothing returns boolean
if ( GetOwningPlayer(GetDyingUnit()) == Player(0) ) then
return true
endif
return false
endfunction
function Trig_Disarm_Handleremove_Actions takes nothing returns nothing
call SaveInteger(udg_bierfass, GetHandleId(GetDyingUnit()), 199, 0)
endfunction
//===========================================================================
function InitTrig_Disarm_Handleremove takes nothing returns nothing
set gg_trg_Disarm_Handleremove = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Disarm_Handleremove, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Disarm_Handleremove, Condition( function Trig_Disarm_Handleremove_Conditions ) )
call TriggerAddAction( gg_trg_Disarm_Handleremove, function Trig_Disarm_Handleremove_Actions )
endfunction