summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-15 15:42:55 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-15 15:42:55 +0000
commite8dd3b47a2ba4537db07c9a1b693d3ed99c75ff2 (patch)
treeece62c5e0450f11153eb92cbd029cc62bfccbe3e
parente4803fa9d29af8a88a20039c636cb47fcb2a898a (diff)
downloadhercules-e8dd3b47a2ba4537db07c9a1b693d3ed99c75ff2.tar.gz
hercules-e8dd3b47a2ba4537db07c9a1b693d3ed99c75ff2.tar.bz2
hercules-e8dd3b47a2ba4537db07c9a1b693d3ed99c75ff2.tar.xz
hercules-e8dd3b47a2ba4537db07c9a1b693d3ed99c75ff2.zip
- Added SCB_DYE which marks which status-changes need a forced cloth dye change to 0 due to sprite issues. Currently only NJ_BUNSINJYUTSU's status uses it.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8293 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--src/map/status.c30
-rw-r--r--src/map/status.h4
3 files changed, 24 insertions, 13 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 9a41edfd3..b62f5e04b 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,9 @@ 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.
2006/08/15
+ * Added SCB_DYE which marks which status-changes need a forced cloth dye
+ change to 0 due to sprite issues. Currently only NJ_BUNSINJYUTSU's status
+ uses it. [Skotlex]
* Asura Strike now moves you to the target on fail always (unless the
target does not exists or is in another map or there's a obstacle on the
way) [Skotlex]
diff --git a/src/map/status.c b/src/map/status.c
index a198de02f..4022565e0 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -357,7 +357,7 @@ void initChangeTables(void) {
add_sc(NJ_HYOUSYOURAKU, SC_FREEZE);
set_sc(NJ_NEN, SC_NEN, SI_NEN, SCB_STR|SCB_INT);
set_sc(NJ_UTSUSEMI, SC_UTSUSEMI, SI_UTSUSEMI,SCB_NONE);
- set_sc(NJ_BUNSINJYUTSU, SC_BUNSINJYUTSU, SI_BUNSINJYUTSU, SCB_NONE);
+ set_sc(NJ_BUNSINJYUTSU, SC_BUNSINJYUTSU, SI_BUNSINJYUTSU, SCB_DYE);
set_sc(CR_SHRINK, SC_SHRINK, SI_SHRINK, SCB_NONE);
set_sc(RG_CLOSECONFINE, SC_CLOSECONFINE2, SI_CLOSECONFINE2, SCB_NONE);
set_sc(RG_CLOSECONFINE, SC_CLOSECONFINE, SI_CLOSECONFINE, SCB_FLEE);
@@ -4454,13 +4454,6 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
}
//Before overlapping fail, one must check for status cured.
switch (type) {
- case SC_BUNSINJYUTSU: //[blackhole89]
- if(sd)
- {
- val4=sd->status.clothes_color;
- pc_changelook(sd,LOOK_CLOTHES_COLOR,0);
- }
- break;
case SC_BLESSING:
if ((!undead_flag && status->race!=RC_DEMON) || bl->type == BL_PC) {
if (sc->data[SC_CURSE].timer!=-1)
@@ -5590,6 +5583,16 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
if(opt_flag)
clif_changeoption(bl);
+ if (calc_flag&SCB_DYE)
+ { //Reset DYE color
+ if (vd && vd->cloth_color)
+ {
+ val4 = vd->cloth_color;
+ clif_changelook(bl,LOOK_CLOTHES_COLOR,0);
+ }
+ calc_flag&=~SCB_DYE;
+ }
+
if (vd && pcdb_checkid(vd->class_)) //Only for players sprites, client crashes if they receive this for a mob o.O [Skotlex]
clif_status_change(bl,StatusIconChangeTable[type],1);
else if (sd) //Send packet to self otherwise (disguised player?)
@@ -5729,10 +5732,6 @@ int status_change_end( struct block_list* bl , int type,int tid )
vd = status_get_viewdata(bl);
calc_flag = StatusChangeFlagTable[type];
switch(type){
- case SC_BUNSINJYUTSU: //[blackhole89]
- {
- if(sd) pc_changelook(sd,LOOK_CLOTHES_COLOR,sc->data[type].val4);
- }
case SC_WEDDING:
case SC_XMAS:
if (!vd) return 0;
@@ -6082,6 +6081,13 @@ int status_change_end( struct block_list* bl , int type,int tid )
opt_flag = 0;
}
+ if (calc_flag&SCB_DYE)
+ { //Restore DYE color
+ if (vd && !vd->cloth_color && sc->data[type].val4)
+ clif_changelook(bl,LOOK_CLOTHES_COLOR,sc->data[type].val4);
+ calc_flag&=~SCB_DYE;
+ }
+
//On Aegis, when turning off a status change, first goes the sc packet, then the option packet.
if (vd && pcdb_checkid(vd->class_))
clif_status_change(bl,StatusIconChangeTable[type],0);
diff --git a/src/map/status.h b/src/map/status.h
index 970a6e578..a8e17539c 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -514,8 +514,10 @@ enum {
#define SCB_SIZE 0x04000000
#define SCB_RACE 0x08000000
#define SCB_RANGE 0x10000000
+//SCB_DYE means the sc should force cloth-dye change to 0 to avoid client crashes.
+#define SCB_DYE 0x40000000
#define SCB_PC 0x80000000
-#define SCB_ALL 0x7FFFFFFF
+#define SCB_ALL 0x3FFFFFFF
//Define to determine who gets HP/SP consumed on doing skills/etc. [Skotlex]
#define BL_CONSUME (BL_PC|BL_HOM)