Jump to content
  • 0

Limiting Item Drop


Azura Skyy

Question


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  545
  • Reputation:   220
  • Joined:  03/01/13
  • Last Seen:  

Obviously Ragnarok's drop system allows for players to receive as few as none, and as many as all drops from a monster with each kill, but I want to have an item that they can only receive one of.

Let's call the item a raffle ticket. You kill a monster and it drops a raffle ticket, which you trade to an NPC for 1/3 different items. I don't want players to be able to have more than one raffle ticket at a time though. Is there a way to limit a character's ability to pick up an item if they already have one?

To continue on this line of thinking, (example) each raffle ticket corresponds to a different reward token- bronze, silver, and gold. I don't want players to be able to own both; a raffle ticket, and a reward token (I figure that will be a simple if statement), but preventing a player from acquiring additional raffle tickets still has me stumped.

Thanks in advance,
~Azura Skyy

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  816
  • Reputation:   236
  • Joined:  01/30/13
  • Last Seen:  

Easiest solution would be to just make the ticket unstoreable and then let the NPC delete all tickets regardless of how many tickets the player has. That's effectively the same and doesn't require source code edits.

 

If you want to do it so that even on share parties the item always goes to someone who hasn't gotten it yet, then you need to code some algorithm for that in party.c:

int party_share_loot(struct party_data* p, struct map_session_data* sd, struct item* item_data, int first_charid)

That's the best place to put it, you have all the info you need (struct item* item_data contains information about the item so you can check if it's your item).




			
		
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  545
  • Reputation:   220
  • Joined:  03/01/13
  • Last Seen:  

 

Easiest solution would be to just make the ticket unstoreable and then let the NPC delete all tickets regardless of how many tickets the player has. That's effectively the same and doesn't require source code edits.

 

I had considered this before posting but didn't like the way it would play out. In my opinion it would play ugly. Collecting 1 or 10 of the items rewards you with 1. I don't know, I feel picky, but I suppose I don't really want to futz around with source edits.

Thanks for your reply,

~Azura Skyy

Link to comment
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
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.

×
×
  • Create New...