Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Compatibility] - Support for Canary with otbr-global, conversion from npcs to revscriptsys and rework on jiddo npc lib #192

Merged
merged 33 commits into from
Feb 7, 2022

Conversation

dudantas
Copy link
Contributor

@dudantas dudantas commented Feb 7, 2022

Description

Fix opentibiabr/otservbr-global#2

This pull request will work directly with the pull opentibiabr/otservbr-global#1 from the otservbr-global-datapack repository.

After testing and merging the two pulls, otservbr-global will use the canary engine, there will no longer be source code in global, thus facilitating our work regarding the number of repositories and the separation of source code from the global datapack ( which is too heavy, too many files and too messy).

Pull request modifications

Added:

Npclib:

Callbacks:

  • onCloseChannel (CALLBACK_ON_CLOSE_CHANNEL)
  • onMove (CALLBACK_ON_MOVE)
  • FocusModule.tradeCallback
  • NpcsEvent_t enum: NPCS_EVENT_PLAYER_CLOSE_CHANNEL

Lua functions:

  • NpcHandler:getKeywordHandler()
  • NpcHandler:getEventDelayedSay(playerId)
  • NpcHandler:setEventDelayedSay(playerId, newEventDelayedSay)
  • NpcHandler:getEventSay(playerId)
  • NpcHandler:setEventSay(playerId, newEventSay)
  • NpcHandler:getTalkStart(playerId)
  • NpcHandler:setTalkStart(playerId, newTalkStart)
  • NpcHandler:getTopic(playerId)
  • NpcHandler:setTopic(playerId, newTopic)
  • NpcHandler:checkInteraction(npc, player)
  • NpcHandler:updateInteraction(npc, player)
  • NpcHandler:setInteraction(npc, player)
  • NpcHandler:removeInteraction(npc, player)
  • NpcHandler:tradeRequest(npc, player, message)
  • NpcHandler:onMove(npc, player, fromPosition, toPosition)
  • NpcHandler:sendMessages(message, messageTable, npc, player, useDelay, delay)
  • FocusModule:setTradeCallback(callback)
  • Npc:sayWithDelay(npcId, text, messageType, delay, event, playerId)
  • Npc:sendMessage(player, text)
  • Npc:isMerchant()
  • Npc:closeShopWindow(player)
  • Npc:isInTalkRange(playerPosition)
  • Npc:move(direction)
  • Npc:turn(direction)
  • Npc:follow(player)
  • Npc:getId()
  • Npc:sellItem(player, itemid, amount, subtype, actionid, <optional: default: 1> canDropOnMap)
  • Npc:getDistanceTo(uid)
  • NpcType:getSpeechBubble()
  • NpcType:setSpeechBubble()
  • Player:getItemIdByCid(itemId)
  • Item:getClientId()
  • LuaFunctionsLoader::getErrorDesc(ErrorCode_t code) new callback: LUA_ERROR_NPC_TYPE_NOT_FOUND

Cpp functions:

  • Npc::onPlayerCloseChannel(creature)
  • Game::loadCustomMap(name)
  • Iomap: loadMonstersCustom(map), loadNpcsCustom(map), loadHousesCustom(map)

Cpp definitions:

  • ITEM_FILLED_BATH_TUBE, ITEM_SWORD_RING, ITEM_CLUB_RING, ITEM_DWARVEN_RING, ITEM_RING_HEALING, ITEM_STEALTH_RING, ITEM_TIME_RING, ITEM_PAIR_SOFT_BOOTS, ITEM_PAIR_SOFT_BOOTS_ACTIVATED, ITEM_DEATH_RING, ITEM_DEATH_RING_ACTIVATED, ITEM_PRISMATIC_RING, ITEM_PRISMATIC_RING_ACTIVATED.

Othes:

  • Added bank system lib (bank_system.lua)
  • TalkAction: /addmoney playername, moneycount

Modified

Callbacks:

  • FROM: CALLBACK_CREATURE_APPEAR, TO: CALLBACK_ON_APPEAR
  • FROM: CALLBACK_CREATURE_DISAPPEAR, TO: CALLBACK_ON_DISAPPEAR
  • FROM: CALLBACK_CREATURE_SAY, TO: CALLBACK_ON_SAY
  • FROM: CALLBACK_ONTHINK, TO: CALLBACK_ON_THINK
  • FROM: CALLBACK_PLAYER_ENDTRADE, TO: CALLBACK_PLAYER_END_TRADE
  • FROM: CALLBACK_PLAYER_CLOSECHANNEL, TO: CALLBACK_CLOSE_CHANNEL
  • FROM: CALLBACK_ONADDFOCUS, TO: CALLBACK_SET_INTERACTION
  • FROM: CALLBACK_ONRELEASEFOCUS, TO: CALLBACK_REMOVE_INTERACTION
  • FROM: CALLBACK_ONTRADEREQUEST, TO: CALLBACK_ON_TRADE_REQUEST
  • FROM: SHOP_TRADEREQUEST, TO: FOCUS_TRADE_MESSAGE

Functions:

  • From: player:removeMoneyNpc(), to: player:removeMoneyBank(cost)
  • From: NpcHandler.eventSay[focus] = nil, to: NpcHandler:setEventSay(playerId, nil)
  • From: NpcHandler.eventDelayedSay[focus] = nil, to: NpcHandler:setEventDelayedSay(playerId, nil)
  • From: NpcHandler.talkStart[focus] = nil, to: NpcHandler:setTalkStart(playerId, nil)
  • From: NpcHandler.topic[focus] = nil, to: NpcHandler:setTopic(playerId, nil)
  • From: NpcHandler:onCreatureAppear, to: NpcHandler:onAppear
  • From: NpcHandler:onCreatureDisappear, to: NpcHandler:onDisappear
  • From: NpcHandler:onCreatureAppear, to: NpcHandler:onAppear
  • From: NpcHandler:onCreatureSay, to: NpcHandler:onSay
  • From: NpcHandler:onPlayerCloseChannel, to: NpcHandler:onCloseChannel
  • From: NpcHandler.topic[playerId] = topicId, to: NpcHandler:setTopic(playerId, topicId)
  • From: NpcHandler.topic[playerId] == topicId, to: NpcHandler:getTopic(playerId) == topicId
  • From: Charm:cancelMessage(), to: charm:messageCancel()
  • From: Charm:logMsg(), to: Charm:messageServerLog()
  • msgcontains(message, keyword) = It was refactored so that it identifies the entire string and does not read just one word, generating this issue: https://github.com/opentibiabr/otservbr-global/issues/2736

Others:

  • Refactored bestiary charms script
  • Changed configkey = From: MAP_CUSTOM_ENABLED, to: TOGGLE_MAP_CUSTOM

Removed

Npclib:

Callbacks:

  • NpcHandler: focuses, idleTime, talkRadius, shopItems, MESSAGE_ONBUY, MESSAGE_BOUGHT, MESSAGE_SELL, MESSAGE_ONSELL, MESSAGE_SOLD, MESSAGE_IDLETIMEOUT
  • Voice modules
  • Shop module
  • NpcSystem (It was used to parse XML npcs information)

Lua functions:

  • NpcHandler:isFocused
  • NpcHandler:releaseFocus
  • NpcHandler:onPlayerEndTrade
  • NpcHandler:onSell
  • doNpcSellItem
  • doCreatureSayWithDelay
  • doPlayerSellItem
  • doPlayerBuyItemContainer
  • doPlayerRemoveMoney
  • getPlayerMoney
  • closeShopWindow

Cpp functions:

  • Npc getCurrencyTrading()

Others:

  • ConfigKey: MAP_CUSTOM_FILE and MAP_CUSTOM_SPAWN

Resume

Added the npcs revscriptsys and removed the npcs xml
Changed jiddo lib to work with revscriptsys npcs, also making several improvements to the lib. And several other functions that have been improved or rework. We also removed all the code from the lib that parse/handle the npcs xml.

Module shop has been removed (a big improvement was made where the shop is now in npcType, more easily and is called directly from source).

Added back storage of npcs spawns in the world folder (there was also a reorganization, where npcs and monsters will be in separate files from now on, as it will be possible to see npcs on the map).

Improvement on register_bestiary_charm and bestiary/charms.lua (formerly modules/bestiary_charms)

Several other modifications and adaptations to make compatibility possible.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:

  • Server Version: 12.64
  • Client: 12.64
  • Operating System: Windows 10 x64

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

dudantas and others added 26 commits October 14, 2021 21:11
…servbr-global/pull/2712

# Description
Fix https://github.com/opentibiabr/otservbr-global/issues/2736

### This pull request will work directly with the pull https://github.com/opentibiabr/otservbr-global/pull/2712 from the otservbr-global repository.
After testing and merging the two pulls, otservbr-global will use the canary engine, there will no longer be source code in global, thus facilitating our work regarding the number of repositories and the separation of source code from the global datapack ( which is too heavy, too many files and too messy).

# Pull request modifications
## Added:
### Npclib:
### Callbacks:
- onCloseChannel (CALLBACK_ON_CLOSE_CHANNEL)
- onMove (CALLBACK_ON_MOVE)
- FocusModule.tradeCallback
- NpcsEvent_t enum: NPCS_EVENT_PLAYER_CLOSE_CHANNEL

### Lua functions:
- NpcHandler:getKeywordHandler()
- NpcHandler:getEventDelayedSay(playerId)
- NpcHandler:setEventDelayedSay(playerId, newEventDelayedSay)
- NpcHandler:getEventSay(playerId)
- NpcHandler:setEventSay(playerId, newEventSay)
- NpcHandler:getTalkStart(playerId)
- NpcHandler:setTalkStart(playerId, newTalkStart)
- NpcHandler:getTopic(playerId)
- NpcHandler:setTopic(playerId, newTopic)
- NpcHandler:checkInteraction(npc, player)
- NpcHandler:updateInteraction(npc, player)
- NpcHandler:setInteraction(npc, player)
- NpcHandler:removeInteraction(npc, player)
- NpcHandler:tradeRequest(npc, player, message)
- NpcHandler:onMove(npc, player, fromPosition, toPosition)
- NpcHandler:sendMessages(message, messageTable, npc, player, useDelay, delay)
- FocusModule:setTradeCallback(callback)
- Npc:sayWithDelay(npcId, text, messageType, delay, event, playerId)
- Npc:sendMessage(player, text)
- Npc:isMerchant()
- Npc:closeShopWindow(player)
- Npc:isInTalkRange(playerPosition)
- Npc:move(direction)
- Npc:turn(direction)
- Npc:follow(player)
- Npc:getId()
- Npc:sellItem(player, itemid, amount, <optional> subtype, <optional> actionid, <optional: default: 1> canDropOnMap)
- Npc:getDistanceTo(uid)
- NpcType:getSpeechBubble()
- NpcType:setSpeechBubble()
- Player:getItemIdByCid(itemId)
- Item:getClientId()
- LuaFunctionsLoader::getErrorDesc(ErrorCode_t code) new callback: LUA_ERROR_NPC_TYPE_NOT_FOUND

### Cpp functions:
- Npc::onPlayerCloseChannel(creature)
- Game::loadCustomMap(name)
- Iomap: loadMonstersCustom(map), loadNpcsCustom(map), loadHousesCustom(map)

### Cpp definitions:
- ITEM_FILLED_BATH_TUBE, ITEM_SWORD_RING, ITEM_CLUB_RING, ITEM_DWARVEN_RING, ITEM_RING_HEALING, ITEM_STEALTH_RING, ITEM_TIME_RING, ITEM_PAIR_SOFT_BOOTS, ITEM_PAIR_SOFT_BOOTS_ACTIVATED, ITEM_DEATH_RING, ITEM_DEATH_RING_ACTIVATED, ITEM_PRISMATIC_RING, ITEM_PRISMATIC_RING_ACTIVATED.

### Othes:
- Added bank system lib (bank_system.lua)
- TalkAction: /addmoney playername, moneycount

### Modified
### Callbacks:
- FROM: CALLBACK_CREATURE_APPEAR, TO: CALLBACK_ON_APPEAR
- FROM: CALLBACK_CREATURE_DISAPPEAR, TO: CALLBACK_ON_DISAPPEAR
- FROM: CALLBACK_CREATURE_SAY, TO: CALLBACK_ON_SAY
- FROM: CALLBACK_ONTHINK, TO: CALLBACK_ON_THINK
- FROM: CALLBACK_PLAYER_ENDTRADE, TO: CALLBACK_PLAYER_END_TRADE
- FROM: CALLBACK_PLAYER_CLOSECHANNEL, TO: CALLBACK_CLOSE_CHANNEL
- FROM: CALLBACK_ONADDFOCUS, TO: CALLBACK_SET_INTERACTION
- FROM: CALLBACK_ONRELEASEFOCUS, TO: CALLBACK_REMOVE_INTERACTION
- FROM: CALLBACK_ONTRADEREQUEST, TO: CALLBACK_ON_TRADE_REQUEST
- FROM: SHOP_TRADEREQUEST, TO: FOCUS_TRADE_MESSAGE

### Functions:
- From: player:removeMoneyNpc(), to: player:removeMoneyBank(cost)
- From: NpcHandler.eventSay[focus] = nil, to: NpcHandler:setEventSay(playerId, nil)
- From: NpcHandler.eventDelayedSay[focus] = nil, to: NpcHandler:setEventDelayedSay(playerId, nil)
- From: NpcHandler.talkStart[focus] = nil, to: NpcHandler:setTalkStart(playerId, nil)
- From: NpcHandler.topic[focus] = nil, to: NpcHandler:setTopic(playerId, nil)
- From: NpcHandler:onCreatureAppear, to: NpcHandler:onAppear
- From: NpcHandler:onCreatureDisappear, to: NpcHandler:onDisappear
- From: NpcHandler:onCreatureAppear, to: NpcHandler:onAppear
- From: NpcHandler:onCreatureSay, to: NpcHandler:onSay
- From: NpcHandler:onPlayerCloseChannel, to: NpcHandler:onCloseChannel
- From: NpcHandler.topic[playerId] = topicId, to: NpcHandler:setTopic(playerId, topicId)
- From: NpcHandler.topic[playerId] == topicId, to: NpcHandler:getTopic(playerId) == topicId
- From: Charm:cancelMessage(), to: charm:messageCancel()
- From: Charm:logMsg(), to: Charm:messageServerLog()
- msgcontains(message, keyword) = It was refactored so that it identifies the entire string and does not read just one word, generating this issue: https://github.com/opentibiabr/otservbr-global/issues/2736

### Others:
- Refactored bestiary charms script
- Changed configkey = From: MAP_CUSTOM_ENABLED, to: TOGGLE_MAP_CUSTOM

## Removed
### Npclib:
### Callbacks:
- NpcHandler: focuses, idleTime, talkRadius, shopItems, MESSAGE_ONBUY, MESSAGE_BOUGHT, MESSAGE_SELL, MESSAGE_ONSELL, MESSAGE_SOLD, MESSAGE_IDLETIMEOUT
- Voice modules
- Shop module
- NpcSystem (It was used to parse XML npcs information)

### Lua functions:
- NpcHandler:isFocused
- NpcHandler:releaseFocus
- NpcHandler:onPlayerEndTrade
- NpcHandler:onSell
- doNpcSellItem
- doCreatureSayWithDelay
- doPlayerSellItem
- doPlayerBuyItemContainer
- doPlayerRemoveMoney
- getPlayerMoney
- closeShopWindow

### Cpp functions:
- Npc getCurrencyTrading()

### Others:
- ConfigKey: MAP_CUSTOM_FILE and MAP_CUSTOM_SPAWN

# Resume
Added the npcs revscriptsys and removed the npcs xml
Changed jiddo lib to work with revscriptsys npcs, also making several improvements to the lib. And several other functions that have been improved or rework. We also removed all the code from the lib that parse/handle the npcs xml.

Module shop has been removed (a big improvement was made where the shop is now in npcType, more easily and is called directly from source).

Added back storage of npcs spawns in the world folder (there was also a reorganization, where npcs and monsters will be in separate files from now on, as it will be possible to see npcs on the map).

Improvement on register_bestiary_charm and bestiary/charms.lua (formerly modules/bestiary_charms)

Several other modifications and adaptations to make compatibility possible.
Thanks @lgrossi

Co-Authored-By: Lucas Grossi <34237492+lgrossi@users.noreply.github.com>
data/npclib/npc_system/modules.lua Show resolved Hide resolved
data/npclib/npc_system/bank_system.lua Show resolved Hide resolved
data/npclib/npc_system/custom_modules.lua Show resolved Hide resolved
data/npclua/canary.lua Show resolved Hide resolved
data/scripts/bestiary/charms.lua Show resolved Hide resolved
data/scripts/talkactions/god/add_money.lua Show resolved Hide resolved
data/npclib/npc.lua Outdated Show resolved Hide resolved
data/npclib/npc_system/custom_modules.lua Show resolved Hide resolved
data/npclib/npc_system/npc_handler.lua Show resolved Hide resolved
data/npclib/npc_system/npc_handler.lua Show resolved Hide resolved
@dudantas dudantas changed the title [Compatibility] - Support for Canary with otbr-global and rework on jiddo npc lib [Compatibility] - Support for Canary with otbr-global convert npcs to revscriptsys and rework on jiddo npc lib Feb 7, 2022
@dudantas dudantas changed the title [Compatibility] - Support for Canary with otbr-global convert npcs to revscriptsys and rework on jiddo npc lib [Compatibility] - Support for Canary with otbr-global, conversion from npcs to revscriptsys and rework on jiddo npc lib Feb 7, 2022
@sonarcloud
Copy link

sonarcloud bot commented Feb 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 35 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@dudantas dudantas merged commit 0397d0c into master Feb 7, 2022
luan pushed a commit that referenced this pull request Jul 11, 2023
…m npcs to revscriptsys and rework on jiddo npc lib (#192)

Description:
NPCS converted to revscriptsys and removed the npcs xml
Changed jiddo lib to work with revscriptsys npcs, also making several improvements to the lib. And several other functions that have been improved or rework. We also removed all the code from the lib that parse/handle the npcs xml.

Module shop has been removed (a big improvement was made where the shop is now in npcType, more easily and is called directly from source).

Added back storage of npcs spawns in the world folder (there was also a reorganization, where npcs and monsters will be in separate files from now on, as it will be possible to see npcs on the map).

Several other modifications and adaptations to make compatibility possible.

Fix: opentibiabr/otservbr-global#2

NOTE: This commit will work directly with the pull opentibiabr/otservbr-global#1 from the otservbr-global repository.
After this commit, the OTServBR-Global will use the Canary Engine, there will no longer be source code in global.

NPCS Lib modifications:
Added new callbacks:
- onCloseChannel (CALLBACK_ON_CLOSE_CHANNEL)
- onMove (CALLBACK_ON_MOVE)
- FocusModule.tradeCallback
- NpcsEvent_t enum: NPCS_EVENT_PLAYER_CLOSE_CHANNEL

Lua functions:
- NpcHandler:getKeywordHandler()
- NpcHandler:getEventDelayedSay(playerId)
- NpcHandler:setEventDelayedSay(playerId, newEventDelayedSay)
- NpcHandler:getEventSay(playerId)
- NpcHandler:setEventSay(playerId, newEventSay)
- NpcHandler:getTalkStart(playerId)
- NpcHandler:setTalkStart(playerId, newTalkStart)
- NpcHandler:getTopic(playerId)
- NpcHandler:setTopic(playerId, newTopic)
- NpcHandler:checkInteraction(npc, player)
- NpcHandler:updateInteraction(npc, player)
- NpcHandler:setInteraction(npc, player)
- NpcHandler:removeInteraction(npc, player)
- NpcHandler:tradeRequest(npc, player, message)
- NpcHandler:onMove(npc, player, fromPosition, toPosition)
- NpcHandler:sendMessages(message, messageTable, npc, player, useDelay, delay)
- FocusModule:setTradeCallback(callback)
- Npc:sayWithDelay(npcId, text, messageType, delay, event, playerId)
- Npc:sendMessage(player, text)
- Npc:isMerchant()
- Npc:closeShopWindow(player)
- Npc:isInTalkRange(playerPosition)
- Npc:move(direction)
- Npc:turn(direction)
- Npc:follow(player)
- Npc:getId()
- Npc:sellItem(player, itemid, amount, <optional> subtype, <optional> actionid, <optional: default: 1> canDropOnMap)
- Npc:getDistanceTo(uid)
- NpcType:getSpeechBubble()
- NpcType:setSpeechBubble()
- Player:getItemIdByCid(itemId)
- Item:getClientId()
- LuaFunctionsLoader::getErrorDesc(ErrorCode_t code) new callback: LUA_ERROR_NPC_TYPE_NOT_FOUND

CPP functions:
- Npc::onPlayerCloseChannel(creature)
- Game::loadCustomMap(name)
- Iomap: loadMonstersCustom(map), loadNpcsCustom(map), loadHousesCustom(map)

Cpp definitions:
- ITEM_FILLED_BATH_TUBE, ITEM_SWORD_RING, ITEM_CLUB_RING, ITEM_DWARVEN_RING, ITEM_RING_HEALING, ITEM_STEALTH_RING, ITEM_TIME_RING, ITEM_PAIR_SOFT_BOOTS, ITEM_PAIR_SOFT_BOOTS_ACTIVATED, ITEM_DEATH_RING, ITEM_DEATH_RING_ACTIVATED, ITEM_PRISMATIC_RING, ITEM_PRISMATIC_RING_ACTIVATED.

Othes:
- Added bank system lib (bank_system.lua)
- TalkAction: /addmoney playername, moneycount

Modified callbacks:
- FROM: CALLBACK_CREATURE_APPEAR, TO: CALLBACK_ON_APPEAR
- FROM: CALLBACK_CREATURE_DISAPPEAR, TO: CALLBACK_ON_DISAPPEAR
- FROM: CALLBACK_CREATURE_SAY, TO: CALLBACK_ON_SAY
- FROM: CALLBACK_ONTHINK, TO: CALLBACK_ON_THINK
- FROM: CALLBACK_PLAYER_ENDTRADE, TO: CALLBACK_PLAYER_END_TRADE
- FROM: CALLBACK_PLAYER_CLOSECHANNEL, TO: CALLBACK_CLOSE_CHANNEL
- FROM: CALLBACK_ONADDFOCUS, TO: CALLBACK_SET_INTERACTION
- FROM: CALLBACK_ONRELEASEFOCUS, TO: CALLBACK_REMOVE_INTERACTION
- FROM: CALLBACK_ONTRADEREQUEST, TO: CALLBACK_ON_TRADE_REQUEST
- FROM: SHOP_TRADEREQUEST, TO: FOCUS_TRADE_MESSAGE

Modified functions:
- From: player:removeMoneyNpc(), to: player:removeMoneyBank(cost)
- From: NpcHandler.eventSay[focus] = nil, to: NpcHandler:setEventSay(playerId, nil)
- From: NpcHandler.eventDelayedSay[focus] = nil, to: NpcHandler:setEventDelayedSay(playerId, nil)
- From: NpcHandler.talkStart[focus] = nil, to: NpcHandler:setTalkStart(playerId, nil)
- From: NpcHandler.topic[focus] = nil, to: NpcHandler:setTopic(playerId, nil)
- From: NpcHandler:onCreatureAppear, to: NpcHandler:onAppear
- From: NpcHandler:onCreatureDisappear, to: NpcHandler:onDisappear
- From: NpcHandler:onCreatureAppear, to: NpcHandler:onAppear
- From: NpcHandler:onCreatureSay, to: NpcHandler:onSay
- From: NpcHandler:onPlayerCloseChannel, to: NpcHandler:onCloseChannel
- From: NpcHandler.topic[playerId] = topicId, to: NpcHandler:setTopic(playerId, topicId)
- From: NpcHandler.topic[playerId] == topicId, to: NpcHandler:getTopic(playerId) == topicId
- From: Charm:cancelMessage(), to: charm:messageCancel()
- From: Charm:logMsg(), to: Charm:messageServerLog()
- msgcontains(message, keyword) = It was refactored so that it identifies the entire string and does not read just one word, generating this issue: https://github.com/opentibiabr/otservbr-global/issues/2736

Removed callbacks:
- NpcHandler: focuses, idleTime, talkRadius, shopItems, MESSAGE_ONBUY, MESSAGE_BOUGHT, MESSAGE_SELL, MESSAGE_ONSELL, MESSAGE_SOLD, MESSAGE_IDLETIMEOUT
- Voice modules
- Shop module
- NpcSystem (It was used to parse XML npcs information)

Removed Lua functions:
- NpcHandler:isFocused
- NpcHandler:releaseFocus
- NpcHandler:onPlayerEndTrade
- NpcHandler:onSell
- doNpcSellItem
- doCreatureSayWithDelay
- doPlayerSellItem
- doPlayerBuyItemContainer
- doPlayerRemoveMoney
- getPlayerMoney
- closeShopWindow

Removed CPP functions:
- Npc:getCurrencyTrading()

Others modifications:
- Changed configkey = From: MAP_CUSTOM_ENABLED, to: TOGGLE_MAP_CUSTOM
- Fixed the load of the custom map, which is now directly in the source and works as a complement to the main map.
- Removed ConfigKey: MAP_CUSTOM_FILE and MAP_CUSTOM_SPAWN
- Some functions are capitalized to indicate that they are global functions, for example: MessageContains(), GetCount(), and others.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: NPCs answer only on keywords
3 participants