Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- fix map/adventurer stone
  • Loading branch information
mattyx14 committed Nov 14, 2023
1 parent 38626f8 commit dbd3ddb
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 35 deletions.
1 change: 1 addition & 0 deletions data-otxserver/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-otxserver/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-otxserver/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
4 changes: 4 additions & 0 deletions data-otxserver/monster/quests/soul_war/goshnars_hatred.lua
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 @@ -19,11 +19,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 @@ -32,30 +52,22 @@ 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)
playerPos:sendMagicEffect(CONST_ME_TELEPORT)

local destination = Position(32210, 32300, 6)
local destination = Position(122, 337, 7)
player:teleportTo(destination)
destination:sendMagicEffect(CONST_ME_TELEPORT)
return true
Expand Down
4 changes: 3 additions & 1 deletion data-otxserver/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()
3 changes: 2 additions & 1 deletion data-otxserver/scripts/actions/other/bag_you_desire.lua
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-otxserver/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
8 changes: 4 additions & 4 deletions data-otxserver/scripts/actions/other/exercise_training.lua
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-otxserver/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()
12 changes: 3 additions & 9 deletions data-otxserver/scripts/globalevents/customs/save_interval.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ local function serverSave(interval)
end

saveServer()
local message = "Server save complete. Next save in %d %ss!"
local messageSingle = "Server save complete. Next save in %d %s!"
local message = string.format(SAVE_INTERVAL_CONFIG_TIME > 1 and "Server save complete. Next save in %d %ss!" or "Server save complete. Next save in %d %s!", SAVE_INTERVAL_CONFIG_TIME, SAVE_INTERVAL_TYPE)
Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT)
logger.info(message)
Webhook.sendMessage("Server save", message, WEBHOOK_COLOR_WARNING)
if SAVE_INTERVAL_CONFIG_TIME > 1 then
Game.broadcastMessage(string.format(message, SAVE_INTERVAL_CONFIG_TIME, SAVE_INTERVAL_TYPE), MESSAGE_GAME_HIGHLIGHT)
logger.info(string.format(message, SAVE_INTERVAL_CONFIG_TIME, SAVE_INTERVAL_TYPE))
else
Game.broadcastMessage(string.format(messageSingle, SAVE_INTERVAL_CONFIG_TIME, SAVE_INTERVAL_TYPE), MESSAGE_GAME_HIGHLIGHT)
logger.info(string.format(messageSingle, SAVE_INTERVAL_CONFIG_TIME, SAVE_INTERVAL_TYPE))
end
end

local save = GlobalEvent("save")
Expand Down
Binary file modified data-otxserver/world/forgotten.otbm
Binary file not shown.

0 comments on commit dbd3ddb

Please sign in to comment.