49 lines
1.5 KiB
Plaintext
49 lines
1.5 KiB
Plaintext
//:://////////////////////////////////////////////////
|
|
//:: prc_pwonspawn
|
|
/*
|
|
Handles loot system and automatic despawns
|
|
*/
|
|
//:://////////////////////////////////////////////////
|
|
|
|
#include "egs_inc"
|
|
#include "ip_inc"
|
|
#include "lgs_inc"
|
|
#include "pat_inc"
|
|
|
|
void main()
|
|
{
|
|
|
|
// Equip the monster
|
|
// Only Faction Hostile creatures will use custom equipment
|
|
if (GetStandardFactionReputation(STANDARD_FACTION_HOSTILE, OBJECT_SELF) >= 90)
|
|
{
|
|
pat_Apply(OBJECT_SELF);
|
|
|
|
/* Delay is necessary so the PAT created equipment is already equipped
|
|
in the associated slots and LGS can actually obey the
|
|
CS_LGS_EQUIP_DONTREPLACE variable set by PAT */
|
|
DelayCommand(3.25f, lgs_EquipMonster(OBJECT_SELF));
|
|
}
|
|
else if (FindSubString(GetName(OBJECT_SELF), "Spider") >= 0)
|
|
{ // HACK! Make spiders apply PAT
|
|
pat_Apply(OBJECT_SELF);
|
|
}
|
|
|
|
// ANPH scaling
|
|
float fScale = GetLocalFloat(OBJECT_SELF, "CREATURE_SCALE");
|
|
if (fScale > 0.01)
|
|
{
|
|
SetObjectVisualTransform(OBJECT_SELF, OBJECT_VISUAL_TRANSFORM_SCALE, fScale);
|
|
}
|
|
else if (GetStandardFactionReputation(STANDARD_FACTION_HOSTILE, OBJECT_SELF) >= 90)
|
|
{
|
|
SetObjectVisualTransform(OBJECT_SELF, OBJECT_VISUAL_TRANSFORM_SCALE, 0.9 + IntToFloat(Random(20))/100);
|
|
}
|
|
|
|
// Fix Bad Strref descriptions
|
|
if (GetDescription(OBJECT_SELF) == "Bad Strref")
|
|
SetDescription(OBJECT_SELF, " ");
|
|
|
|
ExecuteScript("npc_randomize", OBJECT_SELF);
|
|
}
|