Issue information

Issue ID
#4740
Status
Unable to Fix
Severity
None
Started
Hercules Elf Bot
Feb 3, 2011 16:53
Last Post
Hercules Elf Bot
Feb 3, 2011 16:53
Confirmation
N/A

Hercules Elf Bot - Feb 3, 2011 16:53

Originally posted by [b]RyuHoshi[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4740

Hi,

I tried to use the @allskill command but I found that there's a bug in it. It adds all skills (including some unknown null skills) except the job we're curently in. So for example if we're a shura, I get all other skills but not Shura's. The problem is, i cannot level up the shura skills manually, as everytime i click 'apply' the skills just stays grey.

I tried to trace it and found my way to this particular code in pc.c:
int pc_allskillup(struct map_session_data *sd)
{
int i,id;

nullpo_retr(0, sd);

for(i=0;i<MAX_SKILL;i++){
if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){
sd->status.skill[i].lv=(sd->status.skill[i].flag==1)?0:sd->status.skill[i].flag-2;
sd->status.skill[i].flag=0;
if (!sd->status.skill[i].lv)
sd->status.skill[i].id=0;
}
}

//pc_calc_skilltree takes care of setting the ID to valid skills. [Skotlex]
if (battle_config.gm_allskill > 0 && pc_isGM(sd) >= battle_config.gm_allskill)
{ //Get ALL skills except npc/guild ones. [Skotlex]
//and except SG_DEVIL [Komurka] and MO_TRIPLEATTACK and RG_SNATCHER [ultramage]
for(i=0;i<MAX_SKILL;i++){
if(!(skill_get_inf2(i)&(INF2_NPC_SKILL|INF2_GUILD_SKILL)) && i!=SG_DEVIL && i!=MO_TRIPLEATTACK && i!=RG_SNATCHER)
sd->status.skill[i].lv=skill_get_max(i); //Nonexistant skills should return a max of 0 anyway.
}
}
else
{
int inf2;
for(i=0;i < MAX_SKILL_TREE && (id=skill_tree[pc_class2idx(sd->status.class_)][i].id)>0;i++){
inf2 = skill_get_inf2(id);
if (
(inf2&INF2_QUEST_SKILL && !battle_config.quest_skill_learn) ||
(inf2&(INF2_WEDDING_SKILL|INF2_SPIRIT_SKILL)) ||
id==SG_DEVIL
)
continue; //Cannot be learned normally.
sd->status.skill[id].lv = skill_tree_get_max(id, sd->status.class_); // celest
}
}
status_calc_pc(sd,0);
//Required because if you could level up all skills previously,
//the update will not be sent as only the lv variable changes.
clif_skillinfoblock(sd);
return 0;
}

Does anyone know a fix to this problem? I can't seem to find anything on the net after hours of searching...