diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-17 23:54:49 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-17 23:54:49 +0000 |
commit | 6ed44f7303f11ed2de589fca48b19092c2738409 (patch) | |
tree | 7240e16cfb7e7a3b0e0433aab2e0c8c741a5b2bd /src/map | |
parent | b48816ba37affa20998a64300af083faa6c70127 (diff) | |
download | hercules-6ed44f7303f11ed2de589fca48b19092c2738409.tar.gz hercules-6ed44f7303f11ed2de589fca48b19092c2738409.tar.bz2 hercules-6ed44f7303f11ed2de589fca48b19092c2738409.tar.xz hercules-6ed44f7303f11ed2de589fca48b19092c2738409.zip |
- skill_clear_unitgroup is now invoked in unit_remove_map only on death if the applicable battle setting is set. It is now also invoked in unit_free.
- Changed setting clear_unit_ondeath to a type 4 (bl-based) which defaults to BL_ALL.
- Fixed Absorb spirit sphere not working on mobs, thanks to Vividd.
- Cleared the ud->target on pc_stop_attack to prevent attack resuming an other such oddities.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6145 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 2 | ||||
-rw-r--r-- | src/map/pc.c | 2 | ||||
-rw-r--r-- | src/map/pc.h | 2 | ||||
-rw-r--r-- | src/map/skill.c | 50 | ||||
-rw-r--r-- | src/map/unit.c | 7 |
5 files changed, 25 insertions, 38 deletions
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
|