Here is my OnActivateItem script (part 1) cut in half as it is too long to list as one:
[code]
//the following is the verbatim wrapper script as used in the SoU:OC Ch 1
// -Merentha
// x1_itemactivate
//:://////////////////////////////////////////////////
/*
Common script to be used as OnActivateItem script for
all modules. Executes the script with a name matching
the tag of the item being activated. Functions like
GetItemActivator() and GetItemActivatedTarget() will
work in these scripts, since they are being executed
from the perspective of the module itself. ???
Credit for this idea belongs to tjm, who posted it to
nwvault.ign.com.
*/
//:://////////////////////////////////////////////////
//:: Created By: Naomi Novik
//:: Created On: 09/27/2002
//:://////////////////////////////////////////////////
#include “lilarcor_include”
#include “x2_inc_switches”
//#include “horse_inc_h”
#include “pjr_chat_inc”
#include “xs_detonate_loc”
#include “x3_inc_horse”
#include “zep_inc_phenos”
#include “nw_i0_generic”
#include “sd_portable_inc”
#include “blsg_h”
#include “JS_I0_DMTCHK”
#include “cs_activate”
#include “x0_inc_portal”
#include “x2_inc_plot”
#include “_town_crier_inc”
#include “x2_inc_itemprop”
void main()
{
BladeSingerModuleOnActivated();
ExecuteScript(“fly_mod_activate”,OBJECT_SELF);
ExecuteScript(“cr_onact”, GetItemActivator());
ExecuteScript(“dmfi_activate”, GetItemActivator());
ExecuteScript(“dreamscape_onac”,OBJECT_SELF);
CSact();
//:://////////////////////////////////////////////////
//:: Prototypes
object oPC = GetItemActivator();
object oItem = GetItemActivated();
object oActivator = GetItemActivator();
object oTarget = GetItemActivatedTarget();
location lActivator = GetLocation(oActivator);
string sItemTag = GetTag(oItem);
object oPlayer = GetItemActivator();
string sPlayer = GetPCPlayerName(oPlayer);
//fudge time item …found in custom misc. other…made it so PC’s now can use this rather than just DM
object oUser=GetItemActivator();
location lLoc=GetItemActivatedTargetLocation();
string sTag=GetTag(oItem);
if(sTag=="FudgeTime")
{
AssignCommand(oUser, ActionStartConversation(oUser, "ld_con_fudge", TRUE));
}
// Global Economy Tool …found in custom misc. other…made it so PC’s now can use this rather than just DM… this script is also below for DM
if(sTag==“kpbwand”)
{
AssignCommand(oUser, ActionStartConversation(oUser, “kpb_wand”, TRUE));
}
// Item Advancement …found in custom misc. other…made it so PC’s now can use this rather than just DM … this script is also below for DM
if(sTag=="kpb_timetool")
{
AssignCommand(oUser, ActionStartConversation(oUser, "kpb_timetool", TRUE));
}
else if(sTag==“OtherItemsYouWantToActivate”)
{
ExecuteScript(“sTag”,oUser);
}
//---------------------------------START DLA DM HORSE WIDGETS-----------------------------
if (GetTag(oItem) == "horse_dismt2")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "horse_dismnt_dla", TRUE));
return;
}
// Paladin Unsummon//
if (GetTag(oItem) == “horse_unsummon”)
{
object oPaladin = GetItemActivator();
AssignCommand(oPaladin, HorseUnsummonPaladinMount());
return;
}
//---------------------------------START CEP HORSE WIDGETS-------------------------------
///////////////////////////////////////////////////////////////////////////////
// Summon White Pony
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “SummonHorse”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “henchman_pony”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Pony”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Pony"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Spotted Pony
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “SummonHorse2”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “henchman_ponysp”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Pony”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Pony"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Brown Pony
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “SummonHorse3”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “henchman_ponybn”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Pony”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Pony"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Black Horse
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “SummonHorse4”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “henchman_horsebk”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Brown Horse
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “SummonHorse5”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “henchman_horse2”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Nightmare
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “SummonHorse6”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “henchman_horsenm”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon White Horse
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “SummonHorse7”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “henchman_horsewt”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Aurenthil Horse
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “SummonHorse8”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “henchman_horseau”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// CEP widget dismount
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “horse_dismt”)
{
object oPC = GetItemActivator();
//if (GetTag (GetItemActivated ()) == “horse_dismt”) {zep_Dismount (oPC, “horse_dismt”);}
string sResRef = GetLocalString(oPC,“PONY_ID”);
zep_Dismount (oPC, “horse_dismt”);
SetLocalInt(oPC,“bX3_IS_MOUNTED”,FALSE);
DeleteLocalString(oPC,“X3_HORSE_SCRIPT_DISMOUNT”);
SetLocalInt(oPC, “VAR_HORSEMOUNT”, 0);//horselord class variable
//remove horse support DLA Style
object oRider=GetItemActivator();
DelayCommand(1.0, HORSE_SupportOriginalSpeed(oRider));
DelayCommand(1.0, HORSE_SupportRemoveMountedSkillDecreases(oRider));
DelayCommand(1.0, HORSE_SupportRemoveACBonus(oRider));
DelayCommand(1.0, HORSE_SupportRemoveHPBonus(oRider));
object oTarget;
location lPc = GetLocation(oPC);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, sResRef, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPC, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPC, ActionSpeakString("Invalid Horse/Pony"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon CEP/DLA Horse Managemet to dismiss a Horse
///////////////////////////////////////////////////////////////////////////////
if (GetTag(oItem) == “Horse_Management”)
{
AssignCommand(oActivator, ActionStartConversation(oActivator, “horse_magmt”, TRUE));
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Pack Camel
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “SummonCamel”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “henchman_pkcamel”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Camel”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Camel"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Pack Horse
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “SummonpkHorse”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “henchman_pkhorse”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Pack Ox
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “SummonpkOx”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “henchman_pkox”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Ox”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Ox"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Pack Pony
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “Summonpkpony”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “henchman_pkpony”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Pony”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Pony"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon CEP Flying System
///////////////////////////////////////////////////////////////////////////////
if (GetTag(oItem) == “fly_widget”)
{
AssignCommand(oActivator, ActionStartConversation(oActivator, “fly_control”, TRUE));
return;
}
//---------------------------------START DLA HORSE WIDGETS-------------------------------
///////////////////////////////////////////////////////////////////////////////
// Summon Walnut Horse Scale Barding
///////////////////////////////////////////////////////////////////////////////
if (sItemTag == “Horse_1”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “dla_hvywarhorse2”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Walnut Horse Leather Barding
///////////////////////////////////////////////////////////////////////////////
else if (sItemTag == “Horse_2”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “dla_hvywarhorse3”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Walnut Horse Red Barding
///////////////////////////////////////////////////////////////////////////////
else if (sItemTag == “Horse_3”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “dla_hvywarhorse4”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Walnut Horse Chain Barding
///////////////////////////////////////////////////////////////////////////////
else if (sItemTag == “Horse_4”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “dla_hvywarhorse”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Walnut Horse
///////////////////////////////////////////////////////////////////////////////
else if (sItemTag == “Horse_5”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “dla_horse001”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Purple Jousting Horse
///////////////////////////////////////////////////////////////////////////////
else if (sItemTag == “Horse_6”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “dla_jousthorse1”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Blue & Gold Jousting Horse
///////////////////////////////////////////////////////////////////////////////
else if (sItemTag == “Horse_7”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “dla_jousthorse2”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Black & White Jousting Horse
///////////////////////////////////////////////////////////////////////////////
else if (sItemTag == “Horse_8”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “dla_jousthorse3”, lPc, TRUE);
/////////////////////////////////////// name the horse //////////////
SetName (oWyrmling, GetName(GetItemActivator()) + “'s " + " Horse”);
/////////////////////////////////////////////////////////////////////
if (GetIsObjectValid(oWyrmling))
{
AddHenchman(oPc, oWyrmling);
}/* end then (valid owyrmling) */
else
{
AssignCommand(oPc, ActionSpeakString("Invalid Horse"));
}/* end else (valid owyrmling) */
return;
}
///////////////////////////////////////////////////////////////////////////////
// Summon Red & Gold Jousting Horse
///////////////////////////////////////////////////////////////////////////////
else if (sItemTag == “Horse_9”)
{
object oPc = GetItemActivator();
location lPc = GetLocation(oPc);
location lWyrmling = GetItemActivatedTargetLocation();
object oWyrmling = CreateObject(OBJECT_TYPE_CREATURE, “dla_jousthorse4”, lPc, TRUE);