Skip to content

Commit

Permalink
Merge branch 'main' into fix-normal-random
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas authored Nov 13, 2023
2 parents bebdd5e + 8bb5b9c commit 00c1566
Show file tree
Hide file tree
Showing 61 changed files with 473 additions and 281 deletions.
10 changes: 10 additions & 0 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ loyaltyPointsPerPremiumDaySpent = 0
loyaltyPointsPerPremiumDayPurchased = 0
loyaltyBonusPercentageMultiplier = 1.0

-- Custom PvP system
-- NOTE: Rate is additive percent for each level and applied multiplicative to totalDamage
-- NOTE: Damage multipliers for each vocation are adjusted in data/XML/vocations.xml
pvpRateDamageTakenPerLevel = 0.0 -- recommended to start with 0.1
pvpRateDamageReductionPerLevel = 0.0 -- recommended to start with 0.1
pvpMaxLevelDifference = 0


-- Wheel of destiny system
-- NOTE: set wheelSystemEnabled = false to disable the wheel of destiny
-- NOTE: only the wheel points are modified, all other data is on the client executable and cannot be modified
Expand Down Expand Up @@ -196,6 +204,7 @@ 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 @@ -211,6 +220,7 @@ buyAolCommandFee = 0
buyBlessCommandFee = 0
teleportPlayerToVocationRoom = true
toggleReceiveReward = false
randomMonsterSpawn = false

-- Teleport summon
-- Set to true will never remove the summon
Expand Down
1 change: 1 addition & 0 deletions data-otservbr-global/monster/bosses/custodian.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ monster.loot = {
{ id = 281, chance = 28000 }, -- giant shimmering pearl (green)
{ name = "cobra crest", chance = 11000 },
{ name = "skull helmet", chance = 7500 },
{ name = "cobra club", chance = 100 },
}

monster.attacks = {
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/humans/nomad_blue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ monster.events = {
"NomadDeath",
}

monster.raceId = 777
monster.raceId = 776
monster.Bestiary = {
class = "Human",
race = BESTY_RACE_HUMAN,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/humans/nomad_female.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ monster.events = {
"NomadDeath",
}

monster.raceId = 776
monster.raceId = 777
monster.Bestiary = {
class = "Human",
race = BESTY_RACE_HUMAN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ monster.flags = {
hostile = true,
convinceable = false,
pushable = false,
rewardBoss = true,
rewardBoss = false,
illusionable = false,
canPushItems = true,
canPushCreatures = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ monster.outfit = {
lookMount = 0,
}

monster.events = {
"SoulwarsBossDeath",
}

monster.health = 300000
monster.maxHealth = 300000
monster.race = "undead"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ monster.flags = {
hostile = true,
convinceable = false,
pushable = false,
rewardBoss = true,
rewardBoss = false,
illusionable = false,
canPushItems = true,
canPushCreatures = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ local config = {
enableDepots = false,

Temples = {
{ fromPos = Position(32718, 31628, 7), toPos = Position(32736, 31639, 7), townId = TOWNS_LIST.AB_DENDRIEL },
{ fromPos = Position(32356, 31775, 7), toPos = Position(32364, 31787, 7), townId = TOWNS_LIST.CARLIN },
{ fromPos = Position(32727, 31632, 7), toPos = Position(32736, 31639, 7), townId = TOWNS_LIST.AB_DENDRIEL },
{ fromPos = Position(32358, 31777, 7), toPos = Position(32364, 31787, 7), townId = TOWNS_LIST.CARLIN },
{ fromPos = Position(32642, 31921, 11), toPos = Position(32656, 31929, 11), townId = TOWNS_LIST.KAZORDOON },
{ fromPos = Position(32364, 32231, 7), toPos = Position(32374, 32243, 7), townId = TOWNS_LIST.THAIS },
{ fromPos = Position(32365, 32231, 7), toPos = Position(32374, 32243, 7), townId = TOWNS_LIST.THAIS },
{ fromPos = Position(32953, 32072, 7), toPos = Position(32963, 32081, 7), townId = TOWNS_LIST.VENORE },
{ fromPos = Position(33188, 32844, 8), toPos = Position(33201, 32857, 8), townId = TOWNS_LIST.ANKRAHMUN },
{ fromPos = Position(33208, 31803, 8), toPos = Position(33225, 31819, 8), townId = TOWNS_LIST.EDRON },
{ fromPos = Position(33018, 31514, 11), toPos = Position(33032, 31531, 11), townId = TOWNS_LIST.FARMINE },
{ fromPos = Position(33210, 32450, 1), toPos = Position(33217, 32457, 1), townId = TOWNS_LIST.DARASHIA },
{ fromPos = Position(32313, 32818, 7), toPos = Position(32322, 32830, 7), townId = TOWNS_LIST.LIBERTY_BAY },
{ fromPos = Position(32590, 32740, 7), toPos = Position(32600, 32750, 7), townId = TOWNS_LIST.PORT_HOPE },
{ fromPos = Position(32207, 31127, 7), toPos = Position(32218, 31138, 7), townId = TOWNS_LIST.SVARGROND },
{ fromPos = Position(32785, 31274, 7), toPos = Position(32789, 31279, 7), townId = TOWNS_LIST.YALAHAR },
{ fromPos = Position(33442, 31312, 9), toPos = Position(33454, 31326, 9), townId = TOWNS_LIST.GRAY_BEACH },
{ fromPos = Position(33586, 31895, 6), toPos = Position(33603, 31903, 6), townId = TOWNS_LIST.RATHLETON },
{ fromPos = Position(33510, 32360, 6), toPos = Position(33516, 32366, 6), townId = TOWNS_LIST.ROSHAMUUL },
{ fromPos = Position(33916, 31474, 5), toPos = Position(33927, 31484, 5), townId = TOWNS_LIST.ISSAVI },
{ fromPos = Position(32209, 31130, 7), toPos = Position(32215, 31136, 7), townId = TOWNS_LIST.SVARGROND },
{ fromPos = Position(32785, 31275, 7), toPos = Position(32789, 31279, 7), townId = TOWNS_LIST.YALAHAR },
{ fromPos = Position(33444, 31313, 9), toPos = Position(33452, 31324, 9), townId = TOWNS_LIST.GRAY_BEACH },
{ fromPos = Position(33586, 31895, 6), toPos = Position(33602, 31902, 6), townId = TOWNS_LIST.RATHLETON },
{ fromPos = Position(33510, 32360, 6), toPos = Position(33516, 32365, 6), townId = TOWNS_LIST.ROSHAMUUL },
{ fromPos = Position(33916, 31474, 5), toPos = Position(33926, 31480, 5), townId = TOWNS_LIST.ISSAVI },
},

Depots = {
Expand All @@ -45,11 +45,31 @@ local config = {

local adventurersStone = Action()

local function doNotTeleport(player)
local enabledLocations = {}
if config.enableTemples then
table.insert(enabledLocations, "temple")
end
if config.enableDepots then
table.insert(enabledLocations, "depot")
end
local message = "Try to move more to the center of a " .. table.concat(enabledLocations, " or ") .. " to use the spiritual energy for a teleport."
player:getPosition():sendMagicEffect(CONST_ME_POFF)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message)
end

function adventurersStone.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local playerPos, allowed, townId = player:getPosition(), false
local tile = Tile(player:getPosition())
if not tile:hasFlag(TILESTATE_PROTECTIONZONE) or tile:hasFlag(TILESTATE_HOUSE) or player:isPzLocked() or player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
doNotTeleport(player)
return false
end

local playerPos, allowed, townId = player:getPosition(), false, player:getTown():getId()

if config.enableTemples then
for _, temple in ipairs(config.Temples) do
if isInRangeIgnoreZ(playerPos, temple.fromPos, temple.toPos) then
if isInRange(playerPos, temple.fromPos, temple.toPos) then
allowed, townId = true, temple.townId
break
end
Expand All @@ -58,24 +78,16 @@ function adventurersStone.onUse(player, item, fromPosition, target, toPosition,

if config.enableDepots then
for _, depot in ipairs(config.Depots) do
if isInRangeIgnoreZ(playerPos, depot.fromPos, depot.toPos) then
if isInRange(playerPos, depot.fromPos, depot.toPos) then
allowed, townId = true, depot.townId
break
end
end
end

if not allowed then
local enabledLocations = {}
if config.enableTemples then
table.insert(enabledLocations, "temple")
end
if config.enableDepots then
table.insert(enabledLocations, "depot")
end
local message = "Try to move more to the center of a " .. table.concat(enabledLocations, " or ") .. " to use the spiritual energy for a teleport."
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message)
return true
doNotTeleport(player)
return false
end

player:setStorageValue(Storage.AdventurersGuild.Stone, townId)
Expand Down
4 changes: 3 additions & 1 deletion data-otservbr-global/scripts/actions/other/bag_you_covet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ local rewards = {
{ id = 43887, name = "Sanguine Galoshes" },
}

BagYouCovetId = 43895

local bagyouCovet = Action()

function bagyouCovet.onUse(player, item, fromPosition, target, toPosition, isHotkey)
Expand All @@ -28,5 +30,5 @@ function bagyouCovet.onUse(player, item, fromPosition, target, toPosition, isHot
return true
end

bagyouCovet:id(43895)
bagyouCovet:id(BagYouCovetId)
bagyouCovet:register()
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ local rewards = {
{ id = 34096, name = "soulshroud" },
}

BagYouDesireId = 34109
local bagyouDesire = Action()

function bagyouDesire.onUse(player, item, fromPosition, target, toPosition, isHotkey)
Expand All @@ -35,5 +36,5 @@ function bagyouDesire.onUse(player, item, fromPosition, target, toPosition, isHo
return true
end

bagyouDesire:id(34109)
bagyouDesire:id(BagYouDesireId)
bagyouDesire:register()
2 changes: 1 addition & 1 deletion data-otservbr-global/scripts/actions/other/cask_kegs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function flasks.onUse(player, item, fromPosition, target, toPosition, isHotkey)
return false
end

local charges = target:getCharges()
local charges = item:getCharges()
local itemCount = item:getCount()
local recharged = itemCount

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local function isDummy(id)
return dummies[id] and dummies[id] > 0
end

local cooldown = 2
local cooldown = 10

function exerciseTraining.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not target then
Expand All @@ -17,8 +17,7 @@ function exerciseTraining.onUse(player, item, fromPosition, target, toPosition,

if target:isItem() and isDummy(targetId) then
if onExerciseTraining[playerId] then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This exercise dummy can only be used after a " .. cooldown .. " second cooldown.")
LeaveTraining(playerId)
player:sendTextMessage(MESSAGE_FAILURE, "You are already training!")
return true
end

Expand Down Expand Up @@ -56,7 +55,7 @@ function exerciseTraining.onUse(player, item, fromPosition, target, toPosition,
end

if player:getStorageValue(Storage.IsTraining) > os.time() then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This exercise dummy can only be used after a " .. cooldown .. " second cooldown.")
player:sendTextMessage(MESSAGE_FAILURE, "You are already training!")
return true
end

Expand All @@ -66,6 +65,7 @@ function exerciseTraining.onUse(player, item, fromPosition, target, toPosition,
onExerciseTraining[playerId].dummyPos = targetPos
player:setTraining(true)
player:setStorageValue(Storage.IsTraining, os.time() + cooldown)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have started training on an exercise dummy.")
end
return true
end
Expand Down
3 changes: 2 additions & 1 deletion data-otservbr-global/scripts/actions/other/primal_bag.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ local rewards = {
{ id = 39186, name = "charged arboreal ring" },
}

PrimalBagId = 39546
local primalBag = Action()

function primalBag.onUse(player, item, fromPosition, target, toPosition, isHotkey)
Expand All @@ -29,5 +30,5 @@ function primalBag.onUse(player, item, fromPosition, target, toPosition, isHotke
return true
end

primalBag:id(39546)
primalBag:id(PrimalBagId)
primalBag:register()
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function dangerousDepthPesticide.onUse(player, item, fromPosition, target, toPos
return true
end

if not target or not target:isItem() then
if not (target or target:isItem()) then
return false
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local config = {
name = "soul of dragonking zyrtarch",
position = Position(33359, 31182, 12),
},
requiredLevel = 250,
playerPositions = {
{ pos = Position(33391, 31178, 10), teleport = Position(33359, 31186, 10) },
{ pos = Position(33391, 31179, 10), teleport = Position(33359, 31186, 10) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ local config = {
end,
},
timeToDefeat = 15 * 60, -- In seconds
requiredLevel = 250,
playerPositions = {
{ pos = Position(32302, 31088, 14), teleport = Position(32271, 31097, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(32302, 31089, 14), teleport = Position(32271, 31097, 14), effect = CONST_ME_TELEPORT },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ local config = {
},
timeToFightAgain = ParseDuration("14d") / 1000,
timeToDefeat = ParseDuration("17m") / 1000,
requiredLevel = 250,
playerPositions = {
{ pos = Position(32018, 32844, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32019, 32844, 14), teleport = Position(31984, 32851, 14) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local config = {
name = "Lloyd",
position = Position(32799, 32827, 14),
},
requiredLevel = 250,
playerPositions = {
{ pos = Position(32759, 32868, 14), teleport = Position(32800, 32831, 14) },
{ pos = Position(32759, 32869, 14), teleport = Position(32800, 32831, 14) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@ local config = {
name = "Lady Tenebris",
position = Position(32912, 31599, 14),
},
requiredLevel = 250,
playerPositions = {
{ pos = Position(32902, 31623, 14), teleport = Position(32911, 31603, 14) },
{ pos = Position(32902, 31624, 14), teleport = Position(32911, 31603, 14) },
{ pos = Position(32902, 31625, 14), teleport = Position(32911, 31603, 14) },
{ pos = Position(32902, 31626, 14), teleport = Position(32911, 31603, 14) },
{ pos = Position(32902, 31627, 14), teleport = Position(32911, 31603, 14) },
},
onUseExtra = function(player)
for d = 1, 6 do
Game.createMonster("shadow tentacle", Position(math.random(32909, 32914), math.random(31596, 31601), 14), true, true)
end
end,
monsters = {
{ name = "shadow tentacle", pos = Position(32910, 31599, 14) },
{ name = "shadow tentacle", pos = Position(32912, 31597, 14) },
{ name = "shadow tentacle", pos = Position(32914, 31599, 14) },
},
specPos = {
from = Position(32895, 31585, 14),
to = Position(32830, 32855, 14),
from = Position(32899, 31587, 14),
to = Position(32923, 31612, 14),
},
exit = Position(32902, 31629, 14),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ local config = {
return Game.createMonster("Mounted Thorn Knight", Position(32624, 32880, 14), true, true)
end,
},
requiredLevel = 250,
playerPositions = {
{ pos = Position(32657, 32877, 14), teleport = Position(32624, 32886, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(32657, 32878, 14), teleport = Position(32624, 32886, 14), effect = CONST_ME_TELEPORT },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local config = {
name = "The Time Guardian",
position = Position(32977, 31662, 14),
},
requiredLevel = 250,
playerPositions = {
{ pos = Position(33010, 31660, 14), teleport = Position(32977, 31667, 14) },
{ pos = Position(33010, 31661, 14), teleport = Position(32977, 31667, 14) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,7 @@ function dreamCourtsLever.onUse(player, item, fromPosition, target, toPosition,
creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "All the players need to be level " .. config.requiredLevel .. " or higher.")
return false
end
if creature:getStorageValue(config.storage) > os.time() then
local info = lever:getInfoPositions()
for _, v in pairs(info) do
local newPlayer = v.creature
if newPlayer then
newPlayer:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You or a member in your team have to wait " .. config.timeToFightAgain .. " hours to face " .. bossToday .. " again!")
if newPlayer:getStorageValue(config.storage) > os.time() then
newPlayer:getPosition():sendMagicEffect(CONST_ME_POFF)
end
end
end
if not lever:canUseLever(player, bossToday, config.timeToFightAgain) then
return false
end
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ function theOutlawPower.onUse(player, item, fromPosition, target, toPosition, is
return true
end

theOutlawPower:id(1491)
theOutlawPower:uid(3402)
theOutlawPower:register()
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local bosses = {

-- This will set the status of warzone (killing 1, 2 and 3 wz bosses in order you can open the chest and get "some golden fruits") and the reward chest storages
local bossesWarzone = CreatureEvent("BossesWarzoneDeath")
function bossesWarzone.onDeath(target)
function bossesWarzone.onDeath(creature)
local bossConfig = bosses[creature:getName():lower()]
if not bossConfig then
return true
Expand Down
Loading

0 comments on commit 00c1566

Please sign in to comment.