RATDOG/_module/nss/lakeglopdive.nss
Jaysyn904 6b9ab12c25 Added giant gar
Added giant gar.  Updated Level 10a: Under Lake Glop
2023-09-12 23:50:13 -04:00

52 lines
1.1 KiB
Plaintext

#include "prc_inc_spells"
void main()
{
object oPC = GetLastUsedBy();
object oTarget = GetWaypointByTag("glop1");
string sDeny;
location lTarget = GetLocation(oTarget);
int bWB = FALSE;
if (!GetIsPC(oPC))
{
return;
}
if (GetHasFeat(FEAT_WATER_BREATHING, oPC) || GetHasFeat(FEAT_NIXIE_WATERBREATHING, oPC) || GetHasFeat(FEAT_BREATHLESS, oPC))
{
bWB = TRUE;
}
if (MyPRCGetRacialType(oPC) == RACIAL_TYPE_CONSTRUCT || MyPRCGetRacialType(oPC) == RACIAL_TYPE_UNDEAD)
{
bWB = TRUE;
}
if (bWB = FALSE || GetItemPossessedBy(oPC, "BottleofAir")== OBJECT_INVALID)
{
sDeny="You cannot hold your breath long enough to swim down!";
SendMessageToPC(oPC, sDeny);
return;
}
//only do the jump if the location is valid.
//though not flawless, we just check if it is in a valid area.
//the script will stop if the location isn't valid - meaning that
//nothing put after the teleport will fire either.
//the current location won't be stored, either
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(lTarget));
}