Battledale_PRC8/_module/nss/fr_iwd_uz_portab.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

81 lines
3.4 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 sUp = "[You activate the portal.]";
if((GetLocalInt(oHand, "Chk")==0))
{
SpeakString(sUp, TALKVOLUME_TALK);
SetLocalInt(oHand,"Chk", 1);
AssignCommand(oHand, DelayCommand(0.1,ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE)));
location llocation = GetLocation(GetObjectByTag("fr_iwd_uz_portal_loc2"));
object oTarget = GetObjectByTag("fr_iwd_uz_portal_inv2");
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_ppillarb",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_inv1b");
object oPillar2=GetObjectByTag("fr_iwd_uz_ppillar_inv2b");
object oPillar3=GetObjectByTag("fr_iwd_uz_ppillar_inv3b");
object oPillar4=GetObjectByTag("fr_iwd_uz_ppillar_inv4b");
object oPillar5=GetObjectByTag("fr_iwd_uz_ppillar_inv5b");
object oPillar6=GetObjectByTag("fr_iwd_uz_ppillar_inv6b");
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_p02b", 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_ppillarb",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_p02b"), FALSE));
DelayCommand(39.0, DestroyObject(GetNearestObjectByTag("fr_iwd_uz_p02b")));
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,"Chk", 0));
AssignCommand(oHand, DelayCommand(40.0,ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)));
}
}