Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
109 lines
1.8 KiB
Plaintext
109 lines
1.8 KiB
Plaintext
#include "NW_I0_GENERIC"
|
|
|
|
void main()
|
|
{
|
|
|
|
|
|
|
|
{
|
|
object oLeaving=GetExitingObject();
|
|
|
|
if (!GetIsPC(oLeaving))
|
|
{
|
|
return;
|
|
}
|
|
|
|
object oObject = GetFirstObjectInArea();
|
|
int nPCinArea=FALSE;
|
|
location lLoc;
|
|
object oItem;
|
|
|
|
|
|
// first of all, check every object in the area and see if it is a PC.
|
|
object oTest=GetFirstPC();
|
|
|
|
// Test to make sure the activator is a DM, or is a DM
|
|
// controlling a creature.
|
|
|
|
while (GetIsObjectValid(oTest) == TRUE)
|
|
{
|
|
if ((GetArea(oTest) == OBJECT_SELF)&&(!GetIsDM(oTest)))
|
|
{
|
|
nPCinArea = TRUE;
|
|
return;
|
|
}
|
|
oTest=GetNextPC();
|
|
}
|
|
|
|
|
|
|
|
|
|
//while (GetIsObjectValid(oObject))
|
|
// {
|
|
// if (GetIsPC(oObject))
|
|
// {
|
|
// nPCinArea = TRUE;
|
|
// return;
|
|
// }
|
|
// oObject=GetNextObjectInArea();
|
|
// }
|
|
|
|
|
|
// if not, then run the next bit of the script
|
|
|
|
if (nPCinArea != TRUE)
|
|
{
|
|
|
|
|
|
oObject = GetFirstObjectInArea();
|
|
while (GetIsObjectValid(oObject) == TRUE)
|
|
{
|
|
|
|
if (GetRacialType(oObject)==RACIAL_TYPE_DRAGON)
|
|
{
|
|
DestroyObject(oObject);
|
|
}
|
|
//
|
|
if (GetTag(oObject) == "BodyBag")
|
|
{
|
|
|
|
oItem = GetFirstItemInInventory(oObject);
|
|
while (GetIsObjectValid(oItem) == TRUE)
|
|
{
|
|
|
|
|
|
DestroyObject(oItem);
|
|
|
|
oItem=GetNextItemInInventory(oObject);
|
|
}
|
|
|
|
SetPlotFlag(oObject,FALSE);
|
|
|
|
DestroyObject(oObject);
|
|
}
|
|
oObject=GetNextObjectInArea();
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
int nRandom=d3();
|
|
string sString;
|
|
switch (nRandom)
|
|
{
|
|
case 1: sString="jw_drag_blue";
|
|
break;
|
|
case 2: sString="jw_drag_red";
|
|
break;
|
|
case 3: sString="jw_drag_green";
|
|
break;
|
|
|
|
}
|
|
lLoc=GetLocation(GetWaypointByTag("jw_blue_drag_wp"));
|
|
object oDragon=CreateObject(OBJECT_TYPE_CREATURE,sString,lLoc);
|
|
|
|
}
|
|
}
|