diff options
author | glighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-12-30 16:00:24 +0000 |
---|---|---|
committer | glighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-12-30 16:00:24 +0000 |
commit | e81fad940ac591a6a76ecd0aa0b1d26cff688705 (patch) | |
tree | 03e7cad0b1bd243837b40cd5045957806291b992 /src/map/guild.c | |
parent | a31cce3c60cc170db0d4a8ff707626e8777b0801 (diff) | |
download | hercules-e81fad940ac591a6a76ecd0aa0b1d26cff688705.tar.gz hercules-e81fad940ac591a6a76ecd0aa0b1d26cff688705.tar.bz2 hercules-e81fad940ac591a6a76ecd0aa0b1d26cff688705.tar.xz hercules-e81fad940ac591a6a76ecd0aa0b1d26cff688705.zip |
-Harmonize skillid, skill_num, skillnum, skill, to skill_id and same for skill_lv
-Optimise type from int to int16 in order to reduce ram consumtion.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17065 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/guild.c')
-rw-r--r-- | src/map/guild.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/map/guild.c b/src/map/guild.c index f1d81b081..4e256fbd0 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -96,7 +96,7 @@ int guild_skill_get_max (int id) return guild_skill_tree[id-GD_SKILLBASE].max; } -// Retrive skilllv learned by guild +// Retrive skill_lv learned by guild int guild_checkskill(struct guild *g, int id) { int idx = id - GD_SKILLBASE; @@ -110,18 +110,18 @@ int guild_checkskill(struct guild *g, int id) { *------------------------------------------*/ static bool guild_read_guildskill_tree_db(char* split[], int columns, int current) {// <skill id>,<max lv>,<req id1>,<req lv1>,<req id2>,<req lv2>,<req id3>,<req lv3>,<req id4>,<req lv4>,<req id5>,<req lv5> - int k, id, skillid; + int k, id, skill_id; - skillid = atoi(split[0]); - id = skillid - GD_SKILLBASE; + skill_id = atoi(split[0]); + id = skill_id - GD_SKILLBASE; if( id < 0 || id >= MAX_GUILDSKILL ) { - ShowWarning("guild_read_guildskill_tree_db: Invalid skill id %d.\n", skillid); + ShowWarning("guild_read_guildskill_tree_db: Invalid skill id %d.\n", skill_id); return false; } - guild_skill_tree[id].id = skillid; + guild_skill_tree[id].id = skill_id; guild_skill_tree[id].max = atoi(split[1]); if( guild_skill_tree[id].id == GD_GLORYGUILD && battle_config.require_glory_guild && guild_skill_tree[id].max == 0 ) @@ -1238,13 +1238,13 @@ int guild_getexp(struct map_session_data *sd,int exp) } /*==================================================== - * Ask to increase guildskill skill_num + * Ask to increase guildskill skill_id *---------------------------------------------------*/ -int guild_skillup(TBL_PC* sd, int skill_num) +int guild_skillup(TBL_PC* sd, uint16 skill_id) { struct guild* g; - int idx = skill_num - GD_SKILLBASE; - int max = guild_skill_get_max(skill_num); + int idx = skill_id - GD_SKILLBASE; + int max = guild_skill_get_max(skill_id); nullpo_ret(sd); @@ -1256,15 +1256,15 @@ int guild_skillup(TBL_PC* sd, int skill_num) if( g->skill_point > 0 && g->skill[idx].id != 0 && g->skill[idx].lv < max ) - intif_guild_skillup(g->guild_id, skill_num, sd->status.account_id, max); + intif_guild_skillup(g->guild_id, skill_id, sd->status.account_id, max); return 0; } /*==================================================== - * Notification of guildskill skill_num increase request + * Notification of guildskill skill_id increase request *---------------------------------------------------*/ -int guild_skillupack(int guild_id,int skill_num,int account_id) +int guild_skillupack(int guild_id,uint16 skill_id,int account_id) { struct map_session_data *sd=map_id2sd(account_id); struct guild *g=guild_search(guild_id); @@ -1272,15 +1272,15 @@ int guild_skillupack(int guild_id,int skill_num,int account_id) if(g==NULL) return 0; if( sd != NULL ) { - clif_guild_skillup(sd,skill_num,g->skill[skill_num-GD_SKILLBASE].lv); + clif_guild_skillup(sd,skill_id,g->skill[skill_id-GD_SKILLBASE].lv); /* Guild Aura handling */ - switch( skill_num ) { + switch( skill_id ) { case GD_LEADERSHIP: case GD_GLORYWOUNDS: case GD_SOULCOLD: case GD_HAWKEYES: - guild_guildaura_refresh(sd,skill_num,g->skill[skill_num-GD_SKILLBASE].lv); + guild_guildaura_refresh(sd,skill_id,g->skill[skill_id-GD_SKILLBASE].lv); break; } } @@ -1293,9 +1293,9 @@ int guild_skillupack(int guild_id,int skill_num,int account_id) return 0; } -void guild_guildaura_refresh(struct map_session_data *sd, int skill_num, int skill_lv) { +void guild_guildaura_refresh(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) { struct skill_unit_group* group = NULL; - int type = status_skill2sc(skill_num); + int type = status_skill2sc(skill_id); if( !(battle_config.guild_aura&((agit_flag || agit2_flag)?2:1)) && !(battle_config.guild_aura&(map_flag_gvg2(sd->bl.m)?8:4)) ) return; @@ -1305,7 +1305,7 @@ void guild_guildaura_refresh(struct map_session_data *sd, int skill_num, int ski skill_delunitgroup(group); status_change_end(&sd->bl,type,INVALID_TIMER); } - group = skill_unitsetting(&sd->bl,skill_num,skill_lv,sd->bl.x,sd->bl.y,0); + group = skill_unitsetting(&sd->bl,skill_id,skill_lv,sd->bl.x,sd->bl.y,0); if( group ) { sc_start4(&sd->bl,type,100,(battle_config.guild_aura&16)?0:skill_lv,0,0,group->group_id,600000);//duration doesn't matter these status never end with val4 } @@ -1335,10 +1335,10 @@ int guild_get_alliance_count(struct guild *g,int flag) // Blocks all guild skills which have a common delay time. void guild_block_skill(struct map_session_data *sd, int time) { - int skill_num[] = { GD_BATTLEORDER, GD_REGENERATION, GD_RESTORE, GD_EMERGENCYCALL }; + uint16 skill_id[] = { GD_BATTLEORDER, GD_REGENERATION, GD_RESTORE, GD_EMERGENCYCALL }; int i; for (i = 0; i < 4; i++) - skill_blockpc_start_(sd, skill_num[i], time , true); + skill_blockpc_start_(sd, skill_id[i], time , true); } /*==================================================== |