Battledale_PRC8/_module/nss/mod_activate.nss
Jaysyn904 e5b3f6ad61 Finished PRC8 integration
Finished PRC8 integration.  Moved creature abilities to top hak.  Setup tooling.  Created release archive
2024-03-12 21:27:23 -04:00

1486 lines
44 KiB
Plaintext

/////////////////////////////////////////////////////////////////////////////////////////
///Hardcore DMTool Composite
//Archaegeo 2002 June 24
//(Individual credits in other scripts)
// ** This script goes in the OnItemActivation event of your Module
// ** Properties. It checks to see if the item used is a DM Helper
// ** And if so, and the user isnt a DM, destroys it, otherwise it
// ** Starts the DM Helper working. "jth_dmwand" contains the actual
// ** code that controls the Helpers effects. If you update anything
// ** in it, you must recompile the calling dmw_<name> script to make
// ** the change take effect.
// 27 June - Modified to support player raise deads.
#include "jth_dmwand"
#include "nw_i0_plot"
#include "rpo_inc"
#include "jhr_i0_pipe"
#include "jw_custom_spells"
#include "jw_wolf_script"
#include "jw_zachs_scrolls"
#include "prc_class_const"
void main()
{
object oItem=GetItemActivated();
object oUser=GetItemActivator();
string sItemTag=GetTag(oItem);
object oTarget=GetItemActivatedTarget();
int nRandom;
int nSave=21;
object oActivator=oUser;
object oObject;
float fFacing;
location lLocation;
object oArea=GetArea(oUser);
object oScroll;
object oDragon=(GetObjectByTag("frost_xyrothon"));
object oHuman=GetObjectByTag("fr_frostheart");
object oDragonTri=(GetObjectByTag("tri_trichoynius"));
object oHumanTri=GetObjectByTag("tri_dragonashuma");
object oPlanarTri=(GetObjectByTag("tri_rakshasa"));
object oHuman2Tri=GetObjectByTag("tri_rakshasahuma");
////////dicegame
object oPC;
string sGameState;
int nDiceTotal;
int nScoreTotal;
string sShowDice;
string sFloatText;
string sGender;
int nFirstDie;
int nSecondDie;
int nThirdDie;
////////dicegame end
location lTargetLoc = GetItemActivatedTargetLocation();
string sTag=GetTag(oItem);
//IWD DM Wand
if((sItemTag=="fr_iwd_wand"))
{
AssignCommand(oUser, ActionStartConversation(oUser, "fr_iwd_wand", TRUE, FALSE));
}
else
//// DMFI tools
if (FindSubString(sTag,"dmfi")!=-1)
{
ExecuteScript("dmfi_activate", oUser);
}
else
// ioun stone
if (GetStringLeft(sItemTag,7)=="jw_ioun")
{
string sSpell=GetStringRight(sItemTag,3);
AssignCommand(oUser,ClearAllActions());
AssignCommand(oUser,(ActionCastSpellAtObject(StringToInt(sSpell),oUser,METAMAGIC_ANY,TRUE,0,PROJECTILE_PATH_TYPE_DEFAULT,TRUE)));
}
else
// dyes
if(sItemTag=="jw_lethcloth_dye")
{
SetLocalObject(oUser,"dye_con_obj",oItem);
AssignCommand(oUser,ClearAllActions());
AssignCommand(oUser, ActionStartConversation(oUser, "jw_lethcloth_con", TRUE));
return;
}
if(sItemTag=="jw_metdye")
{
SetLocalObject(oUser,"dye_con_obj",oItem);
AssignCommand(oUser,ClearAllActions());
AssignCommand(oUser, ActionStartConversation(oUser, "jw_metdye_con", TRUE));
return;
}
// Zach's scrolls of enchantment/
if(sItemTag=="jw_zach_1"||sItemTag=="jw_zach_2"||sItemTag=="jw_zach_3"||sItemTag=="jw_zach_4"||sItemTag=="jw_zach_5"||sItemTag=="jw_zach_6")
{
AssignCommand(oUser,ZachScroll(oItem,oUser,sItemTag,oTarget));
return;
}
else
// Potion of Cormanthor
if(sItemTag=="jw_harpot_7")
{
AssignCommand(oUser,cormpot());
return;
}
else
/// Viconius' glowing crystals
if(sItemTag=="fr_xyrothon_crystal_master")
{
string oFrostMessage = "You can feel that the crystal token you are carrying begins to radiate cold slightly, and if you inspect it, you notice it has begun to glow demandingly. This lasts for several minutes until it fades back to normal.";
string oFrostCrystal = "frost_portalkey_chosen";
object oFrostPC = GetFirstPC();
while (GetIsObjectValid(oFrostPC) == TRUE)
{
GetItemPossessedBy(oFrostPC, oFrostCrystal);
if((GetItemPossessedBy(oFrostPC, oFrostCrystal)) != OBJECT_INVALID)
{
SendMessageToPC(oFrostPC, oFrostMessage);
}
oFrostPC = GetNextPC();
}
}
else
/// Viconius' glowing crystals (second one)
if(sItemTag=="fr_xyrothon_crystal_master02")
{
string oFrostMessage = "You can feel that the crystal token you are carrying begins to radiate cold slightly, and if you inspect it, you notice it has begun to glow demandingly. This lasts for several minutes until it fades back to normal.";
string oFrostCrystal = "frost_portalkey_03";
object oFrostPC = GetFirstPC();
while (GetIsObjectValid(oFrostPC) == TRUE)
{
GetItemPossessedBy(oFrostPC, oFrostCrystal);
if((GetItemPossessedBy(oFrostPC, oFrostCrystal)) != OBJECT_INVALID)
{
SendMessageToPC(oFrostPC, oFrostMessage);
}
oFrostPC = GetNextPC();
}
}
else
//// the grenade weapons from SoU
if (GetStringLeft(sTag,12)=="X1_WMGRENADE")
{
ExecuteScript(sTag, OBJECT_SELF);
}
else
if(sItemTag=="jw_clear_water")
{
AssignCommand(oUser,PlayAnimation(ANIMATION_FIREFORGET_DRINK));
DelayCommand(0.3,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE),oUser));
SetLocalInt(oUser,"pure_water",2);
SendMessageToPC(oPC,"You feel a purity of body and mind.");
DelayCommand(600.0, SetLocalInt(oUser,"pure_water",1));
DelayCommand(600.0,SendMessageToPC(oPC,"You feel as if the effects of the pure water you drunk have worn off."));
}
else
//paxicon's cloning wand
if(sItemTag=="px_dmclonewand")
{
object oPaxCloned = GetItemActivatedTarget();
object oPaxMob = CopyObject(oPaxCloned,GetLocation(GetObjectByTag("px_clone_spawnpoint")));
object oInventory = GetFirstItemInInventory(OBJECT_SELF);
//int nGold = GetGold(oPaxMob); DOESNT WORK ON MODULE SCRIPTS, check lexicon
AssignCommand(oPaxMob, SetIsDestroyable(TRUE, FALSE, FALSE));
//TakeGoldFromCreature(nGold, oPaxMob, TRUE); DOESNT WORK ON MODULE SCRIPTS, check lexicon
object oPaxItem=GetFirstItemInInventory(oPaxMob);
object oPaxStrip;
while (GetIsObjectValid(oPaxItem))
{
oPaxStrip=oPaxItem;
DestroyObject(oPaxStrip);
oPaxItem=GetNextItemInInventory(oPaxMob);
}
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_ARMS, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_ARROWS, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_BELT, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_BOLTS, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_BOOTS, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_BULLETS, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_CARMOUR, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_CHEST, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_CLOAK, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_HEAD, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_LEFTRING, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_NECK, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPaxMob), FALSE);
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oPaxMob), FALSE);
object oTrigger = GetObjectByTag("fr_pax_clonegold");
ExecuteScript("fr_pax_clonegold", oTrigger);
}
else
// Paxicon's Teleport Wand
if(sItemTag=="px_teleport_wand")
{
AssignCommand(oUser,ActionStartConversation(oUser,"px_teleport_wand",TRUE,FALSE));
}
else
////videric's wolf item
if(sItemTag=="jw_wolf_item")
{
dowolf(oUser);
}
else
// medicine mag
if(sItemTag=="jw_med_bag")
{
AssignCommand(oUser,medicinebag(oTarget));
}
else
/// aaron's blinding dust
if(sItemTag=="ah_blind_dust")
{
if (GetIsObjectValid(oTarget))
{
AssignCommand(oUser,blindust(oTarget));
DestroyObject(oItem);
return;
}
else
{
SendMessageToPC(oUser,"Target this dust on a specific object or creature");
oScroll=CreateItemOnObject("ah_blind_dust",oUser,1);
SetIdentified(oScroll,1);
return;
}
}
else
// bard's songbird flute
if(sItemTag=="ah_songbird_call")
{
int iBard = GetLevelByClass(CLASS_TYPE_BARD, oPC) +
GetLevelByClass(CLASS_TYPE_HARPER, oPC) +
GetLevelByClass(CLASS_TYPE_DIRGESINGER, oPC) +
GetLevelByClass(CLASS_TYPE_DRAGONSONG_LYRIST, oPC) +
GetLevelByClass(CLASS_TYPE_SUBLIME_CHORD, oPC) +
GetLevelByClass(CLASS_TYPE_VIRTUOSO, oPC);
if (iBard < 5)
{
//DestroyObject(oItem);
SendMessageToPC(oPC,"That item may be used only by bards of at least fifth level.");
return;
}
if ((GetLocalInt(oUser,"hench")!=2))
{
AssignCommand(oUser,PlaySound("sdr_bardsong"));
vector Vec=Vector(IntToFloat(Random(20))-10.0,IntToFloat(Random(10))-10.0,IntToFloat(Random(10))-10.0);
lLocation=Location(GetArea(oUser),GetPosition(oUser)-Vec,1.0);
object oSongbird=CreateObject(OBJECT_TYPE_CREATURE,"ah_songbird",lLocation,TRUE);
AddHenchman(oUser,oSongbird);
SetLocalInt(oUser,"hench",2);
SetLocalObject(oUser,"oSongbird",oSongbird);
AssignCommand(oSongbird,ActionForceMoveToObject(oUser,TRUE,4.0));
AssignCommand(oSongbird,PlaySound("as_mg_frstmagic1"));
}
else
{
object oSongbird=GetLocalObject(oUser,"oSongbird");
if (GetIsObjectValid(oSongbird)&&!GetIsDead(oSongbird)&&(GetArea(oSongbird)==GetArea(oUser)))
{
AssignCommand(oUser,PlaySound("sdr_bardsong"));
vector Vec=Vector(IntToFloat(Random(20))-10.0,IntToFloat(Random(10))-10.0,IntToFloat(Random(10))-10.0);
lLocation=Location(GetArea(oUser),GetPosition(oUser)-Vec,1.0);
//AssignCommand(oDog,ActionJumpToLocation(lLocation));
AddHenchman(oUser,oSongbird);
SetLocalInt(oUser,"hench",2);
SetLocalObject(oUser,"oSongird",oSongbird);
//AssignCommand(oDog,ActionForceMoveToLocation(lLocation,TRUE,5.0));
AssignCommand(oSongbird,ActionForceMoveToObject(oUser,TRUE,4.0));
AssignCommand(oSongbird,PlaySound("sce_neutral"));
}
}
}
else
// elistrea item
if(sItemTag=="jw_elis_instr")
{
AssignCommand(oUser,regeninst());
DestroyObject(oItem);
return;
}
else
if(sItemTag=="gz_it_pkeg")
{
AssignCommand(oUser, ActionStartConversation(oUser, "jw_keggy_con", TRUE));
return;
}
else
if(sItemTag=="jw_dwarf_potion")
{
AssignCommand(oUser,dwarfire());
}
// garrote 1
else
if(sItemTag=="jw_garrote1")
{
if (GetIsObjectValid(oTarget)&&GetObjectType(oTarget)==OBJECT_TYPE_CREATURE)
{
AssignCommand(oUser,garrote(oTarget,3));
DestroyObject(oItem);
return;
}
else
{
SendMessageToPC(oUser,"Target this scroll on a specific creature");
oScroll=CreateItemOnObject("jw_garrote1",oUser,1);
SetIdentified(oScroll,1);
return;
}
}
// garrote 2
else
if(sItemTag=="jw_garrote2")
{
if (GetIsObjectValid(oTarget)&&GetObjectType(oTarget)==OBJECT_TYPE_CREATURE)
{
AssignCommand(oUser,garrote(oTarget,5));
DestroyObject(oItem);
return;
}
else
{
SendMessageToPC(oUser,"Target this scroll on a specific creature");
oScroll=CreateItemOnObject("jw_garrote2",oUser,1);
SetIdentified(oScroll,1);
return;
}
}
// garrote 3
else
if(sItemTag=="jw_garrote3")
{
if (GetIsObjectValid(oTarget)&&GetObjectType(oTarget)==OBJECT_TYPE_CREATURE)
{
AssignCommand(oUser,garrote(oTarget,7));
DestroyObject(oItem);
return;
}
else
{
SendMessageToPC(oUser,"Target this scroll on a specific creature");
oScroll=CreateItemOnObject("jw_garrote3",oUser,1);
SetIdentified(oScroll,1);
return;
}
}
// garrote 4
else
if(sItemTag=="jw_garrote4")
{
if (GetIsObjectValid(oTarget)&&GetObjectType(oTarget)==OBJECT_TYPE_CREATURE)
{
AssignCommand(oUser,garrote(oTarget,9));
DestroyObject(oItem);
return;
}
else
{
SendMessageToPC(oUser,"Target this scroll on a specific creature");
oScroll=CreateItemOnObject("jw_garrote4",oUser,1);
SetIdentified(oScroll,1);
return;
}
}
else
//DM helper
if(sItemTag=="jw_nores_wand")
{
if(GetIsDM(oActivator) != TRUE)
{
object oTest = GetFirstPC();
string sTestName = GetPCPlayerName(oActivator);
int nFound = FALSE;
while (GetIsObjectValid(oTest) && (! nFound))
{
if (GetPCPlayerName(oTest) == sTestName)
{
if(GetIsDM(oTest))
{
nFound = TRUE;
}
else
{
DestroyObject(oItem);
SendMessageToPC(oActivator,"You are mortal and this is not yours!");
return;
}
}
oTest=GetNextPC();
}
}
// get the wand's activator and target, put target info into local vars on activator
object oMyActivator = GetItemActivator();
object oMyTarget = GetItemActivatedTarget();
if (GetObjectType(oMyTarget)!=OBJECT_TYPE_CREATURE)
{
SendMessageToPC(oActivator,"You do not appear to have targetted a creature");
return;
}
SetLocalObject(oMyActivator, "norestarget", oMyTarget);
//Make the activator start a conversation with itself
AssignCommand(oMyActivator, ActionStartConversation(oMyActivator, "noreswand", TRUE));
return;
}
else
//dicebag
if (sItemTag == "nk_dice")
{
object oPC = oUser;
sGameState = GetLocalString(oPC, "NK_DICE_GAMESTATE");
nDiceTotal = GetLocalInt(oPC, "NK_DICE_DICETOTAL");
nScoreTotal = GetLocalInt(oPC, "NK_DICE_SCORETOTAL");
nFirstDie = d6(1);
nSecondDie = d6(1);
nThirdDie = d6(1);
if ((GetTag(oTarget)== "nk_dicetable") || (oTarget == oPC))
{
//game
if ((sGameState == "over") || (sGameState == ""))
{
//start new game
if (oTarget != oPC)
{
SetLocalString(oPC, "NK_DICE_GAMESTATE", "running");
SendMessageToPC(oPC, "You started a new game of dice.");
}
else if (oTarget == oPC)
{
SendMessageToPC(oPC, "Please select a dice table to start a new game, but target yourself later to actually roll the dice.");
}
}
else if (sGameState == "running")
{
if (GetGender(oPC) == GENDER_FEMALE)
{
sGender = "She";
}
else
{
sGender = "He";
}
//show dice
if (oTarget != oPC)
{
sShowDice = "*" + GetName(oPC) + " ends the game by uncovering the dice. "
+ sGender + " has a total dice score of " + IntToString(nDiceTotal)
+ " in round " + IntToString(nScoreTotal) + "*";
AssignCommand (oPC, (ActionSpeakString(sShowDice, TALKVOLUME_TALK)));
SetLocalString(oPC, "NK_DICE_GAMESTATE", "over");
SetLocalInt(oPC, "NK_DICE_DICETOTAL", 0);
SetLocalInt(oPC, "NK_DICE_SCORETOTAL", 0);
}
//roll dice
else if (oTarget == oPC)
{
//first round
if (nDiceTotal == 0)
{
nDiceTotal = nFirstDie + nSecondDie + nThirdDie;
nScoreTotal = 1;
//triple
if ((nFirstDie == nSecondDie) && (nSecondDie == nThirdDie))
{
sShowDice = "*" + GetName(oPC) + " quickly ends the game by rolling a triple of "
+ IntToString(nFirstDie) + "! " + sGender + " wins unless someone else rolls a higher triple in the their first round.*";
SetLocalString(oPC, "NK_DICE_GAMESTATE", "over");
SetLocalInt(oPC, "NK_DICE_DICETOTAL", 0);
SetLocalInt(oPC, "NK_DICE_SCORETOTAL", 0);
}
//normal
else
{
sShowDice = "*" + GetName(oPC) + " starts the first round by rolling three dice.*";
SendMessageToPC(oPC, "Your current total is " + IntToString(nDiceTotal) + ". To get a higher score you can roll another die in each round, but if you ever go over 17 you lose.");
SetLocalString(oPC, "NK_DICE_GAMESTATE", "running");
SetLocalInt(oPC, "NK_DICE_DICETOTAL", nDiceTotal);
SetLocalInt(oPC, "NK_DICE_SCORETOTAL", nScoreTotal);
}
AssignCommand (oPC, (ActionSpeakString(sShowDice, TALKVOLUME_TALK)));
}
else
{
nDiceTotal = nDiceTotal + nFirstDie;
nScoreTotal ++;
if (nDiceTotal > 17)
{
sShowDice = "*Loses the game by going above 17 in round " + IntToString(nScoreTotal) + ".*";
SetLocalString(oPC, "NK_DICE_GAMESTATE", "over");
SetLocalInt(oPC, "NK_DICE_DICETOTAL", 0);
SetLocalInt(oPC, "NK_DICE_SCORETOTAL", 0);
}
else
{
sShowDice = "*Rolls another die in round " + IntToString(nScoreTotal) + " and grins.*";
SetLocalString(oPC, "NK_DICE_GAMESTATE", "running");
SetLocalInt(oPC, "NK_DICE_DICETOTAL", nDiceTotal);
SetLocalInt(oPC, "NK_DICE_SCORETOTAL", nScoreTotal);
}
SendMessageToPC(oPC, "You roll a " + IntToString(nFirstDie) + " for a total of " + IntToString(nDiceTotal));
AssignCommand (oPC, (ActionSpeakString(sShowDice, TALKVOLUME_TALK)));
}
FloatingTextStringOnCreature ("*shakes the dice*", oPC, FALSE);
}
}
}
else
{
SendMessageToPC(oPC, "You must target a dice table in order to play.");
}
}
//dicebag end
else
if(sItemTag=="jw_spell_acid")
{
AssignCommand(oUser,acidstorm(lTargetLoc));
DestroyObject(oItem);
return;
}
if(sItemTag=="jw_spell_antim")
{
AssignCommand(oUser,antimagic());
DestroyObject(oItem);
return;
}
if(sItemTag=="jw_spell_azuths")
{
AssignCommand(oUser,azuths());
DestroyObject(oItem);
return;
}
if(sItemTag=="jw_spell_ball")
{
AssignCommand(oUser,balllight(lTargetLoc));
DestroyObject(oItem);
return;
}
if(sItemTag=="jw_spell_blackb")
{
AssignCommand(oUser,blackblade(lTargetLoc));
DestroyObject(oItem);
return;
}
if(sItemTag=="jw_spell_bombard")
{
if (GetIsObjectValid(oTarget))
{
AssignCommand(oUser,bombard(oTarget));
DestroyObject(oItem);
return;
}
else
{
SendMessageToPC(oUser,"Target this scroll on a specific object or creature");
oScroll=CreateItemOnObject("jw_spell_bombard",oUser,1);
SetIdentified(oScroll,1);
return;
}
}
if(sItemTag=="jw_spell_castst")
{
AssignCommand(oUser,caststone(lTargetLoc));
DestroyObject(oItem);
return;
}
if(sItemTag=="jw_pipes_harm")
{
AssignCommand(oUser,pipesharm());
DestroyObject(oItem);
return;
}
if(sItemTag=="jw_pal_sym")
{
if (GetLevelByClass(CLASS_TYPE_PALADIN,oUser)<1)
{
SendMessageToPC(oUser,"Only a paladin may use the holy symbol");
DestroyObject(oItem);
return;
}
else if (GetAlignmentGoodEvil(oUser)!=ALIGNMENT_GOOD)
{
SendMessageToPC(oUser,"A fallen paladin may not use the holy symbol");
return;
}
else
{
AssignCommand(oUser,palsym());
return;
}
}
if(sItemTag=="jw_spell_deathd")
{
AssignCommand(oUser,deathdragon());
DestroyObject(oItem);
return;
}
if(sItemTag=="jw_bard_dirge")
{
AssignCommand(oUser,dirge());
DestroyObject(oItem);
return;
}
if(sItemTag=="jw_spell_casca")
{
if (GetIsObjectValid(oTarget))
{
AssignCommand(oUser,cascade(oTarget));
DestroyObject(oItem);
return;
}
else
{
SendMessageToPC(oUser,"Target this scroll on a specific object or creature");
oScroll=CreateItemOnObject("jw_spell_casca",oUser,1);
SetIdentified(oScroll,1);
return;
}
}
if(sItemTag=="jw_barb_force")
{
AssignCommand(oUser,forcewave());
DestroyObject(oItem);
return;
}
if(sItemTag=="jw_barb_forceb")
{
AssignCommand(oUser,forcewave());
return;
}
if(sItemTag=="jw_horn_valk")
{
AssignCommand(oUser,summonvalk(lTargetLoc));
DestroyObject(oItem);
return;
}
if(sItemTag=="hc_acidflask" ||
sItemTag=="hc_alchfire" ||
sItemTag=="hc_holywater" ||
sItemTag=="hc_tangle" ||
sItemTag=="hc_thunder" ||
sItemTag=="hc_oilflask")
{
SetLocalObject(oUser,"GRENADE",oItem);
SetLocalObject(oUser,"GRENADETARGET",oTarget);
ExecuteScript("hc_grenade", oUser);
}
if(GetTag(oItem)=="trackertool" &&
GetLevelByClass(CLASS_TYPE_RANGER, oUser) > 0)
{
ExecuteScript("hc_track_start", oUser);
//postEvent();
return;
}
if(GetTag(oItem)=="SkillCheckRod")
{
// Test to make sure the activator is a DM, or is a DM
// controlling a creature.
if(GetIsDM(oActivator) != TRUE)
{
object oTest = GetFirstPC();
string sTestName = GetPCPlayerName(oActivator);
int nFound = FALSE;
while (GetIsObjectValid(oTest) && (! nFound))
{
if (GetPCPlayerName(oTest) == sTestName)
{
if(GetIsDM(oTest))
{
nFound = TRUE;
}
else
{
DestroyObject(oItem);
SendMessageToPC(oActivator,"You are mortal and this is not yours!");
return;
}
}
oTest=GetNextPC();
}
}
// get the wand's activator and target, put target info into local vars on activator
object oMyActivator = GetItemActivator();
object oMyTarget = GetItemActivatedTarget();
SetLocalObject(oMyActivator, "skillrodtarget", oMyTarget);
//Make the activator start a conversation with itself
AssignCommand(oMyActivator, ActionStartConversation(oMyActivator, "sk_rod_conv", TRUE));
return;
}
if(GetTag(oItem)=="jw_der_whistle")
{
if ((GetLocalInt(oUser,"derhench")!=2))
{
AssignCommand(oUser,PlaySound("as_cv_eulpipe1"));
vector Vec=Vector(IntToFloat(Random(20))-10.0,IntToFloat(Random(10))-10.0,IntToFloat(Random(10))-10.0);
lLocation=Location(GetArea(oUser),GetPosition(oUser)-Vec,1.0);
object oDog=CreateObject(OBJECT_TYPE_CREATURE,"jw_der_dog",lLocation,TRUE);
AddHenchman(oUser,oDog);
SetLocalInt(oUser,"derhench",2);
SetLocalObject(oUser,"oDog",oDog);
AssignCommand(oDog,ActionForceMoveToObject(oUser,TRUE,4.0));
AssignCommand(oDog,PlaySound("as_an_dogbark7"));
}
else
{
object oDog=GetLocalObject(oUser,"oDog");
if (GetIsObjectValid(oDog)&&!GetIsDead(oDog)&&(GetArea(oDog)==GetArea(oUser)))
{
AssignCommand(oUser,PlaySound("as_cv_eulpipe1"));
vector Vec=Vector(IntToFloat(Random(20))-10.0,IntToFloat(Random(10))-10.0,IntToFloat(Random(10))-10.0);
lLocation=Location(GetArea(oUser),GetPosition(oUser)-Vec,1.0);
//AssignCommand(oDog,ActionJumpToLocation(lLocation));
AddHenchman(oUser,oDog);
SetLocalInt(oUser,"derhench",2);
SetLocalObject(oUser,"oDog",oDog);
//AssignCommand(oDog,ActionForceMoveToLocation(lLocation,TRUE,5.0));
AssignCommand(oDog,ActionForceMoveToObject(oUser,TRUE,4.0));
AssignCommand(oDog,PlaySound("as_an_dogbark7"));
}
}
}
if(GetTag(oItem)=="jw_dog_whistle")
{
if ((GetLocalInt(oUser,"hench")!=2))
{
AssignCommand(oUser,PlaySound("as_cv_eulpipe1"));
vector Vec=Vector(IntToFloat(Random(20))-10.0,IntToFloat(Random(10))-10.0,IntToFloat(Random(10))-10.0);
lLocation=Location(GetArea(oUser),GetPosition(oUser)-Vec,1.0);
object oDog=CreateObject(OBJECT_TYPE_CREATURE,"jw_rany",lLocation,TRUE);
AddHenchman(oUser,oDog);
SetLocalInt(oUser,"hench",2);
SetLocalObject(oUser,"oDog",oDog);
AssignCommand(oDog,ActionForceMoveToObject(oUser,TRUE,4.0));
AssignCommand(oDog,PlaySound("as_an_dogbark7"));
}
else
{
object oDog=GetLocalObject(oUser,"oDog");
if (GetIsObjectValid(oDog)&&!GetIsDead(oDog)&&(GetArea(oDog)==GetArea(oUser)))
{
AssignCommand(oUser,PlaySound("as_cv_eulpipe1"));
vector Vec=Vector(IntToFloat(Random(20))-10.0,IntToFloat(Random(10))-10.0,IntToFloat(Random(10))-10.0);
lLocation=Location(GetArea(oUser),GetPosition(oUser)-Vec,1.0);
//AssignCommand(oDog,ActionJumpToLocation(lLocation));
AddHenchman(oUser,oDog);
SetLocalInt(oUser,"hench",2);
SetLocalObject(oUser,"oDog",oDog);
//AssignCommand(oDog,ActionForceMoveToLocation(lLocation,TRUE,5.0));
AssignCommand(oDog,ActionForceMoveToObject(oUser,TRUE,4.0));
AssignCommand(oDog,PlaySound("as_an_dogbark7"));
}
}
}
if(GetTag(oItem)=="jw_huan_whistle")
{
if ((GetLocalInt(oUser,"hench")!=2))
{
AssignCommand(oUser,PlaySound("as_cv_eulpipe1"));
vector Vec=Vector(IntToFloat(Random(20))-10.0,IntToFloat(Random(10))-10.0,IntToFloat(Random(10))-10.0);
lLocation=Location(GetArea(oUser),GetPosition(oUser)-Vec,1.0);
object oDog=CreateObject(OBJECT_TYPE_CREATURE,"jw_huan",lLocation,TRUE);
AddHenchman(oUser,oDog);
SetLocalInt(oUser,"hench",2);
SetLocalObject(oUser,"oDog",oDog);
AssignCommand(oDog,ActionForceMoveToObject(oUser,TRUE,4.0));
AssignCommand(oDog,PlaySound("as_an_dogbark7"));
}
else
{
object oDog=GetLocalObject(oUser,"oDog");
if (GetIsObjectValid(oDog)&&!GetIsDead(oDog)&&(GetArea(oDog)==GetArea(oUser)))
{
AssignCommand(oUser,PlaySound("as_cv_eulpipe1"));
vector Vec=Vector(IntToFloat(Random(20))-10.0,IntToFloat(Random(10))-10.0,IntToFloat(Random(10))-10.0);
lLocation=Location(GetArea(oUser),GetPosition(oUser)-Vec,1.0);
//AssignCommand(oDog,ActionJumpToLocation(lLocation));
AddHenchman(oUser,oDog);
SetLocalInt(oUser,"hench",2);
SetLocalObject(oUser,"oDog",oDog);
//AssignCommand(oDog,ActionForceMoveToLocation(lLocation,TRUE,5.0));
AssignCommand(oDog,ActionForceMoveToObject(oUser,TRUE,4.0));
AssignCommand(oDog,PlaySound("as_an_dogbark7"));
}
}
}
if(GetTag(oItem)=="jw_zen_magscroll")
{
if(GetTag(oTarget)!="jw_silver_object")
{
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_DISPEL),GetLocation(oTarget));
FloatingTextStringOnCreature("*No effect*",oUser);
}
else
{
oObject=GetObjectByTag("jw_silver_trap");
SetLocked(oTarget,0);
AssignCommand(oTarget,PlayAnimation(ANIMATION_PLACEABLE_OPEN));
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_DISPEL_DISJUNCTION),GetLocation(oTarget));
SetPlotFlag(oObject,0);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDeath(FALSE,FALSE),oObject);
}
}
if(GetTag(oItem)=="WandOfFX")
{
// get the wand's activator and target, put target info into local vars on activator
SetLocalObject(oUser, "FXWandTarget", oMyTarget);
SetLocalLocation(oUser, "FXWandLoc", lTargetLoc);
object oTest=GetFirstPC();
string sTestName = GetPCPlayerName(oUser);
// Test to make sure the activator is a DM, or is a DM
// controlling a creature.
while (GetIsObjectValid(oTest) == TRUE)
{
if (GetPCPlayerName(oTest) == sTestName && GetIsDM(oTest) == FALSE)
{
DestroyObject(oItem);
SendMessageToPC(oActivator,"You are mortal and this is not yours!");
return;
}
oTest=GetNextPC();
}
//Make the activator start a conversation with itself
AssignCommand(oUser, ActionStartConversation(oUser, "fxwand", TRUE));
return;
}
if (GetTag(oItem) == "jw_vamp_stake")
{
if ((GetTag(oTarget)=="jw_cvamp1_shad_coffin")||(GetTag(oTarget)=="jw_cvamp2_shad_coffin")||(GetTag(oTarget)=="jw_cvamp3_shad_coffin"))
{
if (GetIsOpen(oTarget))
{
if (GetLocalInt(oTarget,"vampin")==2)
{
if (GetDistanceBetween(oUser,oTarget)>3.0)
{
SendMessageToPC(oUser,"You are to far away to use the stake on the coffin");
}
else
{
SignalEvent(oTarget,EventUserDefined(60));
DestroyObject(oItem);
}
}
else
{
AssignCommand(oTarget,SpeakString("There is nothing in this coffin to destroy"));
}
}
else
{
SendMessageToPC(oUser,"You must open the coffin before using the stake");
}
}
else
{
SendMessageToPC(oUser,"The stake is no use on this particular object");
}
}
//smoking pipe
if (GetTag(oItem) == "jhr_it_pipe")
{
SmokePipe(oUser);
}
//logs of wood
if (GetTag(oItem) == "jw_logs")
{
object oMyActivator = GetItemActivator();
AssignCommand(oMyActivator, ActionStartConversation(oUser, "nk_cv_wood", TRUE));
}
// Paxi's Polymorph Wand
if(GetTag(oItem)==("px_polymorph_wand"))
{
// Test to make sure the activator is a DM, or is a DM
// controlling a creature.
if(GetIsDM(oActivator) != TRUE)
{
object oTest = GetFirstPC();
string sTestName = GetPCPlayerName(oActivator);
int nFound = FALSE;
while (GetIsObjectValid(oTest) && (! nFound))
{
if (GetPCPlayerName(oTest) == sTestName)
{
if(GetIsDM(oTest))
{
nFound = TRUE;
}
else
{
DestroyObject(oItem);
SendMessageToPC(oActivator,"You are mortal and this is not yours!");
return;
}
}
oTest=GetNextPC();
}
}
// get the wand's activator and target, put target info into local vars on activator
object oMyActivator = GetItemActivator();
object oMyTarget = GetItemActivatedTarget();
SetLocalObject(oMyActivator, "polymorphtarget", oMyTarget);
//Make the activator start a conversation with itself
AssignCommand(oMyActivator, ActionStartConversation(oMyActivator, "px_polymorphwand", TRUE));
return;
}
//DM helper
if(GetTag(oItem)=="DMsHelper")
{
if(GetIsDM(oActivator) != TRUE)
{
object oTest = GetFirstPC();
string sTestName = GetPCPlayerName(oActivator);
int nFound = FALSE;
while (GetIsObjectValid(oTest) && (! nFound))
{
if (GetPCPlayerName(oTest) == sTestName)
{
if(GetIsDM(oTest))
{
nFound = TRUE;
}
else
{
DestroyObject(oItem);
SendMessageToPC(oActivator,"You are mortal and this is not yours!");
return;
}
}
oTest=GetNextPC();
}
}
// get the wand's activator and target, put target info into local vars on activator
object oMyActivator = GetItemActivator();
object oMyTarget = GetItemActivatedTarget();
SetLocalObject(oMyActivator, "dmwandtarget", oMyTarget);
location lMyLoc = GetItemActivatedTargetLocation();
SetLocalLocation(oMyActivator, "dmwandloc", lMyLoc);
//Make the activator start a conversation with itself
AssignCommand(oMyActivator, ActionStartConversation(oMyActivator, "dmwand", TRUE));
return;
}
if(sItemTag=="PlayerCorpse")
{
object oCleric=GetItemActivatedTarget();
object oRespawner=GetLocalObject(oItem, "Owner");
int iLevel=GetLevelByClass(CLASS_TYPE_CLERIC, oCleric);
if(GetIsObjectValid(oRespawner)==FALSE)
{
SendMessageToPC(oUser,"That person is not in our realm.");
return;
}
if(iLevel < 10)
{
SendMessageToPC(oUser,"This cleric is not powerful enough to help you.");
return;
}
int iRezAmount = 50*iLevel;
if(GetGold(oUser) < iRezAmount)
{
SendMessageToPC(oUser,"You do not have enough money, the cost is: "+
IntToString(iRezAmount)+" gps.");
return;
}
TakeGoldFromCreature(iRezAmount, oUser, TRUE);
SendMessageToPC(oUser, "The cleric accepts your donation and casts a spell.");
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
RemoveEffects(oRespawner);
DestroyObject(oItem);
}
if (sItemTag == "Bedroll")
{
object oBedroll = GetLocalObject(oUser,"Bedroll");
if (GetIsObjectValid(oBedroll))
DestroyObject(oBedroll);
else
{
oBedroll = CreateObject(OBJECT_TYPE_PLACEABLE, "bedrolls001", GetLocation(oUser));
AssignCommand(oUser, PlayAnimation(ANIMATION_LOOPING_SIT_CROSS,1.0f, 3600.0f));
SetLocalObject(oUser,"Bedroll",oBedroll);
}
}
if (sItemTag == "CampfireKit")
{
object oCampfire;
oCampfire = GetLocalObject(oItem, "Campfire");
if (GetIsObjectValid(oCampfire))
DestroyObject(oCampfire);
else
{
AssignCommand(oUser, ClearAllActions());
AssignCommand(oUser, PlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0f, 3.0f));
location lCampfire = GetLocFromFacingByDistance(oUser, 1.0f);
oCampfire = CreateObject(OBJECT_TYPE_PLACEABLE, "campfrwspit001", lCampfire);
SetLocalObject(oItem, "Campfire", oCampfire);
}
}
if(sItemTag=="jw_yasdin_drugs")
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectDazed(),oUser,30.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED),oUser,3.0);
FloatingTextStringOnCreature("Ahh . . . feels good",oUser);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_WISDOM,4),oUser,300.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_CHARISMA,4),oUser,300.0);
SendMessageToPC(oUser,"You feel as if you can't get enough of that");
}
if(sItemTag=="jw_kaim")
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectDazed(),oUser,10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED),oUser,3.0);
FloatingTextStringOnCreature("Ahh . . .",oUser);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_WISDOM,1),oUser,300.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_STRENGTH,1),oUser,300.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityIncrease(ABILITY_CHARISMA,1),oUser,20.0);
}
if(sItemTag=="jw_bard_lute")
{
///ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_BARD_SONG),oUser,1.0);
nRandom=Random(2);
if (nRandom==1)
{
AssignCommand(oUser,PlaySound("as_cv_lute1"));
}
else
{
AssignCommand(oUser,PlaySound("as_cv_lute1b"));
}
}
if(sItemTag=="jw_bard_flute")
{
//ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_BARD_SONG),oUser,1.0);
nRandom=Random(2);
if (nRandom==1)
{
AssignCommand(oUser,PlaySound("as_cv_flute1"));
}
else
{
AssignCommand(oUser,PlaySound("as_cv_flute2"));
}
}
if(sItemTag=="jw_haunspeir_drugs")
{
AssignCommand(oUser,PlayAnimation(ANIMATION_FIREFORGET_DRINK));
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityIncrease(ABILITY_STRENGTH,1),oUser,600.0);
}
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_INTELLIGENCE,2),oUser,600.0);
}
}
if(sItemTag=="jw_jhulid_drugs")
{
AssignCommand(oUser,PlayAnimation(ANIMATION_FIREFORGET_DRINK));
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityIncrease(ABILITY_CONSTITUTION,2),oUser,600.0);
}
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_DEXTERITY,2),oUser,600.0);
}
}
if(sItemTag=="jw_kammarth_drugs")
{
AssignCommand(oUser,PlayAnimation(ANIMATION_FIREFORGET_DRINK));
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityIncrease(ABILITY_WISDOM,2),oUser,600.0);
}
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_STRENGTH,2),oUser,600.0);
}
}
if(sItemTag=="jw_katakuda_drugs")
{
AssignCommand(oUser,PlayAnimation(ANIMATION_FIREFORGET_DRINK));
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityIncrease(ABILITY_CHARISMA,2),oUser,600.0);
}
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_WISDOM,2),oUser,600.0);
}
}
if(sItemTag=="jw_mordayn_drugs")
{
AssignCommand(oUser,PlayAnimation(ANIMATION_FIREFORGET_DRINK));
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityIncrease(ABILITY_INTELLIGENCE,2),oUser,600.0);
}
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_DEXTERITY,2),oUser,600.0);
}
}
if(sItemTag=="jw_oruighen_drugs")
{
AssignCommand(oUser,PlayAnimation(ANIMATION_FIREFORGET_DRINK));
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityIncrease(ABILITY_DEXTERITY,2),oUser,600.0);
}
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_CONSTITUTION,2),oUser,600.0);
}
}
if(sItemTag=="jw_panaeolo_drugs")
{
AssignCommand(oUser,PlayAnimation(ANIMATION_FIREFORGET_DRINK));
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityIncrease(ABILITY_INTELLIGENCE,1),oUser,600.0);
}
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_CHARISMA,2),oUser,600.0);
}
}
if(sItemTag=="jw_rhul_drugs")
{
AssignCommand(oUser,PlayAnimation(ANIMATION_FIREFORGET_DRINK));
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityIncrease(ABILITY_STRENGTH,2),oUser,600.0);
}
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_CONSTITUTION,2),oUser,600.0);
}
}
if(sItemTag=="jw_ziran_drugs")
{
AssignCommand(oUser,PlayAnimation(ANIMATION_FIREFORGET_DRINK));
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityIncrease(ABILITY_CONSTITUTION,4),oUser,600.0);
}
if (FortitudeSave(oUser,nSave,SAVING_THROW_TYPE_POISON)==0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityDecrease(ABILITY_DEXTERITY,4),oUser,600.0);
}
}
if(sItemTag=="jw_map")
{
ExploreAreaForPlayer(GetObjectByTag("village"),oUser);
}
if((GetTag(oItem)=="jw_emotewand") || (GetTag(oItem)=="nk_emote_light"))
{
AssignCommand(oUser, ActionStartConversation(oUser, "emotewand", TRUE));
}
if(sItemTag=="jw_panther_potio")
{
oObject=GetObjectByTag("jw_troll_plate_dr");
AssignCommand(oObject,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_POLYMORPH),oUser,60.0));
AssignCommand(oObject, ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectPolymorph(POLYMORPH_TYPE_PANTHER),oUser,60.0));
AssignCommand(oObject,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(6),oUser,60.0));
}
if(sItemTag=="jw_dragon_potion")
{
AssignCommand(oUser,PlayAnimation(ANIMATION_LOOPING_DEAD_FRONT,0.5,5.0));
AssignCommand(oUser,PlayVoiceChat(VOICE_CHAT_PAIN3));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectAbilityIncrease(ABILITY_STRENGTH,2),oUser,3600.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY),oUser,3.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectSavingThrowIncrease(SAVING_THROW_ALL,1,SAVING_THROW_TYPE_ALL),oUser,3600.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectImmunity(IMMUNITY_TYPE_NEGATIVE_LEVEL),oUser,3600.0);
}
if(sItemTag=="jw_frost_device")
{
if (oArea==GetArea(oDragon))
{
fFacing=GetFacing(oDragon);
lLocation=GetLocation(oDragon);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_IMP_POLYMORPH),lLocation,1.0);
AssignCommand(oDragon,JumpToObject(GetWaypointByTag("jw_frost_wp")));
AssignCommand(oHuman,JumpToLocation(lLocation));
AssignCommand(oHuman,SetFacing(fFacing));
return;
}
if (oArea==GetArea(oHuman))
{
fFacing=GetFacing(oHuman);
lLocation=GetLocation(oHuman);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_IMP_POLYMORPH),lLocation,1.0);
AssignCommand(oHuman,JumpToObject(GetWaypointByTag("jw_frost_wp")));
AssignCommand(oDragon,JumpToLocation(lLocation));
AssignCommand(oDragon,SetFacing(fFacing));
return;
}
}
if(sItemTag=="tri_dm_device01")
{
if (oArea==GetArea(oDragonTri))
{
fFacing=GetFacing(oDragonTri);
lLocation=GetLocation(oDragonTri);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_IMP_POLYMORPH),lLocation,1.0);
AssignCommand(oDragonTri,JumpToObject(GetWaypointByTag("tri_dragon_wp")));
AssignCommand(oHumanTri,JumpToLocation(lLocation));
AssignCommand(oHumanTri,SetFacing(fFacing));
return;
}
if (oArea==GetArea(oHumanTri))
{
fFacing=GetFacing(oHumanTri);
lLocation=GetLocation(oHumanTri);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_IMP_POLYMORPH),lLocation,1.0);
AssignCommand(oHumanTri,JumpToObject(GetWaypointByTag("tri_dragon_wp")));
AssignCommand(oDragonTri,JumpToLocation(lLocation));
AssignCommand(oDragonTri,SetFacing(fFacing));
return;
}
}
if(sItemTag=="tri_dm_device02")
{
if (oArea==GetArea(oPlanarTri))
{
fFacing=GetFacing(oPlanarTri);
lLocation=GetLocation(oPlanarTri);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_IMP_POLYMORPH),lLocation,1.0);
AssignCommand(oPlanarTri,JumpToObject(GetWaypointByTag("tri_planar_wp")));
AssignCommand(oHuman2Tri,JumpToLocation(lLocation));
AssignCommand(oHuman2Tri,SetFacing(fFacing));
return;
}
if (oArea==GetArea(oHuman2Tri))
{
fFacing=GetFacing(oHuman2Tri);
lLocation=GetLocation(oHuman2Tri);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_IMP_POLYMORPH),lLocation,1.0);
AssignCommand(oHuman2Tri,JumpToObject(GetWaypointByTag("tri_planar_wp")));
AssignCommand(oPlanarTri,JumpToLocation(lLocation));
AssignCommand(oPlanarTri,SetFacing(fFacing));
return;
}
}
}