Commit graph

13 commits

Author SHA1 Message Date
Ramon Bernardo
afd9165725
refactor(thing): remove Cylinder class and merge receiver logic into Thing (#5058)
* refactor(cylinder): remove Cylinder class and merge receiver logic into Thing

* fix(game): code format

* fix(trashholder): code format

* refactor(thing): remove unused params

* refactor: remove unused params

* fix(luascript): use default switch case

* fix(item): parent nullptr check

* refactor(creature): use tile property instead getTile method

Co-authored-by: Ranieri Althoff <1993083+ranisalt@users.noreply.github.com>

* refactor(item): getTile method on get parent

* refactor(player): simplify query destination logic

* refactor(container): simplify query destination logic

* refactor(item): use const parent var

* fix(luascript): support move removed item

* fix(game): rename thing param

* fix(player): destThing nullptr check

* fix(thing): remove startDecaying method

* fix(container): merge master branch

* fix(depotchest): merge master branch

* refactor(container): remove unnecessary if state on top-parent

---------

Co-authored-by: Ranieri Althoff <1993083+ranisalt@users.noreply.github.com>
2025-11-29 01:38:42 +01:00
Ramon Bernardo
4026157e84
refactor(protocol): remove legacy ProtocolLogin impl (#5038)
* refactor(protocol): remove legacy ProtocolOld impl

* refactor(protocol): remove legacy ProtocolLogin impl

* fix(data): cpplinter enum values

---------

Co-authored-by: Ranieri Althoff <1993083+ranisalt@users.noreply.github.com>
2025-11-22 18:20:38 +01:00
Artur Knopik Linux
5bfda8f613 Revert "[Revscriptsys] RevNpcSys version 1.0 (lua npcs / NpcType / new npc system) (#4671)"
This reverts commit 4a89502f46.
2024-12-05 23:56:16 +01:00
Artur Knopik Linux
72ed4a250b Revert "[Revnpcsys] Revisioned Npc System v1.1 (#4724)"
This reverts commit ac84e261da.
2024-12-05 23:56:16 +01:00
Artur Knopik Linux
c83f7a338b Revert "[Revnpcsys] Revisioned Npc System v1.3 (#4747)"
This reverts commit a490b34fa4.
2024-12-05 23:56:16 +01:00
Ramon Bernardo
8b9e0b0d1d
Add Player:onReconnect event (#4837) 2024-11-17 17:53:22 +01:00
Ramon Bernardo
16249ab3c6
Fix world light default config (#4790)
* Remove cfg world light

* Fi world light cfg
2024-09-26 00:22:30 +02:00
Ranieri Althoff
cf1c4856d7
Move player bug report to Lua (#4768)
Co-authored-by: Xmish <95135755+xmish@users.noreply.github.com>
2024-07-16 16:17:05 +02:00
Mario
a490b34fa4
[Revnpcsys] Revisioned Npc System v1.3 (#4747)
- Added `onSight` event, this has to be enabled with `NpcType:sight(x, y)` unless that is not set the event wont fire. This event triggers whenever a creature (monsters/npcs/players) steps into the sight range, will only re trigger once you walk out of idle range and back in again.
- fixed event callbacks, they're now moved into `NpcCallbacks` they can be set like: `NpcType:callbacks().onSay/onSight/etc.`
- fixed a crash which could occur if you had a npc disabled then enabled him and /reload npcs, this is now fixed
- fixed a crash that if a xml npc is invalid on server startup that it throws an error instead of crashing
- made all the functions in the lib overloadable, only the table data is protected, you can now change functions and they will be correctly changed on /reload npcs
- changed everything related to focus from seconds into ms
- changed focus so it works for all creatures not only players
- changed NpcTalkQueue it now works for creatures not only for players
- changed the onCreatureSay event, it now triggers for all creatures not only for players
- selfSay has a new parameter now called talkType which is optional and falls back to TALKTYPE_SAY
- added `onSpeechBubble` event, with this we can set the speech bubble for each player individual.
example:
Npc has a quest for the player he only shows for this player the quest speech bubble, once the quest is finished the npc wont have a quest speech bubble anymore

---------

Co-authored-by: Evil Puncker <EPuncker@users.noreply.github.com>
Co-authored-by: KrecikOnDexin <krecikondexin@gmail.com>
2024-06-13 03:04:41 +02:00
Danyel Varejão
3ba9e677a7
Fix some warnings and improve type annotations (#4740)
* Fix some warnings and improve type annotations

* Fix `item:transform` type annotation

* Remove `dump` function from compat.lua

* Fix `configKeys` type annotations

* Refactor all enums/constants of `cpplinter.lua` and fix ident style to tabs

Some were missing and others were wrong, I got them all directly from the source.

* Refactor the PlayerFlag constants in cpplinter.lua to use bitwise shift operators instead of exponentiation
2024-06-07 01:25:33 +02:00
Mario
ac84e261da
[Revnpcsys] Revisioned Npc System v1.1 (#4724)
- npc now correctly clears all npc id data when he is removed
- farewell and greet messages can be individually set per talk state if not they fall back to default
- fixed a bug if the npc disappeared while the player was talking to him, then the npc would not respond to the player again once he was spawned
- better warning/error messages which show which npc it occured and which file it originates from
- added shop callback function callback(npc, player, handler, items, afterDiscount) order:
- discount (if there is any) -> callback
- added NpcsHandler:player() this is basicly the equivalent to requirements but instead of requireing you can add/set stuff to the player (modules.lua)
- implemented modules they're load after callbacks order:
    requirements (if returns true) -> callback (if returns true) -> modules
- moved teleport/addItems/setStorageValue to modules
- added new requirements
- changed the requirements functions
- I've included the error message directly inside the functions
- removed :failureRespond & :getFailureRespond as they're redundant with requirement re work
- changed modules outfit function it requires to insert 2 different outfits now because of 2 different player sexes
    ex: :outfit(id1, id2, addon)
- a few linter/annotation fixes
- if the player changed the talk state but still had the shop open and then tried to purchase something it thrown errors, this is now fixed
2024-06-05 20:49:30 +02:00
Mario
4a89502f46
[Revscriptsys] RevNpcSys version 1.0 (lua npcs / NpcType / new npc system) (#4671)
Co-authored-by: Sarah Wesker <sarahelizabetwesker@gmail.com>
2024-05-30 02:55:42 +02:00
Mario
ea59250056
Annotations & Linter including luascript.cpp functions (#4672)
* Create cpplinter.lua
2024-05-23 01:39:46 +02:00