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

25 lines
954 B
Plaintext

void main()
{
object oPC=GetClickingObject();
object oMe=OBJECT_SELF;
string sTitle=GetLocalString(oMe,"sTitle");
int nCost=GetLocalInt(oMe,"nCost");
string sTID=GetLocalString(oPC,"sTeamID");
string sAID=GetLocalString(GetArea(oMe),"sTeamID");
int nGold=GetGold(oPC);
if (sTID==sAID&&nGold>=nCost)
{ // okay to do extend
SetLocalObject(oPC,"oLairExtend",oMe);
AssignCommand(oPC,ClearAllActions());
AssignCommand(oPC,ActionStartConversation(oPC,"lair_extend",TRUE,FALSE));
} // okay to do extend
else if (sTID==sAID)
{ // not enough gold
FloatingTextStringOnCreature("You do not have enough gold to activate the "+GetLocalString(oMe,"sTitle")+" it costs "+IntToString(nCost)+" gold.",oPC,FALSE);
} // not enough gold
else
{ // not your lair
SendMessageToPC(oPC,"You cannot extend the lair of other teams.");
} // not your lair
}