Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Thu Dec 18, 2014 1:23 Post subject: |
|
|
Think I might be making progress:
Code: |
int __fastcall CNWSCreature__ValidateCounterSpellData( CNWSCreature * cre, void*, nwn_objid_t target, unsigned char arg2, unsigned char arg3){
//int nMR = CNWSCreatureStats__GetSpellResistanceNext( cre, NULL );
//if( cre == NULL )
// return nMR;
//
//int nEx = cre->cs_original->obj.obj_vartable.GetInt( CExoString( "SR" ) );
ResetParameters( );
Cool.Event = 102;
Cool.oTarget = cre->obj.obj_generic.obj_id;
Cool.nData = Cool.nLastSpell;
Cool.nData2 = target;
Cool.Log( 1, "o ValidateCounterSpell: %08lx %08lx %i %i\n", cre, target, arg2, arg3 );
Cool.ScriptRunning = true;
(*NWN_VirtualMachine)->Runscript(&CExoString("nwnx_cool"), cre->obj.obj_generic.obj_id);
Cool.ScriptRunning = false;
if( Cool.ByPass ){
Cool.ByPass = false;
//Do not counter
return 0;
}
//Counter
return CNWSCreature__ValidateCounterSpellDataNext(cre,NULL, target, arg2, arg3);
}
|
Target (the nwnobjid) - seems to be the spell that you are countering with.
By modifying my onSpellCast hook to take note of the last cast spell - I am then able to pass that information to the counterspell hook - to pass it to nwnscript.
Testing it now |
|