-
Notifications
You must be signed in to change notification settings - Fork 1
/
ME5_ObjectiveGoto.lua
68 lines (52 loc) · 1.64 KB
/
ME5_ObjectiveGoto.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
local __SCRIPT_NAME = "ME5_ObjectiveGoto";
local debug = true
local function PrintLog(...)
if debug == true then
print("["..__SCRIPT_NAME.."]", unpack(arg));
end
end
PrintLog("Entered")
ScriptCB_DoFile("ME5_Objective")
--=============================
-- ObjectiveGoto
-- Handles the logic for a simple "go to this region" objective
--=============================
ObjectiveGoto = Objective:New
{
-- required values
regionName = "noname",
mapIcon = "imp_icon",
}
function ObjectiveGoto:Start()
--===============================
-- Initialization logic
--===============================
--initialize the base objective data first
Objective.Start(self)
ActivateRegion(self.regionName)
MapAddRegionMarker(self.regionName, self.mapIcon, 2.5, self.teamATT, "YELLOW", true)
MapAddRegionMarker(self.regionName, self.mapIcon, 2.5, self.teamDEF, "YELLOW", true)
--set AI goals
self.AIGoals = {}
if self.AIGoalWeight > 0.0 then
table.insert(self.AIGoals, AddAIGoal(self.teamATT, "Deathmatch", 100*self.AIGoalWeight))
table.insert(self.AIGoals, AddAIGoal(self.teamDEF, "Deathmatch", 100*self.AIGoalWeight))
end
--=======================================
-- Event responses
--=======================================
OnEnterRegion(
function(regionPtr, characterId)
if self.isComplete then return end
if IsCharacterHuman(characterId) then
MapRemoveRegionMarker(self.regionName)
self:Complete( GetCharacterTeam(characterId) )
end
end,
self.regionName
)
end
PrintLog("Exited")