Files
HeroesStone_PRC8/_module/nss/mvi_cv_enter.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

188 lines
7.9 KiB
Plaintext

/*
This script controls any custom commands that
should be run upon entering an Area in the
module.
Each Area is specially tagged, and the script
runs special commands based on the last three
characters of the Area Tag.
*/
//:://////////////////////////////////////////////
//:: Created By : Mike Immordino
//:: Created On : December 20th, 2003
//::---------------------------------------------
//:: Modified By : Mike Immordino
//:: Modified On : 02-22-04
//:: Changes : added support for using 3
//:: character area numbers
//:://////////////////////////////////////////////
#include "mvi_inc_tile"
void DestroyDoor(object oDoor)
{
effect eDmg = EffectDamage(50);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,oDoor);
}
void main()
{
// make sure only PCs (not DMs) trigger this, and it only happens once per area
if ((GetIsPC(GetEnteringObject())) && (!(GetIsDM(GetEnteringObject()))) && (!(GetLocalInt(GetArea(OBJECT_SELF),"enter_fired") == 1)))
{
// get the last three characters of the Area ResRef and convert to integers
// need integer to be able to use a Switch() instead of multiple If's
// Area naming convention must be used for this to work
string sName = GetStringRight(GetTag(OBJECT_SELF),3);
int iArea = StringToInt(sName);
switch(iArea)
{
case 1:
{ break; }
case 2:
{ break; }
case 3: // Fort Sudenholm
{ effect eDmg = EffectDamage(50);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M03_to_M05_1"));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M03_to_M05_2"));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M03_to_M05_3"));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M03_to_M05_4"));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M05_Destroy_Me_1"));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M05_Destroy_Me_2"));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M05_Destroy_Me_3"));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M05_Destroy_Me_4"));
SendMessageToAllDMs("Party entering Fort Sudenholm.");
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
case 6: // Fens of Tor: Ruined Moathouse
{ effect eDmg = EffectDamage(50);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M006_DestroyMe"));
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
case 9: // Ruined Moathouse: Caves
{ effect eDmg = EffectDamage(50);
effect eStone = EffectPetrify();
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M09_Corpse1"));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M09_Corpse2"));
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eStone,GetObjectByTag("M009_Altar_1_Statue"));
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eStone,GetObjectByTag("M009_Altar_2_Statue"));
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eStone,GetObjectByTag("M009_Altar_3_Statue"));
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eStone,GetObjectByTag("M009_Altar_4_Statue"));
SetPlotFlag(GetObjectByTag("M009_Altar_1_Statue"),TRUE);
SetPlotFlag(GetObjectByTag("M009_Altar_2_Statue"),TRUE);
SetPlotFlag(GetObjectByTag("M009_Altar_3_Statue"),TRUE);
SetPlotFlag(GetObjectByTag("M009_Altar_4_Statue"),TRUE);
SendMessageToAllDMs("Party entering Moathouse Caves.");
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
case 22: // Temple Ruins: Tower
{ object oDoor = GetObjectByTag("M022_Destroy_Me");
DestroyDoor(oDoor);
oDoor = GetObjectByTag("M024_Destroy_Me");
DestroyDoor(oDoor);
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
case 30: // High Road: Caves
{ object oDoor1 = GetObjectByTag("M030_to_M683");
object oDoor2 = GetObjectByTag("M683_to_M030");
DestroyDoor(oDoor1);
DestroyDoor(oDoor2);
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
case 31: // Road to Sudenholm
{ effect eDmg = EffectDamage(50);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M031_Corpse1"));
break;
}
case 32: // Crossroads Inn
{ object oDoor = GetObjectByTag("M032s1_to_M032s2");
DestroyDoor(oDoor);
oDoor = GetObjectByTag("M032s2_to_M032s1");
DestroyDoor(oDoor);
oDoor = GetObjectByTag("M032i1_to_M032i2");
DestroyDoor(oDoor);
oDoor = GetObjectByTag("M032i2_to_M032i1");
DestroyDoor(oDoor);
oDoor = GetObjectByTag("M032h1_to_M032h2");
DestroyDoor(oDoor);
oDoor = GetObjectByTag("M032h2_to_M032h1");
DestroyDoor(oDoor);
AssignCommand(GetObjectByTag("M032_Commoner1"),ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS));
int idx = 0;
object oSitter = GetObjectByTag("M032_MaleSit",idx);
while (!(oSitter == OBJECT_INVALID))
{ AssignCommand(oSitter,ActionSit(GetNearestObjectByTag("SitOnMe")));
idx++;
oSitter = GetObjectByTag("M032_MaleSit",idx);
}
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
case 34: // Nulb: Crypt Level I
{ SetLocalInt(OBJECT_SELF,"mummy_trap",0);
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
case 35: // Nulb: Graveyard
{ object oDoor = GetObjectByTag("M035_to_M034a");
DestroyDoor(oDoor);
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
case 601: //Sunken Ruin: Level II
{ TLChangeAreaTiles(OBJECT_SELF,461,14,14,2.8f);
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
case 650: //Western Hommlet
{}
case 651: //Eastern Hommlet
{ ExploreAreaForPlayer(OBJECT_SELF,GetEnteringObject());
break;
}
case 666: //Castle Anthrax
{ TLChangeAreaTiles(OBJECT_SELF,401,2,2,2.2f);
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
case 674:
case 675:
case 676:
case 677:
case 678:
case 679: //Fens of Tor
{ TLChangeAreaTiles(OBJECT_SELF,461,8,8,1.7f);
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
case 681: //Fens of Tor: Sunken Ruin
{ TLChangeAreaTiles(OBJECT_SELF,461,14,14,1.7f);
effect eDmg = EffectDamage(50);
DestroyDoor(GetObjectByTag("M682a_to_M681"));
DestroyDoor(GetObjectByTag("M682b_to_M681"));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M681_Corpse1"));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M681_Corpse2"));
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
case 682: //Sunken Ruin: Level I
{ TLChangeAreaTiles(OBJECT_SELF,461,14,14,1.2f);
effect eDmg = EffectDamage(50);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M681_Corpse1"));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M681_Corpse2"));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,GetObjectByTag("M682_to_M601"));
SetLocalInt(OBJECT_SELF,"enter_fired",1);
break;
}
}
}
}