Jump to content
  • 0

SQL query/ How to replace a specific item from player inventory or equiped item


DanialFX

Question


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  43
  • Reputation:   0
  • Joined:  02/10/14
  • Last Seen:  

For example. I want to replace item id 8888 with 4444 for all players item

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

If you mean via phpmyadmin..

UPDATE `inventory` SET `nameid`=4444 WHERE `nameid`=8888;
UPDATE `cart_inventory` SET `nameid`=4444 WHERE `nameid`=8888;
UPDATE `storage` SET `nameid`=4444 WHERE `nameid`=8888;
UPDATE `guild_storage` SET `nameid`=4444 WHERE `nameid`=8888;

 

If you want it via npc script, just add enclose them in

query_sql()'

 

Make sure your server is turned off.. And you have a backup.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  43
  • Reputation:   0
  • Joined:  02/10/14
  • Last Seen:  

Thanks. How about to change the items that player is equiped?

UPDATE `inventory` SET `equip`=4444 WHERE `equip`=8888;

is it true? :D

Edited by DanialFX
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

It should work the same even if its equipped, 'equip' column contains the equipment slot, not the item id

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...