scope SubwayQuest initializer init
globals
public trigger array Quest
public boolean array Started
public boolean array Finished
endglobals
private function PingIt takes nothing returns boolean
if GetDestructableTypeId(GetFilterDestructable()) == 'DTlv' then
call PingMinimapForPlayer( GetOwningPlayer(TEMP), GetDestructableX(GetFilterDestructable()), GetDestructableY(GetFilterDestructable()), 10 )
endif
return false
endfunction
function AreHavensUnlocked takes nothing returns boolean
return IsTriggerEnabled(TPHaven4th_Trigger[0]) and IsTriggerEnabled(TPHaven5th_Trigger[0]) and IsTriggerEnabled(TPHaven8th_Trigger[0]) and IsTriggerEnabled(TPHaven12th_Trigger[0]) and IsTriggerEnabled(TPHaven14th_Trigger[0])
endfunction
private function Actions2 takes nothing returns boolean
local integer id = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
if RectContainsUnit(gg_rct_BishopHome, Bishop) and GetTriggerUnit() == Slayer[id] and Started[id] and not(IsUnitType(Bishop, UNIT_TYPE_DEAD) or Finished[id] or AreHavensUnlocked()) then
set Finished[id] = true
call ClearScreenForce(bj_FORCE_PLAYER[3])
if not(IsUnitInGroup(Bishop, inBattle) or IsUnitInGroup(Slayer[id], inBattle))then
call CinematicModeExBJ( true, bj_FORCE_PLAYER[id], 0.8 )
call TransmissionFromUnitWithNameBJ( bj_FORCE_PLAYER[id], Bishop, "|cffaca899BISHOP|r", null, "You have cut off the network that moves them, and sealed them above the surface. Because of that they will grow weaker, but stopping them there is only the beginning. We must perservere in deterring their movements; Never give up.", bj_TIMETYPE_SET, 15.00, true )
call CinematicModeExBJ( false, bj_FORCE_PLAYER[id], 0.8 )
endif
call DisplayTextToPlayer( Player(3), 0, 0, "|cffaca899BISHOP|r: You have cut off the network that moves them, and sealed them above the surface. Because of that they will grow weaker, but stopping them there is only the beginning. We must perservere in deterring their movements; Never give up." )
call SetPlayerState(Player(id), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(Player(id), PLAYER_STATE_RESOURCE_LUMBER) + 15 )
call DisplayColoredTagTarget(GetTriggerUnit(), "+15")
endif
return false
endfunction
private function Actions1 takes nothing returns boolean
local integer id = GetPlayerId(GetTriggerPlayer())
if RectContainsUnit(gg_rct_BishopHome, Slayer[id]) and not(IsUnitType(Bishop, UNIT_TYPE_DEAD) or Started[id])then
if GetHeroLevel(Lieutenant) > 4 then
set Started[id] = true
call ClearScreenForce(bj_FORCE_PLAYER[id])
if not(IsUnitInGroup(Bishop, inBattle) or IsUnitInGroup(Slayer[id], inBattle))then
call CinematicModeExBJ( true, bj_FORCE_PLAYER[id], 0.8 )
call TransmissionFromUnitWithNameBJ( bj_FORCE_PLAYER[id], Bishop, "|cffaca899BISHOP|r", null, "The underground tunnels that connect the city were forged with the coal powered locomotive in mind. It's quite the ingenious device. Still the tunnels have given rise to the underground havens, where the vampires hide from the sun while moving around the city. Close off every haven and return to me with them all closed. Cut off their network and you wil effectively leave them hindred.", bj_TIMETYPE_SET, 15.00, true )
call CinematicModeExBJ( false, bj_FORCE_PLAYER[id], 0.8 )
endif
set TEMP = Slayer[id]
call EnumDestructablesInRect( bj_mapInitialPlayableArea, function PingIt, null )
call DisplayTextToPlayer(Player(id), 0, 0, "|cffaca899BISHOP|r: The underground tunnels that connect the city were forged with the coal powered locomotive in mind. It's quite the ingenious device. Still the tunnels have given rise to the underground havens, where the vampires hide from the sun while moving around the city. Close off every haven and return to me with them all closed. Cut off their network and you wil effectively leave them hindred." )
if Quest[2] == null then
set Quest[2] = CreateTrigger()
call TriggerRegisterEnterRectSimple( Quest[2], gg_rct_BishopHome )
call TriggerAddCondition( Quest[2], function Actions2 )
endif
else
call DisplayTextToPlayer(Player(id), 0, 0, "|cffaca899BISHOP|r: Your heart is willing, but your body is weak. Ask again when you've reached level 5." )
endif
endif
return false
endfunction
//===========================================================================
public function init takes nothing returns nothing
local integer i = 0
set Quest[1] = CreateTrigger()
loop
exitwhen i > 11
call TriggerRegisterPlayerChatEvent( Quest[1], Player(i), "-subway", true )
set i = i + 1
endloop
call TriggerAddAction( Quest[1], function Actions1 )
endfunction
endscope