DMH-Online

Dungeon Masters Helper · Est. 2005

Areas Scripts

NWN Script: get_pcs.htm

Author Sticky: Post Working Scripts Here
SDxEair Posted: Wednesday, 17 July 11:20AM
1. Script Name: object GetFirstPCInArea(object oArea) and object GetNextPCInArea(object oArea)

2. What it does: Uses the standard GetNextPC()/GetFirstPC() to get PC's in a specific Area.

3. Notes: Written By Eair


NWScript:
//Written By Eair
object GetFirstPCInArea(object oAreaTest)
{
    object oPCTestValid = GetFirstPC();
    while(GetArea(oPCTestValid)!=oAreaTest&&GetIsObjectValid(oPCTestValid))
        oPCTestValid = GetNextPC();
    return(oPCTestValid);
}
object GetNextPCInArea(object oAreaTest)
{
    object oPCTestValid = GetNextPC();
    while(GetArea(oPCTestValid)!=oAreaTest&&GetIsObjectValid(oPCTestValid))
        oPCTestValid = GetNextPC();
    return(oPCTestValid);
}



Pls tell me if you find any problems with this script

⌂ All Scripts ← PreviousNext → 👁 Category List

All Areas Scripts

📄 ambient_npc_ani 📄 area_spawner 📄 change_lighting 📄 clean_trash_001 📄 clean_trash_002 📄 clean_trash_003 📄 despawn_mobs 📄 despawn_mobs_002 📄 disable_sound 📄 full_edge_transition_001 📄 full_edge_transition_002 📄 full_edge_transition_003 📄 full_edge_transition_004 📄 full_edge_transition_004a 📄 get_pcs 📄 guard_patrols 📄 keyed_transitions 📄 random_enc_001 📄 random_enc_002 📄 random_enc_003 📄 random_enc_004 📄 random_enc_006 📄 random_enc_009 📄 random_encounter_005 📄 random_interiors 📄 random_interiors_001a 📄 restrict_access 📄 sitting_area