- Some cleaning of the slave moving code.

- Fixed the icon for Provoke not showing.
- Fixed skill_timerskills (type was not being stored, water-ball at least got broken, doing only 1 hit always)
- pc_setinventorydata won't try to set data for positions with no item.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5283 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-02-15 03:51:59 +00:00
parent 91bc73b561
commit 931033a7b1
6 changed files with 32 additions and 30 deletions

View File

@ -4,6 +4,11 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EVERYTHING ELSE IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EVERYTHING ELSE
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/14 2006/02/14
* pc_setinventorydata won't use itemdb_search on empty inventory slots (id
= 0) [Skotlex]
* Fixed the icon from Provoke being gone. [Skotlex]
* Fixed skill_timerskill (most notable skill broken: water ball doing 1
hit) [Skotlex]
* Removed the declaration of puchar and pchar from my_global.h which was * Removed the declaration of puchar and pchar from my_global.h which was
preventing compiles on native win NT systems. Drawback is now Win9X systems preventing compiles on native win NT systems. Drawback is now Win9X systems
will fail to compile instead... [Skotlex] will fail to compile instead... [Skotlex]

View File

@ -3098,7 +3098,7 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
int boss = status_get_mode(target)&MD_BOSS; int boss = status_get_mode(target)&MD_BOSS;
int rate = 0; int rate = 0;
if (sd->weapon_coma_ele[ele] > 0) if (sd->weapon_coma_ele[ele] > 0)
rate+=sd->weapon_coma_ele[ele]; rate += sd->weapon_coma_ele[ele];
if (sd->weapon_coma_race[race] > 0) if (sd->weapon_coma_race[race] > 0)
rate += sd->weapon_coma_race[race]; rate += sd->weapon_coma_race[race];
if (sd->weapon_coma_race[boss?10:11] > 0) if (sd->weapon_coma_race[boss?10:11] > 0)

View File

@ -1420,34 +1420,30 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
return 0; return 0;
} }
// Although there is the master, since it is somewhat far, it approaches. // Approach master if within view range, chase back to Master's area also if standing on top of the master.
if((!md->target_id || md->state.targettype == NONE_ATTACKABLE) && mob_can_move(md) && if(md->master_dist<md->db->range3 && (md->master_dist>MOB_SLAVEDISTANCE || md->master_dist == 0) &&
md->master_dist<md->db->range3 && (md->walkpath.path_pos>=md->walkpath.path_len || md->walkpath.path_len==0)){ mob_can_move(md) && md->state.state == MS_IDLE)
{
int i=0,dx,dy,ret; int i=0,dx,dy,ret;
if(md->master_dist>MOB_SLAVEDISTANCE || md->master_dist == 0) do {
{ //Chase back to Master's area also if standing on top of the master. if(i<=5){
do { dx=bl->x - md->bl.x;
if(i<=5){ dy=bl->y - md->bl.y;
dx=bl->x - md->bl.x;
dy=bl->y - md->bl.y;
if(dx<0) dx+=rand()%MOB_SLAVEDISTANCE +1; if(dx<0) dx+=rand()%MOB_SLAVEDISTANCE +1;
else if(dx>0) dx-=rand()%MOB_SLAVEDISTANCE +1; else if(dx>0) dx-=rand()%MOB_SLAVEDISTANCE +1;
if(dy<0) dy+=rand()%MOB_SLAVEDISTANCE +1;
if(dy<0) dy+=rand()%MOB_SLAVEDISTANCE +1; else if(dy>0) dy-=rand()%MOB_SLAVEDISTANCE +1;
else if(dy>0) dy-=rand()%MOB_SLAVEDISTANCE +1;
}else{ }else{
ret = MOB_SLAVEDISTANCE*2+1; ret = MOB_SLAVEDISTANCE*2+1;
dx=bl->x - md->bl.x + rand()%ret - MOB_SLAVEDISTANCE; dx=bl->x - md->bl.x + rand()%ret - MOB_SLAVEDISTANCE;
dy=bl->y - md->bl.y + rand()%ret - MOB_SLAVEDISTANCE; dy=bl->y - md->bl.y + rand()%ret - MOB_SLAVEDISTANCE;
} }
ret=mob_walktoxy(md,md->bl.x+dx,md->bl.y+dy,0); ret=mob_walktoxy(md,md->bl.x+dx,md->bl.y+dy,0);
i++; i++;
} while(ret && i<10); } while(ret && i<10);
md->next_walktime=tick+1000;
}
} }
} 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]

View File

@ -490,7 +490,7 @@ int pc_setinventorydata(struct map_session_data *sd)
for(i=0;i<MAX_INVENTORY;i++) { for(i=0;i<MAX_INVENTORY;i++) {
id = sd->status.inventory[i].nameid; id = sd->status.inventory[i].nameid;
sd->inventory_data[i] = itemdb_search(id); sd->inventory_data[i] = id?itemdb_search(id):NULL;
} }
return 0; return 0;
} }

View File

@ -2330,7 +2330,7 @@ int skill_addtimerskill(struct block_list *src,unsigned int tick,int target,int
} }
for(i=0;i<max && sts[i].timer != -1;i++); for(i=0;i<max && sts[i].timer != -1;i++);
if (i>=max) return 1; if (i>=max) return 1;
sts[i].timer = add_timer(tick, skill_timerskill, src->id, i); sts[i].timer = add_timer(tick, skill_timerskill, src->id, i);
sts[i].src_id = src->id; sts[i].src_id = src->id;
sts[i].target_id = target; sts[i].target_id = target;
@ -2339,6 +2339,7 @@ int skill_addtimerskill(struct block_list *src,unsigned int tick,int target,int
sts[i].map = src->m; sts[i].map = src->m;
sts[i].x = x; sts[i].x = x;
sts[i].y = y; sts[i].y = y;
sts[i].type = type;
sts[i].flag = flag; sts[i].flag = flag;
if (count) if (count)
(*count)++; (*count)++;
@ -2532,11 +2533,11 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s
case NPC_HOLYATTACK: case NPC_HOLYATTACK:
case NPC_DARKNESSATTACK: case NPC_DARKNESSATTACK:
case NPC_TELEKINESISATTACK: case NPC_TELEKINESISATTACK:
case NPC_UNDEADATTACK:
case NPC_BREAKARMOR: case NPC_BREAKARMOR:
case NPC_BREAKWEAPON:
case NPC_BREAKHELM: case NPC_BREAKHELM:
case NPC_BREAKSHIELD: case NPC_BREAKSHIELD:
case NPC_BREAKWEAPON:
case NPC_UNDEADATTACK:
case LK_AURABLADE: /* オ?ラブレ?ド */ case LK_AURABLADE: /* オ?ラブレ?ド */
case LK_SPIRALPIERCE: /* スパイラルピア?ス */ case LK_SPIRALPIERCE: /* スパイラルピア?ス */
case LK_HEADCRUSH: /* ヘッドクラッシュ */ case LK_HEADCRUSH: /* ヘッドクラッシュ */

View File

@ -75,7 +75,7 @@ void initChangeTables(void) {
if (StatusIconChangeTable[sc]==SI_BLANK) StatusIconChangeTable[sc] = icon; if (StatusIconChangeTable[sc]==SI_BLANK) StatusIconChangeTable[sc] = icon;
set_sc(SM_BASH, SC_STUN, SI_BLANK); set_sc(SM_BASH, SC_STUN, SI_BLANK);
set_sc(SM_PROVOKE, SC_PROVOKE, SI_BLANK); set_sc(SM_PROVOKE, SC_PROVOKE, SI_PROVOKE);
set_sc(SM_MAGNUM, SC_WATK_ELEMENT, SI_BLANK); set_sc(SM_MAGNUM, SC_WATK_ELEMENT, SI_BLANK);
set_sc(SM_ENDURE, SC_ENDURE, SI_ENDURE); set_sc(SM_ENDURE, SC_ENDURE, SI_ENDURE);
set_sc(MG_SIGHT, SC_SIGHT, SI_BLANK); set_sc(MG_SIGHT, SC_SIGHT, SI_BLANK);