summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt6
-rw-r--r--db/Changelog.txt2
-rw-r--r--db/skill_db.txt22
-rw-r--r--src/map/battle.c85
4 files changed, 66 insertions, 49 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 19e50377f..429e509db 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -5,6 +5,12 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/03/10
+ * Changed div (multi-hit) behaviour. Skills with div above zero will get
+ their total damage increased by the number of hits, div less than zero is
+ just for "show", total number of hits displayed is abs(div), but damage
+ isn't increased by number of hits. [Skotlex]
+ * Adjusted several skill damage equations to make up for the above change.
+ [Skotlex]
* Fixed a overflow bug when one of the item_random* files has too many
random items. [Skotlex]
* Fixed a variable loopback problem on NPC shop price checking routine. [Lance]
diff --git a/db/Changelog.txt b/db/Changelog.txt
index 6ec2b209a..b9b4b864c 100644
--- a/db/Changelog.txt
+++ b/db/Changelog.txt
@@ -27,6 +27,8 @@
=========================
03/10
+ * Updated div of LoV, Combo Skills and other such skills whose damage
+ equation does not really scales well with the number of hits. [Skotlex]
* Made G_Giant_Hornet Agressive, thanks to Blackgatomon [Lupus]
* Doppel's drops fix Lance 1411 -> Lance 1410 [Lupus]
03/08
diff --git a/db/skill_db.txt b/db/skill_db.txt
index ff5b6846d..449982dfb 100644
--- a/db/skill_db.txt
+++ b/db/skill_db.txt
@@ -7,7 +7,8 @@
// 06 nk (0- normal skill, 1-no damage skill, 2-splash damage skill, 3-no damage area skill)
// 07 splash/effect range (-1 for screen-wide)
// 08 MaxLv
-// 09 Hit frequency (number of hits skill does)
+// 09 Number of hits (when positive, damage is increased by hits,
+// negative values just show number of hits without increasing total damage)
// 10 castcancelled (it is cancelled at 1. Are not cancelled with 0)
// 11 defense-reduction rate during cast.
// 12 inf2 (skill information 2) (1- quest skill, 2- npc skill, 4- wedding skill
@@ -103,7 +104,7 @@
//82,9,6,2,3,0,0,10,1,yes,0,0,0,magic,0 //WZ_FIREIVY#Fire Ivy#
83,9,8,2,3,0,7:7:7:7:7:7:7:7:7:7:14,10,1:1:2:2:3:3:4:4:5:5,yes,0,0,0,magic,0 //WZ_METEOR#Meteor Storm#
84,9,8,1,4,0,0,10,3:4:5:6:7:8:9:10:11:12,yes,0,0,0,magic,2:3:3:4:4:5:5:6:6:7 //WZ_JUPITEL#Jupiter Thunder#
-85,9,8,2,4,0,0,10,10,yes,0,0,0,magic,0 //WZ_VERMILION#Lord of Vermilion#
+85,9,8,2,4,0,0,10,-10,yes,0,0,0,magic,0 //WZ_VERMILION#Lord of Vermilion#
86,9,8,1,1,0,0,5,1,yes,0,0,0,magic,0 //WZ_WATERBALL#Water Ball#
87,9,6,2,1,0,0,10,1,yes,0,0,0,magic,0 //WZ_ICEWALL#Ice Wall#
88,9,6,4,1,2,5,10,1,yes,0,0,0,magic,0 //WZ_FROSTNOVA#Frost Nova#
@@ -248,7 +249,7 @@
227,0,0,0,0,0,0,10,0,no,0,0,0,none,0 //AM_LEARNINGPOTION#Potion Research#
228,0,6,4,0,1,0,10,0,no,0,0,0,none,0 //AM_PHARMACY#Prepare Potion#
229,9,6,2,3,1,0,5,1,yes,0,0,0,weapon,0 //AM_DEMONSTRATION#Bomb#
-230,9,6,1,0,0,0,5,0,yes,0,0,0,weapon,0 //AM_ACIDTERROR#Acid Terror#
+230,9,6,1,0,0,0,5,1,yes,0,0,0,weapon,0 //AM_ACIDTERROR#Acid Terror#
231,9,6,16,0,1,0,5,1,yes,0,3072,0,none,0 //AM_POTIONPITCHER#Aid Potion#
232,4,6,2,0,1,0,5,1,no,0,0,5,none,0 //AM_CANNIBALIZE#Summon Flora#
233,1,6,2,0,1,0,5,1,no,0,0,3,none,0 //AM_SPHEREMINE#Summon Marine Sphere#
@@ -271,7 +272,7 @@
250,3,6,1,0,0,0,5,1,no,0,0,0,weapon,5:6:7:8:9 //CR_SHIELDCHARGE#Smite#
251,3:5:7:9:11,6,1,0,0,0,5,1,no,0,0,0,weapon,0 //CR_SHIELDBOOMERANG#Shield Boomerang#
252,0,6,4,0,0,0,10,1,no,0,0,0,weapon,0 //CR_REFLECTSHIELD#Shield Reflect#
-253,-2,8,1,6,0,0,10,2,no,0,0,0,weapon,0 //CR_HOLYCROSS#Holy Cross#
+253,-2,8,1,6,0,0,10,-2,no,0,0,0,weapon,0 //CR_HOLYCROSS#Holy Cross#
254,9,5,4,6,0,0,10,1,no,33,256,0,magic,0 //CR_GRANDCROSS#Grand Cross#
255,7:8:9:10:11,6,16,0,1,0,5,1,yes,0,3584,0,none,0 //CR_DEVOTION#Sacrifice#
256,9,6,16,0,1,0,5,1,yes,0,512,0,none,0 //CR_PROVIDENCE#Resistant Souls#
@@ -281,7 +282,7 @@
260,0,0,0,0,0,0,5,0,no,0,0,0,weapon,0 //MO_SPIRITSRECOVERY#Spiritual Cadence#
261,0,6,4,0,1,0,5,1,no,0,0,0,none,0 //MO_CALLSPIRITS#Summon Spirit Sphere#
262,9,6,16,0,1,0,1,1,yes,0,0,0,weapon,0 //MO_ABSORBSPIRITS#Absorb Spirit Sphere#
-263,-1,8,0,-1,0,0,10,3,no,0,0,0,weapon,0 //MO_TRIPLEATTACK#Raging Triple Blow#
+263,-1,8,0,-1,0,0,10,-3,no,0,0,0,weapon,0 //MO_TRIPLEATTACK#Raging Triple Blow#
264,18,6,2,0,1,0,1,1,no,0,0,0,none,0 //MO_BODYRELOCATION#Snap#
265,0,0,0,0,0,0,10,0,no,0,0,0,weapon,0 //MO_DODGE#Dodge#
266,2,6,1,0,0,0,5,1,no,0,0,0,weapon,0 //MO_INVESTIGATE#Occult Impact#
@@ -290,7 +291,8 @@
269,0,6,4,0,1,0,5,1,no,0,0,0,weapon,0 //MO_BLADESTOP#Root#
270,0,6,4,0,1,0,5,0,no,0,0,0,weapon,0 //MO_EXPLOSIONSPIRITS#Fury#
271,-2,6,4,0,0,0,5,1,yes,0,512,0,weapon,0 //MO_EXTREMITYFIST#Asura Strike#
-272,-2,8,4,-1,0,0,5,4,no,0,512,0,weapon,0 //MO_CHAINCOMBO#Raging Quadruple Blow#273,-2,6,4,-1,2,2,5,1,no,0,512,0,weapon,0 //MO_COMBOFINISH#Raging Thrust#
+272,-2,8,4,-1,0,0,5,-4,no,0,512,0,weapon,0 //MO_CHAINCOMBO#Raging Quadruple Blow#
+273,-2,6,4,-1,2,2,5,1,no,0,512,0,weapon,0 //MO_COMBOFINISH#Raging Thrust#
274,0,0,0,0,0,0,10,0,no,0,0,0,weapon,0 //SA_ADVANCEDBOOK#Study#
275,0,6,4,0,1,0,5,1,no,0,0,0,magic,0 //SA_CASTCANCEL#Cast Cancel#
276,0,6,4,0,1,0,5,1,yes,0,0,0,magic,0 //SA_MAGICROD#Magic Rod#
@@ -355,7 +357,7 @@
335,9,6,4,0,1,0,1,1,yes,0,4,0,none,0 //WE_FEMALE#I Look up to You#
336,9,6,4,0,1,0,1,1,yes,0,4,1,none,0 //WE_CALLPARTNER#I miss You#
337,9,6,1,-1,0,0,1,1,no,0,0,0,weapon,0 //ITM_TOMAHAWK#Throw Tomahawk#
-338,-1,8,1,7,0,0,0,0,no,0,2,0,weapon,0 //NPC_DARKCROSS#Cross of Darkness#
+338,-1,8,1,7,0,0,0,-2,no,0,2,0,weapon,0 //NPC_DARKCROSS#Cross of Darkness#
339,0,6,4,7,0,0,10,1,no,33,258,0,magic,0 //NPC_GRANDDARKNESS#Grand cross of Darkness#
340,9,8,1,7,0,0,10,1:1:2:2:3:3:4:4:5:5,yes,0,2,0,magic,0 //NPC_DARKSTRIKE#Soul Strike of Darkness#
341,9,8,1,7,0,0,10,3:4:5:6:7:8:9:10:11:12,yes,0,2,0,magic,2:3:3:4:4:5:5:6:6:7 //NPC_DARKTHUNDER#Darkness Jupiter#
@@ -389,7 +391,7 @@
369,0,6,4,0,1,0,10,1,yes,0,0,0,misc,0 //PA_GOSPEL#Battle Chant#
370,-2,6,1,-1,0,0,5,1,yes,0,0,0,weapon,3 //CH_PALMSTRIKE#Raging Palm Strike#
371,-2,8,4,-1,0,0,5,1,no,0,512,0,weapon,0 //CH_TIGERFIST#Glacier Fist#
-372,-2,8,4,-1,0,0,10,1:1:2:2:3:3:4:4:5:5,no,0,512,0,weapon,0 //CH_CHAINCRUSH#Chain Crush Combo#
+372,-2,8,4,-1,0,0,10,-1:-1:-2:-2:-3:-3:-4:-4:-5:-5,no,0,512,0,weapon,0 //CH_CHAINCRUSH#Chain Crush Combo#
373,0,6,4,0,1,0,5,1,no,0,0,0,magic,0 //PF_HPCONVERSION#Health Conversion#
374,9,6,16,0,1,0,1,1,yes,0,3072,0,none,0 //PF_SOULCHANGE#Soul Exhale#
375,9,6,1,0,0,0,5,1,yes,0,0,0,magic,0 //PF_SOULBURN#Soul Siphon#
@@ -411,7 +413,7 @@
//391,0,0,4,0,1,0,1,1,yes,0,0,0,magic,0 //ST_STEALBACKPACK#Steal Backpack#
392,0,0,4,0,1,0,1,1,yes,0,0,0,none,0 //CR_ALCHEMY#Alchemy#
393,0,0,4,0,1,0,1,1,yes,0,0,0,none,0 //CR_SYNTHESISPOTION#Potion Synthesis#
-394,9,8,1,-1,0,0,10,9,yes,0,0,0,weapon,0 //CG_ARROWVULCAN#Vulcan Arrow#
+394,9,8,1,-1,0,0,10,-9,yes,0,0,0,weapon,0 //CG_ARROWVULCAN#Vulcan Arrow#
395,0,0,4,0,1,3,1,1,yes,0,0,0,misc,0 //CG_MOONLIT#Sheltering Bliss#
396,-1,6,16,0,1,0,1,1,yes,0,1536,0,none,0 //CG_MARIONETTE#Marionette Control#
397,5,8,1,-1,0,0,5,5,no,0,0,0,weapon,0 //LK_SPIRALPIERCE#Spiral Pierce#
@@ -543,7 +545,7 @@
522,0,0,0,0,0,0,10,1,no,0,0,0,weapon,0 //NJ_TOBIDOUGU#NJ_TOBIDOUGU#
523,9,6,1,-1,0,0,10,1,no,0,0,0,weapon,0 //NJ_SYURIKEN#NJ_SYURIKEN#
524,9,8,1,-1,0,0,5,3,no,0,0,0,weapon,0 //NJ_KUNAI#NJ_KUNAI#
-525,9,8,1,-1,2,2,5,1:2:3:4:5,no,0,0,0,weapon,0 //NJ_HUUMA#NJ_HUUMA#
+525,9,8,1,-1,2,2,5,-1:-2:-3:-4:-5,no,0,0,0,weapon,0 //NJ_HUUMA#NJ_HUUMA#
526,9,6,1,0,0,0,10,1,no,0,0,0,misc,0 //NJ_ZENYNAGE#NJ_ZENYNAGE#
527,0,6,4,3,0,0,5,1,no,0,0,0,weapon,0 //NJ_TATAMIGAESHI#NJ_TATAMIGAESHI#
528,1,6,1,-1,0,0,10,1,no,0,0,0,weapon,0 //NJ_KASUMIKIRI#NJ_KASUMIKIRI#
diff --git a/src/map/battle.c b/src/map/battle.c
index 7c92f1517..a4dc67b91 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1067,6 +1067,9 @@ static void battle_calc_base_damage(struct block_list *src, struct block_list *t
(*damage2) += baseatk_;
return;
}
+
+//For quick div adjustment.
+#define damage_div_fix(dmg, div) { if (div > 1) (dmg)*=div; else if (div < 0) (div)*=-1; }
/*==========================================
* battle_calc_weapon_attack (by Skotlex)
*------------------------------------------
@@ -1200,8 +1203,12 @@ static struct Damage battle_calc_weapon_attack(
break;
case MO_FINGEROFFENSIVE:
- if(sd && battle_config.finger_offensive_type == 0)
- wd.div_ = sd->spiritball_old;
+ if(sd) {
+ if (battle_config.finger_offensive_type)
+ wd.div_ = 1;
+ else
+ wd.div_ = sd->spiritball_old;
+ }
wd.flag=(wd.flag&~BF_RANGEMASK)|BF_LONG;
break;
@@ -1221,7 +1228,7 @@ static struct Damage battle_calc_weapon_attack(
break;
case KN_PIERCE:
- wd.div_= t_size+1;
+ wd.div_= (wd.div_>0?t_size+1:-(t_size+1));
break;
case TF_DOUBLE: //For NPC used skill.
@@ -1304,6 +1311,7 @@ static struct Damage battle_calc_weapon_attack(
{
wd.type=0x0b;
wd.dmg_lv=ATK_LUCKY;
+ if (wd.div_ < 0) wd.div_*=-1;
return wd;
}
}
@@ -1492,8 +1500,10 @@ static struct Damage battle_calc_weapon_attack(
flag.hit =1;
} //End hit/miss calculation
- if(tsd && tsd->special_state.no_weapon_damage)
+ if(tsd && tsd->special_state.no_weapon_damage) {
+ if (wd.div_ < 0) wd.div_*=-1;
return wd;
+ }
if (flag.hit && !flag.infdef) //No need to do the math for plants
{ //Hitting attack
@@ -1553,8 +1563,6 @@ static struct Damage battle_calc_weapon_attack(
ATK_RATE(75);
break;
}
- ATK_RATE(wd.div_*100); //Increase overall damage by number of this
- //FIXME: (shouldn't something like this apply to ALL weapon skills?) [Skotlex]
break;
}
case CR_SHIELDBOOMERANG:
@@ -1627,13 +1635,10 @@ static struct Damage battle_calc_weapon_attack(
skillratio += 50*skill_lv;
break;
case HT_POWER: //FIXME: How exactly is the STR based damage supposed to be done? [Skotlex]
- skillratio += 10*status_get_str(src);
- break;
- case TF_DOUBLE: //This is the mob-used Double Attack. [Skotlex]
- skillratio += 100;
+ skillratio += 5*status_get_str(src);
break;
case AC_DOUBLE:
- skillratio += 80+20*skill_lv;
+ skillratio += 10*(skill_lv-1);
break;
case AC_SHOWER:
skillratio += 5*skill_lv-25;
@@ -1642,7 +1647,7 @@ static struct Damage battle_calc_weapon_attack(
skillratio += 50;
break;
case KN_PIERCE:
- skillratio += wd.div_*(100+10*skill_lv)-100;
+ skillratio += 10*skill_lv;
break;
case KN_SPEARSTAB:
skillratio += 15*skill_lv;
@@ -1677,7 +1682,7 @@ static struct Damage battle_calc_weapon_attack(
skillratio += 30*skill_lv;
break;
case AS_SONICBLOW:
- skillratio += 300+40*skill_lv;
+ skillratio += -50+5*skill_lv;
break;
case TF_SPRINKLESAND:
skillratio += 30;
@@ -1690,7 +1695,6 @@ static struct Damage battle_calc_weapon_attack(
skillratio += 150; //Max damage for non players.
break;
case NPC_COMBOATTACK:
- skillratio += 100*wd.div_ -100;
break;
case NPC_RANDOMATTACK:
skillratio += rand()%150-50;
@@ -1706,10 +1710,6 @@ static struct Damage battle_calc_weapon_attack(
case NPC_TELEKINESISATTACK:
skillratio += 25*skill_lv;
break;
- case NPC_GUIDEDATTACK:
- case NPC_RANGEATTACK:
- case NPC_PIERCINGATT:
- break;
case RG_BACKSTAP:
if(sd && sd->status.weapon == 11 && battle_config.backstab_bow_penalty)
skillratio += (200+40*skill_lv)/2;
@@ -1727,8 +1727,6 @@ static struct Damage battle_calc_weapon_attack(
break;
case CR_SHIELDBOOMERANG:
skillratio += 30*skill_lv;
- if (sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_CRUSADER)
- skillratio += 100;
break;
case NPC_DARKCROSS:
case CR_HOLYCROSS:
@@ -1747,10 +1745,7 @@ static struct Damage battle_calc_weapon_attack(
flag.cardfix = 0;
break;
case MO_FINGEROFFENSIVE:
- if(battle_config.finger_offensive_type == 0)
- skillratio+= wd.div_ * (100 + 50*skill_lv) -100;
- else
- skillratio+= 50 * skill_lv;
+ skillratio+= 50 * skill_lv;
break;
case MO_INVESTIGATE:
skillratio += 75*skill_lv;
@@ -1827,7 +1822,7 @@ static struct Damage battle_calc_weapon_attack(
flag.idef = flag.idef2 = 1;
break;
case PA_SHIELDCHAIN:
- skillratio += wd.div_*(100+30*skill_lv)-100;
+ skillratio += 30*skill_lv;
break;
case WS_CARTTERMINATION:
if(sd && sd->cart_weight > 0)
@@ -1853,9 +1848,6 @@ static struct Damage battle_calc_weapon_attack(
if (sc && sc->data[SC_COMBO].timer != -1 && sc->data[SC_COMBO].val1 == skill_num)
skillratio += 10*status_get_lv(src)/3;
break;
- case GS_TRIPLEACTION:
- skillratio += 200;
- break;
case GS_BULLSEYE:
skillratio += 400;
break;
@@ -1870,7 +1862,7 @@ static struct Damage battle_calc_weapon_attack(
skillratio += 10*skill_lv;
break;
case GS_RAPIDSHOWER:
- skillratio += 400 + 50*skill_lv;
+ skillratio += 10*skill_lv;
break;
case GS_DESPERADO:
skillratio += 50*skill_lv-50;
@@ -1934,6 +1926,8 @@ static struct Damage battle_calc_weapon_attack(
}
}
}
+ //Div fix.
+ damage_div_fix(wd.damage, wd.div_);
//Here comes a second pass for skills that stack to the previously defined % damage. [Skotlex]
skillratio = 100;
//Skill damage modifiers that affect linearly stacked damage.
@@ -1951,6 +1945,10 @@ static struct Damage battle_calc_weapon_attack(
if(sd && pc_checkskill(sd,AS_SONICACCEL)>0)
skillratio += 10;
break;
+ case CR_SHIELDBOOMERANG:
+ if (sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_CRUSADER)
+ skillratio += 100;
+ break;
}
if (sd && sd->skillatk[0].id != 0)
{
@@ -1962,6 +1960,7 @@ static struct Damage battle_calc_weapon_attack(
}
if (skillratio != 100)
ATK_RATE(skillratio);
+
if(sd)
{
if (skill_num != PA_SACRIFICE && skill_num != MO_INVESTIGATE
@@ -2105,6 +2104,8 @@ static struct Damage battle_calc_weapon_attack(
}
}
} //Here ends flag.hit section, the rest of the function applies to both hitting and missing attacks
+ else if(wd.div_ < 0) //Since the attack missed...
+ wd.div_ *= -1;
if(skill_num == CR_GRANDCROSS || skill_num == NPC_GRANDDARKNESS)
return wd; //Enough, rest is not needed.
@@ -2141,7 +2142,6 @@ static struct Damage battle_calc_weapon_attack(
}
}
-
if ((!flag.rh || wd.damage == 0) && (!flag.lh || wd.damage2 == 0))
flag.cardfix = 0; //When the attack does no damage, avoid doing %bonuses
@@ -2275,8 +2275,8 @@ static struct Damage battle_calc_weapon_attack(
{
if (rand()%100 < (skill_lv>sd->double_rate?skill_lv:sd->double_rate))
{
- wd.damage *=2;
wd.div_=skill_get_num(TF_DOUBLE,skill_lv?skill_lv:1);
+ damage_div_fix(wd.damage, wd.div_);
wd.type = 0x08;
}
} else if (( (skill_lv = 5*pc_checkskill(sd,GS_CHAINACTION)) > 0 &&
@@ -2284,8 +2284,8 @@ static struct Damage battle_calc_weapon_attack(
|| sd->weapontype1 == 0x14 || sd->weapontype1 == 0x15)) || sd->double_rate > 0) // Copied double attack
if (rand()%100 < (skill_lv>sd->double_rate?skill_lv:sd->double_rate))
{
- wd.damage *=2;
wd.div_=skill_get_num(GS_CHAINACTION,skill_lv?skill_lv:1);
+ damage_div_fix(wd.damage, wd.div_);
wd.type = 0x08;
}
}
@@ -2808,9 +2808,11 @@ struct Damage battle_calc_magic_attack(
}
}
- if(!flag.infdef && ad.div_>1 && skill_num != WZ_VERMILION)
- ad.damage *= ad.div_;
-
+ damage_div_fix(ad.damage, ad.div_);
+
+ if (flag.infdef && ad.damage > 0)
+ ad.damage = 1;
+
if (tsd && status_isimmune(target)) {
if (sd && battle_config.gtb_pvp_only) { // [MouseJstr]
MATK_RATE(100 - battle_config.gtb_pvp_only);
@@ -2942,8 +2944,14 @@ struct Damage battle_calc_misc_attack(
case SN_FALCONASSAULT: /* ファルコンアサルト */
if( sd==NULL || (skill = pc_checkskill(sd,HT_STEELCROW)) <= 0)
skill=0;
- damage=(dex/10+int_/2+skill*3+40)*2*skill_get_num(HT_BLITZBEAT, 5); //Blitz Beat lv5 Damage
- damage=damage*(150+70*skill_lv)/100; //Falcon Assault Modifier
+
+ //Blitz Beat lv5 Damage
+ damage=(dex/10+int_/2+skill*3+40)*2;
+ skill = skill_get_num(HT_BLITZBEAT, 5);
+ damage_div_fix(damage, skill);
+
+ //Falcon Assault Modifier
+ damage=damage*(150+70*skill_lv)/100;
if(flag > 1)
damage /= flag;
aflag = (aflag&~BF_RANGEMASK)|BF_LONG;
@@ -3005,8 +3013,7 @@ struct Damage battle_calc_misc_attack(
}
div_=skill_get_num( skill_num,skill_lv );
- if(div_>1)
- damage*=div_;
+ damage_div_fix(damage, div_);
if(damage > 0 && t_mode&MD_PLANT && skill_num != PA_PRESSURE) //Pressure can vaporize plants.
damage = 1;