49 lines
1.1 KiB
Plaintext
49 lines
1.1 KiB
Plaintext
|
#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.");
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|