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

59 lines
2.0 KiB
Plaintext

////////////////////////////////////////////////////////////////////////
// Real Time Strategy - NWN - Ancient Tome of Rebirth
//======================================================================
// By Deva Bryson Winblood. 02/28/2003
////////////////////////////////////////////////////////////////////////
void fnPurgeShadowItems()
{
object oPC=OBJECT_SELF;
object oItem=GetFirstItemInInventory(oPC);
string sTag;
while(oItem!=OBJECT_INVALID)
{
sTag=GetTag(oItem);
if (sTag=="rts_it_light"||sTag=="rts_it_blast"||sTag=="rts_it_negprot") DelayCommand(1.0,DestroyObject(oItem));
else if(sTag=="rts_it_shd1"||sTag=="rts_it_shd2"||sTag=="rts_it_shd3"||sTag=="rts_it_shd3"||sTag=="rts_it_shd5") DelayCommand(1.0,DestroyObject(oItem));
oItem=GetNextItemInInventory(oPC);
}
oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
sTag=GetTag(oItem);
if (sTag=="rts_it_light"||sTag=="rts_it_blast"||sTag=="rts_it_negprot"||
sTag=="rts_it_shd1"||sTag=="rts_it_shd2"||sTag=="rts_it_shd3"||
sTag=="rts_it_shd3"||sTag=="rts_it_shd5") DelayCommand(1.0,DestroyObject(oItem));
}
int fnLevel(object oPC)
{ // get level
int nRet=GetLevelByPosition(1,oPC);
nRet=nRet+GetLevelByPosition(2,oPC);
nRet=nRet+GetLevelByPosition(3,oPC);
return nRet;
} // fnLevel
void main()
{
object oPC=GetItemActivator();
object oItem=GetItemActivated();
object oCreature=GetObjectByTag("Rotund");
int nCost;
string sID=GetLocalString(oPC,"sTeamID");
int nAmount=GetLocalInt(GetModule(),"nTOMEREBIRTH");
if (nAmount==0) nAmount=500;
nCost=fnLevel(oPC)*nAmount;
if (GetGold(oPC)>=nCost)
{ // freedom
AssignCommand(oCreature,TakeGoldFromCreature(nCost,oPC,TRUE));
DestroyObject(oItem);
/// teleport to the waking world
fnPurgeShadowItems();
oItem=GetWaypointByTag(sID+"_START");
AssignCommand(oPC,JumpToObject(oItem));
SetLocalInt(oPC,"nDied",0);
} // freedom
else
{ // gold
SendMessageToPC(oPC,"This item requires "+IntToString(nCost)+" gold to use at your current level!");
} // gold
}