Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyx14 committed Nov 10, 2024
1 parent 4a2a70e commit 991bdcb
Show file tree
Hide file tree
Showing 44 changed files with 1,290 additions and 85 deletions.
77 changes: 0 additions & 77 deletions data-otxserver/lib/core/storages.lua
Original file line number Diff line number Diff line change
@@ -1,80 +1,3 @@
--[[
Reserved player action storage key ranges (const.h)
It is possible to place the storage in a quest door, so the player who has that storage will go through the door
Reserved player action storage key ranges (const.h at the source)
[10000000 - 20000000]
[1000 - 1500]
[2001 - 2011]
Others reserved player action/storages
[100] = unmovable/untrade/unusable items
[101] = use pick floor
[102] = well down action
[103-120] = others keys action
[103] = key 0010
[303] = key 0303
[1000] = level door. Here 1 must be used followed by the level.
Example: 1010 = level 10, 1100 = level 100
[3001-3008] = key 3001/3008
[3012] = key 3012
[3033] = key 3033
[3100] = key 3100
[3142] = key 3142
[3200] = key 3200
[3301] = key 3301
[3302] = key 3302
[3303] = key 3303
[3304] = key 3304
[3350] = key 3350
[3520] = key 3520
[3600] = key 3600
[3610] = key 3610
[3620] = key 3620
[3650] = key 3650
[3666] = key 3666
[3667] = key 3667
[3700] = key 3700
[3701/3703] = key 3701/3703
[3800/3802] = key 3800/3802
[3899] = key 3899
[3900] = key 3900
[3909/3917] = key 3909/3917
[3923] = key 3923
[3925] = key 3925
[3930] = key 3930
[3932] = key 3932
[3934] = key 3934
[3935] = key 3935
[3936] = key 3936
[3938] = key 3938
[3940] = key 3940
[3950] = key 3950
[3960] = key 3960
[3980] = key 3980
[3988] = key 3988
[4001] = key 4001
[4009] = key 4009
[4022] = key 4022
[4023] = key 4023
[4033] = key 4033
[4037] = key 4037
[4055] = key 4055
[4210] = key 4210
[4501] = key 4501
[4502] = key 4502
[4503] = key 4503
[4600] = key 4600
[5000] = key 5000
[5002] = key 5002
[5010] = key 5010
[5050] = key 5050
[6010] = key 6010
Questline = Storage through the Quest
]]

Storage = {
-- General storages
Dragonfetish = 30003,
Expand Down
6 changes: 3 additions & 3 deletions data-otxserver/lib/quests/soul_war.lua
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,9 @@ SoulWarQuest = {
{ conor = { x = 33899, y = 31064, z = 9 }, teleportPosition = { x = 33904, y = 31082, z = 8 } },
},
mapsPath = {
empty = "data-otservbr-global/world/quest/soul_war/ebb_and_flow/ebb-flow-empty.otbm",
inundate = "data-otservbr-global/world/quest/soul_war/ebb_and_flow/ebb-flow-inundate.otbm",
ebbFlow = "data-otservbr-global/world/quest/soul_war/ebb_and_flow/ebb-flow.otbm",
empty = "data-otxserver/world/quest/soul_war/ebb_and_flow/ebb-flow-empty.otbm",
inundate = "data-otxserver/world/quest/soul_war/ebb_and_flow/ebb-flow-inundate.otbm",
ebbFlow = "data-otxserver/world/quest/soul_war/ebb_and_flow/ebb-flow.otbm",
},

-- In Minutes
Expand Down
11 changes: 8 additions & 3 deletions data-otxserver/scripts/actions/other/others/quest_system_old.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
local questSystemOld = Action()

function questSystemOld.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(storage) > 0 and player:getGroup():getId() < GROUP_TYPE_GAMEMASTER then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. ItemType(item.itemid):getName() .. " is empty.")
return true
end

if item.uid <= 100 or item.uid >= 44613 then
return false
end
Expand All @@ -14,14 +19,14 @@ function questSystemOld.onUse(player, item, fromPosition, target, toPosition, is
local playerCap = player:getFreeCapacity()
if player:getStorageValue(item.uid) == -1 then
if playerCap >= itemWeight then
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. '.')
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found a ' .. itemType:getName() .. '.')
player:addItem(item.uid, 1)
player:setStorageValue(item.uid, 1)
else
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.")
end
return true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ local function loadMapActionsAndUniques()
loadLuaMapUnique(TileUnique)
loadLuaMapAction(TilePickAction)
CreateMapItem(CreateItemOnMap)
updateKeysStorage(QuestKeysUpdate)
--updateKeysStorage(QuestKeysUpdate)
end

local function loadMapAttributes()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
local explorerSocietyBotanist = Action()

function explorerSocietyBotanist.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target.itemid == 3874 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 18 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 18 then
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 19)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 19)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
item:transform(4868)
elseif target.itemid == 3885 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 21 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 21 then
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 22)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 22)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
item:transform(4869)
elseif target.itemid == 3878 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 24 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 24 then
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 25)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 25)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
item:transform(4870)
elseif target.itemid == 5658 and target.uid == 3152 and player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.GriffinclawFlower) ~= 1 then --Mission-independent function that uses the same item
toPosition:sendMagicEffect(CONST_ME_MAGIC_RED)
item:transform(5937)
target:transform(5687)
player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.GriffinclawFlower, 1)
player:say("You successfully took a sample of the rare griffinclaw flower.", TALKTYPE_MONSTER_SAY)
end

return true
end

explorerSocietyBotanist:id(4867)
explorerSocietyBotanist:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
local explorerSocietyButterfly = Action()
function explorerSocietyButterfly.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target.itemid == 4992 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 9 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 9 then
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 10)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 10)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
item:transform(4864)
target:remove()
elseif target.itemid == 4993 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 12 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 12 then
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 13)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 13)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
item:transform(4865)
target:remove()
elseif target.itemid == 4991 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 15 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 15 then
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 16)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 16)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
item:transform(4866)
target:remove()
end
return true
end

explorerSocietyButterfly:id(4863)
explorerSocietyButterfly:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local explorerSocietyDragon = Action()
function explorerSocietyDragon.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIslandofDragons) == 57 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 57 then
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIslandofDragons, 58)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 58)
player:addItem(7314, 1)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
end
return true
end

explorerSocietyDragon:uid(40042)
explorerSocietyDragon:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
local UniqueTable = {
-- Chests uniques
[14029] = {
-- Uzgod's Family Brooch
rewardItemId = 4834,
storageMission = Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers,
storageMissionValue = 3,
storageQuestlineValue = 3,
},
[14030] = {
-- Wrinkled parchment
rewardItemId = 173,
storageMission = Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret,
storageMissionValue = 31,
storageQuestlineValue = 30,
},
[14031] = {
-- Strange powder
rewardItemId = 13974,
storageMission = Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder,
storageMissionValue = 34,
storageQuestlineValue = 33,
},
[14032] = {
-- Elven poetry book
rewardItemId = 4844,
storageMission = Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry,
storageMissionValue = 37,
storageQuestlineValue = 36,
},
[14033] = {
-- Memory stone
rewardItemId = 4841,
storageMission = Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone,
storageMissionValue = 40,
storageQuestlineValue = 39,
},
[14034] = {
-- Spectral dress
rewardItemId = 4836,
storageMission = Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress,
storageMissionValue = 49,
storageQuestlineValue = 48,
},
[14035] = {
-- Damage logbook
rewardItemId = 21378,
storageMission = Storage.Quest.U7_6.ExplorerSociety.CalassaQuest,
storageMissionValue = 2,
storageQuestlineValue = 0,
},
-- Others uniques
[40041] = {
-- Funeral urn
rewardItemId = 4847,
storageMission = Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn,
storageMissionValue = 28,
storageQuestlineValue = 27,
},
}

local explorerSocietyFindings = Action()
function explorerSocietyFindings.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local uniqueItem = UniqueTable[item.uid]
if not uniqueItem then
return true
end
if player:getStorageValue(item.uid) >= 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. getItemName(uniqueItem.itemId) .. " is empty.")
return true
end
if player:getStorageValue(uniqueItem.storageMission) ~= uniqueItem.storageMissionValue then
player:addItem(uniqueItem.rewardItemId, 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. getItemName(uniqueItem.rewardItemId) .. ".")
player:setStorageValue(item.uid, 1)
player:setStorageValue(uniqueItem.storageMission, uniqueItem.storageMissionValue)
if uniqueItem.storageQuestlineValue > 0 then
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, uniqueItem.storageQuestlineValue)
end
return true
end
end

for index, value in pairs(UniqueTable) do
explorerSocietyFindings:uid(index)
end

explorerSocietyFindings:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local explorerSocietyIcicle = Action()
function explorerSocietyIcicle.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target.itemid == 4994 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery) == 6 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 6 then
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery, 7)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 7)
player:addItem(4837, 1)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
end
return true
end

explorerSocietyIcicle:id(4872)
explorerSocietyIcicle:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local explorerSocietyResonance = Action()
function explorerSocietyResonance.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target.uid == 40043 then
if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceMusic) == 60 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 60 then
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceMusic, 61)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 61)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
item:transform(7315)
player:say("You recorded the ice music.", TALKTYPE_MONSTER_SAY)
end
end
return true
end

explorerSocietyResonance:id(7242)
explorerSocietyResonance:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
local explorerSocietyStone = Action()
function explorerSocietyStone.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target.uid == 25018 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 53 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 53 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 1 then -- mission taken from Angus
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 54)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 54)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
elseif target.uid == 25019 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 54 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 54 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 1 then -- mission taken from Angus
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 55)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 55)
player:removeItem(4840, 1)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
elseif target.uid == 25019 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 53 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 53 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 2 then -- mission taken from Mortimer
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 54)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 54)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
elseif target.uid == 25018 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 54 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 54 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 2 then -- mission taken from Mortimer
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 55)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 55)
player:removeItem(4840, 1)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
end
return true
end

explorerSocietyStone:id(4840)
explorerSocietyStone:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local explorerSocietyPaper = Action()
function explorerSocietyPaper.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target.itemid == 2199 and target.uid == 3010 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings) == 42 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 42 then
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings, 43)
player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 43)
item:transform(4843)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
end
return true
end

explorerSocietyPaper:id(4842)
explorerSocietyPaper:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
local calassa = MoveEvent()

function calassa.onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end

local headItem = player:getSlotItem(CONST_SLOT_HEAD)
if headItem and table.contains({ 5460, 11585, 13995 }, headItem.itemid) then
player:teleportTo(Position(31914, 32713, 12))
player:getPosition():sendMagicEffect(CONST_ME_WATERSPLASH)
player:getPosition():sendMagicEffect(CONST_ME_LOSEENERGY)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You enter the realm of Calassa.")
else
player:teleportTo(fromPosition)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must wear an underwater exploration helmet in order to dive.")
end
return true
end

calassa:type("stepin")
calassa:aid(2070)
calassa:register()
Loading

0 comments on commit 991bdcb

Please sign in to comment.