* Reduced MAX_SKILL_LEVEL to 10
* Tidied up parts in skill_castfix a bit * Fixed map-server crashing if an empty line was added in any of the skill-xx db files * Updated skill_castnodex reading git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@895 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
b04a9b7671
commit
7beb492f29
@ -1,5 +1,13 @@
|
|||||||
Date Added
|
Date Added
|
||||||
01/02
|
01/02
|
||||||
|
* Reduced MAX_SKILL_LEVEL to 10 to save a bit of memory and speed [celest]
|
||||||
|
* Tidied up parts in skill_castfix a bit [celest]
|
||||||
|
* Fixed map-server crashing if an empty line was added in any of the skill-xx
|
||||||
|
db files [celest]
|
||||||
|
* Updated skill_castnodex reading - An *optional* 3rd value can be added to set
|
||||||
|
whether a skill's delay time can be affected by dex [celest]
|
||||||
|
Example: 46,1,1 - double strafe's delay is not affected by dex
|
||||||
|
46,1,0:0:0:0:1 - only level 5 double strafe is not affected by dex
|
||||||
* More atempts at memory leak fixes [Codemaster] [SVN 890]
|
* More atempts at memory leak fixes [Codemaster] [SVN 890]
|
||||||
* Updated weapon breaking rates, thanks to DracoRPG [celest]
|
* Updated weapon breaking rates, thanks to DracoRPG [celest]
|
||||||
* Optimized enchanting skills success rates calculation, thanks to Wallex
|
* Optimized enchanting skills success rates calculation, thanks to Wallex
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
//<Skill id>,<1 or 0>
|
//<Skill id>,<Cast: 1 or 0>,<Delay (Optional): 1 or 0>
|
||||||
// With 1, dex does not effect the skill's cast rate
|
// Cast: With 1, dex does not affect the skill's cast rate
|
||||||
// With 0, dex effects the skill's cast rate
|
// Cast: With 0, dex affects the skill's cast rate
|
||||||
46,1
|
// Delay: With 1, dex does not affect the skill's delay rate
|
||||||
47,1
|
// Delay: With 0, dex affects the skill's delay rate
|
||||||
129,1
|
// Example - 46,1,1 = Double Strafe's casting time and delay is not affected by dex.
|
||||||
366,1
|
|
||||||
381,1
|
46,1 //AC_DOUBLE
|
||||||
382,1
|
47,1 //AC_SHOWER
|
||||||
383,1
|
129,1 //HT_FALCON
|
||||||
394,1
|
366,1 //HW_MAGICPOWER
|
||||||
403,1
|
381,1 //SN_FALCONASSAULT
|
||||||
406,1
|
382,1 //SN_SHARPSHOOTING
|
||||||
|
383,1 //SN_WINDWALK
|
||||||
|
394,1 //CG_ARROWVULCAN
|
||||||
|
403,1 //PF_MEMORIZE
|
||||||
|
406,0,1 //ASC_METEORASSAULT
|
@ -16,7 +16,7 @@
|
|||||||
#define LIFETIME_FLOORITEM 60
|
#define LIFETIME_FLOORITEM 60
|
||||||
#define DAMAGELOG_SIZE 30
|
#define DAMAGELOG_SIZE 30
|
||||||
#define LOOTITEM_SIZE 10
|
#define LOOTITEM_SIZE 10
|
||||||
#define MAX_SKILL_LEVEL 100
|
#define MAX_SKILL_LEVEL 10
|
||||||
#define MAX_STATUSCHANGE 210
|
#define MAX_STATUSCHANGE 210
|
||||||
#define MAX_SKILLUNITGROUP 32
|
#define MAX_SKILLUNITGROUP 32
|
||||||
#define MAX_MOBSKILLUNITGROUP 8
|
#define MAX_MOBSKILLUNITGROUP 8
|
||||||
|
@ -4205,7 +4205,10 @@ static int mob_readskilldb(void)
|
|||||||
ms->state=state[j].id;
|
ms->state=state[j].id;
|
||||||
}
|
}
|
||||||
ms->skill_id=atoi(sp[3]);
|
ms->skill_id=atoi(sp[3]);
|
||||||
ms->skill_lv=atoi(sp[4]);
|
j=atoi(sp[4]);
|
||||||
|
if (j<=0 || j>MAX_SKILL_DB)
|
||||||
|
continue;
|
||||||
|
ms->skill_lv=j;
|
||||||
ms->permillage=atoi(sp[5]);
|
ms->permillage=atoi(sp[5]);
|
||||||
ms->casttime=atoi(sp[6]);
|
ms->casttime=atoi(sp[6]);
|
||||||
ms->delay=atoi(sp[7]);
|
ms->delay=atoi(sp[7]);
|
||||||
|
@ -854,6 +854,11 @@ int skill_get_castnodex( int id ,int lv ){
|
|||||||
if ((id > MAX_SKILL) || (id < 0)) return 0;
|
if ((id > MAX_SKILL) || (id < 0)) return 0;
|
||||||
return (lv <= 0) ? 0:skill_db[id].castnodex[lv-1];
|
return (lv <= 0) ? 0:skill_db[id].castnodex[lv-1];
|
||||||
}
|
}
|
||||||
|
int skill_get_delaynodex( int id ,int lv ){
|
||||||
|
if (id >= 10000 && id < 10015) id-= 9500;
|
||||||
|
if ((id > MAX_SKILL) || (id < 0)) return 0;
|
||||||
|
return (lv <= 0) ? 0:skill_db[id].delaynodex[lv-1];
|
||||||
|
}
|
||||||
int skill_get_nocast ( int id ){
|
int skill_get_nocast ( int id ){
|
||||||
if (id >= 10000 && id < 10015) id-= 9500;
|
if (id >= 10000 && id < 10015) id-= 9500;
|
||||||
if ((id > MAX_SKILL) || (id < 0)) return 0;
|
if ((id > MAX_SKILL) || (id < 0)) return 0;
|
||||||
@ -7390,23 +7395,23 @@ int skill_check_condition(struct map_session_data *sd,int type)
|
|||||||
*/
|
*/
|
||||||
int skill_castfix( struct block_list *bl, int time )
|
int skill_castfix( struct block_list *bl, int time )
|
||||||
{
|
{
|
||||||
struct map_session_data *sd;
|
struct map_session_data *sd = NULL;
|
||||||
struct mob_data *md; // [Valaris]
|
struct mob_data *md; // [Valaris]
|
||||||
struct status_change *sc_data;
|
struct status_change *sc_data;
|
||||||
int dex;
|
int dex;
|
||||||
int castrate=100;
|
int castrate=100;
|
||||||
int skill,lv,castnodex;
|
int skill,lv;
|
||||||
|
|
||||||
nullpo_retr(0, bl);
|
nullpo_retr(0, bl);
|
||||||
|
|
||||||
if(bl->type==BL_MOB){ // Crash fix [Valaris]
|
if(bl->type==BL_MOB){ // Crash fix [Valaris]
|
||||||
md=(struct mob_data*)bl;
|
nullpo_retr(0, md=(struct mob_data*)bl);
|
||||||
skill = md->skillid;
|
skill = md->skillid;
|
||||||
lv = md->skilllv;
|
lv = md->skilllv;
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
sd=(struct map_session_data*)bl;
|
nullpo_retr(0, sd=(struct map_session_data*)bl);
|
||||||
skill = sd->skillid;
|
skill = sd->skillid;
|
||||||
lv = sd->skilllv;
|
lv = sd->skilllv;
|
||||||
}
|
}
|
||||||
@ -7419,8 +7424,6 @@ int skill_castfix( struct block_list *bl, int time )
|
|||||||
if (skill > MAX_SKILL_DB || skill < 0)
|
if (skill > MAX_SKILL_DB || skill < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
castnodex=skill_get_castnodex(skill, lv);
|
|
||||||
|
|
||||||
/* サフラギウム */
|
/* サフラギウム */
|
||||||
if(sc_data && sc_data[SC_SUFFRAGIUM].timer!=-1 )
|
if(sc_data && sc_data[SC_SUFFRAGIUM].timer!=-1 )
|
||||||
time=time*(100-sc_data[SC_SUFFRAGIUM].val1*15)/100;
|
time=time*(100-sc_data[SC_SUFFRAGIUM].val1*15)/100;
|
||||||
@ -7428,12 +7431,14 @@ int skill_castfix( struct block_list *bl, int time )
|
|||||||
|
|
||||||
if(time==0)
|
if(time==0)
|
||||||
return 0;
|
return 0;
|
||||||
if(castnodex > 0 && bl->type==BL_PC)
|
if (sd) {
|
||||||
castrate=((struct map_session_data *)bl)->castrate;
|
if(skill_get_castnodex(skill, lv) > 0)
|
||||||
else if (castnodex <= 0 && bl->type==BL_PC) {
|
castrate=((struct map_session_data *)bl)->castrate;
|
||||||
castrate=((struct map_session_data *)bl)->castrate;
|
else {
|
||||||
time=time*castrate*(battle_config.castrate_dex_scale - dex)/(battle_config.castrate_dex_scale * 100);
|
castrate=((struct map_session_data *)bl)->castrate;
|
||||||
time=time*battle_config.cast_rate/100;
|
time=time*castrate*(battle_config.castrate_dex_scale - dex)/(battle_config.castrate_dex_scale * 100);
|
||||||
|
time=time*battle_config.cast_rate/100;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ブラギの詩 */
|
/* ブラギの詩 */
|
||||||
@ -7450,15 +7455,24 @@ int skill_castfix( struct block_list *bl, int time )
|
|||||||
int skill_delayfix( struct block_list *bl, int time )
|
int skill_delayfix( struct block_list *bl, int time )
|
||||||
{
|
{
|
||||||
struct status_change *sc_data;
|
struct status_change *sc_data;
|
||||||
|
struct map_session_data *sd = NULL;
|
||||||
|
int skill,lv = 0;
|
||||||
|
|
||||||
nullpo_retr(0, bl);
|
nullpo_retr(0, bl);
|
||||||
|
|
||||||
sc_data = battle_get_sc_data(bl);
|
if(bl->type==BL_PC){
|
||||||
/* if(time<=0)
|
nullpo_retr(0, sd=(struct map_session_data*)bl);
|
||||||
return ( battle_get_adelay(bl) / 2 );*/
|
skill = sd->skillid;
|
||||||
|
lv = sd->skilllv;
|
||||||
|
}
|
||||||
|
|
||||||
if(bl->type == BL_PC) {
|
if(lv <= 0) return 0;
|
||||||
if( battle_config.delay_dependon_dex ) /* dex‚̉e‹¿‚ðŒvŽZ‚·‚é */
|
|
||||||
|
sc_data = battle_get_sc_data(bl);
|
||||||
|
|
||||||
|
if(sd) {
|
||||||
|
if(battle_config.delay_dependon_dex && /* dex‚̉e‹¿‚ðŒvŽZ‚·‚é */
|
||||||
|
skill_get_delaynodex(skill, lv) > 0)
|
||||||
time=time*(battle_config.castrate_dex_scale - battle_get_dex(bl))/battle_config.castrate_dex_scale;
|
time=time*(battle_config.castrate_dex_scale - battle_get_dex(bl))/battle_config.castrate_dex_scale;
|
||||||
time=time*battle_config.delay_rate/100;
|
time=time*battle_config.delay_rate/100;
|
||||||
}
|
}
|
||||||
@ -11646,7 +11660,7 @@ int skill_readdb(void)
|
|||||||
i=atoi(split[0]);
|
i=atoi(split[0]);
|
||||||
if (i>=10000 && i<10015) // for guild skills [Celest]
|
if (i>=10000 && i<10015) // for guild skills [Celest]
|
||||||
i -= 9500;
|
i -= 9500;
|
||||||
else if(i<0 || i>MAX_SKILL_DB)
|
else if(i<=0 || i>MAX_SKILL_DB)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* printf("skill id=%d\n",i); */
|
/* printf("skill id=%d\n",i); */
|
||||||
@ -11721,7 +11735,7 @@ int skill_readdb(void)
|
|||||||
i=atoi(split[0]);
|
i=atoi(split[0]);
|
||||||
if (i>=10000 && i<10015) // for guild skills [Celest]
|
if (i>=10000 && i<10015) // for guild skills [Celest]
|
||||||
i -= 9500;
|
i -= 9500;
|
||||||
else if(i<0 || i>MAX_SKILL_DB)
|
else if(i<=0 || i>MAX_SKILL_DB)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
memset(split2,0,sizeof(split2));
|
memset(split2,0,sizeof(split2));
|
||||||
@ -11863,7 +11877,7 @@ int skill_readdb(void)
|
|||||||
i=atoi(split[0]);
|
i=atoi(split[0]);
|
||||||
if (i>=10000 && i<10015) // for guild skills [Celest]
|
if (i>=10000 && i<10015) // for guild skills [Celest]
|
||||||
i -= 9500;
|
i -= 9500;
|
||||||
else if(i<0 || i>MAX_SKILL_DB)
|
else if(i<=0 || i>MAX_SKILL_DB)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
memset(split2,0,sizeof(split2));
|
memset(split2,0,sizeof(split2));
|
||||||
@ -12030,10 +12044,10 @@ int skill_readdb(void)
|
|||||||
}
|
}
|
||||||
while(fgets(line,1020,fp)){
|
while(fgets(line,1020,fp)){
|
||||||
char *split[50], *split2[MAX_SKILL_LEVEL];
|
char *split[50], *split2[MAX_SKILL_LEVEL];
|
||||||
memset(split,0,sizeof(split));
|
|
||||||
if(line[0]=='/' && line[1]=='/')
|
if(line[0]=='/' && line[1]=='/')
|
||||||
continue;
|
continue;
|
||||||
for(j=0,p=line;j<2 && p;j++){
|
memset(split,0,sizeof(split));
|
||||||
|
for(j=0,p=line;j<3 && p;j++){
|
||||||
split[j]=p;
|
split[j]=p;
|
||||||
p=strchr(p,',');
|
p=strchr(p,',');
|
||||||
if(p) *p++=0;
|
if(p) *p++=0;
|
||||||
@ -12042,7 +12056,7 @@ int skill_readdb(void)
|
|||||||
i=atoi(split[0]);
|
i=atoi(split[0]);
|
||||||
if (i>=10000 && i<10015) // for guild skills [Celest]
|
if (i>=10000 && i<10015) // for guild skills [Celest]
|
||||||
i -= 9500;
|
i -= 9500;
|
||||||
else if(i<0 || i>MAX_SKILL_DB)
|
else if(i<=0 || i>MAX_SKILL_DB)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
memset(split2,0,sizeof(split2));
|
memset(split2,0,sizeof(split2));
|
||||||
@ -12053,6 +12067,17 @@ int skill_readdb(void)
|
|||||||
}
|
}
|
||||||
for(k=0;k<MAX_SKILL_LEVEL;k++)
|
for(k=0;k<MAX_SKILL_LEVEL;k++)
|
||||||
skill_db[i].castnodex[k]=(split2[k])? atoi(split2[k]):atoi(split2[0]);
|
skill_db[i].castnodex[k]=(split2[k])? atoi(split2[k]):atoi(split2[0]);
|
||||||
|
|
||||||
|
if (!split[2])
|
||||||
|
continue;
|
||||||
|
memset(split2,0,sizeof(split2));
|
||||||
|
for(j=0,p=split[2];j<MAX_SKILL_LEVEL && p;j++){
|
||||||
|
split2[j]=p;
|
||||||
|
p=strchr(p,':');
|
||||||
|
if(p) *p++=0;
|
||||||
|
}
|
||||||
|
for(k=0;k<MAX_SKILL_LEVEL;k++)
|
||||||
|
skill_db[i].delaynodex[k]=(split2[k])? atoi(split2[k]):atoi(split2[0]);
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/skill_castnodex_db.txt");
|
sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/skill_castnodex_db.txt");
|
||||||
@ -12079,7 +12104,7 @@ int skill_readdb(void)
|
|||||||
i=atoi(split[0]);
|
i=atoi(split[0]);
|
||||||
if (i>=10000 && i<10015) // for guild skills [Celest]
|
if (i>=10000 && i<10015) // for guild skills [Celest]
|
||||||
i -= 9500;
|
i -= 9500;
|
||||||
else if(i<0 || i>MAX_SKILL_DB)
|
else if(i<=0 || i>MAX_SKILL_DB)
|
||||||
continue;
|
continue;
|
||||||
skill_db[i].nocast=atoi(split[1]);
|
skill_db[i].nocast=atoi(split[1]);
|
||||||
k++;
|
k++;
|
||||||
|
@ -23,6 +23,7 @@ struct skill_db {
|
|||||||
int weapon,state,spiritball[MAX_SKILL_LEVEL];
|
int weapon,state,spiritball[MAX_SKILL_LEVEL];
|
||||||
int itemid[10],amount[10];
|
int itemid[10],amount[10];
|
||||||
int castnodex[MAX_SKILL_LEVEL];
|
int castnodex[MAX_SKILL_LEVEL];
|
||||||
|
int delaynodex[MAX_SKILL_LEVEL];
|
||||||
int nocast;
|
int nocast;
|
||||||
};
|
};
|
||||||
extern struct skill_db skill_db[MAX_SKILL_DB];
|
extern struct skill_db skill_db[MAX_SKILL_DB];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user