onLeaveCombat error
Posted: Thu Apr 14, 2011 12:48 pm
Getting this error when I reach the next level;
Error in your profile: onLeaveCombat error: .../functions.lua:817: attempt to index local 'skill_from_db' <a nil value>
Since it happens when I go up a level, I'm guessing it's getting a nil value for "Ranged Weapon Mastery", which I have a SetSpellPoint for under onLevelup. If I'm right, how do I fix it?
Just in case I'm wrong, here's my functions.lua, lines 814-822, which should be unaltered.
Profile, onLevelup
And onLeaveCombat;
Error in your profile: onLeaveCombat error: .../functions.lua:817: attempt to index local 'skill_from_db' <a nil value>
Since it happens when I go up a level, I'm guessing it's getting a nil value for "Ranged Weapon Mastery", which I have a SetSpellPoint for under onLevelup. If I'm right, how do I fix it?
Just in case I'm wrong, here's my functions.lua, lines 814-822, which should be unaltered.
Code: Select all
local skill_from_db = database.skills[_skillname]; -- read skill parameters from database
-- check is skill has an aslevel in skills.xml
if ( skill_from_db.aslevel ~= nil ) and
( skill_from_db.aslevel > player.Level ) then
cprintf(cli.yellow, "You need at least level %d to levelup skill %s. Your level is %d.\n",
skill_from_db.aslevel, _skillname, player.Level );
return false;
end
Code: Select all
<onLevelup>
-- single skill would be: sendMacro("SetSpellPoint(4,2);");
-- or levelupSkill(_skillname, _times)
sendMacro("SetSpellPoint(4,4);");
levelupSkills1To10();
-- open giftbag and equipt content
openGiftbags1To10(player.Level);
</onLevelup>
Code: Select all
<onLeaveCombat>
-- Additional Lua code to execute after a target is finished
-- if(player.Level == 10) then
-- __WPL:setForcedWaypointType("TRAVEL")
-- end;
lootBodies();
</onLeaveCombat>