////////////////////////////////////////////////////////////////////////////////// // Real Time Strategy - NWN - Portal Gem //================================================================================ // By Deva Bryson Winblood. 03/06/2003 /////////////////////////////////////////////////////////////////////////////////// #include "rtsh_multiplay" void main() { object oPC=GetItemActivator(); string sID=GetLocalString(oPC,"sTeamID"); object oWP=GetObjectByTag("rts_portal_base"); object oOS=GetObjectByTag("rts_portal_outside"); location lLoc=GetItemActivatedTargetLocation(); object oArea=GetArea(oPC); string sTag=GetTag(oArea); object oInter=GetNearestObjectByTag("rts_pl_mag28",oPC); int nMana=fnGetTeamMana(oPC); object oOP=GetNearestObjectByTag("OUTER_PLANES",oPC); if (nMana>14) { // enough mana if (oInter==OBJECT_INVALID) { // no interdictor if (sTag!="TheRealmofShadows"&&sTag!="ThePlaneofInBetween"&&oOP==OBJECT_INVALID) { // not dead if (oWP!=OBJECT_INVALID) DestroyObject(oWP); if (oOS!=OBJECT_INVALID) DestroyObject(oOS); oWP=GetWaypointByTag(sID+"_START"); oWP=CreateObject(OBJECT_TYPE_PLACEABLE,"rts_portal_base",GetLocation(oWP)); oOS=CreateObject(OBJECT_TYPE_PLACEABLE,"rtS_portal_outside",lLoc); SetLocalObject(oWP,"oOwner",oPC); nMana=nMana-15; fnSetTeamMana(oPC,nMana); SendMessageToPC(oPC,"You used 15 mana to activate the portal gem."); } // not dead else SendMessageToPC(oPC,"You cannot use that item in the outer planes."); } // no interdictor else SendMessageToPC(oPC,"There is a teleportation interdictor setup in this area so you may not use the portal gem here."); } // enough mana else SendMessageToPC(oPC,"That item requires 15 mana to use."); }