Initial Commit
Initial Commit [v1.32PRC8]
This commit is contained in:
76
_module/nss/trig_ambush1.nss
Normal file
76
_module/nss/trig_ambush1.nss
Normal file
@@ -0,0 +1,76 @@
|
||||
#include "rd_spawnzones"
|
||||
#include "utl_i_sqluuid"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetEnteringObject();
|
||||
vector vPC;
|
||||
vector vNew;
|
||||
location lLoc;
|
||||
int iRndX;
|
||||
int iRndY;
|
||||
int iLevel;
|
||||
string sTag;
|
||||
|
||||
if (GetIsPC(oPC))
|
||||
{
|
||||
if (Random(20) == 0)
|
||||
{
|
||||
if (GetLocalInt(GetArea(OBJECT_SELF),"SpecialTrig") == 0)
|
||||
{
|
||||
SetLocalInt(GetArea(OBJECT_SELF),"SpecialTrig",1);
|
||||
SendMessageToPC(oPC,"You hear a twig snap...");
|
||||
iLevel = GetHitDice(oPC);
|
||||
iLevel = ZoneLevel(GetArea(oPC),iLevel);
|
||||
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 (SQLocalsUUID_GetInt(oPC,"EvilPath") > 1)
|
||||
{
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalInt(GetArea(OBJECT_SELF),"SpecialTrig",0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user