* add config.shareKill OnActorDeath
* Update commandHandler.lua
* Update base.lua
* Update base.lua
* Update config.lua
* Update eventHandler.lua
* Update commandHandler.lua
* Update eventHandler.lua
* Update commandHandler.lua
* Update base.lua
* Update config.lua
* Added sharing for allies and for players who hit
if the target has not been hit for more than 600 seconds then the sharing list for the hits is reset, the allies receive the share regardless of the hits
* Update eventHandler.lua
* Update eventHandler.lua
* Update eventHandler.lua
* Update eventHandler.lua
* Update eventHandler.lua
* Update eventHandler.lua
* Prevent crash when attepting to reload an invalid module
720: for key, value in pairs(package.loaded[scriptName]) do
- package.loaded[scriptName] is expected to be a table, not all lua scripts return one
- if lua script does not provide a return value, true is implicitly returned instead, this results in an attempt to iterate over boolean value
reference: reference: https://www.lua.org/manual/5.1/manual.html#:~:text=Once%20a%20loader%20is%20found,of%20package.loaded%5Bmodname%5D.
* Fix formatting
When creating a custom NPC via /storerecord command, it's not possible to add an item to their inventory of count greater than 1 (regardless of the number entered in the chat command it always defaults to 1).
1082: inputConcatenation = tableHelper.concatenateFromIndex(cmd, 5) -- no delimiter specified, therefore concatenated substrings are single space delimited
1083: inputValues = tableHelper.getTableFromCommaSplit(inputConcatenation) -- expects comma delimited substrings, whereas these are actually single space delimited
1134: local inputItemId = inputValues[1] -- contains both id and the amount at this point
1135: local inputItemCount = tonumber(inputValues[2]) -- is nil, therefore always defaults to 1, regardless the amount specified in chat command being a number
logicHandler.CreateObjectsAtPlayer and logicHandler.CreateObjectAtLocation both take objectData table instead of plain refId.
objectData can be built using added method BuildObjectData in dataTableBuilder.lua
This way any amount of say gold can be spawned easily.
For backwards compatibility it's possible to replace argument refId in either logicHandler.CreateObjectAtPlayer or logicHandler.CreateObjectAtLocation with dataTableBuilder.BuildObjectData(refId)
As of now, only players and cells still use the slower saving method, and only when disconnecting or being fully unloaded respectively.
Additionally, rename the Save() and Load() methods into SaveToDisk() and LoadFromDisk() to reduce ambiguity and prevent them from being used all the time by new scripters.
This prevents Lua pattern operators from having their special meaning in the values searched for, which was especially causing problems when removing certain spells from players.
Records are now split into 2 categories: permanent records and generated records.
Permanent records are kept forever once created and are sent to all players when they join the server.
Generated records are linked to players, cells or other records, are deleted once those links disappear, and are only sent to players who encounter them. For instance, if a player creates hundreds of potions in a house and then drops the potions there, those potion records will only be sent to players who enter that house. If the potions are drunk and there are no longer any instances of them, their associated records are deleted.
By default, permanent records are created by using the /createrecord command after specifically setting an ID for the record about to be created.
Generated records are created through regular gameplay or by using the /createrecord command without specifying an ID for the record.