- 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://svn.code.sf.net/p/rathena/svn/trunk@5343 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-02-20 14:24:59 +00:00
parent 5172bae1a3
commit 4b752d6757
4 changed files with 30 additions and 14 deletions

View File

@ -5,6 +5,10 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/02/20 2006/02/20
* Corrected the implementation of Gangster's Paradise to work as it should.
[Skotlex]
* Fixed Close-confine not properly ending on a knockback (that includes
backsliding) [Skotlex]
* Changed MAX_RANDITEM from 2000 to 10000 to fit new databases [Komurka] * Changed MAX_RANDITEM from 2000 to 10000 to fit new databases [Komurka]
* Fixed Taekwon stances not triggering. [Skotlex] * Fixed Taekwon stances not triggering. [Skotlex]
* Added atcommand @exp [Skotlex] * Added atcommand @exp [Skotlex]

View File

@ -490,6 +490,7 @@ int map_delblock_sub (struct block_list *bl, int flag)
*/ */
int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) { int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) {
int x0 = bl->x, y0 = bl->y; int x0 = bl->x, y0 = bl->y;
struct status_change *sc = NULL;
int moveblock = ( x0/BLOCK_SIZE != x1/BLOCK_SIZE || y0/BLOCK_SIZE != y1/BLOCK_SIZE); int moveblock = ( x0/BLOCK_SIZE != x1/BLOCK_SIZE || y0/BLOCK_SIZE != y1/BLOCK_SIZE);
if (!bl->prev) { if (!bl->prev) {
@ -499,8 +500,16 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) {
return 0; return 0;
} }
//TODO: Perhaps some outs of bounds checking should be placed here? //TODO: Perhaps some outs of bounds checking should be placed here?
if (bl->type&BL_CHAR) if (bl->type&BL_CHAR) {
skill_unit_move(bl,tick,2); skill_unit_move(bl,tick,2);
sc = status_get_sc(bl);
if (sc && sc->count) {
if (sc->data[SC_CLOSECONFINE].timer != -1)
status_change_end(bl, SC_CLOSECONFINE, -1);
if (sc->data[SC_CLOSECONFINE2].timer != -1)
status_change_end(bl, SC_CLOSECONFINE2, -1);
}
}
if (moveblock) map_delblock_sub(bl,0); if (moveblock) map_delblock_sub(bl,0);
#ifdef CELL_NOSTACK #ifdef CELL_NOSTACK
else map_delblcell(bl); else map_delblcell(bl);
@ -512,22 +521,18 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) {
else map_addblcell(bl); else map_addblcell(bl);
#endif #endif
if (bl->type&BL_CHAR) { if (bl->type&BL_CHAR) {
struct status_change *sc = status_get_sc(bl);
skill_unit_move(bl,tick,3); skill_unit_move(bl,tick,3);
if (sc) { if (sc) {
if (sc->option&OPTION_CLOAK) if (sc->option&OPTION_CLOAK)
skill_check_cloaking(bl); skill_check_cloaking(bl);
if (sc->count) { if (sc->count) {
if (sc->data[SC_DANCING].timer != -1) { if (sc->data[SC_DANCING].timer != -1) {
if (sc->data[SC_DANCING].val1 == CG_MOONLIT) //Cancel Moonlight Petals if moved from casting position. [Skotlex] //Cancel Moonlight Petals if moved from casting position. [Skotlex]
if (sc->data[SC_DANCING].val1 == CG_MOONLIT)
skill_stop_dancing(bl); skill_stop_dancing(bl);
else else
skill_unit_move_unit_group((struct skill_unit_group *)sc->data[SC_DANCING].val2, bl->m, x1-x0, y1-y0); skill_unit_move_unit_group((struct skill_unit_group *)sc->data[SC_DANCING].val2, bl->m, x1-x0, y1-y0);
} }
if (sc->data[SC_CLOSECONFINE].timer != -1)
status_change_end(bl, SC_CLOSECONFINE, -1);
if (sc->data[SC_CLOSECONFINE2].timer != -1)
status_change_end(bl, SC_CLOSECONFINE2, -1);
} }
} }
} }

View File

@ -1285,6 +1285,9 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
switch (bl->type) switch (bl->type)
{ {
case BL_PC: 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: case BL_MOB:
if((dist=distance_bl(&md->bl, bl)) < md->db->range2 if((dist=distance_bl(&md->bl, bl)) < md->db->range2
&& (md->db->range > 6 || mob_can_reach(md,bl,dist+1, MSS_FOLLOW)) && (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) if (md->target_id)
{ //Check validity of current target. [Skotlex] { //Check validity of current target. [Skotlex]
tbl = map_id2bl(md->target_id); tbl = map_id2bl(md->target_id);
if (!tbl || tbl->m != md->bl.m || !status_check_skilluse(&md->bl, tbl, 0, 0)) if (!tbl || tbl->m != md->bl.m || !status_check_skilluse(&md->bl, tbl, 0, 0) || (
{ //Unlock current target. 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. if (md->state.state == MS_WALK && (battle_config.mob_ai&8 || !tbl)) //Inmediately stop chasing.
mob_stop_walking(md, 2); mob_stop_walking(md, 2);
mob_unlocktarget(md, tick-(battle_config.mob_ai&8?3000:0)); //Imediately do random walk. 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 || (dist = distance_bl(&md->bl, abl)) >= 32 ||
battle_check_target(bl, abl, BCT_ENEMY) <= 0 || battle_check_target(bl, abl, BCT_ENEMY) <= 0 ||
(battle_config.mob_ai&2 && !status_check_skilluse(bl, abl, 0, 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... !mob_can_reach(md, abl, dist+2, MSS_RUSH ||
{ //Can't attack back ( //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 (md->attacked_count++ > 3) {
if (mobskill_use(md, tick, MSC_RUDEATTACKED) == 0 && if (mobskill_use(md, tick, MSC_RUDEATTACKED) == 0 &&
mode&MD_CANMOVE && mob_can_move(md)) mode&MD_CANMOVE && mob_can_move(md))

View File

@ -457,14 +457,12 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
struct map_session_data *sd = (struct map_session_data*) target; struct map_session_data *sd = (struct map_session_data*) target;
if (pc_isinvisible(sd)) if (pc_isinvisible(sd))
return 0; return 0;
if ((tsc->option&hide_flag || sd->state.gangsterparadise) if (tsc->option&hide_flag
&& (sd->state.perfect_hiding || !(race == 4 || race == 6 || mode&MD_DETECTOR)) && (sd->state.perfect_hiding || !(race == 4 || race == 6 || mode&MD_DETECTOR))
&& !(mode&MD_BOSS)) && !(mode&MD_BOSS))
return 0; return 0;
} }
break; break;
case BL_PET:
return 0;
case BL_ITEM: //Allow targetting of items to pick'em up (or in the case of mobs, to loot them). case BL_ITEM: //Allow targetting of items to pick'em up (or in the case of mobs, to loot them).
//TODO: Would be nice if this could be used to judge whether the player can or not pick up the item it targets. [Skotlex] //TODO: Would be nice if this could be used to judge whether the player can or not pick up the item it targets. [Skotlex]
if (mode&MD_LOOTER) if (mode&MD_LOOTER)