Jump to content
Sign in to follow this  
Billy

Auction NPC

Recommended Posts

NPC allows GM to set up auctions for users to bid on.

Auction has a set end time.

Auction can have multiple items.

Users bids are in GM defined increments.

Supports multiple auctions at once.

 

Users must talk to the NPC to claim their rewards if they win the bid.

Users can claim back gold spent on bids were they lose (this feature can be disabled)

 

 

 

To do:

Allow use of item attributes on reward items.

 

Bidding System.lua

Edited by 7n6
  • Like 6

Share this post


Link to post
Share on other sites

@Billy

 

I'm not sure if you added the HandleChat function to add auctions in your script, because I can't find it.

 

/AddNewItem & /addnewitem returns nothing,

 

am I supposed to add this myself? O.o


logo-big.png   logo.png

                                   Sunny Go! Online                                                                    pko.host                                                 

Share this post


Link to post
Share on other sites
5 minutes ago, Billy said:

@Shako since different people structure their handlechats different i didnt add one in by default.

You need to make it call Bidding.Add(role,message) 

 

Thats what I figured, I'm trying to make it work. I put in Bidding.Add(role,message)  on my HandleChat function, but now when a non-GM account does even "/" it returns ERROR, whereas the GM account who does /addnewitem doesn't have any feedback. 

 

function HandleChat () 

Bidding.Add ( role , message)

Should I do something like this instead?

 

if (message == "/addnewitem") then
        	Bidding.Add ( role , message)

 

EDIT: Ill assume yes, sry xD

 

Edited by Shako

logo-big.png   logo.png

                                   Sunny Go! Online                                                                    pko.host                                                 

Share this post


Link to post
Share on other sites

@Billy I found a bug.

 

When you press claim back gold / items, it resets your cash stack to the amount claimed.

 

For example, I had 99 mil inside my inventory, and claimed back the item, and received back 1000 gold, but all the gold I have now is only 1000.


logo-big.png   logo.png

                                   Sunny Go! Online                                                                    pko.host                                                 

Share this post


Link to post
Share on other sites
49 minutes ago, Shako said:

@Billy I found a bug.

 

When you press claim back gold / items, it resets your cash stack to the amount claimed.

 

For example, I had 99 mil inside my inventory, and claimed back the item, and received back 1000 gold, but all the gold I have now is only 1000.

 

Edited:

 

Here is the fixed code. Can you review it?

 

function Bidding.ClaimOwedGold(role)
	local name = GetChaDefaultName(role)
	local Owed = table.load(Bidding.OwedSavePath,"r")
	local gold = GetChaAttr(role,8)
	local Owed_Money = 0
	if Owed[name] == nil or Owed[name].Gold == 0 then
		SystemNotice(role,Bidding.Messages[16])
	elseif gold == 2000000000 then
		SystemNotice(role,Bidding.Messages[17])
	else
		local givenGold = math.min(2000000000 - gold,Owed[name].Gold)
		Owed[name].Gold = Owed[name].Gold - givenGold
		table.save(Owed,Bidding.OwedSavePath,"w")
		Owed_Money = givenGold
		givenGold = gold + givenGold
		SetCharaAttr( givenGold ,role , 8)
		RefreshCha(role)
		local msg = string.gsub(Bidding.Messages[22],"$X",Owed_Money)
		SystemNotice(role,msg)
	end
end

 

 

Another bug:

 

When the time expires, you still can't get it. Claim owed items doesn't give you anything either. The item stays in the auction list, and can still be bidded.

Edited by Shako

logo-big.png   logo.png

                                   Sunny Go! Online                                                                    pko.host                                                 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...