Jump to content
  • 0

prevent to unequip item


fusqueta

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.01
  • Content Count:  32
  • Reputation:   0
  • Joined:  10/26/20
  • Last Seen:  

is there anyway to prevent to unequip a single item? I'll bind a visual effect to the item sprite and player cannot unequip it

 

ps: I'm planning to execute a UnEquipScript to equip item again, but seems like a poor way to solve this problem, another better idea?

Edited by fusqueta
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.01
  • Content Count:  32
  • Reputation:   0
  • Joined:  10/26/20
  • Last Seen:  

I made it by source, it's ugly but works fine


 

bool pc_unequipitem(struct map_session_data *sd, int n, int flag) {

...

    if (sd->inventory_data[n]->nameid == 2220 && !(flag & 2))
    {
        clif_unequipitemack(sd, n, 0, 0);
        return false;
    }

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  148
  • Reputation:   21
  • Joined:  11/12/18
  • Last Seen:  

1 hour ago, fusqueta said:

is there anyway to prevent to unequip a single item? I'll bind a visual effect to the item sprite and player cannot unequip it

 

ps: I'm planning to execute a UnEquipScript to equip item again, but seems like a poor way to solve this problem, another better idea?

why not use OnPCLoginEvent and use changelook script?

  • Upvote 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.01
  • Content Count:  32
  • Reputation:   0
  • Joined:  10/26/20
  • Last Seen:  

10 hours ago, Forshaken said:

why not use OnPCLoginEvent and use changelook script?

It's a good altenative, but I'm planning to add item script further on this, a flag disabling unequip would be perfect

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  148
  • Reputation:   21
  • Joined:  11/12/18
  • Last Seen:  

17 hours ago, fusqueta said:

It's a good altenative, but I'm planning to add item script further on this, a flag disabling unequip would be perfect

you can make your own mapflag script and dig deeper on your itemdb.cpp

 

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