Rune_PRC8/_module/nss/b2_auctionplyr.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

52 lines
1.8 KiB
Plaintext

void main()
{
object oPC = GetLastUsedBy();
object oGong = GetNearestObjectByTag("ASG_STRONGBOXAUCTION_GONG",OBJECT_SELF);
object oLastBiddr = GetLocalObject(oGong,"B2_LASTBIDDER");
if (oPC == oLastBiddr)
{
SendMessageToPC(oPC,"*******************");
SendMessageToPC(oPC,"You already have the last bid!");
SendMessageToPC(oPC,"*******************");
}
else {
SetLocalInt(OBJECT_SELF,"B2_AuctionDidIBid",FALSE);
// int get current Bid Info
object oAuctioneer = GetNearestObjectByTag("DMrGAuctioneer");
if(GetIsObjectValid(oAuctioneer))
{
int vAStarted = GetLocalInt(oAuctioneer,"B2_AUCTIONSTATUS");
if (vAStarted == TRUE)
{
object oCChest = GetNearestObjectByTag("ASG_CCHEST");
if (GetIsObjectValid(oCChest))
{
object oItem = GetFirstItemInInventory(oCChest);
if (GetIsObjectValid(oItem))
{
int vPlayerGold = GetGold(oPC);
int vBid = GetLocalInt(oGong,"B2_AuctionBid");
if (vPlayerGold >= vBid)
{
SetLocalInt(OBJECT_SELF,"B2_AuctionDidIBid",TRUE);
AssignCommand(oPC,ActionSpeakString("I BID!"));
SetLocalObject(OBJECT_SELF,"B2_PlayerBid",oPC);
SetLocalObject(oGong,"B2_LASTBIDDER",oPC);
}
else
{
AssignCommand(oPC,ActionSpeakString("I don't have enough money."));
}
}
}
}
else
{
AssignCommand(oAuctioneer,ActionSpeakString("The auction has not started yet."));
}
}
}
}