nwnx_cool brings functionality to the game to modify the combat engien.
Features:
*Can assign which weapon-focus line of feats that is to be used to what weapon. Makes it possible to give CEP weapons weapon focus feats (all of them, including weapon of choice)
*Hooks into the game and exposes several routines to nwscript. UseFeat, UseSkill, CastSpell, UseItem, SpecialAttackOnHit (knockdown, disarm, smite, stunning fist etc), Devastating critical and much more.
*Can disable pause completely
*Can replace nwn's random generator with antoher algorithm
Update 0.4:
Added Set/GetFirst/LastName works on PCs but require a relog.
Added several new events such as toggle-pause, remove-combat invisibility.
Fixed crash with use-feat and devastating critical.
And a bunch more.
Update 0.5 and more thorough explanation:
NWNX localdata modifiers examples:
//The weapon when wielded in the mainhand will have 100 attacks
SetLocalInt( oWeapon, "mainattks", 100 );
//The weapon when wielded in the offhand will have 100 attacks
SetLocalInt( oWeapon, "offhdnatt", 100 );
//The weapon will look for feat 10 as its epic weapon focus feat
SetLocalInt( oWeapon, "ewf", 10 );
//The weapon will look for feat 10 as its weapon focus feat
SetLocalInt( oWeapon, "wf", 10 );
//The weapon will look for feat 10 as its weapon specialization feat
SetLocalInt( oWeapon, "ws", 10 );
//The weapon will look for feat 10 as its weapon epic spec feat
SetLocalInt( oWeapon, "ews", 10 );
//The weapon will look for feat 23 as its improved crit feat
SetLocalInt( oWeapon, "ic", 23 );
//The weapon will look for feat 23 as its overwhelming crit feat
SetLocalInt( oWeapon, "oc", 23 );
//The weapon will respect unarmed base attack bonus
//This will work reguardless of class composition
SetLocalInt( oWeapon, "oc", TRUE );
//The game will check for the weapon of choice feat off the creature
//1 = longsword in this case
//Longswords weapon of choice is feat 10 for oCreature
SetLocalInt( oCreature, "woc_1", 10 );
//The creatures casterlevel is now 9000
SetLocalInt( oCreature, cstrlvl, 9000 );
//The creature has +10 AC Calculated ACVsX+Mod
//This modifier WILL be reflected on the character sheet
SetLocalInt( oCreature, "AC", 10 );
//The creature has -10 AB Calculated ABVsX+Mod
//This modifier WILL be reflected on the character sheet
SetLocalInt( oCreature, "AB", -10 );
OBJECT_SELF = attacker
parameters: target, baseitemtype, weapon
By-passable: yes, the normal crit will still occur however.
9: Special attack onhit melee (knockdown, smite, etc)
OBJECT_SELF = user
parameters: target, special-attack-type
By-passable: yes. No-hit will occur at all.
10: Ranged special attack onhit
OBJECT_SELF = user
parameters: target, special-attack-type
By-passable: yes. No-hit will occur at all.
11: Pause
OBJECT_SELF = module
parameters: pause-state about to be set
By-passable: yes.
12: PvP attitude change (untested!)
OBJECT_SELF = invoker
parameters: target, state
By-passable: yes i think so.
13: Remove Combat Invisibility
OBJECT_SELF = attacker
parameters: none
By-passable: yes. The invisibility/gs stays on.
Unrelated functions:
//Get the latest combat data from oCreature (rolls, damage, crits etc)
string GetCurrentCombatData( object oCreature, int nType );
//Get an object based of their objectID
object GetObject( string sID );
//Get the firstname from a creature
string GetFirstName( object oCreature );
//Get the lastname from a creature
string GetLastName( object oCreature );
//Set the last name on a creatures (PCs needs to relog for this to take effect)
void SetLastName( object oCreature, string sLastName );
//Set the last name on a creatures (PCs needs to relog for this to take effect)
void SetFirstName( object oCreature, string sFirstName );
//Prints sText to the console
void PrintToConsole( string sText );
//Generates a random number from the nwnx plugin itself
int CoolRandom( int nSeed );
//Get current timestamp
int Time( );
inisettings:
WriteToLogFile=### ;(When this number is higher then 0 the plugin will create a console window and hook nwn's log function. 1=nwn's logs is printed to the console window, 2=only the nwscript command will be printed to the console window, 3= all data is printed to the console including the plugins logs very spammy, 4=only the plugin's logdata is printed to the console)
Rand=1/0 ;(When 1 nwn's random functions are hooked and replaced by a frame based random system. Initial frame=unixtimestamp/2. Every random call advances the frame+1. The frame is then used to compute a seed for rand unixtime+frame. At initialization the function fills a buffer with random bytes from rand. Random numbers is returned to nwn though casting random sizes of data from the generated buffer which moves the cursor though the buffer. When the buffer hits its re-buffered with new bytes and the cursor is set back to 0.)
TogglePauseState=1/0 ;(when 1 pause is hooked and runs nwnx_cool.nss)
weapon_hook=1/0 ;(when 1 the plugin will hook the feat functions which enables use of the local-ints: local-int reference. This will completely override ubab and weapon finesse)
GetCasterLevel=1/0 ;(When set to 1 functions reguarding casterlevels are hooked and overriden by a localint)
CastSpell=1/0 ;(Adds a script event to castspell)
ItemCastSpell=1/0 ;(Adds a scriptevent to item-uses)
Polymorph=1/0 ;(Adds a script event to polymorph)
UnPolymorph=1/0 ;(same as above)
UseSkill=1/0 ;(script event)
UseFeat=1/0 ;(script event)
ToggleMode=1/0 ;(same as above)
DevCrit=1/0 ;(Hooks critical/devcrit properly, if nwnx_events is present that hook needs to be disabled)
SpecialAttack=1/0 ;(Hooks into the special attack routine (knockdown, disarm, smite, etc) and runs a script even when the attack is actually occuring)
SetPVPPlayerLikesMe=1/0 ;(Hooks the player attitude change to fire a script when one occurs)
RemoveCombatInvisibility=1/0 ;(Hooks the combat function that removes invisibility effects to fire a script. NOTE: This one fires alot)
RandomBuffer=#### ;(The number of random (including dice) calls that will be rolled before the plugin re-seeds) Default is 100.
AC=1/0 ;(When 1 it enables the AC local data to be used)
AB=1/0 ;(When 1 it enables the AC local data to be used)
ConsoleOnly=1/0 ;(When set to 1 the plugin will only print data to the console and not the logfile)
Special Thanks to MaxRock and the NWNX team for their work aswell.
Also quickfixed 0.5 as the un/polymorph even was screwy.