Added PnP Dire Rat.
Added PnP Dire Rat.
This commit is contained in:
57
nwn_dark_sun/ds_map_enc_sc.nss
Normal file
57
nwn_dark_sun/ds_map_enc_sc.nss
Normal file
@@ -0,0 +1,57 @@
|
||||
string LocationToString(location lLocation)
|
||||
{
|
||||
object oArea = GetAreaFromLocation(lLocation);
|
||||
vector vPosition = GetPositionFromLocation(lLocation);
|
||||
float fOrientation = GetFacingFromLocation(lLocation);
|
||||
return "#AREA#" + GetTag(oArea) +
|
||||
"#POSITION_X#" + FloatToString(vPosition.x) +
|
||||
"#POSITION_Y#" + FloatToString(vPosition.y) +
|
||||
"#POSITION_Z#" + FloatToString(vPosition.z) +
|
||||
"#ORIENTATION#" + FloatToString(fOrientation) + "#END#";
|
||||
}
|
||||
void main()
|
||||
{
|
||||
object oPartyMember, oArea, oTarget;
|
||||
object oPC = GetExitingObject();
|
||||
|
||||
if (oPC != GetFactionLeader(oPC)) // <- only the party leader can trigger
|
||||
return;
|
||||
|
||||
int bGoing;
|
||||
// Only fire for (real) PCs.
|
||||
if (!GetIsPC(oPC) || GetIsDM(oPC) || GetIsDMPossessed(oPC))
|
||||
return;
|
||||
|
||||
if (GetIsDawn() || GetIsDay())
|
||||
bGoing = (Random(100) <= 5);
|
||||
else
|
||||
bGoing = (Random(100) <= 10);
|
||||
|
||||
if (bGoing)
|
||||
{
|
||||
oArea = GetArea(oPC);
|
||||
oPartyMember = GetFirstFactionMember(oPC, TRUE); // <-- Change to TRUE
|
||||
location lStart = GetLocation(oPC);
|
||||
|
||||
if (d100() <= 15)
|
||||
oTarget = GetWaypointByTag("DS_SCRUBENC_2");
|
||||
else
|
||||
oTarget = GetWaypointByTag("DS_SCRUBENC_1");
|
||||
|
||||
location lTarget = GetLocation(oTarget);
|
||||
|
||||
while (GetIsObjectValid(oPartyMember))
|
||||
{
|
||||
if (GetArea(oPartyMember) == oArea && GetDistanceBetween(oPC, oPartyMember) <= 30.0) // <- change to whatever distance you want in meters
|
||||
{
|
||||
// SetLocalLocation(oPC, "ls_stored_loc", GetLocation(oPC)); // <-- change this line to
|
||||
SetLocalLocation(oPartyMember, "ls_stored_loc", lStart); // <-- use saved location because if the oPC has already jumped,
|
||||
// it'll use the PC's new location in the encounter area
|
||||
AssignCommand(oPartyMember, ClearAllActions());
|
||||
AssignCommand(oPartyMember, ActionJumpToLocation(lTarget));
|
||||
}
|
||||
|
||||
oPartyMember = GetNextFactionMember(oPC, TRUE); // <-- change to TRUE
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user