diff options
Diffstat (limited to 'npc/custom/Auctioneer.txt')
-rw-r--r-- | npc/custom/Auctioneer.txt | 563 |
1 files changed, 563 insertions, 0 deletions
diff --git a/npc/custom/Auctioneer.txt b/npc/custom/Auctioneer.txt new file mode 100644 index 000000000..9a36bc268 --- /dev/null +++ b/npc/custom/Auctioneer.txt @@ -0,0 +1,563 @@ +//===== eAthena Script ======================================================================
+//= 1. Auctioneer
+//= 2. Auction Helping (Gives info only, but still good to have in)
+//===== Original By =========================================================================
+//= Fredzilla
+//===== Helped By ===========================================================================
+//= Not one quite yet, but you never know ;)
+//===== Current Version: ====================================================================
+//= 1.0 (Beta) < Thats means it is in testing
+//===== Compatible With: ====================================================================
+//= Any eAthena, that also has a script_athena.conf
+//===== Description: ========================================================================
+//= Lets a people place items into an auction, max of 10 items per round
+//= People can bid on them item
+//= Then buy the items, and sellers pickup there money
+//===== Comments and Credits ===========================================================
+//= This script would not have been made possible if it was not for "Maeki Rika"
+//= My praise goes out to her for finding out all the things we can do with the
+//= current system that eAthena uses
+//=
+//= More comments are listed down the page, in a attempt to explain what is going on in each
+//= section of the script
+//=
+//= This script is currently in testing, and any loss of items will, not only need to be
+//= reported inside the thread I made for this script, but be replaced by GM if proof was given :D
+//===========================================================================================
+
+prontera.gat,153,193,5 script Auctioneer 807,{
+ mes "[Auctioneer]";
+ set @num,0;
+// These few line below are to recover item that would be lost due to a new auction starting
+L_RNameLoop:
+ if(strcharinfo(0)==$ANamesB$[@num] && $paidB[@num]==0) goto L_RBackup;
+ set @num,@num+1;
+ if(@num<10) goto L_RNameLoop;
+ if($Auction==1) goto L_Register;
+ if($Auction==2) goto L_Bid;
+ if($Auction==3) goto L_PayPickup;
+
+// After a server restart, and no auction value is set, it will run this
+// People who placed items in there before the restart should still be to retrieve there items
+
+ mes "You are able to sell and buy things inside the auction, unfortunately nothing has been started, you need to wait for the auction to start";
+ mes "No items lost will be given back, please remember you used this at your own risk";
+ next;
+ mes "[Auctioneer]";
+ mes "I am very sorry if you have lost items";
+ close;
+
+// If the Auction has started, it will run this, during this time items can be registerd and registerd items retrieved
+
+L_Register:
+ mes "Welcome to the auction, you may register you items at this time";
+ next;
+ set @num,0;
+L_NameLoop:
+ if(strcharinfo(0)==$ANames$[@num]) goto L_Already;
+ set @num,@num+1;
+ if(@num<10) goto L_NameLoop;
+ if(getarraysize($AItems)==10) goto L_AFull;
+ menu "I want to register an item now",L_IRegister,"I dont want to leave an item",-;
+L_End:
+ mes "[Auctioneer]";
+ mes "Ok, come back whenever";
+ close;
+L_IRegister:
+ mes "[Auctioneer]";
+ mes "Listed below is the first 10 items you have on you now";
+ mes "What do you want to register?";
+ next;
+ set @array,0;
+ set @item,500;
+// set @loopcount,0;
+L_ILoop:
+// set @loopcount,@loopcount+1;
+// debugmes @loopcount;
+ set @item,@item+1;
+ if(@item>=13005) goto L_Menu;
+ if(countitem(@item)>0) set @item2[@array],@item;
+ if(countitem(@item)>0) set @array,@array+1;
+ if(@array==10) goto L_Menu;
+ set @item,@item+1;
+ if(countitem(@item)>0) set @item2[@array],@item;
+ if(countitem(@item)>0) set @array,@array+1;
+ if(@array==10) goto L_Menu;
+ set @item,@item+1;
+ if(countitem(@item)>0) set @item2[@array],@item;
+ if(countitem(@item)>0) set @array,@array+1;
+ if(@array==10) goto L_Menu;
+ set @item,@item+1;
+ if(countitem(@item)>0) set @item2[@array],@item;
+ if(countitem(@item)>0) set @array,@array+1;
+ if(@array==10) goto L_Menu;
+ set @item,@item+1;
+ if(countitem(@item)>0) set @item2[@array],@item;
+ if(countitem(@item)>0) set @array,@array+1;
+ if(@array==10) goto L_Menu;
+ set @item,@item+1;
+ if(countitem(@item)>0) set @item2[@array],@item;
+ if(countitem(@item)>0) set @array,@array+1;
+ if(@array==10) goto L_Menu;
+ set @item,@item+1;
+ if(countitem(@item)>0) set @item2[@array],@item;
+ if(countitem(@item)>0) set @array,@array+1;
+ if(@array==10) goto L_Menu;
+ set @item,@item+1;
+ if(countitem(@item)>0) set @item2[@array],@item;
+ if(countitem(@item)>0) set @array,@array+1;
+ if(@array==10) goto L_Menu;
+ set @item,@item+1;
+ if(countitem(@item)>0) set @item2[@array],@item;
+ if(countitem(@item)>0) set @array,@array+1;
+ if(@array==10) goto L_Menu;
+ set @item,@item+1;
+ if(countitem(@item)>0) set @item2[@array],@item;
+ if(countitem(@item)>0) set @array,@array+1;
+ if(@array==10) goto L_Menu;
+ goto L_ILoop;
+L_Menu:
+ menu getitemname(@item2[0]),-,getitemname(@item2[1]),-,getitemname(@item2[2]),-,getitemname(@item2[3]),-,getitemname(@item2[4]),-,getitemname(@item2[5]),-,getitemname(@item2[6]),-,getitemname(@item2[7]),-,getitemname(@item2[8]),-,getitemname(@item2[9]),-,"Next Page",L_WipeLoop;
+ set @setitem,@item2[@menu-1];
+ set @num,0;
+L_SorryLoop:
+ set @num,@num+1;
+ if(@menu==@num && @setitem == 0) goto L_Sorry;
+ if(@num==10) goto L_FinalReg;
+ goto L_SorryLoop;
+L_FinalReg:
+ mes "[Auctioneer]";
+ mes "Please remember that if this item does contain cards, or is crafted, these distinctions will be lost when it is put into the auction";
+ mes "This also means if you get the item back, that this applies to, you will have lost out";
+ mes " ";
+ mes "So you want to register your "+getitemname(@setitem);
+ next;
+ menu "Yes please",-,"No",L_End;
+ mes "[Auctioneer]";
+ mes "Ok I will register this item now";
+ next;
+ set @amount,1;
+ if(countitem(@setitem)==1) goto L_FinalInput;
+ mes "[Auctioneer]";
+ mes "Wait a minute it seems you have more than one of that item, please enter the ammount you want to put in the aution";
+ next;
+ input @amount;
+ if(countitem(@setitem)<@amount) goto L_NotEnough;
+L_FinalInput:
+ set $AItems[$array],@setitem;
+ set $ANames$[$array],strcharinfo(0);
+ set $AAmount[$array],@amount;
+ set $array,$array+1;
+ delitem @setitem,@amount;
+ mes "[Auctioneer]";
+ mes "You item has been taken into storage, ready for sale, the auction will begin soon, watch for the announcment";
+ close;
+L_AFull:
+ mes "[Auctioneer]";
+ mes "Oh, sorry, it seems my auction is full this time round, please try in the next one";
+ close;
+L_WipeLoop:
+ deletearray @item2[0],10;
+ set @array,0;
+ goto L_ILoop;
+L_Sorry:
+ mes "[Auctioneer]";
+ mes "It seems that is all you have to offer me, come back when you know what you want to sell";
+ close;
+L_Already:
+ mes "[Auctioneer]";
+ mes "It seems you already have have an item registerd here, would you like to retrieve your item?";
+ next;
+ menu "Yes",-,"No",L_End;
+ getitem $AItems[@num],$AAmount[@num];
+L_AItemsLoop:
+ set $AItems[@num],$AItems[@num+1];
+ set $ANames$[@num],$ANames$[@num+1];
+ set $AAmount[@num],$AAmount[@num+1];
+ set @num,@num+1;
+ if(@num<10) goto L_AItemsLoop;
+ set $array,$array-1;
+ set @num,0;
+ mes "[Auctioneer]";
+ mes "Ok, all items present and acounted for, have a nice day";
+ close;
+L_NotEnough:
+ mes "[Auctioneer]";
+ mes "Seems you dont have that much "+getitemname(@setitem)+"'s";
+ close;
+// If the Auction has enterd phase 2, it will run this, during this time items you can bid on registerd
+// No items can be retrieved during this time, they are now stuck
+
+L_Bid:
+ mes "What would you like to bid on?";
+ next;
+ set @num,0;
+L_MenuLoop:
+ set @menu$[@num],$AAmount[@num]+" x "+getitemname($AItems[@num])+" "+$bid[@num]+"z";
+ set @num,@num+1;
+ if($AItems[@num]!=0) goto L_MenuLoop;
+ menu
+ @menu$[0],-,
+ @menu$[1],-,
+ @menu$[2],-,
+ @menu$[3],-,
+ @menu$[4],-,
+ @menu$[5],-,
+ @menu$[6],-,
+ @menu$[7],-,
+ @menu$[8],-,
+ @menu$[9],-;
+ mes "[Auctioneer]";
+ set @num,@menu-1;
+ if(strcharinfo(0)==$ANames$[@num]) goto L_CantBid;
+L_ReBid:
+ mes "You are currently bidding on "+$AAmount[@num]+" x "+getitemname($AItems[@num]);
+ mes "The current bid is at "+$bid[@num]+"z";
+ mes "This was made by "+$bidders$[@num];
+ if($bidders$[@num]==strcharinfo(0)) goto L_AlreadyBid;
+ mes "How much do you want to bid yourself";
+ mes "(Use 0 to cancel at this point)";
+ next;
+ input @bid;
+ if(@bid<=0) goto L_End;
+ if(zeny<@bid) goto L_LowZeny;
+ if(@bid<$bid[@num]) goto L_LowBid;
+ mes "[Auctioneer]";
+ mes "You are about to bid "+@bid+"z for "+$AAmount[@num]+" x "+getitemname($AItems[@num]);
+ mes "Are you sure?";
+ next;
+ menu "Yes",-,"No",L_End;
+ set $bid[@num],@bid;
+ set $bidders$[@num],strcharinfo(0);
+ mes "[Auctioneer]";
+ mes "Your bid has been entered";
+ close;
+L_LowZeny:
+ mes "[Auctioneer]";
+ mes "Sorry you need to show me that amount as proof you could pay, if you do win";
+ mes "Please either get more money, or bid lower";
+ close;
+L_CantBid:
+ mes "Sorry, you cant bid on your own lots";
+ close;
+L_LowBid:
+ mes "[Auctioneer]";
+ mes "Your bid seems lower than the current one, try entering a higher ammount of zeny";
+ next;
+ mes "[Auctioneer]";
+ goto L_ReBid;
+L_AlreadyBid:
+ mes "Hey wait, that is you, you can't bid again";
+ close;
+// If the Auction has entered phase 3, it will run this
+// During this time, items that have been bid on can be bought
+// Items not bid on can be picked back up by the seller
+// And if any of the items have been bought, and are paid for, seller can pick up their money
+
+L_PayPickup:
+ mes "The auction has now ended";
+ mes "What would you like to do?";
+ next;
+ menu "Check for items I have sold",-,"Check for items I have won",L_Won,"Nothing",L_End;
+
+// Check starts here for if you have sold anything during this auction
+
+ set @num,0;
+L_SoldLoop:
+ if($ANames$[@num]==strcharinfo(0)) goto L_Sold;
+ set @num,@num+1;
+ if(@num<10) goto L_SoldLoop;
+ mes "[Auctioneer]";
+ mes "Sorry it seems you have either picked up all you items, money";
+ mes "or you didnt register any items in this auction";
+ close;
+L_Sold:
+ mes "[Auctioneer]";
+ if($paid[@num]==3) goto L_Returned;
+ mes "Ah I see here, you sold your "+$AAmount[@num]+" x "+getitemname($AItems[@num]);
+ mes "Lets see here it sold for";
+ next;
+ if($bid[@num]==0) goto L_GiveBack;
+ if($paid[@num]==2) goto L_AlreadyPaid;
+ mes "[Auctioneer]";
+ mes $bid[@num]+"z and "+$bidders$[@num]+" bought it from you";
+ if($paid[@num]!=1) goto L_NoMoney;
+ mes "They have fully paid for it, so here is your money";
+ next;
+ set zeny,zeny+$bid[@num];
+ set $paid[@num],2;
+ goto L_End;
+L_AlreadyPaid:
+ mes "[Auctioneer]";
+ mes "Hmm, seems you already have you money for this lot, not trying to con me are you?";
+ close;
+L_Returned:
+ mes "[Auctioneer]";
+ mes "Seems we returned you item already";
+ close;
+L_GiveBack:
+ mes "[Auctioneer]";
+ mes "Seems no-one wanted your item(s)";
+ mes "So you can have them back now";
+ getitem $AItems[@num],$AAmount[@num];
+ set $paid[@num],3;
+ close;
+L_NoMoney:
+ mes "Sorry to say this but they havent paid this yet";
+ mes "You can go and talk to them now, or you can wait";
+ mes "If they havent paid by the time the next Auction starts come back to me to retrieve your item(s)";
+ close;
+
+// Check starts here for if you won any items during this auction, futher options follow
+
+L_Won:
+ set @num,0;
+ mes "[Auctioneer]";
+L_WonLoop:
+ if($bidders$[@num]==strcharinfo(0)) goto L_Winner;
+L_CarryOn:
+ set @num,@num+1;
+ if(@num<10) goto L_WonLoop;
+ mes "Sorry you didnt win any of the lots, please try again next time";
+ close;
+L_Winner:
+ if($paid[@num]>0) goto L_CarryOn;
+ mes "Well it does seem you have won an item";
+ mes "You won "+$AAmount[@num]+" x "+getitemname($AItems[@num]);
+ mes "And you bid "+$bid[@num]+"z for this lot";
+ mes "What do you want to do now?";
+ next;
+
+// At this point they can choose from 3 options, to Buy the current lot
+// see the next one they might have won, or give up that lot
+
+ menu "Buy this lot",-,"See Next Lot you won",L_CarryOn,"Relinquish this lot",L_Back;
+ if(zeny<$bid[@num]) goto L_2lowzeny;
+ set zeny,zeny-$bid[@num];
+ getitem $AItems[@num],$AAmount[@num];
+ set $paid[@num],1;
+ mes "[Auctioneer]";
+ mes "Our transaction is completed";
+ mes "See you again soon";
+ close;
+L_2lowzeny:
+ mes "[Auctioneer]";
+ mes "Sorry it seems you dont have enough zeny on you, please acquire more";
+ close;
+L_Back:
+ mes "[Auctioneer]";
+ mes "Are you sure you want to give up this lot?";
+ next;
+ menu "Yes",-,"No",L_End;
+ set $bid[@num],0;
+ set $bidders$[@num],"no-one";
+ mes "[Auctioneer]";
+ mes "It is done, you might want to tell "+$ANames$[@num]+" they can come and pickup his item(s)";
+ close;
+
+// All the times that will start the Auction
+
+OnClock0100:
+OnClock0400:
+OnClock0700:
+OnClock1000:
+OnClock1300:
+OnClock1600:
+OnClock1900:
+OnClock2200:
+// Starting Backup
+ copyarray $AItemsB[0],$AItems[0],10;
+ copyarray $ANamesB$[0],$ANames$[0],10;
+ copyarray $AAmountB[0],$AAmount[0],10;
+ copyarray $paidB[0],$paid[0],10;
+// End backup - Start Wiping
+ deletearray $paid[0],10;
+ deletearray $bid[0],10;
+ deletearray $bidders$[0],10;
+ deletearray $AItems[0],10;
+ deletearray $ANames$[0],10;
+ deletearray $AAmount[0],10;
+ set $array,0;
+// End Wiping - Begin Announce + Phase setting
+ announce "Registration time has begun, see the Auctioneer to register your items",0;
+ cleararray $bidders$[0],"no-one",10;
+ set $Auction,1;
+ end;
+
+// All the times that will start the bidding section
+
+OnClock0200:
+OnClock0500:
+OnClock0800:
+OnClock1100:
+OnClock1400:
+OnClock1700:
+OnClock2000:
+OnClock2300:
+ if($Auction==0) end;
+ announce "Registration time has ended, time for the biding to begin",0;
+ set $Auction,2;
+ initnpctimer;
+ end;
+
+// All the times that will start the last phase, buying and seller, and item retrieval
+
+OnClock0300:
+OnClock0600:
+OnClock0900:
+OnClock1200:
+OnClock1500:
+OnClock1800:
+OnClock2100:
+OnClock0000:
+ if($Auction==0) end;
+ announce "Bidding time has ended, see the Auctioneer to get your items, or money",0;
+ set $Auction,3;
+ end;
+
+// On the start of the server it will reset the Auction state, but not the items it contains
+// so people still have have a chance to retrieve there lost items
+
+OnInit:
+ copyarray $AItemsB[0],$AItems[0],10;
+ copyarray $ANamesB$[0],$ANames$[0],10;
+ copyarray $AAmountB[0],$AAmount[0],10;
+ copyarray $paidB[0],$paid[0],10;
+ deletearray $paid[0],10;
+ deletearray $bid[0],10;
+ deletearray $bidders$[0],10;
+ deletearray $AItems[0],10;
+ deletearray $ANames$[0],10;
+ deletearray $AAmount[0],10;
+ set $array,0;
+ set $Auction,0;
+ end;
+
+// All below is for anouncing the items in this auction, if there are none it will say so
+// and if there are none in there at the start of phase 2 it will reset the auctions state
+// This is to stop the auction ending message, and will only start again when it reachs phase 1 again
+
+OnTimer5000:
+ announce "Today in our auction we have",0;
+ end;
+OnTimer7000:
+ if($AItems[0]==0) setnpctimer 25001;
+ if($AAmount[0]==1) announce "A lovely "+getitemname($AItems[0])+" left by "+$ANames$[0],0;
+ if($AAmount[0]>1) announce $AAmount[0]+" lovely "+getitemname($AItems[0])+" left by "+$ANames$[0],0;
+ end;
+OnTimer9000:
+ if($AItems[1]==0) setnpctimer 25001;
+ if($AAmount[1]==1) announce "A great "+getitemname($AItems[1])+" left by "+$ANames$[1],0;
+ if($AAmount[1]>1) announce $AAmount[1]+" great "+getitemname($AItems[1])+" left by "+$ANames$[1],0;
+ end;
+OnTimer11000:
+ if($AItems[2]==0) setnpctimer 25001;
+ if($AAmount[2]==1) announce "A excellent "+getitemname($AItems[2])+" left by "+$ANames$[2],0;
+ if($AAmount[2]>1) announce $AAmount[2]+" excellent "+getitemname($AItems[2])+" left by "+$ANames$[2],0;
+ end;
+OnTimer13000:
+ if($AItems[3]==0) setnpctimer 25001;
+ if($AAmount[3]==1) announce "A superb "+getitemname($AItems[3])+" left by "+$ANames$[3],0;
+ if($AAmount[3]>1) announce $AAmount[3]+" superb "+getitemname($AItems[3])+" left by "+$ANames$[3],0;
+ end;
+OnTimer15000:
+ if($AItems[4]==0) setnpctimer 25001;
+ if($AAmount[4]==1) announce "A terrific "+getitemname($AItems[4])+" left by "+$ANames$[4],0;
+ if($AAmount[4]>1) announce $AAmount[4]+" terrific "+getitemname($AItems[4])+" left by "+$ANames$[4],0;
+ end;
+OnTimer17000:
+ if($AItems[5]==0) setnpctimer 25001;
+ if($AAmount[5]==1) announce "A wonderful "+getitemname($AItems[5])+" left by "+$ANames$[5],0;
+ if($AAmount[5]>1) announce $AAmount[5]+" wonderful "+getitemname($AItems[5])+" left by "+$ANames$[5],0;
+ end;
+OnTimer19000:
+ if($AItems[6]==0) setnpctimer 25001;
+ if($AAmount[6]==1) announce "A pretty "+getitemname($AItems[6])+" left by "+$ANames$[6],0;
+ if($AAmount[6]>1) announce $AAmount[6]+" pretty "+getitemname($AItems[6])+" left by "+$ANames$[6],0;
+ end;
+OnTimer21000:
+ if($AItems[7]==0) setnpctimer 25001;
+ if($AAmount[7]==1) announce "A sweet "+getitemname($AItems[7])+" left by "+$ANames$[7],0;
+ if($AAmount[7]>1) announce $AAmount[7]+" sweet "+getitemname($AItems[7])+" left by "+$ANames$[7],0;
+ end;
+OnTimer23000:
+ if($AItems[8]==0) setnpctimer 25001;
+ if($AAmount[8]==1) announce "A stunning "+getitemname($AItems[8])+" left by "+$ANames$[8],0;
+ if($AAmount[8]>1) announce $AAmount[8]+" stunning "+getitemname($AItems[8])+" left by "+$ANames$[8],0;
+ end;
+OnTimer25000:
+ if($AItems[9]==0) end;
+ if($AAmount[9]==1) announce "A fine "+getitemname($AItems[9])+" left by "+$ANames$[9],0;
+ if($AAmount[9]>1) announce $AAmount[9]+" fine "+getitemname($AItems[9])+" left by "+$ANames$[9],0;
+OnTimer27000:
+ if($AItems[0]!=0) announce "That is all the items we have this time round, so get bidding",0;
+ if($AItems[0]==0) announce "Seems there are no items this time round",0;
+ if($AItems[0]==0) set $Auction,0;
+ stopnpctimer;
+ setnpctimer 0;
+ end;
+
+// this is only be run if you own any items left over, not paid for, from the last auction, or the server failed, and items are left over
+
+L_RBackup:
+ mes "You seem to have items left over from the last auction, here you go, have it back";
+ next;
+ getitem $AItemsB[@num],$AAmountB[@num];
+L_BItemsLoop:
+ set $AItemsB[@num],$AItemsB[@num+1];
+ set $ANamesB$[@num],$ANamesB$[@num+1];
+ set $AAmountB[@num],$AAmountB[@num+1];
+ set @num,@num+1;
+ if(@num<10) goto L_BItemsLoop;
+ mes "[Auctioneer]";
+ mes "Have a nice day";
+ close;
+}
+
+// Only for display purposes, and telling people info about the auction
+// Can also be used for finding out what phase the auction is in
+
+prontera.gat,158,193,3 script Auction Helper 833,{
+ mes "[Auction Helper]";
+ set @num,0;
+ if($Auction==0 && $AItemsB[@num]!=0) goto L_ItemRecover;
+ if(($Auction==1 || $Auction ==2) && $AItems[@num]!=0) goto L_LLoop;
+ if($Auction==3 && $AItems[@num]!=0) goto L_Win;
+ mes "Ok Currently we have nothing in the auction.";
+ mes "Please return at the correct time.";
+ close;
+L_LLoop:
+ mes "Ok Currently we have :-";
+L_Loop:
+ mes $ANames$[@num]+" with "+$AAmount[@num]+" x "+getitemname($AItems[@num])+"('s)";
+ set @num,@num+1;
+ if($AItems[@num]==0) close;
+ if(@num<10) goto L_Loop;
+ close;
+L_ItemRecover:
+ mes "Seems there was a problem, and the auction ended prematurely.";
+ mes "This means we still have :-";
+L_BLoop:
+ if($paid[@num]==0) mes $ANamesB$[@num]+" with "+$AAmountB[@num]+" x "+getitemname($AItemsB[@num])+"('s)";
+ set @num,@num+1;
+ if($AItems[@num]==0) close;
+ if(@num<10) goto L_BLoop;
+ close;
+L_Win:
+ mes "The Auction is in the last stage, at this point you can :-";
+ mes " * buy your items";
+ mes " * Pick-up you money";
+ mes "(or if you were unlucky)";
+ mes " * Pick-up unsold items";
+ next;
+ mes "[Auction Helper]";
+ mes "Here is a list of Sellers and Winners";
+ set @num,0;
+L_Loop2:
+ mes $ANames$[@num]+" with "+$AAmount[@num]+" "+getitemname($AItems[@num])+"('s), won by "+$bidders$[@num]+" for "+$bid[@num]+"z";
+ set @num,@num+1;
+ if($AItems[@num]==0) close;
+ if(@num<10) goto L_Loop2;
+ close;
+
+}
|