diff options
-rw-r--r-- | Changelog-Trunk.txt | 8 | ||||
-rw-r--r-- | conf-tmpl/battle/monster.conf | 5 | ||||
-rw-r--r-- | src/map/battle.c | 9 | ||||
-rw-r--r-- | src/map/battle.h | 1 | ||||
-rw-r--r-- | src/map/npc.c | 5 | ||||
-rw-r--r-- | src/map/skill.c | 32 |
6 files changed, 46 insertions, 14 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 9c2f98ded..b40080246 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -2,6 +2,14 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+
+2006/08/07
+ * Adjusted Battle_check_target so that alchemist summoned mobs are
+ targetted by everyone as long as 1. The top-level master is a player and 2.
+ the actual attacker is not a mob-type. [Skotlex]
+ * Added config force_random_spawn which overrides the spawn-files defined
+ coordinates to make all mobs always spawn randomly on the map. [Skotlex]
+ * SC_SPEEDUP0 is no longer dispellable by SA_DISPEL [Skotlex]
2006/08/06
* Updated item_db.sql & mob_db.sql to latest. [Toms]
* Little fixes on homunc (hp/sp are now saved and init stats changed) [Toms]
diff --git a/conf-tmpl/battle/monster.conf b/conf-tmpl/battle/monster.conf index ce3934bdb..f90e92080 100644 --- a/conf-tmpl/battle/monster.conf +++ b/conf-tmpl/battle/monster.conf @@ -116,6 +116,11 @@ boss_spawn_delay: 100 // 5 seconds.
no_spawn_on_player: 0
+// Should spawn coordinates in the mob-spawn files be ignored? (Note 1)
+// If set to yes, all monsters will have a random respawn spot across the whole
+// map regardless of what the mob-spawn file says.
+force_random_spawn: no
+
// Do summon slaves inherit the passive/aggressive traits of their master? (Note 1)
slaves_inherit_mode: yes
diff --git a/src/map/battle.c b/src/map/battle.c index 736ec637d..a1f0e2a90 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1763,7 +1763,6 @@ static struct Damage battle_calc_weapon_attack( wd.damage = battle_addmastery(sd,target,wd.damage,0); if (flag.lh) wd.damage2 = battle_addmastery(sd,target,wd.damage2,1); - if((skill=pc_checkskill(sd,SG_STAR_ANGER)) >0 && (t_class == sd->hate_mob[2] || (sc && sc->data[SC_MIRACLE].timer!=-1))) { skillratio = (sd->status.base_level + sstatus->str + sstatus->dex + sstatus->luk)/(skill<4?12-3*skill:1); @@ -3173,8 +3172,9 @@ 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) - { //Alchemist summoned mobs are sort of universal enemies. + if (((TBL_MOB*)target)->special_state.ai > 1 && + s_bl->type == BL_PC && src->type != BL_MOB) + { //Alchemist summoned mobs are always targettable by players state |= BCT_ENEMY; strip_enemy = 0; } @@ -3509,6 +3509,8 @@ static const struct battle_data_short { { "mob_count_rate", &battle_config.mob_count_rate }, { "mob_spawn_delay", &battle_config.mob_spawn_delay }, { "no_spawn_on_player", &battle_config.no_spawn_on_player }, + + { "force_random_spawn", &battle_config.force_random_spawn }, { "plant_spawn_delay", &battle_config.plant_spawn_delay }, { "boss_spawn_delay", &battle_config.boss_spawn_delay }, { "slaves_inherit_mode", &battle_config.slaves_inherit_mode }, @@ -3914,6 +3916,7 @@ void battle_set_defaults() { battle_config.mob_count_rate=100; battle_config.mob_spawn_delay=100; battle_config.no_spawn_on_player=0; + battle_config.force_random_spawn=0; battle_config.plant_spawn_delay=100; battle_config.boss_spawn_delay=100; battle_config.slaves_inherit_mode=1; diff --git a/src/map/battle.h b/src/map/battle.h index 8dbad1ac0..43f20c4e0 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -157,6 +157,7 @@ extern struct Battle_Config { unsigned short mob_skill_delay; //[Skotlex]
unsigned short mob_count_rate;
unsigned short no_spawn_on_player; //[Skotlex]
+ unsigned short force_random_spawn; //[Skotlex]
unsigned short mob_spawn_delay, plant_spawn_delay, boss_spawn_delay; // [Skotlex]
unsigned short slaves_inherit_mode;
unsigned short slaves_inherit_speed;
diff --git a/src/map/npc.c b/src/map/npc.c index ef8dbf8be..0ebec7aaf 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2217,6 +2217,11 @@ int npc_parse_mob (char *w1, char *w2, char *w3, char *w4) mob.num = 1;
}
+ if (battle_config.force_random_spawn)
+ { //Force a random spawn anywhere on the map.
+ mob.x = mob.y = mob.xs = mob.ys = 0;
+ }
+
//Apply the spawn delay fix [Skotlex]
mode = mob_db(class_)->status.mode;
if (mode & MD_BOSS) { //Bosses
diff --git a/src/map/skill.c b/src/map/skill.c index 6e9d5c9ff..2cd3ff4e6 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4438,14 +4438,24 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in int strip_fix, equip = 0; int sclist[4] = {0,0,0,0}; - if (skillid == RG_STRIPWEAPON || skillid == ST_FULLSTRIP || skillid == GS_DISARM) - equip |= EQP_WEAPON; - if (skillid == RG_STRIPSHIELD || skillid == ST_FULLSTRIP) - equip |= EQP_SHIELD; - if (skillid == RG_STRIPARMOR || skillid == ST_FULLSTRIP) - equip |= EQP_ARMOR; - if (skillid == RG_STRIPHELM || skillid == ST_FULLSTRIP) - equip |= EQP_HELM; + switch (skillid) { + case RG_STRIPWEAPON: + case GS_DISARM: + equip = EQP_WEAPON; + break; + case RG_STRIPSHIELD: + equip = EQP_SHIELD; + break; + case RG_STRIPARMOR: + equip = EQP_ARMOR; + break; + case RG_STRIPHELM: + equip = EQP_HELM; + break; + case ST_FULLSTRIP: + equip = EQP_WEAPON|EQP_SHIELD|EQP_ARMOR|EQP_HELM; + break; + } strip_fix = sstatus->dex - tstatus->dex; if(strip_fix < 0) @@ -4462,7 +4472,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in continue; switch (i) { case EQI_HAND_L: //Shield / left-hand weapon - if(dstsd->inventory_data[dstsd->equip_index[EQI_HAND_L]]->type == IT_ARMOR) + if(dstsd->inventory_data[dstsd->equip_index[i]]->type == IT_ARMOR) { //Shield if (equip&EQP_SHIELD && !(dstsd->unstripable_equip&EQP_SHIELD) && @@ -4475,7 +4485,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in } //Continue to weapon case EQI_HAND_R: - if (equip &EQP_WEAPON && + if (equip&EQP_WEAPON && !(dstsd->unstripable_equip&EQP_WEAPON) && !(tsc && tsc->data[SC_CP_WEAPON].timer != -1) ) { @@ -4663,7 +4673,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in || i==SC_CP_WEAPON || i==SC_CP_SHIELD || i==SC_CP_ARMOR || i==SC_CP_HELM || i==SC_COMBO || i==SC_DANCING || i==SC_GUILDAURA || i==SC_EDP || i==SC_AUTOBERSERK || i==SC_CARTBOOST || i==SC_MELTDOWN || i==SC_MOONLIT - || i==SC_SAFETYWALL || i==SC_SMA + || i==SC_SAFETYWALL || i==SC_SMA || i==SC_SPEEDUP0 ) continue; if(i==SC_BERSERK) tsc->data[i].val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0. |