Initial Commit
Initial Commit [v1.32PRC8]
This commit is contained in:
49
_module/nss/htcaverns_enter.nss
Normal file
49
_module/nss/htcaverns_enter.nss
Normal file
@@ -0,0 +1,49 @@
|
||||
#include "rd_spawnmobs"
|
||||
#include "utl_i_sqluuid"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetEnteringObject();
|
||||
object oSpirit;
|
||||
location lLoc;
|
||||
string sSpirit;
|
||||
|
||||
if (GetIsPC(oPC))
|
||||
{
|
||||
sSpirit = GetLocalString(GetModule(),"FriendlySpirit");
|
||||
|
||||
if (sSpirit == GetName(oPC))
|
||||
{
|
||||
lLoc = GetLocation(GetObjectByTag("wp_spirit2"));
|
||||
oSpirit = CreateObject(OBJECT_TYPE_CREATURE,"en3_spiritfriend",lLoc);
|
||||
|
||||
AddHenchman(oPC,oSpirit);
|
||||
|
||||
if (GetHitDice(oPC) > 1)
|
||||
LevelMob(oSpirit, GetHitDice(oPC)-1);
|
||||
|
||||
ActionForceFollowObject(oPC,3.0);
|
||||
SetLocalString(GetModule(),"FriendlySpirit","");
|
||||
SetLocalString(oSpirit,"Master",GetName(oPC));
|
||||
}
|
||||
|
||||
if (SQLocalsUUID_GetInt(oPC,"Monstrous") > 0 || SQLocalsUUID_GetInt(oPC,"EvilPath") > 0)
|
||||
{
|
||||
object oEvil;
|
||||
oEvil = GetObjectByTag("en4_evil");
|
||||
|
||||
if (!GetIsObjectValid(oEvil))
|
||||
SendMessageToPC(oPC,"Error: Unable to check faction.");
|
||||
|
||||
if (GetIsEnemy(oPC,oEvil))
|
||||
{
|
||||
AdjustReputation(oPC,oEvil,50);
|
||||
|
||||
if (GetIsEnemy(oPC,oEvil))
|
||||
SendMessageToPC(oPC,"Error: Unable to fix faction.");
|
||||
else
|
||||
SendMessageToPC(oPC,"Faction adjusted.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user