diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-24 19:01:53 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-24 19:01:53 +0000 |
commit | 0b4c74ca60babc8e1cc3a5cc2225b5705a430586 (patch) | |
tree | 1ee9ffddee70be1397d153ec29d62aab958be559 /src/map | |
parent | f8ebb28853a8a9c51725778688af0c4bb54d31e0 (diff) | |
download | hercules-0b4c74ca60babc8e1cc3a5cc2225b5705a430586.tar.gz hercules-0b4c74ca60babc8e1cc3a5cc2225b5705a430586.tar.bz2 hercules-0b4c74ca60babc8e1cc3a5cc2225b5705a430586.tar.xz hercules-0b4c74ca60babc8e1cc3a5cc2225b5705a430586.zip |
- Adjusted skill_castfix_sc so that Suffragium will get consumed even on instant cast skills, but Memorize won't.
- Adjusted map_countoncell to receive the BL_* defines currently used instead of 0 to signal all.
- BladeStop will now end when either of the characters is moved (knocked out?) around.
- Moved the Zeny penalty code from respawn to pc_dead.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7859 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/map.c | 11 | ||||
-rw-r--r-- | src/map/pc.c | 18 | ||||
-rw-r--r-- | src/map/skill.c | 10 |
3 files changed, 19 insertions, 20 deletions
diff --git a/src/map/map.c b/src/map/map.c index bdf147082..323ad3681 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -498,6 +498,8 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) { status_change_end(bl, SC_CLOSECONFINE, -1); if (sc->data[SC_CLOSECONFINE2].timer != -1) status_change_end(bl, SC_CLOSECONFINE2, -1); + if (sc->data[SC_BLADESTOP].timer != -1) + status_change_end(bl, SC_BLADESTOP, -1); } } if (moveblock) map_delblock_sub(bl,0); @@ -575,21 +577,20 @@ int map_count_oncell(int m, int x, int y, int type) { bx = x/BLOCK_SIZE; by = y/BLOCK_SIZE; - if (type == 0 || type != BL_MOB) + if (type&~BL_MOB) { bl = map[m].block[bx+by*map[m].bxs]; c = map[m].block_count[bx+by*map[m].bxs]; for(i=0;i<c && bl;i++,bl=bl->next) - if(bl->x == x && bl->y == y && bl->type == (type?type:BL_PC)) count++; + if(bl->x == x && bl->y == y && bl->type&type) count++; } - if (type == 0 || type == BL_MOB) + if (type&BL_MOB) { bl = map[m].block_mob[bx+by*map[m].bxs]; c = map[m].block_mob_count[bx+by*map[m].bxs]; - for(i=0;i<c && bl;i++,bl=bl->next){ + for(i=0;i<c && bl;i++,bl=bl->next) if(bl->x == x && bl->y == y) count++; - } } return count; } diff --git a/src/map/pc.c b/src/map/pc.c index c15fca7f9..ed58ded57 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -297,16 +297,6 @@ int pc_setrestartvalue(struct map_session_data *sd,int type) { } /* removed exp penalty on spawn [Valaris] */ - if(type&2 && (sd->class_&MAPID_UPPERMASK) != MAPID_NOVICE && battle_config.zeny_penalty > 0 && !map[sd->bl.m].flag.nozenypenalty) { - int zeny = (int)((double)sd->status.zeny * (double)battle_config.zeny_penalty / 10000.); - if(zeny < 1) zeny = 1; - if (sd->status.zeny > zeny) - sd->status.zeny -= zeny; - else - sd->status.zeny = 0; - clif_updatestatus(sd,SP_ZENY); - } - return 0; } @@ -4902,7 +4892,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) if (battle_config.death_penalty_base > 0) { switch (battle_config.death_penalty_type) { case 1: - base_penalty += (unsigned int) ((double)pc_nextbaseexp(sd) * (double)battle_config.death_penalty_base/10000); + base_penalty = (unsigned int) ((double)pc_nextbaseexp(sd) * (double)battle_config.death_penalty_base/10000); break; case 2: base_penalty = (unsigned int) ((double)sd->status.base_exp * (double)battle_config.death_penalty_base/10000); @@ -4939,6 +4929,12 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) clif_updatestatus(sd,SP_JOBEXP); } } + if(battle_config.zeny_penalty > 0 && !map[sd->bl.m].flag.nozenypenalty) + { + base_penalty = (unsigned int)((double)sd->status.zeny * (double)battle_config.zeny_penalty / 10000.); + if(base_penalty) + pc_payzeny(sd, base_penalty); + } } if(map[sd->bl.m].flag.pvp_nightmaredrop){ // Moved this outside so it works when PVP isnt enabled and during pk mode [Ancyker] diff --git a/src/map/skill.c b/src/map/skill.c index 230b35e55..3e92d7357 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -7053,7 +7053,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns // GXは重なっていたら3HITしない if ((skillid==CR_GRANDCROSS || skillid==NPC_GRANDDARKNESS) && !battle_config.gx_allhit) - ts->tick += sg->interval*(map_count_oncell(bl->m,bl->x,bl->y,0)-1); + ts->tick += sg->interval*(map_count_oncell(bl->m,bl->x,bl->y,BL_CHAR)-1); } //Temporarily set magic power to have it take effect. [Skotlex] if (sg->state.magic_power && sc && sc->data[SC_MAGICPOWER].timer == -1) @@ -8582,14 +8582,16 @@ int skill_castfix_sc (struct block_list *bl, int time) { struct status_change *sc = status_get_sc(bl); -// if (time <= 0) return 0; //Reports say that Suffragium should be consumed even on instant cast skills [Skotlex] - if (sc && sc->count) { if (sc->data[SC_SUFFRAGIUM].timer != -1) { time -= time * (sc->data[SC_SUFFRAGIUM].val1 * 15) / 100; status_change_end(bl, SC_SUFFRAGIUM, -1); } - if (sc->data[SC_MEMORIZE].timer != -1) { + + if (time <= 0) + return 0; //Only Suffragium gets consumed even if time is 0 + + if (sc->data[SC_MEMORIZE].timer != -1 && time > 0) { time>>=1; if ((--sc->data[SC_MEMORIZE].val2) <= 0) status_change_end(bl, SC_MEMORIZE, -1); |