DMH-Online

Dungeon Masters Helper · Est. 2005

Misc Scripts

NWN Script: quest_escort.htm

Author Sticky: Post Working Scripts Here
bonkey2 Posted: Wednesday, 26 June 02:00AM
Script Name: nw_c3_escort1 (modified)

What it does: A basic escort NPC to a location quest.

Notes: In the NPC coversation set the variable NW_L_MADEITTOEXIT to 10. Then change the variable declaration from GetPCSpeaker() to OBJECT_SELF. You will also need to create a waypoint at the detination with the waypoint TAG = NW_WAY_<NPC TAG> Once the NPC reaches this location he will set NW_L_MADEITTOEXIT to 30 and initiate conversation. Then the NPC will set NW_L_MADEITTOEXIT to 40. This script can be placed in the OnHeartbeat of the NPC.

NWScript:
//::///////////////////////////////////////////////
//::
//:: Escort by player
//::
//:: NW_C3_Escort1.nss
//::
//:: Copyright (c) 2001 Bioware Corp.
//::
//::
//:://////////////////////////////////////////////
//::
//::
//:: Follows player.  If gets close to a waypoint
//:: named NW_WAY_<MyTag> then says thank you text
//:: and escapes area.
//::
//:://////////////////////////////////////////////
//::
//:: Created By: Brent
//:: Created On: May 16, 2001
//::
//:://////////////////////////////////////////////
#include "NW_I0_PLOT"
void main()
{
    ClearAllActions();
//SpeakString(IntToString(GetLocalInt(OBJECT_SELF,"NW_L_MADEITTOEXIT")));
    // * made it to waypoint in time
    if (GetIsObjectValid(GetNearestPC()) == TRUE)
    {
    if ((GetDistanceToObject(GetNearestObjectByTag("NW_WAY_"+GetTag(OBJECT_SELF))) < 7.0)&& (GetLocalInt(OBJECT_SELF,"NW_L_MADEITTOEXIT") == 10))
    {
        SetLocalInt(OBJECT_SELF,"NW_L_MADEITTOEXIT",30);
        ActionStartConversation(GetNearestPC());
        SetLocalInt(OBJECT_SELF,"NW_L_MADEITTOEXIT",40);
    }
    else
    // * follow, if players accepted
    if ((GetLocalInt(OBJECT_SELF,"NW_L_MADEITTOEXIT") == 10) && (GetDistanceToObject(GetNearestPC()) > 4.0))
    {
        ActionMoveToObject(GetNearestPC(),TRUE);
    }
    else
    // * timer expired
    if (FALSE)
    {
        SetLocalInt(OBJECT_SELF,"NW_L_MADEITTOEXIT",20);
        ActionStartConversation(GetNearestPC());
    }
    } // PC object is valid
    else
    {
        SpeakString("TEMP NO PC");
    }
}



Enjoy!

--Bonkey

⌂ All Scripts ← PreviousNext → 👁 Category List

All Misc Scripts

📄 arena 📄 cast_bless_on_PC 📄 change_music 📄 chess_game 📄 climbing 📄 climbing_002 📄 common_includes_002 📄 cone_aoe 📄 cron 📄 cross_country_travel 📄 daoc_style_graves 📄 determine_time 📄 effects 📄 escort 📄 ez_respawn 📄 faction 📄 floating_text 📄 function_includes 📄 gambling 📄 include_sounds 📄 include_time_date 📄 jail 📄 jail_system 📄 journal_entry 📄 logbook 📄 manage_action_queue 📄 mmorpg_vault 📄 mod_intro 📄 mod_intro_002 📄 mod_intro_003 📄 mod_intro_005 📄 pers_world_database 📄 pers_world_database_002 📄 piller_of_fire 📄 plot_item 📄 portal_system 📄 portal_system_002 📄 puking 📄 quest_escort 📄 rep_per 📄 reward_rp 📄 rotation 📄 save_pc_location_002 📄 save_pc_location_003 📄 skill_checks 📄 skill_checks_002 📄 slot_machine 📄 story 📄 swimming 📄 take20_bypass 📄 vis_waypoint 📄 working_temple 📄 working_temple_002 📄 xp_gold_loss 📄 xp_gold_loss_002 📄 xp_loss_action