- Added a check to prevent Blind from ending while standing on a fog of wall.

- The mob Slave ai will be executed now even when the slave has a target. This will allow for "instant" warping to the master when it changes maps or teleports. if the slave has a target already, it won't unlock it and chase back to the master or anything like that.
- Removed a couple of checks that prevents item ids above 20000. However, remember that the max id is still ~32k or the client is the one who's gonna crash!


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7799 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-07-21 14:05:27 +00:00
parent 290dc6b181
commit f5464dccc0
4 changed files with 36 additions and 12 deletions

View File

@ -3,6 +3,16 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. 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. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/07/21
* Added a check to prevent Blind from ending while standing on a fog of
wall. [Skotlex]
* The mob Slave ai will be executed now even when the slave has a target.
This will allow for "instant" warping to the master when it changes maps or
teleports. if the slave has a target already, it won't unlock it and chase
back to the master or anything like that. [Skotlex]
* Removed a couple of checks that prevents item ids above 20000. However,
remember that the max id is still ~32k or the client is the one who's gonna
crash! [Skotlex]
2006/07/20 2006/07/20
* Added source reporting when you do an invalid int&str or str&int * Added source reporting when you do an invalid int&str or str&int
operation on a script. [Skotlex] operation on a script. [Skotlex]

View File

@ -429,7 +429,7 @@ static int itemdb_read_itemavail (void)
} }
if (j < 2 || str[0] == NULL || if (j < 2 || str[0] == NULL ||
(nameid = atoi(str[0])) < 0 || nameid >= 20000 || !(id = itemdb_exists(nameid))) (nameid = atoi(str[0])) < 0 || !(id = itemdb_exists(nameid)))
continue; continue;
k = atoi(str[1]); k = atoi(str[1]);
@ -1036,7 +1036,7 @@ static int itemdb_readdb(void)
continue; continue;
nameid=atoi(str[0]); nameid=atoi(str[0]);
if(nameid<=0 || nameid>=20000) if(nameid<=0)
continue; continue;
if (j < 19) if (j < 19)
{ //Crash-fix on broken item lines. [Skotlex] { //Crash-fix on broken item lines. [Skotlex]

View File

@ -887,14 +887,14 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
struct block_list *bl; struct block_list *bl;
int old_dist; int old_dist;
nullpo_retr(0, md);
bl=map_id2bl(md->master_id); bl=map_id2bl(md->master_id);
if (!bl || status_isdead(bl)) { if (!bl || status_isdead(bl)) {
status_kill(&md->bl); status_kill(&md->bl);
return 0; return 1;
} }
if (bl->prev == NULL)
return 0; //Master not on a map? Could be warping, do not process.
if(status_get_mode(&md->bl)&MD_CANMOVE) if(status_get_mode(&md->bl)&MD_CANMOVE)
{ //If the mob can move, follow around. [Check by Skotlex] { //If the mob can move, follow around. [Check by Skotlex]
@ -910,22 +910,26 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
){ ){
md->master_dist = 0; md->master_dist = 0;
unit_warp(&md->bl,bl->m,bl->x,bl->y,3); unit_warp(&md->bl,bl->m,bl->x,bl->y,3);
return 0; return 1;
} }
if(md->target_id) //Slave is busy with a target.
return 0;
// Approach master if within view range, chase back to Master's area also if standing on top of the master. // Approach master if within view range, chase back to Master's area also if standing on top of the master.
if((md->master_dist>MOB_SLAVEDISTANCE || md->master_dist == 0) && if((md->master_dist>MOB_SLAVEDISTANCE || md->master_dist == 0) &&
unit_can_move(&md->bl)) unit_can_move(&md->bl))
{ {
short x = bl->x, y = bl->y; short x = bl->x, y = bl->y;
mob_stop_attack(md); mob_stop_attack(md);
if (map_search_freecell(&md->bl, bl->m, &x, &y, MOB_SLAVEDISTANCE, MOB_SLAVEDISTANCE, 1)) if(map_search_freecell(&md->bl, bl->m, &x, &y, MOB_SLAVEDISTANCE, MOB_SLAVEDISTANCE, 1)
unit_walktoxy(&md->bl, x, y, 0); && unit_walktoxy(&md->bl, x, y, 0))
return 1;
} }
} else if (bl->m != md->bl.m && map_flag_gvg(md->bl.m)) { } else if (bl->m != md->bl.m && map_flag_gvg(md->bl.m)) {
//Delete the summoned mob if it's in a gvg ground and the master is elsewhere. [Skotlex] //Delete the summoned mob if it's in a gvg ground and the master is elsewhere. [Skotlex]
status_kill(&md->bl); status_kill(&md->bl);
return 0; return 1;
} }
//Avoid attempting to lock the master's target too often to avoid unnecessary overload. [Skotlex] //Avoid attempting to lock the master's target too often to avoid unnecessary overload. [Skotlex]
@ -951,6 +955,7 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
md->min_chase=md->db->range3+distance_bl(&md->bl, tbl); md->min_chase=md->db->range3+distance_bl(&md->bl, tbl);
if(md->min_chase>MAX_MINCHASE) if(md->min_chase>MAX_MINCHASE)
md->min_chase=MAX_MINCHASE; md->min_chase=MAX_MINCHASE;
return 1;
} }
} }
} }
@ -1149,9 +1154,9 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
md->attacked_id = 0; md->attacked_id = 0;
} }
// Processing of slave monster, is it needed when there's a target to deal with? // Processing of slave monster
if (md->master_id > 0 && !tbl) if (md->master_id > 0 && mob_ai_sub_hard_slavemob(md, tick))
mob_ai_sub_hard_slavemob(md, tick); return 0;
// Scan area for targets // Scan area for targets
if (!tbl && mode&MD_LOOTER && md->lootitem && DIFF_TICK(tick, md->ud.canact_tick) > 0 && if (!tbl && mode&MD_LOOTER && md->lootitem && DIFF_TICK(tick, md->ud.canact_tick) > 0 &&

View File

@ -6436,6 +6436,15 @@ int status_change_timer(int tid, unsigned int tick, int id, int data)
return 0; return 0;
} }
break; break;
case SC_BLIND:
if(sc->data[SC_FOGWALL].timer!= -1)
{ //Blind lasts forever while you are standing on the fog.
sc->data[type].timer=add_timer(
5000+tick, status_change_timer,
bl->id, data);
return 0;
}
break;
} }
// default for all non-handled control paths // default for all non-handled control paths