BUG: Spells not getting marked as scribable
Posted: Mon Apr 08, 2019 4:27 am
when you right click a spell to scribe it the scribe option is missing
the following items were checked
1.in the code where menu_type is set, the item type checked out
2. next step is to check if ScribeAllowed
a. check ADV class or TS class Match
b. and then check level
the level check is not passing, the spell Incinerate II (Adept) is level 17
here is the code with some added troubleshooting information.
mylevel is 20
spelllevels = 170
so this part of if fails
so it would seem that the levels(i) has been populated incorrectly somewhere but where
i could just do a divide by 10 here but that is not the solution or is it
the following items were checked
1.in the code where menu_type is set, the item type checked out
2. next step is to check if ScribeAllowed
a. check ADV class or TS class Match
b. and then check level
the level check is not passing, the spell Incinerate II (Adept) is level 17
here is the code with some added troubleshooting information.
mylevel is 20
spelllevels = 170
so this part of if fails
Code: Select all
player->GetLevel() >= levels[i]->spell_levelso it would seem that the levels(i) has been populated incorrectly somewhere but where
i could just do a divide by 10 here but that is not the solution or is it
Code: Select all
bool Spell::ScribeAllowed(Player* player){
bool ret = false;
if(player){
MSpellInfo.lock();
for(int32 i=0;!ret && i<levels.size();i++){
int16 mylevel = player->GetLevel();
int16 spelllevels = levels[i]->spell_level;
bool advlev = player->GetAdventureClass() == levels[i]->adventure_class;
bool tslev = player->GetTradeskillClass() == levels[i]->tradeskill_class;
bool levelmatch = player->GetLevel() >= levels[i]->spell_level;
if((player->GetAdventureClass() == levels[i]->adventure_class || player->GetTradeskillClass() == levels[i]->tradeskill_class) && player->GetLevel() >= levels[i]->spell_level)
ret = true;
}
MSpellInfo.unlock();
}
return ret;
}