View previous topic :: View next topic |
Author |
Message |
Wallack
Joined: 30 Apr 2012 Posts: 27
|
Posted: Fri Apr 15, 2016 11:40 Post subject: Leveling 41-80 using ingame interface |
|
|
Hi.
A while ago, like 4 years ago, I implemented this using NWNx but I lost almost everything. I don't remember what plugins did I use because apparently it was simple enough that I didn't have to do a lot of research.
Basically I modified the classes.2da , levels and xp required to advance so the player could see on his character sheet that he was allowed to go from lvl 40 to 41. Also when reached the XP I was able to use the ingame interface to level up.
I remember I had to limit max class level to 40 because a warrior at 41 was able to get like 30 new feats and it was crazy and broken.
I modified also the attack progression and saving throw. I remember that even if the character sheet showed the XP I had to manually trigger the level up event so the player were able to see the button and portrait change to level up but I controlled that with scripts as there were only certain areas where a player would get xp on those beyond epic levels.
I also remember that I was able to make the gamespy (working back then) to show the levels in the server were from 1 to 80.
I was using windows and remember some of the tools I used bot not all of them so I was wondering if some of you might be able to help. I remember using nwnx_cool, nwnx_funcs but not so many more.
I tried to use some recovery tools on my computer to search for the old neverwinter nights instances but I wasn't able to do so
Any help?
Thanks! |
|
Back to top |
|
|
Wallack
Joined: 30 Apr 2012 Posts: 27
|
Posted: Sat Apr 16, 2016 20:20 Post subject: |
|
|
It was using nwnx_cool and I was able to set it up again. I edited the xptables so chars still gain xp by killing monsters normally and the exp tables required for each level, however that won't reflect on the character sheet unless the client also has it. But is ok, now I just to find a way to test whether or not the char has enough xp to level up. |
|
Back to top |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Thu Apr 28, 2016 10:15 Post subject: |
|
|
lol where do people get this nwnx_cool? Been wanting to try out that one guys onapplydamage hook, but could never get the base nwnx_cool he uses to run it. Sad... |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Thu Apr 28, 2016 11:00 Post subject: |
|
|
http://www.azmodan.net/nwnx_output/nwnx_cool_Baaleos.rar
This is my version of nwnx_cool
If you want to add the functionality to your own version, just add the following:
Code: |
int (__fastcall *CNWSEffectListHandler__OnApplyDamageNext)( void * pThis, void*, CNWSObject * obj, CGameEffect * effect, int iArg );
|
To the top of CNWNHooks.cpp
This
Code: |
int __fastcall CNWSEffectListHandler__OnApplyDamage( void * pThis, void*, CNWSObject * obj, CGameEffect * effect, int iArg )
{
CNWSCreature * cre = obj->AsNWSCreature();
char * cData = new char[25];
if(cre)
{
int iShouldRun = obj->obj_vartable.GetInt( CExoString( "onDamageHook" ) );
if(iShouldRun == 1 || cre->cre_is_pc == 1)
{
ResetParameters();
Cool.frames++;
Cool.Event = 101;
Cool.oTarget = cre->obj.obj_generic.obj_id;
Cool.oTarget2 = effect->eff_creator;
int i;
for (i=0; i< 12; i++)
{
//string sVar = "damage_%d";
sprintf( cData, "damage_%d", i );
int iNum = effect->eff_integers[i];
obj->obj_vartable.SetInt(CExoString( cData ),iNum,0);
}
Cool.ScriptRunning = true;
(*NWN_VirtualMachine)->Runscript(&CExoString("nwnx_cool"), cre->obj.obj_generic.obj_id );
Cool.ScriptRunning = false;
if( Cool.ByPass )
{
for (i=0; i< 12; i++)
{
sprintf( cData, "damage_%d", i );
int nDamAmount = obj->obj_vartable.GetInt( CExoString( cData ) );
effect->eff_integers[i] = nDamAmount;
}
Cool.ByPass = false;
//return Cool.nRetn;
}
}
}
delete cData;
return CNWSEffectListHandler__OnApplyDamageNext(pThis,NULL,obj,effect,iArg);
}
|
Further down in the class - this is the actual hook code.
Then enable it via
Code: |
CreateHook( EffHandlerApplyDmg, CNWSEffectListHandler__OnApplyDamage,(PVOID*) &CNWSEffectListHandler__OnApplyDamageNext, "EffDoDamage" , "EffectHandlerDoDamage" );
|
And then use
Quote: |
[COOL]
EffDoDamage=1;
|
In the nwnx2.ini under the cool settings header.
In my nwnx_cool.nss
Code: |
else if( nEvent == 101){
if(GetIsPC(OBJECT_SELF) || GetLocalInt(OBJECT_SELF,"onDamageHook")==1)
{
int iDamage = -1;
string sBuffer = "";
int iter = 0;
for(iter=0;iter<12;iter++)
{
iDamage = GetLocalInt(OBJECT_SELF,"damage_"+IntToString(iter));
sBuffer += IntToString(iDamage)+"|";
}
object oDamager = GetEventTargetSecond( );
string oAttacker = GetName( oDamager);
//PrintString("Damage Inflicted to:"+GetName(OBJECT_SELF)+" before calculations - "+sBuffer+" \nAttacker:"+oAttacker);
int iBypass = ProcessCustomFeats(OBJECT_SELF,oDamager);
//SpeakString( "Damage Inflicted to:"+GetName(OBJECT_SELF)+" before calculations - "+sBuffer+" \nAttacker:"+oAttacker);
//SpeakString("Damage Dealt"+ IntToString( nData ));
if(iBypass)
{
ByPass( );
}
//SpeakString("Bypassed!!");
//string sData = GetCurrentCombatData(OBJECT_SELF,15);
//SpeakString("Divine Damage = "+sData);
}
}
|
Basically - the rule here is that if you want to change the damage amounts, you just need to change the int value stored in
GetLocalInt(OBJECT_SELF,"damage_"+IntToString(iter));
And then call Bypass();
No bypass = use original values.
Quote: |
iBlud = GetLocalInt(oPC,"damage_0");
iPierce = GetLocalInt(oPC,"damage_1");
iSlash = GetLocalInt(oPC,"damage_2");
iMag = GetLocalInt(oPC,"damage_3");
iAcid = GetLocalInt(oPC,"damage_4");
iCold = GetLocalInt(oPC,"damage_5");
iDivine = GetLocalInt(oPC,"damage_6");
iElec = GetLocalInt(oPC,"damage_7");
iFire = GetLocalInt(oPC,"damage_8");
iNeg = GetLocalInt(oPC,"damage_9");
iPos = GetLocalInt(oPC,"damage_10");
iSonic = GetLocalInt(oPC,"damage_11");
|
Below is an example of how I connected it to some passive feats.
Code: |
int iShouldBypass = FALSE;
//Fire Feat Section:
float fFireReduction = 0.00;
if(GetHasFeat(1117, oPC)) //FIRE ABSORB
{
//Take 10% of the fire damage, and heal the player with it, reduce the fire damage by 10% accordingly
fFireReduction = 0.10;
iShouldBypass = 1;
}
if(GetHasFeat(1117, oPC)) //FIRE ABSORB_II
{
//Take 15% of the fire damage, and heal the player with it, reduce the fire damage by 25% accordingly
fFireReduction = 0.25;
iShouldBypass = 1;
}
if(GetHasFeat(1118, oPC)) //FIRE ABSORB_III
{
//Take 30% of the fire damage, and heal the player with it, reduce the fire damage by 30% accordingly
fFireReduction = 0.55;
if(iCold > 0)
{
iCold = FloatToInt(IntToFloat(iCold)*1.25);
SetLocalInt(oPC,"damage_5",iCold);
}
iShouldBypass = 1;
}
if(fFireReduction > 0.00)
{
float fNewReduction = IntToFloat(iFire)*fFireReduction;
PrintString("Damage before reduction:"+IntToString(iFireOrig));
iFire -= FloatToInt(fNewReduction);
PrintString("Damage after reduction:"+IntToString(iFire));
iToHeal += FloatToInt(fNewReduction);
PrintString("Damage to heal:"+IntToString(iToHeal));
SetLocalInt(oPC,"damage_8",iFire);
}
|
Basically, its a feat called Fire Absorb 1,2 and 3.
The feats work incrementally - so Fire Absorb 1,2 and 3 will stack with eachother.
Thats why the comments don't match to the code -
Eg: referring to 30% immunity when it actually looks like 55%.
You can also use this system to boost boss NPC's
Code: |
if(GetResRef(oDamager)=="caius")
{
int iLoop = 0;
float fMod = 1.25;
if(GetLocalInt(oDamager,"STANCE")==2)
{
fMod = 2.25;
}
for(iLoop=0;iLoop<=11;iLoop++)
{
int iDam = GetLocalInt(oPC,"damage_"+IntToString(iLoop));
if(iDam >= 1)
{
iDam = FloatToInt(IntToFloat(iDam)*fMod);
SetLocalInt(oPC,"damage_"+IntToString(iLoop),iDam);
iShouldBypass = 1;
}
}
}
|
This bit of code, basically makes it so a boss character does 25% more damage by default, however, when he enters STANCE 2 (which is something like Ravager stance or something - He does a shit load more damage (125% more) . Its meant to intimidate the players into running away for the duration of the stance.
Anyway - hope you have fun with it. |
|
Back to top |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Sun Jul 31, 2016 21:12 Post subject: |
|
|
The problem I've been having is the lack of an "inc_cool". Which is needed to actually do any of it lol |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|