summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt8
-rw-r--r--conf-tmpl/battle/skill.conf4
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/pc.c2
-rw-r--r--src/map/pc.h2
-rw-r--r--src/map/skill.c50
-rw-r--r--src/map/unit.c7
7 files changed, 35 insertions, 40 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index c5dcd73c4..e534abc96 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,14 @@ 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/04/17
+ * skill_clear_unitgroup is now invoked in unit_remove_map only on death if
+ the applicable battle setting is set. [Skotlex]
+ * Changed setting clear_unit_ondeath to a type 4 (bl-based) which defaults
+ to BL_ALL. [Skotlex]
+ * Fixed Absorb spirit sphere not working on mobs, thanks to Vividd.
+ [Skotlex]
+ * Cleared the ud->target on pc_stop_attack to prevent attack resuming an
+ other such oddities. [Skotlex]
* I seem to have broken @kami with my last commit, fixed. [Zido]
* Added @users to the IRC Bot, outputs the # of users online. [Zido]
* The baby check when wearing a tuxedo/dress now works [Zido]
diff --git a/conf-tmpl/battle/skill.conf b/conf-tmpl/battle/skill.conf
index e4db9962b..5fbab1d40 100644
--- a/conf-tmpl/battle/skill.conf
+++ b/conf-tmpl/battle/skill.conf
@@ -80,8 +80,8 @@ status_cast_cancel: no
// Strip Equipment effects are removed when you logout.
debuff_on_logout: yes
-// Should ground placed skills be removed as soon as the caster dies?
-clear_skills_on_death: yes
+// Should ground placed skills be removed as soon as the caster dies? [Note 4]
+clear_skills_on_death: 15
//Setting this to YES will override the target mode of ground-based skills with the flag 0x01 to "No Enemies"
//The two skills affected by default are Pneuma and Safety Wall (if set to yes, those two skills will not protect everyone, but only allies)
diff --git a/src/map/battle.c b/src/map/battle.c
index 7301cac5c..529a32b33 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3945,7 +3945,7 @@ void battle_set_defaults() {
battle_config.pc_damage_delay_rate=100;
battle_config.defnotenemy=0;
battle_config.vs_traps_bctall=BL_PC;
- battle_config.clear_unit_ondeath=1;
+ battle_config.clear_unit_ondeath=BL_ALL;
battle_config.random_monster_checklv=1;
battle_config.attr_recover=1;
battle_config.flooritem_lifetime=LIFETIME_FLOORITEM*1000;
diff --git a/src/map/pc.c b/src/map/pc.c
index c8195eec5..03db5bd9c 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3081,7 +3081,7 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in
unit_remove_map(&sd->pd->bl, clrtype);
clif_changemap(sd,map[m].index,x,y); // [MouseJstr]
}
-
+
sd->mapindex = mapindex;
sd->bl.m = m;
sd->bl.x = sd->ud.to_x = x;
diff --git a/src/map/pc.h b/src/map/pc.h
index 33e8eaef0..4a96893a6 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -57,7 +57,7 @@ enum {
#define pc_is90overweight(sd) (sd->weight*10 >= sd->max_weight*9)
#define pc_maxparameter(sd) ((sd->class_&JOBL_BABY) ? battle_config.max_baby_parameter : battle_config.max_parameter)
-#define pc_stop_attack(sd) { if (sd->ud.attacktimer!=-1) unit_stop_attack(&sd->bl); }
+#define pc_stop_attack(sd) { if (sd->ud.attacktimer!=-1) { unit_stop_attack(&sd->bl); sd->ud.target = 0; } }
#define pc_stop_walking(sd, type) { if (sd->ud.walktimer!=-1) unit_stop_walking(&sd->bl, type); }
//Checks if the given class value corresponds to a player class. [Skotlex]
diff --git a/src/map/skill.c b/src/map/skill.c
index d728a7a9f..a3c1b8813 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1695,8 +1695,6 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
nullpo_retr(0, dsrc); //dsrc is the actual originator of the damage, can be the same as src, or a skill casted by src.
nullpo_retr(0, bl); //Target to be attacked.
-// if(src->prev == NULL || dsrc->prev == NULL || bl->prev == NULL)
-// return 0;
if (src != dsrc) {
//When caster is not the src of attack, this is a ground skill, and as such, do the relevant target checking. [Skotlex]
if (!status_check_skilluse(battle_config.skill_caster_check?src:NULL, bl, skillid, 2))
@@ -1707,17 +1705,6 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
return 0;
}
-
- //uncomment the following to do a check between caster and target. [Skotlex]
- //eg: if you want storm gust to do no damage if the caster runs to another map after invoking the skill.
-// if(src->m != bl->m)
-// return 0;
-
- //Uncomment the following to disable trap-ground skills from hitting when the caster is dead [Skotlex]
- //eg: You cast meteor and then are killed, if you uncomment the following the meteors that fall afterwards cause no damage.
-// if(src != dsrc && status_isdead(src))
-// return 0;
-
if (dsrc->type == BL_PC)
sd = (struct map_session_data *)dsrc;
if (bl->type == BL_PC)
@@ -3923,26 +3910,23 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case MO_ABSORBSPIRITS: // ?奪
i = 0;
- if (dstsd && dstsd->spiritball > 0)
- {
- if (((sd && sd == dstsd) || map_flag_vs(src->m)) && ((dstsd->class_&MAPID_BASEMASK)!=MAPID_GUNSLINGER))
- { // split the if for readability, and included gunslingers in the check so that their coins cannot be removed [Reddozen]
- i = dstsd->spiritball * 7;
- pc_delspiritball(dstsd,dstsd->spiritball,0);
- } else if (dstmd && !(status_get_mode(bl)&MD_BOSS) && rand() % 100 < 20)
- { // check if target is a monster and not a Boss, for the 20% chance to absorb 2 SP per monster's level [Reddozen]
- i = 2 * dstmd->db->lv;
- mob_target(dstmd,src,0);
- }
- if (sd){
- if (i > 0x7FFF)
- i = 0x7FFF;
- if (sd->status.sp + i > sd->status.max_sp)
- i = sd->status.max_sp - sd->status.sp;
- if (i) {
- sd->status.sp += i;
- clif_heal(sd->fd,SP_SP,i);
- }
+ if (dstsd && dstsd->spiritball && (sd == dstsd || map_flag_vs(src->m)) && (dstsd->class_&MAPID_BASEMASK)!=MAPID_GUNSLINGER)
+ { // split the if for readability, and included gunslingers in the check so that their coins cannot be removed [Reddozen]
+ i = dstsd->spiritball * 7;
+ pc_delspiritball(dstsd,dstsd->spiritball,0);
+ } else if (dstmd && !(status_get_mode(bl)&MD_BOSS) && rand() % 100 < 20)
+ { // check if target is a monster and not a Boss, for the 20% chance to absorb 2 SP per monster's level [Reddozen]
+ i = 2 * dstmd->db->lv;
+ mob_target(dstmd,src,0);
+ }
+ if (sd){
+ if (i > 0x7FFF)
+ i = 0x7FFF;
+ if (sd->status.sp + i > sd->status.max_sp)
+ i = sd->status.max_sp - sd->status.sp;
+ if (i) {
+ sd->status.sp += i;
+ clif_heal(sd->fd,SP_SP,i);
}
}
clif_skill_nodamage(src,bl,skillid,skilllv,0);
diff --git a/src/map/unit.c b/src/map/unit.c
index 61420d43e..08b29cc5b 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1526,7 +1526,8 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
status_change_end(bl, SC_GOSPEL, -1);
}
- if (battle_config.clear_unit_ondeath || clrtype != 1) //Clrtype 1 = died.
+ if (clrtype == 1 && battle_config.clear_unit_ondeath && //Clrtype 1 = died.
+ battle_config.clear_unit_ondeath&bl->type)
skill_clear_unitgroup(bl); // スキルユニットグループの削除
if (bl->type&BL_CHAR) {
skill_unit_move(bl,gettick(),4);
@@ -1639,7 +1640,7 @@ int unit_free(struct block_list *bl) {
map_freeblock_lock();
if( bl->prev ) //Players are supposed to logout with a "warp" effect.
unit_remove_map(bl, bl->type==BL_PC?3:0);
-
+
if( bl->type == BL_PC ) {
struct map_session_data *sd = (struct map_session_data*)bl;
if(status_isdead(bl))
@@ -1751,6 +1752,8 @@ int unit_free(struct block_list *bl) {
if(mob_is_clone(md->class_))
mob_clone_delete(md->class_);
}
+
+ skill_clear_unitgroup(bl);
status_change_clear(bl,1);
if (bl->type != BL_PC)
{ //Players are handled by map_quit