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

43 lines
1.4 KiB
Plaintext

// vamp_create_span
void fnNewVampire(object oMaster,object oWP,string sID)
{
object oTemp=GetObjectByTag(sID+"_PROXY");
object oNew=CreateObject(OBJECT_TYPE_CREATURE,"vampirespawn",GetLocation(oMaster));
ChangeFaction(oNew,oTemp);
//DestroyObject(oTemp);
SetLocalString(oNew,"sTeamID",sID);
} // fnNewVampire()
void main()
{
object oMe=GetPCSpeaker();
if (!GetIsObjectValid(oMe)) oMe=OBJECT_SELF;
object oTarget=GetLocalObject(oMe,"oTarget");
int nCHP=GetCurrentHitPoints(oTarget);
int nBP=GetLocalInt(oMe,"nBloodPool");
string sID=GetLocalString(oMe,"sTeamID");
object oWP=GetWaypointByTag(sID+"_RESOURCES");
effect eBeam=EffectBeam(VFX_BEAM_SILENT_EVIL,oMe,BODY_NODE_HAND);
if (nCHP<5)
{ // good target
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oTarget,9.8);
nBP=nBP-100;
SetLocalInt(oMe,"nBloodPool",nBP);
SendMessageToPC(oMe,"You expend 100 blood to bring the new vampire into being.");
if (GetIsPC(oTarget)==TRUE)
{ // convert PC
DelayCommand(10.0,ExecuteScript("player_vampire",oTarget));
} // convert PC
else
{ // make vampire spawn
DelayCommand(10.0,DestroyObject(oTarget));
DelayCommand(10.1,fnNewVampire(oMe,oWP,sID));
} // make vampire spawn
} // good target
else
{
SendMessageToPC(oMe,"That target has not been weakened enough to bring them over.");
}
}