summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c7
-rw-r--r--src/map/battle.h3
-rw-r--r--src/map/mob.c23
-rw-r--r--src/map/pc.c1
-rw-r--r--src/map/skill.c3
5 files changed, 26 insertions, 11 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index d0eab1861..da209b2a1 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3169,9 +3169,10 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
return -1; //Cannot be targeted yet.
break;
case BL_MOB:
- if (((TBL_MOB*)target)->special_state.ai > 1 &&
+ if((((TBL_MOB*)target)->special_state.ai == 2 || //Marine Spheres
+ (((TBL_MOB*)target)->special_state.ai == 3 && battle_config.summon_flora&1)) && //Floras
s_bl->type == BL_PC && src->type != BL_MOB)
- { //Alchemist summoned mobs are always targettable by players
+ { //Targettable by players
state |= BCT_ENEMY;
strip_enemy = 0;
}
@@ -3474,6 +3475,7 @@ static const struct battle_data_short {
{ "defunit_not_enemy", &battle_config.defnotenemy },
{ "gvg_traps_target_all", &battle_config.vs_traps_bctall },
{ "traps_setting", &battle_config.traps_setting },
+ { "summon_flora_setting", &battle_config.summon_flora },
{ "clear_skills_on_death", &battle_config.clear_unit_ondeath },
{ "clear_skills_on_warp", &battle_config.clear_unit_onwarp },
{ "random_monster_checklv", &battle_config.random_monster_checklv },
@@ -3872,6 +3874,7 @@ void battle_set_defaults() {
battle_config.defnotenemy=0;
battle_config.vs_traps_bctall=BL_PC;
battle_config.traps_setting=0;
+ battle_config.summon_flora=3;
battle_config.clear_unit_ondeath=BL_ALL;
battle_config.clear_unit_onwarp=BL_ALL;
battle_config.random_monster_checklv=1;
diff --git a/src/map/battle.h b/src/map/battle.h
index 364553ebd..181f39340 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -103,7 +103,8 @@ extern struct Battle_Config {
unsigned short pc_damage_delay_rate;
unsigned short defnotenemy;
unsigned short vs_traps_bctall;
- unsigned short traps_setting;
+ unsigned short traps_setting;
+ unsigned short summon_flora; //[Skotlex]
unsigned short clear_unit_ondeath; //[Skotlex]
unsigned short clear_unit_onwarp; //[Skotlex]
unsigned short random_monster_checklv;
diff --git a/src/map/mob.c b/src/map/mob.c
index fa0d0f135..e8d2a5b81 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2134,17 +2134,26 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
mob_script_callback(md, src, CALLBACK_DEAD);
else if(md->npc_event[0]){
md->status.hp = 0; //So that npc_event invoked functions KNOW that I am dead.
- if(src && src->type == BL_PET)
- sd = ((struct pet_data *)src)->msd;
- if(sd && battle_config.mob_npc_event_type)
+ if(src)
+ switch (src->type) {
+ case BL_PET:
+ sd = ((TBL_PET*)src)->msd;
+ break;
+ case BL_HOM:
+ sd = ((TBL_HOM*)src)->master;
+ break;
+ }
+ if(sd && battle_config.mob_npc_event_type) {
+ pc_setglobalreg(sd,"killerrid",sd->bl.id);
npc_event(sd,md->npc_event,0);
- else if(mvp_sd)
+ } else if(mvp_sd) {
+ pc_setglobalreg(mvp_sd,"killerrid",sd?sd->bl.id:0);
npc_event(mvp_sd,md->npc_event,0);
+ }
md->status.hp = 1;
- } else if (mvp_sd) { //lordalfa
+ } else if (mvp_sd && mvp_sd->state.event_kill_mob) { //lordalfa
pc_setglobalreg(mvp_sd,"killedrid",md->class_);
- if(mvp_sd->state.event_kill_mob)
- npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
+ npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
}
if(md->deletetimer!=-1) {
diff --git a/src/map/pc.c b/src/map/pc.c
index f83b032cf..ee003a66a 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3236,6 +3236,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, int lv)
md->state.steal_flag = UCHAR_MAX; //you can't steal from this mob any more
malloc_set(&tmp_item,0,sizeof(tmp_item));
+ itemid = md->db->dropitem[i].nameid;
tmp_item.nameid = itemid;
tmp_item.amount = 1;
tmp_item.identify = itemdb_isidentified(itemid);
diff --git a/src/map/skill.c b/src/map/skill.c
index 84c174788..b3c87ddaf 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -8137,7 +8137,8 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
int mob_class = (skill==AM_CANNIBALIZE)? summons[lv-1] :1142;
if(battle_config.land_skill_limit && maxcount>0 && (battle_config.land_skill_limit&BL_PC)) {
i = map_foreachinmap(skill_check_condition_mob_master_sub ,sd->bl.m, BL_MOB, sd->bl.id, mob_class, skill, &c);
- if(c >= maxcount || (skill==AM_CANNIBALIZE && c != i))
+ if(c >= maxcount ||
+ (skill==AM_CANNIBALIZE && c != i && battle_config.summon_flora&2))
{ //Fails when: exceed max limit. There are other plant types already out.
clif_skill_fail(sd,skill,0,0);
return 0;