This is great! Thanks.
So, if I understand this correctly (please, bear with me), I should #include this your script in a general OnDeath script for all my creatures and use the final int nXpsToAwardForTheKill when calculating my nerf...
Using LilacSoul's Generator & the NWN Lexicon as references, I've come up with:
#include "nw_i0_tool"
#include "KMdS_XP_Table"
void main()
{
// Who killed me?
object oPC = GetLastKiller();
// Is the killer a henchman, familiar, or summon? If so, find the PC owner.
while (GetIsObjectValid(GetMaster(oPC)));
{
oPC=GetMaster(oPC);
}
if (!GetIsPC(oPC)) return;
// Find the Party Leader
object oPartyMember = GetFirstFactionMember(oPC, TRUE);
// Cycle through each member of the party
while(GetIsObjectValid(oPartyMember) == TRUE)
{
// Divide calculated XP by PC's Level
int nNerfXP = nXpsToAwardForTheKill/GetHitDice(oPartyMember);
// Give nerfed XP to PC
GiveXPToCreature(oPartyMember, nNerfXP);
// Go to the next PC in the party and repeat until everyone has been awarded the correct nerfed amount
oPartyMember = GetNextFactionMember(oPC, TRUE);
}
}
If my thinking is correct, when a creature is killed, this will:
1) Find who made the killing blow
2) if it was a henchman or familiar, locate the owning PC
3) find the Party leader of the killer (or owning PC)
4) Find KMdS's calculated XP amount based on PARTY level
5) Apply XP nerf based on CHARACTER level
6) Give the current PC the nerfed amount
7) Repeat 4-6 with the next PC in the Party list until all party members have been awarded
If I put this together correctly, it should give XP to everyone, no matter who made the kill (Buff-Bots don't get left behind) and everyone's XP is nerfed based on their *own* level and not the level of the killer.
As KMdS's script doesn't take multiclass penalties into account, I've decided I can live without that since this is intended to be used in a low-level module. Having someone high enough level to actually receive the penalty would be less likely.
Did I miss anything?
Modifié par Gawain_VIII, 29 avril 2016 - 02:53 .