From 2c59a71155825161387535f2d5bc43f9f47a0c6d Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 18 Dec 2006 20:12:59 +0000 Subject: - Added hom_setting to specify which homunculus 'quirks' are in effect. The default activates all of them, if you set them to 0 then homuncs will not be treated in any special matter, pretty much like standard mobs. if I missed any 'quirky' homunc behaviour from it, report it so it can be added to the list. - Made flooritem_lifetime a int so you can specify much longer life times (the default of 60k was already very close to the max of 65k) - Removed monster_ai 0x80 since it's now handled by hom_setting. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9519 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.c | 6 ++++-- src/map/battle.h | 3 ++- src/map/clif.c | 7 +++++-- src/map/mob.c | 3 ++- src/map/status.c | 9 +++++---- 5 files changed, 18 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/map/battle.c b/src/map/battle.c index eb544dc4d..766622490 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3284,7 +3284,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f return 0; //For some mysterious reason ground-skills can't target homun. - if (target->type == BL_HOM) + if (target->type == BL_HOM && battle_config.hom_setting&0x2) return 0; if (su->group->src_id == target->id) @@ -3507,7 +3507,6 @@ static const struct battle_data_short { { "clear_skills_on_warp", &battle_config.clear_unit_onwarp }, { "random_monster_checklv", &battle_config.random_monster_checklv }, { "attribute_recover", &battle_config.attr_recover }, - { "flooritem_lifetime", &battle_config.flooritem_lifetime }, { "item_auto_get", &battle_config.item_auto_get }, { "drop_rate0item", &battle_config.drop_rate0item }, { "pvp_exp", &battle_config.pvp_exp }, @@ -3761,6 +3760,7 @@ static const struct battle_data_short { { "debuff_on_logout", &battle_config.debuff_on_logout}, { "monster_ai", &battle_config.mob_ai}, + { "monster_ai", &battle_config.hom_setting}, { "dynamic_mobs", &battle_config.dynamic_mobs}, { "mob_remove_damaged", &battle_config.mob_remove_damaged}, { "show_hp_sp_drain", &battle_config.show_hp_sp_drain}, // [Skotlex] @@ -3813,6 +3813,7 @@ static const struct battle_data_int { const char *str; int *val; } battle_data_int[] = { //List here battle_athena options which are type int! + { "flooritem_lifetime", &battle_config.flooritem_lifetime }, { "item_first_get_time", &battle_config.item_first_get_time }, { "item_second_get_time", &battle_config.item_second_get_time }, { "item_third_get_time", &battle_config.item_third_get_time }, @@ -4196,6 +4197,7 @@ void battle_set_defaults() { battle_config.debuff_on_logout = 1; battle_config.use_statpoint_table = 1; battle_config.mob_ai = 0; + battle_config.hom_setting = 0xFFFF; battle_config.dynamic_mobs = 1; // use Dynamic Mobs [Wizputer] battle_config.mob_remove_damaged = 1; // Dynamic Mobs - Remove mobs even if damaged [Wizputer] battle_config.mob_remove_delay = 60000; diff --git a/src/map/battle.h b/src/map/battle.h index 94ced24f7..4b811f069 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -109,8 +109,8 @@ extern struct Battle_Config { unsigned short clear_unit_onwarp; //[Skotlex] unsigned short random_monster_checklv; unsigned short attr_recover; - unsigned short flooritem_lifetime; unsigned short item_auto_get; + int flooritem_lifetime; int item_first_get_time; int item_second_get_time; int item_third_get_time; @@ -383,6 +383,7 @@ extern struct Battle_Config { unsigned short berserk_cancels_buffs; // [Aru] unsigned short debuff_on_logout; // Removes a few "official" negative Scs on logout. [Skotlex] unsigned short mob_ai; //Configures various mob_ai settings to make them smarter or dumber(official). [Skotlex] + unsigned short hom_setting; //Configures various homunc settings which make them behave unlike normaly characters.. [Skotlex] unsigned short dynamic_mobs; // Dynamic Mobs [Wizputer] - battle_athena flag implemented by [random] unsigned short mob_remove_damaged; // Dynamic Mobs - Remove mobs even if damaged [Wizputer] int mob_remove_delay; // Dynamic Mobs - delay before removing mobs from a map [Skotlex] diff --git a/src/map/clif.c b/src/map/clif.c index 668ef21ee..dbf12e601 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1428,7 +1428,10 @@ int clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag) WBUFW(buf,35)=cap_value(status->rhw.atk2+status->batk, 0, SHRT_MAX); WBUFW(buf,37)=cap_value(status->matk_max, 0, SHRT_MAX); WBUFW(buf,39)=status->hit; - WBUFW(buf,41)=status->luk/3 + 1; //crit is a +1 decimal value! Just display purpose.[Vicious] + if (battle_config.hom_setting&0x10) + WBUFW(buf,41)=status->luk/3 + 1; //crit is a +1 decimal value! Just display purpose.[Vicious] + else + WBUFW(buf,41)=status->cri/10; WBUFW(buf,43)=status->def + status->vit ; WBUFW(buf,45)=status->mdef; WBUFW(buf,47)=status->flee; @@ -8336,7 +8339,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) clif_send_homdata(sd,0,0); clif_homskillinfoblock(sd); //Homunc mimic their master's speed on each map change. [Skotlex] - if (battle_config.slaves_inherit_speed&1) + if (battle_config.hom_setting&0x8) status_calc_bl(&sd->hd->bl, SCB_SPEED); // Since hom is inmune to land effects, unneeded. // skill_unit_move(&sd->hd->bl,gettick(),1); diff --git a/src/map/mob.c b/src/map/mob.c index 32deef2bc..b2dc67482 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -798,7 +798,8 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap) !(status_get_mode(&md->bl)&MD_BOSS)) return 0; //Gangster paradise protection. default: - if (!(battle_config.mob_ai&0x80) && (*target) && (*target)->type == BL_HOM && bl->type != BL_HOM) + if (battle_config.hom_setting&0x4 && + (*target) && (*target)->type == BL_HOM && bl->type != BL_HOM) return 0; //For some reason Homun targets are never overriden. dist = distance_bl(&md->bl, bl); diff --git a/src/map/status.c b/src/map/status.c index ccb017c08..aee10e721 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1101,7 +1101,8 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int //Can't use support skills on homun (only master/self can) //Placed here instead of battle_check_target because support skill //invocations don't call that function. - if (skill_num && skill_get_inf(skill_num)&INF_SUPPORT_SKILL && + if (skill_num && battle_config.hom_setting&0x1 && + skill_get_inf(skill_num)&INF_SUPPORT_SKILL && battle_get_master(target) != src) return 0; default: @@ -2356,7 +2357,7 @@ int status_calc_homunculus(struct homun_data *hd, int first) status->rhw.range = 1 + status->size; status->mode = MD_CANMOVE|MD_CANATTACK; status->speed = DEFAULT_WALK_SPEED; - if (battle_config.slaves_inherit_speed&1 && + if (battle_config.hom_setting&0x8 && hd->master && hd->master->state.auth) //Master needs be authed to have valid speed. status->speed = status_get_speed(&hd->master->bl); @@ -2839,10 +2840,10 @@ void status_calc_bl_sub_hom(struct homun_data *hd, unsigned long flag) //[orn] if(flag|SCB_WATK && status->rhw.atk2 < status->rhw.atk) status->rhw.atk2 = status->rhw.atk; - if(flag&SCB_MATK) //Hom Min Matk is always the same as Max Matk + if(flag&SCB_MATK && battle_config.hom_setting&0x20) //Hom Min Matk is always the same as Max Matk status->matk_min = status->matk_max; - if(flag&SCB_SPEED && battle_config.slaves_inherit_speed&1 && hd->master) + if(flag&SCB_SPEED && battle_config.hom_setting&0x8 && hd->master) status->speed = status_get_speed(&hd->master->bl); if(flag&(SCB_ASPD|SCB_AGI|SCB_DEX)) { -- cgit v1.2.3-70-g09d2