HiddenTradition_PRC8/_module/nss/at_bludragonspot.nss
2024-06-20 15:47:42 -04:00

110 lines
2.9 KiB
Plaintext

#include "nw_i0_generic"
#include "nw_i0_plot"
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
//Has Party been spotted before? If so, don't fire.
if (GetLocalInt(oPC, "DragonSpot") == 2)
return;
//5% chance of dragon flying over this area
if (d100()>5)
return;
//Is PC wearing anything that makes him look like a dragon slayer?
//check for dragon armor
if (GetTag(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC)) == "NW_MAARCL027")
{
SetLocalInt(oPC, "DragonSpot", 1);
}
else if (GetTag(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC)) == "NW_MAARCL028")
{
SetLocalInt(oPC, "DragonSpot", 1);
}
else if (GetTag(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC)) == "NW_MAARCL042")
{
SetLocalInt(oPC, "DragonSpot", 1);
}
else if (GetTag(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC)) == "NW_MAARCL018")
{
SetLocalInt(oPC, "DragonSpot", 1);
}
else if (GetTag(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC)) == "NW_MAARCL015")
{
SetLocalInt(oPC, "DragonSpot", 1);
}
//check for dragonslayer bastard sword
else if (GetTag(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC)) == "NW_WSWMBS006")
{
SetLocalInt(oPC, "DragonSpot", 1);
}
//check for dragon shield
else if (GetTag(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC)) == "NW_ASHMLW006")
{
SetLocalInt(oPC, "DragonSpot", 1);
}
//check for dragon slippers
else if (GetTag(GetItemInSlot(INVENTORY_SLOT_BOOTS, oPC)) == "NW_IT_MBOOTS003")
{
SetLocalInt(oPC, "DragonSpot", 1);
}
//check for custom dragon armor
else if (GetTag(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC)) == "it_BlueDragonArmor")
{
SetLocalInt(oPC, "DragonSpot", 1);
}
else if (GetTag(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC)) == "it_BlackDragonArmor")
{
SetLocalInt(oPC, "DragonSpot", 1);
}
else if (GetTag(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC)) == "it_ClintsArmor")
{
SetLocalInt(oPC, "DragonSpot", 1);
}
else if (GetTag(GetItemInSlot(INVENTORY_SLOT_ARMS, oPC)) == "Wyrmclaws")
{
SetLocalInt(oPC, "DragonSpot", 1);
}
//If he is, drop an ancient dragon on top of him, but only once per party.
object oTarget;
object oSpawn;
location lTarget;
if (GetLocalInt(oPC, "DragonSpot") == 1)
{
SetPLocalInt (oPC, "DragonSpot", 2);
lTarget = GetLocation(oPC);
//uncomment ONE of these to decide which color dragon (based on type of area. default = blue)
//for an old dragon instead of an ancient, change the numbers from 003 to 002
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "nw_drgblue003", lTarget);
//oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "nw_drgwhite003", lTarget);
//oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "nw_drgred003", lTarget);
//oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "nw_drgblack003", lTarget);
//oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "nw_drggreen003", lTarget);
SetIsTemporaryEnemy(oPC, oSpawn);
AssignCommand(oSpawn, ActionAttack(oPC));
AssignCommand(oSpawn, DetermineCombatRound(oPC));
}
}