diff --git a/data-otservbr-global/lib/core/quests.lua b/data-otservbr-global/lib/core/quests.lua
index 19b5a058986..19dacee7a9a 100644
--- a/data-otservbr-global/lib/core/quests.lua
+++ b/data-otservbr-global/lib/core/quests.lua
@@ -6343,12 +6343,12 @@ if not Quests then
},
[47] = {
name = "Grave Danger",
- startStorageId = Storage.Quest.U12_20.GraveDanger.QuestLine,
+ startStorageId = Storage.Quest.U12_20.GraveDanger.Questline,
startStorageValue = 1,
missions = {
[1] = {
name = "* Grave Danger - The Lich Knights",
- storageId = Storage.Quest.U12_20.GraveDanger.QuestLine,
+ storageId = Storage.Quest.U12_20.GraveDanger.Questline,
missionId = 10437,
startValue = 1,
endValue = 2,
@@ -6633,5 +6633,73 @@ if not Quests then
},
},
},
+ [50] = {
+ name = "The Dream Courts",
+ startStorageId = Storage.Quest.U12_00.TheDreamCourts.Main.Questline,
+ startStorageValue = 1,
+ missions = {
+ [1] = {
+ name = "The Dream Courts",
+ storageId = Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline,
+ missionId = 10457,
+ startValue = 1,
+ endValue = 3,
+ states = {
+ [1] = function(player)
+ return string.format("You already got %d/8 energized ward stones.", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count), 0))
+ end,
+ [2] = "You must kill the Nightmare Beast.",
+ [3] = "By defeating the dreadful Nightmare Beast you did the Winter Court and the Summer Court alike a great favor. From now on, the dream elves will regard you as a friend.",
+ },
+ },
+ [2] = {
+ name = "Unsafe Release",
+ storageId = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline,
+ missionId = 10458,
+ startValue = 1,
+ endValue = 3,
+ states = {
+ [1] = "Part I",
+ [2] = "Part II",
+ [3] = "Andre was happy to hear that the compass works as intendend. From now on it is possible that he will charge your compass again. It can be used to give acess to mystical chests once a day.",
+ },
+ },
+ [3] = {
+ name = "Haunted House",
+ storageId = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline,
+ missionId = 10459,
+ startValue = 1,
+ endValue = 6,
+ states = {
+ [1] = function(player)
+ return string.format(
+ "A tormented soul trusted you with the secret of this house: join the passages to the three dungeons it connects to reveal a hidden portal within!\n\nCellar %d/1\nTemple %d/1\nTomb %d/1",
+ math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar), 0),
+ math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple), 0),
+ math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb), 0)
+ )
+ end,
+ [2] = "Part I - burried catedral",
+ [3] = "Part II - puzzle dos livros",
+ [4] = "Part III - bosses",
+ [5] = "Part IV - last stone",
+ [6] = "Activating the ward stone after defeating the Faceless Bane has gained you acess to the deepest mysteries of the dream courts.",
+ },
+ },
+ [4] = {
+ name = "The Seven Keys",
+ storageId = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ missionId = 10460,
+ startValue = 1,
+ endValue = 2,
+ states = {
+ [1] = function(player)
+ return string.format("You already got %d/7 secret keys.", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count), 0))
+ end,
+ [2] = "You found the seven keys to unlock the Seven Dream Doors in the Labyrinth of Summer's and Winter's Dreams.",
+ },
+ },
+ },
+ },
}
end
diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua
index ba71dfedb6f..a43a792665e 100644
--- a/data-otservbr-global/lib/core/storages.lua
+++ b/data-otservbr-global/lib/core/storages.lua
@@ -127,66 +127,6 @@ Storage = {
ThirdStage = 50003,
Crystal = 50004,
},
- Kilmaresh = {
- -- Reserved storage from 50015 - 50049
- Questline = 50015,
- First = {
- Title = 50016,
- },
- Second = {
- Investigating = 50017,
- },
- Third = {
- Recovering = 50018,
- },
- Fourth = {
- Moe = 50019,
- MoeTimer = 50020,
- },
- Fifth = {
- Memories = 50021,
- MemoriesShards = 50022,
- },
- Sixth = {
- Favor = 50023,
- FourMasks = 50024,
- BlessedStatues = 50025,
- },
- Set = {
- Ritual = 50026,
- },
- Eighth = {
- Yonan = 50027,
- Narsai = 50028,
- Shimun = 50029,
- Tefrit = 50030,
- },
- Nine = {
- Owl = 50031,
- },
- Tem = {
- Bleeds = 50032,
- },
- Eleven = {
- Basin = 50033,
- },
- Twelve = {
- Boss = 50034,
- Bragrumol = 50035,
- Mozradek = 50036,
- Xogixath = 50037,
- },
- Thirteen = {
- Fafnar = 50038,
- Lyre = 50039,
- Presente = 50040,
- },
- Fourteen = {
- Remains = 50041,
- },
- AccessDoor = 50043,
- CatacombDoors = 55047,
- },
DeeplingBosses = {
-- Reserved storage from 50075 - 50079
Jaul = 50075,
@@ -214,8 +154,6 @@ Storage = {
-- Until all outfit quests are completed
DefaultStart = 50960,
Ref = 50961,
- -- Golden Outfit
- GoldenOutfit = 51015,
RoyalCostumeOutfit = 51026,
},
TheHuntForTheSeaSerpent = {
@@ -302,13 +240,6 @@ Storage = {
Lever = 52278,
Mainland = 52279,
},
- GraveDanger = {
- -- Reserved storage from 52310 - 52339
- Questline = 52310,
- CobraBastion = {
- Questline = 52311,
- },
- },
TheMummysCurse = {
-- Reserved storage from 52350 - 52359
Time1 = 52351,
@@ -2626,109 +2557,181 @@ Storage = {
UndergroundBastion = 46028,
Key0909 = 46029,
},
+ FalconBastionAccess = 46030,
},
Darashia = {
- Questline = 46030,
- PuzzleSqm = 46031,
- FirstChest = 46032,
- SecondChest = 46033,
- ThirdChest = 46034,
- FourthChest = 46035,
- RedColor = 46036,
- GreenColor = 46037,
- BlueColor = 46038,
- ColorPuzzle = 46039,
- EatenFood = 46040,
- FirstTotem = 46041,
- SecondTotem = 46042,
- ThirdTotem = 46043,
- FourthTotem = 46044,
- FifthChest = 46045,
- ScorpionTimer = 46046,
+ Questline = 46031,
+ PuzzleSqm = 46032,
+ FirstChest = 46033,
+ SecondChest = 46034,
+ ThirdChest = 46035,
+ FourthChest = 46036,
+ RedColor = 46037,
+ GreenColor = 46038,
+ BlueColor = 46039,
+ ColorPuzzle = 46040,
+ EatenFood = 46041,
+ FirstTotem = 46042,
+ SecondTotem = 46043,
+ ThirdTotem = 46044,
+ FourthTotem = 46045,
+ FifthChest = 46046,
+ ScorpionTimer = 46047,
},
LiquidDeath = {
- Questline = 46047,
- Statue1 = 46048,
- Statue2 = 46049,
- Statue3 = 46050,
- Statue4 = 46051,
- Statue5 = 46052,
- Statue6 = 46053,
- Statue7 = 46054,
- Statue8 = 46055,
- Statue9 = 46056,
- StatueCount = 46057,
- BrokulTimer = 46058,
- BrokulTimerGlobal = 46059,
+ Questline = 46048,
+ Statue1 = 46049,
+ Statue2 = 46050,
+ Statue3 = 46051,
+ Statue4 = 46052,
+ Statue5 = 46053,
+ Statue6 = 46054,
+ Statue7 = 46055,
+ Statue8 = 46056,
+ Statue9 = 46057,
+ StatueCount = 46058,
+ BrokulTimer = 46059,
+ BrokulTimerGlobal = 46060,
},
MoTA = {
- Questline = 46060,
- LeverPermission = 46061,
- SampleBlood = 46062,
- BonyRod = 46063,
- BrokenCompass = 46064,
- Crystal1 = 46065,
- Crystal2 = 46066,
- Crystal3 = 46067,
- Crystal4 = 46068,
- Crystal5 = 46069,
- Crystal6 = 46070,
- Crystal7 = 46071,
- Crystal8 = 46072,
- YellowGem = 46073,
- GreenGem = 46074,
- RedGem = 46075,
- FinalBasin = 46076,
- SkullSample = 46077,
- TakenRod = 46078,
- TrialTimer = 46079,
- MuseumTimer = 46080,
+ Questline = 46061,
+ LeverPermission = 46062,
+ SampleBlood = 46063,
+ BonyRod = 46064,
+ BrokenCompass = 46065,
+ Crystal1 = 46066,
+ Crystal2 = 46067,
+ Crystal3 = 46068,
+ Crystal4 = 46069,
+ Crystal5 = 46070,
+ Crystal6 = 46071,
+ Crystal7 = 46072,
+ Crystal8 = 46073,
+ YellowGem = 46074,
+ GreenGem = 46075,
+ RedGem = 46076,
+ FinalBasin = 46077,
+ SkullSample = 46078,
+ TakenRod = 46079,
+ TrialTimer = 46080,
+ MuseumTimer = 46081,
},
SmallIslands = {
- Questline = 46081,
- Parchment = 46082,
- Sapphire = 46083,
- Shovel = 46084,
- Fishing = 46085,
- RaxiasTimer = 46086,
- BoatStages = 46087,
- Hawser = 46088,
- Turtle = 46089,
- },
- LibraryPermission = 46090,
+ Questline = 46082,
+ Parchment = 46083,
+ Sapphire = 46084,
+ Shovel = 46085,
+ Fishing = 46086,
+ RaxiasTimer = 46087,
+ BoatStages = 46088,
+ Hawser = 46089,
+ Turtle = 46090,
+ },
+ LibraryPermission = 46091,
Library = {
- Questline = 46091,
- MazzinorTimer = 46092,
- LokathmorTimer = 46093,
- GhuloshTimer = 46094,
- GorzindelTimer = 46095,
- Ghulosh = 46096,
+ Questline = 46092,
+ MazzinorTimer = 46093,
+ LokathmorTimer = 46094,
+ GhuloshTimer = 46095,
+ GorzindelTimer = 46096,
+ Ghulosh = 46097,
},
},
BattleMageOutfits = {
- Addon1 = 46097,
- Addon2 = 46098,
+ Addon1 = 46098,
+ Addon2 = 46099,
},
DiscovererOutfits = {},
MeasuringTibia = {},
},
U12_00 = { -- update 12.00 - Reserved Storages 46301 - 46600
- DreamWarriorOutfits = {},
TheDreamCourts = {
- QuestLine = 46401,
- HauntedHouseAccess = 46402,
- BuriedCathedralAccess = 46403,
- DreamScarAccess = 46404,
- AndrewDoor = 14900,
- AccessDoors = 46309,
- ArenaTimer = 46310,
- PlaguerootKilled = 46311,
- MalofurKilled = 46312,
- MaxxeniusKilled = 46313,
- AlptramunKilled = 46314,
- IzcandarKilled = 46315,
- NightmareBeastTimer = 46316,
- NightmareBeastKilled = 46317,
+ Main = {
+ Questline = 46301,
+ CourtChest = 46302,
+ TheSummerCourt = 46303,
+ TheWinterCourt = 46304,
+ },
+ WardStones = {
+ Questline = 46305,
+ Count = 46306,
+ OkolnirStone = 46307,
+ FoldaStone = 46308,
+ CalassaStone = 46309,
+ FeyristStone = 46310,
+ MerianaStone = 46311,
+ CormayaStone = 46312,
+ PortHopeStone = 46313,
+ CatedralStone = 46314,
+ },
+ UnsafeRelease = {
+ Questline = 46315,
+ GotAxe = 46316,
+ HasBait = 46317,
+ },
+ HauntedHouse = {
+ Questline = 46318,
+ SkeletonContainer = 46319,
+ Cellar = 46320,
+ Temple = 46321,
+ Tomb = 46322,
+ IdolCount = 46323,
+ },
+ BurriedCatedral = {
+ FishingRod = 46324,
+ EstatueWord = 46325,
+ BarrelWord = 46326,
+ BedWord = 46327,
+ LakeWord = 46328,
+ WordCount = 46329,
+ SequenceBooks = 46330,
+ FacelessTimer = 46331,
+ FacelessLifes = 46332,
+ },
+ TheSevenKeys = {
+ Questline = 46333,
+ RoseBush = 46334,
+ MushRoom = 46335,
+ Book = 46336,
+ OrcSkull = 46337,
+ Recipe = 46338,
+ MinotaurSkull = 46339,
+ TrollSkull = 46340,
+ Lock = 46341,
+ DoorMedusa = 46342,
+ DoorInvisible = 46343,
+ Painting = 46344,
+ SequenceSkulls = 46345,
+ Count = 46346,
+ },
+ DreamScar = {
+ Permission = 46347,
+ BossCount = 46348,
+ MaxxeniusTimer = 46349,
+ AlptramunTimer = 46350,
+ PlagueRootTimer = 46351,
+ IzcandarTimer = 46352,
+ MalofurTimer = 46353,
+ NightmareTimer = 46354,
+ LastBossCurse = 46355,
+ },
+ BurriedCatedralGlobal = {
+ FacelessTiles = 46356,
+ FacelessTimer = 46357,
+ },
+ DreamScarGlobal = {
+ MaxxeniusTimer = 46358,
+ AlptramunTimer = 46359,
+ PlagueRootTimer = 46360,
+ IzcandarTimer = 46361,
+ MalofurTimer = 46362,
+ AlptramunSummonsKilled = 46363,
+ IzcandarOutfit = 46364,
+ NightmareTimer = 46365,
+ LastBossCurse = 46366,
+ },
+ NightmareCurse = 46367,
+ Malofur = 46368,
},
},
U12_02 = { -- update 12.02 - Reserved Storages 46601 - 46800
@@ -2736,39 +2739,138 @@ Storage = {
WinterlightSolstice = {},
},
U12_15 = { -- update 12.15.8659 - Reserved Storages 46801 - 46850
- GoldenOutfits = {},
+ GoldenOutfits = 46801,
},
U12_20 = { -- update 12.20 - Reserved Storages 46851 - 47000
GraveDanger = {
- QuestLine = 46851,
+ Questline = 46851,
+ Stage = 46852,
+ Cobra = 46853,
+ GaffirKilled = 46854,
+ CustodianKilled = 46855,
+ QuaidKilled = 46856,
+ ScarlettKilled = 46857,
+ FireWall = 46858,
Graves = {
- Edron = 46852,
- DarkCathedral = 46853,
- Ghostlands = 46854,
- Cormaya = 46855,
- FemorHills = 46856,
- Ankrahmun = 46857,
- Kilmaresh = 46858,
- Vengoth = 46859,
- Darashia = 46860,
- Thais = 46861,
- Orclands = 46862,
- IceIslands = 46863,
+ Progress = 46859,
+ Edron = 46860,
+ DarkCathedral = 46861,
+ Ghostlands = 46862,
+ Cormaya = 46863,
+ FemorHills = 46864,
+ Ankrahmun = 46865,
+ Kilmaresh = 46866,
+ Vengoth = 46867,
+ Darashia = 46868,
+ Thais = 46869,
+ Orclands = 46870,
+ IceIslands = 46871,
},
Bosses = {
- BaelocNictrosKilled = 46866,
- CountVlarkorthKilled = 46868,
- DukeKruleKilled = 46870,
- EarlOsamKilled = 46872,
- LordAzaramKilled = 46874,
- KingZelosDoor = 46875,
- KingZelosKilled = 46877,
- InquisitionOutfitReceived = 46878,
- },
- Cobra = 46864,
- },
- HandOfTheInquisitionOutfits = {},
- -- Kilmaresh = {}, done earlier in the file
+ LordAzaram = {
+ Killed = 46872,
+ Timer = 46873,
+ Room = 46874,
+ },
+ CountVlarkorth = {
+ Killed = 46875,
+ Timer = 46876,
+ Room = 46877,
+ },
+ EarlOsam = {
+ Killed = 46878,
+ Timer = 46879,
+ Room = 46880,
+ },
+ BaelocNictros = {
+ Timer = 46881,
+ Room = 46882,
+ Killed = 46883,
+ },
+ DukeKrule = {
+ Timer = 46884,
+ Room = 46885,
+ TransformCD = 46886,
+ Killed = 46887,
+ },
+ KingZelos = {
+ Killed = 46888,
+ Timer = 46889,
+ Room = 46890,
+ },
+ },
+ CobraBastion = {
+ Questline = 46891,
+ },
+ },
+ HandOfTheInquisitionOutfits = {
+ Outfits = 46892,
+ Addon1 = 46893,
+ Addon2 = 46894,
+ },
+ KilmareshQuest = {
+ Questline = 46895,
+ First = {
+ Title = 46896,
+ },
+ Second = {
+ Investigating = 46897,
+ },
+ Third = {
+ Recovering = 46898,
+ },
+ Fourth = {
+ Moe = 46899,
+ MoeTimer = 46900,
+ },
+ Fifth = {
+ Memories = 46901,
+ MemoriesShards = 46902,
+ },
+ Sixth = {
+ Favor = 46903,
+ FourMasks = 46904,
+ BlessedStatues = 46905,
+ IvoryMask = 46906,
+ MirrorMask = 46907,
+ SilverMask = 46908,
+ GryphonMask = 46909,
+ },
+ Set = {
+ Ritual = 46910,
+ },
+ Eighth = {
+ Yonan = 46911,
+ Narsai = 46912,
+ Shimun = 46913,
+ Tefrit = 46914,
+ },
+ Nine = {
+ Owl = 46915,
+ },
+ Tem = {
+ Bleeds = 46916,
+ },
+ Eleven = {
+ Basin = 46917,
+ },
+ Twelve = {
+ Boss = 46918,
+ Bragrumol = 46919,
+ Mozradek = 46920,
+ Xogixath = 46921,
+ },
+ Thirteen = {
+ Fafnar = 46922,
+ Lyre = 46923,
+ Presente = 46924,
+ },
+ Fourteen = {
+ Remains = 46925,
+ },
+ AccessDoor = 46926,
+ },
+ Orcsoberfest = {},
},
U12_30 = { -- update 12.30 - Reserved Storages 47001 - 47200
FalconerOutfits = {},
@@ -2939,15 +3041,6 @@ GlobalStorage = {
DarashiaWest = 60193,
},
},
- TheDreamCourts = {
- -- Reserved storage from 60194 - 60196
- FacelessBane = {
- -- Global
- StepsOn = 60194,
- Deaths = 60195,
- ResetSteps = 60196,
- },
- },
FuryGates = 65000,
Yakchal = 65001,
PitsOfInfernoLevers = 65002,
diff --git a/data-otservbr-global/monster/bosses/custodian.lua b/data-otservbr-global/monster/bosses/custodian.lua
index 2a2e414d3d9..ea976a9b265 100644
--- a/data-otservbr-global/monster/bosses/custodian.lua
+++ b/data-otservbr-global/monster/bosses/custodian.lua
@@ -25,6 +25,10 @@ monster.corpse = 31923
monster.speed = 105
monster.manaCost = 0
+monster.events = {
+ "grave_danger_death",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
diff --git a/data-otservbr-global/monster/bosses/gaffir.lua b/data-otservbr-global/monster/bosses/gaffir.lua
index a51115cb094..735eefd0f60 100644
--- a/data-otservbr-global/monster/bosses/gaffir.lua
+++ b/data-otservbr-global/monster/bosses/gaffir.lua
@@ -28,6 +28,7 @@ monster.manaCost = 0
monster.events = {
"UglyMonsterSpawn",
"UglyMonsterCleanup",
+ "grave_danger_death",
}
monster.changeTarget = {
diff --git a/data-otservbr-global/monster/bosses/guard_captain_quaid.lua b/data-otservbr-global/monster/bosses/guard_captain_quaid.lua
index 85507170974..e84f9b9fd83 100644
--- a/data-otservbr-global/monster/bosses/guard_captain_quaid.lua
+++ b/data-otservbr-global/monster/bosses/guard_captain_quaid.lua
@@ -28,6 +28,7 @@ monster.manaCost = 0
monster.events = {
"UglyMonsterSpawn",
"UglyMonsterCleanup",
+ "grave_danger_death",
}
monster.changeTarget = {
diff --git a/data-otservbr-global/monster/bosses/izcandar_champion_of_summer.lua b/data-otservbr-global/monster/bosses/izcandar_champion_of_summer.lua
new file mode 100644
index 00000000000..af2b7d549aa
--- /dev/null
+++ b/data-otservbr-global/monster/bosses/izcandar_champion_of_summer.lua
@@ -0,0 +1,140 @@
+local mType = Game.createMonsterType("Izcandar Champion of Summer")
+local monster = {}
+
+monster.description = "Izcandar Champion of Summer"
+monster.experience = 6900
+monster.outfit = {
+ lookType = 1137,
+ lookHead = 43,
+ lookBody = 78,
+ lookLegs = 43,
+ lookFeet = 43,
+ lookAddons = 3,
+ lookMount = 0,
+}
+
+monster.health = 130000
+monster.maxHealth = 130000
+monster.race = "blood"
+monster.corpse = 25151
+monster.speed = 200
+monster.manaCost = 0
+
+monster.events = {
+ "dreamCourtsDeath",
+ "izcandarThink",
+}
+
+monster.changeTarget = {
+ interval = 4000,
+ chance = 10,
+}
+
+monster.strategiesTarget = {
+ nearest = 70,
+ health = 10,
+ damage = 10,
+ random = 10,
+}
+
+monster.flags = {
+ summonable = false,
+ attackable = true,
+ hostile = true,
+ convinceable = false,
+ pushable = false,
+ rewardBoss = true,
+ illusionable = false,
+ canPushItems = true,
+ canPushCreatures = true,
+ staticAttackChance = 90,
+ targetDistance = 1,
+ runHealth = 0,
+ healthHidden = false,
+ isBlockable = false,
+ canWalkOnEnergy = true,
+ canWalkOnFire = true,
+ canWalkOnPoison = true,
+}
+
+monster.light = {
+ level = 0,
+ color = 0,
+}
+
+monster.voices = {
+ interval = 5000,
+ chance = 10,
+ { text = "Dream or nightmare?", yell = false },
+}
+
+monster.loot = {
+ { name = "Energy Bar", chance = 100000 },
+ { name = "Gold Token", chance = 100000, maxCount = 2 },
+ { name = "Piggy Bank", chance = 100000 },
+ { name = "Platinum Coin", chance = 100000, maxCount = 5 },
+ { name = "Silver Token", chance = 100000, maxCount = 2 },
+ { name = "Mysterious Remains", chance = 100000 },
+ { name = "Yellow Gem", chance = 69230, maxCount = 2 },
+ { name = "Ultimate Spirit Potion", chance = 61540, maxCount = 20 },
+ { name = "Supreme Health Potion", chance = 53850, maxCount = 20 },
+ { name = "Ultimate Mana Potion", chance = 53850, maxCount = 14 },
+ { id = 3039, chance = 46150 }, -- red gem
+ { id = 23529, chance = 38460 }, -- Ring of Blue Plasma
+ { name = "Chaos Mace", chance = 23080 },
+ { name = "Huge Chunk of Crude Iron", chance = 30777 },
+ { name = "Bullseye Potion", chance = 23080, maxCount = 10 },
+ { name = "Summerblade", chance = 100, unique = true },
+ { id = 281, chance = 23080 }, -- giant shimmering pearl
+ { name = "Royal Star", chance = 23080, maxCount = 100 },
+ { name = "Blue Gem", chance = 15380 },
+ { name = "Mastermind Potion", chance = 15380, maxCount = 10 },
+ { name = "Skull Staff", chance = 15380 },
+ { name = "Berserk Potion", chance = 7690, maxCount = 10 },
+ { id = 23543, chance = 7690 }, -- Collar of Green Plasma
+ { id = 23544, chance = 7690 }, -- Collar of Red Plasma
+ { name = "Crystal Coin", chance = 7690, maxCount = 2 },
+ { name = "Ornate Locket", chance = 7690 },
+ { name = "Pomegranate", chance = 7690 },
+ { id = 26189, chance = 7690 }, -- Ring of Red Plasma
+ { name = "Ring of the Sky", chance = 7690 },
+ { name = "Izcandar's Snow Globe", chance = 1500 },
+}
+
+monster.attacks = {
+ { name = "melee", interval = 2000, chance = 100, minDamage = -320, maxDamage = -750 },
+ { name = "combat", interval = 2000, chance = 10, type = COMBAT_ICEDAMAGE, minDamage = -500, maxDamage = -850, radius = 6, effect = false, target = false },
+ { name = "combat", interval = 2000, chance = 15, type = COMBAT_DROWNDAMAGE, minDamage = -300, maxDamage = -850, length = 8, spread = 3, effect = false, target = false },
+ { name = "combat", interval = 2000, chance = 15, type = COMBAT_MANADRAIN, minDamage = -444, maxDamage = -850, radius = 4, effect = false, shootEffect = CONST_ANI_SUDDENDEATH, target = true },
+ { name = "combat", interval = 2000, chance = 15, type = COMBAT_DEATHDAMAGE, minDamage = -410, maxDamage = -850, length = 9, effect = false, target = false },
+ { name = "combat", interval = 2000, chance = 15, type = COMBAT_FIREDAMAGE, minDamage = -410, maxDamage = -850, length = 9, effect = false, target = false },
+ { name = "combat", interval = 2000, chance = 15, type = COMBAT_ICEDAMAGE, minDamage = -410, maxDamage = -850, length = 9, effect = false, target = false },
+ { name = "combat", interval = 2000, chance = 20, type = COMBAT_EARTHDAMAGE, minDamage = -410, maxDamage = -850, radius = 3, shootEffect = CONST_ANI_EARTH, effect = false, target = false },
+}
+
+monster.defenses = {
+ defense = 76,
+ armor = 76,
+ { name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 310, maxDamage = 640, effect = CONST_ME_REDSPARK },
+}
+
+monster.elements = {
+ { type = COMBAT_PHYSICALDAMAGE, percent = 0 },
+ { type = COMBAT_ENERGYDAMAGE, percent = 5 },
+ { type = COMBAT_EARTHDAMAGE, percent = 0 },
+ { type = COMBAT_FIREDAMAGE, percent = 0 },
+ { type = COMBAT_LIFEDRAIN, percent = 0 },
+ { type = COMBAT_MANADRAIN, percent = 0 },
+ { type = COMBAT_DROWNDAMAGE, percent = 0 },
+ { type = COMBAT_ICEDAMAGE, percent = 0 },
+ { type = COMBAT_HOLYDAMAGE, percent = 0 },
+ { type = COMBAT_DEATHDAMAGE, percent = 10 },
+}
+
+monster.immunities = {
+ { type = "paralyze", condition = true },
+ { type = "invisible", condition = true },
+ { type = "fire", condition = true },
+}
+
+mType:register(monster)
diff --git a/data-otservbr-global/monster/bosses/izcandar_champion_of_winter.lua b/data-otservbr-global/monster/bosses/izcandar_champion_of_winter.lua
new file mode 100644
index 00000000000..9ede1095581
--- /dev/null
+++ b/data-otservbr-global/monster/bosses/izcandar_champion_of_winter.lua
@@ -0,0 +1,140 @@
+local mType = Game.createMonsterType("Izcandar Champion of Winter")
+local monster = {}
+
+monster.description = "Izcandar Champion of Winter"
+monster.experience = 6900
+monster.outfit = {
+ lookType = 1137,
+ lookHead = 48,
+ lookBody = 38,
+ lookLegs = 48,
+ lookFeet = 48,
+ lookAddons = 3,
+ lookMount = 0,
+}
+
+monster.health = 130000
+monster.maxHealth = 130000
+monster.race = "blood"
+monster.corpse = 25151
+monster.speed = 200
+monster.manaCost = 0
+
+monster.events = {
+ "dreamCourtsDeath",
+ "izcandarThink",
+}
+
+monster.changeTarget = {
+ interval = 4000,
+ chance = 10,
+}
+
+monster.strategiesTarget = {
+ nearest = 70,
+ health = 10,
+ damage = 10,
+ random = 10,
+}
+
+monster.flags = {
+ summonable = false,
+ attackable = true,
+ hostile = true,
+ convinceable = false,
+ pushable = false,
+ rewardBoss = true,
+ illusionable = false,
+ canPushItems = true,
+ canPushCreatures = true,
+ staticAttackChance = 90,
+ targetDistance = 1,
+ runHealth = 0,
+ healthHidden = false,
+ isBlockable = false,
+ canWalkOnEnergy = true,
+ canWalkOnFire = true,
+ canWalkOnPoison = true,
+}
+
+monster.light = {
+ level = 0,
+ color = 0,
+}
+
+monster.voices = {
+ interval = 5000,
+ chance = 10,
+ { text = "Dream or nightmare?", yell = false },
+}
+
+monster.loot = {
+ { name = "Energy Bar", chance = 100000 },
+ { name = "Gold Token", chance = 100000, maxCount = 2 },
+ { name = "Piggy Bank", chance = 100000 },
+ { name = "Platinum Coin", chance = 100000, maxCount = 5 },
+ { name = "Silver Token", chance = 100000, maxCount = 2 },
+ { name = "Mysterious Remains", chance = 100000 },
+ { name = "Yellow Gem", chance = 69230, maxCount = 2 },
+ { name = "Ultimate Spirit Potion", chance = 61540, maxCount = 20 },
+ { name = "Supreme Health Potion", chance = 53850, maxCount = 20 },
+ { name = "Ultimate Mana Potion", chance = 53850, maxCount = 14 },
+ { id = 3039, chance = 46150 }, -- red gem
+ { id = 23529, chance = 38460 }, -- Ring of Blue Plasma
+ { name = "Chaos Mace", chance = 23080 },
+ { name = "Huge Chunk of Crude Iron", chance = 30777 },
+ { name = "Bullseye Potion", chance = 23080, maxCount = 10 },
+ { name = "Winterblade", chance = 100, unique = true },
+ { id = 281, chance = 23080 }, -- giant shimmering pearl
+ { name = "Royal Star", chance = 23080, maxCount = 100 },
+ { name = "Blue Gem", chance = 15380 },
+ { name = "Mastermind Potion", chance = 15380, maxCount = 10 },
+ { name = "Skull Staff", chance = 15380 },
+ { name = "Berserk Potion", chance = 7690, maxCount = 10 },
+ { id = 23543, chance = 7690 }, -- Collar of Green Plasma
+ { id = 23544, chance = 7690 }, -- Collar of Red Plasma
+ { name = "Crystal Coin", chance = 7690, maxCount = 2 },
+ { name = "Ornate Locket", chance = 7690 },
+ { name = "Pomegranate", chance = 7690 },
+ { id = 23533, chance = 7690 }, -- Ring of Red Plasma
+ { name = "Ring of the Sky", chance = 7690 },
+ { name = "Izcandar's Snow Globe", chance = 1500 },
+}
+
+monster.attacks = {
+ { name = "melee", interval = 2000, chance = 100, minDamage = -320, maxDamage = -750 },
+ { name = "combat", interval = 2000, chance = 10, type = COMBAT_ICEDAMAGE, minDamage = -500, maxDamage = -850, radius = 6, effect = false, target = false },
+ { name = "combat", interval = 2000, chance = 15, type = COMBAT_DROWNDAMAGE, minDamage = -300, maxDamage = -850, length = 8, spread = 3, effect = false, target = false },
+ { name = "combat", interval = 2000, chance = 15, type = COMBAT_MANADRAIN, minDamage = -444, maxDamage = -850, radius = 4, effect = false, shootEffect = CONST_ANI_SUDDENDEATH, target = true },
+ { name = "combat", interval = 2000, chance = 15, type = COMBAT_DEATHDAMAGE, minDamage = -410, maxDamage = -850, length = 9, effect = false, target = false },
+ { name = "combat", interval = 2000, chance = 15, type = COMBAT_FIREDAMAGE, minDamage = -410, maxDamage = -850, length = 9, effect = false, target = false },
+ { name = "combat", interval = 2000, chance = 15, type = COMBAT_ICEDAMAGE, minDamage = -410, maxDamage = -850, length = 9, effect = false, target = false },
+ { name = "combat", interval = 2000, chance = 20, type = COMBAT_EARTHDAMAGE, minDamage = -410, maxDamage = -850, radius = 3, shootEffect = CONST_ANI_EARTH, effect = false, target = false },
+}
+
+monster.defenses = {
+ defense = 76,
+ armor = 76,
+ { name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 310, maxDamage = 640, effect = CONST_ME_MAGIC_BLUE },
+}
+
+monster.elements = {
+ { type = COMBAT_PHYSICALDAMAGE, percent = 0 },
+ { type = COMBAT_ENERGYDAMAGE, percent = 5 },
+ { type = COMBAT_EARTHDAMAGE, percent = 0 },
+ { type = COMBAT_FIREDAMAGE, percent = 0 },
+ { type = COMBAT_LIFEDRAIN, percent = 0 },
+ { type = COMBAT_MANADRAIN, percent = 0 },
+ { type = COMBAT_DROWNDAMAGE, percent = 0 },
+ { type = COMBAT_ICEDAMAGE, percent = 0 },
+ { type = COMBAT_HOLYDAMAGE, percent = 0 },
+ { type = COMBAT_DEATHDAMAGE, percent = 10 },
+}
+
+monster.immunities = {
+ { type = "paralyze", condition = true },
+ { type = "invisible", condition = true },
+ { type = "ice", condition = true },
+}
+
+mType:register(monster)
diff --git a/data-otservbr-global/monster/quests/grave_danger/azarams_soul.lua b/data-otservbr-global/monster/quests/grave_danger/azarams_soul.lua
new file mode 100644
index 00000000000..04c001df211
--- /dev/null
+++ b/data-otservbr-global/monster/quests/grave_danger/azarams_soul.lua
@@ -0,0 +1,84 @@
+local mType = Game.createMonsterType("Azaram's Soul")
+local monster = {}
+
+monster.description = "azaram's soul"
+monster.experience = 0
+monster.outfit = {
+ lookType = 1219,
+ lookHead = 0,
+ lookBody = 0,
+ lookLegs = 0,
+ lookFeet = 0,
+ lookAddons = 0,
+ lookMount = 0,
+}
+
+monster.health = 1
+monster.maxHealth = 100000
+monster.race = "undead"
+monster.corpse = 0
+monster.speed = 150
+monster.manaCost = 0
+monster.maxSummons = 0
+
+monster.events = {
+ "soul_heal",
+}
+
+monster.changeTarget = {
+ interval = 5000,
+ chance = 20,
+}
+
+monster.flags = {
+ summonable = false,
+ attackable = true,
+ hostile = true,
+ convinceable = false,
+ pushable = false,
+ rewardBoss = false,
+ illusionable = false,
+ canPushItems = true,
+ canPushCreatures = false,
+ staticAttackChance = 95,
+ targetDistance = 0,
+ runHealth = 0,
+ healthHidden = false,
+ isBlockable = false,
+ canWalkOnEnergy = true,
+ canWalkOnFire = true,
+ canWalkOnPoison = true,
+ pet = false,
+}
+
+monster.light = {
+ level = 0,
+ color = 0,
+}
+
+monster.defenses = {
+ defense = 40,
+ armor = 40,
+}
+
+monster.elements = {
+ { type = COMBAT_PHYSICALDAMAGE, percent = 100 },
+ { type = COMBAT_ENERGYDAMAGE, percent = 100 },
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+ { type = COMBAT_FIREDAMAGE, percent = 100 },
+ { type = COMBAT_LIFEDRAIN, percent = 100 },
+ { type = COMBAT_MANADRAIN, percent = 100 },
+ { type = COMBAT_DROWNDAMAGE, percent = 100 },
+ { type = COMBAT_ICEDAMAGE, percent = 100 },
+ { type = COMBAT_HOLYDAMAGE, percent = 100 },
+ { type = COMBAT_DEATHDAMAGE, percent = 100 },
+}
+
+monster.immunities = {
+ { type = "paralyze", condition = true },
+ { type = "outfit", condition = false },
+ { type = "invisible", condition = true },
+ { type = "bleed", condition = false },
+}
+
+mType:register(monster)
diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/count_vlarkorth.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/count_vlarkorth.lua
index f2de105033d..f4f9292fb8c 100644
--- a/data-otservbr-global/monster/quests/grave_danger/bosses/count_vlarkorth.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/bosses/count_vlarkorth.lua
@@ -14,7 +14,8 @@ monster.outfit = {
}
monster.events = {
- "GraveDangerBossDeath",
+ "count_vlarkorth_transform",
+ "grave_danger_death",
}
monster.health = 75000
diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/duke_krule.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/duke_krule.lua
index 851867e0161..7c99c057d57 100644
--- a/data-otservbr-global/monster/quests/grave_danger/bosses/duke_krule.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/bosses/duke_krule.lua
@@ -14,7 +14,7 @@ monster.outfit = {
}
monster.events = {
- "GraveDangerBossDeath",
+ "grave_danger_death",
}
monster.health = 75000
diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/earl_osam.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/earl_osam.lua
index 930a744f326..22e8e6c06c9 100644
--- a/data-otservbr-global/monster/quests/grave_danger/bosses/earl_osam.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/bosses/earl_osam.lua
@@ -14,7 +14,8 @@ monster.outfit = {
}
monster.events = {
- "GraveDangerBossDeath",
+ "earl_osam_transform",
+ "grave_danger_death",
}
monster.health = 75000
diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/king_zelos.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/king_zelos.lua
index b723715c55d..1aa71839638 100644
--- a/data-otservbr-global/monster/quests/grave_danger/bosses/king_zelos.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/bosses/king_zelos.lua
@@ -13,17 +13,18 @@ monster.outfit = {
lookMount = 0,
}
-monster.events = {
- "GraveDangerBossDeath",
- "zelosDeath",
-}
-
monster.health = 480000
monster.maxHealth = 480000
monster.race = "venom"
monster.corpse = 31611
monster.speed = 212
+monster.events = {
+ "zelos_damage",
+ "zelos_init",
+ "grave_danger_death",
+}
+
monster.bosstiary = {
bossRaceId = 1784,
bossRace = RARITY_ARCHFOE,
diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/lord_azaram.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/lord_azaram.lua
index 188f11c9dc6..69d64039a85 100644
--- a/data-otservbr-global/monster/quests/grave_danger/bosses/lord_azaram.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/bosses/lord_azaram.lua
@@ -14,7 +14,8 @@ monster.outfit = {
}
monster.events = {
- "GraveDangerBossDeath",
+ "azaram_health",
+ "azaram_summon",
}
monster.health = 300000
diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/scarlett_etzel.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/scarlett_etzel.lua
index 9dcb6503d38..e27c10d1b24 100644
--- a/data-otservbr-global/monster/quests/grave_danger/bosses/scarlett_etzel.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/bosses/scarlett_etzel.lua
@@ -16,6 +16,7 @@ monster.outfit = {
monster.events = {
"scarlettThink",
"scarlettHealth",
+ "grave_danger_death",
}
monster.bosstiary = {
diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/sir_baeloc.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/sir_baeloc.lua
index 957ad10e5ff..7e05cbdb61d 100644
--- a/data-otservbr-global/monster/quests/grave_danger/bosses/sir_baeloc.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/bosses/sir_baeloc.lua
@@ -13,10 +13,6 @@ monster.outfit = {
lookMount = 0,
}
-monster.events = {
- "GraveDangerBossDeath",
-}
-
monster.health = 75000
monster.maxHealth = 75000
monster.race = "venom"
@@ -24,6 +20,12 @@ monster.corpse = 31599
monster.speed = 125
monster.manaCost = 0
+monster.events = {
+ "sir_baeloc_health",
+ "brothers_summon",
+ "grave_danger_death",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/sir_nictros.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/sir_nictros.lua
index 921c63ad286..60b14f17b24 100644
--- a/data-otservbr-global/monster/quests/grave_danger/bosses/sir_nictros.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/bosses/sir_nictros.lua
@@ -20,6 +20,11 @@ monster.corpse = 31599
monster.speed = 125
monster.manaCost = 0
+monster.events = {
+ "sir_nictros_health",
+ "brothers_summon",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
diff --git a/data-otservbr-global/monster/quests/grave_danger/condensed_sin.lua b/data-otservbr-global/monster/quests/grave_danger/condensed_sin.lua
new file mode 100644
index 00000000000..69ea6358e15
--- /dev/null
+++ b/data-otservbr-global/monster/quests/grave_danger/condensed_sin.lua
@@ -0,0 +1,99 @@
+local mType = Game.createMonsterType("Condensed Sin")
+local monster = {}
+
+monster.description = "a condensed sin"
+monster.experience = 0
+monster.outfit = {
+ lookType = 315,
+ lookHead = 0,
+ lookBody = 0,
+ lookLegs = 0,
+ lookFeet = 0,
+ lookAddons = 0,
+ lookMount = 0,
+}
+
+monster.health = 12000
+monster.maxHealth = 12000
+monster.race = "undead"
+monster.corpse = 0
+monster.speed = 160
+monster.manaCost = 0
+monster.maxSummons = 0
+
+monster.changeTarget = {
+ interval = 5000,
+ chance = 0,
+}
+
+monster.strategiesTarget = {
+ nearest = 100,
+}
+
+monster.flags = {
+ summonable = false,
+ attackable = true,
+ hostile = true,
+ convinceable = false,
+ pushable = false,
+ rewardBoss = false,
+ illusionable = false,
+ canPushItems = true,
+ canPushCreatures = true,
+ staticAttackChance = 90,
+ targetDistance = 1,
+ runHealth = 0,
+ healthHidden = false,
+ isBlockable = false,
+ canWalkOnEnergy = true,
+ canWalkOnFire = true,
+ canWalkOnPoison = true,
+ pet = false,
+}
+
+monster.light = {
+ level = 0,
+ color = 0,
+}
+
+monster.voices = {
+ interval = 5000,
+ chance = 10,
+}
+
+monster.loot = {}
+
+monster.attacks = {
+ { name = "melee", interval = 2000, chance = 100, minDamage = -100, maxDamage = -500 },
+ { name = "combat", interval = 5000, chance = 40, type = COMBAT_MANADRAIN, minDamage = -450, maxDamage = -550, length = 3, effect = CONST_ME_SLEEP, target = false },
+ { name = "combat", interval = 2000, chance = 30, type = COMBAT_DEATHDAMAGE, minDamage = -250, maxDamage = -450, range = 1, shootEffect = CONST_ANI_DEATH, target = true },
+ { name = "combat", interval = 2000, chance = 30, type = COMBAT_EARTHDAMAGE, minDamage = -250, maxDamage = -450, range = 1, shootEffect = CONST_ANI_POISON, target = true },
+ { name = "combat", interval = 4000, chance = 50, type = COMBAT_EARTHDAMAGE, minDamage = -600, maxDamage = -800, range = 3, radius = 2, effect = CONST_ME_HITBYPOISON, target = false },
+}
+
+monster.defenses = {
+ defense = 10,
+ armor = 10,
+}
+
+monster.elements = {
+ { type = COMBAT_PHYSICALDAMAGE, percent = 0 },
+ { type = COMBAT_ENERGYDAMAGE, percent = -10 },
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+ { type = COMBAT_FIREDAMAGE, percent = -10 },
+ { type = COMBAT_LIFEDRAIN, percent = 100 },
+ { type = COMBAT_MANADRAIN, percent = 0 },
+ { type = COMBAT_DROWNDAMAGE, percent = 0 },
+ { type = COMBAT_ICEDAMAGE, percent = 20 },
+ { type = COMBAT_HOLYDAMAGE, percent = 0 },
+ { type = COMBAT_DEATHDAMAGE, percent = 100 },
+}
+
+monster.immunities = {
+ { type = "paralyze", condition = false },
+ { type = "outfit", condition = false },
+ { type = "invisible", condition = false },
+ { type = "bleed", condition = false },
+}
+
+mType:register(monster)
diff --git a/data-otservbr-global/monster/quests/grave_danger/dark_druid.lua b/data-otservbr-global/monster/quests/grave_danger/dark_druid.lua
index 0d3004706ed..ad0cba66509 100644
--- a/data-otservbr-global/monster/quests/grave_danger/dark_druid.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/dark_druid.lua
@@ -16,7 +16,7 @@ monster.outfit = {
monster.health = 1800
monster.maxHealth = 1800
monster.race = "blood"
-monster.corpse = 0
+monster.corpse = 31205
monster.speed = 125
monster.manaCost = 0
diff --git a/data-otservbr-global/monster/quests/grave_danger/dark_knight.lua b/data-otservbr-global/monster/quests/grave_danger/dark_knight.lua
index 2115f46947b..dcd07cded8d 100644
--- a/data-otservbr-global/monster/quests/grave_danger/dark_knight.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/dark_knight.lua
@@ -16,7 +16,7 @@ monster.outfit = {
monster.health = 1800
monster.maxHealth = 1800
monster.race = "blood"
-monster.corpse = 0
+monster.corpse = 31203
monster.speed = 125
monster.manaCost = 0
diff --git a/data-otservbr-global/monster/quests/grave_danger/dark_paladin.lua b/data-otservbr-global/monster/quests/grave_danger/dark_paladin.lua
index f53a9fec76a..a0821fb4917 100644
--- a/data-otservbr-global/monster/quests/grave_danger/dark_paladin.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/dark_paladin.lua
@@ -16,7 +16,7 @@ monster.outfit = {
monster.health = 1800
monster.maxHealth = 1800
monster.race = "blood"
-monster.corpse = 0
+monster.corpse = 31204
monster.speed = 125
monster.manaCost = 0
diff --git a/data-otservbr-global/monster/quests/grave_danger/dark_sorcerer.lua b/data-otservbr-global/monster/quests/grave_danger/dark_sorcerer.lua
index f3f7fb478b9..9f6791d0232 100644
--- a/data-otservbr-global/monster/quests/grave_danger/dark_sorcerer.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/dark_sorcerer.lua
@@ -16,7 +16,7 @@ monster.outfit = {
monster.health = 1800
monster.maxHealth = 1800
monster.race = "blood"
-monster.corpse = 0
+monster.corpse = 31206
monster.speed = 125
monster.manaCost = 0
diff --git a/data-otservbr-global/monster/quests/grave_danger/fetter.lua b/data-otservbr-global/monster/quests/grave_danger/fetter.lua
index 9eb8ca308ac..203f1e14a8d 100644
--- a/data-otservbr-global/monster/quests/grave_danger/fetter.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/fetter.lua
@@ -20,6 +20,10 @@ monster.corpse = 0
monster.speed = 140
monster.manaCost = 0
+monster.events = {
+ "fetter_death",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
diff --git a/data-otservbr-global/monster/quests/grave_danger/magical_sphere.lua b/data-otservbr-global/monster/quests/grave_danger/magical_sphere.lua
new file mode 100644
index 00000000000..d17f881f3f9
--- /dev/null
+++ b/data-otservbr-global/monster/quests/grave_danger/magical_sphere.lua
@@ -0,0 +1,84 @@
+local mType = Game.createMonsterType("Magical Sphere")
+local monster = {}
+
+monster.description = "Magical Sphere"
+monster.experience = 0
+monster.outfit = {
+ lookType = 979,
+ lookHead = 0,
+ lookBody = 0,
+ lookLegs = 0,
+ lookFeet = 0,
+ lookAddons = 0,
+ lookMount = 0,
+}
+
+monster.health = 20000
+monster.maxHealth = 20000
+monster.race = "energy"
+monster.corpse = 0
+monster.speed = 0
+monster.manaCost = 0
+monster.maxSummons = 0
+
+monster.events = {
+ "sphere_death",
+}
+
+monster.changeTarget = {
+ interval = 5000,
+ chance = 20,
+}
+
+monster.flags = {
+ summonable = false,
+ attackable = true,
+ hostile = true,
+ convinceable = false,
+ pushable = false,
+ rewardBoss = false,
+ illusionable = true,
+ canPushItems = false,
+ canPushCreatures = false,
+ staticAttackChance = 95,
+ targetDistance = 1,
+ runHealth = 0,
+ healthHidden = false,
+ isBlockable = false,
+ canWalkOnEnergy = false,
+ canWalkOnFire = true,
+ canWalkOnPoison = false,
+ pet = false,
+}
+
+monster.light = {
+ level = 0,
+ color = 0,
+}
+
+monster.defenses = {
+ defense = 40,
+ armor = 40,
+}
+
+monster.elements = {
+ { type = COMBAT_PHYSICALDAMAGE, percent = 0 },
+ { type = COMBAT_ENERGYDAMAGE, percent = 0 },
+ { type = COMBAT_EARTHDAMAGE, percent = 0 },
+ { type = COMBAT_FIREDAMAGE, percent = 0 },
+ { type = COMBAT_LIFEDRAIN, percent = 0 },
+ { type = COMBAT_MANADRAIN, percent = 0 },
+ { type = COMBAT_DROWNDAMAGE, percent = 0 },
+ { type = COMBAT_ICEDAMAGE, percent = 0 },
+ { type = COMBAT_HOLYDAMAGE, percent = 0 },
+ { type = COMBAT_DEATHDAMAGE, percent = -20 },
+}
+
+monster.immunities = {
+ { type = "paralyze", condition = true },
+ { type = "outfit", condition = false },
+ { type = "invisible", condition = true },
+ { type = "bleed", condition = false },
+}
+
+mType:register(monster)
diff --git a/data-otservbr-global/monster/quests/grave_danger/magnor_mournbringer.lua b/data-otservbr-global/monster/quests/grave_danger/magnor_mournbringer.lua
new file mode 100644
index 00000000000..53882f6af5b
--- /dev/null
+++ b/data-otservbr-global/monster/quests/grave_danger/magnor_mournbringer.lua
@@ -0,0 +1,118 @@
+local mType = Game.createMonsterType("Magnor Mournbringer")
+local monster = {}
+
+monster.description = "a magnor mournbringer"
+monster.experience = 0
+monster.outfit = {
+ lookType = 1221,
+ lookHead = 95,
+ lookBody = 0,
+ lookLegs = 0,
+ lookFeet = 95,
+ lookAddons = 3,
+ lookMount = 0,
+}
+
+monster.health = 250000
+monster.maxHealth = 250000
+monster.race = "venom"
+monster.corpse = 0
+monster.speed = 250
+monster.manaCost = 0
+monster.maxSummons = 0
+
+monster.events = {
+ "magnor_death",
+}
+
+monster.changeTarget = {
+ interval = 4000,
+ chance = 10,
+}
+
+monster.strategiesTarget = {
+ nearest = 100,
+}
+
+monster.flags = {
+ summonable = false,
+ attackable = true,
+ hostile = true,
+ convinceable = false,
+ pushable = false,
+ rewardBoss = false,
+ illusionable = false,
+ canPushItems = true,
+ canPushCreatures = true,
+ staticAttackChance = 90,
+ targetDistance = 1,
+ runHealth = 0,
+ healthHidden = false,
+ isBlockable = false,
+ canWalkOnEnergy = true,
+ canWalkOnFire = true,
+ canWalkOnPoison = true,
+ pet = false,
+}
+
+monster.light = {
+ level = 0,
+ color = 0,
+}
+
+monster.voices = {
+ interval = 5000,
+ chance = 10,
+}
+
+monster.attacks = {
+ { name = "melee", interval = 2000, chance = 100, minDamage = -200, maxDamage = -600 },
+ { name = "combat", interval = 4000, chance = 70, type = COMBAT_ENERGYDAMAGE, minDamage = -1000, maxDamage = -1200, length = 5, effect = CONST_ME_BIGCLOUDS, target = false },
+ { name = "combat", interval = 3000, chance = 50, type = COMBAT_ENERGYDAMAGE, minDamage = -400, maxDamage = -900, length = 7, spread = 5, effect = CONST_ME_TELEPORT, target = false },
+}
+
+monster.defenses = {
+ defense = 25,
+ armor = 78,
+ { name = "combat", interval = 2000, chance = 54, type = COMBAT_HEALING, minDamage = 150, maxDamage = 950, effect = CONST_ME_MAGIC_BLUE, target = false },
+}
+
+monster.elements = {
+ { type = COMBAT_PHYSICALDAMAGE, percent = 0 },
+ { type = COMBAT_ENERGYDAMAGE, percent = 0 },
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+ { type = COMBAT_FIREDAMAGE, percent = -15 },
+ { type = COMBAT_LIFEDRAIN, percent = 0 },
+ { type = COMBAT_MANADRAIN, percent = 0 },
+ { type = COMBAT_DROWNDAMAGE, percent = 0 },
+ { type = COMBAT_ICEDAMAGE, percent = 0 },
+ { type = COMBAT_HOLYDAMAGE, percent = 0 },
+ { type = COMBAT_DEATHDAMAGE, percent = 100 },
+}
+
+monster.immunities = {
+ { type = "paralyze", condition = true },
+ { type = "outfit", condition = false },
+ { type = "invisible", condition = true },
+ { type = "bleed", condition = false },
+}
+
+monster.heals = {
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+}
+
+mType.onThink = function(monster, interval) end
+
+mType.onAppear = function(monster, creature)
+ if monster:getType():isRewardBoss() then
+ monster:setReward(true)
+ end
+end
+
+mType.onDisappear = function(monster, creature) end
+
+mType.onMove = function(monster, creature, fromPosition, toPosition) end
+
+mType.onSay = function(monster, creature, type, message) end
+
+mType:register(monster)
diff --git a/data-otservbr-global/monster/quests/grave_danger/nargol_the_impaler.lua b/data-otservbr-global/monster/quests/grave_danger/nargol_the_impaler.lua
new file mode 100644
index 00000000000..c985b745ad6
--- /dev/null
+++ b/data-otservbr-global/monster/quests/grave_danger/nargol_the_impaler.lua
@@ -0,0 +1,120 @@
+local mType = Game.createMonsterType("Nargol The Impaler")
+local monster = {}
+
+monster.description = "a nargol the impaler"
+monster.experience = 0
+monster.outfit = {
+ lookType = 1222,
+ lookHead = 0,
+ lookBody = 0,
+ lookLegs = 94,
+ lookFeet = 0,
+ lookAddons = 3,
+ lookMount = 0,
+}
+
+monster.health = 250000
+monster.maxHealth = 250000
+monster.race = "venom"
+monster.corpse = 0
+monster.speed = 250
+monster.manaCost = 0
+monster.maxSummons = 0
+
+monster.events = {
+ "nargol_death",
+}
+
+monster.changeTarget = {
+ interval = 4000,
+ chance = 10,
+}
+
+monster.strategiesTarget = {
+ nearest = 100,
+}
+
+monster.flags = {
+ summonable = false,
+ attackable = true,
+ hostile = true,
+ convinceable = false,
+ pushable = false,
+ rewardBoss = true,
+ illusionable = false,
+ canPushItems = true,
+ canPushCreatures = true,
+ staticAttackChance = 90,
+ targetDistance = 1,
+ runHealth = 0,
+ healthHidden = false,
+ isBlockable = false,
+ canWalkOnEnergy = true,
+ canWalkOnFire = true,
+ canWalkOnPoison = true,
+ pet = false,
+}
+
+monster.light = {
+ level = 0,
+ color = 0,
+}
+
+monster.voices = {
+ interval = 5000,
+ chance = 10,
+}
+
+monster.loot = {}
+
+monster.attacks = {
+ { name = "melee", interval = 2000, chance = 100, minDamage = -800, maxDamage = -1200 },
+ { name = "combat", interval = 6000, chance = 56, type = COMBAT_EARTHDAMAGE, minDamage = -1000, maxDamage = -1200, length = 7, spread = 5, effect = CONST_ME_POISONAREA, target = false },
+ { name = "combat", interval = 5000, chance = 70, type = COMBAT_LIFEDRAIN, minDamage = -700, maxDamage = -900, length = 7, effect = CONST_ME_MORTAREA, target = false },
+}
+
+monster.defenses = {
+ defense = 25,
+ armor = 78,
+ { name = "combat", interval = 2000, chance = 55, type = COMBAT_HEALING, minDamage = 350, maxDamage = 950, effect = CONST_ME_MAGIC_BLUE, target = false },
+}
+
+monster.elements = {
+ { type = COMBAT_PHYSICALDAMAGE, percent = 0 },
+ { type = COMBAT_ENERGYDAMAGE, percent = 0 },
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+ { type = COMBAT_FIREDAMAGE, percent = -20 },
+ { type = COMBAT_LIFEDRAIN, percent = 0 },
+ { type = COMBAT_MANADRAIN, percent = 0 },
+ { type = COMBAT_DROWNDAMAGE, percent = 0 },
+ { type = COMBAT_ICEDAMAGE, percent = 0 },
+ { type = COMBAT_HOLYDAMAGE, percent = 0 },
+ { type = COMBAT_DEATHDAMAGE, percent = 100 },
+}
+
+monster.immunities = {
+ { type = "paralyze", condition = true },
+ { type = "outfit", condition = false },
+ { type = "invisible", condition = true },
+ { type = "bleed", condition = false },
+}
+
+monster.heals = {
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+}
+
+mType.onThink = function(monster, interval) end
+
+mType.onAppear = function(monster, creature)
+ if monster:getType():isRewardBoss() then
+ monster:setReward(true)
+ end
+end
+
+mType.onDisappear = function(monster, creature) end
+
+mType.onMove = function(monster, creature, fromPosition, toPosition) end
+
+mType.onSay = function(monster, creature, type, message) end
+
+mType:register(monster)
diff --git a/data-otservbr-global/monster/quests/grave_danger/regenerating_mass.lua b/data-otservbr-global/monster/quests/grave_danger/regenerating_mass.lua
new file mode 100644
index 00000000000..2daba01aef4
--- /dev/null
+++ b/data-otservbr-global/monster/quests/grave_danger/regenerating_mass.lua
@@ -0,0 +1,92 @@
+local mType = Game.createMonsterType("Regenerating Mass")
+local monster = {}
+
+monster.description = "a regenerating mass"
+monster.experience = 0
+monster.outfit = {
+ lookType = 238,
+ lookHead = 0,
+ lookBody = 0,
+ lookLegs = 0,
+ lookFeet = 0,
+ lookAddons = 0,
+ lookMount = 0,
+}
+
+monster.health = 100000
+monster.maxHealth = 100000
+monster.race = "venom"
+monster.corpse = 0
+monster.speed = 160
+monster.manaCost = 0
+monster.maxSummons = 0
+
+monster.changeTarget = {
+ interval = 4000,
+ chance = 10,
+}
+
+monster.strategiesTarget = {
+ nearest = 70,
+ health = 10,
+ damage = 10,
+ random = 10,
+}
+
+monster.flags = {
+ summonable = false,
+ attackable = true,
+ hostile = true,
+ convinceable = false,
+ pushable = false,
+ rewardBoss = false,
+ illusionable = true,
+ canPushItems = true,
+ canPushCreatures = true,
+ staticAttackChance = 80,
+ targetDistance = 1,
+ runHealth = 85,
+ healthHidden = false,
+ isBlockable = false,
+ canWalkOnEnergy = false,
+ canWalkOnFire = false,
+ canWalkOnPoison = true,
+ pet = false,
+}
+
+monster.light = {
+ level = 0,
+ color = 0,
+}
+
+monster.attacks = {
+ { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -440 },
+}
+
+monster.defenses = {
+ defense = 20,
+ armor = 20,
+ { name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 880, maxDamage = 1050, effect = CONST_ME_MAGIC_BLUE, target = false },
+}
+
+monster.elements = {
+ { type = COMBAT_PHYSICALDAMAGE, percent = 0 },
+ { type = COMBAT_ENERGYDAMAGE, percent = 10 },
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+ { type = COMBAT_FIREDAMAGE, percent = -25 },
+ { type = COMBAT_LIFEDRAIN, percent = 0 },
+ { type = COMBAT_MANADRAIN, percent = 0 },
+ { type = COMBAT_DROWNDAMAGE, percent = 0 },
+ { type = COMBAT_ICEDAMAGE, percent = 20 },
+ { type = COMBAT_HOLYDAMAGE, percent = 0 },
+ { type = COMBAT_DEATHDAMAGE, percent = 0 },
+}
+
+monster.immunities = {
+ { type = "paralyze", condition = true },
+ { type = "outfit", condition = false },
+ { type = "invisible", condition = true },
+ { type = "bleed", condition = false },
+}
+
+mType:register(monster)
diff --git a/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody.lua b/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody.lua
new file mode 100644
index 00000000000..92cc0b7dcf5
--- /dev/null
+++ b/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody.lua
@@ -0,0 +1,121 @@
+local mType = Game.createMonsterType("Rewar The Bloody")
+local monster = {}
+
+monster.name = "Rewar The Bloody"
+monster.description = "a rewar the bloody"
+monster.experience = 0
+monster.outfit = {
+ lookType = 1221,
+ lookHead = 0,
+ lookBody = 95,
+ lookLegs = 0,
+ lookFeet = 0,
+ lookAddons = 1,
+ lookMount = 0,
+}
+
+monster.health = 250000
+monster.maxHealth = 250000
+monster.race = "venom"
+monster.corpse = 0
+monster.speed = 250
+monster.manaCost = 0
+monster.maxSummons = 0
+
+monster.events = {
+ "blood_death",
+ "rewar_the_bloody",
+}
+
+monster.changeTarget = {
+ interval = 4000,
+ chance = 10,
+}
+
+monster.strategiesTarget = {
+ nearest = 100,
+}
+
+monster.flags = {
+ summonable = false,
+ attackable = true,
+ hostile = true,
+ convinceable = false,
+ pushable = false,
+ rewardBoss = false,
+ illusionable = false,
+ canPushItems = true,
+ canPushCreatures = true,
+ staticAttackChance = 90,
+ targetDistance = 1,
+ runHealth = 0,
+ healthHidden = false,
+ isBlockable = false,
+ canWalkOnEnergy = true,
+ canWalkOnFire = true,
+ canWalkOnPoison = true,
+ pet = false,
+}
+
+monster.light = {
+ level = 0,
+ color = 0,
+}
+
+monster.voices = {
+ interval = 5000,
+ chance = 10,
+}
+
+monster.attacks = {
+ { name = "melee", interval = 2000, chance = 100, minDamage = -800, maxDamage = -1200 },
+ { name = "combat", interval = 3000, chance = 46, type = COMBAT_DROWNDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_BUBBLES, target = false },
+ { name = "combat", interval = 5000, chance = 70, type = COMBAT_LIFEDRAIN, minDamage = -700, maxDamage = -900, length = 7, effect = CONST_ME_MAGIC_RED, target = false },
+ { name = "combat", interval = 6000, chance = 46, type = COMBAT_EARTHDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_POISONAREA, target = false },
+}
+
+monster.defenses = {
+ defense = 25,
+ armor = 78,
+ { name = "combat", interval = 2000, chance = 54, type = COMBAT_HEALING, minDamage = 900, maxDamage = 1000, effect = CONST_ME_MAGIC_BLUE, target = false },
+}
+
+monster.elements = {
+ { type = COMBAT_PHYSICALDAMAGE, percent = 0 },
+ { type = COMBAT_ENERGYDAMAGE, percent = 0 },
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+ { type = COMBAT_FIREDAMAGE, percent = -20 },
+ { type = COMBAT_LIFEDRAIN, percent = 0 },
+ { type = COMBAT_MANADRAIN, percent = 0 },
+ { type = COMBAT_DROWNDAMAGE, percent = 0 },
+ { type = COMBAT_ICEDAMAGE, percent = 0 },
+ { type = COMBAT_HOLYDAMAGE, percent = 0 },
+ { type = COMBAT_DEATHDAMAGE, percent = 100 },
+}
+
+monster.immunities = {
+ { type = "paralyze", condition = true },
+ { type = "outfit", condition = false },
+ { type = "invisible", condition = true },
+ { type = "bleed", condition = false },
+}
+
+monster.heals = {
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+}
+
+mType.onThink = function(monster, interval) end
+
+mType.onAppear = function(monster, creature)
+ if monster:getType():isRewardBoss() then
+ monster:setReward(true)
+ end
+end
+
+mType.onDisappear = function(monster, creature) end
+
+mType.onMove = function(monster, creature, fromPosition, toPosition) end
+
+mType.onSay = function(monster, creature, type, message) end
+
+mType:register(monster)
diff --git a/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody_inv.lua b/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody_inv.lua
new file mode 100644
index 00000000000..d2bfa1fa1be
--- /dev/null
+++ b/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody_inv.lua
@@ -0,0 +1,120 @@
+local mType = Game.createMonsterType("Rewar The Bloody Inv")
+local monster = {}
+
+monster.name = "Rewar The Bloody"
+monster.description = "a rewar the bloody"
+monster.experience = 0
+monster.outfit = {
+ lookType = 633,
+ lookHead = 79,
+ lookBody = 94,
+ lookLegs = 57,
+ lookFeet = 0,
+ lookAddons = 3,
+ lookMount = 0,
+}
+
+monster.health = 250000
+monster.maxHealth = 250000
+monster.race = "venom"
+monster.corpse = 0
+monster.speed = 250
+monster.manaCost = 0
+monster.maxSummons = 0
+
+monster.events = {
+ "rewar_the_bloody",
+}
+
+monster.changeTarget = {
+ interval = 4000,
+ chance = 10,
+}
+
+monster.strategiesTarget = {
+ nearest = 100,
+}
+
+monster.flags = {
+ summonable = false,
+ attackable = true,
+ hostile = true,
+ convinceable = false,
+ pushable = false,
+ rewardBoss = false,
+ illusionable = false,
+ canPushItems = true,
+ canPushCreatures = true,
+ staticAttackChance = 90,
+ targetDistance = 1,
+ runHealth = 0,
+ healthHidden = false,
+ isBlockable = false,
+ canWalkOnEnergy = true,
+ canWalkOnFire = true,
+ canWalkOnPoison = true,
+ pet = false,
+}
+
+monster.light = {
+ level = 0,
+ color = 0,
+}
+
+monster.voices = {
+ interval = 5000,
+ chance = 10,
+}
+
+monster.attacks = {
+ { name = "melee", interval = 2000, chance = 100, minDamage = -800, maxDamage = -1200 },
+ { name = "combat", interval = 3000, chance = 46, type = COMBAT_DROWNDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_BUBBLES, target = false },
+ { name = "combat", interval = 5000, chance = 70, type = COMBAT_LIFEDRAIN, minDamage = -700, maxDamage = -900, length = 7, effect = CONST_ME_MAGIC_RED, target = false },
+ { name = "combat", interval = 6000, chance = 46, type = COMBAT_EARTHDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_POISONAREA, target = false },
+}
+
+monster.defenses = {
+ defense = 25,
+ armor = 78,
+ { name = "combat", interval = 2000, chance = 54, type = COMBAT_HEALING, minDamage = 900, maxDamage = 1000, effect = CONST_ME_MAGIC_BLUE, target = false },
+}
+
+monster.elements = {
+ { type = COMBAT_PHYSICALDAMAGE, percent = 100 },
+ { type = COMBAT_ENERGYDAMAGE, percent = 100 },
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+ { type = COMBAT_FIREDAMAGE, percent = 100 },
+ { type = COMBAT_LIFEDRAIN, percent = 100 },
+ { type = COMBAT_MANADRAIN, percent = 100 },
+ { type = COMBAT_DROWNDAMAGE, percent = 100 },
+ { type = COMBAT_ICEDAMAGE, percent = 100 },
+ { type = COMBAT_HOLYDAMAGE, percent = 100 },
+ { type = COMBAT_DEATHDAMAGE, percent = 100 },
+}
+
+monster.immunities = {
+ { type = "paralyze", condition = true },
+ { type = "outfit", condition = false },
+ { type = "invisible", condition = true },
+ { type = "bleed", condition = false },
+}
+
+monster.heals = {
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+}
+
+mType.onThink = function(monster, interval) end
+
+mType.onAppear = function(monster, creature)
+ if monster:getType():isRewardBoss() then
+ monster:setReward(true)
+ end
+end
+
+mType.onDisappear = function(monster, creature) end
+
+mType.onMove = function(monster, creature, fromPosition, toPosition) end
+
+mType.onSay = function(monster, creature, type, message) end
+
+mType:register(monster)
diff --git a/data-otservbr-global/monster/quests/grave_danger/shard_of_magnor.lua b/data-otservbr-global/monster/quests/grave_danger/shard_of_magnor.lua
index 8f0671ebe21..f504cb7d47c 100644
--- a/data-otservbr-global/monster/quests/grave_danger/shard_of_magnor.lua
+++ b/data-otservbr-global/monster/quests/grave_danger/shard_of_magnor.lua
@@ -20,6 +20,10 @@ monster.corpse = 0
monster.speed = 125
monster.manaCost = 0
+monster.events = {
+ "shard_death",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
diff --git a/data-otservbr-global/monster/quests/grave_danger/tainted_soul_splinter.lua b/data-otservbr-global/monster/quests/grave_danger/tainted_soul_splinter.lua
new file mode 100644
index 00000000000..e20558b5c1e
--- /dev/null
+++ b/data-otservbr-global/monster/quests/grave_danger/tainted_soul_splinter.lua
@@ -0,0 +1,80 @@
+local mType = Game.createMonsterType("Tainted Soul Splinter")
+local monster = {}
+
+monster.description = "tainted soul splinter"
+monster.experience = 0
+monster.outfit = {
+ lookType = 1219,
+ lookHead = 94,
+ lookBody = 94,
+ lookLegs = 94,
+ lookFeet = 94,
+ lookAddons = 0,
+ lookMount = 0,
+}
+
+monster.health = 10000
+monster.maxHealth = 10000
+monster.race = "undead"
+monster.corpse = 35995
+monster.speed = 200
+monster.manaCost = 0
+monster.maxSummons = 0
+
+monster.changeTarget = {
+ interval = 5000,
+ chance = 20,
+}
+
+monster.flags = {
+ summonable = false,
+ attackable = true,
+ hostile = true,
+ convinceable = false,
+ pushable = false,
+ rewardBoss = false,
+ illusionable = false,
+ canPushItems = true,
+ canPushCreatures = false,
+ staticAttackChance = 95,
+ targetDistance = 0,
+ runHealth = 0,
+ healthHidden = false,
+ isBlockable = false,
+ canWalkOnEnergy = true,
+ canWalkOnFire = true,
+ canWalkOnPoison = true,
+ pet = false,
+}
+
+monster.light = {
+ level = 0,
+ color = 0,
+}
+
+monster.defenses = {
+ defense = 40,
+ armor = 40,
+}
+
+monster.elements = {
+ { type = COMBAT_PHYSICALDAMAGE, percent = 0 },
+ { type = COMBAT_ENERGYDAMAGE, percent = 0 },
+ { type = COMBAT_EARTHDAMAGE, percent = 0 },
+ { type = COMBAT_FIREDAMAGE, percent = 0 },
+ { type = COMBAT_LIFEDRAIN, percent = 0 },
+ { type = COMBAT_MANADRAIN, percent = 0 },
+ { type = COMBAT_DROWNDAMAGE, percent = 0 },
+ { type = COMBAT_ICEDAMAGE, percent = 0 },
+ { type = COMBAT_HOLYDAMAGE, percent = 0 },
+ { type = COMBAT_DEATHDAMAGE, percent = 0 },
+}
+
+monster.immunities = {
+ { type = "paralyze", condition = true },
+ { type = "outfit", condition = false },
+ { type = "invisible", condition = true },
+ { type = "bleed", condition = false },
+}
+
+mType:register(monster)
diff --git a/data-otservbr-global/monster/quests/grave_danger/the_red_knight.lua b/data-otservbr-global/monster/quests/grave_danger/the_red_knight.lua
new file mode 100644
index 00000000000..3849bb8d877
--- /dev/null
+++ b/data-otservbr-global/monster/quests/grave_danger/the_red_knight.lua
@@ -0,0 +1,112 @@
+local mType = Game.createMonsterType("The Red Knight")
+local monster = {}
+
+monster.description = "a the red knight"
+monster.experience = 0
+monster.outfit = {
+ lookType = 1223,
+ lookHead = 94,
+ lookBody = 38,
+ lookLegs = 94,
+ lookFeet = 76,
+ lookAddons = 3,
+ lookMount = 0,
+}
+
+monster.health = 250000
+monster.maxHealth = 250000
+monster.race = "venom"
+monster.corpse = 36434
+monster.speed = 250
+monster.manaCost = 0
+
+monster.changeTarget = {
+ interval = 4000,
+ chance = 10,
+}
+
+monster.strategiesTarget = {
+ nearest = 100,
+}
+
+monster.flags = {
+ summonable = false,
+ attackable = true,
+ hostile = true,
+ convinceable = false,
+ pushable = false,
+ rewardBoss = false,
+ illusionable = false,
+ canPushItems = true,
+ canPushCreatures = true,
+ staticAttackChance = 90,
+ targetDistance = 1,
+ runHealth = 0,
+ healthHidden = false,
+ isBlockable = false,
+ canWalkOnEnergy = true,
+ canWalkOnFire = true,
+ canWalkOnPoison = true,
+ pet = false,
+}
+
+monster.light = {
+ level = 0,
+ color = 0,
+}
+
+monster.voices = {
+ interval = 5000,
+ chance = 10,
+}
+
+monster.attacks = {
+ { name = "melee", interval = 2000, chance = 100, minDamage = -200, maxDamage = -1000 },
+ { name = "combat", interval = 2000, chance = 15, type = COMBAT_EARTHDAMAGE, minDamage = -400, maxDamage = -1000, length = 7, spread = 3, effect = CONST_ME_POISONAREA, target = false },
+}
+
+monster.defenses = {
+ defense = 25,
+ armor = 78,
+ { name = "combat", interval = 2000, chance = 50, type = COMBAT_HEALING, minDamage = 150, maxDamage = 950, effect = CONST_ME_MAGIC_BLUE, target = false },
+}
+
+monster.elements = {
+ { type = COMBAT_PHYSICALDAMAGE, percent = 100 },
+ { type = COMBAT_ENERGYDAMAGE, percent = 100 },
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+ { type = COMBAT_FIREDAMAGE, percent = 100 },
+ { type = COMBAT_LIFEDRAIN, percent = 100 },
+ { type = COMBAT_MANADRAIN, percent = 100 },
+ { type = COMBAT_DROWNDAMAGE, percent = 0 },
+ { type = COMBAT_ICEDAMAGE, percent = 100 },
+ { type = COMBAT_HOLYDAMAGE, percent = 100 },
+ { type = COMBAT_DEATHDAMAGE, percent = 100 },
+}
+
+monster.immunities = {
+ { type = "paralyze", condition = true },
+ { type = "outfit", condition = false },
+ { type = "invisible", condition = true },
+ { type = "bleed", condition = false },
+}
+
+monster.heals = {
+ { type = COMBAT_EARTHDAMAGE, percent = 100 },
+}
+
+mType.onThink = function(monster, interval) end
+
+mType.onAppear = function(monster, creature)
+ if monster:getType():isRewardBoss() then
+ monster:setReward(true)
+ end
+end
+
+mType.onDisappear = function(monster, creature) end
+
+mType.onMove = function(monster, creature, fromPosition, toPosition) end
+
+mType.onSay = function(monster, creature, type, message) end
+
+mType:register(monster)
diff --git a/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_immaculate.lua b/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_immaculate.lua
index 8f41b9c404b..2cefeec88e2 100644
--- a/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_immaculate.lua
+++ b/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_immaculate.lua
@@ -20,6 +20,10 @@ monster.corpse = 0
monster.speed = 95
monster.manaCost = 0
+monster.events = {
+ "UrmahlulluChanges",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
@@ -57,9 +61,6 @@ monster.flags = {
canWalkOnPoison = true,
}
-monster.events = {
- "UrmahlulluChanges",
-}
monster.light = {
level = 0,
color = 0,
diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua
index af8b385ddb2..ecc656ee04e 100644
--- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua
+++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua
@@ -13,10 +13,6 @@ monster.outfit = {
lookMount = 0,
}
-monster.events = {
- "DreamCourtsBossDeath",
-}
-
monster.health = 320000
monster.maxHealth = 320000
monster.race = "blood"
@@ -24,6 +20,11 @@ monster.corpse = 30155
monster.speed = 125
monster.manaCost = 0
+monster.events = {
+ "dreamCourtsDeath",
+ "facelessHealth",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
@@ -32,7 +33,6 @@ monster.changeTarget = {
monster.bosstiary = {
bossRaceId = 1698, -- or 1715 need test
bossRace = RARITY_NEMESIS,
- storage = Storage.Quest.U12_00.TheDreamCourts.ArenaTimer,
}
monster.strategiesTarget = {
diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua
index f129a99f00a..09aac84822e 100644
--- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua
+++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua
@@ -20,6 +20,11 @@ monster.corpse = 30013
monster.speed = 125
monster.manaCost = 0
+monster.events = {
+ "dreamCourtsDeath",
+ "facelessThink",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 20,
diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/izcandar_the_banished.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/izcandar_the_banished.lua
index 88688c4fffc..fb4b27530ee 100644
--- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/izcandar_the_banished.lua
+++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/izcandar_the_banished.lua
@@ -13,14 +13,9 @@ monster.outfit = {
lookMount = 0,
}
-monster.events = {
- "DreamCourtsBossDeath",
-}
-
monster.bosstiary = {
bossRaceId = 1699,
bossRace = RARITY_NEMESIS,
- storage = Storage.Quest.U12_00.TheDreamCourts.ArenaTimer,
}
monster.health = 320000
@@ -30,6 +25,11 @@ monster.corpse = 6068
monster.speed = 125
monster.manaCost = 0
+monster.events = {
+ "dreamCourtsDeath",
+ "izcandarThink",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua
index 651ee8cb59b..02d613095da 100644
--- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua
+++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua
@@ -13,10 +13,6 @@ monster.outfit = {
lookMount = 0,
}
-monster.events = {
- "DreamCourtsBossDeath",
-}
-
monster.health = 320000
monster.maxHealth = 320000
monster.race = "blood"
@@ -24,6 +20,10 @@ monster.corpse = 30017
monster.speed = 125
monster.manaCost = 0
+monster.events = {
+ "dreamCourtsDeath",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
@@ -32,7 +32,6 @@ monster.changeTarget = {
monster.bosstiary = {
bossRaceId = 1696,
bossRace = RARITY_NEMESIS,
- storage = Storage.Quest.U12_00.TheDreamCourts.ArenaTimer,
}
monster.strategiesTarget = {
diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua
index a54257df723..03459e0dc59 100644
--- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua
+++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua
@@ -13,10 +13,6 @@ monster.outfit = {
lookMount = 0,
}
-monster.events = {
- "DreamCourtsBossDeath",
-}
-
monster.health = 320000
monster.maxHealth = 320000
monster.race = "blood"
@@ -24,6 +20,10 @@ monster.corpse = 30151
monster.speed = 125
monster.manaCost = 0
+monster.events = {
+ "dreamCourtsDeath",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
@@ -32,7 +32,6 @@ monster.changeTarget = {
monster.bosstiary = {
bossRaceId = 1697,
bossRace = RARITY_NEMESIS,
- storage = Storage.Quest.U12_00.TheDreamCourts.ArenaTimer,
}
monster.strategiesTarget = {
diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua
index 3d5675c4486..47604fd9c8a 100644
--- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua
+++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua
@@ -13,10 +13,6 @@ monster.outfit = {
lookMount = 0,
}
-monster.events = {
- "DreamCourtsBossDeath",
-}
-
monster.health = 320000
monster.maxHealth = 320000
monster.race = "venom"
@@ -24,6 +20,11 @@ monster.corpse = 30022
monster.speed = 85
monster.manaCost = 0
+monster.events = {
+ "dreamCourtsDeath",
+ "facelessHealth",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
@@ -32,7 +33,6 @@ monster.changeTarget = {
monster.bosstiary = {
bossRaceId = 1695,
bossRace = RARITY_NEMESIS,
- storage = Storage.Quest.U12_00.TheDreamCourts.ArenaTimer,
}
monster.strategiesTarget = {
diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/the_nightmare_beast.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/the_nightmare_beast.lua
index 3937edcd2d4..8a6992dd492 100644
--- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/the_nightmare_beast.lua
+++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/the_nightmare_beast.lua
@@ -13,10 +13,6 @@ monster.outfit = {
lookMount = 0,
}
-monster.events = {
- "DreamCourtsBossDeath",
-}
-
monster.health = 850000
monster.maxHealth = 850000
monster.race = "blood"
@@ -24,6 +20,10 @@ monster.corpse = 30159
monster.speed = 125
monster.manaCost = 0
+monster.events = {
+ "dreamCourtsDeath",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
@@ -32,7 +32,6 @@ monster.changeTarget = {
monster.bosstiary = {
bossRaceId = 1718,
bossRace = RARITY_ARCHFOE,
- storage = Storage.Quest.U12_00.TheDreamCourts.NightmareBeastTimer,
}
monster.strategiesTarget = {
diff --git a/data-otservbr-global/monster/quests/the_dream_courts/horrible_dream.lua b/data-otservbr-global/monster/quests/the_dream_courts/horrible_dream.lua
index ed6c3888dcc..1c6ba422aa2 100644
--- a/data-otservbr-global/monster/quests/the_dream_courts/horrible_dream.lua
+++ b/data-otservbr-global/monster/quests/the_dream_courts/horrible_dream.lua
@@ -20,6 +20,10 @@ monster.corpse = 11317
monster.speed = 90
monster.manaCost = 0
+monster.events = {
+ "dreamCourtsDeath",
+}
+
monster.changeTarget = {
interval = 5000,
chance = 0,
diff --git a/data-otservbr-global/monster/quests/the_dream_courts/mind-wrecking_dream.lua b/data-otservbr-global/monster/quests/the_dream_courts/mind-wrecking_dream.lua
index 64c2f952995..d35cc804fe2 100644
--- a/data-otservbr-global/monster/quests/the_dream_courts/mind-wrecking_dream.lua
+++ b/data-otservbr-global/monster/quests/the_dream_courts/mind-wrecking_dream.lua
@@ -20,6 +20,10 @@ monster.corpse = 8127
monster.speed = 130
monster.manaCost = 0
+monster.events = {
+ "dreamCourtsDeath",
+}
+
monster.changeTarget = {
interval = 5000,
chance = 20,
diff --git a/data-otservbr-global/monster/quests/the_dream_courts/nightmarish_dream.lua b/data-otservbr-global/monster/quests/the_dream_courts/nightmarish_dream.lua
index dfec10276cd..0ac4f9c48cd 100644
--- a/data-otservbr-global/monster/quests/the_dream_courts/nightmarish_dream.lua
+++ b/data-otservbr-global/monster/quests/the_dream_courts/nightmarish_dream.lua
@@ -20,6 +20,10 @@ monster.corpse = 0
monster.speed = 100
monster.manaCost = 0
+monster.events = {
+ "dreamCourtsDeath",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
diff --git a/data-otservbr-global/monster/quests/the_dream_courts/plant_abomination.lua b/data-otservbr-global/monster/quests/the_dream_courts/plant_abomination.lua
index fefb9dc4ce3..0fca2ea78ff 100644
--- a/data-otservbr-global/monster/quests/the_dream_courts/plant_abomination.lua
+++ b/data-otservbr-global/monster/quests/the_dream_courts/plant_abomination.lua
@@ -20,6 +20,10 @@ monster.corpse = 0
monster.speed = 110
monster.manaCost = 0
+monster.events = {
+ "dreamCourtsDeath",
+}
+
monster.changeTarget = {
interval = 4000,
chance = 10,
diff --git a/data-otservbr-global/monster/quests/the_dream_courts/unpleasant_dream.lua b/data-otservbr-global/monster/quests/the_dream_courts/unpleasant_dream.lua
index d5afbaf7c4c..ed86f01eac1 100644
--- a/data-otservbr-global/monster/quests/the_dream_courts/unpleasant_dream.lua
+++ b/data-otservbr-global/monster/quests/the_dream_courts/unpleasant_dream.lua
@@ -13,6 +13,10 @@ monster.outfit = {
lookMount = 0,
}
+monster.events = {
+ "dreamCourtsDeath",
+}
+
monster.health = 50
monster.maxHealth = 50
monster.race = "blood"
@@ -20,6 +24,10 @@ monster.corpse = 0
monster.speed = 125
monster.manaCost = 0
+monster.events = {
+ "dreamCourtsDeath",
+}
+
monster.changeTarget = {
interval = 5000,
chance = 0,
diff --git a/data-otservbr-global/npc/alyxo.lua b/data-otservbr-global/npc/alyxo.lua
index f8fd752ba48..35a8f759252 100644
--- a/data-otservbr-global/npc/alyxo.lua
+++ b/data-otservbr-global/npc/alyxo.lua
@@ -49,15 +49,15 @@ local function greetCallback(npc, creature)
local player = Player(creature)
local playerId = player:getId()
- if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
- elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then
+ elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 15)
- elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.First.Mission, 5)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5)
npcHandler:setTopic(playerId, 20)
end
return true
@@ -73,17 +73,17 @@ local function creatureSayCallback(npc, creature, type, message)
-- Mission 3 Steal The Ambassador Ring
if MsgContains(message, "mission") then
- if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 1 then
npcHandler:setTopic(playerId, 1)
end
npcHandler:say({ "Could you kill 3 bosses for me?" }, npc, creature) -- needs review, this is not the speech of the global
elseif MsgContains(message, "yes") then
- if npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 1 then
+ if npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 1 then
npcHandler:say({ "Come back as soon as you kill all 3 bosses." }, npc, creature) -- needs review, this is not the speech of the global
- player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 2)
- player:setStorageValue(Storage.Kilmaresh.Twelve.Bragrumol, 1)
- player:setStorageValue(Storage.Kilmaresh.Twelve.Mozradek, 1)
- player:setStorageValue(Storage.Kilmaresh.Twelve.Xogixath, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 2)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath, 1)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say({ "Sorry, you do not have access." }, npc, creature)
@@ -91,80 +91,80 @@ local function creatureSayCallback(npc, creature, type, message)
end
end
-- Mission 3 Steal The Ambassador Ring
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 2 then
- if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 2 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 2 then
npcHandler:say({ "Did you manage to face all 3 bosses?" }, npc, creature) -- needs review, this is not the speech of the global
npcHandler:setTopic(playerId, 3)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 2 then
- if player:getStorageValue(Storage.Kilmaresh.Twelve.Bragrumol) == 2 and player:getStorageValue(Storage.Kilmaresh.Twelve.Mozradek) == 2 and player:getStorageValue(Storage.Kilmaresh.Twelve.Xogixath) == 2 then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol) == 2 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek) == 2 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath) == 2 then
npcHandler:say({ "I am very satisfied." }, npc, creature) -- needs review, this is not the speech of the global
- player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 3)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 3)
npcHandler:setTopic(playerId, 4)
else
npcHandler:say({ "Sorry." }, npc, creature)
npcHandler:setTopic(playerId, 0)
end
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then
- if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then
npcHandler:say({ "Could you help me with some more work?" }, npc, creature) -- needs review, this is not the speech of the global
npcHandler:setTopic(playerId, 5)
npcHandler:setTopic(playerId, 5)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then
- if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then
npcHandler:say({ "Kill 300 members of the Fafnar cult, help me find Ivory Lyre and help me find an animal to stone." }, npc, creature) -- needs review, this is not the speech of the global
- player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 4)
- player:setStorageValue(Storage.Kilmaresh.Thirteen.Fafnar, 1)
- player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 1)
- player:setStorageValue(Storage.Kilmaresh.Thirteen.Presente, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 4)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente, 1)
npcHandler:setTopic(playerId, 6)
else
npcHandler:say({ "Sorry." }, npc, creature)
npcHandler:setTopic(playerId, 0)
end
end
- if MsgContains(message, "report") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then
- if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then
+ if MsgContains(message, "report") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then
npcHandler:say({ "Have you finished killing the 300 members of Fafnar's cult?" }, npc, creature) -- needs review, this is not the speech of the global
npcHandler:setTopic(playerId, 7)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 7 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then
- if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 7 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then
npcHandler:say({ "Thanks. You killed the 300 members of the Fafnar cult." }, npc, creature) -- needs review, this is not the speech of the global
- player:setStorageValue(Storage.Kilmaresh.Thirteen.Fafnar, 301)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar, 301)
npcHandler:setTopic(playerId, 8)
else
npcHandler:say({ "Sorry." }, npc, creature)
npcHandler:setTopic(playerId, 0)
end
end
- if MsgContains(message, "report") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 then
- if player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 then
+ if MsgContains(message, "report") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 then
npcHandler:say({ "Did you manage to find Lyre?" }, npc, creature) -- needs review, this is not the speech of the global
npcHandler:setTopic(playerId, 9)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 9 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 then
- if player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 and player:getItemById(31447, 1) then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 9 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 and player:getItemById(31447, 1) then
player:removeItem(31447, 1)
npcHandler:say({ "Thanks. I was looking for Lyre for a long time." }, npc, creature) -- needs review, this is not the speech of the global
- player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 4)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 4)
else
npcHandler:say({ "Sorry." }, npc, creature)
npcHandler:setTopic(playerId, 0)
end
end
- if MsgContains(message, "report") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 then
- if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 then
+ if MsgContains(message, "report") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 then
npcHandler:say({ "Did you manage to find Small Tortoise?" }, npc, creature) -- needs review, this is not the speech of the global
npcHandler:setTopic(playerId, 11)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 11 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 then
- if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 and player:getItemById(31445, 1) then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 11 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 and player:getItemById(31445, 1) then
player:removeItem(31445, 1)
npcHandler:say({ "Thanks. I was looking for Small Tortoise." }, npc, creature) -- needs review, this is not the speech of the global
- player:setStorageValue(Storage.Kilmaresh.Thirteen.Presente, 3)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente, 3)
npcHandler:setTopic(playerId, 12)
else
npcHandler:say({ "Sorry." }, npc, creature)
@@ -187,17 +187,17 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 0)
end
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then
- if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then
npcHandler:say({ "Did you finish the 3 jobs I gave you?" }, npc, creature) -- needs review, this is not the speech of the global
npcHandler:setTopic(playerId, 13)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 13 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then
- if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 13 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then
player:addAchievement("Sculptor Apprentice", 'Congratulations! You earned the achievement "Sculptor Apprentice".')
player:addItem(31574, 1)
npcHandler:say({ "Congratulations, you have completed the 3 jobs I gave you." }, npc, creature) -- needs review, this is not the speech of the global
- player:setStorageValue(Storage.Kilmaresh.Fourteen.Remains, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains, 1)
npcHandler:setTopic(playerId, 14)
else
npcHandler:say({ "Sorry." }, npc, creature)
diff --git a/data-otservbr-global/npc/ambassador_of_rathleton.lua b/data-otservbr-global/npc/ambassador_of_rathleton.lua
index fa120c51941..deee159907b 100644
--- a/data-otservbr-global/npc/ambassador_of_rathleton.lua
+++ b/data-otservbr-global/npc/ambassador_of_rathleton.lua
@@ -58,23 +58,31 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end
-keywordHandler:addKeyword({ "present" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "This is a very beautiful ring. Thank you for this generous present!",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 2 and player:getItemById(31263, true)
-end, function(player)
- player:removeItem(31263, 1)
- player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 1)
- player:setStorageValue(Storage.Kilmaresh.Third.Recovering, 3)
-end)
-
-keywordHandler:addKeyword({ "present" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "Didn't you bring my gift?",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 2
-end)
+local function creatureSayCallback(npc, creature, type, message)
+ local player = Player(creature)
+ local playerId = player:getId()
+
+ if not npcHandler:checkInteraction(npc, creature) then
+ return false
+ end
+
+ if MsgContains(message, "present") then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) == 2 then
+ if player:getItemById(31263, true) then
+ npcHandler:say("This is a very beautiful ring. Thank you for this generous present!", npc, creature)
+ player:removeItem(31263, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering, 3)
+ else
+ npcHandler:say("Didn't you bring my gift?", npc, creature)
+ end
+ else
+ npcHandler:say("I don't need a present right now. Thank you.", npc, creature)
+ end
+ end
+
+ return true
+end
+
npcHandler:setMessage(MESSAGE_GREET, "Greetings, friend.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
diff --git a/data-otservbr-global/npc/andrew_lyze.lua b/data-otservbr-global/npc/andrew_lyze.lua
index 82b1f9a61ce..440b23ebfc0 100644
--- a/data-otservbr-global/npc/andrew_lyze.lua
+++ b/data-otservbr-global/npc/andrew_lyze.lua
@@ -64,6 +64,52 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end
+local brokenCompass = 25746
+local chargeableCompass = 29291
+local chargedCompass = 29294
+local goldenAxe = 29286
+local CompassValue = 10000
+
+local buildCompass = {
+ [1] = { id = 29346, qnt = 15 },
+ [2] = { id = 29345, qnt = 50 },
+ [3] = { id = 29347, qnt = 5 },
+ [4] = { id = 25746, qnt = 1 },
+}
+
+local chargeCompass = {
+ [1] = { id = 29287, qnt = 5 },
+ [2] = { id = 29288, qnt = 3 },
+ [3] = { id = 29289, qnt = 1 },
+ [4] = { id = 29348, qnt = 1 },
+ [5] = { id = 29291, qnt = 1 },
+}
+
+local function removeBait(player)
+ local player = Player(player)
+
+ if player and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait) == 1 then
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait, -1)
+ end
+end
+
+local function greetCallback(npc, creature)
+ local player = Player(creature)
+ local playerId = player:getId()
+
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) < 1 then
+ npcHandler:setMessage(MESSAGE_GREET, "Hello, I am the warden of this {monument}. The {sarcophagus} in front of you was established to prevent people from going {down} there. But I doubt that this step is sufficient.")
+ elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 1 then
+ npcHandler:setMessage(MESSAGE_GREET, "Well, let's see if your mission was successful. Just bring me all needed {materials}.")
+ elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 2 then
+ npcHandler:setMessage(MESSAGE_GREET, "If you dug up all three crystals of sufficient quantity and obtained the poison gland, the charging of your compass can start! For the very first time it will be charged by the violet crystal. Ready to {unleash} the power of the crystals?")
+ else
+ npcHandler:setMessage(MESSAGE_GREET, "Greetings.")
+ end
+
+ return true
+end
+
local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
local playerId = player:getId()
@@ -72,62 +118,154 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end
- if MsgContains(message, "monument") then
+ if MsgContains(message, "monument") and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) < 1 then
npcHandler:say({
"Well, a while ago powerful magic devices were used all around Tibia. These are chargeable compasses. There was but one problem: they offered the possibility to make people rich in a quite easy way. ...",
"Therefore, these instruments were very coveted. People tried to get their hands on them at all costs. And so it happened what everybody feared - bloody battles forged ahead. ...",
"To put an end to these cruel escalations, eventually all of the devices were collected and destroyed. The remains were buried {deep} in the earth.",
- }, npc, creature, 10)
- npcHandler:setTopic(playerId, 0)
- elseif MsgContains(message, "deep") then
+ }, npc, creature)
+ npcHandler:setTopic(playerId, 2)
+ elseif MsgContains(message, "deep") and npcHandler:getTopic(playerId) == 2 then
npcHandler:say("As far as I know it is a place of helish heat with bloodthirsty monsters of all kinds.", npc, creature)
- npcHandler:setTopic(playerId, 0)
- elseif MsgContains(message, "sarcophagus") then
+ npcHandler:setTopic(playerId, 1)
+ elseif MsgContains(message, "sarcophagus") and npcHandler:getTopic(playerId) == 1 then
npcHandler:say("This sarcophagus seals the entrance to the caves down there. Only here you can get all the {materials} you need for a working compass of this kind. So no entrance here - no further magic compasses in Tibia. In theory.", npc, creature)
+ npcHandler:setTopic(playerId, 4)
+ elseif MsgContains(message, "down") and npcHandler:getTopic(playerId) == 10 then
+ npcHandler:say("On first glance, this cave does not look very spectacular, but the things you find in there, are. You have to know that this is the only place where you can find the respective materials to build the compass.", npc, creature)
npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "materials") then
- if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.AndrewDoor) ~= 1 then
- player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.AndrewDoor, 1)
+ if npcHandler:getTopic(playerId) == 4 then
+ npcHandler:say({
+ "Only in the cave down there you will find the materials you need to repair the {compass}. Now you know why the entrance is sealed. There's the seal, but I have a deal for you: ...",
+ "I can repair the compass for you if you deliver what I need. Besides the broken compass you have to bring me the following materials: 50 blue glas plates, 15 green glas plates and 5 violet glas plates. ...",
+ "They all can be found in this closed cave in front of you. I should have destroyed this seal key but things have changed. The entrance is opened now, go down and do what has to be done.",
+ }, npc, creature)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, 1)
+ npcHandler:setTopic(playerId, 0)
+ elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 1 then
+ npcHandler:say("May I repair your compass if possible?", npc, creature)
+ npcHandler:setTopic(playerId, 11)
+ end
+ elseif MsgContains(message, "yes") then
+ if npcHandler:getTopic(playerId) == 11 then
+ local haveItens = false
+
+ for _, k in pairs(buildCompass) do
+ if player:getItemCount(k.id) >= k.qnt then
+ haveItens = true
+ else
+ haveItens = false
+ end
+ end
+
+ if haveItens then
+ for _, k in pairs(buildCompass) do
+ if player:getItemCount(k.id) >= k.qnt then
+ player:removeItem(k.id, k.qnt)
+ end
+ end
+
+ npcHandler:say({
+ "Alright, I put the glasses into the right pattern and can repair the compass. ...",
+ "There we are! The next step is the charging of the compass. For this you have to dig three different crystals down there: 5 blue, 3 green and one violet crystal. Are you ready to do that?",
+ }, npc, creature)
+ player:addItem(chargeableCompass, 1)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, 2)
+ npcHandler:setTopic(playerId, 12)
+ else
+ npcHandler:say("You don't have the needed itens yet.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
+ end
+ elseif npcHandler:getTopic(playerId) == 12 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.GotAxe) < 1 then
+ npcHandler:say({
+ "Nice! To do so, take this golden axe and mine the prominent crystals in the cave. Besides, I need a poison gland of quite rare spiders, they are called lucifuga araneae. ...",
+ "These are quite shy, but I have a {bait} for you to lure them. But take care not to face too many of them at once. And hurry, the effect won't last forever!",
+ }, npc, creature)
+ player:addItem(goldenAxe, 1)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.GotAxe, 1)
+ npcHandler:setTopic(playerId, 0)
+ elseif npcHandler:getTopic(playerId) == 51 then
+ if (player:getMoney() + player:getBankBalance()) >= CompassValue then
+ npcHandler:say("Here's your broken compass!", npc, creature)
+ player:removeMoneyBank(CompassValue)
+ player:addItem(brokenCompass, 1)
+ npcHandler:setTopic(playerId, 10)
+ else
+ npcHandler:say("You don't have enough money.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
+ end
+ end
+ elseif MsgContains(message, "unleash") then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 2 then
+ local haveItens = false
+
+ for _, k in pairs(chargeCompass) do
+ if player:getItemCount(k.id) >= k.qnt then
+ haveItens = true
+ else
+ haveItens = false
+ end
+ end
+
+ if haveItens then
+ for _, k in pairs(chargeCompass) do
+ if player:getItemCount(k.id) >= k.qnt then
+ player:removeItem(k.id, k.qnt)
+ end
+ end
+
+ npcHandler:say({
+ "I put these crystals onto the top of compass. As you can see, the compass is now pulsating in a warm, violet colour. ...",
+ "Now this compass is ready for usage. It can transfer the bound energy to other inanimate objects to open certain gates or chests.",
+ }, npc, creature)
+ player:addItem(chargedCompass, 1)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, 3)
+ npcHandler:setTopic(playerId, 0)
+ else
+ npcHandler:say("You don't have the needed itens yet.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
+ end
+ end
+ elseif MsgContains(message, "bait") then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait) < 1 then
+ npcHandler:say("Done. Worry, the effect won't last forever!", npc, creature)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait, 1)
+ addEvent(removeBait, 3 * 60 * 1000, player:getId())
+ npcHandler:setTopic(playerId, 0)
+ else
+ npcHandler:say("You're already with my bait!", npc, creature)
+ npcHandler:setTopic(playerId, 0)
+ end
+ else
+ npcHandler:say("You cannot do that yet.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
end
- npcHandler:say({
- "Only in the cave down there you will find the materials you need to repair the compass. Now you know why the entrance is sealed. There's the seal, but I have a deal for you: ...",
- "I can repair the compass for you if you deliver what I need. Besides the broken compass you have to bring me the following materials: 50 blue glas plates, 15 green glas plates and 5 violet glas plates. ...",
- "They all can be found in this closed cave in front of you. I should have destroyed this seal key but things have changed. The entrance is opened now, go down and do what has to be done.",
- }, npc, creature, 10)
- npcHandler:setTopic(playerId, 2)
- elseif MsgContains(message, "down") then
- npcHandler:say("On first glance, this cave does not look very spectacular, but the things you find in there, are. You have to know that this is the only place where you can find the respective materials to build the {compass}.", npc, creature)
- npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "compass") then
- npcHandler:say("It was decided to collect all of the compasses, destroy them and throw them in the fiery {depths} of Tibia. I still have some of them here. I {sell} them for a low price if you want.", npc, creature)
- npcHandler:setTopic(playerId, 0)
- elseif MsgContains(message, "depths") then
- npcHandler:say("As far as I know it is a place of helish heat with bloodthirsty monsters of all kinds.", npc, creature)
- npcHandler:setTopic(playerId, 0)
+ npcHandler:say("It was decided to collect all of the compasses, destroy them and throw them in the fiery depths of Tibia. I still have some of them here. I {sell} them for a low price if you want.", npc, creature)
+ npcHandler:setTopic(playerId, 50)
elseif MsgContains(message, "sell") then
- npcHandler:say("Would you like to buy a broken compass for 10.000 gold?", npc, creature)
- npcHandler:setTopic(playerId, 1)
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then
- local message = "You have bought a compass"
- if not checkWeightAndBackpackRoom(player, 80, message) then
- npcHandler:say("You not have room or capacity to take it.", npc, creature)
- return true
- end
- if player:getMoney() + player:getBankBalance() >= 5000 then
- player:removeMoneyBank(5000)
- player:addItem(10302, 1)
+ if npcHandler:getTopic(playerId) == 50 then
+ npcHandler:say("Would you like to buy a broken compass for 10.000 gold?", npc, creature)
+ npcHandler:setTopic(playerId, 51)
end
+ elseif MsgContains(message, "no") then
+ npcHandler:say({ "Don't waste my time." }, npc, creature)
npcHandler:setTopic(playerId, 0)
+ else
+ npcHandler:say("Sorry, I didn't understand.", npc, creature)
end
+
return true
end
-npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
-
-npcHandler:setMessage(MESSAGE_GREET, "Hello, I am the warden of this {monument}. The {sarcophagus} in front of you was established to prevent people from going {down} there. But I {doubt} that this step is sufficient.")
-
+npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye.")
+npcHandler:setCallback(CALLBACK_GREET, greetCallback)
+npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
+
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)
-- npcType registering the npcConfig table
diff --git a/data-otservbr-global/npc/emperor_kruzak.lua b/data-otservbr-global/npc/emperor_kruzak.lua
index daf0742f615..0b38aa1e956 100644
--- a/data-otservbr-global/npc/emperor_kruzak.lua
+++ b/data-otservbr-global/npc/emperor_kruzak.lua
@@ -78,7 +78,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 0)
-- Inicio do outfit
elseif npcHandler:getTopic(playerId) == 3 then -- ARMOR/OUTFIT
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 1 then
if player:getMoney() + player:getBankBalance() >= 500000000 then
local inbox = player:getStoreInbox()
local inboxItems = inbox:getItems()
@@ -92,7 +92,7 @@ local function creatureSayCallback(npc, creature, type, message)
player:addOutfit(1211)
player:addOutfit(1210)
player:getPosition():sendMagicEffect(171)
- player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 1)
+ player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 1)
else
npcHandler:say("Please make sure you have free slots in your store inbox.", npc, creature)
end
@@ -106,15 +106,15 @@ local function creatureSayCallback(npc, creature, type, message)
-- Fim do outfit
-- Inicio do helmet
elseif npcHandler:getTopic(playerId) == 4 then
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 1 then
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 2 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 2 then
if player:getMoney() + player:getBankBalance() >= 250000000 then
npcHandler:say("Take this helmet as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature)
player:removeMoneyBank(250000000)
player:addOutfitAddon(1210, 1)
player:addOutfitAddon(1211, 1)
player:getPosition():sendMagicEffect(171)
- player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 2)
+ player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 2)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say("You do not have enough money to donate that amount.", npc, creature)
@@ -132,15 +132,15 @@ local function creatureSayCallback(npc, creature, type, message)
-- Fim do helmet
-- Inicio da boots
elseif npcHandler:getTopic(playerId) == 5 then
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 2 then
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 3 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 3 then
if player:getMoney() + player:getBankBalance() >= 250000000 then
npcHandler:say("Take this boots as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature)
player:removeMoneyBank(250000000)
player:addOutfitAddon(1210, 2)
player:addOutfitAddon(1211, 2)
player:getPosition():sendMagicEffect(171)
- player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 3)
+ player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 3)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say("You do not have enough money to donate that amount.", npc, creature)
diff --git a/data-otservbr-global/npc/eshaya.lua b/data-otservbr-global/npc/eshaya.lua
index 20f39c50dd8..ea02aa4c120 100644
--- a/data-otservbr-global/npc/eshaya.lua
+++ b/data-otservbr-global/npc/eshaya.lua
@@ -58,86 +58,77 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end
--- First
-
-local firstMission = keywordHandler:addKeyword({ "mission" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "I'm willing to admit that I need help. And the help of someone who is not from {Issavi} at that. But the task could be dangerous and you would become embroiled in the politics and court intrigues of {Kilmaresh}. Will you help me anyhow?",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == -1
-end, function(player)
- player:setStorageValue(Storage.Kilmaresh.First.Title, 1)
-end)
-
-firstMission:addChildKeyword(
- { "yes" },
- StdModule.say,
- {
- npcHandler = npcHandler,
- text = {
- "You are a noble soul! So listen: for many decades, over a century actually, the city of {Rathleton} had an Ambassador here in {Issavi}. ...",
- "Kilmaresh and Oramond maintain important commercial relations, and for this reason Rathleton has an envoy here. In the past, the relations were good but now ...",
- "I hate to admit it but I heavily suspect that the current Ambassador is a traitor and consorts with the forbidden cult of Fafnar. I have several hints and Kallimae saw it in one of her visions ...",
- "But the vision of a Kilmareshian seer is no proof they will ever accept in Rathleton. And without proof we can't banish the Ambassador, this would cause major diplomatic fallout or even a war. I can't risk that. ...",
- "I need unequivocal evidence that the Ambassador conspires with the Fafnar cultists. Please go to his residence in the eastern part of the city and search for letters, journals ... anything that could prove him guilty.",
- },
- },
- nil,
- function(player)
- player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 1)
+local function creatureSayCallback(npc, creature, type, message)
+ local player = Player(creature)
+ local playerId = player:getId()
+
+ if not npcHandler:checkInteraction(npc, creature) then
+ return false
+ end
+
+ if MsgContains(message, "mission") then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) < 1 then
+ npcHandler:say("Very good. But now you need the Ring of Secret Thoughts back in order to extract the Ambassador's memories.", npc, creature)
+ npcHandler:setTopic(playerId, 2)
+ elseif player:getItemById(31263, true) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) < 2 then
+ npcHandler:say("You found the Ring of Secret Thoughts! Well done! Now give it to the Ambassador as a present. He's a peacock and will accept such a precious gift for sure. As soon as he wears it, his memories will be stored in the ring.", npc, creature)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering, 2)
+ npcHandler:setTopic(playerId, 0)
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Title) < 1 then
+ npcHandler:say("I'm willing to admit that I need help. And the help of someone who is not from {Issavi} at that. But the task could be dangerous and you would become embroiled in the politics and court intrigues of {Kilmaresh}. Will you help me anyhow?", npc, creature)
+ npcHandler:setTopic(playerId, 1)
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 5 then
+ npcHandler:say({
+ "It seems that he destroyed every visible evidence of his treason. That's very unfortunate and I see only one remaining possibility: You need to see the {Ambassador}'s memories. ...",
+ "But there is only one way to achieve this: You have to find a Ring of {Secret Thoughts}. Legend has it that a monstrous being called {Urmahlullu} has such a ring. If the myths are true you can find this creature in a subterranean tomb south of Issavi.",
+ }, npc, creature)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 6)
+ npcHandler:setTopic(playerId, 0)
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 4 then
+ npcHandler:say("This is the proof we need! Very well done! You have to report this to our {Empress}. She will grant you an audience now.", npc, creature)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 5)
+ npcHandler:setTopic(playerId, 0)
+ else
+ npcHandler:say("You haven't completed your mission yet. Keep searching!", npc, creature)
+ npcHandler:setTopic(playerId, 0)
+ end
+ elseif MsgContains(message, "yes") then
+ if npcHandler:getTopic(playerId) == 1 then
+ npcHandler:say({
+ "You are a noble soul! So listen: for many decades, over a century actually, the city of {Rathleton} had an Ambassador here in {Issavi}. ...",
+ "{Kilmaresh} and {Oramond} maintain important commercial relations, and for this reason Rathleton has an envoy here. In the past, the relations were good but now ..",
+ "I hate to admit it but I heavily suspect that the current {Ambassador} is a traitor and consorts with the forbidden cult of {Fafnar}. I have several hints and {Kallimae} saw it in one of her visions. ...",
+ "But the vision of a Kilmareshian seer is no proof they will ever accept in Rathleton. And without proof we can't banish the {Ambassador}, this would cause major diplomatic fallout or even a war. I can't risk that. ...",
+ "I need unequivocal evidence that the {Ambassador} conspires with the Fafnar cultists. Please go to his residence in the eastern part of the city and search for letters, journals ... anything that could prove him guilty.",
+ }, npc, creature)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Title, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 1)
+ npcHandler:setTopic(playerId, 0)
+ end
+ elseif MsgContains(message, "theft") then
+ if npcHandler:getTopic(playerId) == 3 then
+ npcHandler:say("I don't know whether you are experienced in such things. If not, you could ask somebody who is. But I'm not sure where in Issavi you should look to hire a thief.", npc, creature)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 1)
+ npcHandler:setTopic(playerId, 0)
+ end
+ elseif MsgContains(message, "ring of secret thoughts back") then
+ if npcHandler:getTopic(playerId) == 2 then
+ npcHandler:say("I guess claiming back a present would be a bit suspicious. You'll have to find another way. I resent thinking about theft but sometimes, desperate times call for desperate measures.", npc, creature)
+ npcHandler:setTopic(playerId, 3)
+ end
+ elseif MsgContains(message, "ring") then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 4 then
+ npcHandler:say("You got the ring back? Very well done! Now search for the memories that will prove the Ambassador's treason. I don't know much about ancient artefacts but you could ask the librarian in the palace. I'm sure he knows something helpful.", npc, creature)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 5)
+ npcHandler:setTopic(playerId, 0)
+ end
+ elseif MsgContains(message, "empress") then
+ npcHandler:say("Good luck on your audience with the Empress. May Kilmaresh prosper.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
end
-)
-
--- Second
-
-keywordHandler:addKeyword({ "mission" }, StdModule.say, {
- npcHandler = npcHandler,
- text = {
- "It seems that he destroyed every visible evidence of his treason. That's very unfortunate and I see only one remaining possibility: You need to see the {Ambassador}'s memories. ...",
- "But there is only one way to achieve this: You have to find a Ring of {Secret Thoughts}. Legend has it that a monstrous being called {Urmahlullu} has such a ring. If the myths are true you can find this creature in a subterranean tomb south of Issavi.",
- },
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 5
-end, function(player)
- player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 6)
- player:setStorageValue(Storage.Kilmaresh.Third.Recovering, 1)
-end)
-
-keywordHandler:addKeyword({ "mission" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "You haven't investigated all the evidence.",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Second.Investigating) >= 0 and player:getStorageValue(Storage.Kilmaresh.Second.Investigating) < 5
-end)
-
--- Third
-
-keywordHandler:addKeyword({ "ring" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "You found the Ring of {Secret Thoughts}! Well done! Now give it to the {Ambassador} as a present. He's a peacock and will accept such a precious gift for sure. As soon as he wears it, his memories will be stored in the ring.",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 1 and player:getItemById(31263, true)
-end, function(player)
- player:setStorageValue(Storage.Kilmaresh.Third.Recovering, 2)
-end)
-
-keywordHandler:addKeyword({ "ring" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "You don't have the ring I need.",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 1
-end)
-
--- Fifth
-
-keywordHandler:addKeyword({ "mission" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "This is the proof we need! Very well done! You have to report this to our {Empress}. She will grant you an audience now.",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Fifth.Memories) == 4
-end, function(player)
- player:setStorageValue(Storage.Kilmaresh.Fifth.Memories, 5)
-end)
+
+ return true
+end
npcHandler:setMessage(MESSAGE_GREET, "Suon's and Bastesh's blessing, dear guest!")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
@@ -145,6 +136,7 @@ npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
npcHandler:setCallback(CALLBACK_SET_INTERACTION, onAddFocus)
npcHandler:setCallback(CALLBACK_REMOVE_INTERACTION, onReleaseFocus)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
+
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)
-- npcType registering the npcConfig table
diff --git a/data-otservbr-global/npc/faloriel.lua b/data-otservbr-global/npc/faloriel.lua
index 4f4b0fb8ba8..11726b738e0 100644
--- a/data-otservbr-global/npc/faloriel.lua
+++ b/data-otservbr-global/npc/faloriel.lua
@@ -57,29 +57,35 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end
-local potionTalk = keywordHandler:addKeyword({ "ring" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "So, the Librarian sent you. Well, yes, I have a vial of the hallucinogen you need. I'll give it to you for 1000 gold. Do you agree?",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Fifth.Memories) == 1
-end)
-
-potionTalk:addChildKeyword({ "yes" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "Great. Here, take it.",
-}, function(player)
- return player:getMoney() + player:getBankBalance() >= 1000
-end, function(player)
- player:removeMoneyBank(1000)
- player:addItem(31350, 1) -- flask of hallucinogen
-end)
-
-potionTalk:addChildKeyword({ "yes" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "You do not have enough money.",
-}, function(player)
- return player:getMoney() + player:getBankBalance() < 1000
-end)
+local function creatureSayCallback(npc, creature, type, message)
+ local player = Player(creature)
+ local playerId = player:getId()
+
+ if not npcHandler:checkInteraction(npc, creature) then
+ return false
+ end
+
+ if MsgContains(message, "ring") then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 1 then
+ npcHandler:say("So, the Librarian sent you. Well, yes, I have a vial of the hallucinogen you need. I'll give it to you for 1000 gold. Do you agree?", npc, creature)
+ npcHandler:setTopic(playerId, 1)
+ else
+ npcHandler:say("I don't have anything to offer you regarding a ring.", npc, creature)
+ end
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then
+ if player:getMoney() + player:getBankBalance() >= 1000 then
+ npcHandler:say("Great. Here, take it.", npc, creature)
+ player:removeMoneyBank(1000)
+ player:addItem(31350, 1)
+ npcHandler:setTopic(playerId, 0)
+ else
+ npcHandler:say("You do not have enough money.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
+ end
+ end
+
+ return true
+end
npcHandler:setMessage(MESSAGE_GREET, "Greetings, dear guest and welcome to my {potion} shop.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
diff --git a/data-otservbr-global/npc/farhilorn_of_the_winter_court.lua b/data-otservbr-global/npc/farhilorn_of_the_winter_court.lua
new file mode 100644
index 00000000000..545e4f88406
--- /dev/null
+++ b/data-otservbr-global/npc/farhilorn_of_the_winter_court.lua
@@ -0,0 +1,91 @@
+local internalNpcName = "Farhilorn Of The Winter Court"
+local npcType = Game.createNpcType(internalNpcName)
+local npcConfig = {}
+
+npcConfig.name = internalNpcName
+npcConfig.description = internalNpcName
+
+npcConfig.health = 100
+npcConfig.maxHealth = npcConfig.health
+npcConfig.walkInterval = 2000
+npcConfig.walkRadius = 2
+
+npcConfig.outfit = {
+ lookType = 990,
+ lookHead = 0,
+ lookBody = 0,
+ lookLegs = 0,
+ lookFeet = 0,
+ lookAddons = 0,
+}
+
+npcConfig.flags = {
+ floorchange = false,
+}
+
+local keywordHandler = KeywordHandler:new()
+local npcHandler = NpcHandler:new(keywordHandler)
+
+npcType.onThink = function(npc, interval)
+ npcHandler:onThink(npc, interval)
+end
+
+npcType.onAppear = function(npc, creature)
+ npcHandler:onAppear(npc, creature)
+end
+
+npcType.onDisappear = function(npc, creature)
+ npcHandler:onDisappear(npc, creature)
+end
+
+npcType.onMove = function(npc, creature, fromPosition, toPosition)
+ npcHandler:onMove(npc, creature, fromPosition, toPosition)
+end
+
+npcType.onSay = function(npc, creature, type, message)
+ npcHandler:onSay(npc, creature, type, message)
+end
+
+npcType.onCloseChannel = function(npc, creature)
+ npcHandler:onCloseChannel(npc, creature)
+end
+
+local function creatureSayCallback(npc, creature, type, message)
+ local player = Player(creature)
+ local playerId = player:getId()
+
+ if not npcHandler:checkInteraction(npc, creature) then
+ return false
+ end
+
+ if MsgContains(message, "fight") then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.Permission) < 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheWinterCourt) == 1 then
+ npcHandler:say("We allow able champions of all races to fight for our cause against the challenges of the {arena}. So are you interested? I'm not interested in fancy'wordplay, so a simple {yes} or {no} will suffice!", npc, creature)
+ npcHandler:setTopic(playerId, 2)
+ end
+ elseif MsgContains(message, "yes") then
+ if npcHandler:getTopic(playerId) == 2 then
+ npcHandler:say("You are now able to enter the teleport.", npc, creature)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.Permission, 1)
+ npcHandler:setTopic(playerId, 0)
+ end
+ elseif MsgContains(message, "no") then
+ npcHandler:say("As you wish.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
+ elseif MsgContains(message, "arena") then
+ npcHandler:say("This place has always been a site where the champions of summer and winter have clashed in battle. Over the centuries this spectacle has drawn many creatures here to watch, participate and indulge in less savory activities.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
+ end
+
+ return true
+end
+
+npcHandler:setMessage(MESSAGE_GREET, "Hello fighter. I guess you are here to {fight} for our noble {cause}.")
+npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
+
+npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
+
+npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)
+
+-- npcType registering the npcConfig table
+npcType:register(npcConfig)
diff --git a/data-otservbr-global/npc/gail.lua b/data-otservbr-global/npc/gail.lua
index e0b6062908b..13cf1eff716 100644
--- a/data-otservbr-global/npc/gail.lua
+++ b/data-otservbr-global/npc/gail.lua
@@ -54,15 +54,15 @@ local function greetCallback(npc, creature)
local player = Player(creature)
local playerId = player:getId()
- if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
- elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then
+ elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 15)
- elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.First.Mission, 5)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5)
npcHandler:setTopic(playerId, 20)
end
return true
diff --git a/data-otservbr-global/npc/jack_springer.lua b/data-otservbr-global/npc/jack_springer.lua
index 73cd671a47d..19fe3441291 100644
--- a/data-otservbr-global/npc/jack_springer.lua
+++ b/data-otservbr-global/npc/jack_springer.lua
@@ -30,6 +30,23 @@ npcConfig.voices = {
{ text = "Hmm." },
}
+npcConfig.shop = {
+ { itemName = "vial of potent holy water", clientId = 31612, buy = 100 },
+}
+
+-- On buy npc shop message
+npcType.onBuyItem = function(npc, player, itemId, subType, amount, ignore, inBackpacks, totalCost)
+ npc:sellItem(player, itemId, amount, subType, 0, ignore, inBackpacks)
+end
+
+-- On sell npc shop message
+npcType.onSellItem = function(npc, player, itemId, subtype, amount, ignore, name, totalCost)
+ player:sendTextMessage(MESSAGE_TRADE, string.format("Sold %ix %s for %i gold.", amount, name, totalCost))
+end
+
+-- On check npc shop message (look item)
+npcType.onCheckItem = function(npc, player, clientId, subType) end
+
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
@@ -57,63 +74,211 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end
-local GraveDanger = Storage.Quest.U12_20.GraveDanger
local function greetCallback(npc, creature)
local player = Player(creature)
- if player:getStorageValue(GraveDanger.QuestLine) < 1 then
- npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME|! There is much we have to {discuss}.")
- elseif player:getStorageValue(GraveDanger.QuestLine) >= 1 then
- npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME|! Is there anything to {report}?")
+ if player then
+ if player:getLevel() >= 250 then
+ if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) < 1 then
+ npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME|! There is much we have to {discuss}.")
+ elseif player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) >= 3 then
+ npcHandler:setMessage(MESSAGE_GREET, "Hello, stranger! You look suspicious to me. I don't think we have anything to discuss.")
+ else
+ npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME|! Is there anything to {report}?")
+ end
+ else
+ npcHandler:setMessage(MESSAGE_GREET, "Hello, stranger! Sorry, but I never heard about you. I'm looking for more experienced help.")
+ end
end
+
return true
end
local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
+ local playerId = player:getId()
+
+ if not npcHandler:checkInteraction(npc, creature) then
+ return false
+ end
+
+ local storages = {
+ Storage.Quest.U12_20.GraveDanger.ScarlettKilled,
+ Storage.Quest.U12_20.GraveDanger.Graves.Progress,
+ Storage.Quest.U12_20.GraveDanger.Graves.Edron,
+ Storage.Quest.U12_20.GraveDanger.Graves.DarkCathedral,
+ Storage.Quest.U12_20.GraveDanger.Graves.Ghostlands,
+ Storage.Quest.U12_20.GraveDanger.Graves.Cormaya,
+ Storage.Quest.U12_20.GraveDanger.Graves.FemorHills,
+ Storage.Quest.U12_20.GraveDanger.Graves.Ankrahmun,
+ Storage.Quest.U12_20.GraveDanger.Graves.Kilmaresh,
+ Storage.Quest.U12_20.GraveDanger.Graves.Vengoth,
+ Storage.Quest.U12_20.GraveDanger.Graves.Darashia,
+ Storage.Quest.U12_20.GraveDanger.Graves.Thais,
+ Storage.Quest.U12_20.GraveDanger.Graves.Orclands,
+ Storage.Quest.U12_20.GraveDanger.Graves.IceIslands,
+ }
if MsgContains(message, "late") then
- if player:getStorageValue(GraveDanger.QuestLine) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) < 1 then
npcHandler:say({
"While you travel and fight the threat where it arises, we will put all our resources into researching the ultimate plans of the legion. Perhaps I can tell you more when you {report} back. ...",
"Don't forget that you'll need very potent holy water for your task. If you need some, just ask me for a {trade}.",
}, npc, creature)
- player:setStorageValue(GraveDanger.QuestLine, 1)
- player:setStorageValue(GraveDanger.Graves.Edron, 1)
- player:setStorageValue(GraveDanger.Graves.DarkCathedral, 1)
- player:setStorageValue(GraveDanger.Graves.Ghostlands, 1)
- player:setStorageValue(GraveDanger.Graves.Cormaya, 1)
- player:setStorageValue(GraveDanger.Graves.FemorHills, 1)
- player:setStorageValue(GraveDanger.Graves.Ankrahmun, 1)
- player:setStorageValue(GraveDanger.Graves.Kilmaresh, 1)
- player:setStorageValue(GraveDanger.Graves.Vengoth, 1)
- player:setStorageValue(GraveDanger.Graves.Darashia, 1)
- player:setStorageValue(GraveDanger.Graves.Thais, 1)
- player:setStorageValue(GraveDanger.Graves.Orclands, 1)
- player:setStorageValue(GraveDanger.Graves.IceIslands, 1)
+ for _, stor in pairs(storages) do
+ player:setStorageValue(stor, 0)
+ end
+ player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Stage, 0)
+ player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Questline, 1)
+ npcHandler:setTopic(playerId, 2)
+ else
+ npcHandler:say({
+ "While you travel and fight the threat where it arises, we will put all our resources into researching the ultimate plans of the legion. Perhaps I can tell you more when you {report} back. ...",
+ "Don't forget that you'll need very potent holy water for your task. If you need some, just ask me for a {trade}.",
+ }, npc, creature)
+ npcHandler:setTopic(playerId, 2)
end
+ elseif MsgContains(message, "report") and npcHandler:getTopic(playerId) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Stage) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress) >= 12 then
+ npcHandler:say("By now the cultists of the Shiron'Fal seem to have abandoned their search. But this is sadly no good news. It seems they gathered enough lich-knights to proceed with their {ultimate} plan.", npc, creature)
+ npcHandler:setTopic(playerId, 3)
+ else
+ npcHandler:say("Sadly, I have no news yet. But I can give you information about the {locations} of the graves that we learned about. If you need more holy water just ask me for a {trade}.", npc, creature)
+ end
+ else
+ if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Killed) >= 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) >= 3 and player:getStorageValue(Storage.Quest.U12_20.HandOfTheInquisitionOutfits.Addon2) < 1 and player:removeItem(31737, 1) then
+ npcHandler:say("Here is your second addon for your efforts!", npc, creature)
+ player:addOutfit(1243, 2)
+ player:addOutfit(1244, 2)
+ player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Stage, 2)
+ player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Questline, 3)
+ player:setStorageValue(Storage.Quest.U12_20.HandOfTheInquisitionOutfits.Addon2, 1)
+ elseif player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) >= 3 and player:getStorageValue(Storage.Quest.U12_20.HandOfTheInquisitionOutfits.Addon1) < 1 and player:removeItem(31738, 1) then
+ npcHandler:say("Here is your first addon for your efforts!", npc, creature)
+ player:addOutfit(1243, 1)
+ player:addOutfit(1244, 1)
+ player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Stage, 2)
+ player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Questline, 3)
+ player:setStorageValue(Storage.Quest.U12_20.HandOfTheInquisitionOutfits.Addon1, 1)
+ elseif player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) < 3 and player:getStorageValue(Storage.Quest.U12_20.HandOfTheInquisitionOutfits.Outfits) < 1 then
+ npcHandler:say("Incredible! You averted a crisis that would have utterly crippled our defences aganist any other threat that is arising. Let me grant you the honor to be one of the hands of the inquisition alongside with the according outfit as a reward.", npc, creature)
+ player:addOutfit(1243, 0)
+ player:addOutfit(1244, 0)
+ player:addAchievement("Inquisition's Hand")
+ player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Stage, 2)
+ player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Questline, 3)
+ player:setStorageValue(Storage.Quest.U12_20.HandOfTheInquisitionOutfits.Outfits, 1)
+ else
+ npcHandler:say("Indeed you averted us a great danger! We will ever be greatful to you hand of the inquisition!", npc, creature)
+ end
+ else
+ npcHandler:say("You need to travel to the isle of the kings and end this threat before they raise king Zelos!", npc, creature)
+ end
+ end
+ elseif MsgContains(message, "ultimate") and npcHandler:getTopic(playerId) == 3 then
+ npcHandler:say({
+ "It became obvious that their goal is to raise an ancient and fallen king, to lead their lich-knights and raise even more of them. ...",
+ " With each lich-knight being able to raise and control lesser undead, this would lead to a chain-reaction. If they succeed, we might face an undead {threat} not seen since the corpse wars.",
+ }, npc, creature)
+ npcHandler:setTopic(playerId, 4)
+ elseif MsgContains(message, "threat") and npcHandler:getTopic(playerId) == 4 then
+ npcHandler:say({
+ "You have to travel to the isle of the kings. There, hidden beneath the isle of the kings is the shamefully hidden grave of king Zelos. It is him, they are trying to raise. ...",
+ "With some luck you will arrive before the ritual's completion. But be warned. At least four risen lich-knights will be present, to raise 'their king'. ...",
+ "Hopefully the ritual will bind some of their powers but they will still be formidable foes. You will have to act quick because with each moment you take to defeat the knights ...",
+ "The ritual will progress and the king will become stronger up to a point where you might be unable to defeat him. Due to the efforts and sacrifices of the death cultists, the king will be active at some capacity and you will have to confront him. ...",
+ "Remember, the further the ritual progresses when you face him, he will become considerably more powerful. So time is of the essence. ...",
+ "All I can do right now is to wish you good luck and may the gods bless you.",
+ }, npc, creature)
+ player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Stage, 1)
+ player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Questline, 2)
end
+
return true
end
---Basic
npcHandler:setMessage(MESSAGE_SENDTRADE, "Of course, my friend.")
+
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
-npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)
-npcConfig.shop = {
- { itemName = "vial of potent holy water", clientId = 31612, buy = 100 },
-}
--- On buy npc shop message
-npcType.onBuyItem = function(npc, player, itemId, subType, amount, ignore, inBackpacks, totalCost)
- npc:sellItem(player, itemId, amount, subType, 0, ignore, inBackpacks)
-end
--- On sell npc shop message
-npcType.onSellItem = function(npc, player, itemId, subtype, amount, ignore, name, totalCost)
- player:sendTextMessage(MESSAGE_TRADE, string.format("Sold %ix %s for %i gold.", amount, name, totalCost))
-end
--- On check npc shop message (look item)
-npcType.onCheckItem = function(npc, player, clientId, subType) end
+keywordHandler:addKeyword({ "discuss" }, StdModule.say, { npcHandler = npcHandler, text = "I need your help in a matter of utmost {urgency}." })
+keywordHandler:addKeyword({ "urgency" }, StdModule.say, { npcHandler = npcHandler, text = "The situation is complicated and it's even hard to say where to {start} best, just to describe it to you." })
+keywordHandler:addKeyword({ "start" }, StdModule.say, { npcHandler = npcHandler, text = "You see, several incidents in history can be traced back to a single {source}." })
+keywordHandler:addKeyword({ "source" }, StdModule.say, { npcHandler = npcHandler, text = "Things get murkier the further you go down in history, but that's not even necessary. Even today we can discern a certain pattern in recent {events}." })
+keywordHandler:addKeyword({ "events" }, StdModule.say, { npcHandler = npcHandler, text = {
+ "Well, in Rathleton there was an individual at work, looking for some ancient artefact of power. ...",
+ "To cover its escape the creature left another creature, known as the ravager to cover his tracks. But there is {more}.",
+} })
+keywordHandler:addKeyword({ "more" }, StdModule.say, { npcHandler = npcHandler, text = {
+ "Only recently someone was trying to manipulate the elven dream courts into releasing a monstrosity of nightmares, probably planning to control or recruit this creature. ....",
+ "But those incidents were just some of {many}.",
+} })
+keywordHandler:addKeyword({ "many" }, StdModule.say, { npcHandler = npcHandler, text = "The recent rise of lycanthropy, the robbery of certain forbidden arcane texts and the vanishing of at least three dangerous individuals, targeted by the inquisition are just the tip of the {iceberg}." })
+keywordHandler:addKeyword(
+ { "iceberg" },
+ StdModule.say,
+ { npcHandler = npcHandler, text = {
+ "There is a scheming going on behind the scenes. Powerful good people were corrupted. Evil-doers got backup and resources from a hidden ally. ...",
+ "Powerful malignant creatures, gathering their kind under their banner and so much more. These things are not happening by chance. There is a pattern, a guiding {hand}.",
+ } }
+)
+keywordHandler:addKeyword({ "hand" }, StdModule.say, { npcHandler = npcHandler, text = "This outside force is moving behind the scenes since ages. Our research suggests that this force probably even {predates} the rise of humanity." })
+keywordHandler:addKeyword({ "predates" }, StdModule.say, { npcHandler = npcHandler, text = "Well, we are sure that the puppeteer behind all these events is an organisation. So old that even its name, the Shiron'Fal, has lost its meaning, because the {language} it originates from is long dead." })
+keywordHandler:addKeyword(
+ { "language" },
+ StdModule.say,
+ { npcHandler = npcHandler, text = {
+ "It has a rather complex meaning and as far as we can tell it translates to 'army of those who are many, dedicated to the ultimate time of mayhem and despair'. ...",
+ "Other, more handy names are army of the last battlefield, army of the last days, legion of mayhem, dread legion or simply the {legion}.",
+ } }
+)
+keywordHandler:addKeyword(
+ { "legion" },
+ StdModule.say,
+ { npcHandler = npcHandler, text = {
+ "We know little for sure. You can look into our books to see some of our sources. But most are vague and some even contradictory. ...",
+ "To summarise what we know, let me tell you this: The Shiron'Fal is an extremely old organisation. It seeks to accumulate power for some unknown but certainly sinister {goal}.",
+ } }
+)
+keywordHandler:addKeyword({ "goal" }, StdModule.say, {
+ npcHandler = npcHandler,
+ text = {
+ "For this purpose, the members gather knowledge, artefacts and powerful individuals. The members are formidable at certain fields of expertise. They are cunning and powerful and act with no regard for others, with no remorse or mercy. ...",
+ "As they are doing this since ages, they must have acquired tremendous powers and knowledge. Their members often operate alone but are usually well funded with the necessary resources. ...",
+ "Whatever their endgame might be, each of their operations pose a grave danger to the whole world and have to be {stopped}.",
+ },
+})
+keywordHandler:addKeyword({ "stopped" }, StdModule.say, { npcHandler = npcHandler, text = "Here is where you come into play. We could identify the most recent plot of the Shiron'Fal and already had some {clashes}." })
+keywordHandler:addKeyword({ "clashes" }, StdModule.say, { npcHandler = npcHandler, text = "In our efforts to hinder their plot, we achieved mixed results at best. But now things are escalating fast and we have to {hurry}." })
+keywordHandler:addKeyword({ "hurry" }, StdModule.say, { npcHandler = npcHandler, text = "Our resources are already stretched thin, so we need your help with the most recent {problem}." })
+keywordHandler:addKeyword({ "problem" }, StdModule.say, { npcHandler = npcHandler, text = "The legion tries to use a new form of twisted rituals to raise the bodies of well-known {knights}." })
+keywordHandler:addKeyword({ "knights" }, StdModule.say, { npcHandler = npcHandler, text = {
+ "The knights they aim at were tainted in life by their actions or happenstance. ...",
+ "This leaves their bodies vulnerable to their special breed of necromancy that would raise them as powerful {lich}-knights.",
+} })
+keywordHandler:addKeyword({ "lich" }, StdModule.say, { npcHandler = npcHandler, text = "These powerful undead were a terrible threat on their own but it seems even they are just part of some larger {scheme} that we cannot make out yet." })
+keywordHandler:addKeyword({ "scheme" }, StdModule.say, { npcHandler = npcHandler, text = "We are still working feverishly to uncover their goals but for now more imminent {threats} are at hand." })
+keywordHandler:addKeyword({ "threats" }, StdModule.say, { npcHandler = npcHandler, text = "Death cultists of the Shiron'Fal are trying to locate the bodies of fallen knights and raise them in blasphemous {rituals}." })
+keywordHandler:addKeyword({ "rituals" }, StdModule.say, { npcHandler = npcHandler, text = "The churches of the gods worked hand in hand to supply us with the means to {purge} the graves of those knights." })
+keywordHandler:addKeyword({ "purge" }, StdModule.say, {
+ npcHandler = npcHandler,
+ text = {
+ "Reaching the graves will not be without danger and if you encounter the death cultists you will have to fight them. Even worse, they might have even succeeded in some cases. ...",
+ "As a newly risen lich-knight is not able to leave the site of its resurrection for some time, you might have to fight some of them. ...",
+ "Let us pray that you never come too {late} or else some of the fiends might be able to leave their crypts.",
+ },
+})
+keywordHandler:addKeyword({ "locations" }, StdModule.say, {
+ npcHandler = npcHandler,
+ text = {
+ "We have located twelve graves that have to be secured: In the old northern Edron graveyard, in the dark cathedral of the plains of havoc, in the ghostlands, on Cormaya, Somewhere in the Femor Hills, on Vengoth, ...",
+ "in the graveyard of Darashia, in the old temple north of Thais, at the entrance to the orcland, one is on the southern ice islands, in a mountain on Kilmaresh, one on an island north-east of Ankrahmun.",
+ },
+})
+
+npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)
npcType:register(npcConfig)
diff --git a/data-otservbr-global/npc/kallimae.lua b/data-otservbr-global/npc/kallimae.lua
index 61be4cb34a9..7d41e955886 100644
--- a/data-otservbr-global/npc/kallimae.lua
+++ b/data-otservbr-global/npc/kallimae.lua
@@ -54,15 +54,15 @@ local function greetCallback(npc, creature)
local player = Player(creature)
local playerId = player:getId()
- if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
- elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then
+ elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 15)
- elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.First.Mission, 5)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5)
npcHandler:setTopic(playerId, 20)
end
return true
@@ -76,55 +76,62 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) == 11 then
- if player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) == 11 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) == 11 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) == 11 then
npcHandler:say({ "Some residents are in need of ingredients to finish a ritual. You can help?" }, npc, creature) -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
npcHandler:setTopic(playerId, 1)
end
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) == 11 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) == 11 then
npcHandler:say({ "Search for the NPCs Yonan, Narsai, Shimun and Tefrit." }, npc, creature) -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.Set.Ritual, 1)
- player:setStorageValue(Storage.Kilmaresh.Set.Yonan, 1)
- player:setStorageValue(Storage.Kilmaresh.Set.Narsai, 1)
- player:setStorageValue(Storage.Kilmaresh.Set.Shimun, 1)
- player:setStorageValue(Storage.Kilmaresh.Set.Tefrit, 1)
- player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, 12)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Yonan, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Narsai, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Shimun, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Tefrit, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, 12)
npcHandler:setTopic(playerId, 2)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say({ "Sorry." }, npc, creature) -- It needs to be revised, it's not the same as the global
end
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 3 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 3 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then
npcHandler:say({ "Did you help some residents with ingredients?" }, npc, creature) -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 3)
npcHandler:setTopic(playerId, 3)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 3 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 3 then
+ elseif
+ MsgContains(message, "yes")
+ and npcHandler:getTopic(playerId) == 3
+ and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3
+ and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3
+ and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3
+ and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3
+ then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then
npcHandler:say({ "Thanks. I need you to go to 4 places indicated by Goddess Bastesh." }, npc, creature) -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.Nine.Owl, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl, 1)
npcHandler:setTopic(playerId, 4)
npcHandler:setTopic(playerId, 4)
else
npcHandler:say({ "Sorry." }, npc, creature) -- It needs to be revised, it's not the same as the global
end
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eleven.Basin) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Eleven.Basin) == 1 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin) == 1 then
npcHandler:say({ "Did you check all the points and bring the Symbol of Sun and Sea?" }, npc, creature) -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 5)
npcHandler:setTopic(playerId, 5)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Kilmaresh.Eleven.Basin) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Eleven.Basin) == 1 and player:getItemById(31431, 1) then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin) == 1 and player:getItemById(31431, 1) then
player:addItem(31572, 1)
npcHandler:say({ "Thanks. Here is your reward." }, npc, creature) -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 1)
- player:setStorageValue(Storage.Kilmaresh.Eleven.Basin, 2)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin, 2)
npcHandler:setTopic(playerId, 6)
npcHandler:setTopic(playerId, 6)
else
diff --git a/data-otservbr-global/npc/king_tibianus.lua b/data-otservbr-global/npc/king_tibianus.lua
index d9968357fa1..cf966761cc1 100644
--- a/data-otservbr-global/npc/king_tibianus.lua
+++ b/data-otservbr-global/npc/king_tibianus.lua
@@ -83,7 +83,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 0)
-- Inicio do outfit
elseif npcHandler:getTopic(playerId) == 3 then -- ARMOR/OUTFIT
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 1 then
if player:getMoney() + player:getBankBalance() >= 500000000 then
local inbox = player:getStoreInbox()
local inboxItems = inbox:getItems()
@@ -97,7 +97,7 @@ local function creatureSayCallback(npc, creature, type, message)
player:addOutfit(1211)
player:addOutfit(1210)
player:getPosition():sendMagicEffect(171)
- player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 1)
+ player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 1)
else
npcHandler:say("Please make sure you have free slots in your store inbox.", npc, creature)
end
@@ -111,15 +111,15 @@ local function creatureSayCallback(npc, creature, type, message)
-- Fim do outfit
-- Inicio do helmet
elseif npcHandler:getTopic(playerId) == 4 then
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 1 then
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 2 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 2 then
if player:getMoney() + player:getBankBalance() >= 250000000 then
npcHandler:say("Take this helmet as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature)
player:removeMoneyBank(250000000)
player:addOutfitAddon(1210, 2)
player:addOutfitAddon(1211, 2)
player:getPosition():sendMagicEffect(171)
- player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 2)
+ player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 2)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say("You do not have enough money to donate that amount.", npc, creature)
@@ -137,15 +137,15 @@ local function creatureSayCallback(npc, creature, type, message)
-- Fim do helmet
-- Inicio da boots
elseif npcHandler:getTopic(playerId) == 5 then
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 2 then
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 3 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 3 then
if player:getMoney() + player:getBankBalance() >= 250000000 then
npcHandler:say("Take this boots as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature)
player:removeMoneyBank(250000000)
player:addOutfitAddon(1210, 1)
player:addOutfitAddon(1211, 1)
player:getPosition():sendMagicEffect(171)
- player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 3)
+ player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 3)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say("You do not have enough money to donate that amount.", npc, creature)
diff --git a/data-otservbr-global/npc/moe.lua b/data-otservbr-global/npc/moe.lua
index c96c03da8af..62932f3ffd6 100644
--- a/data-otservbr-global/npc/moe.lua
+++ b/data-otservbr-global/npc/moe.lua
@@ -58,57 +58,59 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end
-keywordHandler:addKeyword({ "help" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx {feathers} I will steal this ring for you.",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 1
-end, function(player)
- player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 2)
-end)
-
-keywordHandler:addKeyword({ "feathers" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "Thank you! They look so pretty, I'm very pleased. Agreed, now I will steal the ring from the Ambassador of Rathleton. Just be patient, I have to wait for a good moment.",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 2 and player:getItemById(31437, 10)
-end, function(player)
- player:removeItem(31437, 10)
- player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 3)
- player:setStorageValue(Storage.Kilmaresh.Fourth.MoeTimer, os.time() + 60 * 60) -- one hour
-end)
-
-keywordHandler:addKeyword({ "feathers" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "If you bring me ten sphinx {feathers} I will steal this ring for you.",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 2 and not player:getItemById(31437, 10)
-end)
-
-keywordHandler:addKeyword({ "ring" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "You're arriving at the right time. I have the ring you asked for. It was not too difficult. I just had to wait until the Ambassador left his residence and then I climbed in through the window. Here it is.",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 3 and player:getStorageValue(Storage.Kilmaresh.Fourth.MoeTimer) - os.time() <= 0
-end, function(player)
- player:addItem(31306, 1)
- player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 4)
-end)
-
-keywordHandler:addKeyword({ "ring" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "I will steal it, promised. I'm just waiting for a good moment.",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 3 and player:getStorageValue(Storage.Kilmaresh.Fourth.MoeTimer) - os.time() > 0
-end)
-keywordHandler:addKeyword({ "lyre" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "I'm upset to accuse myself, the lyre is hidden in a tomb west of Kilmaresh.",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 1
-end, function(player)
- player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 2)
-end)
+local function creatureSayCallback(npc, creature, type, message)
+ local player = Player(creature)
+ local playerId = player:getId()
+
+ if not npcHandler:checkInteraction(npc, creature) then
+ return false
+ end
+
+ if MsgContains(message, "help") then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 1 then
+ npcHandler:say("I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx feathers I will steal this ring for you.", npc, creature)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 2)
+ end
+ elseif MsgContains(message, "feathers") then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 2 then
+ if player:getItemById(31437, 10) then
+ npcHandler:say("Thank you! They look so pretty, I'm very pleased. Agreed, now I will steal the ring from the Ambassador of Rathleton. Just be patient, I have to wait for a good moment.", npc, creature)
+ player:removeItem(31437, 10)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 3)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.MoeTimer, os.time() + 60 * 60)
+ else
+ npcHandler:say("If you bring me ten sphinx feathers, I will steal this ring for you.", npc, creature)
+ end
+ else
+ npcHandler:say("You already delivered the feathers. Be patient while I steal the ring.", npc, creature)
+ end
+ elseif MsgContains(message, "ring") then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 3 then
+ local timeLeft = player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.MoeTimer) - os.time()
+ if timeLeft <= 0 then
+ npcHandler:say("You're arriving at the right time. I have the ring you asked for. It was not too difficult. I just had to wait until the Ambassador left his residence and then I climbed in through the window. Here it is.", npc, creature)
+ player:addItem(31306, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 4)
+ else
+ npcHandler:say("I will steal it, promised. I'm just waiting for a good moment.", npc, creature)
+ end
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 1 then
+ npcHandler:say("I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx feathers I will steal this ring for you.", npc, creature)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 2)
+ else
+ npcHandler:say("You don't need this ring anymore.", npc, creature)
+ end
+ elseif MsgContains(message, "lyre") then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 1 then
+ npcHandler:say("I'm upset to accuse myself, the lyre is hidden in a tomb west of Kilmaresh.", npc, creature)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 2)
+ else
+ npcHandler:say("You already know about the lyre's location.", npc, creature)
+ end
+ end
+
+ return true
+end
npcHandler:setMessage(MESSAGE_GREET, "Greetings, traveller. It seems, you're a {guest} here, just like me.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
diff --git a/data-otservbr-global/npc/myzzi.lua b/data-otservbr-global/npc/myzzi.lua
new file mode 100644
index 00000000000..6ed01df64e5
--- /dev/null
+++ b/data-otservbr-global/npc/myzzi.lua
@@ -0,0 +1,109 @@
+local internalNpcName = "Myzzi"
+local npcType = Game.createNpcType(internalNpcName)
+local npcConfig = {}
+
+npcConfig.name = internalNpcName
+npcConfig.description = internalNpcName
+
+npcConfig.health = 100
+npcConfig.maxHealth = npcConfig.health
+npcConfig.walkInterval = 2000
+npcConfig.walkRadius = 2
+
+npcConfig.outfit = {
+ lookType = 982,
+ lookHead = 0,
+ lookBody = 0,
+ lookLegs = 0,
+ lookFeet = 0,
+ lookAddons = 0,
+}
+
+npcConfig.flags = {
+ floorchange = false,
+}
+
+npcConfig.voices = {
+ interval = 15000,
+ chance = 50,
+ { text = "You need to find some heroes. Find, find, find!!" },
+}
+
+local keywordHandler = KeywordHandler:new()
+local npcHandler = NpcHandler:new(keywordHandler)
+
+npcType.onThink = function(npc, interval)
+ npcHandler:onThink(npc, interval)
+end
+
+npcType.onAppear = function(npc, creature)
+ npcHandler:onAppear(npc, creature)
+end
+
+npcType.onDisappear = function(npc, creature)
+ npcHandler:onDisappear(npc, creature)
+end
+
+npcType.onMove = function(npc, creature, fromPosition, toPosition)
+ npcHandler:onMove(npc, creature, fromPosition, toPosition)
+end
+
+npcType.onSay = function(npc, creature, type, message)
+ npcHandler:onSay(npc, creature, type, message)
+end
+
+npcType.onCloseChannel = function(npc, creature)
+ npcHandler:onCloseChannel(npc, creature)
+end
+
+local function creatureSayCallback(npc, creature, type, message)
+ local player = Player(creature)
+ local playerId = player:getId()
+
+ if not npcHandler:checkInteraction(npc, creature) then
+ return false
+ end
+
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline) < 1 then
+ if MsgContains(message, "good") then
+ npcHandler:say("I'm just a mere messenger and I'm here to find brave adventurers that might {help} my friends in this time of need.", npc, creature)
+ npcHandler:setTopic(playerId, 2)
+ elseif MsgContains(message, "help") and npcHandler:getTopic(playerId) == 2 then
+ npcHandler:say("Lady Alivar of the Summer Court and Lord Cadion of the Winter Court are in need of brave adventurers to avert a great {threat} for the whole world.", npc, creature)
+ npcHandler:setTopic(playerId, 3)
+ elseif MsgContains(message, "threat") and npcHandler:getTopic(playerId) == 3 then
+ npcHandler:say({
+ "I know only little and I forget so much. So many things going around my mind! ...",
+ "However, I can grant you access to the {Courts} of Summer and Winter if you promise to help! There you can meet with Undal or Vanys, the servants of Lord Cadion and Lady Alivar. They will be able to tell you more about the issue.",
+ }, npc, creature)
+ npcHandler:setTopic(playerId, 4)
+ elseif MsgContains(message, "courts") and npcHandler:getTopic(playerId) == 4 then
+ npcHandler:say({ "There are {entrances} to the hidden Courts of Summer and Winter in secluded places. You can find the portal to the Winter Court high in the mountains of Tyrsung and the portal to the Summer Court in the meadows of Feyrist. ...", "With my magic you will be able to enter the Courts. Find Undal or Vanys and talk to them." }, npc, creature)
+ npcHandler:setTopic(playerId, 5)
+ elseif MsgContains(message, "entrances") and npcHandler:getTopic(playerId) == 5 then
+ npcHandler:say("So, are you willing to help in this time of need?", npc, creature)
+ npcHandler:setTopic(playerId, 6)
+ elseif npcHandler:getTopic(playerId) == 6 then
+ if MsgContains(message, "yes") then
+ npcHandler:say({ "You are a true hero! Here, take my enchantment and you will be able to pass the portals. Now hurry, my friends are waiting." }, npc, creature)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline, 1)
+ npcHandler:setTopic(playerId, 0)
+ else
+ npcHandler:say("What?!", npc, creature)
+ end
+ end
+ end
+
+ return true
+end
+
+npcHandler:setMessage(MESSAGE_GREET, "Hello adventurer. It is {good} to see you.")
+npcHandler:setMessage(MESSAGE_FAREWELL, "Well, bye then.")
+npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
+
+npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
+
+npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)
+
+-- npcType registering the npcConfig table
+npcType:register(npcConfig)
diff --git a/data-otservbr-global/npc/narsai.lua b/data-otservbr-global/npc/narsai.lua
index 42e375956f3..aed1a3e3576 100644
--- a/data-otservbr-global/npc/narsai.lua
+++ b/data-otservbr-global/npc/narsai.lua
@@ -54,15 +54,15 @@ local function greetCallback(npc, creature)
local player = Player(creature)
local playerId = player:getId()
- if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
- elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then
+ elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 15)
- elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.First.Mission, 5)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5)
npcHandler:setTopic(playerId, 20)
end
return true
@@ -76,36 +76,36 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 1 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 1 then
npcHandler:say({ "Could you help me do a ritual?" }, npc, creature) -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
npcHandler:setTopic(playerId, 1)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 1 then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 1 then
player:addItem(31714, 1)
npcHandler:say({ "Here is the list of ingredients that are missing to complete the ritual. " }, npc, creature) -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.Eighth.Narsai, 2)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai, 2)
npcHandler:setTopic(playerId, 2)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say({ "Sorry." }, npc, creature) -- It needs to be revised, it's not the same as the global
end
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then
npcHandler:say({ "Did you bring all the materials I informed you about?" }, npc, creature) -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 3)
npcHandler:setTopic(playerId, 3)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 and player:getItemById(31335, 10) and player:getItemById(10279, 2) and player:getItemById(31332, 5) then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 and player:getItemById(31335, 10) and player:getItemById(10279, 2) and player:getItemById(31332, 5) then
player:removeItem(31335, 10)
player:removeItem(10279, 2)
player:removeItem(31332, 5)
npcHandler:say({ "Thank you this stage of the ritual is complete." }, npc, creature) -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.Eighth.Narsai, 3)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai, 3)
npcHandler:setTopic(playerId, 4)
npcHandler:setTopic(playerId, 4)
else
diff --git a/data-otservbr-global/npc/queen_eloise.lua b/data-otservbr-global/npc/queen_eloise.lua
index e4fd566e422..b4ae195bb94 100644
--- a/data-otservbr-global/npc/queen_eloise.lua
+++ b/data-otservbr-global/npc/queen_eloise.lua
@@ -73,7 +73,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 0)
-- Inicio do outfit
elseif npcHandler:getTopic(playerId) == 3 then -- ARMOR/OUTFIT
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 1 then
if player:getMoney() + player:getBankBalance() >= 500000000 then
local inbox = player:getStoreInbox()
local inboxItems = inbox:getItems()
@@ -87,7 +87,7 @@ local function creatureSayCallback(npc, creature, type, message)
player:addOutfit(1211)
player:addOutfit(1210)
player:getPosition():sendMagicEffect(171)
- player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 1)
+ player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 1)
else
npcHandler:say("Please make sure you have free slots in your store inbox.", npc, creature)
end
@@ -101,15 +101,15 @@ local function creatureSayCallback(npc, creature, type, message)
-- Fim do outfit
-- Inicio do helmet
elseif npcHandler:getTopic(playerId) == 4 then
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 1 then
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 2 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 2 then
if player:getMoney() + player:getBankBalance() >= 250000000 then
npcHandler:say("Take this helmet as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature)
player:removeMoneyBank(250000000)
player:addOutfitAddon(1210, 1)
player:addOutfitAddon(1211, 1)
player:getPosition():sendMagicEffect(171)
- player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 2)
+ player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 2)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say("You do not have enough money to donate that amount.", npc, creature)
@@ -127,15 +127,15 @@ local function creatureSayCallback(npc, creature, type, message)
-- Fim do helmet
-- Inicio da boots
elseif npcHandler:getTopic(playerId) == 5 then
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 2 then
- if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 3 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 3 then
if player:getMoney() + player:getBankBalance() >= 250000000 then
npcHandler:say("Take this boots as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature)
player:removeMoneyBank(250000000)
player:addOutfitAddon(1210, 2)
player:addOutfitAddon(1211, 2)
player:getPosition():sendMagicEffect(171)
- player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 3)
+ player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 3)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say("You do not have enough money to donate that amount.", npc, creature)
diff --git a/data-otservbr-global/npc/saideh.lua b/data-otservbr-global/npc/saideh.lua
index 7b28c754a59..855a0616ff9 100644
--- a/data-otservbr-global/npc/saideh.lua
+++ b/data-otservbr-global/npc/saideh.lua
@@ -49,7 +49,7 @@ local function greetCallback(npc, creature)
local player = Player(creature)
local playerId = player:getId()
- if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then
npcHandler:setMessage(MESSAGE_GREET, "Hello, my name is Saideh. Once this was the entry to the crypt of our heroes. One of the graves belongs to our beloved hero Dayyan. Nowadays it is not a good idea to visit this place.")
npcHandler:setTopic(playerId, 1)
end
@@ -64,16 +64,16 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 1 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 1 then
npcHandler:say({ " I would like you to visit the grave of our beloved hero Dayyan. His remains have to be reburied, because a horde of ogres controls this place. Do you want to start this holy mission?" }, npc, creature)
npcHandler:setTopic(playerId, 1)
npcHandler:setTopic(playerId, 1)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 1 then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 1 then
npcHandler:say({ "Well, I appreciate that. Good luck!" }, npc, creature)
- player:setStorageValue(Storage.Kilmaresh.Fourteen.Remains, 2)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains, 2)
npcHandler:setTopic(playerId, 2)
npcHandler:setTopic(playerId, 2)
else
diff --git a/data-otservbr-global/npc/shimun.lua b/data-otservbr-global/npc/shimun.lua
index c3607feccd8..3d0281d98a4 100644
--- a/data-otservbr-global/npc/shimun.lua
+++ b/data-otservbr-global/npc/shimun.lua
@@ -54,15 +54,15 @@ local function greetCallback(npc, creature)
local player = Player(creature)
local playerId = player:getId()
- if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
- elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then
+ elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 15)
- elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.First.Mission, 5)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5)
npcHandler:setTopic(playerId, 20)
end
return true
@@ -76,36 +76,36 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 1 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 1 then
npcHandler:say({ "Could you help me do a ritual?" }, npc, creature) -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
npcHandler:setTopic(playerId, 1)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 1 then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 1 then
player:addItem(31715, 1)
npcHandler:say({ "Here is the list with the missing ingredients to complete the ritual." }, npc, creature) -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.Eighth.Shimun, 2)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun, 2)
npcHandler:setTopic(playerId, 2)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say({ "Sorry." }, npc, creature) -- It needs to be revised, it's not the same as the global
end
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 2 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 2 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 2 then
npcHandler:say({ "Did you bring all the materials I informed you about? " }, npc, creature) -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 3)
npcHandler:setTopic(playerId, 3)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 2 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 2 and player:getItemById(31340, 1) and player:getItemById(31336, 12) and player:getItemById(2874, 5) then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 2 and player:getItemById(31340, 1) and player:getItemById(31336, 12) and player:getItemById(2874, 5) then
player:removeItem(31340, 1)
player:removeItem(31336, 12)
player:removeItem(2874, 5)
npcHandler:say({ "Thank you this stage of the ritual is complete." }, npc, creature) -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.Eighth.Shimun, 3)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun, 3)
npcHandler:setTopic(playerId, 4)
npcHandler:setTopic(playerId, 4)
else
diff --git a/data-otservbr-global/npc/shirtalis_of_the_summer_court.lua b/data-otservbr-global/npc/shirtalis_of_the_summer_court.lua
new file mode 100644
index 00000000000..bc4534f0cf8
--- /dev/null
+++ b/data-otservbr-global/npc/shirtalis_of_the_summer_court.lua
@@ -0,0 +1,91 @@
+local internalNpcName = "Shirtalis Of The Summer Court"
+local npcType = Game.createNpcType(internalNpcName)
+local npcConfig = {}
+
+npcConfig.name = internalNpcName
+npcConfig.description = internalNpcName
+
+npcConfig.health = 100
+npcConfig.maxHealth = npcConfig.health
+npcConfig.walkInterval = 2000
+npcConfig.walkRadius = 2
+
+npcConfig.outfit = {
+ lookType = 990,
+ lookHead = 0,
+ lookBody = 0,
+ lookLegs = 0,
+ lookFeet = 0,
+ lookAddons = 0,
+}
+
+npcConfig.flags = {
+ floorchange = false,
+}
+
+local keywordHandler = KeywordHandler:new()
+local npcHandler = NpcHandler:new(keywordHandler)
+
+npcType.onThink = function(npc, interval)
+ npcHandler:onThink(npc, interval)
+end
+
+npcType.onAppear = function(npc, creature)
+ npcHandler:onAppear(npc, creature)
+end
+
+npcType.onDisappear = function(npc, creature)
+ npcHandler:onDisappear(npc, creature)
+end
+
+npcType.onMove = function(npc, creature, fromPosition, toPosition)
+ npcHandler:onMove(npc, creature, fromPosition, toPosition)
+end
+
+npcType.onSay = function(npc, creature, type, message)
+ npcHandler:onSay(npc, creature, type, message)
+end
+
+npcType.onCloseChannel = function(npc, creature)
+ npcHandler:onCloseChannel(npc, creature)
+end
+
+local function creatureSayCallback(npc, creature, type, message)
+ local player = Player(creature)
+ local playerId = player:getId()
+
+ if not npcHandler:checkInteraction(npc, creature) then
+ return false
+ end
+
+ if MsgContains(message, "fight") then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.Permission) < 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheSummerCourt) == 1 then
+ npcHandler:say("We allow able champions of all races to fight for our cause against the challenges of the {arena}. So are you interested? I'm not interested in fancy'wordplay, so a simple {yes} or {no} will suffice!", npc, creature)
+ npcHandler:setTopic(playerId, 2)
+ end
+ elseif MsgContains(message, "yes") then
+ if npcHandler:getTopic(playerId) == 2 then
+ npcHandler:say("You are now able to enter the teleport.", npc, creature)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.Permission, 1)
+ npcHandler:setTopic(playerId, 0)
+ end
+ elseif MsgContains(message, "no") then
+ npcHandler:say("As you wish.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
+ elseif MsgContains(message, "arena") then
+ npcHandler:say("This place has always been a site where the champions of summer and winter have clashed in battle. Over the centuries this spectacle has drawn many creatures here to watch, participate and indulge in less savory activities.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
+ end
+
+ return true
+end
+
+npcHandler:setMessage(MESSAGE_GREET, "Hello fighter. I guess you are here to {fight} for our noble {cause}.")
+npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
+
+npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
+
+npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)
+
+-- npcType registering the npcConfig table
+npcType:register(npcConfig)
diff --git a/data-otservbr-global/npc/stricken_soul.lua b/data-otservbr-global/npc/stricken_soul.lua
index 88857dfb1e1..e09621b6f4c 100644
--- a/data-otservbr-global/npc/stricken_soul.lua
+++ b/data-otservbr-global/npc/stricken_soul.lua
@@ -45,8 +45,63 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end
-keywordHandler:addKeyword({ "job" }, StdModule.say, { npcHandler = npcHandler, text = "Esperando Script." })
-npcHandler:setMessage(MESSAGE_GREET, "Greetings, |PLAYERNAME|.")
+local function greetCallback(npc, creature)
+ local player = Player(creature)
+ local playerId = player:getId()
+
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) < 1 then
+ npcHandler:setMessage(MESSAGE_GREET, "This place is... haunted... heed my warning... there are... ghooooooosts here...! Why are you giving me that... look? I am certain, there aaaaaaare ghosts here - I've seen them! Do you believe me?")
+ else
+ npcHandler:setMessage(MESSAGE_GREET, "Gree... tings.")
+ end
+
+ return true
+end
+
+local function creatureSayCallback(npc, creature, type, message)
+ local player = Player(creature)
+ local playerId = player:getId()
+
+ if not npcHandler:checkInteraction(npc, creature) then
+ return false
+ end
+
+ local playerName = player:getName()
+
+ if MsgContains(message, "yes") then
+ if npcHandler:getTopic(playerId) == 2 then
+ npcHandler:say("Excellent... I hope they will haaaaaaunt my house no longer. What was your... naaaaaame again, tell me?", npc, creature)
+ npcHandler:setTopic(playerId, 3)
+ elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) < 1 then
+ npcHandler:say("Yeeeees... you need to help meeeeeee. I want those ghosts gone... this is my home and I need it to teach my students. Will you take care of the... ghosts?", npc, creature)
+ npcHandler:setTopic(playerId, 2)
+ end
+ elseif MsgContains(message, playerName) then
+ if npcHandler:getTopic(playerId) == 3 then
+ npcHandler:say({
+ " Ah yeeeeees, " .. playerName .. ". I will remember you. Now, lessons are every day in the morning and once a week in the evening... ...",
+ "Oh, you're not here for this, are you? So about the ghoooosts, yes. You seeeee, there are 3 secret passages here. ...",
+ "Thiiiiis is no ordinary house... it is a nexus, a gateway to a once hidden cathedral. Sheltering a small and peaceful society of scholars and monks. Secluded from every distraction. ...",
+ "I was one of them and ordered to hold contact to the outside woooorld. But then, something... happened. ...",
+ "Outsiders managed to sneak in, infiltrate and influence the society... for the worse. Who knows for what ends. They chaaaaanged... ...",
+ "Shortly after, contact was lost... the nexus broken and sealed, ghosts appeared... eeeeeeeverywhere. ...",
+ "Find the three passages... one is right here in the cellars, one in the jungles of Tiquanda and one in the deserts of Darama. ...",
+ "Restore their connection and open this nexus to access the buried cathedral and find the cause to this... eliminate all remainders there if you must, " .. playerName .. ".",
+ }, npc, creature)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 1)
+ npcHandler:setTopic(playerId, 0)
+ end
+ else
+ npcHandler:say("Sorry, I didn't understand.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
+ end
+
+ return true
+end
+
+npcHandler:setCallback(CALLBACK_GREET, greetCallback)
+npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
+
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)
-- npcType registering the npcConfig table
diff --git a/data-otservbr-global/npc/tefrit.lua b/data-otservbr-global/npc/tefrit.lua
index 8ef2c821bd6..d30248282b8 100644
--- a/data-otservbr-global/npc/tefrit.lua
+++ b/data-otservbr-global/npc/tefrit.lua
@@ -54,15 +54,15 @@ local function greetCallback(npc, creature)
local player = Player(creature)
local playerId = player:getId()
- if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
- elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then
+ elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 15)
- elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.First.Mission, 5)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5)
npcHandler:setTopic(playerId, 20)
end
return true
@@ -76,37 +76,37 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 1 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 1 then
npcHandler:say({ "Could you help me do a ritual?" }, npc, creature) -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
npcHandler:setTopic(playerId, 1)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 1 then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 1 then
player:addItem(31716, 1)
npcHandler:say({ "Here is the list with the missing ingredients to complete the ritual." }, npc, creature) -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.Eighth.Tefrit, 2)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, 2)
npcHandler:setTopic(playerId, 2)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say({ "Sorry." }, npc, creature)
end
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 then
npcHandler:say({ "Did you bring all the materials I informed you about?" }, npc, creature) -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 3)
npcHandler:setTopic(playerId, 3)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 and player:getItemById(31329, 20) and player:getItemById(31339, 25) and player:getItemById(31330, 15) then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 and player:getItemById(31329, 20) and player:getItemById(31339, 25) and player:getItemById(31330, 15) then
player:removeItem(10272, 5)
player:removeItem(31329, 20)
player:removeItem(31339, 25)
player:removeItem(31330, 15)
npcHandler:say({ "Thank you this stage of the ritual is complete." }, npc, creature) -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.Eighth.Tefrit, 3)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, 3)
npcHandler:setTopic(playerId, 4)
npcHandler:setTopic(playerId, 4)
else
diff --git a/data-otservbr-global/npc/the_empress.lua b/data-otservbr-global/npc/the_empress.lua
index fdc475b546e..98ab3fdaf11 100644
--- a/data-otservbr-global/npc/the_empress.lua
+++ b/data-otservbr-global/npc/the_empress.lua
@@ -54,7 +54,14 @@ local function greetCallback(npc, creature)
local player = Player(creature)
local playerId = player:getId()
- if player:getStorageValue(Storage.Kilmaresh.Fifth.Memories) == 4 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) == 10 then
+ npcHandler:setMessage(MESSAGE_GREET, {
+ "You succeeded! Issavi is safe again. Take this as a sign of our grace and gratitude, brave mortal being. It is a precious relic from earlier times. More precisely, it is one of four parts of the relic called the Regalia of Suon. ...",
+ "Should you ever find the other three parts, a talented jeweler might be able to combine them and recreate the regalia for you.",
+ })
+ player:addItem(31573, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, 11)
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 5 then
player:addItem(31414, 1)
npcHandler:setMessage(MESSAGE_GREET, {
"I see. There is enough and adequate evidence that the Ambassador of Rathleton is indeed an arch traitor. So, Eshaya was right. Well done, mortal being. You have proven your loyalty and bravery, therefore allow me to ask you one more favour. ...",
@@ -63,43 +70,23 @@ local function greetCallback(npc, creature)
"Well, they want to activate five Fafnar statues which they have already enchanted. They are hidden in the catacombs underneath the city. Please go down and search for the statues. ...",
"Then use this sceptre to bless them in the name of Suon and Bastesh. This will destroy the disastrous enchantment and Issavi will be safe again.",
})
- player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, 1)
- player:setStorageValue(Storage.Kilmaresh.Sixth.FourMasks, 0)
- player:setStorageValue(Storage.Kilmaresh.Sixth.BlessedStatues, 0)
- player:setStorageValue(Storage.Kilmaresh.Fifth.Memories, 6)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks, 0)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.BlessedStatues, 0)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 6)
else
npcHandler:setMessage(MESSAGE_GREET, "Greetings.")
end
+
return true
end
-local masksDialogue = keywordHandler:addKeyword({ "mission" }, StdModule.say, {
- npcHandler = npcHandler,
- text = "Did you take all the masks and enchant all the statues?",
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) == 10
-end)
-
-masksDialogue:addChildKeyword(
- { "yes" },
- StdModule.say,
- {
- npcHandler = npcHandler,
- text = "Thank you.",
- },
- nil,
- function(player)
- player:addItem(31573, 1) -- Sun Medal
- player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, 11)
- end
-)
-
npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
npcHandler:setCallback(CALLBACK_SET_INTERACTION, onAddFocus)
npcHandler:setCallback(CALLBACK_REMOVE_INTERACTION, onReleaseFocus)
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
-npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
+
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)
-- npcType registering the npcConfig table
diff --git a/data-otservbr-global/npc/the_librarian.lua b/data-otservbr-global/npc/the_librarian.lua
index 45b786342de..47a220dcc8b 100644
--- a/data-otservbr-global/npc/the_librarian.lua
+++ b/data-otservbr-global/npc/the_librarian.lua
@@ -58,19 +58,30 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end
-keywordHandler:addKeyword({ "ring" }, StdModule.say, {
- npcHandler = npcHandler,
- text = {
- "To extract memories from the ring, you have to enter a trance-like state with the help of a hallucinogen. Like this you can see all memories that are stored in the ring. Ask {Faloriel} for a respective potion. ...",
- "Drink it while wearing the ring in the Temple of {Bastesh} and say: 'Sa Katesa Tarsani na'. If the legends are true you will be able to take memories with you in the form of memory shards.",
- },
-}, function(player)
- return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 4
-end, function(player)
- player:setStorageValue(Storage.Kilmaresh.Fifth.Memories, 1)
- player:setStorageValue(Storage.Kilmaresh.Fifth.MemoriesShards, 0)
- player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 5)
-end)
+local function creatureSayCallback(npc, creature, type, message)
+ local player = Player(creature)
+ local playerId = player:getId()
+
+ if not npcHandler:checkInteraction(npc, creature) then
+ return false
+ end
+
+ if MsgContains(message, "ring") then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 5 then
+ npcHandler:say({
+ "To extract memories from the ring, you have to enter a trance-like state with the help of a hallucinogen. Like this you can see all memories that are stored in the ring. Ask Faloriel for a respective potion. ...",
+ "Drink it while wearing the ring in the Temple of Bastesh and say: 'Sa Katesa Tarsani na'. If the legends are true you will be able to take memories with you in the form of memory shards.",
+ }, npc, creature)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.MemoriesShards, 0)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 6)
+ else
+ npcHandler:say("You don't need any instructions about the ring right now.", npc, creature)
+ end
+ end
+
+ return true
+end
npcHandler:setMessage(MESSAGE_GREET, "Greetings, dear guest. If you are interested in paperware such as books or scrolls, ask me for a trade.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
diff --git a/data-otservbr-global/npc/undal.lua b/data-otservbr-global/npc/undal.lua
index ad0346e7e77..b4c44d3369a 100644
--- a/data-otservbr-global/npc/undal.lua
+++ b/data-otservbr-global/npc/undal.lua
@@ -53,36 +53,6 @@ end
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)
-local outfits = { 1147, 1146 }
-
-local function hasOutfit(player)
- for _, outfit in ipairs(outfits) do
- if player:hasOutfit(outfit) then
- return true
- end
- end
- return false
-end
-
-local function hasAddon(player, addon)
- for _, outfit in ipairs(outfits) do
- if player:hasOutfit(outfit, addon) then
- return true
- end
- end
- return false
-end
-
-local function hasKllledTheNightmareBeast(player)
- return player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareBeastKilled) == 1
-end
-
-local function checkAchievement(player)
- if hasAddon(player, 3) then
- player:addAchievement("Dream Warrior")
- end
-end
-
local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
local playerId = player:getId()
@@ -91,82 +61,113 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end
- if npcHandler:getTopic(playerId) == 0 then
- if MsgContains(message, "task") or MsgContains(message, "outfit") then
- if hasOutfit(player) then
- npcHandler:say("You already have the Dream Warrior outfit.", npc, creature)
- return true
- end
-
- if not hasKllledTheNightmareBeast(player) then
- npcHandler:say("You need to kill the Nightmare Beast first.", npc, creature)
- return true
- end
+ local dreamTalisman = 30132
- npcHandler:say("The Nightmare Beast is slain. You have done well. The Courts of Summer and Winter will be forever grateful. For your efforts I want to reward you with our traditional dream warrior outfit. May it suit you well!", npc, creature)
- for _, outfit in ipairs(outfits) do
- player:addOutfit(outfit, 0)
- end
- return true
+ if MsgContains(message, "talk") then
+ npcHandler:say("So do you want to learn the {story} behind of this or rather talk about the {task} at hand? ", npc, creature)
+ npcHandler:setTopic(playerId, 2)
+ elseif MsgContains(message, "story") then
+ if npcHandler:getTopic(playerId) == 2 then
+ npcHandler:say("Do you prefer the {long} version or the {short} version?", npc, creature)
+ npcHandler:setTopic(playerId, 3)
end
-
- if MsgContains(message, "addon") then
- if not hasOutfit(player) then
- npcHandler:say("You don't have the Dream Warrior outfit.", npc, creature)
- return true
+ elseif MsgContains(message, "short") and npcHandler:getTopic(playerId) == 3 then
+ npcHandler:say({
+ "You will have to re-empower several wardstones all over the world, to weaken the beast of nightmares. ...",
+ "The next step would be to enter a place known as dream scar and participate in battles, to gain access to the lower areas. ...",
+ "There the nightmare beast can be challenged and defeated.",
+ "So do you want to learn the story behind of this or rather talk about the {task} at hand?",
+ }, npc, creature)
+ npcHandler:setTopic(playerId, 4)
+ elseif npcHandler:getTopic(playerId) == 4 or npcHandler:getTopic(playerId) == 2 then
+ if MsgContains(message, "task") then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) >= 3 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheWinterCourt) == 1 and not (player:hasOutfit(1146) or player:hasOutfit(1147)) then
+ npcHandler:say("The Nightmare Beast is slain. You have done well. The Courts of Summer and Winter will be forever grateful. For your efforts I want to reward you with our traditional dream warrior outfit. May it suit you well!", npc, creature)
+ for i = 1146, 1147 do
+ player:addOutfit(i)
+ end
+ npcHandler:setTopic(playerId, 0)
+ elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count) >= 8 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheWinterCourt) == 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) == 1 then
+ npcHandler:say({
+ "You empowered all eight ward stones. Well done! You may now enter the Dream Labyrinth via the portal here in the Court. Beneath it you will find the Nightmare Beast's lair. But the labyrinth is protected by seven so called Dream Doors. ...",
+ "You have to find the Seven {Keys} to unlock the Seven Dream Doors down there. Only then you will be able to enter the Nightmare Beast's lair.",
+ }, npc, creature)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 2)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, 1)
+ npcHandler:setTopic(playerId, 5)
+ elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) < 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheSummerCourt) < 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheWinterCourt) < 1 then
+ npcHandler:say({
+ "You have to empower eight ward stones. Once charged with arcane energy, they will strengthen the Nightmare Beast's prison and at the same time weaken this terrible creature. We know about the specific location of six of those stones. ...",
+ "You can find them in the mountains of the island Okolnir, in a water elemental cave beneath Folda, in the depths of Calassa, in the forests of Feyrist and on the islands Meriana and Cormaya. ...",
+ "The location of the other two ward stones is a bit more obscure, however. We are not completely sure where they are. You should make inquiries at an abandoned house in the Plains of Havoc. You may find it east of an outlaw camp. ...",
+ "The other stone seems to be somewhere in Tiquanda. Search for a small stone building south-west of Banuta. Take this talisman to empower the ward stones. It will work with the six stones at the known locations. ...",
+ "However, the empowering of the two hidden stones could be a bit more complicated. But you have to find out on yourself what to do with those stones.",
+ }, npc, creature)
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline) < 1 then
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline, 1)
+ end
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheWinterCourt, 1)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 1)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count, 0)
+ player:addItem(dreamTalisman, 1)
+ npcHandler:setTopic(playerId, 0)
+ else
+ npcHandler:say("I already gave your task.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
end
- npcHandler:say("Are you interested in one or two addons to your dream warrior outfit?", npc, creature)
- npcHandler:setTopic(playerId, 1)
- return true
end
- elseif npcHandler:getTopic(playerId) == 1 then
- if MsgContains(message, "yes") then
- npcHandler:say("I provide two addons. For the first one I need you to bring me five pomegranates. For the second addon you need an ice shield. Which one would you like? {Pomegranate} or {shield}?", npc, creature)
- npcHandler:setTopic(playerId, 2)
+ elseif MsgContains(message, "keys") and npcHandler:getTopic(playerId) == 5 then
+ npcHandler:say("They are not literally keys but rather puzzles you have to solve or a secret mechanism you have to discover in order to open the Dream Doors. A parchment in the chest here can tell you more about it.", npc, creature)
+ elseif MsgContains(message, "addon") then
+ if player:hasOutfit(1146) or player:hasOutfit(1147) then
+ npcHandler:say("Are you interested in one or two addons to your dream warrior outfit?", npc, creature)
+ npcHandler:setTopic(playerId, 6)
else
- npcHandler:say("Alright then. Come back if you change your mind.", npc, creature)
- npcHandler:setTopic(playerId, 0)
+ npcHandler:say("You don't even have the outfit.", npc, creature)
end
- elseif npcHandler:getTopic(playerId) == 2 then
- if MsgContains(message, "pomegranate") then
- if hasAddon(player, 1) then
- npcHandler:say("You already have this addon.", npc, creature)
- return true
- end
- if player:removeItem(30169, 5) then
- npcHandler:say("Great! Here is the addon.", npc, creature)
- for _, outfit in ipairs(outfits) do
- player:addOutfitAddon(outfit, 1)
+ elseif MsgContains(message, "yes") then
+ if npcHandler:getTopic(playerId) == 6 then
+ npcHandler:say("I provide two addons. For the first one I need you to bring me five pomegranates. For the second addon you need an ice shield. Do you want one of these addons?", npc, creature)
+ npcHandler:setTopic(playerId, 7)
+ elseif npcHandler:getTopic(playerId) == 7 then
+ npcHandler:say("What do you have for me: the {pomegranates} or the {ice shield}?", npc, creature)
+ npcHandler:setTopic(playerId, 8)
+ end
+ elseif npcHandler:getTopic(playerId) == 8 then
+ if MsgContains(message, "pomegranates") then
+ if player:getItemCount(30169) >= 5 then
+ npcHandler:say("Very good! You gained the second addon to the dream warrior outfit.", npc, creature)
+ player:removeItem(30169, 5)
+ for i = 1146, 1147 do
+ player:addOutfitAddon(i, 2)
end
- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
- checkAchievement(player)
npcHandler:setTopic(playerId, 0)
else
- npcHandler:say("Sorry, you don't have the required items.", npc, creature)
- end
- elseif MsgContains(message, "shield") then
- if hasAddon(player, 2) then
- npcHandler:say("You already have this addon.", npc, creature)
- return true
+ npcHandler:say("You do not have enough items.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
end
- if player:removeItem(30168, 1) then
- npcHandler:say("Great! Here is the addon.", npc, creature)
- for _, outfit in ipairs(outfits) do
- player:addOutfitAddon(outfit, 2)
+ elseif MsgContains(message, "ice shield") then
+ if player:getItemCount(30168) >= 1 then
+ npcHandler:say("Very good! You gained the first addon to the dream warrior outfit.", npc, creature)
+ player:removeItem(30168, 1)
+ for i = 1146, 1147 do
+ player:addOutfitAddon(i, 1)
end
- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
- checkAchievement(player)
npcHandler:setTopic(playerId, 0)
else
- npcHandler:say("Sorry, you don't have the required items.", npc, creature)
+ npcHandler:say("You do not have enough items.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
end
- else
- npcHandler:say("Sorry, I didn't understand.", npc, creature)
- return true
end
+ else
+ npcHandler:say("Sorry, I didn't understand.", npc, creature)
end
end
+npcHandler:setMessage(MESSAGE_GREET, "Greetings hero. I guess you came to {talk}.")
+npcHandler:setMessage(MESSAGE_FAREWELL, "Well, bye then.")
+npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
+
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
-- npcType registering the npcConfig table
diff --git a/data-otservbr-global/npc/vanys.lua b/data-otservbr-global/npc/vanys.lua
index c922ce8c8cd..643af953d9c 100644
--- a/data-otservbr-global/npc/vanys.lua
+++ b/data-otservbr-global/npc/vanys.lua
@@ -53,36 +53,6 @@ end
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)
-local outfits = { 1147, 1146 }
-
-local function hasOutfit(player)
- for _, outfit in ipairs(outfits) do
- if player:hasOutfit(outfit) then
- return true
- end
- end
- return false
-end
-
-local function hasAddon(player, addon)
- for _, outfit in ipairs(outfits) do
- if player:hasOutfit(outfit, addon) then
- return true
- end
- end
- return false
-end
-
-local function hasKllledTheNightmareBeast(player)
- return player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareBeastKilled) == 1
-end
-
-local function checkAchievement(player)
- if hasAddon(player, 3) then
- player:addAchievement("Dream Warrior")
- end
-end
-
local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
local playerId = player:getId()
@@ -91,82 +61,113 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end
- if npcHandler:getTopic(playerId) == 0 then
- if MsgContains(message, "task") or MsgContains(message, "outfit") then
- if hasOutfit(player) then
- npcHandler:say("You already have the Dream Warrior outfit.", npc, creature)
- return true
- end
-
- if not hasKllledTheNightmareBeast(player) then
- npcHandler:say("You need to kill the Nightmare Beast first.", npc, creature)
- return true
- end
+ local dreamTalisman = 30132
- npcHandler:say("The Nightmare Beast is slain. You have done well. The Courts of Summer and Winter will be forever grateful. For your efforts I want to reward you with our traditional dream warrior outfit. May it suit you well!", npc, creature)
- for _, outfit in ipairs(outfits) do
- player:addOutfit(outfit, 0)
- end
- return true
+ if MsgContains(message, "talk") then
+ npcHandler:say("So do you want to learn the {story} behind of this or rather talk about the {task} at hand? ", npc, creature)
+ npcHandler:setTopic(playerId, 2)
+ elseif MsgContains(message, "story") then
+ if npcHandler:getTopic(playerId) == 2 then
+ npcHandler:say("Do you prefer the {long} version or the {short} version?", npc, creature)
+ npcHandler:setTopic(playerId, 3)
end
-
- if MsgContains(message, "addon") then
- if not hasOutfit(player) then
- npcHandler:say("You don't have the Dream Warrior outfit.", npc, creature)
- return true
+ elseif MsgContains(message, "short") and npcHandler:getTopic(playerId) == 3 then
+ npcHandler:say({
+ "You will have to re-empower several wardstones all over the world, to weaken the beast of nightmares. ...",
+ "The next step would be to enter a place known as dream scar and participate in battles, to gain access to the lower areas. ...",
+ "There the nightmare beast can be challenged and defeated.",
+ "So do you want to learn the story behind of this or rather talk about the {task} at hand?",
+ }, npc, creature)
+ npcHandler:setTopic(playerId, 4)
+ elseif npcHandler:getTopic(playerId) == 4 or npcHandler:getTopic(playerId) == 2 then
+ if MsgContains(message, "task") then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) >= 3 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheSummerCourt) == 1 and not (player:hasOutfit(1146) or player:hasOutfit(1147)) then
+ npcHandler:say("The Nightmare Beast is slain. You have done well. The Courts of Summer and Winter will be forever grateful. For your efforts I want to reward you with our traditional dream warrior outfit. May it suit you well!", npc, creature)
+ for i = 1146, 1147 do
+ player:addOutfit(i)
+ end
+ npcHandler:setTopic(playerId, 0)
+ elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count) >= 8 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheSummerCourt) == 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) == 1 then
+ npcHandler:say({
+ "You empowered all eight ward stones. Well done! You may now enter the Dream Labyrinth via the portal here in the Court. Beneath it you will find the Nightmare Beast's lair. But the labyrinth is protected by seven so called Dream Doors. ...",
+ "You have to find the Seven {Keys} to unlock the Seven Dream Doors down there. Only then you will be able to enter the Nightmare Beast's lair.",
+ }, npc, creature)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 2)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, 1)
+ npcHandler:setTopic(playerId, 5)
+ elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) < 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheSummerCourt) < 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheWinterCourt) < 1 then
+ npcHandler:say({
+ "You have to empower eight ward stones. Once charged with arcane energy, they will strengthen the Nightmare Beast's prison and at the same time weaken this terrible creature. We know about the specific location of six of those stones. ...",
+ "You can find them in the mountains of the island Okolnir, in a water elemental cave beneath Folda, in the depths of Calassa, in the forests of Feyrist and on the islands Meriana and Cormaya. ...",
+ "The location of the other two ward stones is a bit more obscure, however. We are not completely sure where they are. You should make inquiries at an abandoned house in the Plains of Havoc. You may find it east of an outlaw camp. ...",
+ "The other stone seems to be somewhere in Tiquanda. Search for a small stone building south-west of Banuta. Take this talisman to empower the ward stones. It will work with the six stones at the known locations. ...",
+ "However, the empowering of the two hidden stones could be a bit more complicated. But you have to find out on yourself what to do with those stones.",
+ }, npc, creature)
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline) < 1 then
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline, 1)
+ end
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheSummerCourt, 1)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 1)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count, 0)
+ player:addItem(dreamTalisman, 1)
+ npcHandler:setTopic(playerId, 0)
+ else
+ npcHandler:say("I already gave your task.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
end
- npcHandler:say("Are you interested in one or two addons to your dream warrior outfit?", npc, creature)
- npcHandler:setTopic(playerId, 1)
- return true
end
- elseif npcHandler:getTopic(playerId) == 1 then
- if MsgContains(message, "yes") then
- npcHandler:say("I provide two addons. For the first one I need you to bring me five pomegranates. For the second addon you need an ice shield. Which one would you like? {Pomegranate} or {shield}?", npc, creature)
- npcHandler:setTopic(playerId, 2)
+ elseif MsgContains(message, "keys") and npcHandler:getTopic(playerId) == 5 then
+ npcHandler:say("They are not literally keys but rather puzzles you have to solve or a secret mechanism you have to discover in order to open the Dream Doors. A parchment in the chest here can tell you more about it.", npc, creature)
+ elseif MsgContains(message, "addon") then
+ if player:hasOutfit(1146) or player:hasOutfit(1147) then
+ npcHandler:say("Are you interested in one or two addons to your dream warrior outfit?", npc, creature)
+ npcHandler:setTopic(playerId, 6)
else
- npcHandler:say("Alright then. Come back if you change your mind.", npc, creature)
- npcHandler:setTopic(playerId, 0)
+ npcHandler:say("You don't even have the outfit.", npc, creature)
end
- elseif npcHandler:getTopic(playerId) == 2 then
- if MsgContains(message, "pomegranate") then
- if hasAddon(player, 1) then
- npcHandler:say("You already have this addon.", npc, creature)
- return true
- end
- if player:removeItem(30169, 5) then
- npcHandler:say("Great! Here is the addon.", npc, creature)
- for _, outfit in ipairs(outfits) do
- player:addOutfitAddon(outfit, 1)
+ elseif MsgContains(message, "yes") then
+ if npcHandler:getTopic(playerId) == 6 then
+ npcHandler:say("I provide two addons. For the first one I need you to bring me five pomegranates. For the second addon you need an ice shield. Do you want one of these addons?", npc, creature)
+ npcHandler:setTopic(playerId, 7)
+ elseif npcHandler:getTopic(playerId) == 7 then
+ npcHandler:say("What do you have for me: the {pomegranates} or the {ice shield}?", npc, creature)
+ npcHandler:setTopic(playerId, 8)
+ end
+ elseif npcHandler:getTopic(playerId) == 8 then
+ if MsgContains(message, "pomegranates") then
+ if player:getItemCount(30169) >= 5 then
+ npcHandler:say("Very good! You gained the second addon to the dream warrior outfit.", npc, creature)
+ player:removeItem(30169, 5)
+ for i = 1146, 1147 do
+ player:addOutfitAddon(i, 2)
end
- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
- checkAchievement(player)
npcHandler:setTopic(playerId, 0)
else
- npcHandler:say("Sorry, you don't have the required items.", npc, creature)
- end
- elseif MsgContains(message, "shield") then
- if hasAddon(player, 2) then
- npcHandler:say("You already have this addon.", npc, creature)
- return true
+ npcHandler:say("You do not have enough items.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
end
- if player:removeItem(30168, 1) then
- npcHandler:say("Great! Here is the addon.", npc, creature)
- for _, outfit in ipairs(outfits) do
- player:addOutfitAddon(outfit, 2)
+ elseif MsgContains(message, "ice shield") then
+ if player:getItemCount(30168) >= 1 then
+ npcHandler:say("Very good! You gained the first addon to the dream warrior outfit.", npc, creature)
+ player:removeItem(30168, 1)
+ for i = 1146, 1147 do
+ player:addOutfitAddon(i, 1)
end
- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
- checkAchievement(player)
npcHandler:setTopic(playerId, 0)
else
- npcHandler:say("Sorry, you don't have the required items.", npc, creature)
+ npcHandler:say("You do not have enough items.", npc, creature)
+ npcHandler:setTopic(playerId, 0)
end
- else
- npcHandler:say("Sorry, I didn't understand.", npc, creature)
- return true
end
+ else
+ npcHandler:say("Sorry, I didn't understand.", npc, creature)
end
end
+npcHandler:setMessage(MESSAGE_GREET, "Greetings hero. I guess you came to {talk}.")
+npcHandler:setMessage(MESSAGE_FAREWELL, "Well, bye then.")
+npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")
+
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
-- npcType registering the npcConfig table
diff --git a/data-otservbr-global/npc/yonan.lua b/data-otservbr-global/npc/yonan.lua
index 1b85ecc7c17..c31fe9b93da 100644
--- a/data-otservbr-global/npc/yonan.lua
+++ b/data-otservbr-global/npc/yonan.lua
@@ -133,15 +133,15 @@ local function greetCallback(npc, creature)
local player = Player(creature)
local playerId = player:getId()
- if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
- elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then
+ elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 15)
- elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.First.Mission, 5)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5)
npcHandler:setTopic(playerId, 20)
end
return true
@@ -155,37 +155,37 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 1 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 1 then
npcHandler:say({ "Could you help me do a ritual?" }, npc, creature) -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
npcHandler:setTopic(playerId, 1)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 1 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 1 then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 1 then
player:addItem(31717, 1) -- Yonans List
player:addItem(31613, 1) -- Pick Enchanted
npcHandler:say({ "Here is the list with the missing ingredients to complete the ritual." }, npc, creature) -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.Eighth.Yonan, 2)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan, 2)
npcHandler:setTopic(playerId, 2)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say({ "Sorry." }, npc, creature)
end
end
- if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 then
+ if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 then
npcHandler:say({ "Did you bring all the materials I informed you about? " }, npc, creature) -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 3)
npcHandler:setTopic(playerId, 3)
end
- elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 then
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 and player:getItemById(9651, 3) and player:getItemById(31325, 12) and player:getItemById(31333, 10) then
+ elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 and player:getItemById(9651, 3) and player:getItemById(31325, 12) and player:getItemById(31333, 10) then
player:removeItem(9651, 3)
player:removeItem(31325, 12)
player:removeItem(31333, 10)
npcHandler:say({ "Thank you this stage of the ritual is complete." }, npc, creature) -- It needs to be revised, it's not the same as the global
- player:setStorageValue(Storage.Kilmaresh.Eighth.Yonan, 3)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan, 3)
npcHandler:setTopic(playerId, 4)
npcHandler:setTopic(playerId, 4)
else
diff --git a/data-otservbr-global/scripts/actions/bosses_levers/duke_krule.lua b/data-otservbr-global/scripts/actions/bosses_levers/duke_krule.lua
deleted file mode 100644
index 11c3d36a231..00000000000
--- a/data-otservbr-global/scripts/actions/bosses_levers/duke_krule.lua
+++ /dev/null
@@ -1,23 +0,0 @@
-local config = {
- boss = {
- name = "Duke Krule",
- position = Position(33456, 31473, 13),
- },
- requiredLevel = 250,
- playerPositions = {
- { pos = Position(33455, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
- { pos = Position(33456, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
- { pos = Position(33457, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
- { pos = Position(33458, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
- { pos = Position(33459, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
- },
- specPos = {
- from = Position(33447, 31464, 13),
- to = Position(33464, 31481, 13),
- },
- exit = Position(32347, 32167, 12),
-}
-
-local lever = BossLever(config)
-lever:position({ x = 33454, y = 31493, z = 13 })
-lever:register()
diff --git a/data-otservbr-global/scripts/actions/other/enchanting.lua b/data-otservbr-global/scripts/actions/other/enchanting.lua
index ef6d648d15e..c1eada42b98 100644
--- a/data-otservbr-global/scripts/actions/other/enchanting.lua
+++ b/data-otservbr-global/scripts/actions/other/enchanting.lua
@@ -44,6 +44,11 @@ local enchantedItems = {
local enchanting = Action()
function enchanting.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ -- The Dream Courts Quest
+ if item.itemid == 675 and target.itemid == 21573 then
+ return onGrindItem(player, item, fromPosition, target, toPosition)
+ end
+
if table.contains({ 33268, 33269 }, toPosition.x) and toPosition.y == 31830 and toPosition.z == 10 and player:getStorageValue(Storage.Quest.U8_2.ElementalSpheres.QuestLine) > 0 then
if not table.contains(spheres[item.itemid], player:getVocation():getBaseId()) then
return false
diff --git a/data-otservbr-global/scripts/actions/other/gems.lua b/data-otservbr-global/scripts/actions/other/gems.lua
index e56ea30e896..51d40165a9c 100644
--- a/data-otservbr-global/scripts/actions/other/gems.lua
+++ b/data-otservbr-global/scripts/actions/other/gems.lua
@@ -85,12 +85,13 @@ function gems.onUse(player, item, fromPosition, target, toPosition, isHotkey)
-- Small emerald for Kilmaresh quest
-- see data\scripts\quests\kilmaresh\1-fafnars-wrath\7-four-masks.lua
- if item.itemid == 3032 and target.uid == 40032 and player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) >= 1 and not testFlag(player:getStorageValue(Storage.Kilmaresh.Sixth.FourMasks), 4) then
+ if item.itemid == 3032 and target.uid == 40032 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) >= 1 and not testFlag(player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks), 4) then
player:addItem(31371, 1) -- Ivory mask
item:remove(1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You hear a *click*. You can now lift the floor tile and discover a secret compartment. A mask made of ivory lies in it.")
- player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) + 1)
- player:setStorageValue(Storage.Kilmaresh.Sixth.FourMasks, setFlag(player:getStorageValue(Storage.Kilmaresh.Sixth.FourMasks), 4))
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) + 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks, setFlag(player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks), 4))
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.IvoryMask, 1)
return true
-- Enchanted helmet of the ancients
elseif player:getItemCount(3030) >= 1 and target.itemid == 3229 then
diff --git a/data-otservbr-global/scripts/actions/other/others/quest_system2.lua b/data-otservbr-global/scripts/actions/other/others/quest_system2.lua
index 89b61977dfc..3508b585eba 100644
--- a/data-otservbr-global/scripts/actions/other/others/quest_system2.lua
+++ b/data-otservbr-global/scripts/actions/other/others/quest_system2.lua
@@ -309,7 +309,7 @@ This page seems to be part of a book about ancient rituals, mystic incantations
name = "Falcon Bastion Access",
},
},
- storage = Storage.Quest.U11_80.TheSecretLibrary.FalconBastionAccess,
+ storage = Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.FalconBastionAccess,
},
[20002] = {
items = {
diff --git a/data-otservbr-global/scripts/actions/tools/juice_squeezer.lua b/data-otservbr-global/scripts/actions/tools/juice_squeezer.lua
index 127ad921b13..311485c1c42 100644
--- a/data-otservbr-global/scripts/actions/tools/juice_squeezer.lua
+++ b/data-otservbr-global/scripts/actions/tools/juice_squeezer.lua
@@ -3,6 +3,12 @@ local fruits = { 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 359
local juiceSqueezer = Action()
function juiceSqueezer.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ -- The Dream Courts Quest
+ if target.itemid == 29995 then
+ target:transform(30003)
+ return true
+ end
+
if table.contains(fruits, target.itemid) and player:removeItem(2874, 1, 0) then
target:remove(1)
player:addItem(2874, target.itemid == 3589 and 14 or 21)
diff --git a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua
index 9c318264b11..4f7511df0d8 100644
--- a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua
+++ b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua
@@ -291,8 +291,12 @@ local questTable = {
{ storageName = "ForgottenKnowledge.AccessGolden", storage = Storage.Quest.U11_02.ForgottenKnowledge.AccessGolden, storageValue = 1 },
{ storageName = "GrimvaleQuest.AncientFeudDoors", storage = Storage.Quest.U10_80.GrimvaleQuest.AncientFeudDoors, storageValue = 1 },
{ storageName = "GrimvaleQuest.AncientFeudShortcut", storage = Storage.Quest.U10_80.GrimvaleQuest.AncientFeudShortcut, storageValue = 1 },
- { storageName = "Kilmaresh.AccessDoor", storage = Storage.Kilmaresh.AccessDoor, storageValue = 1 },
- { storageName = "Kilmaresh.CatacombDoors", storage = Storage.Kilmaresh.CatacombDoors, storageValue = 1 },
+ { storageName = "KilmareshQuest.AccessDoor", storage = Storage.Quest.U12_20.KilmareshQuest.AccessDoor, storageValue = 1 },
+ { storageName = "KilmareshQuest.Second.Investigating", storage = Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, storageValue = 1 },
+ { storageName = "KilmareshQuest.Sixth.GryphonMask", storage = Storage.Quest.U12_20.KilmareshQuest.Sixth.GryphonMask, storageValue = 1 },
+ { storageName = "KilmareshQuest.Sixth.MirrorMask", storage = Storage.Quest.U12_20.KilmareshQuest.Sixth.MirrorMask, storageValue = 1 },
+ { storageName = "KilmareshQuest.Sixth.IvoryMask", storage = Storage.Quest.U12_20.KilmareshQuest.Sixth.IvoryMask, storageValue = 1 },
+ { storageName = "KilmareshQuest.Sixth.SilverMask", storage = Storage.Quest.U12_20.KilmareshQuest.Sixth.SilverMask, storageValue = 1 },
{ storageName = "TheOrderOfTheLion.AccessEastSide", storage = Storage.Quest.U12_40.TheOrderOfTheLion.AccessEastSide, storageValue = 1 },
{ storageName = "TheOrderOfTheLion.AccessSouthernSide", storage = Storage.Quest.U12_40.TheOrderOfTheLion.AccessSouthernSide, storageValue = 1 },
{ storageName = "APiratesTail.TentuglyDoor", storage = Storage.Quest.U12_60.APiratesTail.TentuglyDoor, storageValue = 1 },
diff --git a/data-otservbr-global/scripts/creaturescripts/monster/faceless_bane_immunity.lua b/data-otservbr-global/scripts/creaturescripts/monster/faceless_bane_immunity.lua
deleted file mode 100644
index 36e1ecd11c3..00000000000
--- a/data-otservbr-global/scripts/creaturescripts/monster/faceless_bane_immunity.lua
+++ /dev/null
@@ -1,47 +0,0 @@
-local bossName = "Faceless Bane"
-
-local function healBoss(creature)
- if creature then
- creature:addHealth(creature:getMaxHealth())
- creature:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
- end
-end
-
-local function createSummons(creature)
- if creature then
- local pos = creature:getPosition()
- Game.createMonster("Gazer Spectre", pos, true, false, creature)
- Game.createMonster("Ripper Spectre", pos, true, false, creature)
- Game.createMonster("Burster Spectre", pos, true, false, creature)
- end
-end
-
-local function resetBoss(creature, deaths)
- if creature then
- healBoss(creature)
- createSummons(creature)
- Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.Deaths, deaths + 1)
- Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, 0)
- Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps, 1)
- end
-end
-
-local facelessBaneImmunity = CreatureEvent("facelessBaneImmunity")
-
-function facelessBaneImmunity.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
- if creature and creature:isMonster() and creature:getName() == bossName then
- local creatureHealthPercent = (creature:getHealth() * 100) / creature:getMaxHealth()
- local facelessBaneDeathsStorage = Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.Deaths)
-
- if creatureHealthPercent <= 20 and facelessBaneDeathsStorage < 1 then
- resetBoss(creature, facelessBaneDeathsStorage)
- return true
- elseif Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn) < 1 then
- healBoss(creature)
- return true
- end
- end
- return primaryDamage, primaryType, secondaryDamage, secondaryType
-end
-
-facelessBaneImmunity:register()
diff --git a/data-otservbr-global/scripts/lib/register_actions.lua b/data-otservbr-global/scripts/lib/register_actions.lua
index 48ef4c38993..edde1c3de50 100644
--- a/data-otservbr-global/scripts/lib/register_actions.lua
+++ b/data-otservbr-global/scripts/lib/register_actions.lua
@@ -74,6 +74,13 @@ local secret_library = {
items = { 27867, 27868, 27869 },
}
+local oldTable = { Position(32005, 32002, 14), Position(32005, 32003, 14), Position(32006, 32002, 14), Position(32006, 32003, 14) }
+local foundItems = {
+ { id = 29992, quantity = 1 },
+ { id = 953, quantity = 4 },
+}
+local storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Lock
+
local function revertItem(position, itemId, transformId)
local item = Tile(position):getItemById(itemId)
if item then
@@ -520,8 +527,26 @@ function onUsePick(player, item, fromPosition, target, toPosition, isHotkey)
end
end
- -- The Secret Library Quest
local tPos = toPosition
+
+ -- The Dream Courts Quest
+ for i = 1, #oldTable do
+ if tPos == oldTable[i] then
+ if player:getStorageValue(storage) < 1 then
+ for j = 1, #foundItems do
+ player:addItem(foundItems[j].id, foundItems[j].quantity)
+ end
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This table is made of several old doors. One of them has a noticeable ornate lock. Perhaps you could lever it out with a tool.")
+ player:setStorageValue(storage, 1)
+ else
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already removed the old lock.")
+ end
+
+ return true
+ end
+ end
+
+ -- The Secret Library Quest
for _, j in pairs(secret_library.crystals) do
if tPos == j.position then
if player:getStorageValue(j.storage) < os.time() then
@@ -1014,8 +1039,26 @@ function onUseKitchenKnife(player, item, fromPosition, target, toPosition, isHot
return false
end
- -- The Secret Library Quest
local tPos = toPosition
+
+ -- The Dream Courts Quest
+ for i = 1, #oldTable do
+ if tPos == oldTable[i] then
+ if player:getStorageValue(storage) < 1 then
+ for j = 1, #foundItems do
+ player:addItem(foundItems[j].id, foundItems[j].quantity)
+ end
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This table is made of several old doors. One of them has a noticeable ornate lock. Perhaps you could lever it out with a tool.")
+ player:setStorageValue(storage, 1)
+ else
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already removed the old lock.")
+ end
+
+ return true
+ end
+ end
+
+ -- The Secret Library Quest
for _, j in pairs(secret_library.crystals) do
if tPos == j.position then
if player:getStorageValue(j.storage) < os.time() then
diff --git a/data-otservbr-global/scripts/quests/grave_danger/actions_bosses_killed.lua b/data-otservbr-global/scripts/quests/grave_danger/actions_bosses_killed.lua
deleted file mode 100644
index 8b1ed5b2c89..00000000000
--- a/data-otservbr-global/scripts/quests/grave_danger/actions_bosses_killed.lua
+++ /dev/null
@@ -1,33 +0,0 @@
-local bosses = {
- ["sir baeloc"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictrosKilled },
- ["count vlarkorth"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorthKilled },
- ["duke krule"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKruleKilled },
- ["earl osam"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsamKilled },
- ["lord azaram"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaramKilled },
- ["king zelos"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelosKilled },
-}
-
-local bossesGraveDanger = CreatureEvent("GraveDangerBossDeath")
-function bossesGraveDanger.onDeath(creature)
- local bossConfig = bosses[creature:getName():lower()]
- if not bossConfig then
- return true
- end
- onDeathForDamagingPlayers(creature, function(creature, player)
- if bossConfig.storage then
- player:setStorageValue(bossConfig.storage, 1)
- end
- local bossesKilled = 0
- for value in pairs(bosses) do
- if player:getStorageValue(bosses[value].storage) > 0 then
- bossesKilled = bossesKilled + 1
- end
- end
- if bossesKilled >= 5 then -- number of mini bosses
- player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Bosses.KingZelosDoor, 1)
- end
- end)
- return true
-end
-
-bossesGraveDanger:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger/creaturescripts_sirs.lua b/data-otservbr-global/scripts/quests/grave_danger/creaturescripts_sirs.lua
deleted file mode 100644
index 539fe5a979f..00000000000
--- a/data-otservbr-global/scripts/quests/grave_danger/creaturescripts_sirs.lua
+++ /dev/null
@@ -1,29 +0,0 @@
-local sirNictrosThink = CreatureEvent("SirNictrosThink")
-function sirNictrosThink.onThink(creature)
- local maxhealth = creature:getMaxHealth()
- if maxhealth * 0.65 > creature:getHealth() then
- creature:say("Now it's your chance for entertainment, dear brother!", TALKTYPE_MONSTER_SAY)
- creature:teleportTo(Position({ x = 33427, y = 31428, z = 13 }))
- local boss = Tile(Position({ x = 33422, y = 31428, z = 13 })):getTopCreature()
- if boss and boss:isMonster() then
- boss:teleportTo(Position({ x = 33423, y = 31437, z = 13 }))
- end
- creature:unregisterEvent("SirNictrosThink")
- end
- return true
-end
-
-sirNictrosThink:register()
-
-local sirBaelocThink = CreatureEvent("SirBaelocThink")
-function sirBaelocThink.onThink(creature)
- local maxhealth = creature:getMaxHealth()
- if maxhealth * 0.65 > creature:getHealth() then
- creature:say("Join me in battle, my brother. Let's share the fun!", TALKTYPE_MONSTER_SAY)
- Tile(Position({ x = 33427, y = 31428, z = 13 })):getTopCreature():teleportTo(Position({ x = 33424, y = 31437, z = 13 }))
- creature:unregisterEvent("SirBaelocThink")
- end
- return true
-end
-
-sirBaelocThink:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger/creaturescripts_zelosDeath.lua b/data-otservbr-global/scripts/quests/grave_danger/creaturescripts_zelosDeath.lua
deleted file mode 100644
index ce65f46c9ef..00000000000
--- a/data-otservbr-global/scripts/quests/grave_danger/creaturescripts_zelosDeath.lua
+++ /dev/null
@@ -1,26 +0,0 @@
-local config = {
- centerPosition = Position(33443, 31545, 13),
- rangeX = 11,
- rangeY = 11,
-}
-
-local KingzelosDeath = CreatureEvent("zelosDeath")
-
-function KingzelosDeath.onPrepareDeath(creature)
- local spectators = Game.getSpectators(config.centerPosition, false, false, config.rangeX, config.rangeX, config.rangeY, config.rangeY)
- for _, specCreature in pairs(spectators) do
- if specCreature:isPlayer() then
- if specCreature:getStorageValue(Storage.Quest.U12_20.GraveDanger.Bosses.InquisitionOutfitReceived) == -1 then
- specCreature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations you received the Hand of the Inquisition Outfit.")
- specCreature:addOutfit(1244, 0)
- specCreature:addOutfit(1243, 0)
- specCreature:setStorageValue(Storage.Quest.U12_20.GraveDanger.Bosses.InquisitionOutfitReceived, 1)
- end
- specCreature:addAchievement("Inquisition's Hand")
- end
- end
-
- return true
-end
-
-KingzelosDeath:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_custodian.lua b/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_custodian.lua
deleted file mode 100644
index c21f58bb90e..00000000000
--- a/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_custodian.lua
+++ /dev/null
@@ -1,16 +0,0 @@
-local config = {
- monsterName = "Custodian",
- bossPosition = Position(33376, 32825, 8),
- centerPosition = Position(33376, 32825, 8),
- rangeX = 50,
- rangeY = 50,
-}
-
-local miniBoss = GlobalEvent("custodian")
-function miniBoss.onThink(interval, lastExecution)
- checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName, config.bossPosition)
- return true
-end
-
-miniBoss:interval(15 * 60 * 1000)
-miniBoss:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_gaffir.lua b/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_gaffir.lua
deleted file mode 100644
index c6f814cbc04..00000000000
--- a/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_gaffir.lua
+++ /dev/null
@@ -1,16 +0,0 @@
-local config = {
- monsterName = "Gaffir",
- bossPosition = Position(33394, 32674, 4),
- centerPosition = Position(33394, 32674, 4),
- rangeX = 50,
- rangeY = 50,
-}
-
-local miniBoss = GlobalEvent("gaffir")
-function miniBoss.onThink(interval, lastExecution)
- checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName, config.bossPosition)
- return true
-end
-
-miniBoss:interval(15 * 60 * 1000)
-miniBoss:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_quaid.lua b/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_quaid.lua
deleted file mode 100644
index 3aeded3beee..00000000000
--- a/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_quaid.lua
+++ /dev/null
@@ -1,16 +0,0 @@
-local config = {
- monsterName = "Guard Captain Quaid",
- bossPosition = Position(33392, 32660, 3),
- centerPosition = Position(33392, 32660, 3),
- rangeX = 50,
- rangeY = 50,
-}
-
-local miniBoss = GlobalEvent("guard captain quaid")
-function miniBoss.onThink(interval, lastExecution)
- checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName, config.bossPosition)
- return true
-end
-
-miniBoss:interval(15 * 60 * 1000)
-miniBoss:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger/movements_firewall_gaffir.lua b/data-otservbr-global/scripts/quests/grave_danger/movements_firewall_gaffir.lua
deleted file mode 100644
index c5b3902c1e0..00000000000
--- a/data-otservbr-global/scripts/quests/grave_danger/movements_firewall_gaffir.lua
+++ /dev/null
@@ -1,47 +0,0 @@
-local above = { [32021] = 5062 }
-local outside = { [5062] = 32021 }
-
--- onStepIn
-local gaffirwall = MoveEvent()
-
-function gaffirwall.onStepIn(creature, item, position, fromPosition)
- if not above[item.itemid] then
- return true
- end
-
- local player = creature:getPlayer()
- if not player or player:isInGhostMode() then
- return true
- end
- item:transform(above[item.itemid])
-end
-
-gaffirwall:type("stepin")
-
-for index, value in pairs(above) do
- gaffirwall:id(index)
-end
-gaffirwall:register()
-
-gaffirwall = MoveEvent()
-
-function gaffirwall.onStepOut(creature, item, position, fromPosition)
- if not outside[item.itemid] then
- return false
- end
-
- local player = creature:getPlayer()
- if not player or player:isInGhostMode() then
- return true
- end
-
- item:transform(outside[item.itemid])
- player:setSpecialContainersAvailable(false, false)
- return true
-end
-
-gaffirwall:type("stepout")
-for index, value in pairs(outside) do
- gaffirwall:id(index)
-end
-gaffirwall:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger/movements_teleport_king_zelos.lua b/data-otservbr-global/scripts/quests/grave_danger/movements_teleport_king_zelos.lua
deleted file mode 100644
index e5742bdddfb..00000000000
--- a/data-otservbr-global/scripts/quests/grave_danger/movements_teleport_king_zelos.lua
+++ /dev/null
@@ -1,14 +0,0 @@
-local Teleport = MoveEvent()
-
-function Teleport.onStepIn(creature, item, position, fromPosition)
- local player = creature:getPlayer()
- if not player then
- return true
- end
- player:teleportTo(Position(33492, 31546, 13))
- player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
- return true
-end
-
-Teleport:position({ x = 32174, y = 31916, z = 8 })
-Teleport:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_azaram_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_azaram_fight.lua
new file mode 100644
index 00000000000..14e479f6fe3
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_azaram_fight.lua
@@ -0,0 +1,28 @@
+local config = {
+ boss = {
+ name = "Lord Azaram",
+ position = Position(33424, 31472, 13),
+ },
+ timeAfterKill = 30 * 60,
+ playerPositions = {
+ { pos = Position(33422, 31493, 13), teleport = Position(33424, 31478, 13) },
+ { pos = Position(33423, 31493, 13), teleport = Position(33424, 31478, 13) },
+ { pos = Position(33424, 31493, 13), teleport = Position(33424, 31478, 13) },
+ { pos = Position(33425, 31493, 13), teleport = Position(33424, 31478, 13) },
+ { pos = Position(33426, 31493, 13), teleport = Position(33424, 31478, 13) },
+ },
+ specPos = {
+ from = Position(33414, 31463, 13),
+ to = Position(33433, 31481, 13),
+ },
+ monsters = {
+ { name = "Condensed Sin", pos = Position(33426, 31471, 13) },
+ { name = "Condensed Sin", pos = Position(33422, 31471, 13) },
+ },
+ exit = Position(32190, 31819, 8),
+ exitTeleporter = Position(32192, 31819, 8),
+}
+
+local lever = BossLever(config)
+lever:aid(14561)
+lever:register()
diff --git a/data-otservbr-global/scripts/actions/bosses_levers/sir_baeloc_sir_nictros.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua
similarity index 56%
rename from data-otservbr-global/scripts/actions/bosses_levers/sir_baeloc_sir_nictros.lua
rename to data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua
index 30b5cff1409..b7e6bd0725c 100644
--- a/data-otservbr-global/scripts/actions/bosses_levers/sir_baeloc_sir_nictros.lua
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua
@@ -5,8 +5,8 @@ local config = {
boss = {
name = "Sir Nictros",
createFunction = function()
- local nictros = Game.createMonster("Sir Nictros", nictrosPosition, true, true):registerEvent("SirNictrosThink")
- local baeloc = Game.createMonster("Sir Baeloc", baelocPosition, true, true):registerEvent("SirBaelocThink")
+ local nictros = Game.createMonster("Sir Nictros", nictrosPosition, true, true)
+ local baeloc = Game.createMonster("Sir Baeloc", baelocPosition, true, true)
return nictros and baeloc
end,
},
@@ -24,12 +24,31 @@ local config = {
},
onUseExtra = function(player)
addEvent(function()
- local nictros = Tile(nictrosPosition):getTopCreature()
- if not nictros then
- return
+ local baeloc = Creature("Sir Baeloc")
+ local nictros = Creature("Sir Nictros")
+
+ if baeloc then
+ baeloc:say("Ah look my Brother! Challengers! After all this time finally a chance to prove our skills!")
+ addEvent(function()
+ local nictros = Creature("Sir Nictros")
+ if nictros then
+ nictros:say("Indeed! It has been a while! As the elder one I request the right of the first battle!")
+ end
+ end, 6 * 1000)
end
- nictros:teleportTo(Position(33427, 31436, 13))
- end, 5 * 1000)
+
+ addEvent(function()
+ local baeloc = Creature("Sir Baeloc")
+ local nictros = Creature("Sir Nictros")
+ if baeloc then
+ baeloc:say("Oh, man! You always get the fun!")
+ if nictros then
+ nictros:teleportTo(Position(33426, 31437, 13))
+ nictros:setMoveLocked(false)
+ end
+ end
+ end, 12 * 1000)
+ end, 4 * 1000)
end,
exit = Position(33290, 32474, 9),
}
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_custodian_door.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_custodian_door.lua
new file mode 100644
index 00000000000..79cf805dd56
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_custodian_door.lua
@@ -0,0 +1,21 @@
+local custodian_door = Action()
+
+function custodian_door.onUse(player, item, isHotkey)
+ if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.GaffirKilled) < 1 then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The power of Gaffir won't let you pass this door!")
+ return true
+ end
+
+ local pos = player:getPosition()
+
+ if pos.x == 33365 then
+ player:teleportTo(Position(pos.x + 2, pos.y, pos.z))
+ elseif pos.x == 33367 then
+ player:teleportTo(Position(pos.x - 2, pos.y, pos.z))
+ end
+
+ return true
+end
+
+custodian_door:aid(36569)
+custodian_door:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_dark_remains.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_dark_remains.lua
new file mode 100644
index 00000000000..2580a209fba
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_dark_remains.lua
@@ -0,0 +1,28 @@
+local voc_table = {
+ [31203] = { voc = 4 },
+ [31204] = { voc = 3 },
+ [31205] = { voc = 2 },
+ [31206] = { voc = 1 },
+}
+
+local dark_remains = Action()
+
+function dark_remains.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ local canUse = voc_table[item.itemid]
+
+ if target:isPlayer() or player:getVocation():getBase():getId() ~= canUse.voc then
+ return false
+ end
+
+ if target:getName():lower() == "count vlarkorth" then
+ item:remove(1)
+ target:setStorageValue(3, target:getStorageValue(3) - 1)
+ target:say("The magic shield of protection is weakened!")
+ toPosition:sendMagicEffect(CONST_ME_HOLYAREA)
+ end
+
+ return true
+end
+
+dark_remains:id(31203, 31204, 31205, 31206)
+dark_remains:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua
new file mode 100644
index 00000000000..283547db05e
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua
@@ -0,0 +1,107 @@
+local config = {
+ boss = {
+ name = "Duke Krule",
+ createFunction = function()
+ local boss = Game.createMonster("Duke Krule", Position(33456, 31473, 13), true, true)
+ boss:setStorageValue(1, os.time())
+ return boss
+ end,
+ },
+ requiredLevel = 250,
+ playerPositions = {
+ { pos = Position(33455, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
+ { pos = Position(33456, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
+ { pos = Position(33457, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
+ { pos = Position(33458, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
+ { pos = Position(33459, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT },
+ },
+ specPos = {
+ from = Position(33447, 31464, 13),
+ to = Position(33464, 31481, 13),
+ },
+ exit = Position(32347, 32167, 12),
+}
+
+local duke_water = Combat()
+duke_water:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)
+duke_water:setArea(createCombatArea(AREA_CIRCLE3X3))
+
+function onTargetTile(cid, pos)
+ local tile = Tile(pos)
+ local target = tile:getTopCreature()
+ if tile then
+ if target and target:isPlayer() and target:getOutfit().lookType == 49 then
+ doTargetCombatHealth(0, target, COMBAT_ICEDAMAGE, -1500, -2000)
+ end
+ end
+end
+
+duke_water:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")
+
+local duke_fire = Combat()
+duke_fire:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
+duke_fire:setArea(createCombatArea(AREA_CIRCLE3X3))
+
+function onTargetTile(cid, pos)
+ local tile = Tile(pos)
+ local target = tile:getTopCreature()
+ if tile then
+ if target and target:isPlayer() and target:getOutfit().lookType == 286 then
+ doTargetCombatHealth(0, target, COMBAT_FIREDAMAGE, -1500, -2000)
+ end
+ end
+end
+
+duke_fire:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")
+
+config.onUseExtra = function()
+ local config = {
+ centerRoom = Position(33456, 31472, 13),
+ x = 10,
+ y = 10,
+ transformCD = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.TransformCD,
+ }
+ local function hitArea(creature)
+ local player = Player(creature)
+
+ if player then
+ if player:getStorageValue(config.transformCD) <= os.time() then
+ if player:getOutfit().lookType == 49 then
+ local var = { type = 1, number = creature }
+ duke_fire:execute(player, var)
+ player:setStorageValue(config.transformCD, os.time() + 3)
+ addEvent(hitArea, 3 * 1000, creature)
+ elseif player:getOutfit().lookType == 286 then
+ local var = { type = 1, number = creature }
+ duke_water:execute(player, var)
+ player:setStorageValue(config.transformCD, os.time() + 3)
+ addEvent(hitArea, 3 * 1000, creature)
+ end
+ end
+ end
+
+ return true
+ end
+
+ local function transformPlayers(id)
+ local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y)
+ local form = { 49, 286 }
+ local boss = Creature("Duke Krule")
+
+ if boss and boss:getStorageValue(1) == id then
+ if #spectators > 0 then
+ for _, player in pairs(spectators) do
+ doSetCreatureOutfit(player, { lookType = form[math.random(#form)] }, 30 * 1000)
+ addEvent(hitArea, 3 * 1000, player:getId())
+ end
+ addEvent(transformPlayers, 36 * 1000, id)
+ end
+ end
+ return true
+ end
+ addEvent(transformPlayers, 30 * 1000, os.time())
+end
+
+local lever = BossLever(config)
+lever:position({ x = 33454, y = 31493, z = 13 })
+lever:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_earl_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_earl_fight.lua
new file mode 100644
index 00000000000..0d40c7d8593
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_earl_fight.lua
@@ -0,0 +1,24 @@
+local config = {
+ boss = {
+ name = "Earl Osam",
+ position = Position(33488, 31438, 13),
+ },
+ timeAfterKill = 30 * 60,
+ playerPositions = {
+ { pos = Position(33516, 31444, 13), teleport = Position(33489, 31441, 13) },
+ { pos = Position(33517, 31444, 13), teleport = Position(33489, 31441, 13) },
+ { pos = Position(33518, 31444, 13), teleport = Position(33489, 31441, 13) },
+ { pos = Position(33519, 31444, 13), teleport = Position(33489, 31441, 13) },
+ { pos = Position(33520, 31444, 13), teleport = Position(33489, 31441, 13) },
+ },
+ specPos = {
+ from = Position(33479, 31429, 13),
+ to = Position(33497, 31447, 13),
+ },
+ exit = Position(33261, 31985, 8),
+ exitTeleporter = Position(33263, 31985, 8),
+}
+
+local lever = BossLever(config)
+lever:aid(14558)
+lever:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_grave_sanctify.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_grave_sanctify.lua
new file mode 100644
index 00000000000..d0526ba9050
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_grave_sanctify.lua
@@ -0,0 +1,71 @@
+local config = {
+ [1] = {
+ pos = Position(32644, 32394, 8),
+ stor = Storage.Quest.U12_20.GraveDanger.Graves.DarkCathedral,
+ msg = "This grave now been sanctified and is safe!",
+ },
+ [2] = {
+ pos = Position(32542, 31846, 6),
+ stor = Storage.Quest.U12_20.GraveDanger.Graves.FemorHills,
+ msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here.",
+ },
+ [3] = {
+ pos = Position(33376, 32806, 8),
+ stor = Storage.Quest.U12_20.GraveDanger.Graves.Ankrahmun,
+ msg = "This grave now been sanctified and is safe!",
+ },
+ [4] = {
+ pos = Position(32959, 31534, 7),
+ stor = Storage.Quest.U12_20.GraveDanger.Graves.Vengoth,
+ msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here.",
+ },
+ [5] = {
+ pos = Position(32776, 31817, 8),
+ stor = Storage.Quest.U12_20.GraveDanger.Graves.Orclands,
+ msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here.",
+ },
+ [6] = {
+ pos = Position(32012, 31558, 7),
+ stor = Storage.Quest.U12_20.GraveDanger.Graves.IceIslands,
+ msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here.",
+ },
+ [7] = {
+ pos = Position(33813, 31624, 9),
+ stor = Storage.Quest.U12_20.GraveDanger.Graves.Kilmaresh,
+ msg = "This grave now been sanctified and is safe!",
+ },
+}
+
+local function getGrave(pos)
+ for i = 1, #config do
+ if pos == config[i].pos then
+ return i
+ end
+ end
+
+ return true
+end
+
+local grave_sanctify = Action()
+
+function grave_sanctify.onUse(player, item, fromPosition, itemEx, toPosition)
+ local thing = config[getGrave(itemEx:getPosition())]
+
+ if not thing then
+ return true
+ end
+
+ if player:getStorageValue(thing.stor) < 1 then
+ player:setStorageValue(thing.stor, 1)
+ itemEx:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, thing.msg)
+ player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress, player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress) + 1)
+ else
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, thing.msg)
+ end
+
+ return true
+end
+
+grave_sanctify:id(31612)
+grave_sanctify:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_king_zelos.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_king_zelos.lua
new file mode 100644
index 00000000000..f1c571de7f8
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_king_zelos.lua
@@ -0,0 +1,79 @@
+local config = {
+ centerRoom = Position(33443, 31545, 13),
+ newPosition = Position(33436, 31572, 13),
+ exitPos = Position(32172, 31917, 8),
+ x = 30,
+ y = 30,
+ summons = {
+ {
+ name = "Rewar The Bloody",
+ pos = Position(33463, 31562, 13),
+ },
+ {
+ name = "The Red Knight",
+ pos = Position(33423, 31562, 13),
+ },
+ {
+ name = "Magnor Mournbringer",
+ pos = Position(33463, 31529, 13),
+ },
+ {
+ name = "Nargol the Impaler",
+ pos = Position(33423, 31529, 13),
+ },
+ {
+ name = "King Zelos",
+ pos = Position(33443, 31545, 13),
+ },
+ },
+ timer = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Timer,
+ room = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Room,
+ fromPos = Position(33414, 31520, 13),
+ toPos = Position(33474, 31574, 13),
+}
+
+local king_zelos = Action()
+
+function king_zelos.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player:doCheckBossRoom("King Zelos", config.fromPos, config.toPos) then
+ player:sendCancelMessage("The room is already in use. Please wait.")
+ return true
+ end
+
+ local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y)
+
+ if player:getPosition() ~= Position(33485, 31546, 13) then
+ player:sendCancelMessage("Sorry, not possible.")
+ return true
+ end
+
+ if #spectators > 0 then
+ player:say("The room is occupied by another team, please wait.", TALKTYPE_MONSTER_SAY, false, player)
+ return true
+ end
+
+ for _, boss in pairs(config.summons) do
+ Game.createMonster(boss.name, boss.pos, false, true)
+ end
+
+ for x = 33485, 33486 do
+ for y = 31544, 31548 do
+ local playerTile = Tile(Position(x, y, 13)):getTopCreature()
+ if playerTile and playerTile:isPlayer() then
+ playerTile:getPosition():sendMagicEffect(CONST_ME_POFF)
+ playerTile:teleportTo(config.newPosition)
+ playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
+ playerTile:setStorageValue(config.timer, os.time() + 20 * 3600)
+ playerTile:setStorageValue(config.room, os.time() + 24 * 60)
+ playerTile:say("You have 24 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", TALKTYPE_MONSTER_SAY, false, playerTile)
+ end
+ end
+ end
+
+ addEvent(clearForgotten, 24 * 60 * 1000, config.centerRoom, config.x, config.y, config.exitPos, config.room)
+
+ return true
+end
+
+king_zelos:aid(14568)
+king_zelos:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_vlarkorth_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_vlarkorth_fight.lua
new file mode 100644
index 00000000000..86711ac8382
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_vlarkorth_fight.lua
@@ -0,0 +1,24 @@
+local config = {
+ boss = {
+ name = "Count Vlarkorth",
+ position = Position(33456, 31437, 13),
+ },
+ timeAfterKill = 30 * 60,
+ playerPositions = {
+ { pos = Position(33455, 31413, 13), teleport = Position(33457, 31442, 13) },
+ { pos = Position(33456, 31413, 13), teleport = Position(33457, 31442, 13) },
+ { pos = Position(33457, 31413, 13), teleport = Position(33457, 31442, 13) },
+ { pos = Position(33458, 31413, 13), teleport = Position(33457, 31442, 13) },
+ { pos = Position(33459, 31413, 13), teleport = Position(33457, 31442, 13) },
+ },
+ specPos = {
+ from = Position(33451, 31432, 13),
+ to = Position(33461, 31442, 13),
+ },
+ exit = Position(33195, 31696, 8),
+ exitTeleporter = Position(33456, 31446, 13),
+}
+
+local lever = BossLever(config)
+lever:aid(14557)
+lever:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/actions_scarlett.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/actions_scarlett.lua
similarity index 86%
rename from data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/actions_scarlett.lua
rename to data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/actions_scarlett.lua
index 8a25b60c3d1..94c1c333a53 100644
--- a/data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/actions_scarlett.lua
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/actions_scarlett.lua
@@ -14,7 +14,7 @@ local config = {
name = "Scarlett Etzel",
createFunction = function()
local scarlett = Game.createMonster("Scarlett Etzel", Position(33396, 32643, 6), true, true)
- scarlett:setStorageValue(Storage.GraveDanger.CobraBastion.Questline, 1)
+ scarlett:setStorageValue(Storage.Quest.U12_20.GraveDanger.CobraBastion.Questline, 1)
return scarlett
end,
},
@@ -56,6 +56,7 @@ local function backMirror()
for x = mirror.fromPos.x, mirror.toPos.x do
for y = mirror.fromPos.y, mirror.toPos.y do
local sqm = Tile(Position(x, y, 6))
+
if sqm then
for _, id in pairs(mirror.mirrors) do
local item = sqm:getItemById(id)
@@ -70,7 +71,13 @@ local function backMirror()
end
local graveScarlettAid = Action()
+
function graveScarlettAid.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.GaffirKilled) ~= 1 and player:getStorageValue(Storage.Quest.U12_20.GraveDanger.CustodianKilled) ~= 1 and player:getStorageValue(Storage.Quest.U12_20.GraveDanger.QuaidKilled) ~= 1 then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are not allowed to use this yet.")
+ return true
+ end
+
if table.contains(transformTo, item.itemid) then
local pilar = transformTo[item.itemid]
if pilar then
@@ -94,6 +101,7 @@ function graveScarlettAid.onUse(player, item, fromPosition, target, toPosition,
player:teleportTo(Position(33395, 32666, 6))
end
end
+
return true
end
diff --git a/data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/creaturescripts_scarlett.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/creaturescripts_scarlett.lua
similarity index 98%
rename from data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/creaturescripts_scarlett.lua
rename to data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/creaturescripts_scarlett.lua
index f68cdfc155d..cd5d4e8ef3e 100644
--- a/data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/creaturescripts_scarlett.lua
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/creaturescripts_scarlett.lua
@@ -20,7 +20,7 @@ end
combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
-local storage = Storage.GraveDanger.CobraBastion.Questline
+local storage = Storage.Quest.U12_20.GraveDanger.CobraBastion.Questline
local rooms = {
[1] = { fromPos = Position(33390, 32642, 6), toPos = Position(33394, 32646, 6) },
[2] = { fromPos = Position(33390, 32646, 6), toPos = Position(33394, 32650, 6) },
diff --git a/data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/creaturescripts_ugly_monster.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/creaturescripts_ugly_monster.lua
similarity index 100%
rename from data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/creaturescripts_ugly_monster.lua
rename to data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/creaturescripts_ugly_monster.lua
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_baeloc_nictros_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_baeloc_nictros_fight.lua
new file mode 100644
index 00000000000..2bebddca492
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_baeloc_nictros_fight.lua
@@ -0,0 +1,119 @@
+local config = {
+ centerRoom = Position(33424, 31439, 13),
+ newPosition = Position(33425, 31431, 13),
+ exitPos = Position(33290, 32474, 9),
+ x = 12,
+ y = 12,
+ baelocPos = Position(33422, 31428, 13),
+ nictrosPos = Position(33427, 31428, 13),
+ timer = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Timer,
+ room = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Room,
+ fromPos = Position(33418, 31434, 13),
+ toPos = Position(33431, 31445, 13),
+}
+
+local brothers_summon = CreatureEvent("brothers_summon")
+
+function brothers_summon.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
+ local chance = math.random(1, 100)
+ local position = Position(math.random(config.fromPos.x, config.toPos.x), math.random(config.fromPos.y, config.toPos.y), config.fromPos.z)
+ local tile = Tile(position)
+
+ if chance >= 90 then
+ if tile:isWalkable(false, false, false, true, false) then
+ local summon = creature:getName():lower() == "sir nictros" and "Squire Of Nictros" or "Retainer Of Baeloc"
+ Game.createMonster(summon, position, false, true)
+ end
+ end
+
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+end
+
+brothers_summon:register()
+
+local sir_nictros_health = CreatureEvent("sir_nictros_health")
+
+function sir_nictros_health.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
+ local players = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y)
+ for _, player in pairs(players) do
+ if player:isPlayer() then
+ if player:getStorageValue(config.timer) < os.time() then
+ player:setStorageValue(config.timer, os.time() + 20 * 3600)
+ end
+ if player:getStorageValue(config.room) < os.time() then
+ player:setStorageValue(config.room, os.time() + 30 * 60)
+ end
+ end
+ end
+
+ if primaryType == COMBAT_HEALING then
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+ end
+
+ local health = creature:getMaxHealth() * 0.60
+ local brother_diff = (creature:getHealth() / creature:getMaxHealth()) * 100
+ local brother = Creature("Sir Baeloc")
+
+ if brother then
+ if brother_diff < 55 then
+ local brother_percent = (brother:getHealth() / brother:getMaxHealth()) * 100
+ if (brother_percent - brother_diff) > 5 then
+ creature:addHealth(28000)
+ end
+ end
+ end
+
+ creature:setStorageValue(1, creature:getStorageValue(1) + primaryDamage + secondaryDamage)
+ if creature:getStorageValue(2) < 1 and creature:getStorageValue(1) >= health then
+ creature:setStorageValue(2, 1)
+ creature:say("Now it's your chance for entertaiment, dear brother!")
+ creature:teleportTo(config.nictrosPos)
+ creature:setMoveLocked(true)
+ local baeloc = Creature("Sir Baeloc")
+ if baeloc then
+ baeloc:teleportTo(Position(33424, 31436, 13))
+ baeloc:setMoveLocked(false)
+ end
+ end
+
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+end
+
+sir_nictros_health:register()
+
+local sir_baeloc_health = CreatureEvent("sir_baeloc_health")
+
+function sir_baeloc_health.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
+ if primaryType == COMBAT_HEALING then
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+ end
+
+ local health = creature:getMaxHealth() * 0.60
+ local brother_diff = (creature:getHealth() / creature:getMaxHealth()) * 100
+ local brother = Creature("Sir Nictros")
+
+ if brother then
+ if brother_diff < 55 then
+ local brother_percent = (brother:getHealth() / brother:getMaxHealth()) * 100
+ if (brother_percent - brother_diff) > 5 then
+ creature:addHealth(28000)
+ end
+ end
+ end
+
+ creature:setStorageValue(1, creature:getStorageValue(1) + primaryDamage + secondaryDamage)
+
+ if creature:getStorageValue(2) < 1 and creature:getStorageValue(1) >= health then
+ creature:setStorageValue(2, 1)
+ creature:say("Join me in battle my brother. Let's share the fun!")
+ local nictros = Creature("Sir Nictros")
+ if nictros then
+ nictros:teleportTo(Position(33426, 31438, 13))
+ nictros:setMoveLocked(false)
+ end
+ end
+
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+end
+
+sir_baeloc_health:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_boss_kill.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_boss_kill.lua
new file mode 100644
index 00000000000..f6bf30d50a8
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_boss_kill.lua
@@ -0,0 +1,84 @@
+local config = {
+ ["gaffir"] = {
+ stor = Storage.Quest.U12_20.GraveDanger.GaffirKilled,
+ },
+ ["custodian"] = {
+ stor = Storage.Quest.U12_20.GraveDanger.CustodianKilled,
+ },
+ ["guard captain quaid"] = {
+ stor = Storage.Quest.U12_20.GraveDanger.QuaidKilled,
+ },
+ ["scarlett etzel"] = {
+ stor = Storage.Quest.U12_20.GraveDanger.ScarlettKilled,
+ },
+ ["earl osam"] = {
+ stor = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsam.Killed,
+ extra = {
+ stor = Storage.Quest.U12_20.GraveDanger.Graves.Cormaya,
+ value = 1,
+ },
+ },
+ ["count vlarkorth"] = {
+ stor = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Killed,
+ extra = {
+ stor = Storage.Quest.U12_20.GraveDanger.Graves.Edron,
+ value = 1,
+ },
+ },
+ ["sir baeloc"] = {
+ stor = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Killed,
+ extra = {
+ stor = Storage.Quest.U12_20.GraveDanger.Graves.Darashia,
+ value = 1,
+ },
+ },
+ ["duke krule"] = {
+ stor = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.Killed,
+ extra = {
+ stor = Storage.Quest.U12_20.GraveDanger.Graves.Thais,
+ value = 1,
+ },
+ },
+ ["lord azaram"] = {
+ stor = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaram.Killed,
+ extra = {
+ stor = Storage.Quest.U12_20.GraveDanger.Graves.Ghostlands,
+ value = 1,
+ },
+ },
+ ["king zelos"] = {
+ stor = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Killed,
+ },
+}
+
+local grave_danger_death = CreatureEvent("grave_danger_death")
+
+function grave_danger_death.onDeath(creature, corpse, killer, mostDamageKiller)
+ local bossConfig = config[creature:getName():lower()]
+
+ if not bossConfig then
+ return true
+ end
+
+ local attackers = creature:getDamageMap()
+ for attackerId, _ in pairs(attackers) do
+ local player = Player(attackerId)
+ if player and player:getStorageValue(bossConfig.stor) < 1 then
+ player:setStorageValue(bossConfig.stor, 1)
+
+ if creature:getName():lower() == "scarlett etzel" then
+ player:addAchievement("A Study in Scarlett")
+ end
+
+ if bossConfig.extra then
+ player:setStorageValue(bossConfig.extra.stor, bossConfig.extra.value)
+ local graves = player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress)
+ player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress, graves + 1)
+ end
+ end
+ end
+
+ return true
+end
+
+grave_danger_death:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_count_vlarkorth_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_count_vlarkorth_fight.lua
new file mode 100644
index 00000000000..d6f15d08cb0
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_count_vlarkorth_fight.lua
@@ -0,0 +1,91 @@
+local config = {
+ centerRoom = Position(33456, 31437, 13),
+ newPosition = Position(33457, 31442, 13),
+ exitPos = Position(33195, 31696, 8),
+ x = 10,
+ y = 10,
+ summons = {
+ [1] = { summon = "Dark Sorcerer" },
+ [2] = { summon = "Dark Druid" },
+ [3] = { summon = "Dark Paladin" },
+ [4] = { summon = "Dark Knight" },
+ },
+ timer = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Timer,
+ room = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Room,
+}
+
+local function summonDarks()
+ local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y)
+ local boss = Creature("Count Vlarkorth")
+ if not boss then
+ return false
+ end
+
+ if #spectators > 0 then
+ for _, player in pairs(spectators) do
+ local vocationId = player:getVocation():getBase():getId()
+ local toSummon = config.summons[vocationId]
+ if toSummon then
+ local newPosition = boss:getClosestFreePosition(boss:getPosition(), true)
+ if newPosition then
+ local dark = Game.createMonster(toSummon.summon, newPosition, false, true)
+ if dark then
+ local summonCount = boss:getStorageValue(3)
+ boss:setStorageValue(3, math.max(0, summonCount) + 1)
+ end
+ end
+ end
+ end
+ boss:say("Face your own darkness!")
+ end
+
+ return true
+end
+
+local count_vlarkorth_transform = CreatureEvent("count_vlarkorth_transform")
+
+function count_vlarkorth_transform.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
+ local players = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y)
+ for _, player in pairs(players) do
+ if player:isPlayer() then
+ if player:getStorageValue(config.timer) < os.time() then
+ player:setStorageValue(config.timer, os.time() + 20 * 3600)
+ end
+ if player:getStorageValue(config.room) < os.time() then
+ player:setStorageValue(config.room, os.time() + 30 * 60)
+ end
+ end
+ end
+
+ if primaryType == COMBAT_HEALING then
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+ end
+
+ if not creature then
+ return primaryDamage, primaryType, secondaryDamage, secondaryType
+ end
+
+ local health = creature:getMaxHealth() * 0.15
+ local damageStorage = creature:getStorageValue(1)
+ if damageStorage < 0 then
+ creature:setStorageValue(1, 0)
+ damageStorage = 0
+ end
+
+ if creature:getStorageValue(3) > 0 then
+ creature:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
+ return primaryDamage, primaryType, secondaryDamage, secondaryType
+ end
+
+ creature:setStorageValue(1, damageStorage + primaryDamage + secondaryDamage)
+
+ if creature:getStorageValue(1) >= health then
+ creature:setStorageValue(1, 0)
+ creature:setStorageValue(3, 0)
+ summonDarks()
+ end
+
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+end
+
+count_vlarkorth_transform:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_earl_osam_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_earl_osam_fight.lua
new file mode 100644
index 00000000000..dee6479531c
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_earl_osam_fight.lua
@@ -0,0 +1,163 @@
+local config = {
+ centerRoom = Position(33488, 31438, 13),
+ newPosition = Position(33489, 31441, 13),
+ exitPos = Position(33261, 31985, 8),
+ x = 10,
+ y = 10,
+ timer = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsam.Timer,
+ room = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsam.Room,
+ fromPos = Position(33479, 31429, 13),
+ toPos = Position(33497, 31447, 13),
+ spheres = {
+ Position(33480, 31438, 13),
+ Position(33488, 31430, 13),
+ Position(33496, 31438, 13),
+ Position(33488, 31446, 13),
+ },
+}
+
+local function moveSphere()
+ local spectators = Game.getSpectators(config.centerRoom, false, false, config.x, config.x, config.y, config.y)
+ local nextPos = nil
+ local boss = Creature("Earl Osam")
+
+ if boss and boss:getStorageValue(3) > 0 then
+ for _, spheres in pairs(spectators) do
+ if spheres:isMonster() and spheres:getName():lower() == "magical sphere" then
+ local pos = spheres:getPosition()
+
+ if pos.y == 31438 then
+ if pos.x > 33488 then
+ nextPos = Position(pos.x - 1, pos.y, pos.z)
+ elseif pos.x < 33488 then
+ nextPos = Position(pos.x + 1, pos.y, pos.z)
+ end
+ elseif pos.x == 33488 then
+ if pos.y > 31438 then
+ nextPos = Position(pos.x, pos.y - 1, pos.z)
+ elseif pos.y < 31438 then
+ nextPos = Position(pos.x, pos.y + 1, pos.z)
+ end
+ end
+
+ if nextPos then
+ local nextTile = Tile(nextPos)
+ if nextTile then
+ local nextCreature = nextTile:getTopCreature()
+ if nextCreature then
+ if nextPos == config.centerRoom and nextCreature:getName():lower() == "earl osam" then
+ spheres:remove()
+ nextCreature:addHealth(80000)
+ nextCreature:setStorageValue(3, nextCreature:getStorageValue(3) - 1)
+ if nextCreature:isMoveLocked() then
+ nextCreature:setMoveLocked(false)
+ end
+ else
+ spheres:remove()
+ end
+ else
+ spheres:teleportTo(nextPos)
+ end
+ end
+ end
+ end
+ end
+
+ if boss:getHealth() > 0 then
+ addEvent(moveSphere, 4 * 1000)
+ end
+ end
+
+ return true
+end
+
+local function initMech()
+ local boss = Creature("Earl Osam")
+ if boss then
+ local topCenter = Tile(config.centerRoom):getTopCreature()
+ if topCenter and topCenter ~= boss then
+ topCenter:teleportTo(Position(config.centerRoom.x, config.centerRoom.y + 2, config.centerRoom.z))
+ end
+
+ boss:teleportTo(config.centerRoom)
+ boss:setMoveLocked(true)
+
+ for _, sphereSpot in pairs(config.spheres) do
+ local sphere = Game.createMonster("Magical Sphere", sphereSpot, false, true)
+ if sphere then
+ boss:setStorageValue(3, math.max(0, boss:getStorageValue(3)) + 1)
+ end
+ end
+
+ addEvent(moveSphere, 4 * 1000)
+ end
+
+ return true
+end
+
+local earl_osam_transform = CreatureEvent("earl_osam_transform")
+
+function earl_osam_transform.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
+ local players = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y)
+ for _, player in pairs(players) do
+ if player:isPlayer() then
+ if player:getStorageValue(config.timer) < os.time() then
+ player:setStorageValue(config.timer, os.time() + 20 * 3600)
+ end
+ if player:getStorageValue(config.room) < os.time() then
+ player:setStorageValue(config.room, os.time() + 30 * 60)
+ end
+ end
+ end
+
+ if primaryType == COMBAT_HEALING then
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+ end
+
+ local chance = math.random(1, 100)
+ local position = Position(math.random(config.fromPos.x, config.toPos.x), math.random(config.fromPos.y, config.toPos.y), config.fromPos.z)
+ local tile = Tile(position)
+
+ if chance >= 95 and tile and tile:isWalkable() then
+ Game.createMonster("Frozen Soul", position)
+ end
+
+ local healthThreshold = creature:getMaxHealth() * 0.15
+ local currentDamage = creature:getStorageValue(1)
+ if currentDamage < 0 then
+ creature:setStorageValue(1, 0)
+ end
+
+ if creature:getStorageValue(3) > 0 then
+ creature:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
+ return primaryDamage, primaryType, secondaryDamage, secondaryType
+ end
+
+ creature:setStorageValue(1, currentDamage + primaryDamage + secondaryDamage)
+
+ if creature:getStorageValue(1) >= healthThreshold then
+ creature:setStorageValue(1, 0)
+ creature:setStorageValue(3, 0)
+ initMech()
+ end
+
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+end
+
+earl_osam_transform:register()
+
+local sphere_death = CreatureEvent("sphere_death")
+
+function sphere_death.onDeath(creature)
+ local boss = Creature("Earl Osam")
+ if boss then
+ local currentSphereCount = boss:getStorageValue(3)
+ boss:setStorageValue(3, math.max(0, currentSphereCount - 1))
+ if boss:getStorageValue(3) <= 0 and boss:isMoveLocked() then
+ boss:setMoveLocked(false)
+ end
+ end
+ return true
+end
+
+sphere_death:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_king_zelos_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_king_zelos_fight.lua
new file mode 100644
index 00000000000..40e9bce49be
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_king_zelos_fight.lua
@@ -0,0 +1,263 @@
+local config = {
+ centerRoom = Position(33443, 31545, 13),
+ newPosition = Position(33436, 31572, 13),
+ exitPos = Position(32172, 31917, 8),
+ x = 30,
+ y = 30,
+ summons = {
+ {
+ name = "Rewar The Bloody",
+ pos = Position(33463, 31562, 13),
+ },
+ {
+ name = "The Red Knight",
+ pos = Position(33423, 31562, 13),
+ },
+ {
+ name = "Magnor Mournbringer",
+ pos = Position(33463, 31529, 13),
+ },
+ {
+ name = "Nargol the Impaler",
+ pos = Position(33423, 31529, 13),
+ },
+ {
+ name = "King Zelos",
+ pos = Position(33443, 31545, 13),
+ },
+ },
+ timer = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Timer,
+ room = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Room,
+ fromPos = Position(33414, 31520, 13),
+ toPos = Position(33474, 31574, 13),
+}
+
+local zelos_damage = CreatureEvent("zelos_damage")
+
+function zelos_damage.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
+ if primaryType ~= COMBAT_HEALING then
+ local storage = creature:getStorageValue(1)
+
+ if storage < 800 then
+ primaryDamage = (primaryDamage + secondaryDamage) - ((primaryDamage + secondaryDamage) * (storage / 800))
+ secondaryDamage = 0
+ else
+ primaryDamage = (primaryDamage + secondaryDamage) - ((primaryDamage + secondaryDamage) * 0.99)
+ secondaryDamage = 0
+ end
+ end
+
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+end
+
+zelos_damage:register()
+
+local zelos_init = CreatureEvent("zelos_init")
+
+function zelos_init.onDeath(creature)
+ local targetMonster = creature:getMonster()
+
+ if not targetMonster or targetMonster:getMaster() then
+ return true
+ end
+
+ local knights = { "Nargol The Impaler", "Magnor Mournbringer", "The Red Knight", "Rewar The Bloody", "Shard Of Magnor", "Regenerating Mass" }
+
+ for _, knight in pairs(knights) do
+ local boss = Creature(knight)
+ if boss and boss:getId() ~= creature:getId() then
+ return true
+ end
+ end
+
+ local zelos = Creature("King Zelos")
+
+ if zelos then
+ local eq = os.time() - zelos:getStorageValue(1)
+
+ zelos:setStorageValue(1, eq)
+ end
+
+ return true
+end
+
+zelos_init:register()
+
+local blood_explode = Combat()
+local area = createCombatArea(AREA_SQUARE1X1)
+blood_explode:setArea(area)
+
+function onTargetTile(cid, pos)
+ local tile = Tile(pos)
+ local target = tile:getTopCreature()
+ if tile then
+ if target and target:getId() ~= cid:getId() then
+ if target:isMonster() and target:getName():lower() == "the red knight" or target:isPlayer() then
+ doTargetCombatHealth(0, target, COMBAT_DROWNDAMAGE, -20000, -25000)
+ end
+ end
+ end
+end
+
+blood_explode:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")
+
+local blood_death = CreatureEvent("blood_death")
+
+function blood_death.onDeath(creature)
+ local targetMonster = creature:getMonster()
+
+ if not targetMonster or targetMonster:getMaster() then
+ return true
+ end
+
+ local var = { type = 1, number = creature:getId() }
+
+ blood_explode:execute(creature, var)
+
+ return true
+end
+
+blood_death:register()
+
+local nargol_death = CreatureEvent("nargol_death")
+
+function nargol_death.onDeath(creature)
+ local targetMonster = creature:getMonster()
+
+ if not targetMonster or targetMonster:getMaster() then
+ return true
+ end
+
+ Game.createMonster("Regenerating Mass", Position(33423, 31529, 13), false, true)
+
+ addEvent(function()
+ local mass = Creature("Regenerating Mass")
+ if mass then
+ mass:remove()
+ Game.createMonster("Nargol The Impaler", Position(33423, 31529, 13), false, true)
+ end
+ end, 30 * 1000)
+
+ return true
+end
+
+nargol_death:register()
+
+local shard_explode = Combat()
+shard_explode:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
+
+local area = createCombatArea(AREA_CIRCLE2X2)
+shard_explode:setArea(area)
+
+function onTargetTile(cid, pos)
+ local tile = Tile(pos)
+ local target = tile:getTopCreature()
+
+ if tile then
+ if target and target:isPlayer() then
+ doTargetCombatHealth(0, target, COMBAT_LIFEDRAIN, -2000, -2500)
+ end
+ end
+end
+
+shard_explode:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")
+
+local shard_death = CreatureEvent("shard_death")
+
+function shard_death.onDeath(creature)
+ local targetMonster = creature:getMonster()
+
+ if not targetMonster or targetMonster:getMaster() then
+ return true
+ end
+
+ local var = { type = 1, number = creature:getId() }
+
+ shard_explode:execute(creature, var)
+
+ return true
+end
+
+shard_death:register()
+
+local magnor_death = CreatureEvent("magnor_death")
+
+function magnor_death.onDeath(creature)
+ local targetMonster = creature:getMonster()
+
+ if not targetMonster or targetMonster:getMaster() then
+ return true
+ end
+
+ local id = os.time()
+
+ for i = 1, 4 do
+ local shards = Game.createMonster("Shard Of Magnor", creature:getClosestFreePosition(creature:getPosition(), true))
+ shards:beginSharedLife(id)
+ shards:registerEvent("SharedLife")
+ shards:registerEvent("shard_death")
+ end
+
+ return true
+end
+
+magnor_death:register()
+
+local fetter_death = CreatureEvent("fetter_death")
+
+function fetter_death.onDeath(creature)
+ local targetMonster = creature:getMonster()
+
+ if not targetMonster or targetMonster:getMaster() then
+ return true
+ end
+
+ local boss = Creature("Rewar The Bloody")
+
+ if boss then
+ boss:setStorageValue(2, boss:getStorageValue(2) - 1)
+
+ if boss:getStorageValue(2) <= 0 then
+ boss:setType("Rewar The Bloody")
+ end
+ end
+
+ return true
+end
+
+fetter_death:register()
+
+local rewar_the_bloody = CreatureEvent("rewar_the_bloody")
+
+rewar_the_bloody:type("healthchange")
+
+function rewar_the_bloody.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
+ if primaryType == COMBAT_HEALING then
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+ end
+
+ local health = creature:getMaxHealth() * 0.05
+
+ creature:setStorageValue(1, creature:getStorageValue(1) + primaryDamage + secondaryDamage)
+
+ if creature:getStorageValue(1) >= health then
+ creature:setStorageValue(1, 0)
+ creature:setStorageValue(2, 0)
+
+ local fetters = math.random(1, 3)
+ local fromPos, toPos = Position(33458, 31556, 13), Position(33467, 31566, 13)
+
+ for i = 1, fetters do
+ local position = Position(math.random(fromPos.x, toPos.x), math.random(fromPos.y, toPos.y), fromPos.z)
+ local fetter = Game.createMonster("Fetter", position, true, true)
+ if fetter then
+ creature:setStorageValue(2, creature:getStorageValue(2) + 1)
+ end
+ end
+ creature:setType("Rewar The Bloody Inv")
+ end
+
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+end
+
+rewar_the_bloody:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_lord_azaram_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_lord_azaram_fight.lua
new file mode 100644
index 00000000000..a06d0fa9702
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_lord_azaram_fight.lua
@@ -0,0 +1,133 @@
+local config = {
+ centerRoom = Position(33424, 31472, 13),
+ newPosition = Position(33424, 31478, 13),
+ exitPos = Position(32190, 31819, 8),
+ x = 10,
+ y = 10,
+ timer = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaram.Timer,
+ room = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaram.Room,
+ soulPos = Position(33426, 31471, 13),
+ bossPos = Position(33423, 31471, 13),
+ tainted = {
+ Position(33422, 31470, 13),
+ Position(33427, 31470, 13),
+ Position(33422, 31476, 13),
+ Position(33427, 31476, 13),
+ },
+ fromPos = Position(33414, 31463, 13),
+ toPos = Position(33433, 31481, 13),
+}
+
+local function removeTainted()
+ local spectators = Game.getSpectators(config.centerRoom, false, false, config.x, config.x, config.y, config.y)
+ for _, creature in pairs(spectators) do
+ if creature:isMonster() and creature:getName():lower() == "tainted soul splinter" then
+ creature:remove()
+ end
+ end
+ return true
+end
+
+local azaram_health = CreatureEvent("azaram_health")
+
+function azaram_health.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
+ local players = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y)
+ for _, player in pairs(players) do
+ if player:isPlayer() then
+ if player:getStorageValue(config.timer) < os.time() then
+ player:setStorageValue(config.timer, os.time() + 20 * 3600)
+ end
+ if player:getStorageValue(config.room) < os.time() then
+ player:setStorageValue(config.room, os.time() + 30 * 60)
+ end
+ end
+ end
+
+ if not creature then
+ return primaryDamage, primaryType, secondaryDamage, secondaryType
+ end
+ local health = creature:getMaxHealth() * 0.10
+ local damageStorage = creature:getStorageValue(1)
+ if damageStorage == -1 then
+ creature:setStorageValue(1, 0)
+ end
+
+ creature:setStorageValue(1, damageStorage + primaryDamage)
+ local stor = creature:getStorageValue(1)
+ if stor >= health then
+ local bossTile = Tile(config.bossPos)
+ if bossTile and bossTile:isWalkable() then
+ creature:teleportTo(config.bossPos)
+ end
+ creature:setStorageValue(1, 0)
+ local soul = Creature("Azaram's Soul")
+ if soul then
+ soul:teleportTo(config.centerRoom)
+ for _, pos in pairs(config.tainted) do
+ Game.createMonster("Tainted Soul Splinter", pos, true, true)
+ end
+ end
+ end
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+end
+
+azaram_health:register()
+
+local azaram_summon = CreatureEvent("azaram_summon")
+
+function azaram_summon.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
+ if not creature then
+ return primaryDamage, primaryType, secondaryDamage, secondaryType
+ end
+ local chance = math.random(1, 100)
+ if chance < 90 then
+ return primaryDamage, primaryType, secondaryDamage, secondaryType
+ end
+
+ local position = Position(math.random(config.fromPos.x, config.toPos.x), math.random(config.fromPos.y, config.toPos.y), config.fromPos.z)
+ local tile = Tile(position)
+ if tile and tile:isWalkable() then
+ local topThing = tile:getTopCreature()
+ if topThing then
+ local newPosition = topThing:getClosestFreePosition(topThing:getPosition(), true)
+ if newPosition then
+ Game.createMonster("Condensed Sin", newPosition, false, true)
+ end
+ else
+ Game.createMonster("Condensed Sin", position, false, true)
+ end
+ end
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+end
+
+azaram_summon:register()
+
+local soul_heal = CreatureEvent("soul_heal")
+
+function soul_heal.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
+ if not attacker or not attacker:isPlayer() then
+ return primaryDamage, primaryType, secondaryDamage, secondaryType
+ end
+ if primaryType == COMBAT_HEALING then
+ local health = (creature:getHealth() / creature:getMaxHealth()) * 100
+ local healStorage = creature:getStorageValue(2)
+ if healStorage == -1 then
+ creature:setStorageValue(2, 0)
+ end
+
+ if health < 100 and health >= healStorage * 15 then
+ creature:setStorageValue(2, healStorage + 1)
+ if config.soulPos:isWalkable() then
+ creature:teleportTo(config.soulPos)
+ end
+ removeTainted()
+ local boss = Creature("Lord Azaram")
+ if boss and config.centerRoom:isWalkable() then
+ boss:teleportTo(config.centerRoom)
+ end
+ end
+ end
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+end
+
+soul_heal:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_sir_baeloc_health.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_sir_baeloc_health.lua
new file mode 100644
index 00000000000..c7ab5345da2
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_sir_baeloc_health.lua
@@ -0,0 +1,38 @@
+local sir_baeloc_health = CreatureEvent("sir_baeloc_health")
+
+sir_baeloc_health:type("healthchange")
+
+function sir_baeloc_health.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
+ if primaryType == COMBAT_HEALING then
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+ end
+
+ local health = creature:getMaxHealth() * 0.60
+ local brother_diff = (creature:getHealth() / creature:getMaxHealth()) * 100
+ local brother = Creature("Sir Nictros")
+
+ if brother then
+ if brother_diff < 55 then
+ local brother_percent = (brother:getHealth() / brother:getMaxHealth()) * 100
+ if (brother_percent - brother_diff) > 5 then
+ creature:addHealth(28000)
+ end
+ end
+ end
+
+ creature:setStorageValue(1, creature:getStorageValue(1) + primaryDamage + secondaryDamage)
+
+ if creature:getStorageValue(2) < 1 and creature:getStorageValue(1) >= health then
+ creature:setStorageValue(2, 1)
+ creature:say("Join me in battle my brother. Let's share the fun!")
+ local nictros = Creature("Sir Nictros")
+ if nictros then
+ nictros:teleportTo(Position(33426, 31438, 13))
+ nictros:setMoveLocked(false)
+ end
+ end
+
+ return primaryDamage, primaryType, -secondaryDamage, secondaryType
+end
+
+sir_baeloc_health:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_cobra_mini_bosses.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_cobra_mini_bosses.lua
new file mode 100644
index 00000000000..ca4ff69d0d0
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_cobra_mini_bosses.lua
@@ -0,0 +1,33 @@
+local FireWall = MoveEvent()
+
+function FireWall.onStepIn(creature, item, position, fromPosition)
+ if creature:isMonster() then
+ return true
+ end
+
+ if fromPosition.y == 32691 then
+ if creature:getStorageValue(Storage.Quest.U12_20.GraveDanger.FireWall) >= 1 then
+ creature:teleportTo(Position(position.x, position.y + 2, position.z))
+ else
+ creature:teleportTo(fromPosition)
+ end
+ elseif fromPosition.y == 32693 then
+ creature:teleportTo(Position(position.x, position.y - 2, position.z))
+ elseif fromPosition.x == 33385 then
+ if creature:getStorageValue(Storage.Quest.U12_20.GraveDanger.CustodianKilled) >= 1 then
+ creature:setStorageValue(Storage.Quest.U12_20.GraveDanger.FireWall, 1)
+ creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You pass the fire without taking any damage. It's now or never...")
+ else
+ creature:teleportTo(fromPosition)
+ end
+ creature:teleportTo(Position(position.x + 2, position.y, position.z))
+ elseif fromPosition.x == 33387 then
+ creature:teleportTo(Position(position.x - 2, position.y, position.z))
+ end
+ creature:getPosition():sendMagicEffect(CONST_ME_HITBYFIRE)
+
+ return true
+end
+
+FireWall:aid(36568)
+FireWall:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_duke_exit_tp.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_duke_exit_tp.lua
new file mode 100644
index 00000000000..99795e72a17
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_duke_exit_tp.lua
@@ -0,0 +1,14 @@
+local duke_exit_tp = MoveEvent()
+
+function duke_exit_tp.onStepIn(creature, item, position, fromPosition)
+ if not creature:isPlayer() then
+ return false
+ end
+
+ creature:removeCondition(CONDITION_OUTFIT)
+
+ return true
+end
+
+duke_exit_tp:aid(14561)
+duke_exit_tp:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_enter_tps.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_enter_tps.lua
new file mode 100644
index 00000000000..beda8793ad1
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_enter_tps.lua
@@ -0,0 +1,67 @@
+local portals = {
+ [14562] = {
+ boss = "Lord Azaram",
+ stor = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaram.Timer,
+ newPos = Position(33425, 31499, 13),
+ },
+ [14563] = {
+ boss = "Duke Krule",
+ stor = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.Timer,
+ newPos = Position(33456, 31499, 13),
+ },
+ [14564] = {
+ boss = "Sir Baeloc",
+ stor = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Timer,
+ newPos = Position(33428, 31406, 13),
+ },
+ [14565] = {
+ boss = "Earl Osam",
+ stor = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsam.Timer,
+ newPos = Position(33519, 31439, 13),
+ },
+ [14566] = {
+ boss = "Count Vlarkorth",
+ stor = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Timer,
+ newPos = Position(33458, 31406, 13),
+ },
+ [14567] = {
+ boss = "King Zelos",
+ stor = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Timer,
+ newPos = Position(33491, 31546, 13),
+ },
+}
+
+function secondsToClock(seconds)
+ local hours = math.floor(seconds / 3600)
+ local mins = math.floor((seconds % 3600) / 60)
+ local secs = seconds % 60
+ return string.format("%02d:%02d:%02d", hours, mins, secs)
+end
+
+local grave_enter = MoveEvent()
+
+function grave_enter.onStepIn(creature, item, position, fromPosition)
+ if creature:isMonster() then
+ return true
+ end
+
+ local thing = portals[item.actionid]
+
+ if not thing then
+ return true
+ end
+
+ if creature:getStorageValue(thing.stor) > os.time() then
+ local eq = creature:getStorageValue(thing.stor) - os.time()
+ creature:say("You need to wait " .. secondsToClock(eq) .. " before trying to challenge " .. thing.boss .. " again!", TALKTYPE_MONSTER_SAY, false, creature)
+ creature:teleportTo(fromPosition)
+ return true
+ end
+
+ creature:teleportTo(thing.newPos)
+
+ return true
+end
+
+grave_enter:aid(14562, 14563, 14564, 14565, 14566, 14567)
+grave_enter:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_quaidDen.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_quaidDen.lua
new file mode 100644
index 00000000000..46367a52e90
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_quaidDen.lua
@@ -0,0 +1,17 @@
+local quaidDen = MoveEvent()
+
+function quaidDen.onStepIn(creature, item, position, fromPosition)
+ if creature:isMonster() then
+ return true
+ end
+
+ if creature:getStorageValue(Storage.Quest.U12_20.GraveDanger.CustodianKilled) < 1 then
+ creature:teleportTo(Position(33401, 32658, 3))
+ creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "With the power of the dark Custodian still holding away, the fog is keeping you from entering Quaid's den.")
+ end
+
+ return true
+end
+
+quaidDen:id(31636)
+quaidDen:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_soul_cleanse.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_soul_cleanse.lua
new file mode 100644
index 00000000000..5c99dede384
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_soul_cleanse.lua
@@ -0,0 +1,29 @@
+local soul_cleanse = MoveEvent()
+
+function soul_cleanse.onStepIn(creature, item, position, fromPosition)
+ if creature:isPlayer() then
+ return true
+ end
+
+ if creature:getName():lower() == "azaram's soul" then
+ local health = (creature:getHealth() / creature:getMaxHealth()) * 100
+
+ if health == 100 then
+ creature:say("The broken Soul absorbs the power of the soul splinter and gains strength!")
+ creature:teleportTo(config.soulPos)
+ item:remove()
+ removeTainted()
+
+ local boss = Creature("Lord Azaram")
+
+ if boss then
+ boss:teleportTo(config.centerRoom)
+ end
+ end
+ end
+
+ return true
+end
+
+soul_cleanse:id(31160)
+soul_cleanse:register()
diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_zelos_tp.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_zelos_tp.lua
new file mode 100644
index 00000000000..75a0412cb60
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_zelos_tp.lua
@@ -0,0 +1,20 @@
+local zelos_tp = MoveEvent()
+
+function zelos_tp.onStepIn(creature, item, position, fromPosition)
+ if not creature:isPlayer() then
+ return false
+ end
+
+ local knights = Creature("Nargol The Impaler") or Creature("Magnor Mournbringer") or Creature("The Red Knight") or Creature("Rewar The Bloody") or Creature("Shard Of Magnor") or Creature("Regenerating Mass")
+
+ if knights then
+ creature:teleportTo(fromPosition)
+ else
+ creature:teleportTo(Position(33443, 31536, 13))
+ end
+
+ return true
+end
+
+zelos_tp:aid(14579)
+zelos_tp:register()
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_books.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_books.lua
deleted file mode 100644
index c068fcadb88..00000000000
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_books.lua
+++ /dev/null
@@ -1,14 +0,0 @@
-local books = Action()
-
-function books.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 4 then
- player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You find nothing in the Ambassador's house. If he's in fact a traitor he got rid of any evidence that could incriminate him.")
- player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 5)
- else
- player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.")
- end
- return true
-end
-
-books:uid(57504)
-books:register()
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/2-ambassadors-treason.lua
similarity index 68%
rename from data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/2-ambassadors-treason.lua
index ff6d3950028..daf7dfb8f4f 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/2-ambassadors-treason.lua
@@ -3,9 +3,9 @@
local paper = Action()
function paper.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 2 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Documents were burnt here recently. Only the part of one scroll still lies in front of the chimney but it's too sooted to read.")
- player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 3)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 3)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already investigated this.")
end
@@ -20,9 +20,9 @@ paper:register()
local paperScraps = Action()
function paperScraps.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 3 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 3 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Paper scraps lie scattered on the floor. It takes some time to put them back together. But it's only a badly written poem.")
- player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 4)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 4)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already investigated this.")
end
@@ -37,9 +37,9 @@ paperScraps:register()
local scrolls = Action()
function scrolls.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You examine the scrolls carefully. Those are orders from Rathleton for the Ambassador. No sign of treason here.")
- player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 2)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 2)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already investigated this.")
end
@@ -54,9 +54,9 @@ scrolls:register()
local roofTop = MoveEvent()
function roofTop.onStepIn(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 4 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 4 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You find nothing in the Ambassador's house. If he's in fact a traitor he got rid of any evidence that could incriminate him.")
- player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 5)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 5)
end
return true
end
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/6-mind-travel.lua
similarity index 89%
rename from data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/6-mind-travel.lua
index cc0d24c7281..d36288eca79 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/6-mind-travel.lua
@@ -89,8 +89,8 @@ local memoryShardsItemIdsBitmasks = {
local memoryShards = Action()
function memoryShards.onUse(player, item, fromPosition, target, toPosition, isHotkey)
- local memoryStorage = player:getStorageValue(Storage.Kilmaresh.Fifth.Memories)
- local memoriesShardsStorage = player:getStorageValue(Storage.Kilmaresh.Fifth.MemoriesShards)
+ local memoryStorage = player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories)
+ local memoriesShardsStorage = player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.MemoriesShards)
local hasUsedShard = testFlag(memoriesShardsStorage, memoryShardsItemIdsBitmasks[item:getId()])
if
@@ -99,8 +99,8 @@ function memoryShards.onUse(player, item, fromPosition, target, toPosition, isHo
and target.uid == 57507 -- is it the shrine?
then
player:say(memoriesWords[memoryStorage], TALKTYPE_MONSTER_SAY, false, player, toPosition)
- player:setStorageValue(Storage.Kilmaresh.Fifth.Memories, memoryStorage + 1)
- player:setStorageValue(Storage.Kilmaresh.Fifth.MemoriesShards, setFlag(memoriesShardsStorage, memoryShardsItemIdsBitmasks[item:getId()]))
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, memoryStorage + 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.MemoriesShards, setFlag(memoriesShardsStorage, memoryShardsItemIdsBitmasks[item:getId()]))
toPosition:sendMagicEffect(CONST_ME_ENERGYAREA)
return true
end
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/7-four-masks.lua
similarity index 55%
rename from data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/7-four-masks.lua
index b3dc0585bce..3ab075a2f4d 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/7-four-masks.lua
@@ -3,19 +3,23 @@ local masks = {
storage = 1,
successMessage = "You have found a gryphon mask.", -- TODO Gryphon Mask
emptyMessage = "The gryphon nest is empty.",
+ storageKey = Storage.Quest.U12_20.KilmareshQuest.Sixth.GryphonMask,
},
[31370] = { -- Silver mask
storage = 2,
successMessage = "You have found a silver mask.",
emptyMessage = "This palm is empty.",
+ storageKey = Storage.Quest.U12_20.KilmareshQuest.Sixth.SilverMask,
},
[31371] = { -- For Ivory mask action see data\scripts\actions\other\gems.lua
storage = 4,
+ storageKey = Storage.Quest.U12_20.KilmareshQuest.Sixth.IvoryMask,
},
[31372] = { -- Mirror Mask
storage = 8,
successMessage = "You have found a mirror mask.",
emptyMessage = "The sarcophagus is empty.",
+ storageKey = Storage.Quest.U12_20.KilmareshQuest.Sixth.MirrorMask,
},
}
@@ -31,12 +35,13 @@ function masksAction.onUse(player, item, fromPosition, target, toPosition, isHot
local maskDiscovered = uidRewards[item.uid]
local mask = masks[maskDiscovered]
- if player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) >= 1 and not testFlag(player:getStorageValue(Storage.Kilmaresh.Sixth.FourMasks), mask.storage) then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) >= 1 and not testFlag(player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks), mask.storage) then
player:addItem(maskDiscovered, 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, mask.successMessage)
- player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) + 1)
- player:setStorageValue(Storage.Kilmaresh.Sixth.FourMasks, player:getStorageValue(Storage.Kilmaresh.Sixth.FourMasks) + mask.storage)
- elseif player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) >= 1 then
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) + 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks) + mask.storage)
+ player:setStorageValue(mask.storageKey, 1)
+ elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) >= 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, mask.emptyMessage)
else
return false
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/8-blessing-the-statues.lua
similarity index 58%
rename from data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/8-blessing-the-statues.lua
index 1c5bc1964bc..b113a191ad3 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/8-blessing-the-statues.lua
@@ -30,10 +30,10 @@ function statuesActions.onUse(player, item, fromPosition, target, toPosition, is
return false
end
- if player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) >= 5 and not testFlag(player:getStorageValue(Storage.Kilmaresh.Sixth.BlessedStatues), key.storage) then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) >= 5 and not testFlag(player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.BlessedStatues), key.storage) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You bless the statue.")
- player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) + 1)
- player:setStorageValue(Storage.Kilmaresh.Sixth.BlessedStatues, player:getStorageValue(Storage.Kilmaresh.Sixth.BlessedStatues) + key.storage)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) + 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.BlessedStatues, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.BlessedStatues) + key.storage)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already blessed this statue.")
end
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_augerfun.lua
similarity index 82%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_augerfun.lua
index 4ab6691ab6c..699cf1957b8 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_augerfun.lua
@@ -1,7 +1,7 @@
local augerfun = Action()
function augerfun.onUse(player, item, fromPosition, target, toPosition, isHotkey)
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then
if table.contains({ 31377 }, target.itemid) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are gathering some catus milk.")
player:addItem(31335, 1)
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_basin.lua
similarity index 67%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_basin.lua
index 613bd5a2f79..9628f9f26d5 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_basin.lua
@@ -1,10 +1,10 @@
local basin = Action()
function basin.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Tem.Bleeds) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Tem.Bleeds) == 1 then
player:addItem(31431, 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You find a golden symbol at the bottom of the blood-filled basin.")
- player:setStorageValue(Storage.Kilmaresh.Eleven.Basin, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin, 1)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sorry")
end
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_cagekey.lua
similarity index 66%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_cagekey.lua
index d4a01248e57..67a3f56cadc 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_cagekey.lua
@@ -1,10 +1,10 @@
local cagekey = Action()
function cagekey.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 2 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a wooden cage key.")
player:addItem(31379, 1) -- Wooden Cage Key
- player:setStorageValue(Storage.Kilmaresh.Fourteen.Remains, 3)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains, 3)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.")
end
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_coruja.lua
similarity index 70%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_coruja.lua
index 367ee462a05..0ab72a6d1ba 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_coruja.lua
@@ -1,9 +1,9 @@
local coruja = Action()
function coruja.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Nine.Owl) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl) == 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You discover an owl resting in a tree. Thats special, because you have never seen an owl in all of Kilmaresh.")
- player:setStorageValue(Storage.Kilmaresh.Nine.Owl, 2)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl, 2)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sorry")
end
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_glasshoneyfun.lua
similarity index 85%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_glasshoneyfun.lua
index b106aa6cab9..e0911e2a695 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_glasshoneyfun.lua
@@ -1,7 +1,7 @@
local glasshoneyfun = Action()
function glasshoneyfun.onUse(player, item, fromPosition, target, toPosition, isHotkey)
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then
if table.contains({ 31376 }, target.itemid) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are gently squishing some of the honey palm blossoms and golden honey is depping into the jug.")
player:removeItem(31331, 1)
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_lyre.lua
similarity index 65%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_lyre.lua
index bdac82d88ef..878caaed444 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_lyre.lua
@@ -1,10 +1,10 @@
local lyre = Action()
function lyre.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 2 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found Lyre.")
player:addItem(31447, 1)
- player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 3)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 3)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The bag can not be opened.")
end
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_peeler.lua
similarity index 66%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_peeler.lua
index 8507ac946f9..ed5f337e92c 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_peeler.lua
@@ -1,9 +1,9 @@
local peeler = Action()
function peeler.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Set.Ritual) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual) == 2 then
player:addItem(31328, 1)
- player:setStorageValue(Storage.Kilmaresh.Set.Ritual, 3)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual, 3)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a bark peeler.")
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.")
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_peelerfun.lua
similarity index 83%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_peelerfun.lua
index 330f838543e..dc1837c2996 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_peelerfun.lua
@@ -1,7 +1,7 @@
local peelerfun = Action()
function peelerfun.onUse(player, item, fromPosition, target, toPosition, isHotkey)
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 then
if table.contains({ 31376 }, target.itemid) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are peeling a piece of tark off the again tree.")
player:addItem(31329, 1)
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_pickenchanted.lua
similarity index 83%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_pickenchanted.lua
index 6cc2ad57f46..29cff3c03a5 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_pickenchanted.lua
@@ -1,7 +1,7 @@
local pickenchanted = Action()
function pickenchanted.onUse(player, item, fromPosition, target, toPosition, isHotkey)
- if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 then
if table.contains({ 30438 }, target.itemid) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are quarrying some tagralt.")
player:addItem(31333, 1)
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_portal_minis_kilmaresh.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_portal_minis_kilmaresh.lua
similarity index 100%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_portal_minis_kilmaresh.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_portal_minis_kilmaresh.lua
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_sangra.lua
similarity index 70%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_sangra.lua
index f1b0b37a698..3ca1f37b0db 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_sangra.lua
@@ -1,9 +1,9 @@
local sangra = Action()
function sangra.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Nine.Owl) == 2 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl) == 2 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The arrow is still sticking in the tree. Fresh blood keeps trickling from the spot where the arrow hit the trunk.")
- player:setStorageValue(Storage.Kilmaresh.Tem.Bleeds, 1)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Tem.Bleeds, 1)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sorry")
end
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_scissors.lua
similarity index 67%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_scissors.lua
index d1d16fa1c30..5d6fae1c98c 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_scissors.lua
@@ -1,9 +1,9 @@
local scissors = Action()
function scissors.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Set.Ritual) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual) == 1 then
player:addItem(31327, 1)
- player:setStorageValue(Storage.Kilmaresh.Set.Ritual, 2)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual, 2)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a ritual scissors.")
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.")
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_scissorsfun.lua
similarity index 75%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_scissorsfun.lua
index 1e4975e705a..0f255445baf 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_scissorsfun.lua
@@ -2,266 +2,266 @@ local config = {
[30426] = {
itemId = 30426,
msg = "You are cutting some veldt flowers.",
- storage = Storage.Kilmaresh.Eighth.Yonan,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan,
getValue = 2,
addItemId = 31325,
}, -- Veldt Flower
[30422] = {
itemId = 30422,
msg = "You are cutting some snake maw.",
- storage = Storage.Kilmaresh.Eighth.Shimun,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun,
getValue = 2,
addItemId = 31336,
}, -- Sanke Maw
[30427] = {
itemId = 30427,
msg = "You are cutting some desert rose blossoms.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31330,
}, -- Rose Blossoms
[12747] = {
itemId = 12747,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12748] = {
itemId = 12748,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12749] = {
itemId = 12749,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12750] = {
itemId = 12750,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12751] = {
itemId = 12751,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12752] = {
itemId = 12752,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12753] = {
itemId = 12753,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12754] = {
itemId = 12754,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12755] = {
itemId = 12755,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12756] = {
itemId = 12756,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12757] = {
itemId = 12757,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12758] = {
itemId = 12758,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12759] = {
itemId = 12759,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12760] = {
itemId = 12760,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12761] = {
itemId = 12761,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12762] = {
itemId = 12762,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12763] = {
itemId = 12763,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12764] = {
itemId = 12764,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12765] = {
itemId = 12765,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12766] = {
itemId = 12766,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12767] = {
itemId = 12767,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12768] = {
itemId = 12768,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12769] = {
itemId = 12769,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12770] = {
itemId = 12770,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12771] = {
itemId = 12771,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12772] = {
itemId = 12772,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12773] = {
itemId = 12773,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12774] = {
itemId = 12774,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12775] = {
itemId = 12775,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12776] = {
itemId = 12776,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12777] = {
itemId = 12777,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12778] = {
itemId = 12778,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12779] = {
itemId = 12779,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12780] = {
itemId = 12780,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
[12781] = {
itemId = 12781,
msg = "You are gathering some spiderweb cloud shreds. But you become entangled.",
- storage = Storage.Kilmaresh.Eighth.Tefrit,
+ storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit,
getValue = 2,
addItemId = 31339,
}, -- Spider Cloud Shreds
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tortoise.lua
similarity index 64%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tortoise.lua
index 3d2f67bb489..ea5158719da 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tortoise.lua
@@ -1,10 +1,10 @@
local tortoise = Action()
function tortoise.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 1 then
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Tortoise.")
player:addItem(31445, 1)
- player:setStorageValue(Storage.Kilmaresh.Thirteen.Presente, 2)
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente, 2)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The tortoise nest empty.")
end
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tumulo.lua
similarity index 63%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tumulo.lua
index 80724b7b876..2b993b41b9c 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tumulo.lua
@@ -1,8 +1,8 @@
local tumulo = Action()
function tumulo.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 1 then
- -- player:setStorageValue(Storage.Kilmaresh.Treze.Presente, 2)
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 1 then
+ -- player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Treze.Presente, 2)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The grave is empty. Nothing than gaping void.")
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.")
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tumuloerro.lua
similarity index 64%
rename from data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tumuloerro.lua
index 07ce019e84b..8148603b01a 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tumuloerro.lua
@@ -1,8 +1,8 @@
local tumuloerro = Action()
function tumuloerro.onUse(player, item, frompos, item2, topos)
- if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 1 then
- -- player:setStorageValue(Storage.Kilmaresh.Treze.Presente, 2)
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 1 then
+ -- player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Treze.Presente, 2)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The grave is empty. Nothing than gaping void.")
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.")
diff --git a/data-otservbr-global/scripts/actions/bosses_levers/urmahlullu_the_immaculate.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_urmahlullu_the_immaculate.lua
similarity index 100%
rename from data-otservbr-global/scripts/actions/bosses_levers/urmahlullu_the_immaculate.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_urmahlullu_the_immaculate.lua
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_bragrumol.lua
similarity index 53%
rename from data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_bragrumol.lua
index 02846ec6cfd..4b0f04a885d 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_bragrumol.lua
@@ -2,8 +2,8 @@ local bragrumol = CreatureEvent("BragrumolDeath")
function bragrumol.onDeath(creature)
onDeathForDamagingPlayers(creature, function(creature, player)
- if player:getStorageValue(Storage.Kilmaresh.Twelve.Bragrumol) == 1 then
- player:setStorageValue(Storage.Kilmaresh.Twelve.Bragrumol, 2)
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol) == 1 then
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol, 2)
end
end)
return true
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_fafnar.lua
similarity index 81%
rename from data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_fafnar.lua
index 4d94f0e6d3b..495c1e4136c 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_fafnar.lua
@@ -1,6 +1,6 @@
local monster = {
- ["burning gladiator"] = Storage.Kilmaresh.Thirteen.Fafnar,
- ["priestess of the wild sun"] = Storage.Kilmaresh.Thirteen.Fafnar,
+ ["burning gladiator"] = Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar,
+ ["priestess of the wild sun"] = Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar,
}
local fafnar = CreatureEvent("FafnarMissionsDeath")
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_mozradek.lua
similarity index 53%
rename from data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_mozradek.lua
index 23507b878b0..fdfc876634d 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_mozradek.lua
@@ -2,8 +2,8 @@ local mozradek = CreatureEvent("MozradekDeath")
function mozradek.onDeath(creature)
onDeathForDamagingPlayers(creature, function(creature, player)
- if player:getStorageValue(Storage.Kilmaresh.Twelve.Mozradek) == 1 then
- player:setStorageValue(Storage.Kilmaresh.Twelve.Mozradek, 2)
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek) == 1 then
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek, 2)
end
end)
return true
diff --git a/data-otservbr-global/scripts/creaturescripts/monster/urmahlullu_change.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_urmahlullu_change.lua
similarity index 100%
rename from data-otservbr-global/scripts/creaturescripts/monster/urmahlullu_change.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_urmahlullu_change.lua
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_xogixath.lua
similarity index 53%
rename from data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_xogixath.lua
index cbfe0daeb3b..41dc703989f 100644
--- a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua
+++ b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_xogixath.lua
@@ -2,8 +2,8 @@ local xogixath = CreatureEvent("XogixathDeath")
function xogixath.onDeath(creature)
onDeathForDamagingPlayers(creature, function(creature, player)
- if player:getStorageValue(Storage.Kilmaresh.Twelve.Xogixath) == 1 then
- player:setStorageValue(Storage.Kilmaresh.Twelve.Xogixath, 2)
+ if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath) == 1 then
+ player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath, 2)
end
end)
return true
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/movements_firetp.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/movements_firetp.lua
similarity index 100%
rename from data-otservbr-global/scripts/quests/kilmaresh/movements_firetp.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/movements_firetp.lua
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/movements_steptile.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/movements_steptile.lua
similarity index 100%
rename from data-otservbr-global/scripts/quests/kilmaresh/movements_steptile.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/movements_steptile.lua
diff --git a/data-otservbr-global/scripts/quests/kilmaresh/movements_tpvoc.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/movements_tpvoc.lua
similarity index 100%
rename from data-otservbr-global/scripts/quests/kilmaresh/movements_tpvoc.lua
rename to data-otservbr-global/scripts/quests/kilmaresh_quest/movements_tpvoc.lua
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts/actions_bosses_killed.lua b/data-otservbr-global/scripts/quests/the_dream_courts/actions_bosses_killed.lua
deleted file mode 100644
index ebbff0713ef..00000000000
--- a/data-otservbr-global/scripts/quests/the_dream_courts/actions_bosses_killed.lua
+++ /dev/null
@@ -1,24 +0,0 @@
-local bosses = {
- ["plagueroot"] = { storage = Storage.Quest.U12_00.TheDreamCourts.PlaguerootKilled },
- ["malofur mangrinder"] = { storage = Storage.Quest.U12_00.TheDreamCourts.MalofurKilled },
- ["maxxenius"] = { storage = Storage.Quest.U12_00.TheDreamCourts.MaxxeniusKilled },
- ["alptramun"] = { storage = Storage.Quest.U12_00.TheDreamCourts.AlptramunKilled },
- ["izcandar the banished"] = { storage = Storage.Quest.U12_00.TheDreamCourts.IzcandarKilled },
- ["the nightmare beast"] = { storage = Storage.Quest.U12_00.TheDreamCourts.NightmareBeastKilled },
-}
-
-local bossesDreamCourts = CreatureEvent("DreamCourtsBossDeath")
-function bossesDreamCourts.onDeath(creature)
- local bossConfig = bosses[creature:getName():lower()]
- if not bossConfig then
- return true
- end
- onDeathForDamagingPlayers(creature, function(creature, player)
- if bossConfig.storage then
- player:setStorageValue(bossConfig.storage, 1)
- end
- end)
- return true
-end
-
-bossesDreamCourts:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts/actions_dream_courts_lever.lua b/data-otservbr-global/scripts/quests/the_dream_courts/actions_dream_courts_lever.lua
deleted file mode 100644
index 7c18cd11a80..00000000000
--- a/data-otservbr-global/scripts/quests/the_dream_courts/actions_dream_courts_lever.lua
+++ /dev/null
@@ -1,91 +0,0 @@
-local config = {
- bossName = {
- ["Monday"] = "Plagueroot",
- ["Tuesday"] = "Malofur Mangrinder",
- ["Wednesday"] = "Maxxenius",
- ["Thursday"] = "Alptramun",
- ["Friday"] = "Izcandar The Banished",
- ["Saturday"] = "Maxxenius",
- ["Sunday"] = "Alptramun",
- },
- requiredLevel = 250,
- timeToFightAgain = 10, -- In hour
- timeToDefeat = 30, -- In minutes
- playerPositions = {
- { pos = Position(32208, 32021, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT },
- { pos = Position(32208, 32022, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT },
- { pos = Position(32208, 32023, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT },
- { pos = Position(32208, 32024, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT },
- { pos = Position(32208, 32025, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT },
- },
- bossPosition = Position(32207, 32051, 14),
- specPos = {
- from = Position(32199, 32039, 14),
- to = Position(32229, 32055, 14),
- },
- exit = Position(32210, 32035, 13),
-}
-local bossToday = config.bossName[os.date("%A")]
-
-local dreamCourtsLever = Action()
-function dreamCourtsLever.onUse(player, item, fromPosition, target, toPosition, isHotkey)
- if config.playerPositions[1].pos ~= player:getPosition() then
- return false
- end
- local spec = Spectators()
- spec:setOnlyPlayer(false)
- spec:setRemoveDestination(config.exit)
- spec:setCheckPosition(config.specPos)
- spec:check()
- if spec:getPlayers() > 0 then
- player:say("There's someone fighting with " .. bossToday .. ".", TALKTYPE_MONSTER_SAY)
- return true
- end
- local lever = Lever()
- lever:setPositions(config.playerPositions)
- lever:setCondition(function(creature)
- if not creature or not creature:isPlayer() then
- return true
- end
- if creature:getLevel() < config.requiredLevel then
- creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "All the players need to be level " .. config.requiredLevel .. " or higher.")
- return false
- end
- if not lever:canUseLever(player, bossToday, config.timeToFightAgain) then
- return false
- end
- return true
- end)
- lever:checkPositions()
- if lever:checkConditions() then
- spec:removeMonsters()
- local monster = Game.createMonster(bossToday, config.bossPosition, true, true)
- if not monster then
- return true
- end
- lever:teleportPlayers()
- lever:setCooldownAllPlayers(bossToday, os.time() + config.timeToFightAgain * 3600)
- addEvent(function()
- local old_players = lever:getInfoPositions()
- spec:clearCreaturesCache()
- spec:setOnlyPlayer(true)
- spec:check()
- local player_remove = {}
- for i, v in pairs(spec:getCreatureDetect()) do
- for _, v_old in pairs(old_players) do
- if v_old.creature == nil or v_old.creature:isMonster() then
- break
- end
- if v:getName() == v_old.creature:getName() then
- table.insert(player_remove, v_old.creature)
- break
- end
- end
- end
- spec:removePlayers(player_remove)
- end, config.timeToDefeat * 60 * 1000)
- end
-end
-
-dreamCourtsLever:position({ x = 32208, y = 32020, z = 13 })
-dreamCourtsLever:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts/actions_entrances_dream_courts.lua b/data-otservbr-global/scripts/quests/the_dream_courts/actions_entrances_dream_courts.lua
deleted file mode 100644
index cdbbb60aa4e..00000000000
--- a/data-otservbr-global/scripts/quests/the_dream_courts/actions_entrances_dream_courts.lua
+++ /dev/null
@@ -1,27 +0,0 @@
-local config = {
- { position = { x = 32042, y = 31938, z = 15 } },
- { position = { x = 32043, y = 31938, z = 15 } },
- { position = { x = 32042, y = 31939, z = 15 } },
- { position = { x = 32043, y = 31939, z = 15 } },
-}
-
-local entranceDreamCourts = MoveEvent()
-function entranceDreamCourts.onStepIn(creature, item, position, fromPosition)
- local player = creature:getPlayer()
- if not player then
- return false
- end
- for value in pairs(config) do
- if Position(config[value].position) == player:getPosition() then
- player:teleportTo(Position(32208, 32093, 13))
- player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
- return true
- end
- end
-end
-
-entranceDreamCourts:type("stepin")
-for value in pairs(config) do
- entranceDreamCourts:position(config[value].position)
-end
-entranceDreamCourts:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts/actions_portal_nightmare_beast.lua b/data-otservbr-global/scripts/quests/the_dream_courts/actions_portal_nightmare_beast.lua
deleted file mode 100644
index 87742e54b43..00000000000
--- a/data-otservbr-global/scripts/quests/the_dream_courts/actions_portal_nightmare_beast.lua
+++ /dev/null
@@ -1,38 +0,0 @@
-local storagesTable = {
- { storage = Storage.Quest.U12_00.TheDreamCourts.PlaguerootKilled, bossName = "Plagueroot" },
- { storage = Storage.Quest.U12_00.TheDreamCourts.MalofurKilled, bossName = "Malofur Mangrinder" },
- { storage = Storage.Quest.U12_00.TheDreamCourts.MaxxeniusKilled, bossName = "Maxxenius" },
- { storage = Storage.Quest.U12_00.TheDreamCourts.AlptramunKilled, bossName = "Alptramun" },
- { storage = Storage.Quest.U12_00.TheDreamCourts.IzcandarKilled, bossName = "Izcandar The Banished" },
-}
-
-local portalNightmareBeast = MoveEvent()
-function portalNightmareBeast.onStepIn(creature, item, position, fromPosition)
- local player = creature:getPlayer()
- if not player then
- return false
- end
- if player:getLevel() < 250 then
- player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need at least level 250 to enter.")
- player:teleportTo(fromPosition, true)
- player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
- return false
- end
- local text = ""
- for value in pairs(storagesTable) do
- if player:getStorageValue(storagesTable[value].storage) < 0 then
- text = text .. "\n" .. storagesTable[value].bossName
- end
- end
- if text == "" then
- return true
- else
- player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You still need to defeat:" .. text)
- player:teleportTo(fromPosition, true)
- return false
- end
-end
-
-portalNightmareBeast:type("stepin")
-portalNightmareBeast:position({ x = 32211, y = 32081, z = 15 })
-portalNightmareBeast:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts/movements_faceless_bane_step_positions.lua b/data-otservbr-global/scripts/quests/the_dream_courts/movements_faceless_bane_step_positions.lua
deleted file mode 100644
index 8ebdc47ae6f..00000000000
--- a/data-otservbr-global/scripts/quests/the_dream_courts/movements_faceless_bane_step_positions.lua
+++ /dev/null
@@ -1,114 +0,0 @@
-local walkedPositions = {}
-local lastResetTime = os.time()
-local checkTime = false
-
-local function resetWalkedPositions(checkLastResetTime)
- if lastResetTime > os.time() and checkLastResetTime then
- return true
- end
-
- walkedPositions = {}
- Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, 0)
- lastResetTime = os.time() + (1 * 60)
-end
-
-local pipePositions = {
- Position(33612, 32568, 13),
- Position(33612, 32567, 13),
- Position(33612, 32566, 13),
- Position(33612, 32565, 13),
- Position(33612, 32564, 13),
- Position(33612, 32563, 13),
- Position(33612, 32562, 13),
- Position(33612, 32561, 13),
- Position(33612, 32560, 13),
- Position(33612, 32559, 13),
- Position(33612, 32558, 13),
- Position(33612, 32557, 13),
- Position(33612, 32556, 13),
- Position(33622, 32556, 13),
- Position(33622, 32557, 13),
- Position(33622, 32558, 13),
- Position(33622, 32559, 13),
- Position(33622, 32560, 13),
- Position(33622, 32561, 13),
- Position(33622, 32562, 13),
- Position(33622, 32563, 13),
- Position(33622, 32564, 13),
- Position(33622, 32565, 13),
- Position(33622, 32566, 13),
- Position(33622, 32567, 13),
- Position(33622, 32568, 13),
-}
-
-local function sendEnergyEffect()
- for _, position in ipairs(pipePositions) do
- position:sendMagicEffect(CONST_ME_PURPLEENERGY)
- position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_GREAT_ENERGY_BEAM)
- end
-
- return true
-end
-
-local facelessBaneStepPositions = MoveEvent()
-
-function facelessBaneStepPositions.onStepIn(creature, item, position, fromPosition)
- local player = creature:getPlayer()
- if not player then
- return true
- end
-
- if Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps) == 1 then
- Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps, 0)
- lastResetTime = os.time()
- resetWalkedPositions(true)
- end
-
- if not checkTime then
- checkTime = addEvent(resetWalkedPositions, 15 * 1000, false)
- end
-
- if Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn) < 1 then
- if #walkedPositions > 0 then
- for _, walkedPos in ipairs(walkedPositions) do
- if walkedPos == position then
- return true
- end
- end
- end
-
- position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_BUZZ)
- position:sendMagicEffect(CONST_ME_YELLOWENERGY)
- table.insert(walkedPositions, position)
-
- if #walkedPositions == 13 then
- Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, 1)
- addEvent(resetWalkedPositions, 60 * 1000, true)
- sendEnergyEffect()
- checkTime = nil
- end
- end
- return true
-end
-
-local facelessBaneSteps = {
- Position(33615, 32567, 13),
- Position(33613, 32567, 13),
- Position(33611, 32563, 13),
- Position(33610, 32561, 13),
- Position(33611, 32558, 13),
- Position(33614, 32557, 13),
- Position(33617, 32558, 13),
- Position(33620, 32557, 13),
- Position(33623, 32558, 13),
- Position(33624, 32561, 13),
- Position(33623, 32563, 13),
- Position(33621, 32567, 13),
- Position(33619, 32567, 13),
-}
-
-for _, pos in ipairs(facelessBaneSteps) do
- facelessBaneStepPositions:position(pos)
-end
-
-facelessBaneStepPositions:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts/movements_teleport.lua b/data-otservbr-global/scripts/quests/the_dream_courts/movements_teleport.lua
deleted file mode 100644
index 2dc6fb7bbe3..00000000000
--- a/data-otservbr-global/scripts/quests/the_dream_courts/movements_teleport.lua
+++ /dev/null
@@ -1,39 +0,0 @@
-local teleports = {
- {
- access = Storage.Quest.U12_00.TheDreamCourts.BuriedCathedralAccess,
- from = { x = 32720, y = 32270, z = 8 }, -- Haunted house cellar
- to = { x = 33618, y = 32545, z = 13 }, -- Buried Cathedral
- },
- {
- access = Storage.Quest.U12_00.TheDreamCourts.BuriedCathedralAccess,
- from = { x = 33618, y = 32546, z = 13 }, -- Buried Cathedral
- to = { x = 32720, y = 32269, z = 8 }, -- Haunted house cellar
- },
-}
-
-local teleport = MoveEvent()
-
-function teleport.onStepIn(creature, item, position, fromPosition)
- if not creature:isPlayer() then
- return true
- end
-
- local teleportTo = fromPosition
- for index, teleportItem in pairs(teleports) do
- if creature:getStorageValue(teleportItem.access) == 1 then
- if creature:getPosition() == Position(teleportItem.from) then
- teleportTo = teleportItem.to
- break
- end
- end
- end
-
- creature:teleportTo(teleportTo)
- creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
- return true
-end
-
-for index, teleportItem in pairs(teleports) do
- teleport:position(teleportItem.from)
-end
-teleport:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua
new file mode 100644
index 00000000000..2f1502bd063
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua
@@ -0,0 +1,32 @@
+local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.LakeWord
+local count = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount
+
+local actions_acidFishingRod = Action()
+
+function actions_acidFishingRod.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ local tPos = target:getPosition()
+ local fromPos = Position(33553, 32558, 15)
+ local toPos = Position(33569, 32562, 15)
+
+ if tPos:isInRange(fromPos, toPos) then
+ if player:getStorageValue(storage) < 1 then
+ if player:getStorageValue(count) < 0 then
+ player:setStorageValue(count, 0)
+ end
+ player:setStorageValue(count, player:getStorageValue(count) + 1)
+ player:setStorageValue(storage, 1)
+ tPos:sendMagicEffect(CONST_ME_GREEN_RINGS)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You dare not touch there remains. A word has been carved into these bones over and over: 'K'muuh'.")
+ end
+ end
+
+ return true
+end
+
+actions_acidFishingRod:id(29950)
+actions_acidFishingRod:allowFarUse(true)
+actions_acidFishingRod:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua
new file mode 100644
index 00000000000..a16bc0bc930
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua
@@ -0,0 +1,31 @@
+local questline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline
+local wordsCount = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount
+local facelessTime = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FacelessTime
+
+local actions_bookOnTable = Action()
+
+function actions_bookOnTable.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ if player:getStorageValue(questline) == 2 and player:getStorageValue(wordsCount) >= 4 then
+ player:setStorageValue(questline, 3)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This book tells you about a spell that draws its wielder towards the most energetic being next to him.")
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It consists of four parts wich have been scratched out of this book. They need to be read in conjunction with chants.")
+ elseif player:getStorageValue(questline) >= 4 then
+ if player:getStorageValue(facelessTime) > os.time() then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait to challange this enemy again!")
+ return true
+ else
+ player:teleportTo(Position(33640, 32561, 13))
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "All chants have been sung in the right order, you are deemed worthy. You are transported away...")
+ player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
+ end
+ end
+
+ return true
+end
+
+actions_bookOnTable:id(29954)
+actions_bookOnTable:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua
new file mode 100644
index 00000000000..92267a99d47
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua
@@ -0,0 +1,39 @@
+local wardPosition = Position(32769, 32621, 10)
+local storage = Storage.Quest.U12_00.TheDreamCourts.WardStones.PortHopeStone
+local count = Storage.Quest.U12_00.TheDreamCourts.WardStones.Count
+
+local function revertStone(position, on, off)
+ local activeStone = Tile(position):getItemById(on)
+
+ if activeStone then
+ activeStone:transform(off)
+ end
+end
+
+local actions_chargedCompass = Action()
+
+function actions_chargedCompass.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ local tPos = target:getPosition()
+ local isInQuest = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline)
+
+ if tPos == wardPosition then
+ if isInQuest == 3 and player:getStorageValue(storage) < 1 then
+ player:setStorageValue(count, player:getStorageValue(count) + 1)
+ player:setStorageValue(storage, 1)
+ player:say("The energy is transferred to the rune stone. It glows now!", TALKTYPE_MONSTER_SAY)
+ target:getPosition():sendMagicEffect(CONST_ME_THUNDER)
+ target:transform(29335)
+ item:transform(29291)
+ addEvent(revertStone, 1000 * 30, tPos, 33828, 33827)
+ end
+ end
+
+ return true
+end
+
+actions_chargedCompass:id(29294)
+actions_chargedCompass:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_colourfulMushroom.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_colourfulMushroom.lua
new file mode 100644
index 00000000000..4fba50d7cb3
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_colourfulMushroom.lua
@@ -0,0 +1,13 @@
+local actions_colourfulMushroom = Action()
+
+function actions_colourfulMushroom.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom) == 1 then
+ player:removeItem(30009, 1)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom, 2)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count) + 1)
+ return true
+ end
+end
+
+actions_colourfulMushroom:id(30009)
+actions_colourfulMushroom:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua
new file mode 100644
index 00000000000..a543149b648
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua
@@ -0,0 +1,153 @@
+local containers = {
+ [1] = {
+ uniqueid = 23102,
+ cPosition = Position(32736, 32282, 8),
+ storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.SkeletonContainer,
+ value = 1,
+ reward = 29310,
+ defaultItem = true,
+ },
+ [2] = {
+ uniqueid = 23103,
+ cPosition = Position(33693, 32185, 8),
+ storage = Storage.Quest.U12_00.TheDreamCourts.Main.CourtChest,
+ value = 1,
+ reward = 30146,
+ defaultItem = true,
+ },
+ [3] = {
+ uniqueid = 23104,
+ cPosition = Position(33711, 32108, 4),
+ storage = Storage.Quest.U12_00.TheDreamCourts.Main.CourtChest,
+ value = 1,
+ reward = 30146,
+ defaultItem = true,
+ },
+ [4] = {
+ uniqueid = 23105,
+ cPosition = Position(33578, 32527, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FishingRod,
+ value = 1,
+ reward = 29950,
+ defaultItem = true,
+ },
+ [5] = {
+ uniqueid = 23106,
+ cPosition = Position(33599, 32533, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.BarrelWord,
+ value = 1,
+ defaultItem = false,
+ text = "The inside of this barrel's lid has a word written onto it: 'O'kteth'.",
+ },
+ [6] = {
+ uniqueid = 23107,
+ cPosition = Position(33618, 32518, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.EstatueWord,
+ value = 1,
+ defaultItem = false,
+ text = "This statue has a word written on her hand: 'N'ogalu'.",
+ },
+ [7] = {
+ uniqueid = 23108,
+ cPosition = Position(33638, 32507, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.BedWord,
+ value = 1,
+ defaultItem = false,
+ text = "This end of the bed has a stack of notes hidden under it. There is only one word on all of them: 'T'sough'.",
+ },
+ [8] = {
+ uniqueid = 23109,
+ cPosition = Position(33703, 32185, 5),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.RoseBush,
+ value = 1,
+ reward = 29993,
+ defaultItem = true,
+ },
+ [9] = {
+ uniqueid = 23110,
+ cPosition = Position(33663, 32192, 7),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom,
+ value = 1,
+ reward = 30009,
+ defaultItem = true,
+ },
+ [10] = {
+ uniqueid = 23111,
+ cPosition = Position(33671, 32203, 7),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Book,
+ value = 1,
+ reward = 29991,
+ defaultItem = true,
+ },
+ [11] = {
+ uniqueid = 23112,
+ cPosition = Position(33683, 32125, 6),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.OrcSkull,
+ value = 1,
+ reward = 29989,
+ defaultItem = true,
+ },
+ [12] = {
+ uniqueid = 23113,
+ cPosition = Position(31996, 31981, 13),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Recipe,
+ value = 1,
+ reward = 30147,
+ defaultItem = true,
+ },
+ [13] = {
+ uniqueid = 23114,
+ cPosition = Position(32017, 31981, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MinotaurSkull,
+ value = 1,
+ reward = 29988,
+ defaultItem = true,
+ },
+ [14] = {
+ uniqueid = 23115,
+ cPosition = Position(32054, 31936, 13),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.TrollSkull,
+ value = 1,
+ reward = 29990,
+ defaultItem = true,
+ },
+}
+
+local actions_containerRewards = Action()
+
+function actions_containerRewards.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ local iPos = item:getPosition()
+
+ for _, k in pairs(containers) do
+ if iPos == k.cPosition and item:getUniqueId() == k.uniqueid then
+ if player:getStorageValue(k.storage) < k.value then
+ if k.defaultItem then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. ItemType(k.reward):getName() .. ".")
+ player:addItem(k.reward, 1)
+ else
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.text)
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount) < 0 then
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount, 0)
+ end
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount) + 1)
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount) == 4 then
+ player:addAchievement("Tied the Knot")
+ end
+ end
+ player:setStorageValue(k.storage, k.value)
+ else
+ if k.defaultItem then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.")
+ end
+ end
+ end
+ end
+
+ return true
+end
+
+for _, k in pairs(containers) do
+ actions_containerRewards:uid(k.uniqueid)
+end
+
+actions_containerRewards:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua
new file mode 100644
index 00000000000..7d0bbb7a85a
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua
@@ -0,0 +1,29 @@
+local Count = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count
+local Storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.DoorInvisible
+local lanternId = 23738
+
+local actions_doorInvisible = Action()
+
+function actions_doorInvisible.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ local iPos = item:getPosition()
+
+ if player:getStorageValue(Storage) < 1 then
+ if player:getItemCount(lanternId) >= 1 then
+ player:setStorageValue(Storage, 1)
+ player:setStorageValue(Count, player:getStorageValue(Count) + 1)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door opens.")
+ end
+ else
+ if iPos.x < player:getPosition().x then
+ player:teleportTo(Position(iPos.x - 3, iPos.y, iPos.z))
+ else
+ player:teleportTo(Position(iPos.x + 3, iPos.y, iPos.z))
+ end
+ player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
+ end
+
+ return true
+end
+
+actions_doorInvisible:aid(23111)
+actions_doorInvisible:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua
new file mode 100644
index 00000000000..26309a69749
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua
@@ -0,0 +1,96 @@
+local config = {
+ [1] = {
+ on = 29337,
+ off = 29336,
+ hisPosition = Position(32251, 31386, 5),
+ hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.OkolnirStone,
+ hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.",
+ },
+ [2] = {
+ on = 29337,
+ off = 29336,
+ hisPosition = Position(31939, 31653, 10),
+ hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.FoldaStone,
+ hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.",
+ },
+ [3] = {
+ on = 29337,
+ off = 29336,
+ hisPosition = Position(32058, 32792, 13),
+ hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.CalassaStone,
+ hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.",
+ },
+ [4] = {
+ on = 29335,
+ off = 29334,
+ hisPosition = Position(33555, 32220, 7),
+ hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.FeyristStone,
+ hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.",
+ },
+ [5] = {
+ on = 29335,
+ off = 29334,
+ hisPosition = Position(32383, 32610, 7),
+ hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.MerianaStone,
+ hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.",
+ },
+ [6] = {
+ on = 29335,
+ off = 29334,
+ hisPosition = Position(33273, 31997, 7),
+ hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.CormayaStone,
+ hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.",
+ },
+ [7] = {
+ on = 29335,
+ off = 29334,
+ hisPosition = Position(33576, 32537, 15),
+ hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.CatedralStone,
+ hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.",
+ lastStone = true,
+ },
+}
+
+local function revertStone(position, on, off)
+ local activeStone = Tile(position):getItemById(on)
+
+ if activeStone then
+ activeStone:transform(off)
+ end
+end
+
+local actions_dreamTalisman = Action()
+
+function actions_dreamTalisman.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ local tPos = target:getPosition()
+
+ for _, k in pairs(config) do
+ if tPos == k.hisPosition and target:getId() == k.off then
+ if player:getStorageValue(k.hisStorage) < 1 then
+ if k.lastStone then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) ~= 5 then
+ return true
+ else
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 6)
+ end
+ end
+
+ player:setStorageValue(k.hisStorage, 1)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count) + 1)
+ target:getPosition():sendMagicEffect(CONST_ME_THUNDER)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.hisMessage)
+ target:transform(k.on)
+ addEvent(revertStone, 1000 * 30, target:getPosition(), k.on, k.off)
+ end
+ end
+ end
+
+ return true
+end
+
+actions_dreamTalisman:id(30132)
+actions_dreamTalisman:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua
new file mode 100644
index 00000000000..69a9f78965c
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua
@@ -0,0 +1,78 @@
+local function placeMask(position, wmask, nmask)
+ local item = Tile(position):getItemById(nmask)
+ if item then
+ item:transform(wmask)
+ end
+end
+
+local maskId = 29276
+
+local function resetArea()
+ local infectedCount = 0
+ local playerCount = 0
+ local spectators = Game.getSpectators(Position(32206, 32045, 15), false, true, 14, 14, 14, 14)
+
+ for _, p in pairs(spectators) do
+ local player = Player(p:getId())
+ if player then
+ playerCount = playerCount + 1
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse) >= 1 then
+ infectedCount = infectedCount + 1
+ end
+ end
+ end
+
+ if playerCount == infectedCount then
+ return true
+ else
+ return false
+ end
+end
+
+local actions_dreamcatcher_curse = Action()
+
+function actions_dreamcatcher_curse.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ if item.itemid == 29274 then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can rip off a dream catcher!")
+ item:transform(29275)
+ local newItem = Game.createItem(maskId, 1, Position(item:getPosition().x, item:getPosition().y + 1, item:getPosition().z))
+ if newItem then
+ newItem:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
+ end
+ addEvent(placeMask, 10 * 1000, item:getPosition(), 29274, 29275)
+ elseif item.itemid == 29276 then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse) < 1 then
+ if (target ~= player) and target:isPlayer() then
+ if target:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) >= 1 then
+ target:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, 0)
+ target:removeCondition(CONDITION_OUTFIT)
+ target:unregisterEvent(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse)
+ target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have a feeling of dread.")
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, 1)
+ player:registerEvent(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You take the dreamcurse on yourself!")
+ item:remove(1)
+ local j = resetArea()
+ if j then
+ Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse, 0)
+ end
+ else
+ return true
+ end
+ else
+ return true
+ end
+ else
+ return true
+ end
+ end
+
+ return true
+end
+
+actions_dreamcatcher_curse:id(29274, 29275, 29276)
+actions_dreamcatcher_curse:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua
new file mode 100644
index 00000000000..e659f384c12
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua
@@ -0,0 +1,99 @@
+local config = {
+ boss = {
+ name = "",
+ position = Position(32208, 32048, 14),
+ },
+ requiredLevel = 250,
+ timeToFightAgain = 20 * 60 * 60,
+ timeToDefeat = 30 * 60,
+ playerPositions = {
+ { pos = Position(32208, 32021, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT },
+ { pos = Position(32208, 32022, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT },
+ { pos = Position(32208, 32023, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT },
+ { pos = Position(32208, 32024, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT },
+ { pos = Position(32208, 32025, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT },
+ },
+ monsters = {
+ ["Maxxenius"] = {
+ { name = "Generator", pos = Position(32205, 32048, 14) },
+ { name = "Generator", pos = Position(32210, 32045, 14) },
+ { name = "Generator", pos = Position(32210, 32051, 14) },
+ },
+ ["Alptramun"] = {
+ { name = "unpleasant dream", pos = Position(32208, 32048, 14) },
+ { name = "unpleasant dream", pos = Position(32208, 32048, 14) },
+ },
+ ["Izcandar The Banished"] = {
+ { name = "the heat of summer", pos = Position(32204, 32053, 14), delay = 15 * 1000 },
+ { name = "the heat of summer", pos = Position(32201, 32047, 14), delay = 15 * 1000 },
+ { name = "the heat of summer", pos = Position(32204, 32043, 14), delay = 15 * 1000 },
+ { name = "the cold of winter", pos = Position(32211, 32042, 14), delay = 15 * 1000 },
+ { name = "the cold of winter", pos = Position(32214, 32048, 14), delay = 15 * 1000 },
+ { name = "the cold of winter", pos = Position(32210, 32053, 14), delay = 15 * 1000 },
+ },
+ ["Plagueroot"] = {
+ { name = "plant attendant", pos = Position(32204, 32047, 14), delay = 15 * 1000 },
+ { name = "plant attendant", pos = Position(32212, 32043, 14), delay = 15 * 1000 },
+ { name = "plant attendant", pos = Position(32212, 32050, 14), delay = 15 * 1000 },
+ },
+ ["Malofur Mangrinder"] = {
+ { name = "whirling blades", pos = Position(32200, 32046, 14) },
+ { name = "whirling blades", pos = Position(32200, 32050, 14) },
+ { name = "whirling blades", pos = Position(32202, 32049, 14) },
+ { name = "whirling blades", pos = Position(32202, 32051, 14) },
+ { name = "whirling blades", pos = Position(32205, 32043, 14) },
+ { name = "whirling blades", pos = Position(32200, 32050, 14) },
+ { name = "whirling blades", pos = Position(32205, 32048, 14) },
+ { name = "whirling blades", pos = Position(32205, 32055, 14) },
+ { name = "whirling blades", pos = Position(32206, 32051, 14) },
+ { name = "whirling blades", pos = Position(32206, 32040, 14) },
+ { name = "whirling blades", pos = Position(32207, 32043, 14) },
+ { name = "whirling blades", pos = Position(32207, 32048, 14) },
+ { name = "whirling blades", pos = Position(32208, 32051, 14) },
+ { name = "whirling blades", pos = Position(32209, 32048, 14) },
+ { name = "whirling blades", pos = Position(32209, 32055, 14) },
+ { name = "whirling blades", pos = Position(32210, 32051, 14) },
+ { name = "whirling blades", pos = Position(32211, 32042, 14) },
+ { name = "whirling blades", pos = Position(32211, 32044, 14) },
+ { name = "whirling blades", pos = Position(32211, 32046, 14) },
+ { name = "whirling blades", pos = Position(32214, 32043, 14) },
+ { name = "whirling blades", pos = Position(32214, 32049, 14) },
+ { name = "whirling blades", pos = Position(32213, 32052, 14) },
+ },
+ },
+ bossPosition = Position(32207, 32051, 14),
+ specPos = {
+ from = Position(32199, 32039, 14),
+ to = Position(32229, 32055, 14),
+ },
+ exit = Position(32210, 32035, 13),
+}
+
+local function configureLever()
+ local bossDate = {
+ ["Monday"] = "Plagueroot",
+ ["Tuesday"] = "Malofur Mangrinder",
+ ["Wednesday"] = "Maxxenius",
+ ["Thursday"] = "Alptramun",
+ ["Friday"] = "Izcandar The Banished",
+ ["Saturday"] = "Maxxenius",
+ ["Sunday"] = "Alptramun",
+ }
+ local bossName = bossDate[os.date("%A")]
+ config.boss.name = bossName
+ config.monsters = config.monsters[bossName]
+ if bossName == "Maxxenius" then
+ config.onUseExtra = function()
+ Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, 0)
+ end
+ elseif bossName == "Izcandar The Banished" then
+ config.onUseExtra = function()
+ Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarOutfit, 0)
+ end
+ end
+end
+
+configureLever()
+local dreamCourtsLever = BossLever(config)
+dreamCourtsLever:position({ x = 32208, y = 32020, z = 13 })
+dreamCourtsLever:register()
diff --git a/data-otservbr-global/scripts/actions/bosses_levers/faceless_bane.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua
similarity index 100%
rename from data-otservbr-global/scripts/actions/bosses_levers/faceless_bane.lua
rename to data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua
new file mode 100644
index 00000000000..91757dbe7fb
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua
@@ -0,0 +1,91 @@
+local firstFloor = {
+ [1] = { hisPosition = Position(32749, 32628, 8) },
+ [2] = { hisPosition = Position(32745, 32613, 8) },
+ [3] = { hisPosition = Position(32811, 32645, 8) },
+ [4] = { hisPosition = Position(32781, 32641, 8) },
+}
+
+local secondFloor = {
+ [1] = { hisPosition = Position(32808, 32612, 9) },
+ [2] = { hisPosition = Position(32775, 32600, 9) },
+ [3] = { hisPosition = Position(32743, 32612, 9) },
+ [4] = { hisPosition = Position(32761, 32630, 9) },
+}
+
+local thirdFloor = {
+ [1] = { hisPosition = Position(32742, 32636, 10) },
+ [2] = { hisPosition = Position(32757, 32606, 10) },
+ [3] = { hisPosition = Position(32767, 32638, 10) },
+ [4] = { hisPosition = Position(32789, 32613, 10) },
+}
+
+local function setActionId(itemid, position, aid)
+ local crystal = Tile(position):getItemById(itemid)
+
+ if crystal and crystal:getActionId() ~= aid then
+ crystal:setActionId(aid)
+ end
+end
+
+local function tryCrystal(player, itemid, position, actionid, message, rewardid)
+ local player = Player(player)
+ local r = math.random(1, 10)
+ local crystal = Tile(position):getItemById(itemid)
+
+ if player then
+ if crystal then
+ if crystal:getActionId() == actionid then
+ if r == 1 then
+ player:say(message, TALKTYPE_MONSTER_SAY)
+ player:addItem(rewardid, 1)
+ crystal:setActionId(0)
+ addEvent(setActionId, 1000 * 30, itemid, position, actionid)
+ else
+ crystal:getPosition():sendMagicEffect(CONST_ME_POFF)
+ end
+ else
+ player:sendCancelMessage("You must wait a while to use this item again.")
+ end
+ end
+ end
+end
+
+local storage = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.GotAxe
+
+local actions_goldenAxe = Action()
+
+function actions_goldenAxe.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ local tPos = target:getPosition()
+ local tId = target:getId()
+
+ if player:getStorageValue(storage) >= 1 then
+ if target.itemid == 8865 then
+ for _, k in pairs(firstFloor) do
+ if tPos == k.hisPosition then
+ tryCrystal(player:getId(), tId, tPos, 23121, "You got a blue crystal!", 29287)
+ end
+ end
+ elseif target.itemid == 14940 then
+ for _, k in pairs(secondFloor) do
+ if tPos == k.hisPosition then
+ tryCrystal(player:getId(), tId, tPos, 23122, "You got a green crystal!", 29288)
+ end
+ end
+ elseif target.itemid == 14974 then
+ for _, k in pairs(thirdFloor) do
+ if tPos == k.hisPosition then
+ tryCrystal(player:getId(), tId, tPos, 23123, "You got a purple crystal!", 29289)
+ end
+ end
+ end
+ end
+
+ return true
+end
+
+actions_goldenAxe:id(29286)
+actions_goldenAxe:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua
new file mode 100644
index 00000000000..2f87b8e50ba
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua
@@ -0,0 +1,65 @@
+local altars = {
+ [1] = { position = Position(32591, 32629, 9) },
+ [2] = { position = Position(32591, 32621, 9) },
+ [3] = { position = Position(32602, 32629, 9) },
+ [4] = { position = Position(32602, 32621, 9) },
+}
+
+local blockedItem = 29300
+local storageIdolCount = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.IdolCount
+local finalStorage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple
+local totalAltars = 4
+local resetTime = 1 * 60 * 1000
+
+local function removeIdol(position)
+ local idol = Tile(position):getItemById(blockedItem)
+ if idol then
+ idol:remove()
+ end
+end
+
+local actions_goldenIdol = Action()
+
+function actions_goldenIdol.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ local tPos = target:getPosition()
+
+ for _, altar in pairs(altars) do
+ if tPos == altar.position then
+ local checkTile = Tile(altar.position):getItemById(blockedItem)
+ if not checkTile then
+ item:remove(1)
+ Game.createItem(blockedItem, 1, altar.position)
+ tPos:sendMagicEffect(CONST_ME_POFF)
+ player:say("**placing idol**", TALKTYPE_MONSTER_SAY)
+
+ local currentCount = player:getStorageValue(storageIdolCount)
+
+ if currentCount < 0 then
+ currentCount = 0
+ end
+ player:setStorageValue(storageIdolCount, currentCount + 1)
+
+ if currentCount + 1 == totalAltars then
+ player:setStorageValue(finalStorage, 1)
+ if p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb) == 1 and p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar) == 1 and p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple) == 1 then
+ p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 2)
+ end
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have placed all the idols on the altars and unlocked the temple!")
+ end
+
+ addEvent(removeIdol, resetTime, altar.position)
+ else
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There is already an idol here. Try another altar.")
+ end
+ end
+ end
+
+ return true
+end
+
+actions_goldenIdol:id(29299)
+actions_goldenIdol:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_keyCheck.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_keyCheck.lua
new file mode 100644
index 00000000000..d05714a64ff
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_keyCheck.lua
@@ -0,0 +1,40 @@
+local storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline
+local pillar = { Position(33069, 32317, 8), Position(33070, 32317, 8), Position(33068, 32308, 8) }
+
+local actions_keyCheck = Action()
+
+function actions_keyCheck.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ local iPos = item:getPosition()
+ local isInQuest = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb)
+
+ if player:getStorageValue(storage) == 1 and isInQuest < 1 then
+ if iPos == pillar[1] or iPos == pillar[2] then
+ if player:getItemCount(29351) >= 2 then
+ player:removeItem(29351, 2)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "As soon as you turn the second key a mechanism retracts the locks and swallows the keys, opening a small passage beyond.")
+ player:teleportTo(Position(33069, 32310, 8))
+ player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
+ else
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to use the mechanism of the pillar itself to turn both keys at once.")
+ return true
+ end
+ elseif iPos == pillar[3] then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You reach for the onyx and trigger and enormous discharge of raw energy. It is now possible to traverse the portal in this tomb.")
+ player:teleportTo(Position(33068, 32320, 8))
+ player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb, 1)
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb) == 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar) == 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple) == 1 then
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 2)
+ end
+ end
+ end
+
+ return true
+end
+
+actions_keyCheck:aid(23105)
+actions_keyCheck:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_magicalPaint.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_magicalPaint.lua
new file mode 100644
index 00000000000..241fce4b2e9
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_magicalPaint.lua
@@ -0,0 +1,45 @@
+local sapphireDust = 30004
+local sunFruitJuice = 30003
+local egg = 30005
+local enchantedBottle = 30006
+local magicalPaint = 29994
+local Count = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count
+
+local actions_magicalPaint = Action()
+
+function actions_magicalPaint.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if item.itemid == sapphireDust and target.itemid == sunFruitJuice then
+ target:remove(1)
+ item:remove(1)
+ player:addItem(enchantedBottle)
+ return true
+ elseif item.itemid == egg and target.itemid == enchantedBottle then
+ target:remove(1)
+ item:remove(1)
+ player:addItem(magicalPaint)
+ return true
+ elseif item.itemid == magicalPaint and target.actionid == 23109 then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Painting) < 1 then
+ item:remove(1)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Carefully you paint over the picture. As you are doing so the flat paiting deepens. It looks now like a room you can enter.")
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Painting, 1)
+ player:setStorageValue(Count, player:getStorageValue(Count) + 1)
+ end
+ elseif item.actionid == 23109 and (item.itemid == 29997 or item.itemid == 29996) then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Painting) == 2 then
+ if item.getPosition() == Position(32104, 31921, 13) or item:getPosition() == Position(32103, 31921, 13) then
+ player:teleportTo(Position(32114, 32014, 13))
+ else
+ player:teleportTo(Position(32103, 31922, 13))
+ end
+
+ player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
+ elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Painting) == 1 then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This isn't a normal paiting anymore. By using magical paint you transformed it into a portal and can easily pass it.")
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Painting, 2)
+ end
+ end
+end
+
+actions_magicalPaint:id(29994, 30003, 30004, 30005, 30006)
+actions_magicalPaint:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_oldLock.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_oldLock.lua
new file mode 100644
index 00000000000..d978cc20f7b
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_oldLock.lua
@@ -0,0 +1,32 @@
+local doorPosition = Position(32091, 31970, 14)
+local keysCount = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count
+
+local actions_oldLock = Action()
+
+function actions_oldLock.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ local tPos = target:getPosition()
+
+ if tPos == doorPosition then
+ if player:getStorageValue(keysCount) == 6 then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You insert the old lock into the door. It fits perfectly.")
+ player:addAchievement("Keeper of the 7 Keys")
+ player:setStorageValue(keysCount, 7)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, 2)
+ tPos:sendMagicEffect(CONST_ME_MAGIC_BLUE)
+ return true
+ else
+ return true
+ end
+ else
+ return true
+ end
+
+ return true
+end
+
+actions_oldLock:id(29992)
+actions_oldLock:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua
new file mode 100644
index 00000000000..2b681f578cb
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua
@@ -0,0 +1,151 @@
+local doors = {
+ [1] = {
+ doorPosition = Position(32761, 32630, 7),
+ storage = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline,
+ value = 1,
+ },
+ [2] = {
+ doorPosition = Position(32700, 32244, 9),
+ storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline,
+ value = 1,
+ },
+ [3] = {
+ doorPosition = Position(32700, 32255, 9),
+ storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline,
+ value = 1,
+ },
+ [4] = {
+ doorPosition = Position(32700, 32275, 8),
+ storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline,
+ value = 1,
+ },
+ [5] = {
+ doorPosition = Position(32719, 32264, 8),
+ storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar,
+ value = 1,
+ },
+ [6] = {
+ doorPosition = Position(33088, 32388, 8),
+ storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline,
+ value = 1,
+ },
+ [7] = {
+ doorPosition = Position(32606, 32629, 9),
+ storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple,
+ value = 1,
+ help = "Tomb",
+ },
+ [8] = {
+ doorPosition = Position(32671, 32652, 7),
+ storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline,
+ value = 1,
+ },
+ [9] = {
+ doorPosition = Position(33625, 32525, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount,
+ value = 3,
+ },
+ [10] = {
+ doorPosition = Position(33640, 32551, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount,
+ value = 3,
+ },
+ [11] = {
+ doorPosition = Position(33657, 32551, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount,
+ value = 3,
+ },
+ [12] = {
+ doorPosition = Position(31983, 31960, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.DoorMedusa,
+ value = 1,
+ help = "Medusa",
+ },
+ [13] = {
+ doorPosition = Position(32051, 31998, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom,
+ value = 2,
+ },
+ [14] = {
+ doorPosition = Position(32074, 31974, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.SequenceSkulls,
+ value = 3,
+ },
+ [15] = {
+ doorPosition = Position(32091, 31970, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = 2,
+ help = "Lock",
+ },
+ [16] = {
+ doorPosition = Position(31983, 32000, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = 2,
+ help = "Open/Close",
+ },
+}
+
+local function closeDoor(position, closedId)
+ local door = Tile(position):getItemById(closedId + 1)
+ if door then
+ door:transform(closedId)
+ end
+end
+
+local actions_questDoors = Action()
+
+function actions_questDoors.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ local iPos = item:getPosition()
+
+ for _, p in pairs(doors) do
+ if iPos == p.doorPosition and not (player:getPosition() == p.doorPosition) then
+ if p.help == "Tomb" then
+ if player:getStorageValue(p.storage) < p.value then
+ player:teleportTo(toPosition, true)
+ item:transform(item.itemid + 1)
+ addEvent(closeDoor, 2000, iPos, item.itemid)
+ else
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.")
+ end
+ elseif p.help == "Medusa" then
+ if player:getStorageValue(p.storage) < 1 then
+ player:setStorageValue(p.storage, 1)
+ local count = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count)
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count, (count < 0 and 1 or count + 1))
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "As Medusa's Ointment takes effect, the door is unpetrified. You can use it now.")
+ end
+ local newPos = (iPos.y < player:getPosition().y) and Position(iPos.x, iPos.y - 3, iPos.z) or Position(iPos.x, iPos.y + 3, iPos.z)
+ player:teleportTo(newPos)
+ player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
+ addEvent(closeDoor, 2000, iPos, item.itemid)
+ elseif p.help == "Lock" then
+ if player:getStorageValue(p.storage) >= p.value then
+ local newPos = (iPos.y < player:getPosition().y) and Position(iPos.x, iPos.y - 1, iPos.z) or Position(iPos.x, iPos.y + 1, iPos.z)
+ player:teleportTo(newPos)
+ player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
+ addEvent(closeDoor, 2000, iPos, item.itemid)
+ else
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The lock in this door is missing. Perhaps you can find a matching lock somewhere?")
+ return true
+ end
+ elseif p.help == "Open/Close" then
+ if player:getStorageValue(p.storage) >= p.value then
+ item:transform((item.itemid == 30033) and 30035 or 30033)
+ end
+ else
+ if player:getStorageValue(p.storage) >= p.value then
+ player:teleportTo(toPosition, true)
+ item:transform(item.itemid + 1)
+ addEvent(closeDoor, 2000, iPos, item.itemid)
+ else
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.")
+ end
+ end
+ end
+ end
+
+ return true
+end
+
+actions_questDoors:aid(23101)
+actions_questDoors:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_rosebushUse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_rosebushUse.lua
new file mode 100644
index 00000000000..9a077595cc7
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_rosebushUse.lua
@@ -0,0 +1,34 @@
+local earthPosition = Position(32014, 32035, 13)
+local Rosebush = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.RoseBush
+local keysCount = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count
+
+local actions_rosebushUse = Action()
+
+function actions_rosebushUse.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ local tPos = target:getPosition()
+
+ if tPos == earthPosition then
+ if player:getStorageValue(Rosebush) <= 1 then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You plant the rosebush into the fresh soil. The green portal glows brighter. Perhaps you may pass it now.")
+ player:setStorageValue(Rosebush, 2)
+ if player:getStorageValue(keysCount) < 0 then
+ player:setStorageValue(keysCount, 0)
+ end
+ player:setStorageValue(keysCount, player:getStorageValue(keysCount) + 1)
+ tPos:sendMagicEffect(CONST_ME_SMALLPLANTS)
+ else
+ return false
+ end
+ else
+ return false
+ end
+
+ return true
+end
+
+actions_rosebushUse:id(29993)
+actions_rosebushUse:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sacrophagusUse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sacrophagusUse.lua
new file mode 100644
index 00000000000..49496f0e86f
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sacrophagusUse.lua
@@ -0,0 +1,79 @@
+local sacrophagus = {
+ [1] = { hisPosition = Position(33081, 32355, 8) },
+ [2] = { hisPosition = Position(33093, 32356, 8) },
+ [3] = { hisPosition = Position(33081, 32349, 8) },
+ [4] = { hisPosition = Position(33092, 32347, 8) },
+ [5] = { hisPosition = Position(33083, 32338, 8) },
+ [6] = { hisPosition = Position(33093, 32338, 8) },
+ [7] = { hisPosition = Position(33054, 32335, 8) },
+ [8] = { hisPosition = Position(33058, 32323, 8) },
+ [9] = { hisPosition = Position(33051, 32309, 8) },
+ [10] = { hisPosition = Position(33055, 32297, 8) },
+ [11] = { hisPosition = Position(33091, 32301, 8) },
+ [12] = { hisPosition = Position(33091, 32319, 8) },
+ [13] = { hisPosition = Position(33103, 32344, 8) },
+ [14] = { hisPosition = Position(33091, 32319, 8) },
+}
+
+local function setActionId(itemid, position, aid)
+ local item = Tile(position):getItemById(itemid)
+
+ if item and item:getActionId() ~= aid then
+ item:setActionId(aid)
+ end
+end
+
+local function resetActionId(player, itemid, position, actionid, message, rewardid)
+ local player = Player(player)
+ local r = math.random(1, 10)
+ local check = Tile(position):getItemById(itemid)
+
+ if player then
+ if check then
+ if check:getActionId() == actionid then
+ if r >= 7 then
+ player:say(message, TALKTYPE_MONSTER_SAY)
+ local item = player:addItem(rewardid, 1)
+ item:decay()
+ else
+ Game.createMonster("Mummy", check:getPosition())
+ check:getPosition():sendMagicEffect(CONST_ME_POFF)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The curse of disturbing this fragile, ancient peace is your price to pay!")
+ end
+
+ check:setActionId(0)
+ addEvent(setActionId, 1000 * 30, itemid, position, actionid)
+ else
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The opening of the last sarcophagus still haunts you. Wait some time for your spirits to return.")
+ end
+ end
+ end
+end
+
+local storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline
+
+local actions_sacrophagusUse = Action()
+
+function actions_sacrophagusUse.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ local rewardId = 29351
+ local tPos = item:getPosition()
+ local tId = item:getId()
+ local isInQuest = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb)
+
+ if player:getStorageValue(storage) == 1 and isInQuest < 1 then
+ for _, k in pairs(sacrophagus) do
+ if tPos == k.hisPosition then
+ resetActionId(player:getId(), tId, tPos, 23104, "You got a " .. ItemType(rewardId):getName() .. "!", rewardId)
+ end
+ end
+ end
+
+ return true
+end
+
+actions_sacrophagusUse:id(29349)
+actions_sacrophagusUse:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua
new file mode 100644
index 00000000000..6a11f8d3596
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua
@@ -0,0 +1,67 @@
+local sequenceBooks = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.SequenceBooks
+local questline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline
+
+local sequence = {
+ [1] = {
+ number = 0,
+ position = Position(33613, 32515, 15),
+ msg = "The chants in this book often contain the word 'K'muuh'.",
+ },
+ [2] = {
+ number = 1,
+ position = Position(33621, 32520, 15),
+ msg = "The chants in this book often contain the word 'N'ogalu'.",
+ },
+ [3] = {
+ number = 2,
+ position = Position(33616, 32520, 15),
+ msg = "The chants in this book often contain the word 'O'kteth.'.",
+ },
+ [4] = {
+ number = 3,
+ position = Position(33624, 32515, 15),
+ msg = "All chants have been sung in the right order, you are deemed worthy. You are transported away...",
+ },
+}
+
+local actions_sequenceBooks = Action()
+
+function actions_sequenceBooks.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ if player:getStorageValue(sequenceBooks) < 0 then
+ player:setStorageValue(sequenceBooks, 0)
+ end
+
+ local tPos = item:getPosition()
+
+ if player:getStorageValue(questline) == 3 then
+ for _, book in pairs(sequence) do
+ if tPos == book.position then
+ if player:getStorageValue(sequenceBooks) == book.number then
+ player:setStorageValue(sequenceBooks, player:getStorageValue(sequenceBooks) + 1)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, book.msg)
+ tPos:sendMagicEffect(CONST_ME_SOUND_WHITE)
+ else
+ player:setStorageValue(sequenceBooks, 0)
+ tPos:sendMagicEffect(CONST_ME_SOUND_RED)
+ end
+ end
+ if player:getStorageValue(sequenceBooks) == 4 then
+ player:teleportTo(Position(33640, 32561, 13))
+ player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
+ player:setStorageValue(sequenceBooks, 0)
+ if player:getStorageValue(questline) < 4 then
+ player:setStorageValue(questline, 4)
+ end
+ end
+ end
+ end
+
+ return true
+end
+
+actions_sequenceBooks:id(29957)
+actions_sequenceBooks:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua
new file mode 100644
index 00000000000..fde13982e2e
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua
@@ -0,0 +1,63 @@
+local sequenceSkulls = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.SequenceSkulls
+local Count = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count
+
+local bookId = 29991
+
+local sequence = {
+ [1] = {
+ id = 29988,
+ number = 0,
+ position = Position(32071, 31977, 14),
+ msg = "You put the minotaur skull into the coffin within the minotaur skeleton. One of the door's locks clicks.",
+ },
+ [2] = {
+ id = 29989,
+ number = 1,
+ position = Position(32074, 31977, 14),
+ msg = "You put the orc skull into the coffin within the orc skeleton. One of the door's locks clicks.",
+ },
+ [3] = {
+ id = 29990,
+ number = 2,
+ position = Position(32077, 31977, 14),
+ msg = "You put the minotaur skull into the coffin within the minotaur skeleton. One of the door's locks clicks.",
+ },
+}
+
+local actions_sequenceSkulls = Action()
+
+function actions_sequenceSkulls.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ if player:getStorageValue(sequenceSkulls) < 0 then
+ player:setStorageValue(sequenceSkulls, 0)
+ end
+
+ local tPos = target:getPosition()
+
+ if player:getItemCount(bookId) >= 1 and player:getStorageValue(sequenceSkulls) < 3 then
+ for _, skull in pairs(sequence) do
+ if tPos == skull.position and skull.id == item.itemid then
+ if player:getStorageValue(sequenceSkulls) == skull.number then
+ player:setStorageValue(sequenceSkulls, player:getStorageValue(sequenceSkulls) + 1)
+ tPos:sendMagicEffect(CONST_ME_MAGIC_GREEN)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, skull.msg)
+ item:remove(1)
+ if player:getStorageValue(sequenceSkulls) == 3 then
+ player:setStorageValue(Count, player:getStorageValue(Count) + 1)
+ end
+ end
+ end
+ end
+ end
+
+ return true
+end
+
+for _, k in pairs(sequence) do
+ actions_sequenceSkulls:id(k.id)
+end
+
+actions_sequenceSkulls:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_strangeBucket.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_strangeBucket.lua
new file mode 100644
index 00000000000..b72241f251c
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_strangeBucket.lua
@@ -0,0 +1,79 @@
+local function revertEgg(position, normalEgg, mutatedEgg)
+ local activeStone = Tile(position):getItemById(normalEgg)
+
+ if activeStone then
+ activeStone:transform(mutatedEgg)
+ end
+end
+
+local actions_strangeBucket = Action()
+
+function actions_strangeBucket.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ local tPos = target:getPosition()
+ local tId = target:getId()
+ local r = math.random(0, 10)
+ local mutatedEgg = 29305
+ local normalEgg = 233
+ local emptyBucket = 29310
+ local lessBucket = 29307
+ local mediumBucket = 29308
+ local fullBucket = 29309
+ local filled = false
+ local isInQuest = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline)
+ local slimeCondition = createConditionObject(CONDITION_OUTFIT)
+ setConditionParam(slimeCondition, CONDITION_PARAM_TICKS, 2 * 60 * 1000)
+ addOutfitCondition(slimeCondition, { lookType = 19 })
+
+ if isInQuest >= 1 then
+ if tId == mutatedEgg then
+ if item.itemid == emptyBucket then
+ if r >= 5 then
+ filled = true
+ item:transform(lessBucket)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There is not enough ectoplasm left to fill it in the bucket.")
+ end
+ elseif item.itemid == lessBucket then
+ if r >= 5 then
+ filled = true
+ item:transform(mediumBucket)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There is not enough ectoplasm left to fill it in the bucket.")
+ end
+ elseif item.itemid == mediumBucket then
+ if r >= 5 then
+ filled = true
+ item:transform(fullBucket)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The ectoplasm all over this egg was already seeping inside the cocoon itself. You manage to fill soem of it into the bucket.")
+ end
+ end
+ if filled then
+ player:getPosition():sendMagicEffect(CONST_ME_POISONAREA)
+ else
+ target:getPosition():sendMagicEffect(CONST_ME_POFF)
+ end
+
+ target:transform(normalEgg)
+ addEvent(revertEgg, r * 1000 * 60, tPos, mutatedEgg, normalEgg)
+ end
+ if item.itemid == fullBucket then
+ if target:isPlayer() then
+ if target:getId() ~= player:getId() then
+ return true
+ else
+ item:transform(emptyBucket)
+ doAddCondition(player, slimeCondition)
+ player:getPosition():sendMagicEffect(CONST_ME_POFF)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You pour all of the ectoplasm over yourself. Without the bucket you cannot stabilise it, you need to hurry until it dissolves!")
+ end
+ end
+ end
+ end
+
+ return true
+end
+
+actions_strangeBucket:id(29307, 29308, 29309, 29310)
+actions_strangeBucket:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sunFruit.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sunFruit.lua
new file mode 100644
index 00000000000..c6319c4cf01
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sunFruit.lua
@@ -0,0 +1,30 @@
+local function placeFruits(position, fruit, nofruit)
+ local item = Tile(position):getItemById(nofruit)
+
+ if item then
+ item:transform(fruit)
+ end
+end
+
+local fruitId = 29995
+
+local actions_sunFruit = Action()
+
+function actions_sunFruit.onUse(player, item, fromPosition, target, toPosition, isHotkey)
+ if not player then
+ return true
+ end
+
+ local r = math.random(2, 4)
+
+ player:addItem(fruitId, r)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found some " .. ItemType(fruitId):getName() .. "s.")
+ item:transform(29970)
+ item:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
+ addEvent(placeFruits, 1 * 60 * 60 * 1000, item:getPosition(), 29969, 29970)
+
+ return true
+end
+
+actions_sunFruit:id(29969)
+actions_sunFruit:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua
new file mode 100644
index 00000000000..f529108e076
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua
@@ -0,0 +1,77 @@
+local sides = {
+ { fromPosition = Position(32208, 32040, 14), toPosition = Position(32216, 32055, 14) },
+ { fromPosition = Position(32198, 32039, 14), toPosition = Position(32207, 32055, 14) },
+}
+
+local changes = {
+ [1] = "izcandar champion of winter",
+ [2] = "izcandar champion of summer",
+}
+
+local function transformIzcandar(cid, name, health, position)
+ local creature = Creature(cid)
+
+ if not creature then
+ return true
+ end
+
+ local id = creature:getId()
+
+ if isInArray({ "izcandar champion of winter", "izcandar champion of summer" }, creature:getName():lower()) then
+ creature:remove()
+ local oldIzcandar = Game.createMonster("Izcandar the Banished", position, true, true)
+ if oldIzcandar then
+ oldIzcandar:registerEvent("izcandarThink")
+ oldIzcandar:addHealth(-(oldIzcandar:getHealth() - health))
+ id = oldIzcandar:getId()
+ end
+ end
+
+ addEvent(function(cid_)
+ local c = Creature(cid_)
+
+ if not c then
+ return true
+ end
+
+ if isInArray({ "izcandar the banished" }, c:getName():lower()) then
+ local h_ = c:getHealth()
+ local p_ = c:getPosition()
+
+ c:remove()
+
+ local newIzcandar = Game.createMonster(name, p_, true, true)
+
+ if newIzcandar then
+ newIzcandar:registerEvent("izcandarThink")
+ newIzcandar:addHealth(-(newIzcandar:getHealth() - h_))
+ end
+ else
+ return true
+ end
+ end, math.random(10, 20) * 1000, id)
+end
+
+local creaturescripts_Izcandar = CreatureEvent("izcandarThink")
+
+function creaturescripts_Izcandar.onThink(creature, interval)
+ if not creature:isMonster() then
+ return true
+ end
+
+ local health = creature:getHealth()
+ local position = creature:getPosition()
+ local cName = creature:getName():lower()
+
+ if position:isInRange(sides[1].fromPosition, sides[1].toPosition) and not (cName == "izcandar champion of winter") then
+ transformIzcandar(creature:getId(), "izcandar champion of winter", health, position)
+ Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.izcandarOutfit, 1)
+ elseif position:isInRange(sides[2].fromPosition, sides[2].toPosition) and not (cName == "izcandar champion of summer") then
+ transformIzcandar(creature:getId(), "izcandar champion of summer", health, position)
+ Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.izcandarOutfit, 2)
+ end
+
+ return true
+end
+
+creaturescripts_Izcandar:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua
new file mode 100644
index 00000000000..a2005f8641d
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua
@@ -0,0 +1,136 @@
+local questlog = {
+ [1] = {
+ bossName = "Faceless Bane",
+ storageQuestline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline,
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedralGlobal.FacelessTime,
+ middlePosition = Position(33617, 32563, 13),
+ maxValue = 4,
+ },
+ [2] = {
+ bossName = "Maxxenius",
+ storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount,
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer,
+ middlePosition = Position(32208, 32048, 14),
+ maxValue = 5,
+ },
+ [3] = {
+ bossName = "Alptramun",
+ storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount,
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunTimer,
+ middlePosition = Position(32208, 32048, 14),
+ maxValue = 5,
+ },
+ [4] = {
+ bossName = "Izcandar the Banished",
+ storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount,
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer,
+ middlePosition = Position(32208, 32048, 14),
+ maxValue = 5,
+ },
+ [5] = {
+ bossName = "Izcandar Champion of Winter",
+ storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount,
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer,
+ middlePosition = Position(32208, 32048, 14),
+ maxValue = 5,
+ },
+ [6] = {
+ bossName = "Izcandar Champion of Summer",
+ storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount,
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer,
+ middlePosition = Position(32208, 32048, 14),
+ maxValue = 5,
+ },
+ [7] = {
+ bossName = "Plagueroot",
+ storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount,
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.PlagueRootTimer,
+ middlePosition = Position(32208, 32048, 14),
+ maxValue = 5,
+ },
+ [8] = {
+ bossName = "Malofur Mangrinder",
+ storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount,
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MalofurTimer,
+ middlePosition = Position(32208, 32048, 14),
+ maxValue = 5,
+ },
+ [9] = {
+ bossName = "The Nightmare Beast",
+ storageQuestline = Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline,
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.NightmareTimer,
+ middlePosition = Position(32207, 32045, 15),
+ maxValue = 2,
+ },
+}
+
+local alptramunSummons = {
+ [1] = {
+ name = "unpleasant dream",
+ minValue = 0,
+ maxValue = 9,
+ },
+ [2] = {
+ name = "horrible dream",
+ minValue = 9,
+ maxValue = 18,
+ },
+ [3] = {
+ name = "nightmarish dream",
+ minValue = 18,
+ maxValue = 27,
+ },
+ [4] = {
+ name = "mind-wrecking dream",
+ minValue = 27,
+ maxValue = 36,
+ },
+}
+
+local creaturescripts_dreamCourtsDeath = CreatureEvent("dreamCourtsDeath")
+
+function creaturescripts_dreamCourtsDeath.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified)
+ if not creature:isMonster() or creature:getMaster() then
+ return true
+ end
+
+ local cName = creature:getName()
+
+ if cName:lower() == "plant abomination" then
+ local cPos = creature:getPosition()
+ Game.createMonster("plant attendant", cPos)
+ end
+
+ for _, k in pairs(questlog) do
+ if cName == k.bossName then
+ for pid, _ in pairs(creature:getDamageMap()) do
+ local attackerPlayer = Player(pid)
+
+ if attackerPlayer then
+ if attackerPlayer:getStorageValue(k.storageQuestline) <= k.maxValue then
+ attackerPlayer:setStorageValue(k.storageQuestline, attackerPlayer:getStorageValue(k.storageQuestline) + 1)
+ end
+ attackerPlayer:setStorageValue(k.storageTimer, os.time() + 20 * 60 * 60)
+ end
+ end
+
+ if cName:lower() == "alptramun" then
+ Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, 0)
+ end
+ end
+ end
+
+ local summonsKilled = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled)
+
+ for _, k in pairs(alptramunSummons) do
+ if cName:lower() == k.name then
+ if summonsKilled >= k.minValue and summonsKilled <= k.maxValue then
+ Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, summonsKilled + 1)
+ end
+ end
+ end
+
+ return true
+end
+
+creaturescripts_dreamCourtsDeath:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua
new file mode 100644
index 00000000000..268166d61e0
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua
@@ -0,0 +1,65 @@
+local summons = { "Burster Spectre", "Gazer Spectre", "Ripper Spectre" }
+local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FacelessLifes
+
+local creaturescripts_facelessBane = CreatureEvent("facelessThink")
+
+function creaturescripts_facelessBane.onThink(creature, interval)
+ if not creature:isMonster() then
+ return true
+ end
+
+ local lifes = creature:getStorageValue(storage)
+ local percentageHealth = (creature:getHealth() / creature:getMaxHealth()) * 100
+
+ if lifes <= 3 then
+ if lifes < 0 then
+ creature:setStorageValue(storage, 0)
+ end
+ if percentageHealth <= 20 then
+ creature:addHealth(creature:getMaxHealth())
+ creature:registerEvent("facelessHealth")
+
+ for i = 1, #summons do
+ Game.createMonster(summons[i], creature:getPosition(), true, true)
+ end
+
+ creature:setStorageValue(storage, lifes + 1)
+ Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FacelessLifes, 0)
+ end
+ end
+
+ return true
+end
+
+creaturescripts_facelessBane:register()
+
+local creaturescripts_facelessBane = CreatureEvent("facelessHealth")
+
+function creaturescripts_facelessBane.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
+ if not creature:isMonster() then
+ return primaryDamage, primaryType, secondaryDamage, secondaryType
+ end
+
+ if creature:getName():lower() == "maxxenius" then
+ if primaryType == COMBAT_ENERGYDAMAGE then
+ creature:addHealth(primaryDamage)
+ primaryDamage = 0
+ end
+ elseif creature:getName():lower() == "alptramun" then
+ if primaryType == COMBAT_DEATHDAMAGE then
+ creature:addHealth(primaryDamage)
+ primaryDamage = 0
+ end
+ elseif creature:getName():lower() == "faceless bane" then
+ primaryDamage = 0
+ elseif creature:getName():lower() == "plagueroot" then
+ if primaryType == COMBAT_EARTHDAMAGE then
+ creature:addHealth(primaryDamage)
+ primaryDamage = 0
+ end
+ end
+
+ return primaryDamage, primaryType, secondaryDamage, secondaryType
+end
+
+creaturescripts_facelessBane:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua
new file mode 100644
index 00000000000..9325e2a48e4
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua
@@ -0,0 +1,68 @@
+local spectreTime = 15 * 1000
+local phantasmTime = 10 * 1000
+local spectre = createConditionObject(CONDITION_OUTFIT)
+setConditionParam(spectre, CONDITION_PARAM_TICKS, spectreTime)
+addOutfitCondition(spectre, { lookType = 235 })
+local phantasm = createConditionObject(CONDITION_OUTFIT)
+setConditionParam(phantasm, CONDITION_PARAM_TICKS, phantasmTime)
+addOutfitCondition(phantasm, { lookType = 241 })
+
+local function resetArea()
+ local spectators = Game.getSpectators(Position(32206, 32045, 15), false, true, 14, 14, 14, 14)
+
+ for _, p in pairs(spectators) do
+ local player = Player(p:getId())
+ if player then
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse, 0)
+ end
+ end
+end
+
+local creaturescripts_nightmareCurse = CreatureEvent("nightmareCurse")
+
+function creaturescripts_nightmareCurse.onThink(creature, interval)
+ if not creature:isPlayer() then
+ return true
+ end
+
+ local player = Player(creature)
+ local stage = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse)
+
+ if stage == 1 and not player:getCondition(CONDITION_OUTFIT, spectre) then
+ doAddCondition(player, spectre)
+
+ addEvent(function(cid)
+ local p = Player(cid)
+
+ if p then
+ p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, 2)
+ end
+ end, spectreTime, player:getId())
+ elseif stage == 2 and not player:getCondition(CONDITION_OUTFIT, phantasm) then
+ doAddCondition(player, phantasm)
+
+ addEvent(function(cid)
+ local p = Player(cid)
+
+ if p and p:getCondition(CONDITION_OUTFIT, phantasm) then
+ resetArea()
+ Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse, 0)
+ p:teleportTo(Position(32213, 32083, 15))
+ p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, -1)
+ p:unregisterEvent("nightmareCurse")
+ end
+ end, phantasmTime, player:getId())
+ elseif (stage == 1 or stage == 2) and (player:getCondition(CONDITION_OUTFIT, spectre) or player:getCondition(CONDITION_OUTFIT, phantasm)) then
+ addEvent(function(cid)
+ local p = Player(cid)
+
+ if p then
+ p:getPosition():sendMagicEffect(CONST_ME_SLEEP)
+ end
+ end, 1 * 1000, player:getId())
+ end
+
+ return true
+end
+
+creaturescripts_nightmareCurse:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dreamCourts.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dreamCourts.lua
new file mode 100644
index 00000000000..ec97b338bba
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dreamCourts.lua
@@ -0,0 +1,88 @@
+local templeEffects = {
+ Position(32594, 32615, 9),
+ Position(32595, 32614, 9),
+ Position(32596, 32615, 9),
+ Position(32597, 32615, 9),
+ Position(32598, 32614, 9),
+ Position(32599, 32614, 9),
+ Position(32599, 32615, 9),
+ Position(32600, 32615, 9),
+ Position(32601, 32614, 9),
+ Position(32602, 32615, 9),
+ Position(32603, 32614, 9),
+ Position(32604, 32614, 9),
+ Position(32604, 32615, 9),
+ Position(32605, 32615, 9),
+ Position(32606, 32614, 9),
+ Position(32606, 32615, 9),
+ Position(32608, 32614, 9),
+ Position(32608, 32615, 9),
+ Position(32609, 32614, 9),
+ Position(32611, 32615, 9),
+ Position(32611, 32614, 9),
+ Position(32610, 32615, 9),
+ Position(32610, 32614, 9),
+ Position(32616, 32615, 9),
+ Position(32617, 32614, 9),
+ Position(32618, 32614, 9),
+ Position(32618, 32615, 9),
+ Position(32619, 32615, 9),
+}
+
+local maxxeniusEffects = {
+ fromPosition = Position(32200, 32041, 14),
+ toPosition = Position(32217, 32057, 14),
+ tileId = 9192,
+}
+
+local globalevents_dreamCourts = GlobalEvent("earthTrap")
+
+function globalevents_dreamCourts.onThink(interval)
+ local creature
+ local chance = math.random(1, 10)
+ local templeCenter = Position(32607, 32624, 9)
+ local templeWatchers = Game.getSpectators(templeCenter, false, true, 20, 20, 20, 20)
+
+ if #templeWatchers > 0 then
+ for i = 1, #templeEffects do
+ local position = templeEffects[i]
+ position:sendMagicEffect(CONST_ME_SMALLPLANTS)
+ creature = Tile(position):getTopCreature()
+ if creature and creature:isPlayer() then
+ doTargetCombatHealth(0, creature, COMBAT_EARTHDAMAGE, -(creature:getHealth() * 0.2), -(creature:getHealth() * 0.5), CONST_ME_SMALLPLANTS)
+ end
+ end
+ end
+
+ local maxxeniusCenter = Position(32208, 32048, 14)
+ local maxxeniuswatchers = Game.getSpectators(maxxeniusCenter, false, true, 11, 11, 11, 11)
+
+ if #maxxeniuswatchers > 0 then
+ for x = maxxeniusEffects.fromPosition.x, maxxeniusEffects.toPosition.x do
+ for y = maxxeniusEffects.fromPosition.y, maxxeniusEffects.toPosition.y do
+ local sqm = Tile(Position(x, y, 14))
+
+ if sqm:getItemById(maxxeniusEffects.tileId) then
+ sqm:getPosition():sendMagicEffect(CONST_ME_ENERGYHIT)
+
+ local min = -200
+ local max = -600
+
+ if sqm:getTopCreature() then
+ if sqm:getTopCreature():isMonster() and sqm:getTopCreature():getName():lower() == "maxxenius" then
+ min = -1111
+ max = -3333
+ end
+
+ doTargetCombatHealth(0, sqm:getTopCreature(), COMBAT_ENERGYDAMAGE, min, max, CONST_ME_ENERGYHIT)
+ end
+ end
+ end
+ end
+ end
+
+ return true
+end
+
+globalevents_dreamCourts:interval(3000)
+globalevents_dreamCourts:register()
diff --git a/data-otservbr-global/scripts/world_changes/the_dream_courts.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_the_dream_courts.lua
similarity index 61%
rename from data-otservbr-global/scripts/world_changes/the_dream_courts.lua
rename to data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_the_dream_courts.lua
index bb3bcc3a6a8..b6a340e1e68 100644
--- a/data-otservbr-global/scripts/world_changes/the_dream_courts.lua
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_the_dream_courts.lua
@@ -1,11 +1,11 @@
local dreamCourtsConfig = {
- ["Monday"] = { map = "plagueroot", bossName = "Plagueroot" },
- ["Tuesday"] = { map = "malofur_mangrinder", bossName = "Malofur Mangrinder" },
- ["Wednesday"] = { map = "maxxenius", bossName = "Maxxenius" },
- ["Thursday"] = { map = "alptramun", bossName = "Alptramun" },
+ ["Monday"] = { map = "alptramun", bossName = "Alptramun" },
+ ["Tuesday"] = { map = "izcandar_the_banished", bossName = "Izcandar the Banished" },
+ ["Wednesday"] = { map = "malofur_mangrinder", bossName = "Malofur Mangrinder" },
+ ["Thursday"] = { map = "maxxenius", bossName = "Maxxenius" },
["Friday"] = { map = "izcandar_the_banished", bossName = "Izcandar the Banished" },
- ["Saturday"] = { map = "maxxenius", bossName = "Maxxenius" },
- ["Sunday"] = { map = "alptramun", bossName = "Alptramun" },
+ ["Saturday"] = { map = "plagueroot", bossName = "Plagueroot" },
+ ["Sunday"] = { map = "maxxenius", bossName = "Maxxenius" },
}
local dreamCourtsEvent = GlobalEvent("DreamCourts")
@@ -20,6 +20,7 @@ function dreamCourtsEvent.onStartup()
Game.loadMap(DATA_DIRECTORY .. "/world/quest/the_dream_courts/" .. dayConfig.map .. ".otbm")
logger.info("[World Change] The Dream Courts today's boss is: {}!", dayConfig.bossName)
+
return true
end
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua
new file mode 100644
index 00000000000..d3d524f4b79
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua
@@ -0,0 +1,129 @@
+local default = {
+ [1] = {
+ itemPosition = Position(33618, 32546, 13),
+ toPosition = Position(32723, 32270, 8),
+ neededStorage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline,
+ value = 2,
+ blockedText = "Connect all three gateways to restore the circle of energy sustaining this nexus.",
+ },
+ [2] = {
+ itemPosition = Position(32720, 32270, 8),
+ toPosition = Position(33618, 32544, 13),
+ neededStorage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline,
+ value = 2,
+ blockedText = "Connect all three gateways to restore the circle of energy sustaining this nexus.",
+ },
+ [3] = {
+ itemPosition = Position(33619, 32526, 15),
+ toPosition = Position(33619, 32528, 15),
+ neededStorage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline,
+ value = 2,
+ msg = "You traverse the rubble with ease but more of it falls down behind you, essentially blocking your path once again.",
+ },
+}
+
+local dreamScar = {
+ [1] = {
+ day = "Monday",
+ bossName = "Alptramun",
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunTimer,
+ },
+ [2] = {
+ day = "Tuesday",
+ bossName = "Izcandar the Banished",
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer,
+ },
+ [3] = {
+ day = "Wednesday",
+ bossName = "Malofur Mangrinder",
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MalofurTimer,
+ },
+ [4] = {
+ day = "Thursday",
+ bossName = "Maxxenius",
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer,
+ },
+ [5] = {
+ day = "Friday",
+ bossName = "Izcandar the Banished",
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer,
+ },
+ [6] = {
+ day = "Saturday",
+ bossName = "Plagueroot",
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.PlaguerootTimer,
+ },
+ [7] = {
+ day = "Sunday",
+ bossName = "Maxxenius",
+ storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer,
+ },
+}
+
+local permission = Storage.Quest.U12_00.TheDreamCourts.DreamScar.Permission
+
+local movements_acessTeleports = MoveEvent()
+
+function movements_acessTeleports.onStepIn(creature, item, position, fromPosition)
+ local player = creature:getPlayer()
+
+ if not player then
+ return true
+ end
+
+ local iPos = item:getPosition()
+ local dreamScarTeleport = Position(32208, 32033, 13)
+ local nightmareTeleport = Position(32211, 32081, 15)
+
+ if item:getPosition() == nightmareTeleport then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount) >= 5 then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.NightmareTimer) > os.time() then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait to challenge The Nightmare Beast again!")
+ player:teleportTo(fromPosition)
+ else
+ player:teleportTo(Position(32211, 32075, 15))
+ end
+ else
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can not use this teleport yet.")
+ player:teleportTo(fromPosition)
+ end
+ end
+
+ for _, k in pairs(default) do
+ if k.itemPosition == iPos then
+ if player:getStorageValue(k.neededStorage) >= k.value then
+ player:teleportTo(k.toPosition)
+ if k.msg then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.msg)
+ end
+ else
+ player:teleportTo(fromPosition)
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.blockedText)
+ end
+ end
+ end
+
+ if iPos == dreamScarTeleport then
+ if player:getStorageValue(permission) >= 1 then
+ for i = 1, #dreamScar do
+ if os.date("%A") == dreamScar[i].day then
+ if player:getStorageValue(dreamScar[i].storageTimer) > os.time() then
+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait to challenge " .. dreamScar[i].bossName .. " again!")
+ player:teleportTo(fromPosition)
+ else
+ player:teleportTo(Position(32208, 32026, 13))
+ end
+ end
+ end
+ else
+ player:teleportTo(fromPosition)
+ end
+ end
+
+ player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
+
+ return true
+end
+
+movements_acessTeleports:aid(23103)
+movements_acessTeleports:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_corruptedNature.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_corruptedNature.lua
new file mode 100644
index 00000000000..41b85bcd20f
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_corruptedNature.lua
@@ -0,0 +1,29 @@
+local movements_corruptedNature = MoveEvent()
+
+function movements_corruptedNature.onStepIn(creature, item, position, fromPosition)
+ if not creature or not creature:isMonster() then
+ return true
+ end
+
+ local r = math.random(7000, 10000)
+ local cName = creature:getName()
+ local cPos = creature:getPosition()
+
+ if cName:lower() == "plant attendant" then
+ creature:remove()
+
+ local abomination = Game.createMonster("Plant Abomination", cPos)
+
+ if abomination then
+ abomination:registerEvent("dreamCourtsDeath")
+ abomination:say("The vile energy changes the attendant horribly!", TALKTYPE_MONSTER_SAY)
+ end
+ elseif cName:lower() == "plagueroot" then
+ creature:addHealth(r)
+ end
+
+ return true
+end
+
+movements_corruptedNature:id(28951)
+movements_corruptedNature:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_courtsEntrance.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_courtsEntrance.lua
new file mode 100644
index 00000000000..060d438dd20
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_courtsEntrance.lua
@@ -0,0 +1,153 @@
+local config = {
+ [1] = {
+ hisPosition = Position(33675, 32147, 7),
+ toPosition = Position(32354, 31249, 3),
+ storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline,
+ value = 1,
+ },
+ [2] = {
+ hisPosition = Position(32354, 31247, 3),
+ toPosition = Position(33675, 32149, 7),
+ storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline,
+ value = 1,
+ },
+ [3] = {
+ hisPosition = Position(33672, 32227, 7),
+ toPosition = Position(33584, 32209, 7),
+ storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline,
+ value = 1,
+ },
+ [4] = {
+ hisPosition = Position(33584, 32207, 7),
+ toPosition = Position(33672, 32229, 7),
+ storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline,
+ value = 1,
+ },
+ [5] = {
+ hisPosition = Position(32014, 31946, 13),
+ toPosition = Position(33695, 32189, 5),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = 1,
+ },
+ [6] = {
+ hisPosition = Position(33695, 32191, 5),
+ toPosition = Position(32014, 31948, 13),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = 1,
+ },
+ [7] = {
+ hisPosition = Position(32066, 31949, 13),
+ toPosition = Position(33688, 32113, 5),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = 1,
+ },
+ [8] = {
+ hisPosition = Position(33688, 32111, 5),
+ toPosition = Position(32066, 31951, 13),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = 1,
+ },
+ [9] = {
+ hisPosition = Position(32016, 32037, 13),
+ toPosition = Position(32057, 32001, 13),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush,
+ value = -1,
+ },
+ [10] = {
+ hisPosition = Position(32055, 32001, 13),
+ toPosition = Position(32016, 32035, 13),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush,
+ value = -1,
+ },
+ [11] = {
+ hisPosition = Position(32041, 32022, 14),
+ toPosition = Position(32042, 31924, 15),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = -1,
+ },
+ [12] = {
+ hisPosition = Position(32042, 31922, 15),
+ toPosition = Position(32041, 32024, 14),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = -1,
+ },
+ [13] = {
+ hisPosition = Position(32043, 31954, 15),
+ toPosition = Position(32095, 32038, 13),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = -1,
+ },
+ [14] = {
+ hisPosition = Position(32042, 31938, 15),
+ toPosition = Position(32208, 32093, 13),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = -1,
+ },
+ [15] = {
+ hisPosition = Position(32042, 31939, 15),
+ toPosition = Position(32208, 32093, 13),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = -1,
+ },
+ [16] = {
+ hisPosition = Position(32043, 31938, 15),
+ toPosition = Position(32208, 32093, 13),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = -1,
+ },
+ [17] = {
+ hisPosition = Position(32043, 31939, 15),
+ toPosition = Position(32208, 32093, 13),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = -1,
+ },
+ [18] = {
+ hisPosition = Position(32208, 32091, 13),
+ toPosition = Position(32043, 31943, 15),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = -1,
+ },
+ [19] = {
+ hisPosition = Position(32203, 32078, 14),
+ toPosition = Position(33672, 32118, 7),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = -1,
+ },
+ [20] = {
+ hisPosition = Position(32217, 32071, 14),
+ toPosition = Position(33718, 32182, 7),
+ storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline,
+ value = -1,
+ },
+}
+
+local storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline
+
+local movements_courtsEntrance = MoveEvent()
+
+function movements_courtsEntrance.onStepIn(creature, item, position, fromPosition)
+ local player = creature:getPlayer()
+
+ if not player then
+ return true
+ end
+
+ local posItem = item:getPosition()
+
+ for _, k in pairs(config) do
+ if k.hisPosition == posItem then
+ if player:getStorageValue(k.storage) >= k.value then
+ player:teleportTo(k.toPosition)
+ else
+ player:teleportTo(fromPosition)
+ end
+ end
+ end
+
+ player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
+
+ return true
+end
+
+movements_courtsEntrance:aid(23100)
+movements_courtsEntrance:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_crackedTile.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_crackedTile.lua
new file mode 100644
index 00000000000..40baa621402
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_crackedTile.lua
@@ -0,0 +1,19 @@
+local movements_crackedTile = MoveEvent()
+
+function movements_crackedTile.onStepIn(creature, item, position, fromPosition)
+ local player = Player(creature:getId())
+
+ if not player then
+ return true
+ end
+
+ local min = player:getMaxHealth() * 0.2
+ local max = player:getMaxHealth() * 0.5
+
+ doTargetCombat(0, player, COMBAT_DEATHDAMAGE, -min, -max, CONST_ME_MORTAREA, ORIGIN_NONE)
+
+ return true
+end
+
+movements_crackedTile:aid(23106)
+movements_crackedTile:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua
new file mode 100644
index 00000000000..d5f61ae2bd1
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua
@@ -0,0 +1,51 @@
+local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedralGlobal.FacelessTiles
+
+local function setActionId(itemid, position, aid)
+ local item = Tile(position):getItemById(itemid)
+
+ if item and item:getActionId() ~= aid then
+ item:setActionId(aid)
+ end
+end
+
+local function isnotImmortal()
+ local spectators = Game.getSpectators(Position(33617, 32563, 13), false, false, 10, 10, 10, 10)
+
+ for _, c in pairs(spectators) do
+ if c:isMonster() then
+ if c:getName():lower() == "faceless bane" then
+ c:unregisterEvent("facelessHealth")
+ end
+ end
+ end
+end
+
+local movements_facelessTiles = MoveEvent()
+
+function movements_facelessTiles.onStepIn(creature, item, position, fromPosition)
+ local player = creature:getPlayer()
+
+ if not player then
+ return true
+ end
+
+ local isImmortal = Game.getStorageValue(storage)
+
+ if isImmortal == 5 then
+ Game.setStorageValue(storage, 0)
+ creature:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
+ isnotImmortal()
+ elseif isImmortal < 0 then
+ Game.setStorageValue(storage, 0)
+ elseif isImmortal >= 0 and isImmortal < 5 then
+ Game.setStorageValue(storage, isImmortal + 1)
+ creature:getPosition():sendMagicEffect(CONST_ME_YELLOWENERGY)
+ item:setActionId(0)
+ addEvent(setActionId, (10 * 1000), item.itemid, position, 23108)
+ end
+
+ return true
+end
+
+movements_facelessTiles:aid(23108)
+movements_facelessTiles:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_slimeLooktype.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_slimeLooktype.lua
new file mode 100644
index 00000000000..b842555484e
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_slimeLooktype.lua
@@ -0,0 +1,28 @@
+local movements_library_mazzinor = MoveEvent()
+
+function movements_library_mazzinor.onStepIn(creature, item, position, fromPosition)
+ local player = creature:getPlayer()
+
+ if not player then
+ return true
+ end
+
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) >= 1 then
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar) < 1 then
+ if creature:getOutfit().lookType == 19 and player:getItemCount(29310) >= 1 then
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar, 1)
+ player:teleportTo(Position(32727, 32280, 8))
+ player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
+ player:removeCondition(CONDITION_OUTFIT)
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb) == 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar) == 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple) == 1 then
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 2)
+ end
+ end
+ end
+ end
+
+ return true
+end
+
+movements_library_mazzinor:aid(23102)
+movements_library_mazzinor:register()
diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua
new file mode 100644
index 00000000000..00562a98375
--- /dev/null
+++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua
@@ -0,0 +1,31 @@
+local spiderName = "Lucifuga Aranea"
+
+local function setActionId(itemid, position, aid)
+ local item = Tile(position):getItemById(itemid)
+
+ if item and item:getActionId() ~= aid then
+ item:setActionId(aid)
+ end
+end
+
+local movements_spiderSummon = MoveEvent()
+
+function movements_spiderSummon.onStepIn(creature, item, position, fromPosition)
+ local player = creature:getPlayer()
+
+ if not player then
+ return true
+ end
+
+ if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait) == 1 then
+ local r = math.random(1, 10)
+ Game.createMonster(spiderName, position)
+ item:setActionId(0)
+ addEvent(setActionId, r * (1000 * 60), item.itemid, position, 23120)
+ end
+
+ return true
+end
+
+movements_spiderSummon:aid(23120)
+movements_spiderSummon:register()
diff --git a/data-otservbr-global/scripts/spells/monster/alptramun_summon.lua b/data-otservbr-global/scripts/spells/monster/alptramun_summon.lua
new file mode 100644
index 00000000000..2b5f1c91023
--- /dev/null
+++ b/data-otservbr-global/scripts/spells/monster/alptramun_summon.lua
@@ -0,0 +1,59 @@
+local combat = Combat()
+combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_NONE)
+combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SOUND_PURPLE)
+
+local area = createCombatArea(AREA_CIRCLE2X2)
+combat:setArea(area)
+
+local config = {
+ [1] = { name = "unpleasant dream" },
+ [2] = { name = "horrible dream" },
+ [3] = { name = "nightmarish dream" },
+ [4] = { name = "mind-wrecking dream" },
+}
+
+local maxsummons = 5
+
+local spell = Spell("instant")
+
+function spell.onCastSpell(creature, var)
+ local monsterName = ""
+ local randomName = math.random(1, #config)
+ local randomSummon = math.random(1, 4)
+ local summonsKilled = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled) or -1
+
+ if summonsKilled >= 0 and summonsKilled <= 9 then
+ monsterName = config[1].name
+ elseif summonsKilled > 9 and summonsKilled <= 18 then
+ monsterName = config[2].name
+ elseif summonsKilled > 18 and summonsKilled <= 27 then
+ monsterName = config[3].name
+ elseif summonsKilled > 27 and summonsKilled <= 36 then
+ monsterName = config[4].name
+ else
+ monsterName = config[randomName].name
+ end
+
+ local summoncount = creature:getSummons()
+
+ if #summoncount < maxsummons then
+ for i = 1, randomSummon do
+ local mid = Game.createMonster(monsterName, creature:getPosition())
+ if not mid then
+ return
+ end
+ mid:setMaster(creature)
+ mid:registerEvent("dreamCourtsDeath")
+ end
+ end
+
+ return combat:execute(creature, var)
+end
+
+spell:name("alptramun summon")
+spell:words("###553")
+spell:isAggressive(false)
+spell:blockWalls(true)
+spell:needTarget(false)
+spell:needLearn(true)
+spell:register()
diff --git a/data-otservbr-global/scripts/spells/monster/cold_of_winter.lua b/data-otservbr-global/scripts/spells/monster/cold_of_winter.lua
new file mode 100644
index 00000000000..7d816cd4e87
--- /dev/null
+++ b/data-otservbr-global/scripts/spells/monster/cold_of_winter.lua
@@ -0,0 +1,46 @@
+local combat = Combat()
+combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
+combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SNOWBALL)
+combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
+
+combat:setArea(createCombatArea({
+ { 0, 1, 0 },
+ { 1, 3, 1 },
+ { 0, 1, 0 },
+}))
+
+function spellCallbackColdOfWinter(param)
+ local tile = Tile(Position(param.pos))
+ if tile then
+ if tile:getTopCreature() and tile:getTopCreature():isMonster() then
+ if tile:getTopCreature():getName():lower():find("izcandar") then
+ tile:getTopCreature():addHealth(math.random(0, 1500))
+ end
+ end
+ end
+end
+
+function onTargetTileColdOfWinter(cid, pos)
+ local param = {}
+ param.cid = cid
+ param.pos = pos
+ param.count = 0
+ spellCallbackColdOfWinter(param)
+end
+
+setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileColdOfWinter")
+
+local spell = Spell("instant")
+
+function spell.onCastSpell(creature, var)
+ return combat:execute(creature, var)
+end
+
+spell:name("cold of winter")
+spell:words("###555")
+spell:needDirection(true)
+spell:isAggressive(false)
+spell:blockWalls(true)
+spell:needTarget(false)
+spell:needLearn(true)
+spell:register()
diff --git a/data-otservbr-global/scripts/spells/monster/generator_wave.lua b/data-otservbr-global/scripts/spells/monster/generator_wave.lua
new file mode 100644
index 00000000000..79680c08e79
--- /dev/null
+++ b/data-otservbr-global/scripts/spells/monster/generator_wave.lua
@@ -0,0 +1,49 @@
+local combat = Combat()
+combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
+combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
+
+combat:setArea(createCombatArea({
+ { 0, 0, 0, 1, 0, 0, 0 },
+ { 0, 0, 1, 1, 1, 0, 0 },
+ { 0, 1, 1, 1, 1, 1, 0 },
+ { 1, 1, 1, 3, 1, 1, 1 },
+ { 0, 1, 1, 1, 1, 1, 0 },
+ { 0, 0, 1, 1, 1, 0, 0 },
+ { 0, 0, 0, 1, 0, 0, 0 },
+}))
+
+function spellCallbackGenerator(param)
+ local sqm = Tile(Position(param.pos))
+
+ if sqm then
+ local monster = sqm:getTopCreature()
+ if monster and monster:getName():lower() == "maxxenius" then
+ doTargetCombatHealth(0, monster, COMBAT_ENERGYDAMAGE, -999, -1999, CONST_ME_ENERGYAREA)
+ end
+ end
+end
+
+function onTargetTileGenerator(cid, pos)
+ local param = {}
+
+ param.cid = cid
+ param.pos = pos
+ param.count = 0
+ spellCallbackGenerator(param)
+end
+
+setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileGenerator")
+
+local spell = Spell("instant")
+
+function spell.onCastSpell(creature, var)
+ return combat:execute(creature, var)
+end
+
+spell:name("generator wave")
+spell:words("###551")
+spell:needDirection(false)
+spell:isSelfTarget(true)
+spell:needTarget(false)
+spell:needLearn(true)
+spell:register()
diff --git a/data-otservbr-global/scripts/spells/monster/heat_of_summer.lua b/data-otservbr-global/scripts/spells/monster/heat_of_summer.lua
new file mode 100644
index 00000000000..60f8c096ec2
--- /dev/null
+++ b/data-otservbr-global/scripts/spells/monster/heat_of_summer.lua
@@ -0,0 +1,49 @@
+local combat = Combat()
+combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
+combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
+
+combat:setArea(createCombatArea({
+ { 0, 1, 0 },
+ { 0, 1, 0 },
+ { 0, 1, 0 },
+ { 0, 1, 0 },
+ { 0, 3, 0 },
+}))
+
+function spellCallbackHeatOfSummer(param)
+ local tile = Tile(Position(param.pos))
+
+ if tile then
+ if tile:getTopCreature() and tile:getTopCreature():isMonster() then
+ if tile:getTopCreature():getName():lower():find("izcandar") then
+ tile:getTopCreature():addHealth(math.random(0, 1500))
+ end
+ end
+ end
+end
+
+function onTargetTileHeatOfSummer(cid, pos)
+ local param = {}
+
+ param.cid = cid
+ param.pos = pos
+ param.count = 0
+ spellCallbackHeatOfSummer(param)
+end
+
+setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileHeatOfSummer")
+
+local spell = Spell("instant")
+
+function spell.onCastSpell(creature, var)
+ return combat:execute(creature, var)
+end
+
+spell:name("heat of summer")
+spell:words("###554")
+spell:needDirection(true)
+spell:isAggressive(false)
+spell:blockWalls(true)
+spell:needTarget(false)
+spell:needLearn(true)
+spell:register()
diff --git a/data-otservbr-global/scripts/spells/monster/malofur_explosion.lua b/data-otservbr-global/scripts/spells/monster/malofur_explosion.lua
new file mode 100644
index 00000000000..5d3a743976e
--- /dev/null
+++ b/data-otservbr-global/scripts/spells/monster/malofur_explosion.lua
@@ -0,0 +1,124 @@
+local BOOOM = Combat()
+BOOOM:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
+BOOOM:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
+BOOOM:setFormula(COMBAT_FORMULA_DAMAGE, -200, -600, -10000, -20000)
+BOOOM:setArea(createCombatArea({
+ { 0, 1, 1, 1, 0 },
+ { 0, 1, 3, 1, 0 },
+ { 0, 1, 1, 1, 0 },
+}))
+
+local BOOOOM = Combat()
+BOOOOM:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
+BOOOOM:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
+BOOOOM:setFormula(COMBAT_FORMULA_DAMAGE, -200, -600, -10000, -20000)
+BOOOOM:setArea(createCombatArea({
+ { 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 1, 1, 1, 0, 0 },
+ { 0, 1, 1, 1, 1, 1, 0 },
+ { 0, 1, 1, 3, 1, 1, 0 },
+ { 0, 1, 1, 1, 1, 1, 0 },
+ { 0, 0, 1, 1, 1, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0 },
+}))
+
+local BOOOOOM = Combat()
+BOOOOOM:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
+BOOOOOM:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
+BOOOOOM:setFormula(COMBAT_FORMULA_DAMAGE, -200, -600, -10000, -20000)
+BOOOOOM:setArea(createCombatArea({
+ { 0, 0, 1, 1, 1, 0, 0 },
+ { 0, 1, 1, 1, 1, 1, 0 },
+ { 1, 1, 1, 1, 1, 1, 1 },
+ { 1, 1, 1, 3, 1, 1, 1 },
+ { 1, 1, 1, 1, 1, 1, 1 },
+ { 0, 1, 1, 1, 1, 1, 0 },
+ { 0, 0, 1, 1, 1, 0, 0 },
+}))
+
+local BOOOOOOM = Combat()
+BOOOOOOM:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
+BOOOOOOM:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
+BOOOOOOM:setFormula(COMBAT_FORMULA_DAMAGE, -200, -600, -10000, -20000)
+BOOOOOOM:setArea(createCombatArea({
+ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0 },
+ { 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0 },
+ { 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
+ { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
+ { 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1 },
+ { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
+ { 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
+ { 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0 },
+ { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 },
+}))
+
+local spell = Spell("instant")
+
+function spell.onCastSpell(creature, var)
+ if not creature:isMonster() then
+ return false
+ end
+
+ local exaust = math.random(11, 41)
+
+ if creature:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Malofur) ~= 1 then
+ creature:say("RAAAARGH! I'M MASHING YE TO DUST!", TALKTYPE_MONSTER_SAY)
+ creature:say("BOOM!", TALKTYPE_MONSTER_SAY)
+ creature:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Malofur, 1)
+
+ addEvent(function(cid)
+ local c = Creature(cid)
+ if c then
+ local var = Variant(c:getPosition())
+ BOOOM:execute(c, var)
+ c:say("BOOOM!", TALKTYPE_MONSTER_SAY)
+ end
+ end, 3 * 1000, creature:getId())
+
+ addEvent(function(cid)
+ local c = Creature(cid)
+ if c then
+ local var = Variant(c:getPosition())
+ BOOOOM:execute(c, var)
+ c:say("BOOOOM!", TALKTYPE_MONSTER_SAY)
+ end
+ end, 5 * 1000, creature:getId())
+
+ addEvent(function(cid)
+ local c = Creature(cid)
+ if c then
+ local var = Variant(c:getPosition())
+ BOOOOOM:execute(c, var)
+ c:say("BOOOOOM!", TALKTYPE_MONSTER_SAY)
+ end
+ end, 7 * 1000, creature:getId())
+
+ addEvent(function(cid)
+ local c = Creature(cid)
+ if c then
+ local var = Variant(c:getPosition())
+ BOOOOOOM:execute(c, var)
+ c:say("BOOOOOOM!", TALKTYPE_MONSTER_SAY)
+ end
+ end, 9 * 1000, creature:getId())
+
+ addEvent(function(cid)
+ local c = Creature(cid)
+ if c then
+ c:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Malofur, 0)
+ end
+ end, exaust * 1000, creature:getId())
+ end
+
+ return true
+end
+
+spell:name("malofur explosion")
+spell:words("###559")
+spell:isAggressive(false)
+spell:blockWalls(true)
+spell:needTarget(false)
+spell:needLearn(true)
+spell:register()
diff --git a/data-otservbr-global/scripts/spells/monster/maxxenius_energy_elemental.lua b/data-otservbr-global/scripts/spells/monster/maxxenius_energy_elemental.lua
new file mode 100644
index 00000000000..927efd9a6e4
--- /dev/null
+++ b/data-otservbr-global/scripts/spells/monster/maxxenius_energy_elemental.lua
@@ -0,0 +1,100 @@
+local arrayArea = {
+ { 0, -4 },
+ { -1, -3 },
+ { 0, -3 },
+ { 1, -3 },
+ { -2, -2 },
+ { -1, -2 },
+ { 0, -2 },
+ { 1, -2 },
+ { 2, -2 },
+ { 3, -1 },
+ { -2, -1 },
+ { -1, -1 },
+ { 0, -1 },
+ { 1, -1 },
+ { 2, -1 },
+ { 3, -1 },
+ { -4, 0 },
+ { -3, 0 },
+ { -2, 0 },
+ { -1, 0 },
+ { 0, 0 },
+ { 1, 0 },
+ { 2, 0 },
+ { 3, 0 },
+ { 4, 0 },
+ { -3, 1 },
+ { -2, 1 },
+ { -1, 1 },
+ { 0, 1 },
+ { 1, 1 },
+ { 2, 1 },
+ { 3, 1 },
+ { -2, 2 },
+ { -1, 2 },
+ { 0, 2 },
+ { 1, 2 },
+ { 2, 2 },
+ { -1, 3 },
+ { 0, 3 },
+ { 1, 3 },
+ { 0, 4 },
+}
+
+local area = createCombatArea(arrayArea)
+
+local function spellDamage(id, centerpos, target)
+ local damage = math.random(1000, 2000)
+ local target = Creature(target)
+ local monster = Monster(id)
+
+ if not target and monster then
+ centerpos = monster:getPosition()
+ elseif target then
+ centerpos = target:getPosition()
+ end
+
+ for _, pos in pairs(arrayArea) do
+ local newpos = Position(centerpos.x + pos[1], centerpos.y + pos[2], centerpos.z)
+ if newpos then
+ local creature = Tile(newpos):getTopCreature()
+ if creature then
+ doTargetCombatHealth(0, creature, COMBAT_ENERGYDAMAGE, -1000, -2000, CONST_ME_ENERGYHIT)
+ end
+ newpos:sendMagicEffect(CONST_ME_ENERGYHIT)
+ end
+ end
+end
+
+local combat = Combat()
+combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
+combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)
+
+local looktype = createConditionObject(CONDITION_OUTFIT)
+setConditionParam(looktype, CONDITION_PARAM_TICKS, 5000)
+addOutfitCondition(looktype, { lookType = 290 })
+
+local spell = Spell("instant")
+
+function spell.onCastSpell(creature, var)
+ local target = creature:getTarget()
+
+ if target:isPlayer() then
+ target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel a powerfull eletric charge building up!")
+ doAddCondition(target, looktype)
+ end
+
+ addEvent(spellDamage, 5 * 1000, creature:getId(), creature:getPosition(), target and target:getId() or 0)
+
+ return combat:execute(creature, var)
+end
+
+spell:name("maxxenius energy elemental")
+spell:words("###552")
+spell:needDirection(true)
+spell:isAggressive(false)
+spell:blockWalls(true)
+spell:needTarget(true)
+spell:needLearn(true)
+spell:register()
diff --git a/data-otservbr-global/scripts/spells/monster/nightmare_beast_curse.lua b/data-otservbr-global/scripts/spells/monster/nightmare_beast_curse.lua
new file mode 100644
index 00000000000..2a405c74748
--- /dev/null
+++ b/data-otservbr-global/scripts/spells/monster/nightmare_beast_curse.lua
@@ -0,0 +1,34 @@
+local spell = Spell("instant")
+
+function spell.onCastSpell(creature, var)
+ local hasCasted = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse)
+
+ if hasCasted == 0 then
+ local players = Game.getSpectators(cid:getPosition(), false, true, 14, 14, 14, 14)
+ local randomNumber = math.random(1, #players)
+
+ for _, k in pairs(players) do
+ local player = Player(k)
+ if player then
+ player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse, -1)
+ end
+ end
+
+ local newPlayer = Player(players[randomNumber]:getId())
+
+ newPlayer:registerEvent("nightmareCurse")
+ newPlayer:setStorageValue("nightmareCurse", 1)
+ newPlayer:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse, 1)
+ newPlayer:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The beast laid a terrible curse on you!")
+
+ Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse, 1)
+ end
+end
+
+spell:name("nightmare beast curse")
+spell:words("###560")
+spell:isAggressive(false)
+spell:blockWalls(true)
+spell:needTarget(true)
+spell:needLearn(true)
+spell:register()
diff --git a/data-otservbr-global/scripts/spells/monster/plagueroot_skill_reducer.lua b/data-otservbr-global/scripts/spells/monster/plagueroot_skill_reducer.lua
new file mode 100644
index 00000000000..acc9ff01785
--- /dev/null
+++ b/data-otservbr-global/scripts/spells/monster/plagueroot_skill_reducer.lua
@@ -0,0 +1,30 @@
+local combat = {}
+
+for i = 60, 85 do
+ combat[i] = Combat()
+ combat[i]:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
+
+ local condition = Condition(CONDITION_ATTRIBUTES)
+ condition:setParameter(CONDITION_PARAM_TICKS, 25000)
+ condition:setParameter(CONDITION_PARAM_SKILL_DISTANCEPERCENT, i)
+ condition:setParameter(CONDITION_PARAM_SKILL_MELEEPERCENT, i)
+ condition:setParameter(CONDITION_PARAM_SKILL_FISTPERCENT, i)
+
+ local area = createCombatArea(AREA_CIRCLE3X3)
+ combat[i]:setArea(area)
+ combat[i]:addCondition(condition)
+end
+
+local spell = Spell("instant")
+
+function spell.onCastSpell(creature, var)
+ return combat[math.random(60, 85)]:execute(creature, var)
+end
+
+spell:name("plagueroot skill reducer")
+spell:words("###561")
+spell:isAggressive(false)
+spell:blockWalls(true)
+spell:needTarget(false)
+spell:needLearn(true)
+spell:register()
diff --git a/data-otservbr-global/scripts/spells/monster/plagueroot_teleport.lua b/data-otservbr-global/scripts/spells/monster/plagueroot_teleport.lua
new file mode 100644
index 00000000000..7f6075cf177
--- /dev/null
+++ b/data-otservbr-global/scripts/spells/monster/plagueroot_teleport.lua
@@ -0,0 +1,88 @@
+local combat = Combat()
+combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
+combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLPLANTS)
+
+combat:setArea(createCombatArea({
+ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+ { 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1 },
+ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+}))
+
+function spellCallbackPlaguerootTeleport(param) end
+
+function onTargetTilePlaguerootTeleport(cid, pos)
+ local param = {}
+
+ param.cid = cid
+ param.pos = pos
+ param.count = 0
+ spellCallbackPlaguerootTeleport(param)
+end
+
+setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTilePlaguerootTeleport")
+
+local function teleportMonster(creature, centerPos, fromPos, toPos)
+ local position = { x = math.random(fromPos.x, toPos.x), y = math.random(fromPos.y, toPos.y), z = centerPos.z }
+ local tile = Tile(Position(position))
+ local count = 1
+
+ while not tile or tile:getItemByType(ITEM_TYPE_TELEPORT) or not tile:getGround() or tile:hasFlag(TILESTATE_BLOCKPATH) or tile:hasFlag(TILESTATE_PROTECTIONZONE) or tile:hasFlag(TILESTATE_BLOCKSOLID) or count < 5 do
+ position = Position(math.random(fromPos.x, toPos.x), math.random(fromPos.y, toPos.y), centerPos.z)
+ tile = Tile(position)
+ count = count + 1
+ end
+
+ if tile then
+ if position:isInRange(Position(32199, 32039, 14), Position(32216, 32057, 14)) then
+ creature:getPosition():sendMagicEffect(CONST_ME_POFF)
+ creature:teleportTo(position)
+ Position(position):sendMagicEffect(CONST_ME_TELEPORT)
+ end
+ end
+end
+
+local spell = Spell("instant")
+
+function spell.onCastSpell(creature, var)
+ if not creature:isMonster() then
+ return false
+ end
+
+ local centerPos = creature:getPosition()
+ local fromPos = { x = centerPos.x - 7, y = centerPos.y - 5, z = centerPos.z }
+ local toPos = { x = centerPos.x + 7, y = centerPos.y + 5, z = centerPos.z }
+
+ creature:say("PLAGUEROOT TUNNELS TO ANOTHER PLACE!", TALKTYPE_MONSTER_SAY)
+ teleportMonster(creature, centerPos, fromPos, toPos)
+
+ var = { type = 2, pos = { x = creature:getPosition().x, y = creature:getPosition().y, z = creature:getPosition().z } }
+
+ combat:execute(creature, var)
+
+ addEvent(function()
+ if creature then
+ var = { type = 2, pos = { x = creature:getPosition().x, y = creature:getPosition().y, z = creature:getPosition().z } }
+ combat:execute(creature, var)
+ end
+ end, 2 * 1000)
+
+ return true
+end
+
+spell:name("plagueroot teleport")
+spell:words("###558")
+spell:isAggressive(false)
+spell:blockWalls(true)
+spell:needTarget(false)
+spell:needLearn(true)
+spell:register()
diff --git a/data-otservbr-global/scripts/spells/monster/plant_abomination_wave.lua b/data-otservbr-global/scripts/spells/monster/plant_abomination_wave.lua
new file mode 100644
index 00000000000..84b2f0e1061
--- /dev/null
+++ b/data-otservbr-global/scripts/spells/monster/plant_abomination_wave.lua
@@ -0,0 +1,49 @@
+local combat = Combat()
+combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
+combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYPOISON)
+combat:setParameter(COMBAT_PARAM_SHOOT, CONST_ANI_EARTH)
+
+combat:setArea(createCombatArea({
+ { 0, 0, 1, 0, 0 },
+ { 0, 1, 1, 1, 0 },
+ { 1, 1, 3, 1, 1 },
+ { 0, 1, 1, 1, 0 },
+ { 0, 0, 1, 0, 0 },
+}))
+
+function spellCallbackAbominationWave(param)
+ local tile = Tile(Position(param.pos))
+
+ if tile then
+ if tile:getTopCreature() and tile:getTopCreature():isMonster() then
+ if tile:getTopCreature():getName():lower() == "plagueroot" then
+ tile:getTopCreature():addHealth(math.random(0, 1500))
+ end
+ end
+ end
+end
+
+function onTargetTileAbominationWave(cid, pos)
+ local param = {}
+
+ param.cid = cid
+ param.pos = pos
+ param.count = 0
+ spellCallbackAbominationWave(param)
+end
+
+setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileAbominationWave")
+
+local spell = Spell("instant")
+
+function spell.onCastSpell(creature, var)
+ return combat:execute(creature, var)
+end
+
+spell:name("plant abomination wave")
+spell:words("###557")
+spell:isAggressive(false)
+spell:blockWalls(true)
+spell:needTarget(true)
+spell:needLearn(true)
+spell:register()
diff --git a/data-otservbr-global/scripts/spells/monster/plant_attendant_wave.lua b/data-otservbr-global/scripts/spells/monster/plant_attendant_wave.lua
new file mode 100644
index 00000000000..d315e0ff692
--- /dev/null
+++ b/data-otservbr-global/scripts/spells/monster/plant_attendant_wave.lua
@@ -0,0 +1,44 @@
+local combat = Combat()
+combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
+combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLPLANTS)
+
+combat:setArea(createCombatArea({
+ { 1, 1, 1 },
+ { 1, 3, 1 },
+ { 1, 1, 1 },
+}))
+
+function spellCallbackAttendantWave(param)
+ local tile = Tile(Position(param.pos))
+ if tile then
+ if tile:getTopCreature() and tile:getTopCreature():isMonster() then
+ if tile:getTopCreature():getName():lower() == "plagueroot" then
+ tile:getTopCreature():addHealth(math.random(0, 1500))
+ end
+ end
+ end
+end
+
+function onTargetTileAttendantWave(cid, pos)
+ local param = {}
+ param.cid = cid
+ param.pos = pos
+ param.count = 0
+ spellCallbackAttendantWave(param)
+end
+
+setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileAttendantWave")
+
+local spell = Spell("instant")
+
+function spell.onCastSpell(creature, var)
+ return combat:execute(creature, var)
+end
+
+spell:name("plant attendant wave")
+spell:words("###556")
+spell:isAggressive(false)
+spell:blockWalls(true)
+spell:needTarget(false)
+spell:needLearn(true)
+spell:register()
diff --git a/data-otservbr-global/startup/tables/door_level.lua b/data-otservbr-global/startup/tables/door_level.lua
index 4739b040753..4108d0a044e 100644
--- a/data-otservbr-global/startup/tables/door_level.lua
+++ b/data-otservbr-global/startup/tables/door_level.lua
@@ -100,4 +100,13 @@ LevelDoorAction = {
{ x = 33214, y = 31671, z = 13 },
},
},
+ -- Doors for level 250
+ [1250] = {
+ itemId = false,
+ itemPos = {
+ { x = 32016, y = 32023, z = 13 },
+ { x = 32017, y = 31978, z = 13 },
+ { x = 32041, y = 31938, z = 13 },
+ },
+ },
}
diff --git a/data-otservbr-global/startup/tables/door_quest.lua b/data-otservbr-global/startup/tables/door_quest.lua
index 374f3c9a61f..3fee0ec470c 100644
--- a/data-otservbr-global/startup/tables/door_quest.lua
+++ b/data-otservbr-global/startup/tables/door_quest.lua
@@ -50,18 +50,6 @@ QuestDoorAction = {
itemId = false,
itemPos = { { x = 32467, y = 31969, z = 5 } },
},
- -- Edron
- [Storage.Kilmaresh.Sixth.Favor] = {
- itemId = false,
- itemPos = {
- { x = 33855, y = 31450, z = 9 },
- { x = 33855, y = 31496, z = 9 },
- { x = 33884, y = 31510, z = 9 },
- { x = 33884, y = 31536, z = 9 },
- { x = 33911, y = 31496, z = 9 },
- { x = 33912, y = 31466, z = 9 },
- },
- },
-- Rathleton quest door
[Storage.HeroRathleton.AccessDoor] = {
itemId = false,
@@ -667,21 +655,6 @@ QuestDoorAction = {
{ x = 32169, y = 31933, z = 7 },
},
},
- -- The dream courts door (Andrew Lyze npc)
- [Storage.Quest.U12_00.TheDreamCourts.AndrewDoor] = {
- itemId = 20450,
- itemPos = { { x = 32761, y = 32630, z = 7 } },
- },
- -- Kilmaresh doors
- -- [Storage.Kilmaresh.First.Title] = {
- -- itemId = false,
- -- itemPos = {
- -- {x = 33959, y = 31501, z = 4},
- -- {x = 33375, y = 31346, z = 5},
- -- {x = 33371, y = 31349, z = 4},
- -- {x = 33376, y = 31335, z = 3}
- -- }
- -- },
-- The Rookie Guard Quest - Mission 07: Attack!
-- The library vault door
[Storage.Quest.U9_1.TheRookieGuard.LibraryDoor] = {
@@ -759,7 +732,8 @@ QuestDoorAction = {
itemId = false,
itemPos = { { x = 33083, y = 31216, z = 8 } },
},
- [Storage.Quest.U12_20.GraveDanger.QuestLine] = {
+
+ [Storage.Quest.U12_20.GraveDanger.Questline] = {
itemId = false,
itemPos = {
{ x = 33264, y = 31993, z = 7 },
@@ -776,10 +750,11 @@ QuestDoorAction = {
{ x = 32012, y = 31565, z = 7 },
},
},
- [Storage.Quest.U12_20.GraveDanger.Bosses.KingZelosDoor] = {
+ [Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Room] = {
itemId = false,
itemPos = { { x = 32173, y = 31922, z = 8 } },
},
+
[Storage.Quest.U12_70.AdventuresOfGalthen.AccessDoor] = {
itemId = false,
itemPos = { { x = 32466, y = 32494, z = 8 } },
@@ -799,48 +774,40 @@ QuestDoorAction = {
{ x = 33470, y = 32786, z = 11 },
},
},
- [Storage.Kilmaresh.AccessDoor] = {
+ -- Kilmaresh Quest
+ [Storage.Quest.U12_20.KilmareshQuest.AccessDoor] = {
itemId = false,
itemPos = { { x = 33886, y = 31476, z = 7 } },
},
- [Storage.Kilmaresh.CatacombDoors] = {
- itemId = false,
- itemPos = {
- { x = 33855, y = 31450, z = 9 },
- { x = 33912, y = 31466, z = 9 },
- { x = 33855, y = 31496, z = 9 },
- { x = 33911, y = 31496, z = 9 },
- { x = 33884, y = 31510, z = 9 },
- { x = 33884, y = 31536, z = 9 },
- },
+ [Storage.Quest.U12_20.KilmareshQuest.Second.Investigating] = {
+ itemId = 31568,
+ itemPos = { { x = 33959, y = 31501, z = 4 } },
},
- [Storage.Quest.U12_60.APiratesTail.TentuglyDoor] = {
- itemId = false,
- itemPos = { { x = 33793, y = 31388, z = 6 } },
+ [Storage.Quest.U12_20.KilmareshQuest.Sixth.GryphonMask] = {
+ itemId = 9558,
+ itemPos = { { x = 33884, y = 31536, z = 9 } },
},
- [Storage.Quest.U12_00.TheDreamCourts.HauntedHouseAccess] = {
- itemId = false,
+ [Storage.Quest.U12_20.KilmareshQuest.Sixth.MirrorMask] = {
+ itemId = 9558,
+ itemPos = { { x = 33884, y = 31510, z = 9 } },
+ },
+ [Storage.Quest.U12_20.KilmareshQuest.Sixth.IvoryMask] = {
+ itemId = 9558,
itemPos = {
- { x = 32700, y = 32244, z = 9 },
- { x = 32700, y = 32255, z = 9 },
- { x = 32700, y = 32275, z = 8 },
- { x = 33088, y = 32388, z = 8 },
- { x = 32671, y = 32652, z = 7 },
- { x = 32606, y = 32629, z = 9 },
+ { x = 33911, y = 31496, z = 9 },
+ { x = 33855, y = 31496, z = 9 },
},
},
- [Storage.Quest.U12_00.TheDreamCourts.BuriedCathedralAccess] = {
- itemId = false,
+ [Storage.Quest.U12_20.KilmareshQuest.Sixth.SilverMask] = {
+ itemId = 9558,
itemPos = {
- { x = 32719, y = 32264, z = 8 },
- { x = 32728, y = 32280, z = 8 },
+ { x = 33855, y = 31450, z = 9 },
+ { x = 33912, y = 31466, z = 9 },
},
},
- [Storage.Quest.U12_00.TheDreamCourts.DreamScarAccess] = {
+ [Storage.Quest.U12_60.APiratesTail.TentuglyDoor] = {
itemId = false,
- itemPos = {
- { x = 31983, y = 32000, z = 14 },
- },
+ itemPos = { { x = 33793, y = 31388, z = 6 } },
},
[Storage.Quest.U12_40.TheOrderOfTheLion.AccessEastSide] = {
itemId = false,
diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua
index 5868efcd31b..883fe90ce48 100644
--- a/data-otservbr-global/startup/tables/item.lua
+++ b/data-otservbr-global/startup/tables/item.lua
@@ -1187,6 +1187,207 @@ ItemAction = {
{ x = 32741, y = 32382, z = 15 },
},
},
+ -- The Dream Courts Quest
+ [23100] = {
+ itemId = false,
+ itemPos = {
+ { x = 32217, y = 32071, z = 14 },
+ { x = 32043, y = 31954, z = 15 },
+ { x = 32203, y = 32078, z = 14 },
+ { x = 32066, y = 31949, z = 13 },
+ { x = 32042, y = 31922, z = 15 },
+ { x = 32354, y = 31247, z = 3 },
+ { x = 32055, y = 32001, z = 13 },
+ { x = 33688, y = 32111, z = 5 },
+ { x = 32043, y = 31939, z = 15 },
+ { x = 33675, y = 32147, z = 7 },
+ { x = 33695, y = 32191, z = 5 },
+ { x = 33584, y = 32207, z = 7 },
+ { x = 33672, y = 32227, z = 7 },
+ { x = 32042, y = 31938, z = 15 },
+ { x = 32043, y = 31938, z = 15 },
+ { x = 32014, y = 31946, z = 13 },
+ { x = 32042, y = 31939, z = 15 },
+ { x = 32016, y = 32037, z = 13 },
+ { x = 32041, y = 32022, z = 14 },
+ { x = 32208, y = 32091, z = 13 },
+ },
+ },
+ [23101] = {
+ itemId = false,
+ itemPos = {
+ { x = 33088, y = 32388, z = 8 },
+ { x = 32606, y = 32629, z = 9 },
+ { x = 31983, y = 31960, z = 14 },
+ { x = 33625, y = 32525, z = 14 },
+ { x = 33657, y = 32551, z = 14 },
+ { x = 33640, y = 32551, z = 14 },
+ { x = 32671, y = 32652, z = 7 },
+ { x = 32074, y = 31974, z = 14 },
+ { x = 32091, y = 31970, z = 14 },
+ { x = 31983, y = 32000, z = 14 },
+ { x = 32051, y = 31998, z = 14 },
+ { x = 32700, y = 32255, z = 9 },
+ { x = 32700, y = 32244, z = 9 },
+ { x = 32693, y = 32238, z = 8 },
+ { x = 32700, y = 32275, z = 8 },
+ { x = 32761, y = 32630, z = 7 },
+ { x = 32719, y = 32264, z = 8 },
+ },
+ },
+ [23102] = {
+ itemId = false,
+ itemPos = {
+ { x = 32729, y = 32280, z = 8 },
+ { x = 32729, y = 32279, z = 8 },
+ { x = 32729, y = 32281, z = 8 },
+ },
+ },
+ [23103] = {
+ itemId = false,
+ itemPos = {
+ { x = 33619, y = 32526, z = 15 },
+ { x = 32211, y = 32081, z = 15 },
+ { x = 32720, y = 32270, z = 8 },
+ { x = 33618, y = 32546, z = 13 },
+ { x = 32208, y = 32033, z = 13 },
+ },
+ },
+ [23104] = {
+ itemId = 29349,
+ itemPos = {
+ { x = 33054, y = 32335, z = 8 },
+ { x = 33081, y = 32355, z = 8 },
+ { x = 33091, y = 32319, z = 8 },
+ { x = 33091, y = 32301, z = 8 },
+ { x = 33092, y = 32347, z = 8 },
+ { x = 33051, y = 32309, z = 8 },
+ { x = 33081, y = 32349, z = 8 },
+ { x = 33083, y = 32338, z = 8 },
+ { x = 33058, y = 32323, z = 8 },
+ { x = 33103, y = 32344, z = 8 },
+ { x = 33093, y = 32338, z = 8 },
+ { x = 33093, y = 32356, z = 8 },
+ { x = 33055, y = 32297, z = 8 },
+ },
+ },
+ [23105] = {
+ itemId = false,
+ itemPos = {
+ { x = 33070, y = 32317, z = 8 },
+ { x = 33069, y = 32317, z = 8 },
+ { x = 33068, y = 32308, z = 8 },
+ },
+ },
+ [23106] = {
+ itemId = false,
+ itemPos = {
+ { x = 32616, y = 32620, z = 8 },
+ { x = 32663, y = 32645, z = 8 },
+ { x = 32667, y = 32656, z = 8 },
+ { x = 32662, y = 32658, z = 8 },
+ { x = 32641, y = 32647, z = 8 },
+ { x = 32643, y = 32633, z = 8 },
+ { x = 32640, y = 32631, z = 8 },
+ { x = 32628, y = 32635, z = 8 },
+ { x = 32635, y = 32618, z = 8 },
+ },
+ },
+ [23107] = {
+ itemId = 2082,
+ itemPos = {
+ { x = 32596, y = 32627, z = 9 },
+ },
+ },
+ [23108] = {
+ itemId = false,
+ itemPos = {
+ { x = 33623, y = 32563, z = 13 },
+ { x = 33611, y = 32558, z = 13 },
+ { x = 33619, y = 32567, z = 13 },
+ { x = 33614, y = 32557, z = 13 },
+ { x = 33620, y = 32557, z = 13 },
+ { x = 33623, y = 32558, z = 13 },
+ { x = 33610, y = 32561, z = 13 },
+ { x = 33611, y = 32563, z = 13 },
+ { x = 33624, y = 32561, z = 13 },
+ { x = 33621, y = 32567, z = 13 },
+ { x = 33613, y = 32567, z = 13 },
+ { x = 33617, y = 32558, z = 13 },
+ { x = 33615, y = 32567, z = 13 },
+ },
+ },
+ [23109] = {
+ itemId = false,
+ itemPos = {
+ { x = 32104, y = 31921, z = 13 },
+ { x = 32103, y = 31921, z = 13 },
+ },
+ },
+ [23111] = {
+ itemId = false,
+ itemPos = {
+ { x = 32062, y = 31938, z = 14 },
+ { x = 32062, y = 31937, z = 14 },
+ { x = 32061, y = 31939, z = 14 },
+ { x = 32061, y = 31938, z = 14 },
+ { x = 32061, y = 31937, z = 14 },
+ { x = 32062, y = 31939, z = 14 },
+ },
+ },
+ [23120] = {
+ itemId = false,
+ itemPos = {
+ { x = 32772, y = 32644, z = 10 },
+ { x = 32787, y = 32634, z = 10 },
+ { x = 32791, y = 32625, z = 10 },
+ { x = 32769, y = 32613, z = 10 },
+ { x = 32773, y = 32626, z = 10 },
+ { x = 32750, y = 32605, z = 10 },
+ { x = 32751, y = 32638, z = 10 },
+ { x = 32740, y = 32619, z = 10 },
+ { x = 32749, y = 32622, z = 10 },
+ { x = 32785, y = 32603, z = 10 },
+ { x = 32805, y = 32619, z = 10 },
+ { x = 32758, y = 32622, z = 10 },
+ { x = 32756, y = 32632, z = 10 },
+ { x = 32804, y = 32628, z = 10 },
+ { x = 32764, y = 32634, z = 10 },
+ { x = 32779, y = 32636, z = 10 },
+ { x = 32784, y = 32619, z = 10 },
+ { x = 32771, y = 32602, z = 10 },
+ { x = 32770, y = 32621, z = 10 },
+ { x = 32792, y = 32606, z = 10 },
+ { x = 32757, y = 32643, z = 10 },
+ },
+ },
+ [23121] = {
+ itemId = 8865,
+ itemPos = {
+ { x = 32745, y = 32613, z = 8 },
+ { x = 32811, y = 32645, z = 8 },
+ { x = 32749, y = 32628, z = 8 },
+ { x = 32781, y = 32641, z = 8 },
+ },
+ },
+ [23122] = {
+ itemId = 14940,
+ itemPos = {
+ { x = 32808, y = 32612, z = 9 },
+ { x = 32743, y = 32612, z = 9 },
+ { x = 32775, y = 32600, z = 9 },
+ { x = 32761, y = 32630, z = 9 },
+ },
+ },
+ [23123] = {
+ itemId = 14974,
+ itemPos = {
+ { x = 32789, y = 32613, z = 10 },
+ { x = 32767, y = 32638, z = 10 },
+ { x = 32742, y = 32636, z = 10 },
+ { x = 32757, y = 32606, z = 10 },
+ },
+ },
-- Ferumbras' Ascension Quest
[24837] = {
itemId = 1949,
@@ -2697,6 +2898,63 @@ ItemUnique = {
itemId = 1949,
itemPos = { x = 33926, y = 31477, z = 5 },
},
+ -- Threatened Dreams Quest
+ [23102] = {
+ itemId = 4024,
+ itemPos = { x = 32736, y = 32282, z = 8 },
+ },
+ [23103] = {
+ itemId = 2471,
+ itemPos = { x = 33693, y = 32185, z = 8 },
+ },
+ [23104] = {
+ itemId = 29435,
+ itemPos = { x = 33711, y = 32108, z = 4 },
+ },
+ [23105] = {
+ itemId = 2523,
+ itemPos = { x = 33578, y = 32527, z = 14 },
+ },
+ [23106] = {
+ itemId = 29952,
+ itemPos = { x = 33599, y = 32533, z = 14 },
+ },
+ [23107] = {
+ itemId = 29951,
+ itemPos = { x = 33618, y = 32518, z = 14 },
+ },
+ [23108] = {
+ itemId = 5501,
+ itemPos = { x = 33638, y = 32507, z = 14 },
+ },
+ [23109] = {
+ itemId = 2478,
+ itemPos = { x = 33703, y = 32185, z = 5 },
+ },
+ [23110] = {
+ itemId = 25762,
+ itemPos = { x = 33663, y = 32192, z = 7 },
+ },
+ [23111] = {
+ itemId = 2438,
+ itemPos = { x = 33671, y = 32203, z = 7 },
+ },
+ [23112] = {
+ itemId = 30145,
+ itemPos = { x = 33683, y = 32125, z = 6 },
+ },
+ [23113] = {
+ itemId = 28522,
+ itemPos = { x = 31996, y = 31981, z = 13 },
+ },
+ [23114] = {
+ itemId = 23740,
+ itemPos = { x = 32017, y = 31981, z = 14 },
+ },
+ [23115] = {
+ itemId = 4077,
+ itemPos = { x = 32054, y = 31936, z = 13 },
+ },
-- The shattered isles
[40001] = {
itemId = 6118,
@@ -3189,4 +3447,17 @@ ItemUnique = {
itemId = 9253,
itemPos = { x = 33755, y = 32161, z = 14 },
},
+ -- Kilmaresh Quest
+ [57505] = {
+ itemId = 31349,
+ itemPos = { x = 33899, y = 31643, z = 9 },
+ },
+ [57506] = {
+ itemId = 31349,
+ itemPos = { x = 33936, y = 31647, z = 9 },
+ },
+ [57507] = {
+ itemId = 31357,
+ itemPos = { x = 33914, y = 31639, z = 9 },
+ },
}
diff --git a/data-otservbr-global/startup/tables/lever.lua b/data-otservbr-global/startup/tables/lever.lua
index ab887209866..bcf98109646 100644
--- a/data-otservbr-global/startup/tables/lever.lua
+++ b/data-otservbr-global/startup/tables/lever.lua
@@ -129,6 +129,31 @@ LeverAction = {
{ x = 32576, y = 31862, z = 14 },
},
},
+ -- Grave Danger Quest
+ [14557] = {
+ itemId = 8911,
+ itemPos = {
+ { x = 33454, y = 31413, z = 13 },
+ },
+ },
+ [14558] = {
+ itemId = 8911,
+ itemPos = {
+ { x = 33515, y = 31444, z = 13 },
+ },
+ },
+ [14561] = {
+ itemId = 8911,
+ itemPos = {
+ { x = 33421, y = 31493, z = 13 },
+ },
+ },
+ [14568] = {
+ itemId = 8911,
+ itemPos = {
+ { x = 33484, y = 31546, z = 13 },
+ },
+ },
-- Forgotten Knowledge Quest
[26663] = {
itemId = 9125,
diff --git a/data-otservbr-global/startup/tables/teleport.lua b/data-otservbr-global/startup/tables/teleport.lua
index 94a7d57e822..a04d00188b8 100644
--- a/data-otservbr-global/startup/tables/teleport.lua
+++ b/data-otservbr-global/startup/tables/teleport.lua
@@ -41,6 +41,50 @@ TeleportAction = {
{ x = 33449, y = 32241, z = 7 },
},
},
+ -- Grave Danger Quest
+ [14562] = {
+ itemId = 23482,
+ itemPos = {
+ { x = 32190, y = 31817, z = 8 },
+ },
+ },
+ [14563] = {
+ itemId = 23482,
+ itemPos = {
+ { x = 32345, y = 32168, z = 12 },
+ },
+ },
+ [14564] = {
+ itemId = 23482,
+ itemPos = {
+ { x = 33288, y = 32472, z = 9 },
+ },
+ },
+ [14565] = {
+ itemId = 23482,
+ itemPos = {
+ { x = 33261, y = 31984, z = 8 },
+ },
+ },
+ [14566] = {
+ itemId = 23482,
+ itemPos = {
+ { x = 33196, y = 31694, z = 8 },
+ },
+ },
+ [14567] = {
+ itemId = 23482,
+ itemPos = {
+ { x = 32174, y = 31916, z = 8 },
+ },
+ },
+ -- Grave Danger Quest
+ [14579] = {
+ itemId = 22761,
+ itemPos = {
+ { x = 33443, y = 31532, z = 13 },
+ },
+ },
-- Barbarian Test - Temple Citizen Svargrond
[30032] = {
itemId = 1949,
@@ -418,4 +462,125 @@ TeleportUnique = {
destination = { x = 33618, y = 32523, z = 15 },
effect = CONST_ME_TELEPORT,
},
+ -- Grave Dange Quest
+ [39009] = {
+ itemId = 22761,
+ itemPos = { x = 33451, y = 31562, z = 13 },
+ destination = { x = 33456, y = 31564, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39010] = {
+ itemId = 22761,
+ itemPos = { x = 33465, y = 31570, z = 13 },
+ destination = { x = 32172, y = 31917, z = 8 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39011] = {
+ itemId = 22761,
+ itemPos = { x = 33463, y = 31553, z = 13 },
+ destination = { x = 33462, y = 31548, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39012] = {
+ itemId = 22761,
+ itemPos = { x = 33454, y = 31562, z = 13 },
+ destination = { x = 33449, y = 31561, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39013] = {
+ itemId = 22761,
+ itemPos = { x = 33463, y = 31541, z = 13 },
+ destination = { x = 33465, y = 31536, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39014] = {
+ itemId = 22761,
+ itemPos = { x = 33463, y = 31538, z = 13 },
+ destination = { x = 33462, y = 31543, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39015] = {
+ itemId = 22761,
+ itemPos = { x = 33454, y = 31529, z = 13 },
+ destination = { x = 33449, y = 31530, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39016] = {
+ itemId = 22761,
+ itemPos = { x = 33465, y = 31521, z = 13 },
+ destination = { x = 32172, y = 31917, z = 8 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39017] = {
+ itemId = 22761,
+ itemPos = { x = 33451, y = 31529, z = 13 },
+ destination = { x = 33456, y = 31531, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39018] = {
+ itemId = 32415,
+ itemPos = { x = 33443, y = 31539, z = 13 },
+ destination = { x = 32172, y = 31917, z = 8 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39019] = {
+ itemId = 22761,
+ itemPos = { x = 33435, y = 31529, z = 13 },
+ destination = { x = 33430, y = 31531, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39020] = {
+ itemId = 22761,
+ itemPos = { x = 33432, y = 31529, z = 13 },
+ destination = { x = 33437, y = 31530, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39021] = {
+ itemId = 22761,
+ itemPos = { x = 33421, y = 31521, z = 13 },
+ destination = { x = 32172, y = 31917, z = 8 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39022] = {
+ itemId = 22761,
+ itemPos = { x = 33423, y = 31538, z = 13 },
+ destination = { x = 33424, y = 31543, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39023] = {
+ itemId = 22761,
+ itemPos = { x = 33423, y = 31541, z = 13 },
+ destination = { x = 33425, y = 31536, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39024] = {
+ itemId = 22761,
+ itemPos = { x = 33423, y = 31551, z = 13 },
+ destination = { x = 33425, y = 31556, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39025] = {
+ itemId = 22761,
+ itemPos = { x = 33423, y = 31554, z = 13 },
+ destination = { x = 33424, y = 31549, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39026] = {
+ itemId = 22761,
+ itemPos = { x = 33421, y = 31570, z = 13 },
+ destination = { x = 32172, y = 31917, z = 8 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39027] = {
+ itemId = 22761,
+ itemPos = { x = 33432, y = 31562, z = 13 },
+ destination = { x = 33437, y = 31563, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
+ [39028] = {
+ itemId = 22761,
+ itemPos = { x = 33435, y = 31562, z = 13 },
+ destination = { x = 33430, y = 31564, z = 13 },
+ effect = CONST_ME_TELEPORT,
+ },
}
diff --git a/data-otservbr-global/startup/tables/teleport_item.lua b/data-otservbr-global/startup/tables/teleport_item.lua
index c09dd9e22fa..395a3c18e80 100644
--- a/data-otservbr-global/startup/tables/teleport_item.lua
+++ b/data-otservbr-global/startup/tables/teleport_item.lua
@@ -161,11 +161,4 @@ TeleportItemUnique = {
destination = { x = 33916, y = 31466, z = 8 },
effect = CONST_ME_TELEPORT,
},
- -- Faceless Bane entrance
- [15004] = {
- itemId = 29954,
- itemPos = { x = 33619, y = 32518, z = 15 },
- destination = { x = 33640, y = 32561, z = 13 },
- effect = CONST_ME_TELEPORT,
- },
}
diff --git a/data-otservbr-global/startup/tables/tile.lua b/data-otservbr-global/startup/tables/tile.lua
index 59d9d3be69f..5246b290c37 100644
--- a/data-otservbr-global/startup/tables/tile.lua
+++ b/data-otservbr-global/startup/tables/tile.lua
@@ -296,8 +296,9 @@ TileAction = {
[50307] = {
itemId = false,
itemPos = {
+ { x = 33955, y = 31503, z = 2 },
{ x = 33956, y = 31503, z = 2 },
- { x = 33957, y = 31503, z = 2 },
+ { x = 33956, y = 31504, z = 2 },
},
},
-- The paradox tower quest
diff --git a/data-otservbr-global/world/otservbr-monster.xml b/data-otservbr-global/world/otservbr-monster.xml
index 2fe127164f3..ee52776b9d9 100644
--- a/data-otservbr-global/world/otservbr-monster.xml
+++ b/data-otservbr-global/world/otservbr-monster.xml
@@ -4071,6 +4071,9 @@
+
+
+
@@ -6948,6 +6951,9 @@
+
+
+
@@ -68038,7 +68044,7 @@
-
+
@@ -71857,6 +71863,9 @@
+
+
+
diff --git a/data-otservbr-global/world/otservbr-npc.xml b/data-otservbr-global/world/otservbr-npc.xml
index 897f70baa1d..6d9ed07557e 100644
--- a/data-otservbr-global/world/otservbr-npc.xml
+++ b/data-otservbr-global/world/otservbr-npc.xml
@@ -1353,6 +1353,9 @@
+
+
+
@@ -2794,6 +2797,12 @@
+
+
+
+
+
+
diff --git a/data/items/items.xml b/data/items/items.xml
index 379095e5d9c..f3e5dc487e1 100644
--- a/data/items/items.xml
+++ b/data/items/items.xml
@@ -55707,6 +55707,7 @@ hands of its owner. Granted by TibiaRoyal.com"/>
-
+
diff --git a/data/libs/functions/boss_lever.lua b/data/libs/functions/boss_lever.lua
index ae8a89d0e54..1a8ec612f3f 100644
--- a/data/libs/functions/boss_lever.lua
+++ b/data/libs/functions/boss_lever.lua
@@ -14,7 +14,7 @@
---@field private _aid number
---@field private playerPositions {pos: Position, teleport: Position}[]
---@field private area {from: Position, to: Position}
----@field private monsters {name: string, pos: Position}[]
+---@field private monsters {name: string, pos: Position, delay: number}[]
---@field private exitTeleporter Position
---@field private exit Position
---@field private encounter Encounter
@@ -42,6 +42,10 @@ local config = {
from = Position(33607, 32553, 13),
to = Position(33627, 32570, 13)
},
+ monsters = {
+ { name = "rat", pos = Position(33615, 32563, 13) },
+ { name = "rat", pos = Position(33615, 32563, 13), delay = 5000 },
+ },
onUseExtra = function(player, infoPositions)
player:teleportTo(Position(33618, 32523, 15))
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
@@ -223,9 +227,6 @@ function BossLever:onUse(player)
end
if lever:checkConditions() then
zone:removeMonsters()
- for _, monster in pairs(self.monsters) do
- Game.createMonster(monster.name, monster.pos, true, true)
- end
if self.createBoss then
if not self.createBoss() then
return true
@@ -238,6 +239,13 @@ function BossLever:onUse(player)
end
monster:registerEvent("BossLeverOnDeath")
end
+ for _, monster in pairs(self.monsters) do
+ if monster.delay then
+ addEvent(Game.createMonster, monster.delay, monster.name, monster.pos, true, true)
+ else
+ Game.createMonster(monster.name, monster.pos, true, true)
+ end
+ end
lever:teleportPlayers()
if self.encounter then
local encounter = Encounter(self.encounter)