summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/map.c4
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/npc.c4
-rw-r--r--src/map/skill.c8
-rw-r--r--src/map/status.c14
5 files changed, 22 insertions, 9 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 1ea7498f5..e69d5956c 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2025,7 +2025,11 @@ int mob_cache_cleanup_sub(struct block_list *bl, va_list ap) {
return 0;
if (!battle_config.mob_remove_damaged &&
md->status.hp < md->status.max_hp)
+ {
+ if (md->spawn && md->spawn_n >= 0) //Do not respawn mob later.
+ map[md->spawn->m].moblist[md->spawn_n]->skip++;
return 0; //Do not remove damaged mobs.
+ }
unit_free(&md->bl,0);
diff --git a/src/map/map.h b/src/map/map.h
index 69cd1383b..9a3df879f 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -917,6 +917,7 @@ struct spawn_data {
unsigned short m,x,y; //Spawn information (map, point, spawn-area around point)
signed short xs,ys;
unsigned short num; //Number of mobs using this structure.
+ unsigned short skip; //Number of mobs to skip when spawning them (for mob_remove_damageed: no)
unsigned int level; //Custom level.
unsigned int delay1,delay2; //Min delay before respawning after spawn/death
struct {
diff --git a/src/map/npc.c b/src/map/npc.c
index 59d21e7ba..f6fa6e9ac 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2307,14 +2307,14 @@ int npc_parse_mob2 (struct spawn_data *mob, int index)
int i;
struct mob_data *md;
- for (i = 0; i < mob->num; i++) {
+ for (i = mob->skip; i < mob->num; i++) {
md = mob_spawn_dataset(mob);
md->spawn = mob;
md->spawn_n = index;
md->special_state.cached = (index>=0); //If mob is cached on map, it is dynamically removed
mob_spawn(md);
}
-
+ mob->skip = 0;
return 1;
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 8e2953705..5b250bbca 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -8331,6 +8331,14 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
return 1;
if (sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_STAR)
break;
+ //Auron insists we should implement SP consumption when you are not Soul Linked. [Skotlex]
+ if(sp>0 && type&1)
+ {
+ if (status->sp < (unsigned int)sp)
+ clif_skill_fail(sd,skill,1,0);
+ else
+ status_zap(&sd->bl, 0, sp);
+ }
return 0;
case GD_BATTLEORDER:
case GD_REGENERATION:
diff --git a/src/map/status.c b/src/map/status.c
index dfa0ab424..924a97407 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2494,14 +2494,14 @@ void status_calc_regen(struct block_list *bl, struct status_data *status, struct
val = 0;
if((skill=pc_checkskill(sd,SM_RECOVERY)) > 0)
- val += skill*5 + (status->max_hp*skill/500);
+ val += skill*(5 + status->max_hp/500);
sregen->hp = cap_value(val, 0, SHRT_MAX);
val = 0;
if((skill=pc_checkskill(sd,MG_SRECOVERY)) > 0)
- val += skill*3 + (status->max_sp*skill/500);
+ val += skill*(3 + status->max_sp/500);
if((skill=pc_checkskill(sd,NJ_NINPOU)) > 0)
- val += skill*3 + (status->max_sp*skill/500);
+ val += skill*(3 + status->max_sp/500);
sregen->sp = cap_value(val, 0, SHRT_MAX);
// Skill-related recovery (only when sit)
@@ -2509,21 +2509,21 @@ void status_calc_regen(struct block_list *bl, struct status_data *status, struct
val = 0;
if((skill=pc_checkskill(sd,MO_SPIRITSRECOVERY)) > 0)
- val += skill*4 + (status->max_hp*skill/500);
+ val += skill*(4 + status->max_hp/500);
if((skill=pc_checkskill(sd,TK_HPTIME)) > 0 && sd->state.rest)
- val += skill*30 + (status->max_hp*skill/500);
+ val += skill*(30 + status->max_hp/500);
sregen->hp = cap_value(val, 0, SHRT_MAX);
val = 0;
if((skill=pc_checkskill(sd,TK_SPTIME)) > 0 && sd->state.rest)
{
- val += skill*3 + (status->max_sp*skill/500);
+ val += skill*(3 + status->max_sp/500);
if ((skill=pc_checkskill(sd,SL_KAINA)) > 0) //Power up Enjoyable Rest
val += (30+10*skill)*val/100;
}
if((skill=pc_checkskill(sd,MO_SPIRITSRECOVERY)) > 0)
- val += skill*2 + (status->max_sp*skill/500);
+ val += skill*(2 + status->max_sp/500);
sregen->sp = cap_value(val, 0, SHRT_MAX);
}