forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreaturescripts_kill.lua
More file actions
47 lines (41 loc) · 2.1 KB
/
Copy pathcreaturescripts_kill.lua
File metadata and controls
47 lines (41 loc) · 2.1 KB
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
local defaultTime = 20
local creaturescripts_library_bosses = CreatureEvent("killingLibrary")
function creaturescripts_library_bosses.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified)
if not creature:isMonster() or creature:getMaster() then
return true
end
local monsterStorages = {
["grand commander soeren"] = { stg = Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.KillingBosses, value = 1 },
["preceptor lazare"] = { stg = Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.KillingBosses, value = 2 },
["grand chaplain gaunder"] = { stg = Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.KillingBosses, value = 3 },
["grand canon dominus"] = { stg = Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.KillingBosses, value = 4 },
["dazed leaf golem"] = { stg = Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.KillingBosses, value = 5 },
["grand master oberon"] = { stg = Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.KillingBosses, value = 6, achievements = { "Millennial Falcon", "Master Debater" }, lastBoss = true },
["brokul"] = { stg = Storage.Quest.U11_80.TheSecretLibrary.LiquidDeath.Questline, value = 7 },
["the flaming orchid"] = { stg = Storage.Quest.U11_80.TheSecretLibrary.Asuras.FlammingOrchid, value = 1 },
}
local monsterName = creature:getName():lower()
local monsterStorage = monsterStorages[monsterName]
if monsterStorage then
for playerid, damage in pairs(creature:getDamageMap()) do
local p = Player(playerid)
if p then
if p:getStorageValue(monsterStorage.stg) < monsterStorage.value then
p:setStorageValue(monsterStorage.stg, monsterStorage.value)
end
if monsterStorage.achievements then
for i = 1, #monsterStorage.achievements do
p:addAchievement(monsterStorage.achievements[i])
end
end
if monsterStorage.lastBoss then
if p:getStorageValue(Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.Questline) < 2 then
p:setStorageValue(Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.Questline, 2)
end
end
end
end
end
return true
end
creaturescripts_library_bosses:register()