Renamed struct 'skill' to 's_skill' to remove naming collisions.

Added defines for mercenary skill ranges.
Added a mapping of mercenary skills to the skill db (700-799 atm).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13012 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ultramage 2008-07-29 08:19:07 +00:00
parent 6fd34c5052
commit 582c36c11e
7 changed files with 36 additions and 20 deletions

View File

@ -4,6 +4,9 @@ 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. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2008/07/29 2008/07/29
* Renamed struct 'skill' to 's_skill' to remove naming collisions.
* Added defines for mercenary skill ranges.
* Added a mapping of mercenary skills to the skill db (700-799 atm).
* Fixed Sql object not initializing default values properly. * Fixed Sql object not initializing default values properly.
Fixed Sql_Free producing timer deallocation errors when called Fixed Sql_Free producing timer deallocation errors when called
without first establishing a database connection. without first establishing a database connection.

View File

@ -886,7 +886,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything
char point_map[MAP_NAME_LENGTH_EXT]; char point_map[MAP_NAME_LENGTH_EXT];
struct point tmp_point; struct point tmp_point;
struct item tmp_item; struct item tmp_item;
struct skill tmp_skill; struct s_skill tmp_skill;
struct s_friend tmp_friend; struct s_friend tmp_friend;
#ifdef HOTKEY_SAVING #ifdef HOTKEY_SAVING
struct hotkey tmp_hotkey; struct hotkey tmp_hotkey;

View File

@ -30,7 +30,7 @@
#define MAX_ZENY 1000000000 #define MAX_ZENY 1000000000
#define MAX_FAME 1000000000 #define MAX_FAME 1000000000
#define MAX_CART 100 #define MAX_CART 100
#define MAX_SKILL 1100 // Bumped to 1100 for new quest skills, will need to further increase one day... [DracoRPG] #define MAX_SKILL 1020
#define GLOBAL_REG_NUM 96 #define GLOBAL_REG_NUM 96
#define ACCOUNT_REG_NUM 64 #define ACCOUNT_REG_NUM 64
#define ACCOUNT_REG2_NUM 16 #define ACCOUNT_REG2_NUM 16
@ -104,6 +104,10 @@
#define MAIL_TITLE_LENGTH 40 #define MAIL_TITLE_LENGTH 40
#define MAIL_BODY_LENGTH 200 #define MAIL_BODY_LENGTH 200
//Mercenary System
#define MC_SKILLBASE 8201
#define MAX_MERCSKILL 37
enum item_types { enum item_types {
IT_HEALING = 0, IT_HEALING = 0,
IT_UNKNOWN, //1 IT_UNKNOWN, //1
@ -157,7 +161,7 @@ struct point {
short x,y; short x,y;
}; };
struct skill { struct s_skill {
unsigned short id,lv,flag; unsigned short id,lv,flag;
}; };
@ -216,7 +220,7 @@ struct s_homunculus { //[orn]
int hp,max_hp,sp,max_sp; int hp,max_hp,sp,max_sp;
unsigned int intimacy; //[orn] unsigned int intimacy; //[orn]
short hunger; short hunger;
struct skill hskill[MAX_HOMUNSKILL]; //albator struct s_skill hskill[MAX_HOMUNSKILL]; //albator
short skillpts; short skillpts;
short level; short level;
unsigned int exp; unsigned int exp;
@ -280,7 +284,7 @@ struct mmo_charstatus {
struct point last_point,save_point,memo_point[MAX_MEMOPOINTS]; struct point last_point,save_point,memo_point[MAX_MEMOPOINTS];
struct item inventory[MAX_INVENTORY],cart[MAX_CART]; struct item inventory[MAX_INVENTORY],cart[MAX_CART];
struct storage_data storage; struct storage_data storage;
struct skill skill[MAX_SKILL]; struct s_skill skill[MAX_SKILL];
struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex] struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex]
#ifdef HOTKEY_SAVING #ifdef HOTKEY_SAVING

View File

@ -836,7 +836,7 @@ int merc_hom_shuffle(struct homun_data *hd)
struct map_session_data *sd; struct map_session_data *sd;
int lv, i, skillpts; int lv, i, skillpts;
unsigned int exp; unsigned int exp;
struct skill b_skill[MAX_HOMUNSKILL]; struct s_skill b_skill[MAX_HOMUNSKILL];
if (!merc_is_hom_active(hd)) if (!merc_is_hom_active(hd))
return 0; return 0;

View File

@ -38,11 +38,14 @@
#define SKILLUNITTIMER_INTERVAL 100 #define SKILLUNITTIMER_INTERVAL 100
//Guild Skills are shifted to these to make them stick into the skill array.
// ranges reserved for mapping skill ids to skilldb offsets
#define GD_SKILLRANGEMIN 900 #define GD_SKILLRANGEMIN 900
#define GD_SKILLRANGEMAX GD_SKILLRANGEMIN+MAX_GUILDSKILL #define GD_SKILLRANGEMAX GD_SKILLRANGEMIN+MAX_GUILDSKILL
#define HM_SKILLRANGEMIN 800 #define HM_SKILLRANGEMIN 800
#define HM_SKILLRANGEMAX HM_SKILLRANGEMIN+MAX_HOMUNSKILL #define HM_SKILLRANGEMAX HM_SKILLRANGEMIN+MAX_HOMUNSKILL
#define MC_SKILLRANGEMIN 700
#define MC_SKILLRANGEMAX MC_SKILLRANGEMIN+MAX_MERCSKILL
static struct eri *skill_unit_ers = NULL; //For handling skill_unit's [Skotlex] static struct eri *skill_unit_ers = NULL; //For handling skill_unit's [Skotlex]
static struct eri *skill_timer_ers = NULL; //For handling skill_timerskills [Skotlex] static struct eri *skill_timer_ers = NULL; //For handling skill_timerskills [Skotlex]
@ -73,17 +76,23 @@ int skill_name2id(const char* name)
/// Returns the skill's array index, or 0 (Unknown Skill). /// Returns the skill's array index, or 0 (Unknown Skill).
int skill_get_index( int id ) int skill_get_index( int id )
{ {
// avoid ranges reserved for mapping guild/homun skills // avoid ranges reserved for mapping guild/homun/mercenary skills
if( id >= GD_SKILLRANGEMIN && id <= GD_SKILLRANGEMAX ) if( id >= GD_SKILLRANGEMIN && id <= GD_SKILLRANGEMAX
return 0; || id >= HM_SKILLRANGEMIN && id <= HM_SKILLRANGEMAX
if( id >= HM_SKILLRANGEMIN && id <= HM_SKILLRANGEMAX ) || id >= MC_SKILLRANGEMIN && id <= MC_SKILLRANGEMAX )
return 0; return 0;
// map skill number to skill id // map skill id to skill db index
if( id >= GD_SKILLBASE ) if( id >= GD_SKILLBASE )
id = GD_SKILLRANGEMIN + id - GD_SKILLBASE; id = GD_SKILLRANGEMIN + id - GD_SKILLBASE;
else
if( id >= HM_SKILLBASE ) if( id >= HM_SKILLBASE )
id = HM_SKILLRANGEMIN + id - HM_SKILLBASE; id = HM_SKILLRANGEMIN + id - HM_SKILLBASE;
else
if( id >= MC_SKILLBASE )
id = MC_SKILLRANGEMIN + id - MC_SKILLBASE;
else
; // identity
// validate result // validate result
if( id <= 0 || id >= MAX_SKILL_DB ) if( id <= 0 || id >= MAX_SKILL_DB )
@ -10791,14 +10800,14 @@ static bool skill_parse_row_skilldb(char* split[], int columns, int current)
{// id,range,hit,inf,element,nk,splash,max,list_num,castcancel,cast_defence_rate,inf2,maxcount,skill_type,blow_count,name,description {// id,range,hit,inf,element,nk,splash,max,list_num,castcancel,cast_defence_rate,inf2,maxcount,skill_type,blow_count,name,description
int id = atoi(split[0]); int id = atoi(split[0]);
int i; int i;
if( id >= GD_SKILLRANGEMIN && id <= GD_SKILLRANGEMAX ) { if( id >= GD_SKILLRANGEMIN && id <= GD_SKILLRANGEMAX
ShowWarning("skill_parse_row_skilldb: Skill id %d is forbidden (interferes with guild skill mapping)!\n"); || id >= HM_SKILLRANGEMIN && id <= HM_SKILLRANGEMAX
return false; || id >= MC_SKILLRANGEMIN && id <= MC_SKILLRANGEMAX )
} {
if( id >= HM_SKILLRANGEMIN && id <= HM_SKILLRANGEMAX ) { ShowWarning("skill_parse_row_skilldb: Skill id %d is forbidden (interferes with guild/homun/mercenary skill mapping)!\n");
ShowWarning("skill_parse_row_skilldb: Skill id %d is forbidden (interferes with homunculus skill mapping)!\n");
return false; return false;
} }
i = skill_get_index(id); i = skill_get_index(id);
if( !i ) // invalid skill id if( !i ) // invalid skill id
return false; return false;

View File

@ -349,7 +349,7 @@ enum {
ST_WATER, ST_WATER,
}; };
enum s_skill { enum e_skill {
NV_BASIC = 1, NV_BASIC = 1,
SM_SWORD, SM_SWORD,

View File

@ -1595,7 +1595,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
static int calculating = 0; //Check for recursive call preemption. [Skotlex] static int calculating = 0; //Check for recursive call preemption. [Skotlex]
struct status_data b_status, *status; struct status_data b_status, *status;
const struct status_change *sc = &sd->sc; const struct status_change *sc = &sd->sc;
struct skill b_skill[MAX_SKILL]; struct s_skill b_skill[MAX_SKILL];
int b_weight,b_max_weight; int b_weight,b_max_weight;
int i,index; int i,index;