52 lines
1.8 KiB
Plaintext
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."));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|