onLeaveCombat error

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Mushroomstamp
Posts: 210
Joined: Wed Oct 27, 2010 11:34 am

onLeaveCombat error

#1 Post by Mushroomstamp »

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.

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
Profile, onLevelup

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>
And onLeaveCombat;

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>
User avatar
Administrator
Site Admin
Posts: 5353
Joined: Sat Jan 05, 2008 4:21 pm

Re: onLeaveCombat error

#2 Post by Administrator »

Can you post the whole skills section for your profile, so we know exactly which skills you are using that could be causing this?
Mushroomstamp
Posts: 210
Joined: Wed Oct 27, 2010 11:34 am

Re: onLeaveCombat error

#3 Post by Mushroomstamp »

Code: Select all

	<skills_scout>
		<skill name="SCOUT_VAMPIRE_ARROWS"      hotkey="MACRO" priority="100" />
		<skill name="SCOUT_SHOT"        		hotkey="MACRO" priority="90" />
		<skill name="SCOUT_WIND_ARROWS"         hotkey="MACRO" priority="80" />
		<skill name="SCOUT_AUTOSHOT"    		hotkey="MACRO" priority="70" />
	</skills_scout>
On what is probably a completely unrelated note... I just realized that < modifier="" > is no longer in there... why is that not needed anymore?
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: onLeaveCombat error

#4 Post by lisa »

Yeah I know this error well, you just hit lvl 6 and bammo error. This is because the levelupSkills1To10(); wants to lvl up range weapon mastery but it was removed from the skills.xml as it wasn't an actual skill you can cast.

For now you can just add the skill into skills.xml in the database folder.

Code: Select all

	<skill name="SCOUT_RANGED_WEAPON_MASTERY aslevel="6" skilltab="4" skillnum="4" />
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Post Reply