From bfe193aa5b3589cb7e44d7c7d910b202c2cfcc31 Mon Sep 17 00:00:00 2001 From: Luan Santos Date: Sat, 9 Dec 2023 14:10:53 -0800 Subject: [PATCH] feat: coryms black market monster and npcs (#1991) Thanks @Gtravisani for contributing the map and spawn locations. You can download the updated map from the 3.1.0 and 3.0.0 releases (and of course, any future releases). --- data-otservbr-global/npc/larry.lua | 68 ++++ data-otservbr-global/npc/squeekquek.lua | 74 ++++ .../world/otservbr-monster.xml | 327 ++++++++++++++++++ data-otservbr-global/world/otservbr-npc.xml | 6 + 4 files changed, 475 insertions(+) create mode 100644 data-otservbr-global/npc/larry.lua create mode 100644 data-otservbr-global/npc/squeekquek.lua diff --git a/data-otservbr-global/npc/larry.lua b/data-otservbr-global/npc/larry.lua new file mode 100644 index 00000000000..35638152be3 --- /dev/null +++ b/data-otservbr-global/npc/larry.lua @@ -0,0 +1,68 @@ +local internalNpcName = "Larry" +local npcType = Game.createNpcType(internalNpcName) +local npcConfig = {} + +npcConfig.name = internalNpcName +npcConfig.description = internalNpcName + +npcConfig.health = 100 +npcConfig.maxHealth = npcConfig.health +npcConfig.walkInterval = 2000 +npcConfig.walkRadius = 2 + +npcConfig.outfit = { + lookTypeEx = 24432, +} + +npcConfig.flags = { + floorchange = false, +} + +npcConfig.voices = { + interval = 15000, + chance = 50, +} + +npcConfig.shop = {} + +-- 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 + +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) + +npcType:register(npcConfig) diff --git a/data-otservbr-global/npc/squeekquek.lua b/data-otservbr-global/npc/squeekquek.lua new file mode 100644 index 00000000000..1d0a5e6d675 --- /dev/null +++ b/data-otservbr-global/npc/squeekquek.lua @@ -0,0 +1,74 @@ +local internalNpcName = "Squeekquek" +local npcType = Game.createNpcType(internalNpcName) +local npcConfig = {} + +npcConfig.name = internalNpcName +npcConfig.description = internalNpcName + +npcConfig.health = 100 +npcConfig.maxHealth = npcConfig.health +npcConfig.walkInterval = 2000 +npcConfig.walkRadius = 2 + +npcConfig.outfit = { + lookType = 532, + lookHead = 0, + lookBody = 113, + lookLegs = 95, + lookFeet = 0, + lookAddons = 0, + lookMount = 0, +} + +npcConfig.flags = { + floorchange = false, +} + +npcConfig.voices = { + interval = 15000, + chance = 50, +} + +npcConfig.shop = {} + +-- 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 + +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) + +npcType:register(npcConfig) diff --git a/data-otservbr-global/world/otservbr-monster.xml b/data-otservbr-global/world/otservbr-monster.xml index bc326a9fb21..d3bbc69e858 100644 --- a/data-otservbr-global/world/otservbr-monster.xml +++ b/data-otservbr-global/world/otservbr-monster.xml @@ -71337,6 +71337,12 @@ + + + + + + @@ -71412,6 +71418,9 @@ + + + @@ -71446,6 +71455,9 @@ + + + @@ -71478,6 +71490,9 @@ + + + @@ -71533,6 +71548,9 @@ + + + @@ -71576,6 +71594,9 @@ + + + @@ -71624,6 +71645,12 @@ + + + + + + @@ -71639,6 +71666,9 @@ + + + @@ -71686,6 +71716,9 @@ + + + @@ -71747,6 +71780,9 @@ + + + @@ -71765,10 +71801,16 @@ + + + + + + @@ -71879,12 +71921,21 @@ + + + + + + + + + @@ -71915,6 +71966,9 @@ + + + @@ -71929,6 +71983,12 @@ + + + + + + @@ -72002,6 +72062,9 @@ + + + @@ -95945,6 +96008,9 @@ + + + @@ -96059,6 +96125,12 @@ + + + + + + @@ -96167,6 +96239,9 @@ + + + @@ -96398,6 +96473,12 @@ + + + + + + @@ -96432,6 +96513,9 @@ + + + @@ -96570,6 +96654,9 @@ + + + @@ -96638,12 +96725,18 @@ + + + + + + @@ -96654,6 +96747,12 @@ + + + + + + @@ -118631,6 +118730,9 @@ + + + @@ -118671,6 +118773,9 @@ + + + @@ -118684,6 +118789,9 @@ + + + @@ -118736,6 +118844,9 @@ + + + @@ -118781,6 +118892,9 @@ + + + @@ -118815,6 +118929,9 @@ + + + @@ -118845,6 +118962,9 @@ + + + @@ -133977,6 +134097,9 @@ + + + @@ -134004,6 +134127,12 @@ + + + + + + @@ -134016,6 +134145,9 @@ + + + @@ -134040,12 +134172,18 @@ + + + + + + @@ -134058,6 +134196,9 @@ + + + @@ -134099,21 +134240,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -134135,6 +134303,12 @@ + + + + + + @@ -134155,6 +134329,9 @@ + + + @@ -134178,9 +134355,27 @@ + + + + + + + + + + + + + + + + + + @@ -147210,6 +147405,9 @@ + + + @@ -147221,6 +147419,9 @@ + + + @@ -147244,6 +147445,9 @@ + + + @@ -147253,9 +147457,30 @@ + + + + + + + + + + + + + + + + + + + + + @@ -147297,6 +147522,9 @@ + + + @@ -147348,15 +147576,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -147386,6 +147638,12 @@ + + + + + + @@ -147399,6 +147657,15 @@ + + + + + + + + + @@ -158821,6 +159088,9 @@ + + + @@ -158839,6 +159109,12 @@ + + + + + + @@ -158859,6 +159135,9 @@ + + + @@ -158871,6 +159150,15 @@ + + + + + + + + + @@ -158897,6 +159185,24 @@ + + + + + + + + + + + + + + + + + + @@ -158915,6 +159221,12 @@ + + + + + + @@ -158924,6 +159236,12 @@ + + + + + + @@ -158939,12 +159257,21 @@ + + + + + + + + + diff --git a/data-otservbr-global/world/otservbr-npc.xml b/data-otservbr-global/world/otservbr-npc.xml index b82ea1ad59a..305023dbfa2 100644 --- a/data-otservbr-global/world/otservbr-npc.xml +++ b/data-otservbr-global/world/otservbr-npc.xml @@ -2554,6 +2554,9 @@ + + + @@ -2626,6 +2629,9 @@ + + +