WoR_PRC8/_module/nss/sha_myra_onenter.nss

53 lines
2.7 KiB
Plaintext
Raw Permalink Normal View History

2025-04-03 11:49:34 -04:00
#include "NW_I0_GENERIC"
//To check if a PC with an Evil alignment enters Myra'therend.
//And initiate the actions of the Guards
void main()
{
object oPC = GetEnteringObject();
if(!GetIsPC(oPC))
return;
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL))
return;
//Do only once per enter.
int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);
object oTarget = GetObjectByTag("SHA_ELVEN_MRANGER_GUARD");
object oTarget1 = GetObjectByTag("SHA_ELVEN_MRANGER_01");
object oTarget2 = GetObjectByTag("SHA_ELVEN_MRANGER_02");
AssignCommand(oTarget, SpeakString("Ready your bows Myra'therendi for an evil sets foot in our city!", TALKVOLUME_TALK));
//If the PC had saved the disguised Lady from the Troll cave on the way
//AND wears the Amulet she gives as the gift then the guards will let the PC pass
//otherwise Faction Myratherendi become hostile towards the Evil PC
if (GetTag(GetItemInSlot(INVENTORY_SLOT_NECK, oPC)) == "SHA_AMU_LADYSGIFT")
{
//Attack the Rocks near the PC so that the arrow doesnt hit the PC
AssignCommand(oTarget, ActionAttack(GetObjectByTag("SHA_TARGETROCKS")));
DelayCommand(1.2, AssignCommand(oTarget1, SpeakString("Wait Soffrin! Look... around it's neck...the Lady's gift!", TALKVOLUME_TALK)));
DelayCommand(1.3, AssignCommand(oTarget, ClearAllActions(TRUE)));
DelayCommand(2.0, AssignCommand(oTarget2, SpeakString("The Lady did say she was expecting someone...", TALKVOLUME_TALK)));
DelayCommand(3.0, AssignCommand(oTarget, SpeakString("Hmm...Lady of the Moon would not so easily hand over her possession to any evil...", TALKVOLUME_TALK)));
DelayCommand(4.0, AssignCommand(oTarget, SpeakString("*Reluctantly* Very well... Let it pass. But be alert! *Looks directly at you* One false move and you will find an arrow through your black heart!")));
//Adjust any previous misconceptions
AdjustReputation(oPC, oTarget, 100);
//Adjust to a neutral feeling
AdjustReputation(oPC, oTarget, -50);
}
else
{
AdjustReputation(oPC, oTarget, -100);
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget, DetermineCombatRound(oPC));
DelayCommand(2.0, AssignCommand(oTarget, SpeakString("You are not welcome within these walls creature of darkness!")));
AssignCommand(oTarget1, ActionAttack(oPC));
AssignCommand(oTarget1, DetermineCombatRound(oPC));
AssignCommand(oTarget2, ActionAttack(oPC));
AssignCommand(oTarget2, DetermineCombatRound(oPC));
DelayCommand(6.0, AssignCommand(oTarget1, SpeakString("May the Goddess cleanse your foul soul!")));
DelayCommand(8.0 , AssignCommand(oTarget2, SpeakString("Defend Myra'therend at all costs!")));
}
}