-
-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-divine-grenade
- Loading branch information
Showing
79 changed files
with
1,158 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 21 additions & 18 deletions
39
data-otservbr-global/scripts/actions/other/bag_you_desire.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
data-otservbr-global/scripts/actions/quests/a_pirates_tail/cheesy_key.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.