diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-30 15:50:54 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-30 15:50:54 +0000 |
commit | c09b285a4ed34188ae0f4d13a9f235352e12009e (patch) | |
tree | 736189f0c9b04fd6b0f76ba2783d0ffee0a430ad /src/map/battle.c | |
parent | b463207e4730edf3877b57577e8ac91decaca5c8 (diff) | |
download | hercules-c09b285a4ed34188ae0f4d13a9f235352e12009e.tar.gz hercules-c09b285a4ed34188ae0f4d13a9f235352e12009e.tar.bz2 hercules-c09b285a4ed34188ae0f4d13a9f235352e12009e.tar.xz hercules-c09b285a4ed34188ae0f4d13a9f235352e12009e.zip |
- the auth function in login.c won't jstrescapecpy passwords that were encrypted.
- Moved the Endure and Gravitation sc ends to battle_damage from pc_damage.
- Endure level 11 and above are now considered infinite-endure.
- Set the minimum pet hungry delay to 10
- modified function skill_delayfix to only receive skill/lv, actual time is now always acquired from skill_get_delay. It also now will never return a value below min_skill_delay_limit.
- Modified brandish spear so you won't see the skill-animation for every targetted mob. Also cleaned it up to use map_foreachincell calls.
- splitted skill_cast_fix into skill_cast_fix and skill_cast_fix_sc, the first does cast adjustments based on dex and server settings, the later only based on sc changes. Mobs use the later while everyone else use the former (which invokes the later when appropiate)
- Added the Steel Body icon to auto-berserk.
- Now you can't cast auto-counter while the previous one is active.
- For the duration of Berserk, infinite-endure is activated.
- Added Veider's suggestion to do a hack-report when players request the name of an invisible/cloaked character.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5813 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index dbd706e07..479a2c0e1 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -160,12 +160,12 @@ int battle_delay_damage (unsigned int tick, struct block_list *src, struct block }
// ŽÀ?Û‚ÉHP‚ð‘€?ì
-int battle_damage(struct block_list *bl,struct block_list *target,int damage, int flag)
+int battle_damage(struct block_list *src,struct block_list *target,int damage, int flag)
{
struct map_session_data *sd = NULL;
struct status_change *sc;
- nullpo_retr(0, target); //bl‚ÍNULL‚ŌĂ΂ê‚邱‚Æ‚ª‚ ‚é‚Ì‚Å‘¼‚Ń`ƒFƒbƒN
+ nullpo_retr(0, target); //stc‚ÍNULL‚ŌĂ΂ê‚邱‚Æ‚ª‚ ‚é‚Ì‚Å‘¼‚Ń`ƒFƒbƒN
sc = status_get_sc(target);
@@ -174,16 +174,14 @@ int battle_damage(struct block_list *bl,struct block_list *target,int damage, in target->type == BL_PET)
return 0;
- if (bl) {
- if (bl->prev == NULL)
+ if (src) {
+ if (src->prev == NULL)
return 0;
- if (bl->type == BL_PC) {
- nullpo_retr(0, sd = (struct map_session_data *)bl);
- }
+ BL_CAST(BL_PC, src, sd);
}
if (damage < 0)
- return battle_heal(bl,target,-damage,0,flag);
+ return battle_heal(src,target,-damage,0,flag);
if (!flag && sc && sc->count) {
// “€Œ‹?A?Ή»?A?‡–°‚ð?Á‹Ž
@@ -205,14 +203,30 @@ int battle_damage(struct block_list *bl,struct block_list *target,int damage, in status_change_end(target, SC_CLOAKING, -1);
if (sc->data[SC_CHASEWALK].timer != -1)
status_change_end(target, SC_CHASEWALK, -1);
+ if (sc->data[SC_ENDURE].timer != -1 && sc->data[SC_ENDURE].val1 <= 10) {
+ //Endure count is only reduced by non-players on non-gvg maps.
+ //if val1 is greater than 10, this is infinite endure. [Skotlex]
+ if (src && src->type != BL_PC && !map_flag_gvg(target->m)
+ && --(sc->data[SC_ENDURE].val2) < 0)
+ status_change_end(target, SC_ENDURE, -1);
+ }
+ if (sc->data[SC_GRAVITATION].timer != -1 &&
+ sc->data[SC_GRAVITATION].val3 == BCT_SELF) {
+ struct skill_unit_group *sg = (struct skill_unit_group *)sc->data[SC_GRAVITATION].val4;
+ if (sg) {
+ skill_delunitgroup(sg);
+ sc->data[SC_GRAVITATION].val4 = 0;
+ status_change_end(target, SC_GRAVITATION, -1);
+ }
+ }
}
-
- if (sc && sc->count && sc->data[SC_DEVOTION].val1 && bl && battle_getcurrentskill(bl) != PA_PRESSURE)
+
+ if (sc && sc->count && sc->data[SC_DEVOTION].val1 && src && battle_getcurrentskill(src) != PA_PRESSURE)
{ //Devotion only works on attacks from a source (to prevent it from absorbing coma) [Skotlex]
struct map_session_data *sd2 = map_id2sd(sc->data[SC_DEVOTION].val1);
if (sd2 && sd2->devotion[sc->data[SC_DEVOTION].val2] == target->id)
{
- clif_damage(bl, &sd2->bl, gettick(), 0, 0, damage, 0, 0, 0);
+ clif_damage(src, &sd2->bl, gettick(), 0, 0, damage, 0, 0, 0);
pc_damage(&sd2->bl, sd2, damage);
return 0;
} else
@@ -220,11 +234,11 @@ int battle_damage(struct block_list *bl,struct block_list *target,int damage, in }
unit_skillcastcancel(target, 2);
if (target->type == BL_MOB) {
- return mob_damage(bl,(TBL_MOB*)target, damage,0);
+ return mob_damage(src,(TBL_MOB*)target, damage,0);
} else if (target->type == BL_PC) {
- return pc_damage(bl,(TBL_PC*)target,damage);
+ return pc_damage(src,(TBL_PC*)target,damage);
} else if (target->type == BL_SKILL)
- return skill_unit_ondamaged((struct skill_unit *)target, bl, damage, gettick());
+ return skill_unit_ondamaged((struct skill_unit *)target, src, damage, gettick());
return 0;
}
@@ -4305,6 +4319,9 @@ void battle_validate_conf() { if(battle_config.pet_support_min_friendly > 950) //Capped to 950/1000 [Skotlex]
battle_config.pet_support_min_friendly = 950;
+ if(battle_config.pet_hungry_delay_rate < 10)
+ battle_config.pet_hungry_delay_rate=10;
+
if(battle_config.pet_max_atk1 > battle_config.pet_max_atk2) //Skotlex
battle_config.pet_max_atk1 = battle_config.pet_max_atk2;
|