-
-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into Nyedson-patch-2
- Loading branch information
Showing
71 changed files
with
221 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 0 additions & 19 deletions
19
data-otservbr-global/scripts/actions/other/cobra_flask.lua
This file was deleted.
Oops, something went wrong.
102 changes: 53 additions & 49 deletions
102
data-otservbr-global/scripts/actions/quests/oramond/glooth_fairy_lever.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,73 @@ | ||
local function removeBosst(fromArea1, fromArea2, bossName) | ||
for x = fromArea1.x, fromArea2.x do | ||
for y = fromArea1.y, fromArea2.y do | ||
for z = fromArea1.z, fromArea2.z do | ||
if getTopCreature({ x = x, y = y, z = z, stackpos = 255 }).uid > 0 then | ||
if isMonster(getTopCreature({ x = x, y = y, z = z, stackpos = 255 }).uid) then | ||
if string.lower(getCreatureName(getTopCreature({ x = x, y = y, z = z, stackpos = 255 }).uid)) == bossName then | ||
doRemoveCreature(getTopCreature({ x = x, y = y, z = z, stackpos = 255 }).uid) | ||
end | ||
local function clearMonstersAndTeleportPlayers() | ||
local leverRoomFromPos = Position(33658, 31934, 9) | ||
local leverRoomToPos = Position(33670, 31940, 9) | ||
local bossRoomFromPos = Position(33678, 31922, 9) | ||
local bossRoomToPos = Position(33699, 31943, 9) | ||
local exitPos = Position(33657, 31943, 9) | ||
local destinationPos = Position(33684, 31932, 9) | ||
|
||
for x = leverRoomFromPos.x, leverRoomToPos.x do | ||
for y = leverRoomFromPos.y, leverRoomToPos.y do | ||
for z = leverRoomFromPos.z, leverRoomToPos.z do | ||
local currentTile = Tile(Position({ x = x, y = y, z = z })) | ||
if currentTile then | ||
local topCreature = currentTile:getTopCreature() | ||
if topCreature and topCreature:isPlayer() then | ||
topCreature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | ||
topCreature:teleportTo(exitPos) | ||
topCreature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
return true | ||
end | ||
|
||
local function teleportAllPlayersFromAreat(fromArea1, fromArea2, toPos) | ||
for x = fromArea1.x, fromArea2.x do | ||
for y = fromArea1.y, fromArea2.y do | ||
for z = fromArea1.z, fromArea2.z do | ||
local tile = Tile(Position({ x = x, y = y, z = z })) | ||
if tile then | ||
local player = tile:getTopCreature() | ||
if player and player:isPlayer() then | ||
player:teleportTo(toPos) | ||
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | ||
for x = bossRoomFromPos.x, bossRoomToPos.x do | ||
for y = bossRoomFromPos.y, bossRoomToPos.y do | ||
for z = bossRoomFromPos.z, bossRoomToPos.z do | ||
local currentTile = Tile(Position({ x = x, y = y, z = z })) | ||
if currentTile then | ||
local topCreature = currentTile:getTopCreature() | ||
if topCreature and topCreature:isMonster() then | ||
topCreature:remove() | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
for x = bossRoomFromPos.x, bossRoomToPos.x do | ||
for y = bossRoomFromPos.y, bossRoomToPos.y do | ||
for z = bossRoomFromPos.z, bossRoomToPos.z do | ||
local currentTile = Tile(Position({ x = x, y = y, z = z })) | ||
if currentTile then | ||
local topCreature = currentTile:getTopCreature() | ||
if topCreature and topCreature:isPlayer() then | ||
topCreature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | ||
topCreature:teleportTo(destinationPos) | ||
topCreature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
return true | ||
end | ||
|
||
local function PrepareEnter() | ||
removeBosst({ x = 33679, y = 31919, z = 9 }, { x = 33701, y = 31941, z = 9 }, "glooth fairy") | ||
teleportAllPlayersFromAreat({ x = 33659, y = 31935, z = 9 }, { x = 33668, y = 31939, z = 9 }, { x = 33684, y = 31935, z = 9 }) | ||
Game.createMonster("Glooth Fairy", { x = 33688, y = 31937, z = 9 }) | ||
Game.createMonster("Glooth Fairy", Position(33688, 31937, 9), false, true) | ||
end | ||
|
||
local oramondGloothLever = Action() | ||
function oramondGloothLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
if item.itemid == 8913 then | ||
if getGlobalStorageValue(15560) >= os.time() then | ||
doPlayerSendTextMessage(player, 19, "You need to wait 15 minutes to use again.") | ||
return true | ||
end | ||
local gloothFairyLever = Action() | ||
|
||
local specs, spec = Game.getSpectators({ x = 33688, y = 31932, z = 9 }, false, false, 13, 13, 13, 13) | ||
for i = 1, #specs do | ||
spec = specs[i] | ||
if spec:isPlayer() then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A team is already inside the quest room.") | ||
return true | ||
end | ||
spec:remove() | ||
end | ||
setGlobalStorageValue(18081, os.time() + 15 * 60) | ||
player:say("Everyone in this place will be teleported into Glooth Fairy's hideout in one minute. No way back!!!", TALKTYPE_MONSTER_SAY) | ||
addEvent(PrepareEnter, 60 * 1000) | ||
function gloothFairyLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
if Game.getStorageValue(GlobalStorage.GloothFairyTimer) >= os.time() then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait 15 minutes to use again.") | ||
return true | ||
end | ||
|
||
item:transform(item.itemid == 8913 and 8914 or 8913) | ||
player:say("Everyone in this place will be teleported into Glooth Fairy's hideout in one minute. No way back!!!", TALKTYPE_MONSTER_SAY) | ||
Game.setStorageValue(GlobalStorage.GloothFairyTimer, os.time() + 15 * 60) | ||
addEvent(clearMonstersAndTeleportPlayers, 60 * 1000) | ||
return true | ||
end | ||
|
||
oramondGloothLever:uid(1020) | ||
oramondGloothLever:register() | ||
gloothFairyLever:uid(1020) | ||
gloothFairyLever:register() |
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
...rvbr-global/scripts/globalevents/game_migrations/20241708362079_move_vip_system_to_kv.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
local isVipStorage = 150001 | ||
|
||
local function migrateIsVipSystem(player) | ||
local isVipValue = player:getStorageValue(isVipStorage) | ||
if isVipValue > 0 then | ||
player:kv():scoped("account"):set("vip-system", true) | ||
player:setStorageValue(isVipStorage, -1) | ||
end | ||
end | ||
|
||
local migration = Migration("20241708362079_move_vip_system_to_kv") | ||
|
||
function migration:onExecute() | ||
self:forEachPlayer(migrateIsVipSystem) | ||
end | ||
|
||
migration:register() |
69 changes: 0 additions & 69 deletions
69
data-otservbr-global/scripts/globalevents/others/spawns_npc_by_time.lua
This file was deleted.
Oops, something went wrong.
71 changes: 27 additions & 44 deletions
71
data-otservbr-global/scripts/quests/threatened_dreams/event-raven_herb_bush.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,59 @@ | ||
local ThreatenedDreams = Storage.Quest.U11_40.ThreatenedDreams | ||
local periods = { | ||
[LIGHT_STATE_NIGHT] = "Night", | ||
[LIGHT_STATE_DAY] = "Day", | ||
[LIGHT_STATE_SUNRISE] = "Sunrise", | ||
[LIGHT_STATE_SUNSET] = "Sunset", | ||
} | ||
local config = { | ||
-- createByType day / night | ||
[1] = { -- create in night | ||
bushId = 25783, | ||
createItem = LIGHT_STATE_NIGHT, | ||
removeItem = LIGHT_STATE_SUNRISE, | ||
pos = Position(33497, 32196, 7), | ||
herbId = 5953, | ||
herbWeight = 1, | ||
storage = ThreatenedDreams.Mission03.RavenHerbTimer, | ||
}, | ||
bushId = 25783, | ||
createItem = LIGHT_STATE_NIGHT, | ||
removeItem = LIGHT_STATE_SUNRISE, | ||
pos = Position(33497, 32196, 7), | ||
herbId = 5953, | ||
herbWeight = 1, | ||
storage = Storage.Quest.U11_40.ThreatenedDreams.Mission03.RavenHerbTimer, | ||
} | ||
|
||
local createRavenHerb = GlobalEvent("createRavenHerb") | ||
|
||
function createRavenHerb.onPeriodChange(period, light) | ||
local time = getWorldTime() | ||
|
||
if configManager.getBoolean(configKeys.ALL_CONSOLE_LOG) then | ||
logger.info("Starting {} Current light is {} and it's {} Tibian Time", periods[period], light, getFormattedWorldTime(time)) | ||
end | ||
for index, item in pairs(config) do | ||
if item.createItem == period then -- Adding | ||
local createItem = Game.createItem(item.bushId, 1, item.pos) | ||
createItem:setActionId(item.storage) | ||
if createItem then | ||
item.pos:sendMagicEffect(CONST_ME_BIGPLANTS) | ||
end | ||
elseif item.removeItem == period then -- Removing | ||
local target = Tile(item.pos):getItemById(item.bushId) | ||
if target then | ||
item.pos:removeItem(item.bushId, CONST_ME_BIGPLANTS) | ||
end | ||
local pos = config.pos | ||
if config.createItem == period then | ||
local createItem = Game.createItem(config.bushId, 1, pos) | ||
if createItem then | ||
pos:sendMagicEffect(CONST_ME_BIGPLANTS) | ||
end | ||
elseif config.removeItem == period then | ||
local target = Tile(pos):getItemById(config.bushId) | ||
if target then | ||
pos:removeItem(config.bushId, CONST_ME_BIGPLANTS) | ||
end | ||
end | ||
|
||
return true | ||
end | ||
|
||
createRavenHerb:register() | ||
|
||
local ravenHerb = Action() | ||
|
||
function ravenHerb.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
local herbConfig = config[1] | ||
local message = "You have found a " .. getItemName(herbConfig.herbId) .. "." | ||
local message = "You have found a " .. getItemName(config.herbId) .. "." | ||
local backpack = player:getSlotItem(CONST_SLOT_BACKPACK) | ||
|
||
if not backpack or backpack:getEmptySlots(true) < 1 then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message .. " But you have no room to take it.") | ||
return true | ||
end | ||
if (player:getFreeCapacity() / 100) < herbConfig.herbWeight then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message .. ". Weighing " .. herbConfig.herbWeight .. " oz, it is too heavy for you to carry.") | ||
|
||
if (player:getFreeCapacity() / 100) < config.herbWeight then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message .. ". Weighing " .. config.herbWeight .. " oz, it is too heavy for you to carry.") | ||
return true | ||
end | ||
|
||
if player:getStorageValue(herbConfig.storage) > os.time() then | ||
if player:getStorageValue(config.storage) > os.time() then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The raven herb cannot be collected right now.") | ||
return true | ||
end | ||
|
||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. getItemName(herbConfig.herbId) .. ".") | ||
player:setStorageValue(herbConfig.storage, os.time() + 60 * 30 * 1000) -- Can be collected on next cycle | ||
player:addItem(herbConfig.herbId, 1) | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message) | ||
player:setStorageValue(config.storage, os.time() + 60 * 30 * 1000) | ||
player:addItem(config.herbId, 1) | ||
return true | ||
end | ||
|
||
ravenHerb:aid(ThreatenedDreams.Mission03.RavenHerbTimer) | ||
ravenHerb:id(25783) | ||
ravenHerb:register() |
Oops, something went wrong.