RATDOG/_module/nss/drownitem.nss
Jaysyn904 0f13e6c538 Initial module commit
Initial module commit.
2021-08-29 23:34:48 -04:00

17 lines
746 B
Plaintext

void main()
{
object oCurrentObject = GetFirstObjectInArea();
// This iterates through every object in the area once per heartbeat
while(oCurrentObject != OBJECT_INVALID)
{
// Run suffocation function if the current object is a PC and is not wearing an Amulet of Water Breathing
if((GetIsPC(oCurrentObject)) && (GetTag(GetItemInSlot(INVENTORY_SLOT_NECK, oCurrentObject)) != "AmuletofWaterBreathing" || GetItemInSlot(INVENTORY_SLOT_NECK, oCurrentObject) == OBJECT_INVALID))
{
SetLocalInt(oCurrentObject, "nTimer", GetLocalInt(oCurrentObject, "nTimer") + 1);
Suffocation(oCurrentObject, GetAbilityScore(oCurrentObject, ABILITY_CONSTITUTION), GetAbilityModifier(ABILITY_CONSTITUTION, oCurrentObject));
}
oCurrentObject = GetNextObjectInArea();
}
}