From b0588f94abf44afd9079c4af40a5ffc1603d5ef8 Mon Sep 17 00:00:00 2001 From: skotlex Date: Sun, 5 Mar 2006 16:06:30 +0000 Subject: - Fixed a pair of missing map_freeblock_unlock - Changed around a bit the code of the skill_get defines to return 0 if you ask for an id of the place where the guild skills are placed. Also moved the guild skills block to ID 900~915. Also stuff like skill_get_inf will return the relevant guild data as defined on skill_db.txt git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5465 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 6 +++--- src/map/guild.c | 14 -------------- src/map/guild.h | 1 - src/map/pc.c | 6 +++--- src/map/skill.c | 55 +++++++++++++++++++++++++++++++++++-------------------- 5 files changed, 41 insertions(+), 41 deletions(-) (limited to 'src') diff --git a/src/map/clif.c b/src/map/clif.c index 8042e5743..cba560a30 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2062,7 +2062,7 @@ int clif_walkok(struct map_session_data *sd) nullpo_retr(0, sd); fd=sd->fd; - WFIFOHEAD(fd, packet_len_table[0x87]); + WFIFOHEAD(fd, packet_len_table[0x87]); WFIFOW(fd,0)=0x87; WFIFOL(fd,2)=gettick(); WFIFOPOS2(fd,6,sd->bl.x,sd->bl.y,sd->to_x,sd->to_y); @@ -7613,13 +7613,13 @@ int clif_guild_skillinfo(struct map_session_data *sd) g=guild_search(sd->status.guild_id); if(g==NULL) return 0; - WFIFOHEAD(fd, MAX_GUILDSKILL * 37 + 6); + WFIFOHEAD(fd, MAX_GUILDSKILL * 37 + 6); WFIFOW(fd,0)=0x0162; WFIFOW(fd,4)=g->skill_point; for(i=c=0;iskill[i].id>0 && guild_check_skill_require(g,g->skill[i].id)){ WFIFOW(fd,c*37+ 6) = id = g->skill[i].id; - WFIFOW(fd,c*37+ 8) = guild_skill_get_inf(id); + WFIFOW(fd,c*37+ 8) = skill_get_inf(id); WFIFOW(fd,c*37+10) = 0; WFIFOW(fd,c*37+12) = g->skill[i].lv; WFIFOW(fd,c*37+14) = skill_get_sp(id,g->skill[i].lv); diff --git a/src/map/guild.c b/src/map/guild.c index 5d38b5f98..364f676e7 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -63,20 +63,6 @@ int guild_gvg_eliminate_timer(int tid,unsigned int tick,int id,int data); int guild_save_sub(int tid,unsigned int tick,int id,int data); static int guild_send_xy_timer(int tid,unsigned int tick,int id,int data); -// ギルドスキルdbのアクセサ(今は直打ちで代用) -// Modified for new skills [Sara] -int guild_skill_get_inf(int id) -{ - switch(id) { - case GD_BATTLEORDER: - case GD_REGENERATION: - case GD_RESTORE: - case GD_EMERGENCYCALL: - return 4; - } - return 0; -} - // Modified [Komurka] int guild_skill_get_max (int id) { diff --git a/src/map/guild.h b/src/map/guild.h index eaca29f46..d44500be5 100644 --- a/src/map/guild.h +++ b/src/map/guild.h @@ -11,7 +11,6 @@ struct guild_member; struct guild_position; struct guild_castle; -int guild_skill_get_inf(int id); int guild_skill_get_max(int id); int guild_checkskill(struct guild *g,int id); diff --git a/src/map/pc.c b/src/map/pc.c index afe638f1b..31020bf6d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3382,9 +3382,9 @@ int pc_run(struct map_session_data *sd, int skilllv, int dir) if(to_x == sd->bl.x && to_y == sd->bl.y){ if(sd->sc.data[SC_RUN].timer!=-1) status_change_end(&sd->bl,SC_RUN,-1); - } else - pc_walktoxy(sd, to_x, to_y); - + return 0; + } + pc_walktoxy(sd, to_x, to_y); return 1; } /*========================================== diff --git a/src/map/skill.c b/src/map/skill.c index a5a9242e5..140acd9e4 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -30,6 +30,9 @@ #include "date.h" #define SKILLUNITTIMER_INVERVAL 100 +//Guild Skills are shifted to these to make them stick into the skill array. +#define GD_SKILLRANGEMIN 900 +#define GD_SKILLRANGEMAX GD_SKILLRANGEMIN+MAX_GUILDSKILL #define swap(x,y) { int t; t = x; x = y; y = t; } int skill_names_id[MAX_SKILL_DB]; @@ -577,20 +580,21 @@ struct skill_abra_db skill_abra_db[MAX_SKILL_ABRA_DB]; // for values that don't require level just put a one (putting 0 will trigger return 0; instead // for values that might need to use a different function just skill_chk would suffice. #define skill_chk(i, l) \ - if (i >= 10000 && i < 10015) {i -= 9500;} \ - if (i < 1 || i > MAX_SKILL_DB) {return 0;} \ + if (i >= GD_SKILLRANGEMIN && i <= GD_SKILLRANGEMAX) { return 0; } \ + if (i >= GD_SKILLBASE) {i = GD_SKILLRANGEMIN + i - GD_SKILLBASE;} \ + if (i < 1 || i >= MAX_SKILL_DB) {return 0;} \ if (l <= 0 || l > MAX_SKILL_LEVEL) {return 0;} #define skill_get(var, i, l) \ { skill_chk(i, l); return var; } // Skill DB int skill_get_hit( int id ){ skill_get (skill_db[id].hit, id, 1); } -int skill_get_inf( int id ){ skill_chk (id, 1); return (id < 500 || id > 1000) ? skill_db[id].inf : guild_skill_get_inf(id); } +int skill_get_inf( int id ){ skill_get (skill_db[id].inf, id, 1); } int skill_get_pl( int id ){ skill_get (skill_db[id].pl, id, 1); } int skill_get_nk( int id ){ skill_get (skill_db[id].nk, id, 1); } -int skill_get_max( int id ){ skill_chk (id, 1); return (id < 500 || id > 1000) ? skill_db[id].max : guild_skill_get_max(id); } -int skill_get_range( int id , int lv ){ skill_chk (id, lv); return (id < 500 || id > 1000) ? skill_db[id].range[lv-1] : 0; } -int skill_get_splash( int id , int lv ){ skill_chk (id, lv); return (id < 500 || id > 1000) ? (skill_db[id].splash[lv-1]>=0?skill_db[id].splash[lv-1]:AREA_SIZE) : 0; } +int skill_get_max( int id ){ skill_get (skill_db[id].max, id, 1); } +int skill_get_range( int id , int lv ){ skill_get(skill_db[id].range[lv-1], id, lv); } +int skill_get_splash( int id , int lv ){ skill_chk (id, lv); return (skill_db[id].splash[lv-1]>=0?skill_db[id].splash[lv-1]:AREA_SIZE); } int skill_get_hp( int id ,int lv ){ skill_get (skill_db[id].hp[lv-1], id, lv); } int skill_get_sp( int id ,int lv ){ skill_get (skill_db[id].sp[lv-1], id, lv); } int skill_get_zeny( int id ,int lv ){ skill_get (skill_db[id].zeny[lv-1], id, lv); } @@ -618,9 +622,13 @@ int skill_get_unit_range( int id ){ skill_get (skill_db[id].unit_range, id, 1); int skill_get_unit_target( int id ){ skill_get ((skill_db[id].unit_target&BCT_ALL), id, 1); } int skill_get_unit_bl_target( int id ){ skill_get ((skill_db[id].unit_target&BL_ALL), id, 1); } int skill_get_unit_flag( int id ){ skill_get (skill_db[id].unit_flag, id, 1); } -const char* skill_get_name( int id ){ - if (id >= 10000 && id < 10015) id -= 9500; - if (id < 1 || id > MAX_SKILL_DB || skill_db[id].name==NULL) return "UNKNOWN_SKILL"; //Can't use skill_chk because we return a string. +const char* skill_get_name( int id ){ + if (id >= GD_SKILLRANGEMIN && id <= GD_SKILLRANGEMAX) + return "UNKNOWN_SKILL"; + if (id >= GD_SKILLBASE) + id = GD_SKILLRANGEMIN + id - GD_SKILLBASE; + if (id < 1 || id > MAX_SKILL_DB || skill_db[id].name==NULL) + return "UNKNOWN_SKILL"; //Can't use skill_chk because we return a string. return skill_db[id].name; } @@ -2561,13 +2569,14 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s BF_WEAPON, src, src, skillid, skilllv, tick, flag, BCT_ENEMY); break; case TK_JUMPKICK: - if(sd) { - if (!pc_can_move(sd)) - return 0; - skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag); - pc_movepos(sd,bl->x,bl->y,0); - clif_slide(src,bl->x,bl->y); + if (sd && !pc_can_move(sd)) { + map_freeblock_unlock(); + return 1; } + skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag); + if (sd) pc_movepos(sd,bl->x,bl->y,0); + else map_moveblock(src, bl->y, bl->y, tick); + clif_slide(src,bl->x,bl->y); break; case ASC_BREAKER: /* ソウルブレ?カ? */ // [DracoRPG] // Separate weapon and magic attacks @@ -4552,8 +4561,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in { int x,y, dir = status_get_dir(src); - if (md && !mob_can_move(md)) - return 0; + if (md && !mob_can_move(md)) { + map_freeblock_unlock(); + return 1; + } x = src->x + dirx[dir]*skilllv*2; y = src->y + diry[dir]*skilllv*2; @@ -11006,9 +11017,13 @@ int skill_readdb(void) continue; i=atoi(split[0]); - if (i>=10000 && i<10015) // for guild skills [Celest] - i -= 9500; - else if(i<=0 || i>MAX_SKILL_DB) + if (i >= GD_SKILLRANGEMIN && i <= GD_SKILLRANGEMAX) { + ShowWarning("read skill_db: Can't use skill id %d as guild skills are placed there!\n"); + continue; + } + if (i >= GD_SKILLBASE) + i = GD_SKILLRANGEMIN + i - GD_SKILLBASE; + if(i<=0 || i>MAX_SKILL_DB) continue; skill_split_atoi(split[1],skill_db[i].range); -- cgit v1.2.3-70-g09d2