RATDOG/_module/nss/tribitz_att_pc.nss

49 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

//::///////////////////////////////////////////////
//::
//:: tribitz_att_pc.nss
//::
//:: Copyright (c) 2025 Project RATDOG
//::
//:://////////////////////////////////////////////
/*
Makes speaking NPC attack the PC speaker
*/
//:://////////////////////////////////////////////
//::
//:: Created By: Jaysyn
//:: Created On: 20220618
//::
//:://////////////////////////////////////////////
#include "nw_i0_generic"
void main()
{
object oPC = GetPCSpeaker();
object oTribitz = OBJECT_SELF;
// Have Tribitz target the PC.
SetIsTemporaryEnemy(oPC, oTribitz);
ActionAttack(oPC);
DetermineCombatRound(oPC);
// Loop through all objects in the area.
object oObject = GetFirstObjectInArea(oTribitz);
while (GetIsObjectValid(oObject))
{
// Check if the object is a creature and isn't the PC or Tribitz.
if (GetObjectType(oObject) == OBJECT_TYPE_CREATURE && oObject != oPC && oObject != oTribitz)
{
// Check if the creature's tag is "GoblinPriestl8a"
if (GetTag(oObject) == "GoblinPriestl8a")
{
// Set PC as temporary enemy for the minion and order it to attack.
SetIsTemporaryEnemy(oPC, oObject);
ActionAttack(oPC);
DetermineCombatRound(oPC);
}
}
oObject = GetNextObjectInArea(oTribitz);
}
}