30 lines
876 B
Plaintext
30 lines
876 B
Plaintext
void main()
|
|
{
|
|
object oPlace=GetObjectByTag("RTS_POWER_RES");
|
|
object oItem=GetObjectByTag("rts_powerres");
|
|
object oArea;
|
|
string sLoc="waiting to be reformed";
|
|
int nGold=GetLocalInt(OBJECT_SELF,"nGoldCost");
|
|
int bTakeGold=FALSE;
|
|
if (GetIsObjectValid(oPlace))
|
|
{ // placeable
|
|
bTakeGold=TRUE;
|
|
sLoc=GetName(GetArea(oPlace));
|
|
} // placeable
|
|
else if (GetIsObjectValid(oItem))
|
|
{ // item
|
|
bTakeGold=TRUE;
|
|
oArea=GetItemPossessor(oItem);
|
|
if (oArea!=OBJECT_INVALID)
|
|
{ // pc carrying
|
|
sLoc=GetName(GetArea(oArea))+" where it is being carried by "+GetName(oArea);
|
|
} // pc carrying
|
|
else
|
|
{ // PC not carrying
|
|
sLoc=GetName(GetArea(oPlace));
|
|
} // PC not carrying
|
|
} // item
|
|
SetCustomToken(998,sLoc);
|
|
if (bTakeGold) TakeGoldFromCreature(nGold,GetPCSpeaker(),TRUE);
|
|
}
|