summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt5
-rw-r--r--src/map/atcommand.c42
-rw-r--r--src/map/battle.c8
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/mob.c11
-rw-r--r--src/map/skill.c6
-rw-r--r--src/map/status.c4
-rw-r--r--src/map/status.h2
8 files changed, 63 insertions, 17 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index fbaaa40d2..3da6e56c2 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/08/28
+ * Fixed exp bonuses applying twice for the job-exp [Skotlex]
+ * Magic damage adjustment per number of hits is now performed before mdef
+ reductions. [Skotlex]
+ * @reloadbattleconf will now also update the ragsrvinfo table on the
+ char-server. [Skotlex]
* Reverted Mpeg's change of NJ_BUNSINJYUTSU SCB [Toms]
* Fixed homun hp/sp growth rates stacking with HP/SP passive increasing
skills. [Skotlex]
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 62fe834c8..1bdb8e39a 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -5530,8 +5530,48 @@ atcommand_reloadbattleconf(
const int fd, struct map_session_data* sd,
const char* command, const char* message)
{
+ struct Battle_Config prev_config;
+ memcpy(&prev_config, &battle_config, sizeof(prev_config));
+
battle_config_read(BATTLE_CONF_FILENAME);
- mob_reload(); //Needed as well so rate changes take effect.
+
+ if (memcmp(&prev_config.item_rate_mvp,
+ &battle_config.item_rate_mvp,
+ sizeof(battle_config.item_rate_mvp)+
+ sizeof(battle_config.item_rate_common)+
+ sizeof(battle_config.item_rate_common_boss)+
+ sizeof(battle_config.item_rate_card)+
+ sizeof(battle_config.item_rate_card_boss)+
+ sizeof(battle_config.item_rate_equip)+
+ sizeof(battle_config.item_rate_equip_boss)+
+ sizeof(battle_config.item_rate_heal)+
+ sizeof(battle_config.item_rate_heal_boss)+
+ sizeof(battle_config.item_rate_use)+
+ sizeof(battle_config.item_rate_use_boss)+
+ sizeof(battle_config.item_rate_treasure)+
+ sizeof(battle_config.item_rate_adddrop)+
+ sizeof(battle_config.logarithmic_drops)+
+ sizeof(battle_config.item_drop_common_min)+
+ sizeof(battle_config.item_drop_common_max)+
+ sizeof(battle_config.item_drop_card_min)+
+ sizeof(battle_config.item_drop_card_max)+
+ sizeof(battle_config.item_drop_equip_min)+
+ sizeof(battle_config.item_drop_equip_max)+
+ sizeof(battle_config.item_drop_mvp_min)+
+ sizeof(battle_config.item_drop_mvp_max)+
+ sizeof(battle_config.item_drop_heal_min)+
+ sizeof(battle_config.item_drop_heal_max)+
+ sizeof(battle_config.item_drop_use_min)+
+ sizeof(battle_config.item_drop_use_max)+
+ sizeof(battle_config.item_drop_treasure_min)+
+ sizeof(battle_config.item_drop_treasure_max)
+ ) != 0)
+ { //Drop rates changed.
+ mob_reload(); //Needed as well so rate changes take effect.
+#ifndef TXT_ONLY
+ chrif_ragsrvinfo(battle_config.base_exp_rate, battle_config.job_exp_rate, battle_config.item_rate_common);
+#endif
+ }
clif_displaymessage(fd, msg_txt(255));
return 0;
}
diff --git a/src/map/battle.c b/src/map/battle.c
index 28c8e4c4c..5410ed3fc 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -2365,6 +2365,8 @@ struct Damage battle_calc_magic_attack(
MATK_ADD(50);
}
}
+ //Adjust damage per number of hits.
+ damage_div_fix(ad.damage, ad.div_);
if(sd) {
//Ignore Defense?
@@ -2449,9 +2451,8 @@ struct Damage battle_calc_magic_attack(
MATK_RATE(cardfix);
}
- }
-
- damage_div_fix(ad.damage, ad.div_);
+ } else //Correct number of hits anyway.
+ damage_div_fix(ad.damage, ad.div_);
if (flag.infdef && ad.damage)
ad.damage = ad.damage>0?1:-1;
@@ -3746,7 +3747,6 @@ static const struct battle_data_short {
{ "duel_autoleave_when_die", &battle_config.duel_autoleave_when_die}, //[LuzZza]
{ "duel_time_interval", &battle_config.duel_time_interval}, // [LuzZza]
{ "duel_only_on_same_map", &battle_config.duel_only_on_same_map}, // [Toms]
-
{ "skip_teleport_lv1_menu", &battle_config.skip_teleport_lv1_menu}, // [LuzZza]
{ "allow_skill_without_day", &battle_config.allow_skill_without_day}, // [Komurka]
{ "allow_es_magic_player", &battle_config.allow_es_magic_pc },
diff --git a/src/map/clif.c b/src/map/clif.c
index e14364b44..b3decf5b3 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9431,7 +9431,7 @@ void clif_parse_NpcBuyListSend(int fd,struct map_session_data *sd)
if (sd->state.trading|| !sd->npc_shopid)
fail = 1;
- else{
+ else {
if((nd = ((struct npc_data *)map_id2bl(sd->npc_shopid))->master_nd)){
int regkey = add_str("@bought_nameid");
int regkey2 = add_str("@bought_quantity");
diff --git a/src/map/mob.c b/src/map/mob.c
index 8c38374ef..3ceb8287c 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1781,6 +1781,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
int flag=1,zeny=0;
unsigned int base_exp,job_exp;
double per; //Your share of the mob's exp
+ double jper; //For the job-exp
int bonus; //Bonus on top of your share.
if (status_isdead(tmpbl[i]) || tmpbl[i]->m != md->bl.m)
@@ -1814,11 +1815,11 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
zeny=(int) ((md->level+rand()%md->level)*per*bonus/100.);
if(md->db->mexp > 0)
zeny*=rand()%250;
- }
+
+ jper = per;
if (map[md->bl.m].flag.nobaseexp)
base_exp=0;
- else {
temp = bonus; //Do not alter bonus for the jExp section below.
if (map[md->bl.m].bexp != 100)
temp = map[md->bl.m].bexp*temp/100;
@@ -1842,14 +1843,14 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if (map[md->bl.m].jexp != 100)
bonus = map[md->bl.m].jexp*bonus/100;
if (bonus != 100)
- per = per*bonus/100.;
+ jper = jper*bonus/100.;
job_exp = md->db->job_exp;
- if (job_exp*per > UINT_MAX)
+ if (job_exp*jper > UINT_MAX)
job_exp = UINT_MAX;
else
- job_exp = (unsigned int)(job_exp*per);
+ job_exp = (unsigned int)(job_exp*jper);
if (job_exp < 1)
job_exp = 1;
diff --git a/src/map/skill.c b/src/map/skill.c
index b8f869c7c..d99971244 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5605,7 +5605,7 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
nullpo_retr(0, ud);
BL_CAST( BL_PC, src, sd);
- BL_CAST( BL_HOM, src, hd); //[orn]
+ BL_CAST( BL_HOM, src, hd); //[orn]
BL_CAST( BL_MOB, src, md);
if( src->prev == NULL ) {
@@ -5819,7 +5819,7 @@ int skill_castend_pos (int tid, unsigned int tick, int id, int data)
nullpo_retr(0, ud);
BL_CAST( BL_PC , src, sd);
- BL_CAST( BL_HOM , src, hd); //[orn]
+ BL_CAST( BL_HOM, src, hd); //[orn]
BL_CAST( BL_MOB, src, md);
if( src->prev == NULL ) {
@@ -10069,7 +10069,7 @@ int skill_unit_timer_sub (struct block_list *bl, va_list ap)
if (--group->val1 <= 0)
{ //All tiles were processed, disable skill.
group->target_flag=BCT_NOONE;
- group->bl_flag= 0;
+ group->bl_flag= BL_NUL;
}
}
diff --git a/src/map/status.c b/src/map/status.c
index 30f3486fd..32974e07c 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -355,7 +355,7 @@ void initChangeTables(void) {
set_sc(KN_ONEHAND, SC_ONEHAND, SI_ONEHAND, SCB_ASPD);
set_sc(GS_FLING, SC_FLING, SI_BLANK, SCB_DEF|SCB_DEF2);
add_sc(GS_CRACKER, SC_STUN);
- set_sc(GS_DISARM, SC_STRIPWEAPON, SI_STRIPWEAPON, SCB_WATK);
+ add_sc(GS_DISARM, SC_STRIPWEAPON);
add_sc(GS_PIERCINGSHOT, SC_BLEEDING);
set_sc(GS_MADNESSCANCEL, SC_MADNESSCANCEL, SI_MADNESSCANCEL, SCB_BATK|SCB_ASPD);
set_sc(GS_ADJUSTMENT, SC_ADJUSTMENT, SI_ADJUSTMENT, SCB_HIT|SCB_FLEE);
@@ -4766,7 +4766,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
case SC_ATKPOTION:
case SC_MATKPOTION:
case SC_JAILED:
- case SC_ARMOR_ELEMENT: // Just delete the current one
+ case SC_ARMOR_ELEMENT:
break;
case SC_GOSPEL:
//Must not override a casting gospel char.
diff --git a/src/map/status.h b/src/map/status.h
index 4f1fc9dad..fb6847804 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -521,8 +521,8 @@ enum {
#define SCB_SIZE 0x04000000
#define SCB_RACE 0x08000000
#define SCB_RANGE 0x10000000
-//SCB_DYE means the sc should force cloth-dye change to 0 to avoid client crashes.
#define SCB_REGEN 0x20000000
+//SCB_DYE means the sc should force cloth-dye change to 0 to avoid client crashes.
#define SCB_DYE 0x40000000
#define SCB_PC 0x80000000
#define SCB_ALL 0x3FFFFFFF