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

57 lines
1.6 KiB
Plaintext

// vamp_act_summon
#include "vampire_header"
void fnFollowMaster(object oPC)
{ // follow
object oMe=OBJECT_SELF;
float fDist=GetDistanceBetween(oPC,oMe);
if (fDist>4.0&&GetArea(oPC)==GetArea(oMe)&&!GetIsInCombat(oMe))
{
if (fDist>10.0) ActionMoveToObject(oPC,TRUE,1.0);
else { ActionMoveToObject(oPC,FALSE,1.0); }
}
else if (GetArea(oPC)!=GetArea(oMe))
{ // teleport
AssignCommand(oMe,ClearAllActions(TRUE));
AssignCommand(oMe,JumpToObject(oPC));
} // teleport
DelayCommand(8.0,fnFollowMaster(oPC));
} // fnFollowMaster()
void main()
{
object oPC=GetPCSpeaker();
if (!GetIsObjectValid(oPC)) oPC=OBJECT_SELF;
int nXP=GetLocalInt(oPC,"nVampireXP");
int nBlood=GetLocalInt(oPC,"nBloodPool");
object oCreature;
string sRes="rat002";
string sID;
object oTemp;
object oWP;
nXP=1+(nXP/5000);
nBlood=nBlood-20;
SetLocalInt(oPC,"nBloodPool",nBlood);
SendMessageToPC(oPC,"You spend 20 blood to conjure children of the night.");
fnGiveVampXP(oPC,10);
if (GetIsAreaAboveGround(GetArea(oPC))==AREA_ABOVEGROUND)
{ // wolves
sRes="wolf001"; // wolf
if (nXP>2) sRes="worg001"; // Dire Wolf
} // wolves
else
{ // rats
sRes="rat002"; // rat
if (nXP>0) sRes="ratdire002"; // dire rat
} // rats
oCreature=CreateObject(OBJECT_TYPE_CREATURE,sRes,GetLocation(oPC),TRUE);
sID=GetLocalString(oPC,"sTeamID");
SetLocalString(oCreature,"sTeamID",sID);
//oWP=GetWaypointByTag(sID+"_RESOURCES");
oTemp=GetObjectByTag(sID+"_PROXY");
ChangeFaction(oCreature,oTemp);
//DestroyObject(oTemp);
AssignCommand(oCreature,fnFollowMaster(oPC));
}