summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-30 20:43:57 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-30 20:43:57 +0000
commit8500597883d7ff7ace2a7d9c661c5c468c8d8ce3 (patch)
treebe81be6a49f90fa2021fca7c9d8f95542f4bb9a2
parent4362a0c677113465c450da34148e10676c32298f (diff)
downloadhercules-8500597883d7ff7ace2a7d9c661c5c468c8d8ce3.tar.gz
hercules-8500597883d7ff7ace2a7d9c661c5c468c8d8ce3.tar.bz2
hercules-8500597883d7ff7ace2a7d9c661c5c468c8d8ce3.tar.xz
hercules-8500597883d7ff7ace2a7d9c661c5c468c8d8ce3.zip
- Mob casted Sanctuary will no longer always heal it's targets regardless of element/race
- Status change packets will now use as criteria for sending the actual view_class instead of player/not-player. This will fix status-changes displaying improperly on clones, and also possible crashes with disguised players. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7984 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt6
-rw-r--r--src/map/skill.c5
-rw-r--r--src/map/status.c24
3 files changed, 15 insertions, 20 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index c03068d52..1f1c41ef8 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,12 @@ 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/07/30
+ * Mob casted Sanctuary will no longer always heal it's targets regardless
+ of element/race [Skotlex]
+ * Status change packets will now use as criteria for sending the actual
+ view_class instead of player/not-player. This will fix status-changes
+ displaying improperly on clones, and also possible crashes with disguised
+ players. [Skotlex]
* Merged mpeg's fix on ninja skills and SA_VOLCANO,SA_DELUGE,SA_VIOLENTGALE [Toms]
* Added bNoMiscDamage setting so you can specify misc-damage blocking from
skills. Modified battle_calc_damage so that even Pressure and similar
diff --git a/src/map/skill.c b/src/map/skill.c
index a1f02e31a..e9806d666 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -3280,7 +3280,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
return 1;
if(status_isdead(src))
return 1;
-if(src!=bl && status_isdead(bl) && skillid != ALL_RESURRECTION && skillid != PR_REDEMPTIO)
+ if(src!=bl && status_isdead(bl) && skillid != ALL_RESURRECTION && skillid != PR_REDEMPTIO)
return 1;
tstatus = status_get_status_data(bl);
@@ -7029,8 +7029,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
}
case UNT_SANCTUARY:
- //Only player casted Sanctuaries will do offensive heal.
- if (sd && (battle_check_undead(tstatus->race, tstatus->def_ele) || tstatus->race==RC_DEMON))
+ if (battle_check_undead(tstatus->race, tstatus->def_ele) || tstatus->race==RC_DEMON)
{ //Only damage enemies with offensive Sanctuary. [Skotlex]
if(battle_check_target(&src->bl,bl,BCT_ENEMY)>0 &&
skill_attack(BF_MAGIC, ss, &src->bl, bl, sg->skill_id, sg->skill_lv, tick, 0))
diff --git a/src/map/status.c b/src/map/status.c
index f572b6fe8..58aae14ac 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -4307,6 +4307,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
struct homun_data *hd = NULL;
struct status_change* sc;
struct status_data *status;
+ struct view_data *vd;
int opt_flag , calc_flag, undead_flag;
nullpo_retr(0, bl);
@@ -4656,6 +4657,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
sc->data[type].timer = -1;
}
+ vd = status_get_viewdata(bl);
calc_flag = StatusChangeFlagTable[type];
if(!(flag&4)) //Do not parse val settings when loading SCs
switch(type){
@@ -4832,8 +4834,6 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
case SC_WEDDING:
case SC_XMAS:
- {
- struct view_data *vd = status_get_viewdata(bl);
if (!vd) return 0;
//Store previous values as they could be removed.
val1 = vd->class_;
@@ -4845,7 +4845,6 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
clif_changelook(bl,LOOK_WEAPON,0);
clif_changelook(bl,LOOK_SHIELD,0);
clif_changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color);
- }
break;
case SC_NOCHAT:
if(!battle_config.muting_players) {
@@ -5301,13 +5300,9 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
else
val2 = 0; //0 -> Half stat.
break;
- case SC_TRICKDEAD: /* 死んだふり */
- {
- struct view_data *vd = status_get_viewdata(bl);
+ case SC_TRICKDEAD:
if (vd) vd->dead_sit = 1;
break;
- }
-
case SC_CONCENTRATE:
val2 = 2 + val1;
if (sd) { //Store the card-bonus data that should not count in the %
@@ -5446,7 +5441,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
break;
}
- if (sd) //Only for players, client crashes if they receive this for a mob o.O [Skotlex]
+ 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);
// Set option as needed.
@@ -5662,6 +5657,7 @@ int status_change_end( struct block_list* bl , int type,int tid )
struct map_session_data *sd;
struct status_change *sc;
struct status_data *status;
+ struct view_data *vd;
int opt_flag=0, calc_flag;
nullpo_retr(0, bl);
@@ -5690,8 +5686,6 @@ int status_change_end( struct block_list* bl , int type,int tid )
switch(type){
case SC_WEDDING:
case SC_XMAS:
- {
- struct view_data *vd = status_get_viewdata(bl);
if (!vd) return 0;
if (sd) //Load data from sd->status.* as the stored values could have changed.
status_set_viewdata(bl, sd->status.class_);
@@ -5705,7 +5699,6 @@ int status_change_end( struct block_list* bl , int type,int tid )
clif_changelook(bl,LOOK_WEAPON,vd->weapon);
clif_changelook(bl,LOOK_SHIELD,vd->shield);
clif_changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color);
- }
break;
case SC_RUN:
{
@@ -5895,12 +5888,9 @@ int status_change_end( struct block_list* bl , int type,int tid )
case SC_MOONLIT: //Clear the unit effect. [Skotlex]
skill_setmapcell(bl,CG_MOONLIT, sc->data[SC_MOONLIT].val1, CELL_CLRMOONLIT);
break;
- case SC_TRICKDEAD: /* 死んだふり */
- {
- struct view_data *vd = status_get_viewdata(bl);
+ case SC_TRICKDEAD:
if (vd) vd->dead_sit = 0;
break;
- }
case SC_WARM:
if (sc->data[type].val4) { //Clear the group.
struct skill_unit_group *group = (struct skill_unit_group *)sc->data[type].val4;
@@ -5927,7 +5917,7 @@ int status_change_end( struct block_list* bl , int type,int tid )
break; //guess hes not in jail :P
}
- if (sd)
+ if (vd && pcdb_checkid(vd->class_))
clif_status_change(bl,StatusIconChangeTable[type],0);
opt_flag = 1;