Jump to content
  • 0
Sign in to follow this  
Only4fun

Hide costume item in certain maps

Question

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!

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

This function is probably only called when an item is equipped, so yes you'll need to either create a new function on map load, or if feasible call the same function.

Edited by Smokexyz

Share this post


Link to post
Share on other sites
  • 0

This function is probably only called when an item is equipped, so yes you'll need to either create a new function on map load, or if feasible call the same function.

 

Perfect! Thanks to reply. But how do that?

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.