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

56 lines
1.9 KiB
Plaintext

void main()
{
object oObject=GetInventoryDisturbItem();
object oPC=GetLastDisturbed();
object oPedestal=GetNearestObjectByTag("trito_pedestal", OBJECT_SELF, 1);
object oInv;
location lLoc=GetLocation(GetWaypointByTag("trito_creaturespawn_wp"));
object oObject2=GetFirstItemInInventory(oPedestal);
// Run this when something is added to the inventory
if (GetInventoryDisturbType()==INVENTORY_DISTURB_TYPE_ADDED)
{
// The Item placed in it is NOT the right object
// .. so tells the PC, and zaps them with an electric shock, and destroys whatever was put in
if ((GetTag(oObject)!="trito_gem_tag"))
{
ActionSpeakString("This is NOT the right gem");
ActionCastSpellAtObject(SPELL_ELECTRIC_JOLT,oPC,METAMAGIC_ANY,TRUE);
DestroyObject(oObject);
}
else
{
// The item placed in the inventory IS the right gem
if ((GetTag(oObject)=="trito_gem_tag"))
{
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_KNOCK),GetLocation(OBJECT_SELF));
SetLocalInt(OBJECT_SELF, "trito_has_gem", 1);
if ((GetLocalInt(oPedestal, "trito_has_gem")==1) && (GetLocalInt(OBJECT_SELF, "trito_has_gem")==1))
{
CreateObject(OBJECT_TYPE_CREATURE, "tri_undeadc", lLoc, FALSE, "tri_undeadc");
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_2), lLoc);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), lLoc);
DestroyObject(oObject);
DestroyObject(oObject2);
DeleteLocalInt(OBJECT_SELF, "trito_has_gem");
DeleteLocalInt(oPedestal, "trito_has_gem");
}
}
}
}
if (GetInventoryDisturbType()==INVENTORY_DISTURB_TYPE_REMOVED)
{
if ((GetTag(oObject) == "trito_gem_tag"))
{
DeleteLocalInt(OBJECT_SELF, "trito_has_gem");
}
}
}