Name | Type | is_array | initial_value |
Non_Vamps_Left | integer | No | |
timer | timerdialog | No | |
VampAllies | force | No | |
Vampire | player | No | Player11 |
function Trig_Convert_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'hpea' ) ) then
return false
endif
return true
endfunction
function Trig_Convert_Func002002 takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_Convert_Actions takes nothing returns nothing
local player p = GetOwningPlayer(GetTriggerUnit())
set udg_Non_Vamps_Left = udg_Non_Vamps_Left - 1
call ForceAddPlayerSimple( p, udg_VampAllies )
call PlaySoundBJ( gg_snd_HumanDeath )
call ForGroupBJ( GetUnitsOfPlayerAll(p), function Trig_Convert_Func002002)
call DisplayTextToForce( GetPlayersAll(), GetPlayerName(p) + " got owned and has joined the vampires." )
call TriggerSleepAction(1)
call AddSpecialEffectLocBJ( GetUnitLoc(GetTriggerUnit()), "Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl" )
call TriggerSleepAction(4)
call ForceAddPlayerSimple( p, GetPlayersAllies(udg_Vampire) )
call ForceRemovePlayerSimple( p, GetPlayersEnemies(udg_Vampire) )
call CreateNUnitsAtLoc( 1, 'Udre', p, GetUnitLoc(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()) )
call PanCameraToTimedLocForPlayer( p, GetPlayerStartLocationLoc(Player(0)), 1 )
call SetForceAllianceStateBJ( GetPlayersAllies(udg_Vampire), GetForceOfPlayer(p), bj_ALLIANCE_ALLIED_VISION )
call SetForceAllianceStateBJ( GetForceOfPlayer(p), GetPlayersAllies(udg_Vampire), bj_ALLIANCE_ALLIED_VISION )
call SetForceAllianceStateBJ( GetPlayersEnemies(udg_Vampire), GetForceOfPlayer(p), bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ( GetForceOfPlayer(p), GetPlayersEnemies(udg_Vampire), bj_ALLIANCE_UNALLIED )
if ( udg_Non_Vamps_Left == 0 ) then
call DisplayTextToForce( GetPlayersAll(), "|cffff0000All humans have been transformed into vampires!|r" )
call TriggerExecute( gg_trg_VampireWins )
call DestroyTrigger(GetTriggeringTrigger())
call DestroyTrigger(gg_trg_Vampire_Death)
call DestroyTrigger(gg_trg_Vamp_Leader_Leaves)
call DestroyTrigger(gg_trg_VampireWins)
else
endif
endfunction
//===========================================================================
function InitTrig_Convert takes nothing returns nothing
set gg_trg_Convert = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Convert, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Convert, Condition( function Trig_Convert_Conditions ) )
call TriggerAddAction( gg_trg_Convert, function Trig_Convert_Actions )
endfunction
function Trig_Vamp_Leader_Leaves_Func003A takes nothing returns nothing
call CustomDefeatBJ( GetEnumPlayer(), "You can blame|n"+GetPlayerName(udg_Vampire) )
endfunction
function Trig_Vamp_Leader_Leaves_Func004A takes nothing returns nothing
call CustomVictoryBJ( GetEnumPlayer(), true, true )
endfunction
function Trig_Vamp_Leader_Leaves_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), "The Vampire Leader has wussed out and left the game!" )
call ForForce( udg_VampAllies, function Trig_Vamp_Leader_Leaves_Func003A )
call ForForce( GetPlayersEnemies(udg_Vampire), function Trig_Vamp_Leader_Leaves_Func004A )
endfunction
//===========================================================================
function InitTrig_Vamp_Leader_Leaves takes nothing returns nothing
set gg_trg_Vamp_Leader_Leaves = CreateTrigger( )
call TriggerRegisterPlayerEventLeave( gg_trg_Vamp_Leader_Leaves, udg_Vampire )
call TriggerAddAction( gg_trg_Vamp_Leader_Leaves, function Trig_Vamp_Leader_Leaves_Actions )
endfunction