69 lines
1.7 KiB
Plaintext
69 lines
1.7 KiB
Plaintext
#include "rd_spawnzones"
|
|
|
|
void main()
|
|
{
|
|
object oPC;
|
|
vector vPC;
|
|
vector vNew;
|
|
location lLoc;
|
|
int iRndX;
|
|
int iRndY;
|
|
int iLevel;
|
|
string sTag;
|
|
|
|
oPC = GetEnteringObject();
|
|
if (GetIsPC(oPC))
|
|
{
|
|
if (GetLocalInt(OBJECT_SELF,"Triggered") == 0)
|
|
{
|
|
if (Random(20) == 0)
|
|
{
|
|
SendMessageToPC(oPC,"You hear a twig snap...");
|
|
iLevel = GetHitDice(oPC);
|
|
SetLocalInt(OBJECT_SELF,"Triggered",1);
|
|
vPC = GetPosition(oPC);
|
|
iRndX = Random(6) + 4;
|
|
iRndY = Random(6) + 4;
|
|
|
|
if (Random(2) == 1) iRndX=iRndX * -1;
|
|
if (Random(2) == 1) iRndY=iRndY * -1;
|
|
|
|
vNew = vPC + Vector( iRndX/1.0, iRndY/1.0, 0.0 );
|
|
lLoc = Location(GetArea(oPC), vNew, VectorToAngle( -1.0 * vNew ) );
|
|
|
|
if (iLevel>25)
|
|
sTag = "fiend";
|
|
else if (iLevel>10)
|
|
sTag = "merc";
|
|
else
|
|
sTag = "bandit";
|
|
|
|
if (GetLocalInt(oPC,"Evil") == 1 && Random(2) == 0)
|
|
{
|
|
if (iLevel>25)
|
|
sTag = "angelic";
|
|
else if (Random(2) == 0)
|
|
sTag = "elf";
|
|
else
|
|
sTag = "dwarf";
|
|
}
|
|
|
|
GetRaceCreatures(sTag,lLoc,iLevel,3);
|
|
|
|
vPC = GetPosition(oPC);
|
|
iRndX = Random(6) + 4;
|
|
iRndY = Random(6) + 4;
|
|
|
|
if (Random(2) == 1) iRndX=iRndX * -1;
|
|
if (Random(2) == 1) iRndY=iRndY * -1;
|
|
|
|
vNew = vPC + Vector( iRndX/1.0, iRndY/1.0, 0.0 );
|
|
lLoc = Location(GetArea(oPC), vNew, VectorToAngle( -1.0 * vNew ) );
|
|
|
|
GetRaceCreatures(sTag,lLoc,iLevel,3);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|