summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c28
-rw-r--r--src/map/clif.c37
-rw-r--r--src/map/pc.c9
-rw-r--r--src/map/skill.c139
-rw-r--r--src/map/skill.h5
-rw-r--r--src/map/status.c104
-rw-r--r--src/map/status.h68
7 files changed, 249 insertions, 141 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index dfbda4ded..711310442 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -664,11 +664,6 @@ int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int dama
case NJ_ZENYNAGE:
break;
default:
- /* Uncomment if you want god-mode Emperiums at 100 defense. [Kisuka]
- if (md && md->guardian_data) {
- damage -= damage * (md->guardian_data->castle->defense/100) * battle_config.castle_defense_rate/100;
- }
- */
if (flag & BF_SKILL) { //Skills get a different reduction than non-skills. [Skotlex]
if (flag&BF_WEAPON)
damage = damage * battle_config.gvg_weapon_damage_rate/100;
@@ -1194,7 +1189,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
if (flag.cri)
{
wd.type = 0x0a;
- flag.idef = flag.idef2 = flag.hit = 1;
+ flag.hit = 1;
} else { //Check for Perfect Hit
if(sd && sd->perfect_hit > 0 && rand()%100 < sd->perfect_hit)
flag.hit = 1;
@@ -1775,7 +1770,8 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
skill_num != ASC_BREAKER &&
skill_num != ASC_METEORASSAULT &&
skill_num != AS_SPLASHER &&
- skill_num != AS_VENOMKNIFE)
+ skill_num != AS_VENOMKNIFE &&
+ skill_num != AS_GRIMTOOTH) // RE disabled Grimtooth carrying EDP.
ATK_ADDRATE(sc->data[SC_EDP]->val3);
}
@@ -1845,7 +1841,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
if (!flag.idef || !flag.idef2)
{ //Defense reduction
short vit_def;
- signed char def1 = status_get_def(target); //Don't use tstatus->def1 due to skill timer reductions.
+ signed short def1 = status_get_def(target); //Don't use tstatus->def1 due to skill timer reductions.
short def2 = (short)tstatus->def2;
if( sc && sc->data[SC_EXPIATIO] )
@@ -2535,7 +2531,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
skillratio = skillratio * status_get_lv(src) / 100;
break;
case AB_ADORAMUS:
- skillratio += 400 + 100 * skill_lv; //Possible RE-Formula
+ skillratio += 100 * (skill_lv + 5);
if( status_get_lv(src) >= 100 )
skillratio = skillratio * status_get_lv(src) / 100;
break;
@@ -2567,7 +2563,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
}
if(!flag.imdef){
- char mdef = tstatus->mdef;
+ short mdef = tstatus->mdef;
int mdef2= tstatus->mdef2;
if(sd) {
i = sd->ignore_mdef[is_boss(target)?RC_BOSS:RC_NONBOSS];
@@ -3194,11 +3190,11 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
damage = wd.damage + wd.damage2;
if( damage > 0 && src != target )
{
- if(sc && sc->data[SC_DUPLELIGHT]) {
+ if( sc && sc->data[SC_DUPLELIGHT] ) {
int skilllv = sc->data[SC_DUPLELIGHT]->val1;
- if(rand()%100 < sc->data[SC_DUPLELIGHT]->val2)
+ if( rand()%100 < sc->data[SC_DUPLELIGHT]->val2 )
skill_addtimerskill(src,tick+status_get_adelay(src) / 2,target->id,0,0,AB_DUPLELIGHT_MELEE,skilllv,BF_WEAPON,flag);
- else if(rand()%100 < sc->data[SC_DUPLELIGHT]->val3)
+ else if( rand()%100 < sc->data[SC_DUPLELIGHT]->val3 )
skill_addtimerskill(src,tick+status_get_adelay(src) / 2,target->id,0,0,AB_DUPLELIGHT_MAGIC,skilllv,BF_MAGIC,flag);
}
@@ -3808,7 +3804,7 @@ static const struct _battle_data {
{ "max_baby_parameter", &battle_config.max_baby_parameter, 80, 10, 10000, },
{ "max_third_parameter", &battle_config.max_third_parameter, 120, 10, 10000, },
{ "max_baby_third_parameter", &battle_config.max_baby_third_parameter, 108, 10, 10000, },
- { "max_def", &battle_config.max_def, 9999, 0, INT_MAX, },
+ { "max_def", &battle_config.max_def, SHRT_MAX, 0, INT_MAX, },
{ "over_def_bonus", &battle_config.over_def_bonus, 0, 0, 1000, },
{ "skill_log", &battle_config.skill_log, BL_NUL, BL_NUL, BL_ALL, },
{ "battle_log", &battle_config.battle_log, 0, 0, 1, },
@@ -4108,8 +4104,8 @@ void battle_adjust_conf()
battle_config.max_walk_speed = 100*DEFAULT_WALK_SPEED/battle_config.max_walk_speed;
battle_config.max_cart_weight *= 10;
- if(battle_config.max_def > 9999 && !battle_config.weapon_defense_type) // added by [Skotlex]
- battle_config.max_def = 9999;
+ if(battle_config.max_def > SHRT_MAX && !battle_config.weapon_defense_type) // added by [Skotlex]
+ battle_config.max_def = SHRT_MAX;
if(battle_config.min_hitrate > battle_config.max_hitrate)
battle_config.min_hitrate = battle_config.max_hitrate;
diff --git a/src/map/clif.c b/src/map/clif.c
index 3278a80cd..ef48e6d60 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2487,26 +2487,22 @@ int clif_updatestatus(struct map_session_data *sd,int type)
WFIFOL(fd,4)=sd->battle_status.amotion;
break;
case SP_ATK1:
- WFIFOL(fd,4)=sd->battle_status.batk +sd->battle_status.rhw.atk +sd->battle_status.lhw.atk;
+ WFIFOL(fd,4)=sd->battle_status.batk;
break;
case SP_DEF1:
- WFIFOL(fd,4)=sd->battle_status.def;
+ WFIFOL(fd,4)=sd->battle_status.def2;
break;
case SP_MDEF1:
- WFIFOL(fd,4)=sd->battle_status.mdef;
+ WFIFOL(fd,4)= sd->battle_status.mdef2;
break;
case SP_ATK2:
- WFIFOL(fd,4)=sd->battle_status.rhw.atk2 + sd->battle_status.lhw.atk2;
+ WFIFOL(fd,4)=sd->battle_status.rhw.atk + sd->battle_status.rhw.atk2 + sd->battle_status.equipment_atk;
break;
case SP_DEF2:
- WFIFOL(fd,4)=sd->battle_status.def2;
+ WFIFOL(fd,4)=sd->battle_status.def;
break;
case SP_MDEF2:
- //negative check (in case you have something like Berserk active)
- len = sd->battle_status.mdef2 - (sd->battle_status.vit>>1);
- if (len < 0) len = 0;
- WFIFOL(fd,4)= len;
- len = 8;
+ WFIFOL(fd,4)=sd->battle_status.mdef;
break;
case SP_CRITICAL:
WFIFOL(fd,4)=sd->battle_status.cri/10;
@@ -2843,16 +2839,13 @@ int clif_initialstatus(struct map_session_data *sd)
WBUFB(buf,15)=pc_need_status_point(sd,SP_LUK,1);
WBUFW(buf,16) = sd->battle_status.batk;
- WBUFW(buf,18) = sd->battle_status.rhw.atk2 + sd->battle_status.lhw.atk2; //atk bonus
+ WBUFW(buf,18) = sd->battle_status.rhw.atk + sd->battle_status.lhw.atk2 + sd->battle_status.equipment_atk; //atk bonus
WBUFW(buf,20) = sd->weapon_matk + sd->battle_status.rhw.atk2 + sd->equipment_matk;
- WBUFW(buf,22) = sd->battle_status.matk_min;
- WBUFW(buf,24) = sd->battle_status.def; // def
- WBUFW(buf,26) = sd->battle_status.def2;
- WBUFW(buf,28) = sd->battle_status.mdef; // mdef
- fd = sd->battle_status.mdef2 - (sd->battle_status.vit>>1);
- if (fd < 0) fd = 0; //Negative check for Frenzy'ed characters.
- WBUFW(buf,30) = fd;
- fd = sd->fd;
+ WBUFW(buf,22) = sd->battle_status.status_matk;
+ WBUFW(buf,24) = sd->battle_status.def2;
+ WBUFW(buf,26) = sd->battle_status.def; // def
+ WBUFW(buf,28) = sd->battle_status.mdef2;
+ WBUFW(buf,30) = sd->battle_status.mdef; // mdef
WBUFW(buf,32) = sd->battle_status.hit;
WBUFW(buf,34) = sd->battle_status.flee;
WBUFW(buf,36) = sd->battle_status.flee2/10;
@@ -2872,8 +2865,14 @@ int clif_initialstatus(struct map_session_data *sd)
clif_updatestatus(sd,SP_ATTACKRANGE);
clif_updatestatus(sd,SP_ASPD);
+ clif_updatestatus(sd,SP_ATK1);
+ clif_updatestatus(sd,SP_ATK2);
clif_updatestatus(sd,SP_MATK1);
clif_updatestatus(sd,SP_MATK2);
+ clif_updatestatus(sd,SP_DEF1);
+ clif_updatestatus(sd,SP_DEF2);
+ clif_updatestatus(sd,SP_MDEF1);
+ clif_updatestatus(sd,SP_MDEF2);
return 0;
}
diff --git a/src/map/pc.c b/src/map/pc.c
index cd00e0ffc..1869372ae 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1851,14 +1851,14 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
break;
case SP_BASE_ATK:
if(sd->state.lr_flag != 2) {
- bonus = status->batk + val;
- status->batk = cap_value(bonus, 0, USHRT_MAX);
+ bonus = status->equipment_atk + val;
+ status->equipment_atk = cap_value(bonus, 0, USHRT_MAX);
}
break;
case SP_DEF1:
if(sd->state.lr_flag != 2) {
bonus = status->def + val;
- status->def = cap_value(bonus, CHAR_MIN, CHAR_MAX);
+ status->def = cap_value(bonus, SHRT_MIN, SHRT_MAX);
}
break;
case SP_DEF2:
@@ -1870,7 +1870,7 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
case SP_MDEF1:
if(sd->state.lr_flag != 2) {
bonus = status->mdef + val;
- status->mdef = cap_value(bonus, CHAR_MIN, CHAR_MAX);
+ status->mdef = cap_value(bonus, SHRT_MIN, SHRT_MAX);
}
break;
case SP_MDEF2:
@@ -3652,6 +3652,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
//Not consumable item
if( item->type != IT_HEALING && item->type != IT_USABLE && item->type != IT_CASH )
return 0;
+ // This contradicts official behavior. Items with no scripts should be consumed regardless. [L0ne_W0lf]
if( !item->script ) //if it has no script, you can't really consume it!
return 0;
diff --git a/src/map/skill.c b/src/map/skill.c
index 9aac438d4..3f386bbb7 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -274,6 +274,7 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, int skill
struct map_session_data *tsd = map_id2sd(target->id);
struct status_change* sc;
struct status_data *status;
+ bool FullCalc = false;
status = status_get_status_data(src);
@@ -291,13 +292,14 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, int skill
hp = (skill_lv>6)?666:skill_lv*100;
break;
default:
+ FullCalc = true; // Enables full calculation, which adds heal variance.
if (skill_lv >= battle_config.max_heal_lv)
return battle_config.max_heal;
-
+
// iRO Wiki states as of 2011/08/22:
// heal = ( [(Base Level + INT) / 5] ?30 ) ?(Heal Level / 10) ?(1 + (Modifiers / 100)) + MATK
// fixme: Does not match up with iRO's heal, level 1 or level 10
- // with 219 mak + HP_MEDITATO, level 1 = 361; level 10 = 1839
+ // with 219 matk + HP_MEDITATO (10) (no gear), level 1 = 361; level 10 = 1839
if( skill_id == AB_HIGHNESSHEAL ) {
skill = pc_checkskill(sd,AL_HEAL);
if( skill < 0 )
@@ -314,47 +316,50 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, int skill
mod += skill * 2;
else if( src->type == BL_HOM && (skill = merc_hom_checkskill(((TBL_HOM*)src), HLIF_BRAIN)) > 0 )
mod += skill * 2;
- if( sd && (skill = pc_skillheal_bonus(sd, skill_id)) )
- mod += skill;
- if( tsd && (skill = pc_skillheal2_bonus(tsd, skill_id)) )
- mod += skill;
+ break;
+ }
- sc = status_get_sc(target);
- if( sc && sc->count )
- {
- if( sc->data[SC_CRITICALWOUND] && heal ) // Critical Wound has no effect on offensive heal. [Inkfish]
- mod -= sc->data[SC_CRITICALWOUND]->val2;
- if( sc->data[SC_INCHEALRATE] && skill_id != NPC_EVILLAND && skill_id != BA_APPLEIDUN )
- mod += sc->data[SC_INCHEALRATE]->val1; // Only affects Heal, Sanctuary and PotionPitcher.(like bHealPower) [Inkfish]
- }
+ // Increment skill and status based modifiers
+ if( sd && (skill = pc_skillheal_bonus(sd, skill_id)) )
+ mod += skill;
+ if( tsd && (skill = pc_skillheal2_bonus(tsd, skill_id)) )
+ mod += skill;
+
+ sc = status_get_sc(target);
+ if( sc && sc->count )
+ {
+ if( sc->data[SC_CRITICALWOUND] && heal ) // Critical Wound has no effect on offensive heal. [Inkfish]
+ mod -= sc->data[SC_CRITICALWOUND]->val2;
+ if( sc->data[SC_INCHEALRATE] && skill_id != NPC_EVILLAND && skill_id != BA_APPLEIDUN )
+ mod += sc->data[SC_INCHEALRATE]->val1; // Only affects Heal, Sanctuary and PotionPitcher.(like bHealPower) [Inkfish]
+// if( sc->data[SC_VITALITYACTIVATION] && heal && skill_id != BA_APPLEIDUN )
+// mod += sc->data[SC_VITALITYACTIVATION]->val2;
+ }
- // Adjust the HP recovered rate by adding all of the modifiers together.
- hp = hp * mod / 100;
+ // Adjust the HP recovered rate by adding all of the modifiers together.
+ hp = hp * mod / 100;
- // Get weapon level and weapon matk for variance calculations if it's a player.
- // Mobs have their own variance, we've assumed:
- // Weapon Level = 1
- // Weapom_Matk = ?
- // Need more information before that can be implemented.
- if( sd )
- {
- int matk = 0;
- int smatk = sd->battle_status.status_matk;
- int ematk = sd->equipment_matk;
- int wmatk = 0;
- int wlv = 1;
- int index = sd->equip_index[EQI_HAND_R];
-
- if( index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_WEAPON )
- wlv = sd->inventory_data[index]->wlv;
+ // Get weapon level and weapon matk for variance calculations if it's a player.
+ // Mobs have their own variance, we've assumed:
+ // Weapon Level = 1
+ // Weapom_Matk = ?
+ // Need more information before that can be implemented.
+ if( sd && FullCalc)
+ {
+ int matk = 0;
+ int smatk = sd->battle_status.status_matk;
+ int ematk = sd->equipment_matk;
+ int wmatk = 0;
+ int wlv = 1;
+ int index = sd->equip_index[EQI_HAND_R];
- wmatk = (int)( sd->weapon_matk + ( (float)( ( rand() % 20 ) - 10 ) / 100 * wlv * sd->weapon_matk ) + ( sd->battle_status.rhw.atk2 ) );
- matk = ( smatk + wmatk + ematk );
+ if( index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_WEAPON )
+ wlv = sd->inventory_data[index]->wlv;
- hp += matk;
- }
+ wmatk = (int)( sd->weapon_matk + ( (float)( ( rand() % 20 ) - 10 ) / 100 * wlv * sd->weapon_matk ) + ( sd->battle_status.rhw.atk2 ) );
+ matk = ( smatk + wmatk + ematk );
- break;
+ hp += matk;
}
// mercenaries only take half-effectiveness from heals.
@@ -5758,7 +5763,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case AB_CLEMENTIA: if( sd ) lv = pc_checkskill(sd,AL_BLESSING); break;
case AB_CANTO: if( sd ) lv = pc_checkskill(sd,AL_INCAGI); break;
}
- clif_skill_nodamage(bl, bl, skillid, skilllv, sc_start(bl,type,100,lv,skill_get_time(skillid,skilllv)));
+ clif_skill_nodamage(bl, bl, skillid, skilllv,
+ sc_start4(bl,type,100,lv,0,sd?sd->status.job_level:0,0,skill_get_time(skillid,skilllv)));
}
else if( sd )
party_foreachsamemap(skill_area_sub, sd, skill_get_splash(skillid, skilllv), src, skillid, skilllv, tick, flag|BCT_PARTY|1, skill_castend_nodamage_id);
@@ -5784,8 +5790,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
{
if( dstsd && dstsd->special_state.no_magic_damage )
break;
- clif_skill_nodamage(bl,bl,skillid,skilllv,1);
- clif_skill_nodamage(bl, bl, skillid, skilllv, sc_start4(bl, type, 100, skilllv, 0, 0, 1, skill_get_time(skillid, skilllv)));
+ clif_skill_nodamage(bl, bl, skillid, skilllv,
+ sc_start4(bl, type, 100, skilllv, 0, 0, 1, skill_get_time(skillid, skilllv)));
}
else
party_foreachsamemap(skill_area_sub, sd, skill_get_splash(skillid, skilllv), src, skillid, skilllv, tick, flag|BCT_PARTY|1, skill_castend_nodamage_id);
@@ -5793,7 +5799,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case AB_ORATIO:
if (flag&1)
sc_start(bl, type, 40+skilllv*5, skilllv, skill_get_time(skillid, skilllv));
- else {
+ else
+ {
clif_skill_nodamage(src, bl, skillid, skilllv, 1);
map_foreachinrange(skill_area_sub, bl,
skill_get_splash(skillid, skilllv), BL_CHAR,
@@ -5803,7 +5810,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
case AB_LAUDAAGNUS:
case AB_LAUDARAMUS:
- if( flag&1 || sd == NULL )
+ if( (flag&1) || sd == NULL || sd->status.party_id == 0 )
{
if( tsc && (rand()%100 < 30+5*skilllv) )
{
@@ -5849,7 +5856,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
{
if (!tsc->data[i])
continue;
- //Initial list of status effects cancelled by Clearance. Does not contain third job status.
+ //Initial list of status effects NOT cancelled by Clearance.
switch (i) {
case SC_WEIGHT50: case SC_WEIGHT90: case SC_TWOHANDQUICKEN:
case SC_QUAGMIRE: case SC_SLOWPOISON: case SC_BENEDICTIO:
@@ -5882,7 +5889,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case SC_FOOD_VIT_CASH: case SC_FOOD_DEX_CASH: case SC_FOOD_INT_CASH:
case SC_FOOD_LUK_CASH: case SC_MERC_FLEEUP: case SC_MERC_ATKUP:
case SC_MERC_HPUP: case SC_MERC_SPUP: case SC_MERC_HITUP:
- case SC_SLOWCAST: case SC_CRITICALWOUND: case SC_SPEEDUP0:
+ case SC_SLOWCAST: /*case SC_CRITICALWOUND:*/ case SC_SPEEDUP0:
case SC_DEF_RATE: case SC_MDEF_RATE: case SC_INCHEALRATE:
case SC_S_LIFEPOTION: case SC_L_LIFEPOTION: case SC_INCCRI:
case SC_SPCOST_RATE: case SC_COMMONSC_RESIST: case SC_ELEMENTALCHANGE:
@@ -5899,9 +5906,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case SC_INTOABYSS: case SC_SIEGFRIED: case SC_WHISTLE:
case SC_ASSNCROS: case SC_POEMBRAGI: case SC_APPLEIDUN:
case SC_HUMMING: case SC_DONTFORGETME: case SC_FORTUNE:
- case SC_SERVICE4U: case SC_EPICLESIS: case SC_PARTYFLEE:
+ case SC_SERVICE4U: case SC_PARTYFLEE: /*case SC_ANGEL_PROTECT:*/
+ case SC_EPICLESIS:
// not implemented
- //case SC_ANGEL_PROTECT: case SC_BUCHEDENOEL: case SC_POPECOOKIE:
+ //case SC_BUCHEDENOEL: case SC_POPECOOKIE:
//case SC_SAVAGE_STEAK: case SC_COCKTAIL_WARG_BLOOD: case SC_MINOR_BBQ:
//case SC_SIROMA_ICE_TEA: case SC_DROCERA_HERB_STEAMED: case SC_PUTTI_TAILS_NOODLES:
//case SC_CRIFOOD: case SC_STR_SCROLL: case SC_INT_SCROLL:
@@ -6800,9 +6808,9 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk
case AB_EPICLESIS:
if( skill_unitsetting(src, skillid, skilllv, x, y, 0) )
{
- int range = skill_get_splash(skillid,skilllv); // Use Splash Range.
+ i = skill_get_splash(skillid,skilllv); // Use Splash Range.
map_foreachinarea(skill_area_sub,
- src->m, x-range, y-range, x+range, y+range, BL_CHAR,
+ src->m, x-i, y-i, x+i, y+i, BL_CHAR,
src, ALL_RESURRECTION, 1, tick, flag|BCT_NOENEMY|1,
skill_castend_nodamage_id);
}
@@ -8024,7 +8032,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
//if( tsc->data[SC_BERSERK] )
// break;
- //Apply status effect if standing in unit, should cancel upon stepping out of skill_get_splash() area. [FIXME]
+ //FIXME: Apply status effect if standing in unit, should cancel upon stepping out of skill_get_splash() area.
if( tsc && !tsc->data[SC_EPICLESIS] )
sc_start(bl, type, 100, sg->skill_lv, skill_get_time(sg->skill_id,sg->skill_lv));
@@ -8955,6 +8963,26 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh
break;
clif_skill_fail(sd,skill,0,0);
return 0;
+ break;
+/*
+ case ST_DRAGON:
+ if(!pc_isdragon(sd)) {
+ clif_skill_fail(sd,skill,25,0);
+ return 0;
+ }
+ break;
+ case ST_WARG:
+ if(!pc_iswarg(sd)) {
+ clif_skill_fail(sd,skill,0,0);
+ return 0;
+ }
+ break;
+ case ST_MADOGEAR:
+ if(!pc_ismadogear(sd)) {
+ clif_skill_fail(sd,skill,33,0);
+ return 0;
+ }
+*/
}
if(require.mhp > 0 && get_percentage(status->hp, status->max_hp) > require.mhp) {
@@ -9057,14 +9085,6 @@ int skill_check_condition_castend(struct map_session_data* sd, short skill, shor
}
break;
}
- case AB_LAUDAAGNUS:
- case AB_LAUDARAMUS:
- if( !sd->status.party_id )
- {
- clif_skill_fail(sd,skill,0,0);
- return 0;
- }
- break;
}
status = &sd->battle_status;
@@ -9405,7 +9425,7 @@ int skill_castfix (struct block_list *bl, int skill_id, int skill_lv)
}
}
- //TODO: apply fixed cast rate modifiers via status effects.
+ // apply fixed cast rate modifiers via status effects.
if( !(skill_get_castnodex(skill_id, skill_lv)&2) && sc && sc->count )
{
if( sc->data[SC_AB_SECRAMENT] && sc->data[SC_AB_SECRAMENT]->val2 > max_fixedReduction )
@@ -12113,6 +12133,9 @@ static bool skill_parse_row_requiredb(char* split[], int columns, int current)
else if( strcmpi(split[10],"recover_weight_rate")==0 ) skill_db[i].state = ST_RECOV_WEIGHT_RATE;
else if( strcmpi(split[10],"move_enable")==0 ) skill_db[i].state = ST_MOVE_ENABLE;
else if( strcmpi(split[10],"water")==0 ) skill_db[i].state = ST_WATER;
+ else if( strcmpi(split[10],"dragon")==0 ) skill_db[i].state = ST_DRAGON;
+ else if( strcmpi(split[10],"warg")==0 ) skill_db[i].state = ST_WARG;
+ else if( strcmpi(split[10],"madogear")==0 ) skill_db[i].state = ST_MADOGEAR;
else skill_db[i].state = ST_NONE;
skill_split_atoi(split[11],skill_db[i].spiritball);
diff --git a/src/map/skill.h b/src/map/skill.h
index 73b3e9fd0..0cadd92d7 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -13,7 +13,7 @@ struct skill_unit_group;
struct status_change_entry;
#define MAX_SKILL_DB MAX_SKILL
-#define MAX_SKILL_PRODUCE_DB 150
+#define MAX_SKILL_PRODUCE_DB 170
#define MAX_PRODUCE_RESOURCE 12
#define MAX_SKILL_ARROW_DB 150
#define MAX_ARROW_RESOURCE 5
@@ -369,6 +369,9 @@ enum {
ST_RECOV_WEIGHT_RATE,
ST_MOVE_ENABLE,
ST_WATER,
+ ST_DRAGON,
+ ST_WARG,
+ ST_MADOGEAR
};
enum e_skill {
diff --git a/src/map/status.c b/src/map/status.c
index bfa6be76d..933d18690 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1304,7 +1304,7 @@ int status_base_amotion_pc(struct map_session_data* sd, struct status_data* stat
static unsigned short status_base_atk(const struct block_list *bl, const struct status_data *status)
{
- int flag = 0, str, dex, dstr;
+ int flag = 0, str, dex, dstr, base;
if(!(bl->type&battle_config.enable_baseatk))
return 0;
@@ -1322,10 +1322,10 @@ static unsigned short status_base_atk(const struct block_list *bl, const struct
flag = 1;
}
if (flag) {
- str = status->dex;
+ base =str = status->dex;
dex = status->str;
} else {
- str = status->str;
+ base = str = status->str;
dex = status->dex;
}
//Normally only players have base-atk, but homunc have a different batk
@@ -1334,7 +1334,7 @@ static unsigned short status_base_atk(const struct block_list *bl, const struct
dstr = str/10;
str += dstr*dstr;
if (bl->type == BL_PC)
- str+= dex/5 + status->luk/5;
+ str = (((TBL_PC*)bl)->status.base_level*10/4 + base*10 + dex*10/5 + status->luk*10/3)/10;
return cap_value(str, 0, USHRT_MAX);
}
@@ -1354,10 +1354,17 @@ void status_calc_misc(struct block_list *bl, struct status_data *status, int lev
status->matk_min = status_base_matk_min(status);
status->matk_max = status_base_matk_max(status);
- status->hit += 175 + status->dex + (unsigned short)floor((double)status->luk/3) + level; //Renewal calclation.
+ //Renewal calculation? HIT is currently coming up too high.
+ status->hit += 175 + status->dex + (unsigned short)floor((double)status->luk/3) + level;
status->flee += 100 + status->agi + level;
- status->def2 += status->vit;
- status->mdef2 += status->mdef;
+
+ // Values are still off by roughly 1~3 points. Getting there though.
+ status->def2 += (level*10/2 + status->vit*10/2 + status->agi*10/5)/10;
+ if( bl->type != BL_MOB )
+ status->mdef2 += (level*10/4 + status->int_*10 + status->vit*10/5 + status->dex*10/5)/10;
+ else
+ status->mdef2 = status->mdef; // Mobs use their mdef as their mdef2.
+
//Status MATK = floor(Base Level/4 + INT + INT/2 + DEX/5 + LUK/3)
status->status_matk = (unsigned short)floor((double)level/4 + (double)status->int_ + (double)status->int_/2 + (double)status->dex/5 + (double)status->luk/3);
@@ -1539,8 +1546,6 @@ int status_calc_mob_(struct mob_data* md, bool first)
status->max_sp += 200 * gc->defense;
status->hp = status->max_hp;
status->sp = status->max_sp;
- status->def += (gc->defense+2)/3;
- status->mdef += (gc->defense+2)/3;
}
}else{
status->max_hp += 1000 * gc->defense;
@@ -1963,7 +1968,11 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
}
}
else if(sd->inventory_data[index]->type == IT_ARMOR) {
- refinedef += sd->status.inventory[index].refine*refinebonus[0][0];
+ int r = sd->status.inventory[index].refine;
+ int per = 0, refine=(r>0)?1:0;
+ for(per=1; per<r; per++)
+ refine += (per/4) + 1;
+ refinedef += refine;
if(sd->inventory_data[index]->script) {
run_script(sd->inventory_data[index]->script,0,sd->bl.id,0);
if (!calculating) //Abort, run_script retriggered this. [Skotlex]
@@ -2296,13 +2305,13 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
sd->def_rate = 0;
if(sd->def_rate != 100) {
i = status->def * sd->def_rate/100;
- status->def = cap_value(i, CHAR_MIN, CHAR_MAX);
+ status->def = cap_value(i, SHRT_MIN, SHRT_MAX);
}
if (!battle_config.weapon_defense_type && status->def > battle_config.max_def)
{
status->def2 += battle_config.over_def_bonus*(status->def -battle_config.max_def);
- status->def = (unsigned char)battle_config.max_def;
+ status->def = (unsigned short)battle_config.max_def;
}
// ----- EQUIPMENT-MDEF CALCULATION -----
@@ -2312,13 +2321,13 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
sd->mdef_rate = 0;
if(sd->mdef_rate != 100) {
i = status->mdef * sd->mdef_rate/100;
- status->mdef = cap_value(i, CHAR_MIN, CHAR_MAX);
+ status->mdef = cap_value(i, SHRT_MIN, SHRT_MAX);
}
if (!battle_config.magic_defense_type && status->mdef > battle_config.max_def)
{
status->mdef2 += battle_config.over_def_bonus*(status->mdef -battle_config.max_def);
- status->mdef = (signed char)battle_config.max_def;
+ status->mdef = (signed short)battle_config.max_def;
}
// ----- ASPD CALCULATION -----
@@ -2580,9 +2589,9 @@ static signed short status_calc_hit(struct block_list *,struct status_change *,i
static signed short status_calc_critical(struct block_list *,struct status_change *,int);
static signed short status_calc_flee(struct block_list *,struct status_change *,int);
static signed short status_calc_flee2(struct block_list *,struct status_change *,int);
-static signed char status_calc_def(struct block_list *,struct status_change *,int);
+static signed short status_calc_def(struct block_list *,struct status_change *,int);
static signed short status_calc_def2(struct block_list *,struct status_change *,int);
-static signed char status_calc_mdef(struct block_list *,struct status_change *,int);
+static signed short status_calc_mdef(struct block_list *,struct status_change *,int);
static signed short status_calc_mdef2(struct block_list *,struct status_change *,int);
static unsigned short status_calc_speed(struct block_list *,struct status_change *,int);
static short status_calc_aspd_rate(struct block_list *,struct status_change *,int);
@@ -2823,7 +2832,7 @@ void status_calc_bl_main(struct block_list *bl, enum scb_flag flag)
if(flag&SCB_LUK) {
status->luk = status_calc_luk(bl, sc, b_status->luk);
- flag|=SCB_BATK|SCB_CRI|SCB_FLEE2;
+ flag|=SCB_BATK|SCB_CRI|SCB_FLEE2|SCB_MATK;
}
if(flag&SCB_BATK && b_status->batk) {
@@ -3194,25 +3203,26 @@ void status_calc_bl_(struct block_list* bl, enum scb_flag flag, bool first)
clif_updatestatus(sd,SP_ASPD);
if(b_status.speed != status->speed)
clif_updatestatus(sd,SP_SPEED);
- if(b_status.rhw.atk != status->rhw.atk || b_status.lhw.atk != status->lhw.atk || b_status.batk != status->batk)
+ if(b_status.rhw.atk != status->rhw.atk || b_status.lhw.atk != status->lhw.atk || b_status.batk != status->batk
+ || b_status.rhw.atk2 != status->rhw.atk2 || b_status.lhw.atk2 != status->lhw.atk2 || b_status.equipment_atk != status->equipment_atk)
{
clif_updatestatus(sd,SP_ATK1);
+ clif_updatestatus(sd,SP_ATK2);
clif_updatestatus(sd,SP_MATK1);
}
- if(b_status.def != status->def)
+ if(b_status.def != status->def || b_status.def2 != status->def2)
+ {
clif_updatestatus(sd,SP_DEF1);
- if(b_status.rhw.atk2 != status->rhw.atk2 || b_status.lhw.atk2 != status->lhw.atk2)
- clif_updatestatus(sd,SP_ATK2);
- if(b_status.def2 != status->def2)
clif_updatestatus(sd,SP_DEF2);
+ }
if(b_status.flee2 != status->flee2)
clif_updatestatus(sd,SP_FLEE2);
if(b_status.cri != status->cri)
clif_updatestatus(sd,SP_CRITICAL);
if(b_status.matk_max != status->matk_max)
{
- clif_updatestatus(sd,SP_MATK1);
- clif_updatestatus(sd,SP_MATK2);
+ clif_updatestatus(sd,SP_MATK1);
+ clif_updatestatus(sd,SP_MATK2);
}
if(b_status.mdef != status->mdef || b_status.mdef2 != status->mdef2)
{
@@ -3708,10 +3718,10 @@ static signed short status_calc_flee2(struct block_list *bl, struct status_chang
return (short)cap_value(flee2,10,SHRT_MAX);
}
-static signed char status_calc_def(struct block_list *bl, struct status_change *sc, int def)
+static signed short status_calc_def(struct block_list *bl, struct status_change *sc, int def)
{
if(!sc || !sc->count)
- return (signed char)cap_value(def,CHAR_MIN,CHAR_MAX);
+ return (signed short)cap_value(def,SHRT_MIN,SHRT_MAX);
if(sc->data[SC_BERSERK])
return 0;
@@ -3748,7 +3758,7 @@ static signed char status_calc_def(struct block_list *bl, struct status_change *
if (sc->data[SC_FLING])
def -= def * (sc->data[SC_FLING]->val2)/100;
- return (signed char)cap_value(def,CHAR_MIN,CHAR_MAX);
+ return (signed short)cap_value(def,SHRT_MIN,SHRT_MAX);
}
static signed short status_calc_def2(struct block_list *bl, struct status_change *sc, int def2)
@@ -3783,10 +3793,10 @@ static signed short status_calc_def2(struct block_list *bl, struct status_change
return (short)cap_value(def2,1,SHRT_MAX);
}
-static signed char status_calc_mdef(struct block_list *bl, struct status_change *sc, int mdef)
+static signed short status_calc_mdef(struct block_list *bl, struct status_change *sc, int mdef)
{
if(!sc || !sc->count)
- return (signed char)cap_value(mdef,CHAR_MIN,CHAR_MAX);
+ return (signed short)cap_value(mdef,SHRT_MIN,SHRT_MAX);
if(sc->data[SC_BERSERK])
return 0;
@@ -3807,7 +3817,7 @@ static signed char status_calc_mdef(struct block_list *bl, struct status_change
if(sc->data[SC_CONCENTRATION])
mdef += 1; //Skill info says it adds a fixed 1 Mdef point.
- return (signed char)cap_value(mdef,CHAR_MIN,CHAR_MAX);
+ return (signed short)cap_value(mdef,SHRT_MIN,SHRT_MAX);
}
static signed short status_calc_mdef2(struct block_list *bl, struct status_change *sc, int mdef2)
@@ -4288,7 +4298,7 @@ struct status_data *status_get_base_status(struct block_list *bl)
}
}
-signed char status_get_def(struct block_list *bl)
+signed short status_get_def(struct block_list *bl)
{
struct unit_data *ud;
struct status_data *status = status_get_status_data(bl);
@@ -4296,7 +4306,7 @@ signed char status_get_def(struct block_list *bl)
ud = unit_bl2ud(bl);
if (ud && ud->skilltimer != INVALID_TIMER)
def -= def * skill_get_castdef(ud->skillid)/100;
- return cap_value(def, CHAR_MIN, CHAR_MAX);
+ return cap_value(def, SHRT_MIN, SHRT_MAX);
}
unsigned short status_get_speed(struct block_list *bl)
@@ -4521,6 +4531,22 @@ void status_set_viewdata(struct block_list *bl, int class_)
class_ = JOB_BABY_CRUSADER2;
break;
}
+ /*
+ else
+ if (sd->sc.option&OPTION_DRAGON) // For completeness' sake. These aren't actually needed...except maybe in older clients.
+ switch (class_)
+ {
+ case JOB_RUNE_KNIGHT:
+ class_ = JOB_RUNE_KNIGHT2;
+ break;
+ case JOB_RUNE_KNIGHT_H:
+ class_ = JOB_RUNE_KNIGHT_H2;
+ break;
+ case JOB_BABY_RUNE:
+ class_ = JOB_BABY_RUNE2;
+ break;
+ }
+ */
sd->vd.class_ = class_;
clif_get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield);
sd->vd.head_top = sd->status.head_top;
@@ -5316,6 +5342,8 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_INCREASEAGI:
case SC_ADORAMUS:
val2 = 2 + val1; //Agi change
+ if (val3) //Canto Candidus: Add joblv/10 additional AGI (8/31/2011)
+ val2 += (val3/10);
break;
case SC_ENDURE:
val2 = 7; // Hit-count [Celest]
@@ -5365,14 +5393,14 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
break;
case SC_KYRIE:
val2 = status->max_hp * (val1 * 2 + 10) / 100; //%Max HP to absorb
- // val1 determines if status is casued by Kyrie or Praefatio,
+ // val4 determines if status is casued by Kyrie or Praefatio,
// as Praefatio blocks more hits than Kyrie Elesion.
- if( !val4 )
+ if( !val4 ) //== PR_KYRIE
val3 = (val1 / 2 + 5);
- else
+ else //== AB_PRAEFATIO
val3 = 6 + val1;
if( sd )
- val1 = min(val1,pc_checkskill(sd,PR_KYRIE)); // uses kill level to determine barrier health.
+ val1 = min(val1,pc_checkskill(sd,PR_KYRIE)); // use skill level to determine barrier health.
break;
case SC_MAGICPOWER:
//val1: Skill lv
@@ -5923,7 +5951,11 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
break;
case SC_BLESSING:
if ((!undead_flag && status->race!=RC_DEMON) || bl->type == BL_PC)
+ {
val2 = val1;
+ if (val3) //Clementia: Add joblv/10 additional STR/INT/DEX (8/31/2011)
+ val2 += (val3/10);
+ }
else
val2 = 0; //0 -> Half stat.
break;
diff --git a/src/map/status.h b/src/map/status.h
index 4eeadef12..169d193ae 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -11,7 +11,7 @@ struct homun_data;
struct status_change;
//Use this to refer the max refinery level [Skotlex]
-#define MAX_REFINE 10
+#define MAX_REFINE 20
#define MAX_REFINE_BONUS 5
extern unsigned long StatusChangeFlagTable[];
@@ -330,7 +330,7 @@ typedef enum sc_type {
SC_FOOD_INT_CASH,
SC_FOOD_LUK_CASH,
//SC_MOVHASTE_INFINITY,
- SC_PARTYFLEE = 310 ,
+ SC_PARTYFLEE = 310,
//SC_ENDURE_MDEF, //311
// Third Jobs - Maintaining SI order for SCs.
@@ -933,6 +933,62 @@ enum si_type {
SI_WIND_INSIGNIA = 569,
SI_EARTH_INSIGNIA = 570,
SI_EQUIPED_FLOOR = 571,
+ SI_GUARDIAN_RECALL = 572,
+ SI_MORA_BUFF = 573,
+ SI_REUSE_LIMIT_G = 574,
+ SI_REUSE_LIMIT_H = 575,
+ SI_NEEDLE_OF_PARALYZE = 576,
+ SI_PAIN_KILLER = 577,
+ SI_G_LIFEPOTION = 578,
+ SI_VITALIZE_POTION = 579,
+ SI_LIGHT_OF_REGENE = 580,
+ SI_OVERED_BOOST = 581,
+ SI_SILENT_BREEZE = 582,
+ SI_ODINS_POWER = 583,
+ SI_STYLE_CHANGE = 584,
+ SI_SONIC_CLAW_POSTDELAY = 585,
+//--586-595 Unused
+ SI_SILVERVEIN_RUSH_POSTDELAY = 596,
+ SI_MIDNIGHT_FRENZY_POSTDELAY = 597,
+ SI_GOLDENE_FERSE = 598,
+ SI_ANGRIFFS_MODUS = 599,
+ SI_TINDER_BREAKER = 600,
+ SI_TINDER_BREAKER_POSTDELAY = 601,
+ SI_CBC = 602,
+ SI_CBC_POSTDELAY = 603,
+ SI_EQC = 604,
+ SI_MAGMA_FLOW = 605,
+ SI_GRANITIC_ARMOR = 606,
+ SI_PYROCLASTIC = 607,
+ SI_VOLCANIC_ASH = 608,
+ SI_SPIRITS_SAVEINFO1 = 609,
+ SI_SPIRITS_SAVEINFO2 = 610,
+ SI_MAGIC_CANDY = 611,
+//--612 skipped
+ SI_ALL_RIDING = 613,
+//--614 skipped
+ SI_MACRO = 615,
+ SI_MACRO_POSTDELAY = 616,
+ SI_BEER_BOTTLE_CAP = 617,
+ SI_OVERLAPEXPUP = 618,
+ SI_PC_IZ_DUN05 = 619,
+ SI_CRUSHSTRIKE = 620,
+ SI_MONSTER_TRANSFORM = 621,
+ SI_SIT = 622,
+ SI_ONAIR = 623,
+ SI_MTF_ASPD = 624,
+ SI_MTF_RANGEATK = 625,
+ SI_MTF_MATK = 626,
+ SI_MTF_MLEATKED = 627,
+ SI_MTF_CRIDAMAGE = 628,
+ SI_REUSE_LIMIT_MTF = 629,
+ SI_MACRO_PERMIT = 630,
+ SI_MACRO_PLAY = 631,
+ SI_SKF_CAST = 632,
+ SI_SKF_ASPD = 633,
+ SI_SKF_ATK = 634,
+ SI_SKF_MATK = 635,
+ SI_REWARD_PLUSONLYJOBEXP = 636,
*/
};
@@ -1133,20 +1189,18 @@ struct status_data {
max_hp, max_sp;
unsigned short
str, agi, vit, int_, dex, luk,
- batk,
+ batk, equipment_atk,
matk_min, matk_max, status_matk,
speed,
amotion, adelay, dmotion,
mode;
short
hit, flee, cri, flee2,
- def2, mdef2,
+ def, mdef, def2, mdef2,
aspd_rate;
unsigned char
def_ele, ele_lv,
size, race;
- signed char
- def, mdef;
struct weapon_atk rhw, lhw; //Right Hand/Left Hand Weapon.
};
@@ -1259,7 +1313,7 @@ int status_get_lv(struct block_list *bl);
#define status_get_luk(bl) status_get_status_data(bl)->luk
#define status_get_hit(bl) status_get_status_data(bl)->hit
#define status_get_flee(bl) status_get_status_data(bl)->flee
-signed char status_get_def(struct block_list *bl);
+signed short status_get_def(struct block_list *bl);
#define status_get_mdef(bl) status_get_status_data(bl)->mdef
#define status_get_flee2(bl) status_get_status_data(bl)->flee2
#define status_get_def2(bl) status_get_status_data(bl)->def2