Battledale_PRC8/_module/nss/fr_iwd_uz_portal.nss
Jaysyn904 7b9e44ebbb Initial upload
Initial upload.  PRC8 has been added.  Module compiles, PRC's default AI & treasure scripts have been integrated.  Started work on top hak for SLA / Ability / Scripting modifications.
2024-03-11 23:44:08 -04:00

161 lines
6.6 KiB
Plaintext

void main()
{
object oTower = GetObjectByTag("fr_iwd_tower_ke");
object oHand = OBJECT_SELF;
object oAaShards = GetItemPossessedBy(oHand, "fr_iwd_animar_ke");
int iSX = 0;
string sDown = "[The Enchanted Gemstones are consumed, the portal will not stay open for long.]";
string sUp = "[The Runestone is no longer used by the hand, it can be removed now.]";
if(GetLocalInt(oHand, "sChk")==0)
{
if ((GetItemPossessedBy(oHand, "fr_iwd_animar_ke") != OBJECT_INVALID) && (GetItemStackSize(oAaShards) == 2))
{
DestroyObject(oAaShards);
SpeakString(sDown, TALKVOLUME_TALK);
SetLocalInt(oHand,"sChk", 1);
location llocation = GetLocation(GetObjectByTag("fr_iwd_uz_portal_loc"));
object oTarget = GetObjectByTag("fr_iwd_uz_portal_inv");
int nIdx;
object oPillar;
effect eBeam;
//start beams from each pillar to middle waypoint.
for (nIdx=0; nIdx<=5; nIdx++)
{
oPillar=GetObjectByTag("fr_iwd_uz_ppillar",nIdx);
eBeam = EffectBeam(VFX_BEAM_SILENT_HOLY, oPillar, BODY_NODE_CHEST);
DelayCommand(5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oTarget, 10.0));
}
object oPillar1=GetObjectByTag("fr_iwd_uz_ppillar_inv1");
object oPillar2=GetObjectByTag("fr_iwd_uz_ppillar_inv2");
object oPillar3=GetObjectByTag("fr_iwd_uz_ppillar_inv3");
object oPillar4=GetObjectByTag("fr_iwd_uz_ppillar_inv4");
object oPillar5=GetObjectByTag("fr_iwd_uz_ppillar_inv5");
object oPillar6=GetObjectByTag("fr_iwd_uz_ppillar_inv6");
effect eBeam1 = EffectBeam(VFX_BEAM_LIGHTNING, oPillar1, BODY_NODE_CHEST);
effect eBeam2 = EffectBeam(VFX_BEAM_LIGHTNING, oPillar2, BODY_NODE_CHEST);
effect eBeam3 = EffectBeam(VFX_BEAM_LIGHTNING, oPillar3, BODY_NODE_CHEST);
effect eBeam4 = EffectBeam(VFX_BEAM_LIGHTNING, oPillar4, BODY_NODE_CHEST);
effect eBeam5 = EffectBeam(VFX_BEAM_LIGHTNING, oPillar5, BODY_NODE_CHEST);
effect eBeam6 = EffectBeam(VFX_BEAM_LIGHTNING, oPillar6, BODY_NODE_CHEST);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam1, oPillar3, 10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam3, oPillar5, 10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam5, oPillar1, 10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam2, oPillar4, 10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam4, oPillar6, 10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam6, oPillar2, 10.0);
//open portal
DelayCommand(14.0, ActionInteractObject(CreateObject(OBJECT_TYPE_PLACEABLE, "fr_iwd_uz_portal", llocation, TRUE)));
DelayCommand(14.0, PlaySound("as_mg_telepin1"));
DelayCommand(16.0, SoundObjectPlay(GetNearestObjectByTag("fr_iwd_uzsnd")));
//start beams from each pillar to middle waypoint.
for (nIdx=0; nIdx<=5; nIdx++)
{
oPillar=GetObjectByTag("fr_iwd_uz_ppillar",nIdx);
eBeam = EffectBeam(VFX_BEAM_SILENT_HOLY, oTarget, BODY_NODE_CHEST);
DelayCommand(68.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oPillar, 5.0));
}
effect eEND = EffectVisualEffect(VFX_IMP_PULSE_HOLY_SILENT, FALSE);
//close portal
DelayCommand(68.0, SetPlotFlag(GetObjectByTag("fr_iwd_uz_portal"), FALSE));
DelayCommand(69.0, DestroyObject(GetObjectByTag("fr_iwd_uz_portal")));
DelayCommand(69.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEND, oTarget, 5.0));
DelayCommand(68.0, SoundObjectStop(GetNearestObjectByTag("fr_iwd_uzsnd")));
DelayCommand(69.0, PlaySound("as_mg_telepout1"));
DelayCommand(40.0, SetLocalInt(oHand,"sChk", 0));
}
//if you enter a secret key, the portal leads to the top of the tower.
if (GetItemPossessedBy(oHand, "fr_iwd_tower_ke") != OBJECT_INVALID)
{
SpeakString(sUp, TALKVOLUME_TALK);
SetLocalInt(oHand,"sChk", 1);
location llocation = GetLocation(GetObjectByTag("fr_iwd_uz_portal_loc"));
object oTarget = GetObjectByTag("fr_iwd_uz_portal_inv");
int nIdx;
object oPillar;
effect eBeam;
//start beams from each pillar to middle waypoint.
for (nIdx=0; nIdx<=5; nIdx++)
{
oPillar=GetObjectByTag("fr_iwd_uz_ppillar",nIdx);
eBeam = EffectBeam(VFX_BEAM_SILENT_HOLY, oPillar, BODY_NODE_CHEST);
DelayCommand(5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oTarget, 10.0));
}
object oPillar1=GetObjectByTag("fr_iwd_uz_ppillar_inv1");
object oPillar2=GetObjectByTag("fr_iwd_uz_ppillar_inv2");
object oPillar3=GetObjectByTag("fr_iwd_uz_ppillar_inv3");
object oPillar4=GetObjectByTag("fr_iwd_uz_ppillar_inv4");
object oPillar5=GetObjectByTag("fr_iwd_uz_ppillar_inv5");
object oPillar6=GetObjectByTag("fr_iwd_uz_ppillar_inv6");
effect eBeam1 = EffectBeam(VFX_BEAM_EVIL, oPillar1, BODY_NODE_CHEST);
effect eBeam2 = EffectBeam(VFX_BEAM_EVIL, oPillar2, BODY_NODE_CHEST);
effect eBeam3 = EffectBeam(VFX_BEAM_EVIL, oPillar3, BODY_NODE_CHEST);
effect eBeam4 = EffectBeam(VFX_BEAM_EVIL, oPillar4, BODY_NODE_CHEST);
effect eBeam5 = EffectBeam(VFX_BEAM_EVIL, oPillar5, BODY_NODE_CHEST);
effect eBeam6 = EffectBeam(VFX_BEAM_EVIL, oPillar6, BODY_NODE_CHEST);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam1, oPillar3, 10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam3, oPillar5, 10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam5, oPillar1, 10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam2, oPillar4, 10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam4, oPillar6, 10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam6, oPillar2, 10.0);
//open portal
DelayCommand(14.0, ActionInteractObject(CreateObject(OBJECT_TYPE_PLACEABLE, "fr_iwd_uz_p02", llocation, TRUE)));
DelayCommand(14.0, PlaySound("as_mg_telepin1"));
DelayCommand(16.0, SoundObjectPlay(GetNearestObjectByTag("fr_iwd_uzsnd")));
//start beams from each pillar to middle waypoint.
for (nIdx=0; nIdx<=5; nIdx++)
{
oPillar=GetObjectByTag("fr_iwd_uz_ppillar",nIdx);
eBeam = EffectBeam(VFX_BEAM_SILENT_HOLY, oTarget, BODY_NODE_CHEST);
DelayCommand(38.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oPillar, 5.0));
}
effect eEND = EffectVisualEffect(VFX_IMP_PULSE_HOLY_SILENT, FALSE);
//close portal
DelayCommand(38.0, SetPlotFlag(GetNearestObjectByTag("fr_iwd_uz_p02"), FALSE));
DelayCommand(39.0, DestroyObject(GetNearestObjectByTag("fr_iwd_uz_p02")));
DelayCommand(39.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEND, oTarget, 5.0));
DelayCommand(38.0, SoundObjectStop(GetNearestObjectByTag("fr_iwd_uzsnd")));
DelayCommand(39.0, PlaySound("as_mg_telepout1"));
DelayCommand(40.0, SetLocalInt(oHand,"sChk", 0));
}
}
}