share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/final.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Wed, 18 Sep 2013 03:09:31 +0300
branchspacecampaign
changeset 9637 b23f9b7d49fa
parent 9634 8032df67a249
child 9642 8a691e0f117a
permissions -rw-r--r--
added event for meteorite mission
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9632
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     1
------------------- ABOUT ----------------------
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     2
--
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     3
-- Hero has collected all the anti-gravity device
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     4
-- parts but because of the size of the meteorite
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     5
-- he needs to detonate some faulty explosives that
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     6
-- PAotH have previously placed on it.
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     7
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     8
HedgewarsScriptLoad("/Scripts/Locale.lua")
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     9
HedgewarsScriptLoad("/Scripts/Animate.lua")
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    10
HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua")
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    11
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    12
----------------- VARIABLES --------------------
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    13
-- globals
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    14
local missionName = loc("The big bang")
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    15
local challengeObjectives = loc("Find a way to detonate all the explosives and stay alive!")
9634
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    16
local explosives = {}
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    17
local currentHealth = 1
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    18
local currentDamage = 0
9632
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    19
-- hogs
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    20
local hero = {
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    21
	name = loc("Hog Solo"),
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    22
	x = 790,
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    23
	y = 70
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    24
}
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    25
-- teams
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    26
local teamA = {
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    27
	name = loc("Hog Solo"),
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    28
	color = tonumber("38D61C",16) -- green
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    29
}
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    30
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    31
-------------- LuaAPI EVENT HANDLERS ------------------
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    32
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    33
function onGameInit()
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    34
	GameFlags = gfDisableWind + gfOneClanMode
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    35
	Seed = 1
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    36
	TurnTime = -1
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    37
	CaseFreq = 0
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    38
	MinesNum = 0
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    39
	MinesTime = 1
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    40
	Explosives = 0
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    41
	HealthCaseAmount = 50
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    42
	Map = "final_map"
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    43
	Theme = "EarthRise"
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    44
	
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    45
	-- Hog Solo
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    46
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    47
	hero.gear = AddHog(hero.name, 0, 1, "war_desertgrenadier1")
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    48
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    49
	
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    50
	initCheckpoint("final")
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    51
	
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    52
	AnimInit()
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    53
end
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    54
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    55
function onGameStart()
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    56
	AnimWait(hero.gear, 3000)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    57
	FollowGear(hero.gear)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    58
	ShowMission(missionName, loc("Challenge Objectives"), challengeObjectives, -amSkip, 0)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    59
	
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    60
	-- explosives
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    61
	x = 400
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    62
	while x < 815 do
9634
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    63
		local gear = AddGear(x, 500, gtExplosives, 0, 0, 0, 0)
9632
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    64
		x = x + math.random(15,40)
9634
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    65
		table.insert(explosives, gear)
9632
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    66
	end
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    67
	-- mines
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    68
	local x = 360
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    69
	while x < 815 do
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    70
		AddGear(x, 480, gtMine, 0, 0, 0, 0)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    71
		x = x + math.random(5,20)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    72
	end
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    73
	-- health crate	
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    74
	SpawnHealthCrate(900, 5)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    75
	-- ammo crates
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    76
	SpawnAmmoCrate(930, 1000,amRCPlane)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    77
	SpawnAmmoCrate(1220, 672,amPickHammer)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    78
	SpawnAmmoCrate(1220, 672,amGirder)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    79
	
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    80
	-- ammo
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    81
	AddAmmo(hero.gear, amPortalGun, 1)	
9634
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    82
	AddAmmo(hero.gear, amFirePunch, 1)
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    83
	
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    84
	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    85
	AddEvent(onHeroWin, {hero.gear}, heroWin, {hero.gear}, 0)
9632
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    86
	
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    87
	SendHealthStatsOff()
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    88
end
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    89
9634
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    90
function onGameTick()
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    91
	AnimUnWait()
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    92
	if ShowAnimation() == false then
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    93
		return
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    94
	end
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    95
	ExecuteAfterAnimations()
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    96
	CheckEvents()
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    97
end
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
    98
9632
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    99
function onAmmoStoreInit()
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   100
	SetAmmo(amRCPlane, 0, 0, 0, 1)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   101
	SetAmmo(amPickHammer, 0, 0, 0, 2)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   102
	SetAmmo(amGirder, 0, 0, 0, 1)
9dd1c36d8b54 final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   103
end
9634
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   104
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   105
function onNewTurn()
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   106
	currentDamage = 0
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   107
	currentHealth = GetHealth(hero.gear)
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   108
end
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   109
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   110
function onGearDamage(gear, damage)
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   111
	if gear == hero.gear then
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   112
		currentDamage = currentDamage + damage
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   113
	end
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   114
end
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   115
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   116
-------------- EVENTS ------------------
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   117
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   118
function onHeroDeath(gear)
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   119
	if not GetHealth(hero.gear) then
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   120
		return true
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   121
	end
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   122
	return false
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   123
end
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   124
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   125
function onHeroWin(gear)
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   126
	local win = true
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   127
	for i=1,table.getn(explosives) do
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   128
		if GetHealth(explosives[i]) then
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   129
			win = false
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   130
			break
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   131
		end
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   132
	end
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   133
	if currentHealth <= currentDamage then
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   134
		win = false
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   135
	end
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   136
	return win
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   137
end
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   138
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   139
-------------- ACTIONS ------------------
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   140
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   141
function heroDeath(gear)
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   142
	SendStat('siGameResult', loc("Hog Solo lost, try again!")) --1
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   143
	SendStat('siCustomAchievement', loc("You have to destroy all the explosives without dying!")) --11
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   144
	SendStat('siPlayerKills','0',teamA.name)
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   145
	EndGame()
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   146
end
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   147
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   148
function heroWin(gear)
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   149
	SendStat('siGameResult', loc("Congratulations, you have saved Hogera!")) --1
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   150
	SendStat('siCustomAchievement', loc("Hogera is safe!")) --11
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   151
	SendStat('siPlayerKills','1',teamA.name)
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   152
	EndGame()
8032df67a249 custom stats and win/lose events
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9632
diff changeset
   153
end