- npc.setani(ani, params0, params1...)
- npc.setcharani(ani, params0, params1...) - same as above
- player.isstaff - true if the account is in the staff= serveroption
- player.setani(ani, params0, params1...)
- player.attached(npcId|npcObject)
Signed-off-by: joey <1166538+xtjoeytx@users.noreply.github.com>
- Refactored the script timer out of TServer and into CScriptEngine
- Minor refactoring of some for-loops
NPC-Server changes:
- fixed overflow when manipulating player.hearts
- npc.scheduleevent(time, function, arg)
- Potentially fixed an issue with unescaping '\' characters from the client. TBD
Changes to npc-server:
- player.sendpm("message")
- npc.setpm(function) - only works for the database npc named "Control-NPC", and each call to this function will override the previous function.
- level.issparringzone
- Fixed an issue with npc.save[] sending to players
- Tweaked the timer to be more accurate, and report better statistics.
Other changes:
- Changed around many files with the ScriptBinding's to try to separate it from being intertwined with the v8 implementation / gserver.
- Potentially fix segmentation fault on exit. V8 should now clean all constructors we bind too, should fix multiple-server support but it has not been tested.
- Implemented new properties on the npc and player objects.
New properties for the npc object:
- npc.bodyimg
- npc.headimg
- npc.horseimg
- npc.shieldimg
- npc.swordimg
- npc.height (read-only)
- npc.width (read-only)
New properties for the player object:
- player.bodyimg
- player.headimg
- player.glovepower
- player.guild
- player.mp
- player.platform
- player.shieldimg
- player.shieldpower
- player.swordimg
- player.swordpower
- Global function tokenize(string, token = ' ') will split a string based on the token. (character only)
- Fixed an issue with comments on the last line of scripts breaking execution.
- Fixed an issue with the npc-controls triggering onPlayerLogout
- Fixed a crash when using npc.join() to join a class with compile errors
- Fixed npc.ani, it was returning the npcs chat message instead of the animation.
- Changing chat by npcs will no longer trigger playerchats on other npcs.
New functions for the level object:
- level.findnearestplayers(x, y)
- level.putnpc(x, y, script, options)
New functions for the npc object:
- npc.destroy() - only works on npcs from putnpc
New properties for the player object:
- player.ani
- player.ap
- player.bombs
- player.darts
- Persist npc.attr[] to disk for database npcs.
- Fixed npc.save[], and changed so it replicates graals functionality. Index starts at 0, and ends at 9.
- Fixed updating npc props to clients for npcs that were manipulated by other npcs.
- Fixed an issue with database npcs clientside scripts not being updated to the players.
- Fixed an issue with scripts manipulating player x/y triggering playertouchsme. Player must move for this to be triggered and can't be forced on a player
- server.findlevel("str") - returns a level object for the corresponding
level. If it has not been loaded, the server will load it. May be useful.
- server.players
Level object:
- level.players - list of players in a level
- Unique names are required for database npcs, and will be assigned incrementally if they collide with other npcs.
- server.findnpc(id/str) - returns the npc-object if the npc is found. Useful for database npcs
New events for database npcs:
- onPlayerLogin(player)
- onPlayerLogout(player)
Player object:
- player.rupees
- Fixed server.npcs, now properly returns an array of npcs on the server. Make sure to cache it for use in loops etc.. each reference rebuilds this array on the fly.
- Untested move() function, may work.
Level object:
- level.findareanpcs(x, y, width, height)
- level.npcs
Npc object:
- npc.move(dx, dy, time, options)
- Added a level object
NPC object:
- npc.level - access the level object
- npc.levelname - level name as string
Level object:
- level.name - level name as string
- Changed the timer from time() to use chrono
- Added a flag to npc props which allows forwarding the changes to the client (used for the npcserver)
NPCServer Changes:
- Giant dump of changes, including level npc support.