Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Fix falcon castle access to doors and teleport #758

Merged
merged 5 commits into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions data/items/items.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10314,10 +10314,7 @@
</item>
<item id="5060" article="a" name="small snake head"/>
<item fromid="5061" toid="5067" article="a" name="burning wall"/>
<item fromid="5068" toid="5070" name="electric sparks">
<attribute key="blocking" value="1"/>
<attribute key="blockProjectile" value="1"/>
</item>
<item fromid="5068" toid="5070" name="electric sparks"/>
<item fromid="5071" toid="5073" article="an" name="energy fence"/>
<item fromid="5074" toid="5075" article="a" name="lava fountain"/>
<item fromid="5076" toid="5079" article="a" name="stony pond">
Expand Down Expand Up @@ -12473,7 +12470,10 @@
<attribute key="description" value="Use it in your house to construct a weapon rack"/>
<attribute key="weight" value="3500"/>
</item>
<item fromid="6116" toid="6117" name="electric sparks"/>
<item fromid="6116" toid="6117" name="electric sparks">
<attribute key="blocking" value="1"/>
<attribute key="blockProjectile" value="1"/>
</item>
<item id="6118" article="a" name="treasure map">
<attribute key="weight" value="830"/>
</item>
Expand Down
42 changes: 34 additions & 8 deletions data/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Storage = {
UrmahlulluTimer = 50042
},
TheSecretLibrary = {
-- Reserved storage from 50050 - 50069
-- Reserved storage from 50050 - 50074
TheOrderOfTheFalcon = {
OberonTimer = 50050
},
Expand All @@ -233,14 +233,28 @@ Storage = {
PinkTel = 50060,
Peacock = 50061,
HighDry = 50062,
FalconBastionAccess = 50063
FalconBastionAccess = 50063,
FalconBastionChestsTimer = {
Key0909 = 50064
},
MiniBosses = {
GrandCommanderSoeren = 50065,
PreceptorLazare = 50066,
GrandChaplainGaunder = 50067,
GrandCanonDominus = 50068,
DazedLeafGolem = 50069
},
LowerBastionAccess = 50070,
UndergroundBastionAccess = 50071,
OberonAccess = 50072,
ShortcutToBastion = 50073
},
DeeplingBosses = {
-- Reserved storage from 50070 - 50079
Jaul = 50070,
Tanjis = 50071,
Obujos = 50072,
DeeplingStatus = 50073
-- Reserved storage from 50075 - 50079
Jaul = 50075,
Tanjis = 50076,
Obujos = 50077,
DeeplingStatus = 50078
},
DangerousDepths = {
-- Reserved storage from 50080 - 50199
Expand Down Expand Up @@ -1717,6 +1731,8 @@ Storage = {
Quest = {
Key = {
ID0010 = 103,
ID0808 = 808,
ID0909 = 909,
ID3001 = 3001,
ID3002 = 3002,
ID3003 = 3003,
Expand All @@ -1726,6 +1742,7 @@ Storage = {
ID3007 = 3007,
ID3008 = 3008,
ID3012 = 3012,
ID3600 = 3600,
ID3620 = 3620,
ID3666 = 3666,
ID3702 = 3702,
Expand Down Expand Up @@ -2633,7 +2650,16 @@ Storage = {
BattleMageOutfits = {},
DiscovererOutfits = {},
MeasuringTibia = {},
TheSecretLibrary = {},
TheSecretLibrary = {
FalconBastionChestsTimer = {
Coast = 46281,
Island = 46282,
ThroneHall = 46283,
Shortcut = 46284,
LowerBastion = 46285,
UndergroundBastion = 46286
},
},
},
U12_00 = { -- update 12.00 - Reserved Storages 46301 - 46600
DreamWarriorOutfits = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ monster.corpse = 28737
monster.speed = 210
monster.manaCost = 0

monster.events = {
"GrandCanonDominusDeath"
}

monster.changeTarget = {
interval = 4000,
chance = 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ monster.corpse = 28733
monster.speed = 210
monster.manaCost = 0

monster.events = {
"GrandChaplainGaunderDeath"
}

monster.changeTarget = {
interval = 3000,
chance = 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ monster.corpse = 28726
monster.speed = 210
monster.manaCost = 0

monster.events = {
"GrandCommanderSoerenDeath"
}

monster.changeTarget = {
interval = 5000,
chance = 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ monster.corpse = 28643
monster.speed = 210
monster.manaCost = 0

monster.events = {
"PreceptorLazareDeath"
}

monster.changeTarget = {
interval = 2000,
chance = 10
Expand Down
4 changes: 4 additions & 0 deletions data/monster/quests/the_secret_library/dazed_leaf_golem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ monster.corpse = 19117
monster.speed = 350
monster.manaCost = 0

monster.events = {
"DazedLeafGolemDeath"
}

monster.changeTarget = {
interval = 0,
chance = 0
Expand Down
42 changes: 28 additions & 14 deletions data/scripts/actions/farmine/boat.lua
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
local config = {
[57601] = Position(33326, 31351, 7),
[57602] = Position(33382, 31292, 7),
[57603] = Position(33374, 31310, 7),
[64007] = Position(33346, 31349, 7),
local boats = {
{pos = {x = 33344, y = 31349, z = 7}, destination = Position(33326, 31351, 7), unlockShortcut = Storage.TheSecretLibrary.ShortcutToBastion},
{pos = {x = 33373, y = 31309, z = 7}, destination = Position(33382, 31292, 7)},
{pos = {x = 33382, y = 31294, z = 7}, destination = Position(33374, 31310, 7)},
{pos = {x = 33328, y = 31352, z = 7}, destination = Position(33346, 31348, 7), access = Storage.TheSecretLibrary.ShortcutToBastion}
}

local boat = Action()

function boat.onUse(player, item, fromPosition, itemEx, toPosition)
for actionId, destination in pairs(config) do
if item.actionid == actionId then
player:teleportTo(destination)
destination:sendMagicEffect(CONST_ME_POFF)
fromPosition:sendMagicEffect(CONST_ME_POFF)
return true
end
end
for b = 1, #boats do
if item:getPosition() == Position(boats[b].pos) then
if boats[b].unlockShortcut then
if player:getStorageValue(boats[b].unlockShortcut) < 1 then
player:setStorageValue(boats[b].unlockShortcut, 1)
end
end
if boats[b].access then
if player:getStorageValue(boats[b].access) == 1 then
player:teleportTo(boats[b].destination)
player:getPosition():sendMagicEffect(CONST_ME_WATERSPLASH)
return true
end
else
player:teleportTo(boats[b].destination)
player:getPosition():sendMagicEffect(CONST_ME_WATERSPLASH)
return true
end
end
end
end

boat:aid(57601, 57602, 57603, 64007)
for a = 1, #boats do
boat:position(boats[a].pos)
end
boat:register()
8 changes: 4 additions & 4 deletions data/scripts/actions/quests/cults_of_tibia/bosses_levers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,10 @@ function cultsOfTibiaLevers.onUse(player, item, fromPosition, itemEx, toPosition
end
end
-- criando os raios
criarRaio1(Position(33134, 31856, 15), Position(33139, 31856, 15), 5068, 1)
criarRaio1(Position(33134, 31863, 15), Position(33139, 31863, 15), 5068, 1)
criarRaio1(Position(33140, 31857, 15), Position(33140, 31862, 15), 5069, 2)
criarRaio1(Position(33133, 31857, 15), Position(33133, 31862, 15), 5069, 2)
criarRaio1(Position(33134, 31856, 15), Position(33139, 31856, 15), 6116, 1)
criarRaio1(Position(33134, 31863, 15), Position(33139, 31863, 15), 6116, 1)
criarRaio1(Position(33140, 31857, 15), Position(33140, 31862, 15), 6117, 2)
criarRaio1(Position(33133, 31857, 15), Position(33133, 31862, 15), 6117, 2)

-- criando os securys
Game.createMonster("Security Golem", Position(33131, 31855, 15))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ function ferumbrasAscendantFlowerPuzzle.onUse(player, item, fromPosition, target
end
addEvent(revertItem, 30 * 1000, gate.position, gate.itemid, gate.transform)
end
local wall = Tile(Position(33477, 32698, 14)):getItemById(6116)
local wall = Tile(Position(33477, 32698, 14)):getItemById(5068)
if not wall then
Game.createItem(6116, 1, Position(33477, 32698, 14))
Game.createItem(5068, 1, Position(33477, 32698, 14))
end
end
item:transform(9111)
Expand Down
23 changes: 19 additions & 4 deletions data/scripts/actions/system/quest_reward_common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ local function playerAddItem(params, item)
end

player:sendTextMessage(MESSAGE_EVENT_ADVANCE, params.message .. ".")
player:setStorageValue(params.storage, 1)
if params.timer then
player:setStorageValue(params.timer, os.time() + params.time * 3600)
else
player:setStorageValue(params.storage, 1)
end
return true
end

Expand Down Expand Up @@ -115,11 +119,20 @@ function questReward.onUse(player, item, fromPosition, itemEx, toPosition)
end
end

if player:getStorageValue(setting.storage) >= 0 then
if setting.timerStorage then
if player:getStorageValue(setting.timerStorage) > os.time() then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The ".. getItemName(setting.itemId) .. " is empty.")
return true
end
elseif player:getStorageValue(setting.storage) >= 0 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The ".. getItemName(setting.itemId) .. " is empty.")
return true
end

if setting.randomReward then
local randomReward = math.random(#setting.randomReward)
setting.reward[1][1] = setting.randomReward[randomReward][1]
setting.reward[1][2] = setting.randomReward[randomReward][2]
end
local container = player:addItem(setting.container)
for i = 1, #setting.reward do
local itemid = setting.reward[i][1]
Expand All @@ -137,7 +150,9 @@ function questReward.onUse(player, item, fromPosition, itemEx, toPosition)
count = count,
weight = getItemWeight(itemid) * count,
storage = setting.storage,
key = setting.isKey
key = setting.isKey,
timer = setting.timerStorage,
time = setting.time,
}

if count > 1 and ItemType(itemid):isStackable() then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ function machineDeath.onDeath(creature, attacker)
local creaturePosition = creature:getPosition()
if name == "containment machine" then
-- destruindo os raios
DestruirRaio1(Position(33134, 31856, 15), Position(33139, 31856, 15), 5068, 1)
DestruirRaio1(Position(33134, 31863, 15), Position(33139, 31863, 15), 5068, 1)
DestruirRaio1(Position(33140, 31857, 15), Position(33140, 31862, 15), 5069, 2)
DestruirRaio1(Position(33133, 31857, 15), Position(33133, 31862, 15), 5069, 2)
DestruirRaio1(Position(33134, 31856, 15), Position(33139, 31856, 15), 6116, 1)
DestruirRaio1(Position(33134, 31863, 15), Position(33139, 31863, 15), 6116, 1)
DestruirRaio1(Position(33140, 31857, 15), Position(33140, 31862, 15), 6117, 2)
DestruirRaio1(Position(33133, 31857, 15), Position(33133, 31862, 15), 6117, 2)
local itensToMonster = {--8633
Position(33133, 31856, 15),
Position(33140, 31856, 15),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ function huskyKill.onKill(player, target)
return true
end

if not target:getName():lower() == "husky" then
return true
if target:getName():lower() == "husky" then
player:setStorageValue(Storage.TheIceIslands.HuskyKill, player:getStorageValue(Storage.TheIceIslands.HuskyKill) + 1)
end
player:setStorageValue(Storage.TheIceIslands.HuskyKill, player:getStorageValue(Storage.TheIceIslands.HuskyKill) + 1)
return true
end

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
local grandCommanderSoerenDeath = CreatureEvent("GrandCommanderSoerenDeath")
function grandCommanderSoerenDeath.onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
if killer:isPlayer() and killer:getStorageValue(Storage.TheSecretLibrary.MiniBosses.GrandCommanderSoeren) < 1 then
killer:setStorageValue(Storage.TheSecretLibrary.MiniBosses.GrandCommanderSoeren, 1)
if killer:getStorageValue(Storage.TheSecretLibrary.MiniBosses.PreceptorLazare) == 1 then
killer:setStorageValue(Storage.TheSecretLibrary.LowerBastionAccess, 1) -- Access to quest door
end
end
end
grandCommanderSoerenDeath:register()

local preceptorLazareDeath = CreatureEvent("PreceptorLazareDeath")
function preceptorLazareDeath.onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
if killer:isPlayer() and killer:getStorageValue(Storage.TheSecretLibrary.MiniBosses.PreceptorLazare) < 1 then
killer:setStorageValue(Storage.TheSecretLibrary.MiniBosses.PreceptorLazare, 1)
if killer:getStorageValue(Storage.TheSecretLibrary.MiniBosses.GrandCommanderSoeren) == 1 then
killer:setStorageValue(Storage.TheSecretLibrary.LowerBastionAccess, 1) -- Access to quest door
end
end
end
preceptorLazareDeath:register()

local grandChaplainGaunderDeath = CreatureEvent("GrandChaplainGaunderDeath")
function grandChaplainGaunderDeath.onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
if killer:isPlayer() and killer:getStorageValue(Storage.TheSecretLibrary.MiniBosses.GrandChaplainGaunder) < 1 then
killer:setStorageValue(Storage.TheSecretLibrary.MiniBosses.GrandChaplainGaunder, 1)
if killer:getStorageValue(Storage.TheSecretLibrary.MiniBosses.GrandCanonDominus) == 1 then
killer:setStorageValue(Storage.TheSecretLibrary.UndergroundBastionAccess, 1) -- Access to quest door
end
end
end
grandChaplainGaunderDeath:register()

local grandCanonDominusDeath = CreatureEvent("GrandCanonDominusDeath")
function grandCanonDominusDeath.onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
if killer:isPlayer() and killer:getStorageValue(Storage.TheSecretLibrary.MiniBosses.GrandCanonDominus) < 1 then
killer:setStorageValue(Storage.TheSecretLibrary.MiniBosses.GrandCanonDominus, 1)
if killer:getStorageValue(Storage.TheSecretLibrary.MiniBosses.GrandChaplainGaunder) == 1 then
killer:setStorageValue(Storage.TheSecretLibrary.UndergroundBastionAccess, 1) -- Access to quest door
end
end
end
grandCanonDominusDeath:register()

local dazedLeafGolemDeath = CreatureEvent("DazedLeafGolemDeath")
function dazedLeafGolemDeath.onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
if killer:isPlayer() and killer:getStorageValue(Storage.TheSecretLibrary.OberonAccess) < 1 then
killer:setStorageValue(Storage.TheSecretLibrary.OberonAccess, 1) -- Access to teleport
end
end
dazedLeafGolemDeath:register()
15 changes: 4 additions & 11 deletions data/scripts/movements/quests/assassin_outfit/erayo_house.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
local enterPosition = Position(32519, 32911, 7)
local exitPosition = Position(32519, 32912, 7)

local erayoHouse = MoveEvent()

function erayoHouse.onStepIn(creature, item, position, fromPosition)
Expand All @@ -9,17 +6,13 @@ function erayoHouse.onStepIn(creature, item, position, fromPosition)
return true
end

if not (position == enterPosition) then
return true
end

if not player:getItemById(3086, deepSearch) and not player:getCondition(CONDITION_INVISIBLE) then
player:teleportTo(exitPosition)
player:teleportTo(Position(32519, 32914, 7))
player:getPosition():sendMagicEffect(CONST_ME_POFF)
player:say("Why are you sneaking around to my house? Think I don't see you?", TALKTYPE_MONSTER_SAY)
end

return true
end

erayoHouse:type("stepin")
erayoHouse:id(486)
erayoHouse:position({x = 32517, y = 32909, z = 7})
erayoHouse:register()
Loading