30 lines
1.1 KiB
Plaintext
30 lines
1.1 KiB
Plaintext
///////////////////////////////////////////////////////////////////////////////
|
|
// ring of The hall
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
#include "rtsh_multiplay"
|
|
|
|
void main()
|
|
{
|
|
object oPC=GetItemActivator();
|
|
int nMana=fnGetTeamMana(oPC);
|
|
object oMe=GetItemActivated();
|
|
object oRight=GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oPC);
|
|
object oLeft=GetItemInSlot(INVENTORY_SLOT_LEFTRING,oPC);
|
|
object oPortal;
|
|
if (oRight==oMe||oLeft==oMe)
|
|
{ // wearing
|
|
if (nMana>49)
|
|
{ // enough mana
|
|
nMana=nMana-50;
|
|
fnSetTeamMana(oPC,nMana);
|
|
oPortal=CreateObject(OBJECT_TYPE_PLACEABLE,"rts_hall_gate",GetLocation(oPC));
|
|
SendMessageToPC(oPC,"A portal to the hall has been created. It will collapse in 20 seconds.");
|
|
DelayCommand(20.0,DestroyObject(oPortal));
|
|
} // enough mana
|
|
else
|
|
{ SendMessageToPC(oPC,"You need at least 50 mana to use this ring. You only have "+IntToString(nMana)+" mana."); }
|
|
} // wearing
|
|
else
|
|
{ SendMessageToPC(oPC,"You must be wearing the ring to use it."); }
|
|
}
|