diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-23 15:08:37 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-23 15:08:37 +0000 |
commit | feb18879f7adaae475cd4435252eb399ee5a185e (patch) | |
tree | 2f9b2c849123fa81024ceed55908949bfd4c8207 | |
parent | e3e7adefe2227343a55a4ac6634de23e045fab09 (diff) | |
download | hercules-feb18879f7adaae475cd4435252eb399ee5a185e.tar.gz hercules-feb18879f7adaae475cd4435252eb399ee5a185e.tar.bz2 hercules-feb18879f7adaae475cd4435252eb399ee5a185e.tar.xz hercules-feb18879f7adaae475cd4435252eb399ee5a185e.zip |
- Modified battle_calc_weapon_attack to use new flags pdef/pdef (pierce defense), Investigate and Icepick will now use the final def/vit-def values rather than the base ones.
- The move-enable condition checks for skills are now checked for only when on skill use, not at cast-end time.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6714 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 5 | ||||
-rw-r--r-- | src/map/battle.c | 32 | ||||
-rw-r--r-- | src/map/skill.c | 12 |
3 files changed, 32 insertions, 17 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 4d7b07863..378e15a52 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,11 @@ 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/05/23
+ * Modified battle_calc_weapon_attack to use new flags pdef/pdef (pierce
+ defense), Investigate and Icepick will now use the final def/vit-def values
+ rather than the base ones. [Skotlex]
+ * The move-enable condition checks for skills are now checked for only when
+ on skill use, not at cast-end time. [Skotlex]
* Corrected clif parse name request failing on disguised characters [Skotlex]
* Corrected Soul Drain draining from all non-ground-based skills including
non-magic attacks. [Skotlex]
diff --git a/src/map/battle.c b/src/map/battle.c index a8f892aa0..41c2f9c16 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -995,6 +995,8 @@ static struct Damage battle_calc_weapon_attack( unsigned cri : 1; //Critical hit
unsigned idef : 1; //Ignore defense
unsigned idef2 : 1; //Ignore defense (left weapon)
+ unsigned pdef : 2; //Pierces defense (Investigate/Ice Pick)
+ unsigned pdef2 : 2; //1: Use def+def2/50, 2: Use def+def2/100
unsigned infdef : 1; //Infinite defense (plants)
unsigned arrow : 1; //Attack is arrow-based
unsigned rh : 1; //Attack considers right hand (wd.damage)
@@ -1606,6 +1608,7 @@ static struct Damage battle_calc_weapon_attack( break;
case MO_INVESTIGATE:
skillratio += 75*skill_lv;
+ flag.pdef = flag.pdef2 = 2;
break;
case MO_EXTREMITYFIST:
if (sd)
@@ -1822,25 +1825,21 @@ static struct Damage battle_calc_weapon_attack( && skill_num != CR_GRANDCROSS && skill_num != NPC_GRANDDARKNESS
&& !flag.cri)
{ //Elemental/Racial adjustments
- char raceele_flag=0, raceele_flag_=0;
if(sd->right_weapon.def_ratio_atk_ele & (1<<t_ele) ||
sd->right_weapon.def_ratio_atk_race & (1<<t_race) ||
sd->right_weapon.def_ratio_atk_race & (is_boss(target)?1<<10:1<<11)
)
- raceele_flag = flag.idef = 1;
+ flag.pdef = 1;
if(sd->left_weapon.def_ratio_atk_ele & (1<<t_ele) ||
sd->left_weapon.def_ratio_atk_race & (1<<t_race) ||
sd->left_weapon.def_ratio_atk_race & (is_boss(target)?1<<10:1<<11)
) { //Pass effect onto right hand if configured so. [Skotlex]
if (battle_config.left_cardfix_to_right && flag.rh)
- raceele_flag = flag.idef = 1;
+ flag.pdef = 1;
else
- raceele_flag_ = flag.idef2 = 1;
+ flag.pdef2 = 1;
}
-
- if (raceele_flag || raceele_flag_)
- ATK_RATE2(raceele_flag?(def1 + def2):100, raceele_flag_?(def1 + def2):100);
}
if (skill_num != CR_GRANDCROSS && skill_num != NPC_GRANDDARKNESS)
@@ -1911,12 +1910,19 @@ static struct Damage battle_calc_weapon_attack( vit_def += def1*battle_config.pet_defense_type;
def1 = 0;
}
- if(skill_num == MO_INVESTIGATE) { //Must use adjusted defense
- ATK_RATE(2*(def1 + vit_def));
- } else {
- ATK_RATE2(flag.idef?100:100-def1, flag.idef2?100:100-def1);
- ATK_ADD2(flag.idef?0:-vit_def, flag.idef2?0:-vit_def);
- }
+ if (def1 > 100) def1 = 100;
+ ATK_RATE2(
+ flag.idef ?100:
+ (flag.pdef ?flag.pdef *(def1 + vit_def):
+ 100-def1),
+ flag.idef2?100:
+ (flag.pdef2?flag.pdef2*(def1 + vit_def):
+ 100-def1)
+ );
+ ATK_ADD2(
+ flag.idef ||flag.pdef ?0:-vit_def,
+ flag.idef2||flag.pdef2?0:-vit_def
+ );
}
//Post skill/vit reduction damage increases
diff --git a/src/map/skill.c b/src/map/skill.c index e058efcc2..be7c1a6cb 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -7528,7 +7528,10 @@ int skill_isammotype(TBL_PC *sd, int skill) }
/*==========================================
- * ƒXƒLƒ‹Žg—p?Œ??i?‚ÅŽg—pŽ¸”s?j
+ * Checks that you have the requirements for casting a skill.
+ * Flag:
+ * &1: finished casting the skill (invoke hp/sp/item consumption)
+ * &2: picked menu entry (Warp Portal, Teleport and other menu based skills)
*------------------------------------------
*/
int skill_check_condition(struct map_session_data *sd,int skill, int lv, int type)
@@ -7756,7 +7759,7 @@ int skill_check_condition(struct map_session_data *sd,int skill, int lv, int typ if(sd->sc.data[SC_COMBO].val1 != MO_COMBOFINISH && sd->sc.data[SC_COMBO].val1 != CH_TIGERFIST)
return 0;
break;
- case MO_EXTREMITYFIST: // ˆ¢?C—…”e–PŒ?
+ case MO_EXTREMITYFIST:
// if(sd->sc.data[SC_EXTREMITYFIST].timer != -1) //To disable Asura during the 5 min skill block uncomment this...
// return 0;
if(sd->sc.data[SC_BLADESTOP].timer!=-1)
@@ -7769,7 +7772,7 @@ int skill_check_condition(struct map_session_data *sd,int skill, int lv, int typ else if (sd->sc.data[SC_COMBO].val1 == CH_CHAINCRUSH)
spiritball = sd->spiritball?sd->spiritball:1;
//It should consume whatever is left as long as it's at least 1.
- } else if(!unit_can_move(&sd->bl))
+ } else if(!type && !unit_can_move(&sd->bl)) //Check only on begin casting.
{ //Placed here as ST_MOVE_ENABLE should not apply if rooted or on a combo. [Skotlex]
clif_skill_fail(sd,skill,0,0);
return 0;
@@ -8162,7 +8165,8 @@ int skill_check_condition(struct map_session_data *sd,int skill, int lv, int typ }
break;
case ST_MOVE_ENABLE:
- if(!unit_can_move(&sd->bl)) {
+ //Check only on begin casting. [Skotlex]
+ if(!type && !unit_can_move(&sd->bl)) {
clif_skill_fail(sd,skill,0,0);
return 0;
}
|