Jump to content
  • 0

Deleting sold item in OnSellItem:


aadritch2

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  04/29/13
  • Last Seen:  

Is it possible to delete those items that were specifically "sold"?

For example, I have three +10 Example_Sword in my inventory, each of them has 3 Random Options, all of them has 'Holy Property' as their first random option, while their other two random options are all different from each other.
If I sold 1 Example_Sword, how can I delete only that specific sword and keep the others intact?

If i use delitem2 it's possible that it will delete the wrong item. But what about delitem3, can it take into factor the last two random options of the items?

EDIT: 

I noticed that items in inventory have unique id like GID in the database, is it possible to get this value like a @sold_gid[] array when using OnSellItem: and also delete the item using its "gid"?

Edited by aadritch2
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

@aadritch2 It looks like delitem3 would work, but as for using the unique id to delete items there isn't a command for that. You could remove it via SQL and kick the player, but they would need to go back to login screen and could create problems.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  04/29/13
  • Last Seen:  

Thanks for the reply. The thing im not sure about delitem3 is how many random options can it take in consideration. I tried using delitem3 but i got disconnected from serve

EDIT:

Got it working now, I set the @sold_option1 to another variable first, and using that variable for delitem3 param instead of using @sold_option1 directly.
I can now differentiate item with random options, but only the first random options. Still cannot differentiate two items with two or more random option with the first option being the same.

It seems like delitem3 shows an error when I use it to delete an item without random options, but then, I use delitem2, there's a possibilty that it will delete another same item with random option.

Edited by aadritch2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  04/29/13
  • Last Seen:  

Is it possible to specify which items were sold when using OnSellItem:? Similar to how normal NPC Shops know which items to delete when you sell items normally.
OnSellItem: only gives general data like item id, refine leve, etc. but it cannot pin point which items in the character's inventory were actually dragged to the sell window and were sold.
Please help, really need this.
 Wrong thread, my bad

Edited by aadritch2
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...