Initial Upload
Initial Upload
This commit is contained in:
164
_module/nss/m_onactivate.nss
Normal file
164
_module/nss/m_onactivate.nss
Normal file
@@ -0,0 +1,164 @@
|
||||
#include "hal_wolf_inc"
|
||||
#include "areascan_inc"
|
||||
#include "areahandler_inc"
|
||||
#include "mooooo_inc"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oItem;
|
||||
object oActivator;
|
||||
string sItemTag;
|
||||
string sAccount;
|
||||
object oMod = GetModule();
|
||||
|
||||
oItem = GetItemActivated();
|
||||
oActivator = GetItemActivator();
|
||||
sItemTag = GetTag(oItem);
|
||||
string sArea = GetTag(GetArea(oActivator));
|
||||
|
||||
/*--------------------------*/
|
||||
/* Area Scanner Wand */
|
||||
/*--------------------------*/
|
||||
if((sItemTag == "DMsAreaScanner") && GetIsDM(oActivator))
|
||||
{
|
||||
if(SetupAreaScanner(oActivator))
|
||||
AssignCommand(oActivator, ActionStartConversation(oActivator, "areascanner", TRUE));
|
||||
return;
|
||||
}
|
||||
|
||||
/*--------------------------*/
|
||||
/* DM's Mooooo rod */
|
||||
/*--------------------------*/
|
||||
if((GetTag(oItem) == "mooooo") && GetIsDM(oActivator))
|
||||
{
|
||||
object oTarget = GetItemActivatedTarget();
|
||||
if(oTarget != OBJECT_INVALID && GetIsPC(oTarget) && !GetIsDM(oTarget))
|
||||
{
|
||||
if(!GetLocalInt(oTarget, "is_cow"))
|
||||
{
|
||||
TurnIntoCow(oTarget);
|
||||
DelayCommand(4.0f, ExecuteScript("mooooo", oTarget));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*--------------------------*/
|
||||
/* Emote Wand */
|
||||
/*--------------------------*/
|
||||
if(sItemTag =="EmoteWand")
|
||||
{
|
||||
AssignCommand(oActivator, ActionStartConversation(oActivator, "emotewand", TRUE));
|
||||
return;
|
||||
}
|
||||
|
||||
/*--------------------------*/
|
||||
/* Final Legend Reward */
|
||||
/*--------------------------*/
|
||||
if (GetSubString(sItemTag,0,13) == "FinalLegendof" ||
|
||||
sItemTag == "elv_finallegend" )
|
||||
{
|
||||
if (sArea != "WelcomeToLoD")
|
||||
{
|
||||
AssignCommand(oActivator, ActionStartConversation(oActivator, "finallegend", TRUE));
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageToPC(oActivator, "You can't use Final Legend in this area...");
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------*/
|
||||
/* Wand for the portals */
|
||||
/*--------------------------*/
|
||||
// variable init
|
||||
if(sItemTag == "magicalportal")
|
||||
{
|
||||
if (sArea != "DungeonofDoom" && sArea != "DeadEnd" && sArea != "WelcomeToLoD")
|
||||
{ // checks if it's the town portal scroll that was used
|
||||
location lLoc = GetItemActivatedTargetLocation(); // sets the location the scroll was casted at
|
||||
// Effects start
|
||||
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD, FALSE);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, lLoc, 6.0);
|
||||
// Effects stop
|
||||
CreateObject(OBJECT_TYPE_PLACEABLE,"magicalportal",lLoc,TRUE); // creates the actual portal
|
||||
SetLocalLocation(oActivator, "Owner", GetItemActivatedTargetLocation()); // stores the location variable in the PC itself
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageToPC(oActivator, "You can't use a teleport rod here.");
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------*/
|
||||
/* FishingBait */
|
||||
/*--------------------------*/
|
||||
if( sItemTag == "TsFishingBait" && GetArea(oActivator) != GetArea(GetWaypointByTag("TsFishSuccessWell")) && GetArea(oActivator) != GetArea(GetWaypointByTag("TsFishSuccessOasis")))
|
||||
{
|
||||
ExecuteScript( "ts_fishing", oItem );
|
||||
}
|
||||
/*------------------------------*/
|
||||
/* FishingBaitWellofRiches */
|
||||
/*------------------------------*/
|
||||
else if( (sItemTag == "TsFishingBait") && (GetArea(oActivator) == GetArea(GetWaypointByTag("TsFishSuccessWell")))) {
|
||||
ExecuteScript( "ts_fishingwell", oItem );
|
||||
}
|
||||
/*--------------------------*/
|
||||
/* FishingBaitOasis */
|
||||
/*--------------------------*/
|
||||
else if( (sItemTag == "TsFishingBait") && (GetArea(oActivator) == GetArea(GetWaypointByTag("TsFishSuccessOasis")))) {
|
||||
ExecuteScript( "ts_fishingoasis", oItem );
|
||||
}
|
||||
|
||||
|
||||
//:://////////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////////
|
||||
// //
|
||||
// All items after here can only be used by DMs //
|
||||
// //
|
||||
//:://////////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////////
|
||||
|
||||
if (GetLocalInt(oActivator, "IsDm") == FALSE){return;}
|
||||
|
||||
/*--------------------------*/
|
||||
/* Wolfman rod */
|
||||
/*--------------------------*/
|
||||
if(GetTag(oItem) == "LycoRod")
|
||||
{
|
||||
object oTarget = GetItemActivatedTarget();
|
||||
if(oTarget != OBJECT_INVALID && GetIsPC(oTarget))
|
||||
{
|
||||
int bIsWerewolf = GetLocalInt(oTarget, "is_werewolf");
|
||||
if(!bIsWerewolf)
|
||||
{
|
||||
SetLocalInt(oTarget, "is_werewolf", TRUE);
|
||||
RemoveFromParty(oTarget);
|
||||
AssignCommand(oTarget, ClearAllActions(TRUE));
|
||||
AssignCommand (oTarget, ActionSpeakString("AHHH, Help me!"));
|
||||
DelayCommand(2.5f, AssignCommand(oTarget, ActionSpeakString("I'm changing!!!")));
|
||||
DelayCommand(4.0f, TurnIntoWolf(oTarget));
|
||||
DelayCommand(4.0f, ExecuteScript("hal_attacknearpc", oTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------*/
|
||||
/* Wand to refresh database */
|
||||
/*--------------------------*/
|
||||
if(sItemTag == "ForgeDataRefresh")
|
||||
{
|
||||
AssignCommand(oActivator, ActionStartConversation(oActivator,"sd_db_refresh", TRUE, TRUE));
|
||||
}
|
||||
|
||||
ExecuteScript("dmfi_activate", oActivator);
|
||||
ExecuteScript("dmfxew_activate", oActivator);
|
||||
|
||||
/*--------------------------*/
|
||||
/* Wand of Destruction */
|
||||
/*--------------------------*/
|
||||
if(sItemTag == "WandofDestruction")
|
||||
{
|
||||
ExecuteScript("phs_wndestr_act", oActivator);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user