44 lines
1.6 KiB
Plaintext
44 lines
1.6 KiB
Plaintext
/////////////////////////////////////////////////////////////////////////////////
|
|
// Real Time Strategy - NWN - Permanent Gate Construction Tool
|
|
//===============================================================================
|
|
// By Deva Bryson Winblood. 03/11/2003
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
#include "rtsh_multiplay"
|
|
|
|
void main()
|
|
{
|
|
object oPC=GetItemActivator();
|
|
location lLoc=GetItemActivatedTargetLocation();
|
|
int nMana=fnGetTeamMana(oPC);
|
|
object oG1=GetObjectByTag("rts_pl_mag32a");
|
|
object oG2=GetObjectByTag("rts_pl_mag32b");
|
|
string sTag=GetTag(GetArea(oPC));
|
|
object oOP=GetNearestObjectByTag("OUTER_PLANES",oPC);
|
|
if (oG1==OBJECT_INVALID||oG2==OBJECT_INVALID)
|
|
{ // OI
|
|
if (sTag!="ThePlaneofInBetween"&&sTag!="TheRealmofShadows"&&oOP==OBJECT_INVALID)
|
|
{ // ! Outer planes
|
|
if (nMana>49)
|
|
{ // enough mana
|
|
nMana=nMana-50;
|
|
fnSetTeamMana(oPC,nMana);
|
|
SendMessageToPC(oPC,"You used 50 mana to create a permanent gate terminus.");
|
|
if (oG1==OBJECT_INVALID)
|
|
{ // gate 1
|
|
oG1=CreateObject(OBJECT_TYPE_PLACEABLE,"rts_pl_mag32a",lLoc,TRUE);
|
|
} // gate 1
|
|
else
|
|
{ // gate 2
|
|
oG2=CreateObject(OBJECT_TYPE_PLACEABLE,"rts_pl_mag32b",lLoc,TRUE);
|
|
} // gate 2
|
|
} // enough mana
|
|
else
|
|
SendMessageToPC(oPC,"Constructing a Permanent Gate terminus costs 50 mana.");
|
|
} // not outer planes
|
|
else
|
|
SendMessageToPC(oPC,"You may not use that item in the outer planes.");
|
|
} // OI
|
|
else
|
|
SendMessageToPC(oPC,"You have already constructed a permanent gate.");
|
|
}
|