summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/mob.c4
-rw-r--r--src/map/status.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index f1a4f9f82..c18f83b66 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -665,9 +665,6 @@ int mob_spawn (struct mob_data *md)
md->target_id = 0;
md->move_fail_count = 0;
- if (!md->level) // [Valaris]
- md->level=md->db->lv;
-
// md->master_id = 0;
md->master_dist = 0;
@@ -2124,7 +2121,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if(mvp_sd->state.event_kill_mob)
npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
}
- if(md->level) md->level=0;
if(md->deletetimer!=-1) {
delete_timer(md->deletetimer,mob_timer_delete);
diff --git a/src/map/status.c b/src/map/status.c
index adeb09be1..4552d9d9f 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -760,7 +760,7 @@ int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per
return 0; //Invalid target.
hp = status->max_hp * per_hp/100;
- sp = status->max_sp * per_hp/100;
+ sp = status->max_sp * per_sp/100;
if(hp > status->max_hp - status->hp)
hp = status->max_hp - status->hp;
@@ -1015,6 +1015,14 @@ int status_calc_mob(struct mob_data* md, int first)
struct block_list *mbl = NULL;
int flag=0;
+ if(first)
+ { //Set basic level on respawn.
+ if (md->spawn)
+ md->level = md->spawn->level;
+ else
+ md->level = md->db->lv; // [Valaris]
+ }
+
//Check if we need custom base-status
if (battle_config.mobs_level_up && md->level != md->db->lv)
flag|=1;