summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/login_sql/login.c23
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/battle.c47
-rw-r--r--src/map/battle.h2
-rw-r--r--src/map/clif.c6
-rw-r--r--src/map/clif.h2
-rw-r--r--src/map/map.h6
-rw-r--r--src/map/pc.c4
-rw-r--r--src/map/script.c6
-rw-r--r--src/map/skill.c65
-rw-r--r--src/map/skill.h8
-rw-r--r--src/map/status.c12
-rw-r--r--src/map/status.h2
13 files changed, 114 insertions, 71 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 3986279f5..b895bbab8 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -524,7 +524,7 @@ int mmo_auth(struct mmo_account* account, int fd)
char t_uid[256], t_pass[256];
char user_password[256];
- int encpasswdok = 0;
+ int encpasswdok = 0, state;
char md5str[64], md5bin[32];
@@ -610,6 +610,7 @@ int mmo_auth(struct mmo_account* account, int fd)
return 0;
}
+ state = atoi(sql_row[9]);
//Client Version check
if (login_config.check_client_version && account->version != 0) {
if (account->version != login_config.client_version_to_connect) {
@@ -618,15 +619,11 @@ int mmo_auth(struct mmo_account* account, int fd)
}
}
- if (atoi(sql_row[9]) == -3) {
- //id is banned
+ switch (state) {
+ case -3: //id is banned
+ case -2: //dynamic ban
mysql_free_result(sql_res);
- return -3;
- } else if (atoi(sql_row[9]) == -2) { //dynamic ban
- //id is banned
- mysql_free_result(sql_res);
- //add IP list.
- return -2;
+ return state;
}
if (login_config.use_md5_passwds) {
@@ -683,15 +680,17 @@ int mmo_auth(struct mmo_account* account, int fd)
if (ban_until_time > time(NULL)) // always banned
return 6; // 6 = Your are Prohibited to log in until %s
- sprintf(tmpsql, "UPDATE `%s` SET `ban_until`='0' WHERE `%s`= %s '%s'", login_db, login_db_userid, login_config.case_sensitive ? "BINARY" : "", t_uid);
+ sprintf(tmpsql, "UPDATE `%s` SET `ban_until`='0' %s WHERE `%s`= %s '%s'",
+ login_db, state==7?",state='0'":"", login_db_userid,
+ login_config.case_sensitive ? "BINARY" : "", t_uid);
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
- if (atoi(sql_row[9])) {
- switch(atoi(sql_row[9])) { // packet 0x006a value + 1
+ if (state) {
+ switch(state) { // packet 0x006a value + 1
case 1: // 0 = Unregistered ID
case 2: // 1 = Incorrect Password
case 3: // 2 = This ID is expired
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index d68bb16a1..073503505 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -6355,7 +6355,7 @@ int atcommand_jailfor(const int fd, struct map_session_data* sd, const char* com
//Added by Coltaro
if (pl_sd->sc.count && pl_sd->sc.data[SC_JAILED].timer != -1 &&
- pl_sd->sc.data[SC_JAILED].val1 != UINT_MAX)
+ pl_sd->sc.data[SC_JAILED].val1 != INT_MAX)
{ //Update the player's jail time
jailtime += pl_sd->sc.data[SC_JAILED].val1;
if (jailtime <= 0) {
diff --git a/src/map/battle.c b/src/map/battle.c
index dd18d38bd..92297e67d 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -833,6 +833,20 @@ static int battle_blewcount_bonus(struct map_session_data *sd, int skill_num)
return 0;
}
+int battle_skillatk_bonus(struct map_session_data *sd, int skill_num)
+{
+ int i;
+ if (!sd->skillatk[0].id)
+ return 0;
+ for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id &&
+ sd->skillatk[i].id != skill_num; i++);
+
+ if (i < MAX_PC_BONUS && sd->skillatk[i].id)
+ return sd->skillatk[i].val;
+
+ return 0;
+}
+
struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag);
struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag);
@@ -975,7 +989,7 @@ static struct Damage battle_calc_weapon_attack(
}
t_class = status_get_class(target);
- s_ele = s_ele_ = skill_get_pl(skill_num);
+ s_ele = s_ele_ = skill_get_pl(skill_num, skill_lv);
if (!skill_num || s_ele == -1) { //Take weapon's element
s_ele = sstatus->rhw.ele;
s_ele_ = sstatus->lhw?sstatus->lhw->ele:0;
@@ -1627,14 +1641,8 @@ static struct Damage battle_calc_weapon_attack(
if(sd)
{
- if (skill_num && sd->skillatk[0].id)
- { //Additional skill damage.
- for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id &&
- sd->skillatk[i].id != skill_num; i++);
-
- if (i < MAX_PC_BONUS && sd->skillatk[i].id == skill_num)
- ATK_ADDRATE(sd->skillatk[i].val);
- }
+ if (skill_num && (i = battle_skillatk_bonus(sd, skill_num)))
+ ATK_ADDRATE(i);
if(skill_num != PA_SACRIFICE && skill_num != MO_INVESTIGATE &&
skill_num != CR_GRANDCROSS && skill_num != NPC_GRANDDARKNESS &&
@@ -2145,7 +2153,7 @@ struct Damage battle_calc_magic_attack(
BL_CAST(BL_PC, target, tsd);
//Initialize variables that will be used afterwards
- s_ele = skill_get_pl(skill_num);
+ s_ele = skill_get_pl(skill_num, skill_lv);
if (s_ele == -1) // pl=-1 : the skill takes the weapon's element
s_ele = sstatus->rhw.ele;
@@ -2324,12 +2332,8 @@ struct Damage battle_calc_magic_attack(
if(sd) {
//Damage bonuses
- if (sd->skillatk[0].id)
- {
- for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id && sd->skillatk[i].id != skill_num; i++);
- if (i < MAX_PC_BONUS && sd->skillatk[i].id == skill_num)
- ad.damage += ad.damage*sd->skillatk[i].val/100;
- }
+ if ((i = battle_skillatk_bonus(sd, skill_num)))
+ ad.damage += ad.damage*i/100;
//Ignore Defense?
if (!flag.imdef && (
@@ -2468,7 +2472,7 @@ struct Damage battle_calc_misc_attack(
md.blewcount += battle_blewcount_bonus(sd, skill_num);
}
- s_ele = skill_get_pl(skill_num);
+ s_ele = skill_get_pl(skill_num, skill_lv);
if (s_ele < 0) //Attack that takes weapon's element for misc attacks? Make it neutral [Skotlex]
s_ele = ELE_NEUTRAL;
@@ -2625,12 +2629,9 @@ struct Damage battle_calc_misc_attack(
if (cardfix != 10000)
md.damage=md.damage*cardfix/10000;
}
- if (sd && skill_num > 0 && sd->skillatk[0].id != 0)
- {
- for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id != 0 && sd->skillatk[i].id != skill_num; i++);
- if (i < MAX_PC_BONUS && sd->skillatk[i].id == skill_num)
- md.damage += md.damage*sd->skillatk[i].val/100;
- }
+
+ if (sd && (i = battle_skillatk_bonus(sd, skill_num)))
+ md.damage += md.damage*i/100;
if(md.damage < 0)
md.damage = 0;
diff --git a/src/map/battle.h b/src/map/battle.h
index 6d94d3fd9..ada282eab 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -29,6 +29,8 @@ int battle_calc_return_damage(struct block_list *bl, int *damage, int flag);
void battle_drain(struct map_session_data *sd, struct block_list *tbl, int rdamage, int ldamage, int race, int boss);
+int battle_skillatk_bonus(struct map_session_data *sd, int skill_num);
+
int battle_attr_fix(struct block_list *src, struct block_list *target, int damage,int atk_elem,int def_type, int def_lv);
// ダメージ最終計算
diff --git a/src/map/clif.c b/src/map/clif.c
index 146095afb..bfb6d5500 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4221,7 +4221,7 @@ int clif_skillup(struct map_session_data *sd,int skill_num)
int clif_skillcasting(struct block_list* bl,
int src_id,int dst_id,int dst_x,int dst_y,int skill_num,int casttime)
{
- int pl = skill_get_pl(skill_num);
+ int pl = skill_get_pl(skill_num, 1); //TODO: Need Skill level here :/
unsigned char buf[32];
WBUFW(buf,0) = 0x13e;
WBUFL(buf,2) = src_id;
@@ -5365,7 +5365,7 @@ int clif_item_refine_list(struct map_session_data *sd)
* アイテムによる一時的なスキル効果
*------------------------------------------
*/
-int clif_item_skill(struct map_session_data *sd,int skillid,int skilllv,const char *name)
+int clif_item_skill(struct map_session_data *sd,int skillid,int skilllv)
{
int fd;
@@ -5380,7 +5380,7 @@ int clif_item_skill(struct map_session_data *sd,int skillid,int skilllv,const ch
WFIFOW(fd, 8)=skilllv;
WFIFOW(fd,10)=skill_get_sp(skillid,skilllv);
WFIFOW(fd,12)=skill_get_range2(&sd->bl, skillid,skilllv);
- strncpy((char*)WFIFOP(fd,14),name,NAME_LENGTH);
+ strncpy((char*)WFIFOP(fd,14),skill_get_name(skillid),NAME_LENGTH);
WFIFOB(fd,38)=0;
WFIFOSET(fd,packet_len(0x147));
return 0;
diff --git a/src/map/clif.h b/src/map/clif.h
index 9dc33db6d..770da02b1 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -233,7 +233,7 @@ int clif_item_repair_list (struct map_session_data *sd, struct map_session_data
int clif_item_repaireffect(struct map_session_data *sd, int nameid, int flag);
int clif_item_refine_list(struct map_session_data *sd);
-int clif_item_skill(struct map_session_data *sd,int skillid,int skilllv,const char *name);
+int clif_item_skill(struct map_session_data *sd,int skillid,int skilllv);
int clif_mvp_effect(struct map_session_data *sd);
int clif_mvp_item(struct map_session_data *sd,int nameid);
diff --git a/src/map/map.h b/src/map/map.h
index 87ac38711..13d811771 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -616,8 +616,9 @@ struct map_session_data {
unsigned no_castcancel2 : 1;
unsigned no_sizefix : 1;
unsigned no_gemstone : 1;
- unsigned intravision : 1; // Maya Purple Card effect allowing to see Hiding/Cloaking people [DracoRPG]
+ unsigned intravision : 1; // Maya Purple Card effect [DracoRPG]
unsigned perfect_hiding : 1; // [Valaris]
+ unsigned no_knockback : 1;
} special_state;
int login_id1, login_id2;
unsigned short class_; //This is the internal job ID used by the map server to simplify comparisons/queries/etc. [Skotlex]
@@ -1195,7 +1196,7 @@ enum _sp {
SP_SHORT_WEAPON_DAMAGE_RETURN,SP_LONG_WEAPON_DAMAGE_RETURN,SP_WEAPON_COMA_ELE,SP_WEAPON_COMA_RACE, // 1063-1066
SP_ADDEFF2,SP_BREAK_WEAPON_RATE,SP_BREAK_ARMOR_RATE,SP_ADD_STEAL_RATE, // 1067-1070
SP_MAGIC_DAMAGE_RETURN,SP_RANDOM_ATTACK_INCREASE,SP_ALL_STATS,SP_AGI_VIT,SP_AGI_DEX_STR,SP_PERFECT_HIDE, // 1071-1076
- SP_FREE,SP_CLASSCHANGE, // 1077-1078
+ SP_NO_KNOCKBACK,SP_CLASSCHANGE, // 1077-1078
SP_HP_DRAIN_VALUE,SP_SP_DRAIN_VALUE, // 1079-1080
SP_WEAPON_ATK,SP_WEAPON_ATK_RATE, // 1081-1082
SP_DELAYRATE,SP_HP_DRAIN_RATE_RACE,SP_SP_DRAIN_RATE_RACE, // 1083-1085
@@ -1214,7 +1215,6 @@ enum _sp {
SP_ADD_SKILL_BLOW, SP_SP_VANISH_RATE //2041
//Before adding another, note that these are free:
//1024 (SP_FREE2, previous matk)
- //1077 (SP_FREE, previously disguise)
};
enum _look {
diff --git a/src/map/pc.c b/src/map/pc.c
index 059dc41fd..31fecc8f5 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1721,6 +1721,10 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
clif_status_load(&sd->bl, SI_INTRAVISION, 1);
}
break;
+ case SP_NO_KNOCKBACK:
+ if(sd->state.lr_flag != 2)
+ sd->special_state.no_knockback = 1;
+ break;
case SP_SPLASH_RANGE:
if(sd->state.lr_flag != 2 && sd->splash_range < val)
sd->splash_range = val;
diff --git a/src/map/script.c b/src/map/script.c
index 7ab0164eb..ffc0a10ad 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3962,7 +3962,7 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(gettimestr,"si"),
BUILDIN_DEF(openstorage,""),
BUILDIN_DEF(guildopenstorage,"*"),
- BUILDIN_DEF(itemskill,"iis"),
+ BUILDIN_DEF(itemskill,"ii"),
BUILDIN_DEF(produce,"i"),
BUILDIN_DEF(monster,"siisii*"),
BUILDIN_DEF(areamonster,"siiiisii*"),
@@ -7098,12 +7098,10 @@ BUILDIN_FUNC(guildopenstorage)
BUILDIN_FUNC(itemskill)
{
int id,lv;
- const char *str;
struct map_session_data *sd=script_rid2sd(st);
id=conv_num(st,script_getdata(st,2));
lv=conv_num(st,script_getdata(st,3));
- str=conv_str(st,script_getdata(st,4));
// 詠唱中にスキルアイテムは使用できない
if(sd->ud.skilltimer != -1)
@@ -7111,7 +7109,7 @@ BUILDIN_FUNC(itemskill)
sd->skillitem=id;
sd->skillitemlv=lv;
- clif_item_skill(sd,id,lv,str);
+ clif_item_skill(sd,id,lv);
return 0;
}
/*==========================================
diff --git a/src/map/skill.c b/src/map/skill.c
index 63916b8f1..861c33e87 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -248,6 +248,7 @@ const struct skill_name_db skill_names[] = {
{ HW_MAGICPOWER, "HW_MAGICPOWER", "Mystical_Amplification" } ,
{ HW_NAPALMVULCAN, "HW_NAPALMVULCAN", "Napalm_Vulcan" } ,
{ HW_SOULDRAIN, "HW_SOULDRAIN", "Soul_Drain" } ,
+ { ITEM_ENCHANTARMS, "ITEM_ENCHANTARMS", "Weapon Enchantment" },
{ ITM_TOMAHAWK, "ITM_TOMAHAWK", "Tomahawk_Throwing" } ,
{ KN_AUTOCOUNTER, "KN_AUTOCOUNTER", "Counter_Attack" } ,
{ KN_BOWLINGBASH, "KN_BOWLINGBASH", "Bowling_Bash" } ,
@@ -652,7 +653,7 @@ struct skill_abra_db skill_abra_db[MAX_SKILL_ABRA_DB];
// Skill DB
int skill_get_hit( int id ){ skill_get (skill_db[id].hit, id, 1); }
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_pl( int id , int lv ){ skill_get (skill_db[id].pl[lv-1], id, lv); }
int skill_get_nk( int id ){ skill_get (skill_db[id].nk, id, 1); }
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); }
@@ -800,11 +801,18 @@ int skill_calc_heal (struct block_list *bl, int skill_lv)
return battle_config.max_heal;
heal = ( status_get_lv(bl)+status_get_int(bl) )/8 *(4+ skill_lv*8);
- if(bl->type == BL_PC && (skill = pc_checkskill((TBL_PC*)bl, HP_MEDITATIO)) > 0)
- heal += heal * skill * 2 / 100;
+ if(bl->type == BL_PC)
+ {
+ if ((skill = pc_checkskill((TBL_PC*)bl, HP_MEDITATIO)) > 0)
+ heal += heal * skill * 2 / 100;
+ if ((skill = battle_skillatk_bonus((TBL_PC*)bl, AL_HEAL)) > 0)
+ heal += heal * skill / 100;
+ }
if(bl->type == BL_HOM && (skill = merc_hom_checkskill(((TBL_HOM*)bl), HLIF_BRAIN)) > 0)
heal += heal * skill * 2 / 100;
+
+
return heal;
}
@@ -1761,6 +1769,10 @@ int skill_blown (struct block_list *src, struct block_list *target, int count)
if(src != target && is_boss(target)) //Bosses can't be knocked-back
return 0;
break;
+ case BL_PC:
+ if(src != target && ((TBL_PC*)target)->special_state.no_knockback)
+ return 0;
+ break;
case BL_SKILL:
su=(struct skill_unit *)target;
break;
@@ -1877,7 +1889,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
struct pet_data *pd = (TBL_PET*)src;
if (pd->a_skill && pd->a_skill->div_ && pd->a_skill->id == skillid)
{
- int element = skill_get_pl(skillid);
+ int element = skill_get_pl(skillid, skilllv);
if (skillid == -1)
element = sstatus->rhw.ele;
if (element != ELE_NEUTRAL || !(battle_config.attack_attr_none&BL_PET))
@@ -3489,7 +3501,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
sd->skillitem = abra_skillid;
sd->skillitemlv = abra_skilllv;
sd->state.abra_flag = 1;
- clif_item_skill (sd, abra_skillid, abra_skilllv, "Abracadabra");
+ clif_item_skill (sd, abra_skillid, abra_skilllv);
} else
{ // [Skotlex]
struct unit_data *ud = unit_bl2ud(src);
@@ -3682,27 +3694,33 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
break;
+ case ITEM_ENCHANTARMS:
+ clif_skill_nodamage(src,bl,skillid,skilllv,
+ sc_start2(bl,type,100,skilllv,
+ skill_get_pl(skillid,skilllv), skill_get_time(skillid,skilllv)));
+ break;
+
case TK_SEVENWIND:
- switch(skilllv){
- case 1:
+ switch(skill_get_pl(skillid,skilllv)){
+ case ELE_EARTH:
type=SC_EARTHWEAPON;
break;
- case 2:
+ case ELE_WIND:
type=SC_WINDWEAPON;
break;
- case 3:
+ case ELE_WATER:
type=SC_WATERWEAPON;
break;
- case 4:
+ case ELE_FIRE:
type=SC_FIREWEAPON;
break;
- case 5:
+ case ELE_GHOST:
type=SC_GHOSTWEAPON;
break;
- case 6:
+ case ELE_DARK:
type=SC_SHADOWWEAPON;
break;
- case 7:
+ case ELE_HOLY:
type=SC_ASPERSIO;
break;
}
@@ -4417,8 +4435,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
pc_randomwarp(sd,3);
} else {
if (sd->skillitem != AL_TELEPORT)
- clif_skill_warppoint(sd,skillid,skilllv,"Random",
- mapindex_id2name(sd->status.save_point.map),"","");
+ {
+ char save_map[MAP_NAME_LENGTH];
+ snprintf(save_map, MAP_NAME_LENGTH, "%s.gat", mapindex_id2name(sd->status.save_point.map));
+ clif_skill_warppoint(sd,skillid,skilllv,"Random",save_map,"","");
+ }
else //Autocasted Teleport level 2??
pc_setpos(sd,sd->status.save_point.map,
sd->status.save_point.x,sd->status.save_point.y,3);
@@ -4548,6 +4569,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
sp = sp * (100 + pc_checkskill(dstsd,MG_SRECOVERY)*10) / 100;
}
}
+ if ((i = battle_skillatk_bonus(sd, skillid)) > 0)
+ {
+ hp += hp * i / 100;
+ sp += sp * i / 100;
+ }
}
else {
hp = (1 + rand()%400) * (100 + skilllv*10) / 100;
@@ -4795,7 +4821,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case NPC_CHANGETELEKINESIS:
case NPC_CHANGEUNDEAD:
clif_skill_nodamage(src,bl,skillid,skilllv,
- sc_start4(bl, type, 100, skilllv, skillid, skill_get_pl(skillid), 0,
+ sc_start4(bl, type, 100, skilllv, skillid, skill_get_pl(skillid,skilllv), 0,
skill_get_time(skillid, skilllv)));
break;
@@ -6140,7 +6166,8 @@ int skill_castend_pos2 (struct block_list *src, int x, int y, int skillid, int s
//Apply skill bonuses
i = pc_checkskill(sd,CR_SLIMPITCHER)*10
+ pc_checkskill(sd,AM_POTIONPITCHER)*10
- + pc_checkskill(sd,AM_LEARNINGPOTION)*5;
+ + pc_checkskill(sd,AM_LEARNINGPOTION)*5
+ + battle_skillatk_bonus(sd, skillid);
potion_hp = potion_hp * (100+i)/100;
potion_sp = potion_sp * (100+i)/100;
@@ -6554,6 +6581,8 @@ struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid,
case PR_SANCTUARY:
val1=(skilllv+3)*2;
val2=(skilllv>6)?777:skilllv*100;
+ if (sd && (i = battle_skillatk_bonus(sd, skillid)) > 0)
+ val2 += val2 * i / 100;
break;
case WZ_FIREPILLAR:
@@ -11220,7 +11249,7 @@ int skill_readdb (void)
skill_split_atoi(split[1],skill_db[i].range);
skill_db[i].hit=atoi(split[2]);
skill_db[i].inf=atoi(split[3]);
- skill_db[i].pl=atoi(split[4]);
+ skill_split_atoi(split[4],skill_db[i].pl);
skill_db[i].nk=(int)strtol(split[5], NULL, 0);
skill_split_atoi(split[6],skill_db[i].splash);
skill_db[i].max=atoi(split[7]);
diff --git a/src/map/skill.h b/src/map/skill.h
index 676193d03..55233f3c3 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -62,7 +62,7 @@
struct skill_db {
char *name;
char *desc;
- int range[MAX_SKILL_LEVEL],hit,inf,pl,nk,splash[MAX_SKILL_LEVEL],max;
+ int range[MAX_SKILL_LEVEL],hit,inf,pl[MAX_SKILL_LEVEL],nk,splash[MAX_SKILL_LEVEL],max;
int num[MAX_SKILL_LEVEL];
int cast[MAX_SKILL_LEVEL],walkdelay[MAX_SKILL_LEVEL],delay[MAX_SKILL_LEVEL];
int upkeep_time[MAX_SKILL_LEVEL],upkeep_time2[MAX_SKILL_LEVEL];
@@ -155,7 +155,7 @@ int skill_get_casttype(int id); //[Skotlex]
int skill_get_type( int id );
int skill_get_hit( int id );
int skill_get_inf( int id );
-int skill_get_pl( int id );
+int skill_get_pl( int id , int lv );
int skill_get_nk( int id );
int skill_get_max( int id );
int skill_get_range( int id , int lv );
@@ -801,8 +801,8 @@ enum _skill {
CG_TAROTCARD,
CR_ACIDDEMONSTRATION,
CR_CULTIVATION,
- //492,missing?
- TK_MISSION = 493,
+ ITEM_ENCHANTARMS,
+ TK_MISSION,
SL_HIGH,
KN_ONEHAND,
AM_TWILIGHT1,
diff --git a/src/map/status.c b/src/map/status.c
index 5521bf517..bc7b5130c 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -351,6 +351,7 @@ void initChangeTables(void) {
set_sc(WS_OVERTHRUSTMAX, SC_MAXOVERTHRUST, SI_MAXOVERTHRUST, SCB_NONE);
set_sc(CG_LONGINGFREEDOM, SC_LONGING, SI_BLANK, SCB_SPEED|SCB_ASPD);
add_sc(CG_HERMODE, SC_HERMODE);
+ set_sc(ITEM_ENCHANTARMS, SC_ENCHANTARMS, SI_BLANK, SCB_ATK_ELE);
set_sc(SL_HIGH, SC_SPIRIT, SI_SPIRIT, SCB_PC);
set_sc(KN_ONEHAND, SC_ONEHAND, SI_ONEHAND, SCB_ASPD);
set_sc(GS_FLING, SC_FLING, SI_BLANK, SCB_DEF|SCB_DEF2);
@@ -1091,7 +1092,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
hide_flag = flag?OPTION_HIDE:(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK);
//You cannot hide from ground skills.
- if(skill_get_pl(skill_num) == ELE_EARTH)
+ if(skill_get_pl(skill_num,1) == ELE_EARTH) //TODO: Need Skill Lv here :/
hide_flag &= ~OPTION_HIDE;
switch (target->type)
@@ -3903,6 +3904,8 @@ unsigned char status_calc_attack_element(struct block_list *bl, struct status_ch
{
if(!sc || !sc->count)
return element;
+ if( sc->data[SC_ENCHANTARMS].timer!=-1)
+ return sc->data[SC_ENCHANTARMS].val2;
if( sc->data[SC_WATERWEAPON].timer!=-1)
return ELE_WATER;
if( sc->data[SC_EARTHWEAPON].timer!=-1)
@@ -5744,6 +5747,13 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
val3 = BF_LONG; //Range
val4 = BF_WEAPON|BF_MISC; //Type
break;
+ case SC_ENCHANTARMS:
+ //Make sure the received element is valid.
+ if (val2 >= ELE_MAX)
+ val2 = val2%ELE_MAX;
+ else if (val2 < 0)
+ val2 = rand()%ELE_MAX;
+ break;
case SC_ARMOR_ELEMENT:
//Place here SCs that have no SCB_* data, no skill associated, no ICON
//associated, and yet are not wrong/unknown. [Skotlex]
diff --git a/src/map/status.h b/src/map/status.h
index 095581962..ca330d595 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -236,7 +236,6 @@ enum {
SC_SKA, // [marquis007]
SC_TKREST, // [marquis007]
SC_MIRACLE, //SG 'hidden' skill [Komurka]
- //Ninja/GS states
SC_MADNESSCANCEL,
SC_ADJUSTMENT,
SC_INCREASING, //230
@@ -259,6 +258,7 @@ enum {
SC_INCAGIRATE,
SC_INCDEXRATE,
SC_JAILED,
+ SC_ENCHANTARMS,
SC_MAX, //Automatically updated max, used in for's and at startup to check we are within bounds. [Skotlex]
};
int SkillStatusChangeTable(int skill);