diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-20 14:24:59 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-20 14:24:59 +0000 |
commit | 4e2c773c1e4203b4e9db62c016445e0443dd39ff (patch) | |
tree | 5a3adce557a104901d10cb06c26df8dd9ce0da1b /src/map/mob.c | |
parent | f122cf8dd41f6bdcd8a5bc719135c758b9660918 (diff) | |
download | hercules-4e2c773c1e4203b4e9db62c016445e0443dd39ff.tar.gz hercules-4e2c773c1e4203b4e9db62c016445e0443dd39ff.tar.bz2 hercules-4e2c773c1e4203b4e9db62c016445e0443dd39ff.tar.xz hercules-4e2c773c1e4203b4e9db62c016445e0443dd39ff.zip |
- Corrected implementation of Gangster Paradise to just prevent mobs from targetting you.
- Likely fixed Close Confine not unlocking the target when you move/are moved.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5343 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index af8cb9dea..db752c556 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1285,6 +1285,9 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap) switch (bl->type)
{
case BL_PC:
+ if (((struct map_session_data*)bl)->state.gangsterparadise &&
+ !(status_get_mode(&md->bl)&MD_BOSS))
+ return 0; //Gangster paradise protection.
case BL_MOB:
if((dist=distance_bl(&md->bl, bl)) < md->db->range2
&& (md->db->range > 6 || mob_can_reach(md,bl,dist+1, MSS_FOLLOW))
@@ -1598,8 +1601,10 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) if (md->target_id)
{ //Check validity of current target. [Skotlex]
tbl = map_id2bl(md->target_id);
- if (!tbl || tbl->m != md->bl.m || !status_check_skilluse(&md->bl, tbl, 0, 0))
- { //Unlock current target.
+ if (!tbl || tbl->m != md->bl.m || !status_check_skilluse(&md->bl, tbl, 0, 0) || (
+ tbl->type == BL_PC && !(mode&MD_BOSS) &&
+ ((struct map_session_data*)tbl)->state.gangsterparadise
+ )) { //Unlock current target.
if (md->state.state == MS_WALK && (battle_config.mob_ai&8 || !tbl)) //Inmediately stop chasing.
mob_stop_walking(md, 2);
mob_unlocktarget(md, tick-(battle_config.mob_ai&8?3000:0)); //Imediately do random walk.
@@ -1616,8 +1621,12 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) (dist = distance_bl(&md->bl, abl)) >= 32 ||
battle_check_target(bl, abl, BCT_ENEMY) <= 0 ||
(battle_config.mob_ai&2 && !status_check_skilluse(bl, abl, 0, 0)) ||
- !mob_can_reach(md, abl, dist+2, MSS_RUSH)) //Some more cells of grace...
- { //Can't attack back
+ !mob_can_reach(md, abl, dist+2, MSS_RUSH ||
+ ( //Gangster Paradise check
+ abl->type == BL_PC && !(mode&MD_BOSS) &&
+ ((struct map_session_data*)abl)->state.gangsterparadise
+ )
+ )) { //Can't attack back
if (md->attacked_count++ > 3) {
if (mobskill_use(md, tick, MSC_RUDEATTACKED) == 0 &&
mode&MD_CANMOVE && mob_can_move(md))
|