Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NWNXLua v0.5 created by Terra_777
- Copyright © 1994–2013 Lua.org, PUC-Rio. Please visit: http://www.lua.org/
- Additional nwn functions: (useage nwn.funcname)
- void SetLuaTMI( new ) - the tmi is handed in 100.000 units. 1 = 100.000 instructions. Calling this also resets the current count value
- int GetLuaTMI( ) - Get the TMI, see SetLuaTMI
- int GetFirstNextTURD( first ) - Traverse the turds, if first is true it'll reset and start from the top. Returns nil on fail and id and communityname on success
- string GetBic( creature ) - Get the bicfilecurrently in use by creature (player object)
- int DeleteTURD( pccreature ) - Delete a TURD (object containing info about PCs not online).
- int SetGetDomain( creature, domain, newdomain ) - set the domain (1 or 2) to a new domain or return the current if newdomain is nil. Returns -1 for non clerics, does not mod feats.
- int SetGetSpecialization( creature, newspec ) - set the wizard spec to a new specilization or return the current if newspec is nil. Returns -1 for non wizards.
- table GetLevelStat( creature, level ) - returns a table filled in with the info of the level that was requested, nil on failure
- int AddFeat( creature, feat, level ) - adds feat to creature, if level is higher then 0 then its also added to that level in the statlist
- void RemoveFeat( creature, feat ) - removes feat from creature, it'll also remove it from the statlist if any
- int GetABVs( creature, target ) - returns the AB the creature has vs the target
- int GetACVs( creature, target ) - returns the AC the creature has vs the target
- void SetSkillScore( creature, type, number ) - Sets the skill of a creature, type corresponds to SKILL_*, if type is negative it'll set the 'stored' skillpoints
- int GetStoredSkillPoints( creature ) - Get the number of stored/unassigned skillpoints the creature has
- void SetAbilityScore( creature, type, number ) - Set the base ability score for a creature. type corresponds to ABILITY_*
- string SetGetName( creature, type, name ) - Set the first or lastname of a creature. type 1 = lastname, type 0 = firstname. If name is nil it will only return a value
- string SetGetScript( creature, type, script ) - sets or gets an eventscript on a creature.
- If script is nil it will return only.
- type: 1: onattack 2: onblock 3: ondamage 4: ondeath 5: onconvo 6: ondisturbed 7: onendcombat 8: onheartbeat 9: onperception 10: onrested 11: onspawn 12: onspellcastat 13: userdefined
- int SetGetMovementRate( creature, movementratetype ) - sets the movementrate for a creature. nil or 0 will return only. type: 0 PC movement, 1: immobile, 2: very slow, 3:slow, 4: normal, 5: fast, 6: very fast, 7: default, 8: dm fast
- int SetGetVoiceSet( creature, voiceset ) - sets the voiceset of creature, if voiceset is nil or less then 0 it will return the current without changing
- void SetBaseDesc( creature, text ) - Set the base desc of a creature
- void SendMSGToAll( text )
- void SendMSGToPC( PC, text )
- int IsValid( object )
- object GetFirstPC( )
- object GetNextPC( )
- int ExecuteScript( script, objectself )
- void SetLocalString( object, varname, data )
- string GetLocalString( object, varname )
- void DeleteLocalString( object, varname )
- void SetLocalObject( object, varname, target )
- object GetLocalObject( object, varname )
- void DeleteLocalObject( object, varname )
- void SetLocalInt( object, varname, int )
- int GetLocalInt( object, varname )
- void DeleteLocalInt( object, varname )
- int SendChatMessage( receiver, sender, message, channel ) channel = 0:talk 1:whisper 2:party 3:tell 4:shout 5:dm 6: dmtalk 7: dmwhisper
- object IntToObject( number )
- int IntToObject( object )
- data NWScriptFunction( proc-address-string, opcode, secondarg, ... ): attempts calling a nwscript function, proc-address-string must the address to the function. Then the function behaves the same as the nwscript version, this can horribly crash everything! Only works with nwscript functions that handle ints, floats, strings and objects!
- void LuaLog( int ) 0 (default) no logging done, 1 log stuff
- file, attributes GetFirstFile( filepathfilter )
- file, attributes GetNextFile( )
- spot, listen GetCheckDistance( creature )
- oldvalue SetCheckDistance( creature, type, newvalue ) type: 1 combat spot 2 spot 3 combat listen 4 listen
- void ClearVisibleList( creature )
- void UpdateVisibleList( creature )
- int AddToVisibleList( creature, target, a1,a2,a3,a4 )
- void RemoveFromVisibleList( creature, target )
- oldflags SetVisibleListFlag( creature, target, flags )
- flags GetVisibleListFlag( creature, target )
- bool GetInvisible( creature, target, DC )
- bool GetBlind( creature )
- void LuaMainLoop( string FuncName ): hooks nwservers mainloop and executes the function with FuncName as its name
- void SetObject( object ): sets the object which is returned by nwscript GetObject
- Additional:
- The object type is a hexadecimal string, same as nwns ObjectToString.
- The command print is by default redirected to this logfile.
- All standard lua libraries enabled!
- OBJECT_SELF is available in lua-scripts executed from nwscript and holds the object executing the script.
- Hooking VM: ok
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement