Jump to content
  • 0

Hide costume item in certain maps


char0

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  12/20/11
  • Last Seen:  

Hello everyone.

 

I'm trying to hide costume items and shows the original equip in same maps where are PvP, GvG and Battleground ON because this confuses the player when will fight.

 

The player doesn't know what the opponent is equipped, this way he can't defend herself.

 

To try do this, I change some lines in map/pc.c:

//Added check to prevent sending the same look on multiple slots ->
//causes client to redraw item on top of itself. (suggested by Lupus)
if(pos&(EQP_HEAD_LOW|EQP_COSTUME_HEAD_LOW)) {
    if(id && !(pos&(EQP_HEAD_TOP|EQP_HEAD_MID|EQP_COSTUME_HEAD_MID|EQP_COSTUME_HEAD_TOP)))
    sd->status.head_bottom = id->look;
    else
    sd->status.head_bottom = 0;
    if((pos&EQP_HEAD_LOW && (pc_checkequip(sd,EQP_COSTUME_HEAD_LOW)) < 0) || pos&EQP_COSTUME_HEAD_LOW)
    clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
}
if(pos&(EQP_HEAD_TOP|EQP_COSTUME_HEAD_TOP)) {
    if(id)
    sd->status.head_top = id->look;
    else
    sd->status.head_top = 0;
    if((pos&EQP_HEAD_TOP && (pc_checkequip(sd,EQP_COSTUME_HEAD_TOP)) < 0) || pos&EQP_COSTUME_HEAD_TOP)
    clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
}
if(pos&(EQP_HEAD_MID|EQP_COSTUME_HEAD_MID)) {
    if(id && !(pos&(EQP_HEAD_TOP|EQP_COSTUME_HEAD_TOP)))
    sd->status.head_mid = id->look;
    else
    sd->status.head_mid = 0;
    if((pos&EQP_HEAD_MID && (pc_checkequip(sd,EQP_COSTUME_HEAD_MID)) < 0) || pos&EQP_COSTUME_HEAD_MID)
    clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
}
I change to:

//Added check to prevent sending the same look on multiple slots ->
//causes client to redraw item on top of itself. (suggested by Lupus)
if(strcmp( mapindex_id2name(sd->mapindex), "morocc" )){
    if(pos&(EQP_HEAD_LOW|EQP_COSTUME_HEAD_LOW)) {
        if(id && !(pos&(EQP_HEAD_TOP|EQP_HEAD_MID|EQP_COSTUME_HEAD_MID|EQP_COSTUME_HEAD_TOP)))
        sd->status.head_bottom = id->look;
        else
        sd->status.head_bottom = 0;
        if((pos&EQP_HEAD_LOW && (pc_checkequip(sd,EQP_COSTUME_HEAD_LOW)) < 0) || pos&EQP_COSTUME_HEAD_LOW)
        clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
    }
    if(pos&(EQP_HEAD_TOP|EQP_COSTUME_HEAD_TOP)) {
        if(id)
        sd->status.head_top = id->look;
        else
        sd->status.head_top = 0;
        if((pos&EQP_HEAD_TOP && (pc_checkequip(sd,EQP_COSTUME_HEAD_TOP)) < 0) || pos&EQP_COSTUME_HEAD_TOP)
        clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
    }
    if(pos&(EQP_HEAD_MID|EQP_COSTUME_HEAD_MID)) {
        if(id && !(pos&(EQP_HEAD_TOP|EQP_COSTUME_HEAD_TOP)))
        sd->status.head_mid = id->look;
        else
        sd->status.head_mid = 0;
        if((pos&EQP_HEAD_MID && (pc_checkequip(sd,EQP_COSTUME_HEAD_MID)) < 0) || pos&EQP_COSTUME_HEAD_MID)
        clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
    }
}else{ //Old way before comes costome items
    if(pos & EQP_HEAD_LOW) {
        if(id && !(pos&(EQP_HEAD_TOP|EQP_HEAD_MID)))
        sd->status.head_bottom = id->look;
        else
        sd->status.head_bottom = 0;
        clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
    }
    if(pos & EQP_HEAD_TOP) {
        if(id)
        sd->status.head_top = id->look;
        else
        sd->status.head_top = 0;
        clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
    }
    if(pos & EQP_HEAD_MID) {
        if(id && !(pos&EQP_HEAD_TOP))
        sd->status.head_mid = id->look;
        else
        sd->status.head_mid = 0;
        clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
    }
}
I put Morocc town just as example, but after I'll change the maps.

 

This change works partially: the equip just hide if is changed manually. In other words, the player needs unequip the item and after equip again, so the costume hide.

 

I think I need call this function in some other location, like when the char warps, but I do not know how to do this.

 

Can anyone help me? Very thanks!

Edited by char0
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  12/20/11
  • Last Seen:  

Up!

Edited by char0
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  12/20/11
  • Last Seen:  

Up, any can help me to solve this?

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