Skip to content

Commit

Permalink
Merge branch 'main' into tibia1410
Browse files Browse the repository at this point in the history
  • Loading branch information
jprzimba committed Dec 30, 2024
2 parents c2bb828 + d59449b commit 99f6548
Show file tree
Hide file tree
Showing 35 changed files with 475 additions and 261 deletions.
7 changes: 6 additions & 1 deletion config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ allowChangeOutfit = true
freePremium = false
kickIdlePlayerAfterMinutes = 15
maxMessageBuffer = 4
emoteSpells = false
allowWalkthrough = true
coinPacketSize = 25
coinImagesURL = "http://127.0.0.1/images/store/"
Expand All @@ -452,8 +451,10 @@ maxDamageReflection = 200

-- Chain system
-- NOTE: combatChainDelay: set to minimum 50 miliseconds
-- NOTE: chainSystemModifyMagic will increase power of wands and rods based on player magic level
toggleChainSystem = false
chainSystemVipOnly = true
chainSystemModifyMagic = false
combatChainDelay = 50
combatChainTargets = 5
combatChainSkillFormulaAxe = 0.9
Expand All @@ -463,6 +464,10 @@ combatChainSkillFormulaDistance = 0.9
combatChainSkillFormulaMissile = 0.9
combatChainSkillFormulaWandsAndRods = 1.0

-- Spells
emoteSpells = false
spellNameInsteadOfWords = false

-- Global server Save
-- NOTE: globalServerSaveNotifyDuration in minutes
globalServerSaveNotifyMessage = true
Expand Down
5 changes: 4 additions & 1 deletion data-global/scripts/lib/register_actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,10 @@ function onUsePick(player, item, fromPosition, target, toPosition, isHotkey)
-- The Pits of Inferno Quest
if toPosition == Position(32808, 32334, 11) then
for i = 1, #lava do
Game.createItem(5815, 1, lava[i])
local lavaTile = Tile(lava[i]):getItemById(21477)
if lavaTile then
lavaTile:transform(5815)
end
end
target:transform(3141)
toPosition:sendMagicEffect(CONST_ME_SMOKE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
local flowerPositions = {
[1] = { itemid = 3676, position = Position(33455, 32707, 14) },
[2] = { itemid = 3676, position = Position(33460, 32707, 14) },
[3] = { itemid = 3678, position = Position(33455, 32708, 14) },
[4] = { itemid = 3677, position = Position(33457, 32707, 14) },
[5] = { itemid = 3678, position = Position(33457, 32708, 14) },
[6] = { itemid = 3677, position = Position(33456, 32708, 14) },
[7] = { itemid = 3676, position = Position(33458, 32709, 14) },
[8] = { itemid = 3677, position = Position(33459, 32708, 14) },
[9] = { itemid = 3678, position = Position(33460, 32709, 14) },
[1] = { itemid = 3676, position = Position(33455, 32708, 14) },
[2] = { itemid = 3676, position = Position(33459, 32707, 14) },
[3] = { itemid = 3676, position = Position(33460, 32708, 14) },
[4] = { itemid = 3678, position = Position(33456, 32692, 14) },
[5] = { itemid = 3678, position = Position(33458, 32692, 14) },
[6] = { itemid = 3678, position = Position(33460, 32693, 14) },
[7] = { itemid = 3677, position = Position(33457, 32686, 14) },
[8] = { itemid = 3677, position = Position(33459, 32686, 14) },
[9] = { itemid = 3677, position = Position(33456, 32687, 14) },
}

local gates = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,188 +2,158 @@ local positions = {
[1] = {
squarePos = Position(33452, 32721, 14),
flowerOne = Position(33455, 32685, 14),
flowerTwo = Position(33455, 32691, 14),
flowerThree = Position(33455, 32707, 14),
flowerTwo = Position(33455, 32686, 14),
flowerThree = Position(33455, 32687, 14),
},
[2] = {
squarePos = Position(33455, 32721, 14),
flowerOne = Position(33456, 32685, 14),
flowerTwo = Position(33456, 32691, 14),
flowerThree = Position(33456, 32707, 14),
flowerTwo = Position(33456, 32686, 14),
flowerThree = Position(33456, 32687, 14),
},
[3] = {
squarePos = Position(33458, 32721, 14),
flowerOne = Position(33457, 32685, 14),
flowerTwo = Position(33457, 32691, 14),
flowerThree = Position(33457, 32707, 14),
flowerTwo = Position(33457, 32686, 14),
flowerThree = Position(33457, 32687, 14),
},
[4] = {
squarePos = Position(33461, 32721, 14),
flowerOne = Position(33458, 32685, 14),
flowerTwo = Position(33458, 32691, 14),
flowerThree = Position(33458, 32707, 14),
flowerTwo = Position(33458, 32686, 14),
flowerThree = Position(33458, 32687, 14),
},
[5] = {
squarePos = Position(33464, 32721, 14),
flowerOne = Position(33459, 32685, 14),
flowerTwo = Position(33459, 32691, 14),
flowerThree = Position(33459, 32707, 14),
flowerTwo = Position(33459, 32686, 14),
flowerThree = Position(33459, 32687, 14),
},
[6] = {
squarePos = Position(33467, 32721, 14),
flowerOne = Position(33460, 32685, 14),
flowerTwo = Position(33460, 32691, 14),
flowerThree = Position(33460, 32707, 14),
flowerTwo = Position(33460, 32686, 14),
flowerThree = Position(33460, 32687, 14),
}, -- done
[7] = {
squarePos = Position(33452, 32724, 14),
flowerOne = Position(33455, 32686, 14),
flowerOne = Position(33455, 32691, 14),
flowerTwo = Position(33455, 32692, 14),
flowerThree = Position(33455, 32708, 14),
flowerThree = Position(33455, 32693, 14),
},
[8] = {
squarePos = Position(33455, 32724, 14),
flowerOne = Position(33456, 32686, 14),
flowerOne = Position(33456, 32691, 14),
flowerTwo = Position(33456, 32692, 14),
flowerThree = Position(33456, 32708, 14),
flowerThree = Position(33456, 32693, 14),
},
[9] = {
squarePos = Position(33458, 32724, 14),
flowerOne = Position(33457, 32686, 14),
flowerOne = Position(33457, 32691, 14),
flowerTwo = Position(33457, 32692, 14),
flowerThree = Position(33457, 32708, 14),
flowerThree = Position(33457, 32693, 14),
},
[10] = {
squarePos = Position(33461, 32724, 14),
flowerOne = Position(33458, 32686, 14),
flowerOne = Position(33458, 32691, 14),
flowerTwo = Position(33458, 32692, 14),
flowerThree = Position(33458, 32708, 14),
flowerThree = Position(33458, 32693, 14),
},
[11] = {
squarePos = Position(33464, 32724, 14),
flowerOne = Position(33459, 32686, 14),
flowerOne = Position(33459, 32691, 14),
flowerTwo = Position(33459, 32692, 14),
flowerThree = Position(33459, 32708, 14),
flowerThree = Position(33459, 32693, 14),
},
[12] = {
squarePos = Position(33467, 32724, 14),
flowerOne = Position(33460, 32686, 14),
flowerOne = Position(33460, 32691, 14),
flowerTwo = Position(33460, 32692, 14),
flowerThree = Position(33460, 32708, 14),
flowerThree = Position(33460, 32693, 14),
}, -- done
[13] = {
squarePos = Position(33452, 32727, 14),
flowerOne = Position(33455, 32687, 14),
flowerTwo = Position(33455, 32693, 14),
flowerOne = Position(33455, 32707, 14),
flowerTwo = Position(33455, 32708, 14),
flowerThree = Position(33455, 32709, 14),
},
[14] = {
squarePos = Position(33455, 32727, 14),
flowerOne = Position(33456, 32687, 14),
flowerTwo = Position(33456, 32693, 14),
flowerOne = Position(33456, 32707, 14),
flowerTwo = Position(33456, 32708, 14),
flowerThree = Position(33456, 32709, 14),
},
[15] = {
squarePos = Position(33458, 32727, 14),
flowerOne = Position(33457, 32687, 14),
flowerTwo = Position(33457, 32693, 14),
flowerOne = Position(33457, 32707, 14),
flowerTwo = Position(33457, 32708, 14),
flowerThree = Position(33457, 32709, 14),
},
[16] = {
squarePos = Position(33461, 32727, 14),
flowerOne = Position(33458, 32687, 14),
flowerTwo = Position(33458, 32693, 14),
flowerOne = Position(33458, 32707, 14),
flowerTwo = Position(33458, 32708, 14),
flowerThree = Position(33458, 32709, 14),
},
[17] = {
squarePos = Position(33464, 32727, 14),
flowerOne = Position(33459, 32687, 14),
flowerTwo = Position(33459, 32693, 14),
flowerOne = Position(33459, 32707, 14),
flowerTwo = Position(33459, 32708, 14),
flowerThree = Position(33459, 32709, 14),
},
[18] = {
squarePos = Position(33467, 32727, 14),
flowerOne = Position(33460, 32687, 14),
flowerTwo = Position(33460, 32693, 14),
flowerOne = Position(33460, 32707, 14),
flowerTwo = Position(33460, 32708, 14),
flowerThree = Position(33460, 32709, 14),
},
}

local flowerPuzzle = MoveEvent()

function clearFlowers(tiles)
for _, tile in ipairs(tiles) do
local items = tile:getItems()
for i = 1, #items do
if items[i]:getId() == 3676 or items[i]:getId() == 3677 or items[i]:getId() == 3678 then
items[i]:remove()
end
end
end
end

function flowerPuzzle.onStepIn(creature, item, position, fromPosition)
for i = 1, #positions do
local itempos = positions[i]
for i, itempos in ipairs(positions) do
if position == itempos.squarePos then
if item.itemid == 22538 then
item:transform(22539)
local flowerOne = Tile(itempos.flowerOne):getItemById(3676) or Tile(itempos.flowerOne):getItemById(3678) or Tile(itempos.flowerOne):getItemById(3677)
local flowerTwo = Tile(itempos.flowerTwo):getItemById(3676) or Tile(itempos.flowerTwo):getItemById(3678) or Tile(itempos.flowerTwo):getItemById(3677)
local flowerThree = Tile(itempos.flowerThree):getItemById(3676) or Tile(itempos.flowerThree):getItemById(3678) or Tile(itempos.flowerThree):getItemById(3677)
if not flowerOne then
flowerOne = Game.createItem(3677, 1, itempos.flowerOne)
end
if not flowerTwo then
flowerTwo = Game.createItem(3677, 1, itempos.flowerTwo)
end
if not flowerThree then
flowerThree = Game.createItem(3677, 1, itempos.flowerThree)
end
flowerOne:transform(3677)
flowerTwo:transform(3677)
flowerThree:transform(3677)
elseif item.itemid == 22539 then
item:transform(22540)
local flowerOne = Tile(itempos.flowerOne):getItemById(3676) or Tile(itempos.flowerOne):getItemById(3678) or Tile(itempos.flowerOne):getItemById(3677)
local flowerTwo = Tile(itempos.flowerTwo):getItemById(3676) or Tile(itempos.flowerTwo):getItemById(3678) or Tile(itempos.flowerTwo):getItemById(3677)
local flowerThree = Tile(itempos.flowerThree):getItemById(3676) or Tile(itempos.flowerThree):getItemById(3678) or Tile(itempos.flowerThree):getItemById(3677)
if not flowerOne then
flowerOne = Game.createItem(3678, 1, itempos.flowerOne)
end
if not flowerTwo then
flowerTwo = Game.createItem(3678, 1, itempos.flowerTwo)
end
if not flowerThree then
flowerThree = Game.createItem(3678, 1, itempos.flowerThree)
end
flowerOne:transform(3678)
flowerTwo:transform(3678)
flowerThree:transform(3678)
elseif item.itemid == 22540 then
item:transform(22541)
local flowerOne = Tile(itempos.flowerOne):getItemById(3676) or Tile(itempos.flowerOne):getItemById(3678) or Tile(itempos.flowerOne):getItemById(3677)
local flowerTwo = Tile(itempos.flowerTwo):getItemById(3676) or Tile(itempos.flowerTwo):getItemById(3678) or Tile(itempos.flowerTwo):getItemById(3677)
local flowerThree = Tile(itempos.flowerThree):getItemById(3676) or Tile(itempos.flowerThree):getItemById(3678) or Tile(itempos.flowerThree):getItemById(3677)
if not flowerOne then
flowerOne = Game.createItem(3676, 1, itempos.flowerOne)
end
if not flowerTwo then
flowerTwo = Game.createItem(3676, 1, itempos.flowerTwo)
end
if not flowerThree then
flowerThree = Game.createItem(3676, 1, itempos.flowerThree)
end
flowerOne:transform(3676)
flowerTwo:transform(3676)
flowerThree:transform(3676)
elseif item.itemid == 22541 then
local flowerOneTile = Tile(itempos.flowerOne)
local flowerTwoTile = Tile(itempos.flowerTwo)
local flowerThreeTile = Tile(itempos.flowerThree)
local flowerTiles = { flowerOneTile, flowerTwoTile, flowerThreeTile }

local itemId
if i <= 6 then
itemId = 3677
elseif i <= 12 then
itemId = 3678
else
itemId = 3676
end

local step = item.itemid - 22538 + 1

if step == 4 then
clearFlowers(flowerTiles)
item:transform(22538)
local flowerOne = Tile(itempos.flowerOne):getItemById(3676) or Tile(itempos.flowerOne):getItemById(3678) or Tile(itempos.flowerOne):getItemById(3677)
local flowerTwo = Tile(itempos.flowerTwo):getItemById(3676) or Tile(itempos.flowerTwo):getItemById(3678) or Tile(itempos.flowerTwo):getItemById(3677)
local flowerThree = Tile(itempos.flowerThree):getItemById(3676) or Tile(itempos.flowerThree):getItemById(3678) or Tile(itempos.flowerThree):getItemById(3677)
if flowerOne then
flowerOne:remove()
end
if flowerTwo then
flowerTwo:remove()
end
if flowerThree then
flowerThree:remove()
end
else
clearFlowers(flowerTiles)
Game.createItem(itemId, 1, flowerTiles[step]:getPosition())
item:transform(item.itemid + 1)
end

return true
end
end
return true
return false
end

flowerPuzzle:type("stepin")
Expand Down
7 changes: 6 additions & 1 deletion data-global/startup/others/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
function CreateMapItem(tablename)
for index, value in pairs(tablename) do
for i = 1, #value.itemPos do
local item
local tile = Tile(value.itemPos[i])
-- Checks if the position is valid
if tile then
if tile:getItemCountById(index) == 0 then
item = tile:getItemById(index)
if item then
Game.createItem(index, 1, value.itemPos[i])
item:setLoadedFromMap(true)
end
end
end
Expand Down Expand Up @@ -102,6 +105,7 @@ function loadLuaMapSign(tablename)
-- If he found the item, add the text
if item then
item:setAttribute(ITEM_ATTRIBUTE_TEXT, value.text)
item:setLoadedFromMap(true)
end
end
::continue::
Expand Down Expand Up @@ -138,6 +142,7 @@ function loadLuaMapBookDocument(tablename)
-- If the item exists, add the text
if item then
item:setAttribute(ITEM_ATTRIBUTE_TEXT, value.text)
item:setLoadedFromMap(true)
totals[2] = totals[2] + 1
else
logger.warn("[loadLuaMapBookDocument] - Item not found! Index: {}, itemId: {}", index, value.itemId)
Expand Down
2 changes: 1 addition & 1 deletion data/libs/functions/boss_lever.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function BossLever:onUse(player)
end

local infoPositions = lever:getInfoPositions()
if creature:getGroup():getId() < GROUP_TYPE_GOD and isAccountNormal and self:lastEncounterTime(creature) > os.time() then
if creature:getGroup():getId() < GROUP_TYPE_GOD and checkAccountType and self:lastEncounterTime(creature) > os.time() then
for _, posInfo in pairs(infoPositions) do
local currentPlayer = posInfo.creature
if currentPlayer then
Expand Down
2 changes: 2 additions & 0 deletions data/libs/systems/features.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Features = {
AutoLoot = "autoloot",
ChainSystem = "chainSystem",
EmoteSpells = "emoteSpells",
SpellNameInsteadOfWords = "spellNameInsteadOfWords",
}

local function validateFeature(feature)
Expand Down
12 changes: 12 additions & 0 deletions data/scripts/creaturescripts/player/swimming.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local swimmingLogout = CreatureEvent("SwimmingLogout")

function swimmingLogout.onLogout(player)
if player:getOutfit().lookType == 267 then
player:sendCancelMessage("You cannot logout while in the pool.")
return false
end

return true
end

swimmingLogout:register()
Loading

0 comments on commit 99f6548

Please sign in to comment.