HoS_PRC8/_mod/_module/nss/rts_it_mag31.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

60 lines
2.1 KiB
Plaintext

/////////////////////////////////////////////////////////////////////////////
// Real Time Strategy - NWN - Outer plane Persuasion Device
//===========================================================================
// By Deva Bryson Winblood. 03/11/2003
/////////////////////////////////////////////////////////////////////////////
#include "rtsh_multiplay"
void fnAttractor()
{ // the attractor routine
object oMe=OBJECT_SELF;
object oCr=GetLocalObject(oMe,"oCreature");
if (oCr==OBJECT_INVALID||GetIsDead(oCr))
{// !OI
if (GetResRef(oMe)=="rts_pl_mag30b")
{ // penumbral lord
oCr=CreateObject(OBJECT_TYPE_CREATURE,"penlord",GetLocation(oMe),TRUE);
} // penumbral lord
else
{ // planar worm
oCr=CreateObject(OBJECT_TYPE_CREATURE,"planworm",GetLocation(oMe),TRUE);
} // planar worm
SetLocalObject(oMe,"oCreature",oCr);
}// !OI
DelayCommand(30.0,fnAttractor());
} // fnAttractor()
void main()
{
object oPC=GetItemActivator();
int nMana=fnGetTeamMana(oPC);
object oAttractor;
location lLoc=GetItemActivatedTargetLocation();
string sTag=GetTag(GetArea(oPC));
if (nMana>9)
{ // have enough mana
if (sTag=="TheRealmofShadows")
{ // shadow plane
nMana=nMana-10;
fnSetTeamMana(oPC,nMana);
SendMessageToPC(oPC,"You used 10 mana to create an attractor.");
oAttractor=CreateObject(OBJECT_TYPE_PLACEABLE,"rts_pl_mag30b",lLoc,TRUE);
DelayCommand(5.0,RecomputeStaticLighting(GetArea(oPC)));
DelayCommand(30.0,AssignCommand(oAttractor,fnAttractor()));
} // shadow plane
else if (sTag=="ThePlaneofInBetween")
{ // outer area
nMana=nMana-10;
fnSetTeamMana(oPC,nMana);
SendMessageToPC(oPC,"You used 10 mana to create an attractor.");
oAttractor=CreateObject(OBJECT_TYPE_PLACEABLE,"rts_pl_mag30a",lLoc,TRUE);
DelayCommand(30.0,AssignCommand(oAttractor,fnAttractor()));
} // outer area
else
SendMessageToPC(oPC,"This item can only be used in the outer planes.");
} // have enough mana
else
SendMessageToPC(oPC,"This device requires 10 mana to use.");
}