Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyx14 committed Nov 20, 2023
1 parent dbd3ddb commit 0cd4174
Show file tree
Hide file tree
Showing 39 changed files with 565 additions and 329 deletions.
2 changes: 0 additions & 2 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ onlyPremiumAccount = false
-- NOTE: buyBlessCommandFee will add fee when player buy bless by command (!bless), active changing value between 1 and 100 (fee percent. ex: 3 = 3%, 30 = 30%)
-- NOTE: teleportPlayerToVocationRoom will enable oressa to teleport player to his/her room vocation
-- NOTE: toggleReceiveReward = true, will enable players to choose one of reward exercise weapon by command !reward
-- NOTE: randomMonsterSpawn = true, will enable monsters from the same spawn to be randomized between them, thus making a variable hunt
weatherRain = false
thunderEffect = false
allConsoleLog = false
Expand All @@ -219,7 +218,6 @@ buyAolCommandFee = 0
buyBlessCommandFee = 0
teleportPlayerToVocationRoom = true
toggleReceiveReward = false
randomMonsterSpawn = false

-- Teleport summon
-- Set to true will never remove the summon
Expand Down
9 changes: 7 additions & 2 deletions data-otxserver/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1705,8 +1705,6 @@ Storage = {
-- Reserved storage 52396-52410 (TheOrderOfTheLion)
Drume = {
Commander = 52396, -- Global
TotalLionCommanders = 52397, -- Global
TotalUsurperCommanders = 52398, -- Global
},
},
-- News quest development
Expand Down Expand Up @@ -3067,6 +3065,13 @@ GlobalStorage = {
DiprathSwitchesGlobalStorage = 60161,
AshmunrahSwitchesGlobalStorage = 60162,
},
TheOrderOfTheLion = {
-- Reserved storage from 60170 - 60171
Drume = {
TotalLionCommanders = 60170, -- Global
TotalUsurperCommanders = 60171, -- Global
},
},
FuryGates = 65000,
Yakchal = 65001,
PitsOfInfernoLevers = 65002,
Expand Down
4 changes: 4 additions & 0 deletions data-otxserver/monster/mammals/white_deer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ monster.outfit = {
lookMount = 0,
}

monster.events = {
"WhiteDeerDeath",
}

monster.raceId = 720
monster.Bestiary = {
class = "Mammal",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ monster.strategiesTarget = {
nearest = 100,
}

monster.events = {
"KesarImmortal",
}

monster.flags = {
summonable = false,
attackable = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ monster.strategiesTarget = {
nearest = 100,
}

monster.events = {
"LionCommanderDeath",
}

monster.flags = {
summonable = false,
attackable = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ monster.speed = 125
monster.manaCost = 0

monster.faction = FACTION_LIONUSURPERS
monster.enemyFactions = { FACTION_LION, FACTION_PLAYER }
monster.enemyFactions = { FACTION_PLAYER, FACTION_LION }

monster.changeTarget = {
interval = 4000,
Expand All @@ -33,7 +33,7 @@ monster.strategiesTarget = {
}

monster.events = {
"usurperCommanderDeath",
"UsurperCommanderDeath",
}

monster.flags = {
Expand Down
4 changes: 1 addition & 3 deletions data-otxserver/scripts/actions/other/construction_kits.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ local constructionKits = {
[2780] = 2418,
[2781] = 2422,
[2782] = 2319,
[2812] = 11812,
[10207] = 2986,
[2812] = 2986,
[2785] = 2314,
[2786] = 2347,
[2787] = 2348,
Expand Down Expand Up @@ -36,7 +35,6 @@ local constructionKits = {
[2809] = 2426,
[2810] = 2352,
[2811] = 2982,
[2812] = 2353,
[5086] = 5046,
[5087] = 5055,
[5088] = 5056,
Expand Down
8 changes: 6 additions & 2 deletions data-otxserver/scripts/globalevents/others/startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ function serverstartup.onStartup()
-- Create new item on map
CreateMapItem(CreateItemOnMap)
-- Update old quest storage keys
--[[
updateKeysStorage(QuestKeysUpdate)
]]

logger.debug("Loaded all actions in the map")
logger.debug("Loaded all uniques in the map")
Expand Down Expand Up @@ -107,6 +105,12 @@ function serverstartup.onStartup()
Result.free(banResultId)
end

-- Ferumbras Ascendant quest
for i = 1, #GlobalStorage.FerumbrasAscendant.Habitats do
local storage = GlobalStorage.FerumbrasAscendant.Habitats[i]
Game.setStorageValue(storage, 0)
end

-- Check house auctions
local resultId = db.storeQuery("SELECT `id`, `highest_bidder`, `last_bid`, (SELECT `balance` FROM \z
`players` WHERE `players`.`id` = `highest_bidder`) AS `balance` FROM `houses` WHERE `owner` = 0 AND \z
Expand Down
2 changes: 0 additions & 2 deletions data-otxserver/scripts/globalevents/spawn/raids.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
local raids = {
--[[
--Terça-Feira
["Tuesday"] = {
["16:00"] = { raidName = "Midnight Panther" },
Expand Down Expand Up @@ -35,7 +34,6 @@ local raids = {
["31/10"] = {
["16:00"] = { raidName = "Halloween Hare" },
},
]]
}

local spawnRaids = GlobalEvent("spawn raids")
Expand Down
4 changes: 0 additions & 4 deletions data-otxserver/scripts/lib/register_actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,6 @@ function onUsePick(player, item, fromPosition, target, toPosition, isHotkey)
end
target:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
target:remove(1)
elseif target.itemid == 10310 then
target:remove(1)
toPosition:sendMagicEffect(CONST_ME_POFF)
player:addItem(3035, 10)
elseif target.itemid == 7200 then
target:transform(7236)
target:decay()
Expand Down
29 changes: 24 additions & 5 deletions data-otxserver/scripts/movements/teleport/citizen.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
local config = {
[9059] = TOWNS_LIST.TREKOLT,
[9056] = TOWNS_LIST.RHYVES,
[9060] = TOWNS_LIST.VARAK,
[9057] = TOWNS_LIST.JORVIK,
[9058] = TOWNS_LIST.SAUND
[9059] = TOWNS_LIST.AB_DENDRIEL,
[9056] = TOWNS_LIST.CARLIN,
[9060] = TOWNS_LIST.KAZORDOON,
[9057] = TOWNS_LIST.THAIS,
[9058] = TOWNS_LIST.VENORE,
[9061] = TOWNS_LIST.DARASHIA,
[9062] = TOWNS_LIST.ANKRAHMUN,
[9063] = TOWNS_LIST.EDRON,
[9068] = TOWNS_LIST.FARMINE,
[9064] = TOWNS_LIST.LIBERTY_BAY,
[9065] = TOWNS_LIST.PORT_HOPE,
[9066] = TOWNS_LIST.SVARGROND,
[9067] = TOWNS_LIST.YALAHAR,
[9240] = TOWNS_LIST.GRAY_BEACH,
[9510] = TOWNS_LIST.RATHLETON,
[9500] = TOWNS_LIST.ROSHAMUUL,
[9515] = TOWNS_LIST.ISSAVI,
}

local citizen = MoveEvent()
Expand All @@ -24,6 +36,13 @@ function citizen.onStepIn(creature, item, position, fromPosition)
return true
end

if town:getId() == TOWNS_LIST.SVARGROND and player:getStorageValue(Storage.BarbarianTest.Questline) < 8 then
player:sendTextMessage(MESSAGE_GAME_HIGHLIGHT, "You first need to absolve the Barbarian Test Quest to become citizen!")
player:teleportTo(town:getTemplePosition())
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end

player:setTown(town)
player:teleportTo(town:getTemplePosition())
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local bounacEntrance = Action()
function bounacEntrance.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item:getActionId() == 59602 then
if player:getLevel() < 250 then
player:sendCancelMessage("You need at least level 250.")
toPosition:sendMagicEffect(CONST_ME_POFF)
else
player:teleportTo({ x = 32423, y = 32448, z = 7 })
toPosition:sendMagicEffect(CONST_ME_WATERSPLASH)
Position({ x = 32423, y = 32448, z = 7 }):sendMagicEffect(CONST_ME_WATERSPLASH)
end
elseif item:getActionId() == 59603 then
player:teleportTo({ x = 33183, y = 31756, z = 7 })
Position({ x = 33183, y = 31756, z = 7 }):sendMagicEffect(CONST_ME_WATERSPLASH)
toPosition:sendMagicEffect(CONST_ME_WATERSPLASH)
end
return true
end

bounacEntrance:aid(59602)
bounacEntrance:aid(59603)
bounacEntrance:register()
120 changes: 120 additions & 0 deletions data-otxserver/scripts/quests/the_order_of_lion/action-drume.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
local config = {
lionPosition = {
Position(32444, 32512, 7),
Position(32449, 32516, 7),
Position(32444, 32520, 7),
},
usurperPosition = {
Position(32450, 32520, 7),
Position(32444, 32516, 7),
Position(32448, 32512, 7),
},
firstPlayerPosition = Position(32457, 32508, 6),
centerPosition = Position(32439, 32523, 7), -- Center Room
exitPosition = Position(32453, 32503, 7), -- Exit Position
newPosition = Position(32453, 32510, 7),
rangeX = 22,
rangeY = 16,
timeToKill = 20, -- time in minutes to remove the player
}

local currentEvent = nil

local function clearRoomDrume(centerPosition, rangeX, rangeY, resetGlobalStorage)
local spectators, spectator = Game.getSpectators(centerPosition, false, false, rangeX, rangeX, rangeY, rangeY)
for i = 1, #spectators do
spectator = spectators[i]
if spectator:isMonster() then
spectator:remove()
end
if spectator:isPlayer() then
spectator:teleportTo(config.exitPosition)
spectator:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your time is over.")
end
end
if Game.getStorageValue(resetGlobalStorage) == 1 then
Game.setStorageValue(resetGlobalStorage, -1)
end
currentEvent = nil
end

local drumeAction = Action()
function drumeAction.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getPosition() ~= config.firstPlayerPosition then
return false
end

local spectators = Game.getSpectators(config.centerPosition, false, true, config.rangeX, config.rangeX, config.rangeY, config.rangeY)
if #spectators ~= 0 then
player:sendCancelMessage("There's someone already in the skirmish.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return true
end

local tempPos, tempTile, tempCreature
local players = {}
for x = config.firstPlayerPosition.x, config.firstPlayerPosition.x + 4 do
tempPos = Position(x, config.firstPlayerPosition.y, config.firstPlayerPosition.z)
tempTile = Tile(tempPos)
if tempTile then
tempCreature = tempTile:getTopCreature()
if tempCreature and tempCreature:isPlayer() then
table.insert(players, tempCreature)
end
end
end
if #players == 0 then
return false
end
for _, pi in pairs(players) do
if not pi:canFightBoss("Drume") then
player:sendCancelMessage("Someone of your team has already fought in the skirmish in the last 10h.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return true
end
end
local spectators = Game.getSpectators(config.centerPosition, false, false, config.rangeX, config.rangeX, config.rangeY, config.rangeY)
for _, creature in pairs(spectators) do
if creature:isMonster() then
creature:remove()
end
end
local totalLion = 0
local totalUsurper = 0
local tempMonster
for _, pos in pairs(config.lionPosition) do
tempMonster = Game.createMonster("Lion Commander", pos)
if not tempMonster then
player:sendCancelMessage("There was an error, contact an admin.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return true
end
totalLion = totalLion + 1
end
for _, pos in pairs(config.usurperPosition) do
tempMonster = Game.createMonster("Usurper Commander", pos)
if not tempMonster then
player:sendCancelMessage("There was an error, contact an admin.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return true
end
totalUsurper = totalUsurper + 1
end
for _, pi in pairs(players) do
pi:setBossCooldown("Drume", os.time() + (configManager.getNumber(configKeys.BOSS_DEFAULT_TIME_TO_FIGHT_AGAIN)))
pi:teleportTo(config.newPosition)
pi:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have " .. config.timeToKill .. " minutes to defeat Drume.")
end
if currentEvent then
stopEvent(currentEvent)
end
currentEvent = addEvent(clearRoomDrume, config.timeToKill * 60 * 1000, config.centerPosition, config.rangeX, config.rangeY, resetGlobalStorage)
config.newPosition:sendMagicEffect(CONST_ME_TELEPORT)
toPosition:sendMagicEffect(CONST_ME_POFF)
Game.setStorageValue(GlobalStorage.TheOrderOfTheLion.Drume.TotalLionCommanders, totalLion)
Game.setStorageValue(GlobalStorage.TheOrderOfTheLion.Drume.TotalUsurperCommanders, totalUsurper)
return true
end

drumeAction:aid(59601)
drumeAction:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
local elevatorBounacAction = Action()
function elevatorBounacAction.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getPosition() ~= Position(32371, 32496, 7) then
Position(32371, 32496, 7):sendMagicEffect(CONST_ME_POFF)
else
player:teleportTo(Position(32374, 32497, 3))
Position(32374, 32497, 3):sendMagicEffect(CONST_ME_POFF)
end
return true
end

elevatorBounacAction:aid(59604)
elevatorBounacAction:register()

local elevatorBounacMoveEvent = MoveEvent()
function elevatorBounacMoveEvent.onStepIn(creature, item, position, fromPosition)
if creature:isPlayer() then
creature:teleportTo(Position(32371, 32497, 7))
Position(32371, 32497, 7):sendMagicEffect(CONST_ME_POFF)
end
return true
end

elevatorBounacMoveEvent:aid(59605)
elevatorBounacMoveEvent:register()
Loading

0 comments on commit 0cd4174

Please sign in to comment.