HoS_PRC8/_mod/_module/nss/rts_rmg_death.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

113 lines
4.2 KiB
Plaintext

/////////////////////////////////////////////////////////////////////////////
// Real Time Strategy - NWN Modified OnDeath script
//===========================================================================
// By Deva Bryson Winblood. 02/26/2003
/////////////////////////////////////////////////////////////////////////////
//::///////////////////////////////////////////////
//:: Default:On Death
//:: NW_C2_DEFAULT7
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Shouts to allies that they have been killed
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
#include "hos_alignment"
void fnHireAssassin(object oPC);
void main()
{
int nClass = GetLevelByClass(CLASS_TYPE_COMMONER);
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
object oKiller = GetLastKiller();
object oMod=GetModule();
string sID;
object oLead;
int nPow=GetLocalInt(oMod,"nEvilPower");
int nAdjust=0;
float fCR=GetChallengeRating(OBJECT_SELF);
nAdjust=GetLocalInt(oMod,"nRMGKilled");
nAdjust++;
SetLocalInt(oMod,"nRMGKilled",nAdjust);
nAdjust=0;
if (GetIsPC(oKiller)==TRUE)
{ // PC
nAdjust=GetLocalInt(oKiller,"nKilledMerch");
nAdjust++;
SetLocalInt(oKiller,"nKilledMerch",nAdjust);
AdjustAlignmentPartyProtected(oKiller,ALIGNMENT_EVIL,5);
AdjustAlignmentPartyProtected(oKiller,ALIGNMENT_CHAOTIC,5);
sID=GetLocalString(oKiller,"sTeamID");
oLead=GetLocalObject(oMod,"oTeamLead"+sID);
if (nAdjust>2)
{ // hire assassin
if (GetLocalObject(oLead,"oCGAssassin")==OBJECT_INVALID)
{ // hire one
if (nAdjust<5) SetLocalString(oLead,"sCGAss","assassin1");
else if (nAdjust<7) SetLocalString(oLead,"sCGAss","assassin2");
else { SetLocalString(oLead,"sCGAss","assassin3"); }
if (sID=="DWF") SetLocalInt(oLead,"nMAGEASST",4);
else if (sID=="SPID") SetLocalInt(oLead,"nMAGEASST",2);
else if (sID=="UNC") SetLocalInt(oLead,"nMAGEASST",1);
else if (sID=="UND") SetLocalInt(oLead,"nMAGEASST",3);
fnHireAssassin(oLead);
} // hire one
} // hire assassin
nAdjust=0;
} // PC
else
{ // NPC
sID=GetLocalString(oKiller,"sTeamID");
if (sID!="")
{ // has an ID
oLead=GetLocalObject(oMod,"oTeamLead"+sID);
if (oLead!=OBJECT_INVALID)
{ //!OI
SendMessageToPC(oLead,GetName(oKiller)+" killed the roving merchant!");
nAdjust=GetLocalInt(oLead,"nKilledMerch");
nAdjust++;
SetLocalInt(oLead,"nKilledMerch",nAdjust);
AdjustAlignmentPartyProtected(oLead,ALIGNMENT_EVIL,2);
AdjustAlignmentPartyProtected(oLead,ALIGNMENT_CHAOTIC,2);
if (nAdjust>2)
{ // hire assassin
if (GetLocalObject(oLead,"oCGAssassin")==OBJECT_INVALID)
{ // hire one
if (nAdjust<5) SetLocalString(oLead,"sCGAss","assassin1");
else if (nAdjust<7) SetLocalString(oLead,"sCGAss","assassin2");
else { SetLocalString(oLead,"sCGAss","assassin3"); }
if (sID=="DWF") SetLocalInt(oLead,"nMAGEASST",4);
else if (sID=="SPID") SetLocalInt(oLead,"nMAGEASST",2);
else if (sID=="UNC") SetLocalInt(oLead,"nMAGEASST",1);
else if (sID=="UND") SetLocalInt(oLead,"nMAGEASST",3);
fnHireAssassin(oLead);
} // hire one
} // hire assassin
nAdjust=0;
} //!OI
} // has an ID
} // NPC
ExecuteScript("rts_mon_death",OBJECT_SELF);
}
void fnHireAssassin(object oPC)
{ // hire an assassin
object oSpawn=GetWaypointByTag("ASS_SPAWN");
object oAss;
string sRes=GetLocalString(oPC,"sCGAss");
int nTarget=GetLocalInt(oPC,"nMAGEASST");
oAss=CreateObject(OBJECT_TYPE_CREATURE,sRes,GetLocation(oSpawn));
SetLocalObject(oPC,"oCGAssassin",oAss);
SetLocalInt(oAss,"nSpeed",8);
SetLocalInt(oAss,"nTarget",nTarget);
SetAILevel(oAss,AI_LEVEL_NORMAL);
ExecuteScript("cg_assassin",oAss);
} // fnHireAssassin();