Skip to content

Commit

Permalink
Merge branch 'main' into fix-divine-grenade
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas authored Oct 21, 2023
2 parents 9e2fd43 + e3675f5 commit 1ebaaaf
Show file tree
Hide file tree
Showing 79 changed files with 1,158 additions and 287 deletions.
9 changes: 6 additions & 3 deletions data-otservbr-global/migrations/40.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
function onUpdateDatabase()
logger.info("Updating database to version 41 (optimize house_lists)")
db.query([[
ALTER TABLE `house_lists` DROP COLUMN `id`;
]])

db.query([[
ALTER TABLE `house_lists`
ADD COLUMN `version` bigint NOT NULL DEFAULT 0 AFTER `listid`,
ADD INDEX `version` (`version`),
ADD PRIMARY KEY (`house_id`, `listid`);
]])

db.query([[
ALTER TABLE `house_lists`
MODIFY `version` bigint(20) NOT NULL DEFAULT '0';
]])

return true
end
4 changes: 2 additions & 2 deletions data-otservbr-global/npc/....lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ npcConfig.outfit = {
lookBody = 0,
lookLegs = 0,
lookFeet = 0,
lookAddons = 0
lookAddons = 0,
}

npcConfig.flags = {
floorchange = false
floorchange = false,
}

local keywordHandler = KeywordHandler:new()
Expand Down
3 changes: 3 additions & 0 deletions data-otservbr-global/npc/battlemart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ npcConfig.shop = {
{ itemName = "enhanced exercise bow", clientId = 35282, buy = 2340000 },
{ itemName = "enhanced exercise club", clientId = 35281, buy = 2340000 },
{ itemName = "enhanced exercise rod", clientId = 35283, buy = 2340000 },
{ itemName = "enhanced exercise shield", clientId = 44066, buy = 2340000 },
{ itemName = "enhanced exercise sword", clientId = 35279, buy = 2340000 },
{ itemName = "enhanced exercise wand", clientId = 35284, buy = 2340000 },
{ itemName = "envenomed arrow", clientId = 16143, buy = 12 },
Expand Down Expand Up @@ -124,10 +125,12 @@ npcConfig.shop = {
{ itemName = "magic wall rune", clientId = 3180, buy = 116 },
{ itemName = "magma amulet", clientId = 817, buy = 15000 },
{ itemName = "mana potion", clientId = 268, buy = 56 },
{ itemName = "mana shield potion", clientId = 35563, buy = 200000 },
{ itemName = "masterful exercise axe", clientId = 35286, buy = 2700000 },
{ itemName = "masterful exercise bow", clientId = 35288, buy = 2700000 },
{ itemName = "masterful exercise club", clientId = 35287, buy = 2700000 },
{ itemName = "masterful exercise rod", clientId = 35289, buy = 2700000 },
{ itemName = "masterful exercise shield", clientId = 44067, buy = 2700000 },
{ itemName = "masterful exercise sword", clientId = 35285, buy = 2700000 },
{ itemName = "masterful exercise wand", clientId = 35290, buy = 2700000 },
{ itemName = "might ring", clientId = 3048, buy = 5000 },
Expand Down
74 changes: 74 additions & 0 deletions data-otservbr-global/npc/john_bounac.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
local npcName = "John"
local npcType = Game.createNpcType("John (Bounac)")
local npcConfig = {}

npcConfig.name = npcName
npcConfig.description = npcName

npcConfig.health = 100
npcConfig.maxHealth = npcConfig.health
npcConfig.walkInterval = 2000
npcConfig.walkRadius = 2

npcConfig.outfit = {
lookType = 1245,
lookHead = 40,
lookBody = 0,
lookLegs = 99,
lookFeet = 28,
lookAddons = 3,
}

npcConfig.flags = {
floorchange = false,
}

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)

npcType.onThink = function(npc, interval)
npcHandler:onThink(npc, interval)
end

npcType.onAppear = function(npc, creature)
npcHandler:onAppear(npc, creature)
end

npcType.onDisappear = function(npc, creature)
npcHandler:onDisappear(npc, creature)
end

npcType.onMove = function(npc, creature, fromPosition, toPosition)
npcHandler:onMove(npc, creature, fromPosition, toPosition)
end

npcType.onSay = function(npc, creature, type, message)
npcHandler:onSay(npc, creature, type, message)
end

npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

npcConfig.shop = {
{ clientId = 36951, buy = 10000 },
{ clientId = 36952, buy = 10000 },
{ clientId = 36953, buy = 10000 },
{ clientId = 36954, buy = 10000 },
{ clientId = 36955, buy = 10000 },
{ clientId = 36956, buy = 10000 },
}
-- On buy npc shop message
npcType.onBuyItem = function(npc, player, itemId, subType, amount, ignore, inBackpacks, totalCost)
npc:sellItem(player, itemId, amount, subType, 0, ignore, inBackpacks)
end
-- On sell npc shop message
npcType.onSellItem = function(npc, player, itemId, subtype, amount, ignore, name, totalCost)
player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("Sold %ix %s for %i gold.", amount, name, totalCost))
end
-- On check npc shop message (look item)
npcType.onCheckItem = function(npc, player, clientId, subType) end

npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/the_bone_master.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ local function creatureSayCallback(npc, creature, type, message)
}, npc, creature)
npcHandler:setTopic(playerId, 1)
end
elseif MsgContains(message, "advancement") then
elseif MsgContains(message, "advancement") or MsgContains(message, "demonic") or MsgContains(message, "essence") then
if player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) == 1 then
npcHandler:say("So you want to advance to a {Hyaena} rank? Did you bring 500 demonic essences with you?", npc, creature)
npcHandler:setTopic(playerId, 3)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/the_dream_master.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ local function creatureSayCallback(npc, creature, type, message)
}, npc, creature)
npcHandler:setTopic(playerId, 1)
end
elseif MsgContains(message, "advancement") then
elseif MsgContains(message, "advancement") or MsgContains(message, "demonic") or MsgContains(message, "essence") then
if player:getStorageValue(Storage.OutfitQuest.NightmareOutfit) == 1 then
npcHandler:say("So you want to advance to a {Initiate} rank? Did you bring 500 demonic essences with you?", npc, creature)
npcHandler:setTopic(playerId, 3)
Expand Down
3 changes: 3 additions & 0 deletions data-otservbr-global/scripts/actions/addons/addons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ local config = {
-- poltergeist
[32630] = { female = 1271, male = 1270, addon = 1, effect = CONST_ME_BLUE_GHOST, achievement = "Mainstreet Nightmare" },
[32631] = { female = 1271, male = 1270, addon = 2, effect = CONST_ME_BLUE_GHOST, achievement = "Mainstreet Nightmare" },
-- rascoohan
[35595] = { female = 1372, male = 1371, addon = 1, achievement = "Honorary Rascoohan" },
[35695] = { female = 1372, male = 1371, addon = 2, achievement = "Honorary Rascoohan" },
}

local addons = Action()
Expand Down
39 changes: 21 additions & 18 deletions data-otservbr-global/scripts/actions/other/bag_you_desire.lua
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
local rewards = {
{ id = 34082, name = "Soulcutter" },
{ id = 34083, name = "Soulshredder" },
{ id = 34084, name = "Soulbiter" },
{ id = 34085, name = "Souleater" },
{ id = 34086, name = "Soulcrusher" },
{ id = 34087, name = "Soulmaimer" },
{ id = 34088, name = "Soulbleeder" },
{ id = 34089, name = "Soulpiercer" },
{ id = 34090, name = "Soultainter" },
{ id = 34091, name = "Soulhexer" },
{ id = 34092, name = "Soulshanks" },
{ id = 34093, name = "Soulstrider" },
{ id = 34094, name = "Soulshell" },
{ id = 34095, name = "Soulmantle" },
{ id = 34096, name = "Soulshroud" },
{ id = 34097, name = "Pair of Soulwalkers" },
{ id = 34098, name = "Pair of Soulstalkers" },
{ id = 34099, name = "Soulbastion" },
{ id = 34082, name = "soulcutter" },
{ id = 34083, name = "soulshredder" },
{ id = 34084, name = "soulbiter" },
{ id = 34085, name = "souleater" },
{ id = 34086, name = "soulcrusher" },
{ id = 34087, name = "soulmaimer" },
{ id = 34097, name = "pair of soulwalkers" },
{ id = 34099, name = "soulbastion" },
{ id = 34088, name = "soulbleeder" },
{ id = 34089, name = "soulpiercer" },
{ id = 34094, name = "soulshell" },
{ id = 34098, name = "pair of soulstalkers" },
{ id = 34090, name = "soultainter" },
{ id = 34092, name = "soulshanks" },
{ id = 34095, name = "soulmantle" },
{ id = 34091, name = "soulhexer" },
{ id = 34093, name = "soulstrider" },
{ id = 34096, name = "soulshroud" },
}

local bagyouDesire = Action()

function bagyouDesire.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not player then
return false
end
local randId = math.random(1, #rewards)
local rewardItem = rewards[randId]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function exerciseTraining.onUse(player, item, fromPosition, target, toPosition,
playersOnDummy = playersOnDummy + 1
end

if playersOnDummy == maxAllowedOnADummy then
if playersOnDummy >= maxAllowedOnADummy then
player:sendTextMessage(MESSAGE_FAILURE, "That exercise dummy is busy.")
return true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ function questSystem1.onUse(player, item, fromPosition, target, toPosition, isHo
end
else
local container = Container(item.uid)
if not container then
logger.error("[questSystem1.onUse] failed to create container")
return false
end
for i = 0, container:getSize() - 1 do
local originalItem = container:getItem(i)
local newItem = Game.createItem(originalItem.itemid, originalItem.type)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
local config = {
sorcerer = {
id = 1367,
name = "Bladespark",
},
druid = {
id = 1364,
name = "Mossmasher",
},
paladin = {
id = 1366,
name = "Sandscourge",
},
knight = {
id = 1365,
name = "Snowbash",
},
}

local action = Action()

function action.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local vocation = config[player:getVocation():getBase():getName():lower()]
if not vocation then
return true
end
if player:hasFamiliar(vocation.id) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already have the " .. vocation.name .. " familiar.")
return false
end

player:addFamiliar(vocation.id)
item:remove()
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You obtained the " .. vocation.name .. " familiar.")
return true
end

action:id(35508)
action:register()
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ local config = {
requiredLevel = 250,

playerPositions = {
{ pos = Position(33739, 31506, 14), teleport = Position(33711, 31510, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33740, 31506, 14), teleport = Position(33711, 31510, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33741, 31506, 14), teleport = Position(33711, 31510, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33742, 31506, 14), teleport = Position(33711, 31510, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33743, 31506, 14), teleport = Position(33711, 31510, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33739, 31506, 14), teleport = Position(33712, 31509, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33740, 31506, 14), teleport = Position(33712, 31509, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33741, 31506, 14), teleport = Position(33712, 31509, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33742, 31506, 14), teleport = Position(33712, 31509, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33743, 31506, 14), teleport = Position(33712, 31509, 14), effect = CONST_ME_TELEPORT },
},
specPos = {
from = Position(33703, 31494, 14),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ local config = {
requiredLevel = 250,

playerPositions = {
{ pos = Position(33734, 31471, 14), teleport = Position(33711, 31476, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33735, 31471, 14), teleport = Position(33711, 31476, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33736, 31471, 14), teleport = Position(33711, 31476, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33737, 31471, 14), teleport = Position(33711, 31476, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33738, 31471, 14), teleport = Position(33711, 31476, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33734, 31471, 14), teleport = Position(33711, 31474, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33735, 31471, 14), teleport = Position(33711, 31474, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33736, 31471, 14), teleport = Position(33711, 31474, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33737, 31471, 14), teleport = Position(33711, 31474, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33738, 31471, 14), teleport = Position(33711, 31474, 14), effect = CONST_ME_TELEPORT },
},
specPos = {
from = Position(33705, 31463, 14),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ local config = {

timeToDefeat = 25 * 60,
playerPositions = {
{ pos = Position(33772, 31504, 14), teleport = Position(33808, 31515, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33773, 31504, 14), teleport = Position(33808, 31515, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33774, 31504, 14), teleport = Position(33808, 31515, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33775, 31504, 14), teleport = Position(33808, 31515, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33773, 31503, 14), teleport = Position(33808, 31515, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33774, 31503, 14), teleport = Position(33808, 31515, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33775, 31503, 14), teleport = Position(33808, 31515, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33773, 31505, 14), teleport = Position(33808, 31515, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33774, 31505, 14), teleport = Position(33808, 31515, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33775, 31505, 14), teleport = Position(33808, 31515, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33772, 31504, 14), teleport = Position(33808, 31513, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33773, 31504, 14), teleport = Position(33808, 31513, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33774, 31504, 14), teleport = Position(33808, 31513, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33775, 31504, 14), teleport = Position(33808, 31513, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33773, 31503, 14), teleport = Position(33808, 31513, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33774, 31503, 14), teleport = Position(33808, 31513, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33775, 31503, 14), teleport = Position(33808, 31513, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33773, 31505, 14), teleport = Position(33808, 31513, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33774, 31505, 14), teleport = Position(33808, 31513, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33775, 31505, 14), teleport = Position(33808, 31513, 14), effect = CONST_ME_TELEPORT },
},
specPos = {
from = Position(33793, 31496, 14),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ local config = {
requiredLevel = 250,

playerPositions = {
{ pos = Position(33736, 31537, 14), teleport = Position(33708, 31547, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33737, 31537, 14), teleport = Position(33708, 31547, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33738, 31537, 14), teleport = Position(33708, 31547, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33739, 31537, 14), teleport = Position(33708, 31547, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33740, 31537, 14), teleport = Position(33708, 31547, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33736, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33737, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33738, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33739, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT },
{ pos = Position(33740, 31537, 14), teleport = Position(33707, 31545, 14), effect = CONST_ME_TELEPORT },
},
specPos = {
from = Position(33699, 31529, 14),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local bpItems = {
{ name = "gold token", count = 3 },
{ name = "blue gem", count = 1 },
{ name = "yellow gem", count = 1 },
{ name = "red gem", count = 1 },
{ id = 3039, count = 1 }, -- red gem
{ name = "demon horn", count = 2 },
{ name = "slime heart", count = 2 },
{ name = "energy vein", count = 2 },
Expand Down Expand Up @@ -46,7 +46,11 @@ function finalReward.onUse(player, item, fromPosition, target, toPosition, isHot
local bp = Game.createItem("Backpack", 1)
if bp then
for i = 1, #bpItems do
bp:addItem(bpItems[i].name, count)
if bpItems[i].id then
bp:addItem(bpItems[i].id, count)
else
bp:addItem(bpItems[i].name, count)
end
end
bp:moveTo(player)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ local UniqueTable = {
count = 1,
},
[14002] = {
name = "gold nugget",
-- gold nugget,
itemId = 3040,
count = 2,
},
[14003] = {
Expand Down
Loading

0 comments on commit 1ebaaaf

Please sign in to comment.