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

86 lines
2.8 KiB
Plaintext

////////////////////////////////////////////////////////////////
// Sacrifice to Evil Altar
// By Deva Bryson Winblood. 12/29/2003
////////////////////////////////////////////////////////////////
#include "rtsh_multiplay"
#include "hos_alignment"
void fnDoSacrifice(object oT,object oA)
{ // make oT walk to oA and be sacrificed
effect eVisBlood=EffectVisualEffect(VFX_COM_BLOOD_LRG_RED);
effect eDie=EffectDeath(TRUE);
AssignCommand(oT,ClearAllActions(TRUE));
AssignCommand(oT,ActionMoveToObject(oA,FALSE,1.0));
AssignCommand(oT,ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_INSTANT,eVisBlood,oT,1.0)));
AssignCommand(oT,ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_INSTANT,eDie,oT,1.0)));
DelayCommand(5.0,DestroyObject(oT));
} // fnDoSacrifice()
void fnAttractFiend(location lLoc,string sResRef,string sTID)
{ // attract a fiend
object oWP=GetWaypointByTag(sTID+"_RESOURCES");
object oTemp=GetObjectByTag(sTID+"_PROXY");
object oNew=CreateObject(OBJECT_TYPE_CREATURE,sResRef,lLoc);
SetLocalString(oNew,"sTeamID",sTID);
ChangeFaction(oNew,oTemp);
} // fnAttractFiend()
void main()
{
object oPC=GetPCSpeaker();
object oTarget=GetLocalObject(oPC,"oTarget");
int nMode=GetLocalInt(oPC,"nParm");
object oAltar=GetNearestObjectByTag("ALTAR");
object oMod=GetModule();
int nEvilPower=GetLocalInt(oMod,"nEvilPower");
int nMana;
int nR;
string sRes;
string sID=GetLocalString(oPC,"sTeamID");
effect eGate=EffectVisualEffect(VFX_FNF_SUMMON_GATE);
fnDoSacrifice(oTarget,oAltar);
AdjustAlignmentPartyProtected(oPC,ALIGNMENT_EVIL,10);
nEvilPower=nEvilPower+5;
SetLocalInt(oMod,"nEvilPower",nEvilPower);
ExecuteScript("rise_of_evil",oMod);
if (nMode==1)
{ // sacrifice for mana
nMana=fnGetTeamMana(oPC);
nMana=nMana+50;
fnSetTeamMana(oPC,nMana);
SendMessageToPC(oPC,"Your team has gained 50 mana.");
} // sacrifice for mana
else if (nMode==2)
{ // sacrifice for fiend attraction
nR=d100();
SendMessageToPC(oPC,"Rolled a "+IntToString(nR)+"% needed 10 or less.");
if (nR<11)
{ // attract
nR=d100();
if (nR<71)
{ // lesser
sRes="hellhound001";
if (sID=="SPID") sRes="dmsucubus002";
} // lesser
else if (nR<96)
{ // mid
sRes="erinyes002";
if (sID=="SPID"||sID=="UNC") sRes="dmvrock002";
} // mid
else
{ // major
sRes="devil004";
if (sID=="SPID") sRes="spiderdemo003";
} // major
SendMessageToPC(oPC,"Something comes.");
DelayCommand(20.0,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eGate,GetLocation(oPC),1.0));
DelayCommand(21.0,fnAttractFiend(GetLocation(oPC),sRes,sID));
} // attract
else
{ // nothing
SendMessageToPC(oPC,"No fiend is attracted.");
} // nothing
} // sacrifice for fiend attraction
}