summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog.txt10
-rw-r--r--conf-tmpl/battle_athena.conf3
-rw-r--r--src/map/battle.c42
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/mob.c21
-rw-r--r--src/map/pc.c19
7 files changed, 82 insertions, 16 deletions
diff --git a/Changelog.txt b/Changelog.txt
index 890a30e17..c89d03821 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,4 +1,14 @@
Date Added
+11/15
+ * Added mobs_level_up option. [Valaris]
+ -Everytime a monster kills a play their level will increase and show levelup animation.
+ -Their 6 main stats and speed will increase as they level.
+ -They will recover 10% of the max hp of the player it kills.
+ -Player will gain extra exp based on how much stronger a monster is than normal.
+ -Skill estimation will show monsters current level (instead of reading from db).
+ -Will display level 99 aura if and when a monster hits level 99.
+ -They will not go higher than level 99.
+
11/14
* Made the Advance jobchangers to kRO standars with the following;
- Checks if you are level 99/50 and 2nd class OR above.
diff --git a/conf-tmpl/battle_athena.conf b/conf-tmpl/battle_athena.conf
index 5839191fb..4061056c6 100644
--- a/conf-tmpl/battle_athena.conf
+++ b/conf-tmpl/battle_athena.conf
@@ -724,5 +724,8 @@ area_size: 14
// Zeny from mobs
zeny_from_mobs: no
+// Monsters level up (monster will level up each time a player is killed and they will grow stronger)
+mobs_level_up: no
+
import: conf/import/battle_conf.txt
diff --git a/src/map/battle.c b/src/map/battle.c
index 405abaea1..27efdd9e8 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -98,7 +98,7 @@ int battle_get_lv(struct block_list *bl)
{
nullpo_retr(0, bl);
if(bl->type==BL_MOB && (struct mob_data *)bl)
- return mob_db[((struct mob_data *)bl)->class].lv;
+ return ((struct mob_data *)bl)->level;
else if(bl->type==BL_PC && (struct map_session_data *)bl)
return ((struct map_session_data *)bl)->status.base_level;
else if(bl->type==BL_PET && (struct pet_data *)bl)
@@ -153,6 +153,8 @@ int battle_get_max_hp(struct block_list *bl)
int max_hp=1;
if(bl->type==BL_MOB && ((struct mob_data*)bl)) {
max_hp = mob_db[((struct mob_data*)bl)->class].max_hp;
+ if(battle_config.mobs_level_up) // mobs leveling up increase [Valaris]
+ max_hp+=(((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv)*battle_get_vit(bl);
if(mob_db[((struct mob_data*)bl)->class].mexp > 0) {
if(battle_config.mvp_hp_rate != 100)
max_hp = (max_hp * battle_config.mvp_hp_rate)/100;
@@ -195,8 +197,11 @@ int battle_get_str(struct block_list *bl)
nullpo_retr(0, bl);
sc_data=battle_get_sc_data(bl);
- if(bl->type==BL_MOB && ((struct mob_data *)bl))
+ if(bl->type==BL_MOB && ((struct mob_data *)bl)) {
str = mob_db[((struct mob_data *)bl)->class].str;
+ if(battle_config.mobs_level_up) // mobs leveling up increase [Valaris]
+ str+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ }
else if(bl->type==BL_PC && ((struct map_session_data *)bl))
return ((struct map_session_data *)bl)->paramc[0];
else if(bl->type==BL_PET && ((struct pet_data *)bl))
@@ -229,8 +234,11 @@ int battle_get_agi(struct block_list *bl)
nullpo_retr(0, bl);
sc_data=battle_get_sc_data(bl);
- if(bl->type==BL_MOB && (struct mob_data *)bl)
+ if(bl->type==BL_MOB && (struct mob_data *)bl) {
agi=mob_db[((struct mob_data *)bl)->class].agi;
+ if(battle_config.mobs_level_up) // increase of mobs leveling up [Valaris]
+ agi+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ }
else if(bl->type==BL_PC && (struct map_session_data *)bl)
agi=((struct map_session_data *)bl)->paramc[1];
else if(bl->type==BL_PET && (struct pet_data *)bl)
@@ -270,8 +278,11 @@ int battle_get_vit(struct block_list *bl)
nullpo_retr(0, bl);
sc_data=battle_get_sc_data(bl);
- if(bl->type==BL_MOB && (struct mob_data *)bl)
+ if(bl->type==BL_MOB && (struct mob_data *)bl) {
vit=mob_db[((struct mob_data *)bl)->class].vit;
+ if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
+ vit+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ }
else if(bl->type==BL_PC && (struct map_session_data *)bl)
vit=((struct map_session_data *)bl)->paramc[2];
else if(bl->type==BL_PET && (struct pet_data *)bl)
@@ -298,8 +309,11 @@ int battle_get_int(struct block_list *bl)
nullpo_retr(0, bl);
sc_data=battle_get_sc_data(bl);
- if(bl->type==BL_MOB && (struct mob_data *)bl)
+ if(bl->type==BL_MOB && (struct mob_data *)bl){
int_=mob_db[((struct mob_data *)bl)->class].int_;
+ if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
+ int_+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ }
else if(bl->type==BL_PC && (struct map_session_data *)bl)
int_=((struct map_session_data *)bl)->paramc[3];
else if(bl->type==BL_PET && (struct pet_data *)bl)
@@ -331,8 +345,11 @@ int battle_get_dex(struct block_list *bl)
nullpo_retr(0, bl);
sc_data=battle_get_sc_data(bl);
- if(bl->type==BL_MOB && (struct mob_data *)bl)
+ if(bl->type==BL_MOB && (struct mob_data *)bl) {
dex=mob_db[((struct mob_data *)bl)->class].dex;
+ if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
+ dex+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ }
else if(bl->type==BL_PC && (struct map_session_data *)bl)
dex=((struct map_session_data *)bl)->paramc[4];
else if(bl->type==BL_PET && (struct pet_data *)bl)
@@ -371,8 +388,11 @@ int battle_get_luk(struct block_list *bl)
nullpo_retr(0, bl);
sc_data=battle_get_sc_data(bl);
- if(bl->type==BL_MOB && (struct mob_data *)bl)
+ if(bl->type==BL_MOB && (struct mob_data *)bl) {
luk=mob_db[((struct mob_data *)bl)->class].luk;
+ if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
+ luk+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ }
else if(bl->type==BL_PC && (struct map_session_data *)bl)
luk=((struct map_session_data *)bl)->paramc[5];
else if(bl->type==BL_PET && (struct pet_data *)bl)
@@ -876,9 +896,11 @@ int battle_get_speed(struct block_list *bl)
else {
struct status_change *sc_data=battle_get_sc_data(bl);
int speed = 1000;
- if(bl->type==BL_MOB && (struct mob_data *)bl)
-// speed = mob_db[((struct mob_data *)bl)->class].speed;
+ if(bl->type==BL_MOB && (struct mob_data *)bl) {
speed = ((struct mob_data *)bl)->speed;
+ if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
+ speed-=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ }
else if(bl->type==BL_PET && (struct pet_data *)bl)
speed = ((struct pet_data *)bl)->msd->petDB->speed;
@@ -5087,6 +5109,7 @@ static const struct {
{ "area_size", &battle_config.area_size }, // added by [MouseJstr]
{ "muting_players", &battle_config.muting_players}, // added by [Apple]
{ "zeny_from_mobs", &battle_config.zeny_from_mobs}, // [Valaris]
+ { "mobs_level_up", &battle_config.mobs_level_up}, // [Valaris]
//SQL-only options start
#ifndef TXT_ONLY
{ "mail_system", &battle_config.mail_system }, // added by [Valaris]
@@ -5307,6 +5330,7 @@ void battle_set_defaults() {
battle_config.min_cloth_color = 0;
battle_config.max_cloth_color = 4;
battle_config.zeny_from_mobs = 0;
+ battle_config.mobs_level_up = 0;
battle_config.castrate_dex_scale = 150;
diff --git a/src/map/battle.h b/src/map/battle.h
index 806d74852..97fa369a4 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -332,6 +332,7 @@ extern struct Battle_Config {
int area_size; // added by [MouseJstr]
int zeny_from_mobs; // [Valaris]
+ int mobs_level_up; // [Valaris]
#ifndef TXT_ONLY /* SQL-only options */
int mail_system; // [Valaris]
diff --git a/src/map/clif.c b/src/map/clif.c
index 544a8fdfc..e44222baf 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4578,7 +4578,7 @@ int clif_skill_estimation(struct map_session_data *sd,struct block_list *dst)
WBUFW(buf, 0)=0x18c;
WBUFW(buf, 2)=mob_get_viewclass(md->class);
- WBUFW(buf, 4)=mob_db[md->class].lv;
+ WBUFW(buf, 4)=md->level;
WBUFW(buf, 6)=mob_db[md->class].size;
WBUFL(buf, 8)=md->hp;
WBUFW(buf,12)=battle_get_def2(&md->bl);
diff --git a/src/map/mob.c b/src/map/mob.c
index 57ff28eda..ea4f46685 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2350,21 +2350,30 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if(per>512) per=512;
if(per<1) per=1;
base_exp=mob_db[md->class].base_exp*per/256;
+
if(base_exp < 1) base_exp = 1;
if(sd && md && battle_config.pk_mode==1 && (mob_db[md->class].lv - sd->status.base_level >= 20)) {
base_exp*=1.15; // pk_mode additional exp if monster >20 levels [Valaris]
}
- if(md->state.special_mob_ai >= 1 && battle_config.alchemist_summon_reward != 1) base_exp = 0; // Added [Valaris]
job_exp=mob_db[md->class].job_exp*per/256;
if(job_exp < 1) job_exp = 1;
if(sd && md && battle_config.pk_mode==1 && (mob_db[md->class].lv - sd->status.base_level >= 20)) {
job_exp*=1.15; // pk_mode additional exp if monster >20 levels [Valaris]
}
- if(md->state.special_mob_ai >= 1 && battle_config.alchemist_summon_reward != 1) job_exp = 0; // Added [Valaris]
- else if(battle_config.zeny_from_mobs) {
- if(md->level > 0) zeny=(md->level+rand()%md->level)*per/256; // zeny calculation moblv + random moblv [Valaris]
- if(mob_db[md->class].mexp > 0)
- zeny*=rand()%250;
+ if(md->state.special_mob_ai >= 1 && battle_config.alchemist_summon_reward != 1) { // for summoned creatures [Valaris]
+ base_exp = 0;
+ job_exp = 0;
+ }
+ else {
+ if(battle_config.zeny_from_mobs) {
+ if(md->level > 0) zeny=(md->level+rand()%md->level)*per/256; // zeny calculation moblv + random moblv [Valaris]
+ if(mob_db[md->class].mexp > 0)
+ zeny*=rand()%250;
+ }
+ if(battle_config.mobs_level_up && md->level > mob_db[md->class].lv) { // [Valaris]
+ job_exp+=((md->level-mob_db[md->class].lv)*mob_db[md->class].job_exp*.03)*per/256;
+ base_exp+=((md->level-mob_db[md->class].lv)*mob_db[md->class].base_exp*.03)*per/256;
+ }
}
if((pid=tmpsd[i]->status.party_id)>0){ // パーティに入っている
diff --git a/src/map/pc.c b/src/map/pc.c
index 0c204c707..2022f1e58 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2648,6 +2648,11 @@ int pc_skill(struct map_session_data *sd,int id,int level,int flag)
pc_calcstatus(sd,0);
clif_skillinfoblock(sd);
}
+ else if(flag==2 && (sd->status.skill[id].id == id || level == 0)){ // クエスト所得ならここで条件を確認して送信する
+ sd->status.skill[id].lv+=level;
+ pc_calcstatus(sd,0);
+ clif_skillinfoblock(sd);
+ }
else if(sd->status.skill[id].lv < level){ // 覚えられるがlvが小さいなら
if(sd->status.skill[id].id==id)
sd->status.skill[id].flag=sd->status.skill[id].lv+2; // lvを記憶
@@ -5014,6 +5019,20 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
clif_updatestatus(sd,SP_JOBEXP);
}
}
+ // monster level up [Valaris]
+ if(battle_config.mobs_level_up && src && src->type==BL_MOB) {
+ struct mob_data *md=(struct mob_data *)src;
+ if(md && md->target_id != 0 && md->target_id==sd->bl.id) { // reset target id when player dies
+ md->target_id=0;
+ mob_changestate(md,MS_WALK,0);
+ }
+ if(md && md->state.state!=MS_DEAD && md->level < 99) {
+ clif_misceffect(&md->bl,0);
+ md->level++;
+ md->hp+=sd->status.max_hp*.1;
+ }
+ }
+
//ナイトメアモードアイテムドロップ
if(map[sd->bl.m].flag.pvp_nightmaredrop){ // Moved this outside so it works when PVP isnt enabled and during pk mode [Ancyker]
for(j=0;j<MAX_DROP_PER_MAP;j++){