Rune_PRC8/_module/nss/oai_cust_death.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

101 lines
2.6 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
//
// Olander's AI
// oai_cust_death
// by Don Anderson
// dandersonru@msn.com
//
// Place your custom death requirements here.
// This script will be called once when a creature dies or flees the map (by the Creature).
// Use GetIsDead(OBJECT_SELF) if you need to differentiate between dying and fleeing.
//
////////////////////////////////////////////////////////////////////////////////
#include "nbde_inc"
//ORS Player Stats
#include "opw_inc_pstat"
void main()
{
//Example
/*
ExecuteScript("blah_blah", OBJECT_SELF);
*/
/******************************************************************************/
//:: PLACE CUSTOM DEATH STUFF BELOW HERE
object oMod = GetModule();
object oNPC = OBJECT_SELF;
object oTarget = GetLastKiller();
int BIOXP = GetLocalInt(oMod,"BIOXP");//Bioware XP System
int OPWXP = GetLocalInt(oMod,"OPWXP");//Olander's XP System
int PWFXP = GetLocalInt(oMod,"PWFXP");//Knat's PWFXP System v2.0
int DMGXP = GetLocalInt(oMod,"DMGXP");//ScrewTape's DMG XP System
//XP System Selection
if(OPWXP == 0)
{
//Use Knat's PWFXP System
if(PWFXP == 1) ExecuteScript("pwfxp",oNPC);
//Use ScrewTape's DMG XP System
if(DMGXP == 1 && PWFXP == 0) ExecuteScript("xp_dmg_system",oNPC);
//Use Bioware XP System (Set Your Module Slider)
if(BIOXP == 1 && PWFXP == 0 && DMGXP == 0) ExecuteScript("xp_bio_system",oNPC);
}
else ExecuteScript("xp_opw_system",oNPC);
//Olander's Pack Animals
int nPA = GetLocalInt(oNPC,"PACK_ANIMAL");
if(nPA == 1)
{
ExecuteScript("opa_pack_remove", oNPC);
return;
}
//Olander's Horses
int nHorse = GetLocalInt(oNPC,"HORSE");
if(nHorse == 1)
{
ExecuteScript("hor_horse_remove", oNPC);
return;
}
//Player Kill Tracking for NPC's
int nPKTrack = GetLocalInt(GetModule(),"PKTRACK");
if(nPKTrack == 1)
{
if(GetIsPC(oTarget))
{
int nNPCKills = NBDE_GetCampaignInt("KILLS","NPC",oTarget);
int nNewTotal = nNPCKills + 1;
NBDE_SetCampaignInt("KILLS","NPC",nNewTotal,oTarget);
}
}
//Favorite Weapon Tracking
int nFavWeapon = GetLocalInt(GetModule(),"FAVWEAPON");
if(nFavWeapon == 1)
{
if(GetIsPC(oTarget)) SetPCFavoriteWeapon(oTarget);
}
//Strongest Creatures
int nStrKill = GetLocalInt(GetModule(),"STRKILL");
if(nStrKill == 1)
{
if(GetIsPC(oTarget)) SetStrongestCreatureKilled(oTarget, oNPC);
}
//Average CR
int nAvgCR = GetLocalInt(GetModule(),"AVGCR");
if(nAvgCR == 1)
{
if(GetIsPC(oTarget)) SetAverageCR(oTarget, oNPC);
}
}