- Modified pc_setoption so that it will correctly update sprite AND clothes color when mounting/unmounting changing into/from xmas/wedding sprites.

- Allowed itemdb_exists to return the dummy item. Enables "invalid" items to be sold, traded, dropped, etc.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7321 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-06-23 23:31:55 +00:00
parent 4855ad8d5e
commit 95aa55a3e6
3 changed files with 23 additions and 30 deletions

View File

@ -4,6 +4,11 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/06/23 2006/06/23
* Modified pc_setoption so that it will correctly update sprite AND clothes
color when mounting/unmounting changing into/from xmas/wedding sprites.
[Skotlex]
* Allowed itemdb_exists to return the dummy item. Enables "invalid" items
to be sold, traded, dropped, etc. [Skotlex]
* Corrected ASC_BREAKER. Int-based damage is applied after attribute fixes * Corrected ASC_BREAKER. Int-based damage is applied after attribute fixes
and before card reductions. The skill now completely disregards left and before card reductions. The skill now completely disregards left
hand weapon. [Skotlex] hand weapon. [Skotlex]

View File

@ -135,7 +135,7 @@ int itemdb_group (int nameid)
struct item_data* itemdb_exists(int nameid) struct item_data* itemdb_exists(int nameid)
{ {
struct item_data* id = idb_get(item_db,nameid); struct item_data* id = idb_get(item_db,nameid);
if (id == &dummy_item) return NULL; // if (id == &dummy_item) return NULL; //Let dummy items go through... technically they "exist" because someone already has them...
return id; return id;
} }

View File

@ -5476,7 +5476,7 @@ int pc_changelook(struct map_session_data *sd,int type,int val)
*/ */
int pc_setoption(struct map_session_data *sd,int type) int pc_setoption(struct map_session_data *sd,int type)
{ {
int p_type; int p_type, new_look=0;
nullpo_retr(0, sd); nullpo_retr(0, sd);
p_type = sd->sc.option; p_type = sd->sc.option;
@ -5486,20 +5486,13 @@ int pc_setoption(struct map_session_data *sd,int type)
if (type&OPTION_RIDING && !(p_type&OPTION_RIDING) && (sd->class_&MAPID_BASEMASK) == MAPID_SWORDMAN) if (type&OPTION_RIDING && !(p_type&OPTION_RIDING) && (sd->class_&MAPID_BASEMASK) == MAPID_SWORDMAN)
{ //We are going to mount. [Skotlex] { //We are going to mount. [Skotlex]
status_set_viewdata(&sd->bl, sd->status.class_); //Adjust view class. new_look = -1;
clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
if (sd->vd.cloth_color)
clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
clif_status_load(&sd->bl,SI_RIDING,1); clif_status_load(&sd->bl,SI_RIDING,1);
status_calc_pc(sd,0); //Mounting/Umounting affects walk and attack speeds. status_calc_pc(sd,0); //Mounting/Umounting affects walk and attack speeds.
} }
else if (!(type&OPTION_RIDING) && p_type&OPTION_RIDING && (sd->class_&MAPID_BASEMASK) == MAPID_SWORDMAN) else if (!(type&OPTION_RIDING) && p_type&OPTION_RIDING && (sd->class_&MAPID_BASEMASK) == MAPID_SWORDMAN)
{ //We are going to dismount. { //We are going to dismount.
if (sd->vd.class_ != sd->status.class_) { new_look = -1;
status_set_viewdata(&sd->bl, sd->status.class_);
clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
}
clif_status_load(&sd->bl,SI_RIDING,0); clif_status_load(&sd->bl,SI_RIDING,0);
status_calc_pc(sd,0); //Mounting/Umounting affects walk and attack speeds. status_calc_pc(sd,0); //Mounting/Umounting affects walk and attack speeds.
} }
@ -5520,33 +5513,28 @@ int pc_setoption(struct map_session_data *sd,int type)
clif_status_load(&sd->bl,SI_FALCON,0); clif_status_load(&sd->bl,SI_FALCON,0);
if (type&OPTION_FLYING && !(p_type&OPTION_FLYING)) if (type&OPTION_FLYING && !(p_type&OPTION_FLYING))
clif_changelook(&sd->bl,LOOK_BASE,JOB_STAR_GLADIATOR2); new_look = JOB_STAR_GLADIATOR2;
else if (!(type&OPTION_FLYING) && p_type&OPTION_FLYING) else if (!(type&OPTION_FLYING) && p_type&OPTION_FLYING)
{ new_look = -1;
status_set_viewdata(&sd->bl, sd->status.class_);
clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
if(sd->status.clothes_color)
clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->status.clothes_color);
}
if (type&OPTION_WEDDING && !(p_type&OPTION_WEDDING)) if (type&OPTION_WEDDING && !(p_type&OPTION_WEDDING))
clif_changelook(&sd->bl,LOOK_BASE,JOB_WEDDING); new_look = JOB_WEDDING;
else if (!(type&OPTION_WEDDING) && p_type&OPTION_WEDDING) else if (!(type&OPTION_WEDDING) && p_type&OPTION_WEDDING)
{ new_look = -1;
status_set_viewdata(&sd->bl, sd->status.class_);
clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
if(sd->status.clothes_color)
clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->status.clothes_color);
}
if (type&OPTION_XMAS && !(p_type&OPTION_XMAS)) if (type&OPTION_XMAS && !(p_type&OPTION_XMAS))
clif_changelook(&sd->bl,LOOK_BASE,JOB_XMAS); new_look = JOB_XMAS;
else if (!(type&OPTION_XMAS) && p_type&OPTION_XMAS) else if (!(type&OPTION_XMAS) && p_type&OPTION_XMAS)
{ new_look = -1;
if (new_look < 0) { //Restore normal look.
status_set_viewdata(&sd->bl, sd->status.class_); status_set_viewdata(&sd->bl, sd->status.class_);
clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_); new_look = sd->vd.class_;
if(sd->status.clothes_color) }
clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->status.clothes_color); if (new_look) {
clif_changelook(&sd->bl,LOOK_BASE,new_look);
if (sd->vd.cloth_color)
clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
} }
return 0; return 0;
} }