Levelling up Skills beyond 1-10

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Levelling up Skills beyond 1-10

#1 Post by imaginethat » Tue Nov 15, 2011 8:46 pm

I am looking for some thoughts on the best way to level up a character beyond the very handy Levelup1-10 function.
I am wanting a function that will level up a character no matter what class and right up through the levels 60+.

The ways I see it being done at the moment are:

Code: Select all

levelupSkills1To10(_loadonly)
and

Code: Select all

levelupSkill(_skillname, _times)
The 1To10 works really well for the 1-10 stage(obviously), when you can level up the skills you have to max, but I'm not sure how well it would work at higher levels (if the table was extended to include the higher level skills), as you do not have enough TPs to max all the skills you use. So some skills need to be get maxed, and some are added to a bit more sparsely.

I was wondering how other deal with leveling up their characters skills? do you do it manually, or do you use the levelupskill function to do it per skill, per level?

look forward to hearing how others deal with this?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Levelling up Skills beyond 1-10

#2 Post by lisa » Tue Nov 15, 2011 8:52 pm

I personally lvl up skills manually, I find skill choice to be a personal thing. If you wanted to automate it though you would need a table to tell the bot which skills you want leveled as you don't want all skills leveled and waste valuable TP.

Also need to take into consideration elite skills a character may have.

In order to make bot lvl up skills automatically without user input would mean doing quite a lot of coding to make sure the end result is exactly what you wanted.
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

imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Re: Levelling up Skills beyond 1-10

#3 Post by imaginethat » Tue Nov 15, 2011 10:22 pm

Hi Lisa
thanks for the prompt reply, and yes I think what ever way I do it, it will be quite a bit or work and will be a bit fiddly to get it right.

I have not rally worked with tables, so thought I might use this as a chance for me to learn tables in Lua, and thought of using the kind of structure of the Levelup1-10 table, but maybe adding a column(terminology for this...column/field/?) something like "AtLevel", and it contain the levels you want that skill to be leveled. Something like:(bad syntax I know)

Code: Select all

        local skillLevelupMap = {
        [CLASS_WARRIOR]        = {     [1] = { aslevel = 1, skillname="WARRIOR_SLASH", [AT_LEVEL] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,...},
                                                      [5] = { aslevel = 6, skillname="WARRIOR_THUNDER", [AT_LEVEL] = {6,8,10,13,16,20,...} }
                                                 },
        [CLASS_SCOUT]        = {         [1] = { aslevel = 1, skillname="SCOUT_SHOT", [AT_LEVEL] = {ALL} },
                                                      [2] = { aslevel = 2, skillname="SCOUT_WIND_ARROWS", [AT_LEVEL] = {2,3,4,5,6,8,10,13,16,20,...} },
                                            }
I'm not really sure about tables, so layout maybe all wrong, but the idea is to list the levels you want the skills to be leveled up. Maybe the "ALL" could be used to always keep that skill maxed, or maybe it would need to be a digit, and check for "99" for example, and max the skill if "AT_LEVEL"=99.

I dont know how to work through this table with the several layered tables, but if I just start with the SkillLevelUp1-10 function, I shod be able to muddle though it.

I am not sure how I would increase a skill to max when that skill became available latter on, as this method would level up that skill one point at each of the listed levels, so if it was available at lvl 20 it wold be leveled by one each level after that

I just wanted to get a feel for an efficient way of doing it before diving into learning how to manipulate tables and realizing that is was flawed from the start.

thought?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Levelling up Skills beyond 1-10

#4 Post by lisa » Tue Nov 15, 2011 10:39 pm

I did this about a year ago when I created the 1-10/10 script I did. A lot has changed since then though with how the bot works. Now we get skill info direct from memory instead of relying on the skills database.

Code: Select all

function myskillup(_loadonly)
-- level up the skill by using an internal leveling table
-- load the skills for using into the profile skill table

	-- e.g. 4 = third skill tab, 2 = second skill on the tab
	-- CAUTION: addressing a invalid skill will crash the RoM client
	local skillLevelupMap = {
		[CLASS_WARRIOR]		= {  [1] = { aslevel = 1, skillname="WARRIOR_SLASH" },
								 [2] = { aslevel = 2, skillname="WARRIOR_OPEN_FLANK" },
								 [3] = { aslevel = 2, skillname="WARRIOR_PROBING_ATTACK" },
								 [4] = { aslevel = 4, skillname="WARRIOR_TACTICAL_ATTACK" },
								 [5] = { aslevel = 4, skillname="WARRIOR_ENRAGED" }, },

		[CLASS_SCOUT]		= {  [1] = { aslevel = 1, skillname="SCOUT_SHOT" },
								 [2] = { aslevel = 2, skillname="SCOUT_WIND_ARROWS" },
								 [3] = { aslevel = 4, skillname="SCOUT_VAMPIRE_ARROWS" },},
		[CLASS_ROGUE]		= {  [1] = { aslevel = 1, skillname="ROGUE_SHADOWSTAB" },
								 [2] = { aslevel = 2, skillname="ROGUE_LOW_BLOW" },
								 [3] = { aslevel = 6, skillname="ROGUE_WOUND_ATTACK" }, },
		[CLASS_MAGE]		= {  [1] = { aslevel = 1, skillname="MAGE_FLAME" },
								 [2] = { aslevel = 4, skillname="MAGE_FIREBALL" }, },
		[CLASS_PRIEST]		= {  [1] = { aslevel = 1, skillname="PRIEST_RISING_TIDE" },
								 [2] = { aslevel = 1, skillname="PRIEST_URGENT_HEAL" },
								 [3] = { aslevel = 4, skillname="PRIEST_REGENERATE" }, },
		[CLASS_KNIGHT]		= {  [1] = { aslevel = 1, skillname="KNIGHT_PUNISHMENT" },
								 [2] = { aslevel = 1, skillname="KNIGHT_HOLY_STRIKE" },
								 [3] = { aslevel = 1, skillname="KNIGHT_MANA_RETURN" }, },
		[CLASS_WARDEN]		= {  [1] = { aslevel = 1, skillname="WARDEN_CHARGED_CHOP" },
								 [2] = { aslevel = 1, skillname="WARDEN_ENERGY_ABSORB" },
								 [3] = { aslevel = 2, skillname="WARDEN_THORNY_VINE" },
								 [4] = { aslevel = 4, skillname="WARDEN_BRIAR_SHIELD" },
								 [5] = { aslevel = 8, skillname="WARDEN_POWER_OF_THE_WOOD_SPIRIT" } },
		[CLASS_DRUID]		= {  [1] = { aslevel = 1, skillname="DRUID_RECOVER" },
								 [2] = { aslevel = 1, skillname="DRUID_EARTH_ARROW" },
								 [3] = { aslevel = 2, skillname="DRUID_BRIAR_ENTWINEMENT" },
								 [4] = { aslevel = 6, skillname="DRUID_RESTORE_LIFE" } },
		};


	local leveluptable = skillLevelupMap[player.Class1];
	for i,v in pairs(leveluptable)  do

		if (_loadonly ~= "loadonly") then
			-- levelup the skill ingame
			-- TODO: maxlevel skills vs. new skill with only one level
			if( player.Level == v.aslevel ) then		-- maxlevel the new skill
					levelupSkill(v.skillname, v.aslevel);
			elseif( player.Level == 2 and
					v.aslevel == 1) then			-- 2x aft level 2
					levelupSkill(v.skillname, 2);
			elseif( player.Level > v.aslevel ) then  	-- levelup 1 level
					levelupSkill(v.skillname);
			end
		end;

		-- sort the skill table
		local skillSort = function(tab1, tab2)
			if( tab2.priority < tab1.priority ) then
				return true;
			end;
			return false;
		end
		table.sort(settings.profile.skills, skillSort);

	end

	-- special skill for SCOUT / not usable, just level it
	if(_loadonly ~= "loadonly") then
		if(player.Class1 == CLASS_SCOUT and
		   player.Level  == 6 ) then
			levelupSkill("SCOUT_RANGED_WEAPON_MASTERY", 6)
		elseif(player.Class1 == CLASS_SCOUT and
		   player.Level  > 6 ) then
		   levelupSkill("SCOUT_RANGED_WEAPON_MASTERY")
		end
	end

end
For you I would suguest adding in a value to lvl the skill to, a maximum lvl.

Code: Select all

[2] = { aslevel = 1, skillname="DRUID_EARTH_ARROW", maxlvl = 50 },
you can then do a comparison to the players level and if maxlvl >= player.Level then just do the code to max.
Or you could just get the current skill lvl and do a comparison to the maxlvl and then use the difference in the levelupSkill(_skillname, _times) function.

Something like this

Code: Select all

	local leveluptable = skillLevelupMap[player.Class1];
	for i,v in pairs(leveluptable)  do
		if (_loadonly ~= "loadonly") then
			if( player.Level >= v.aslevel ) then 
				for k,p in pairs(settings.profile.skillsData) do
					if v.skillname == p.Name then
						if player.Level >= v.maxlvl then
							levelupSkill(v.skillname, (v.maxlvl-p.Level));
						else
							levelupSkill(v.skillname, (player.Level-p.Level));
						end
					end
				end
			end
		end
	end
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

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Levelling up Skills beyond 1-10

#5 Post by BillDoorNZ » Tue Nov 15, 2011 10:55 pm

you could just build a complete table with a format like:

Code: Select all

local skillDevTable = 
{
	[CLASS_WARRIOR] = 	{
					WARRIOR_SLASH=		{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70}
					WARRIOR_THUNDER=	{0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65}
						}
}
where each class has all skills listed and what the level of that skill should be developed to at every level. In the example above, WARRIOR_SLASH should be at 5 when the warrior is level 5 and WARRIOR_THUNDER should be at 0. WARRIOR_THUNDER gets developed to 1 when they reach level 6 and WARRIOR_SLASH will be developed to 6. So the characters class is the index into the first part part of the table and the level is the index into the sub-table. You could even do it so you then had another section for elites. e.g.:

Code: Select all

local skillDevTable = 
{
	[CLASS_WARRIOR] = 	{
					WARRIOR_SLASH=		{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70}
					WARRIOR_THUNDER=	{0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65}
						}
						
	[CLASS_PRIEST] =	{
							....
						}
	[CLASS_WARRIOR.CLASS_PRIEST] = 
	{
					ELITE_DEFENDERS_ROAR=	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,11,12...}
					ELITE_OPPORTUNITY=		{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,11...}
	}
}
The advantage of this format is you can easily generate it from a spreadsheet or the like - making it easier to build and maintain :)

imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Re: Levelling up Skills beyond 1-10

#6 Post by imaginethat » Tue Nov 15, 2011 11:21 pm

It will take a bit for me to work my way through what is happening in those nested if's.
The issue I have with having a maxlvl, there is not enough TP's to lvl up all the skills I use, so this level I will level up a couple to the max (keep maxed) and there will be several I want to level up, but can only do some this level, and the others the following level, and alternate between the non-maxed ones.

With "maxlvl" would it depend a lot on the order of skills in the table as to what skills get the TP points, and as the code runs through the table it will give the skills it gets to first the TP's untill it gets to maxlvl, and the skills later in the table will only get TP's if the earlier skills have been maxed, or there e are lots of TP's
Sorry, I dont feel I have explained that very well. How to alternate level ups between several skills you want to level up evenly, but not enough TPs to max any.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Levelling up Skills beyond 1-10

#7 Post by lisa » Tue Nov 15, 2011 11:29 pm

You could add in more checks.

check the skills arn't at max lvl already and then compare the current levels of the skills and level the lowest ones first. getting more complicated but again still possible.

If you are going to be getting this in depth then I would alter the way I did that code, it is easy enough to indent if statements if you only do 5 or 6 but if you are going to make it larger then it is better to do the opposite and do checks for the opposite and use a break to stop going further at that point. A lot like how player:useskill works.

As for your question yes it will check the first skills in database first and level them first. So it will try to max first skill, then try to max second skill and so on.
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

imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Re: Levelling up Skills beyond 1-10

#8 Post by imaginethat » Wed Nov 16, 2011 6:56 pm

Hi
I think you are right, Lisa, with a few more checks it can be streamlined. But it might be a bit of a logic minefield (for me at least) so am leaning toward the way BillDoorNZ has outlined. I think the table looks a bit clumsy/big, but it is more visual and you can look at each skill and see when it is being LevelUp and you can be more precise about when to level things, so allows for more 'tweaking'
I do have a couple of questions about that setup though:

1. The way BillDoorNZ has set it up is (assuming excel generated) having a value for each level gives each skill a fixed number of entries, say 70. With this, how would you see the code loop check for a levelup 'green light'? maybe if the 23rd value (when character is level 23) is not 0. I would see it as visually easier to manage if you just listed the levels you wanted to be leveled, say levels, maxed= {1,2,3,4,5,...68,69,70} or odd={2,4,6,8,10,12,...68,70} maxed to 9 then every 5th={1,2,3,4,5,6,7,8,9,15,20,25,30,35,40...} Having only the levels you want skills to be leveled at seems easier to add and alter.

2. Having these values does not solve the issue of maxing a skill that is obtained at, say 25. Maybe a single value of {99} would mean to just max this level, so you don't have to list all 70 values. I still see the need for "aslevel" to make sure you are only trying to levelup a skill that you have access to.

i am trying to flesh this out as much as possible, as I see the testing for this to be time consuming, waiting for a character to level to check, and then alter the code and then wait for a level etc etc. So the more I can pick everyones brains, and get a logical process, the less (I hope) issues I will run into in implementing the code

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Levelling up Skills beyond 1-10

#9 Post by BillDoorNZ » Wed Nov 16, 2011 8:12 pm

The main reason I was suggesting a complete table was for ease of generation from something like excel.

The way I would imagine that it would work is like this:

Pseudo code

level refers to a players level
rank refers to the level the player have developed a skill to

1) Character gains a level triggering process
2) Lookup table for Player.Class1
3) for each sub-table (the sub table is a table showing what rank the skill should be set to for each player level, lets call is skillLevelTable) in the table do
3.1) while 'the players skill rank' is < skillLevelTable[player.Level], rank it by 1

The onus of TP management would be on the person defining the excel sheet that you use to generate the skillLevelTable that works based of normative values for TP at each level.

Ultimately you could just generate your tables without the extra 'padding' for each level - given that lua allows you to specify indexes easily.

so instead of

Code: Select all

   [CLASS_WARRIOR.CLASS_PRIEST] =
   {
               ELITE_DEFENDERS_ROAR=   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,11,12...}
               ELITE_OPPORTUNITY=      {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,11...}
   }
you would do:

Code: Select all

   [CLASS_WARRIOR.CLASS_PRIEST] =
   {
               ELITE_DEFENDERS_ROAR=   {15=10,16=11,17=12...}
               ELITE_OPPORTUNITY=      {36=10,37=11...}
   }

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Levelling up Skills beyond 1-10

#10 Post by rock5 » Thu Nov 17, 2011 4:44 am

Yes, I was going to say 'What happens if you level up while not botting?'. You could miss a skill level up. I think it best to say "at this level this skill should be at this level" like that second table. So even if the skill is at zero, it will level it upto the desired level.

I think prioritising which skills to level when tp is low is going to be a problem.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Levelling up Skills beyond 1-10

#11 Post by BillDoorNZ » Thu Nov 17, 2011 4:56 am

yes, thats the hard part :)

all the rest of it has been easy so far. It would be far too easy if you could just list the skills in the order you want them developed. Unfortunately your priorities are going to change at each level too. The second issue, is the reverse scenario where you have more than enough tp to achieve the ranks you specify, what then do you spend the rest of the tp on - if indeed you do spend it rather than saving it for next level!!!

imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Re: Levelling up Skills beyond 1-10

#12 Post by imaginethat » Sun Dec 04, 2011 3:38 pm

Hi
I have been away from RoM for a couple of weeks so have not really had a chance to play with this.
I have gotten the table method working, adding in an "atlevel" field to show what levels to level a skill up.
It is still very rough around the edges, as I am still learning about table to just getting it to run and not error is progress for me.

I have a questions and a large concern.

1. what is the syntax for finding the current level of a given skill. When I set the "atlevel" to 99 to max that level out each time it's time to run the level up function, it will update that skill as many time as the player level, or "aslevel" depending on what I use in the script, either way it is a slow process levelling each skill many times just to get it to max. So need to find out the difference between the current skill level and the player level.

2. I have been running this script/function in "onload" which I would not normally do, but did not want to have to wait for the character to level another level just to check the script ran etc.
What I noticed which concerns me, is the function would use up all the TPs (to zero) each time the function would run, even if it did not actually level any skills up.

How do you use up TPs if the skill cant be levelled up? How can I stop the TPs being spent if there is nothing affordable to spend them on, seems a huge waste of TPs.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Levelling up Skills beyond 1-10

#13 Post by lisa » Sun Dec 04, 2011 8:55 pm

1.

Code: Select all

for k,p in pairs(settings.profile.skillsData) do
p.Level -- this is current level.
end
The code I posted earlier dealt with this.


2.
Sounds like it is leveling other skills you may not want leveled, probably an issue with your table of skill names.
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

imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Re: Levelling up Skills beyond 1-10

#14 Post by imaginethat » Sun Dec 04, 2011 10:05 pm

thanks
its is very odd, as the TPs go to zero each time I run it, and if it was levelling other skills I would still expect to see some left over TPs that would not be enough to level up any skill. I was watching the level up in MM window, and the skills in the character skills tabs, and it tried to level up each of the skills it was allowed to (only 3 I had set in the table, and at the end of the function no skills had been updated(because not enough TPs once they had all been used) but then there were zero TPs left.

I killed a few mobs to get some TPs ran the function (onload) and all the TPs got used up, but how? there were not enough TPs to level anything.

Seems to be black code hole they end up in.

If there is the chance of wasting TPs by running this kind of script, it will change they way I need to assign them.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Levelling up Skills beyond 1-10

#15 Post by lisa » Sun Dec 04, 2011 11:47 pm

confirmed, if you use the code to upgrade skill lvl and don't have enough tp it goes to 0 and you get nothing for it. So need to add in a check for tp against tp required.
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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Levelling up Skills beyond 1-10

#16 Post by lisa » Mon Dec 05, 2011 12:44 am

rom/functions.lua
line 903
replace

Code: Select all

	local hf_return = false;
	for i = 1, _times do
		yrest(600);
		sendMacro("SetSpellPoint("..skill_from_db.skilltab..","..skill_from_db.skillnum..");");
		hf_return = true;
	end
with

Code: Select all

	local hf_return = false;
	for i = 1, _times do
		yrest(600);
		local name, _, icon, _, rank, type, upgradeCost, isSkillable, isAvailable = RoMScript("GetSkillDetail("..skill_from_db.skilltab..","..skill_from_db.skillnum..")")
		player:update()
		if player.TP >= upgradeCost then
			sendMacro("SetSpellPoint("..skill_from_db.skilltab..","..skill_from_db.skillnum..");");
			hf_return = true;
		else
			break
		end
	end

I just use this

Code: Select all

function skillup()
	local skillLevelupMap = {
		[CLASS_WARRIOR]		= {  [1] = { aslevel = 1, maxlvl = 50 , skillname="WARRIOR_SLASH" },
								 [2] = { aslevel = 2, maxlvl = 50 , skillname="WARRIOR_OPEN_FLANK"  },
								 [3] = { aslevel = 2, maxlvl = 50 , skillname="WARRIOR_PROBING_ATTACK" },
								 [4] = { aslevel = 4, maxlvl = 50 , skillname="WARRIOR_TACTICAL_ATTACK" },
								 [5] = { aslevel = 4, maxlvl = 50 , skillname="WARRIOR_ENRAGED" }, },
		[CLASS_SCOUT]		= {  [1] = { aslevel = 1, maxlvl = 50 , skillname="SCOUT_SHOT" },
								 [2] = { aslevel = 2, maxlvl = 50 , skillname="SCOUT_WIND_ARROWS" },
								 [3] = { aslevel = 4, maxlvl = 50 , skillname="SCOUT_VAMPIRE_ARROWS" },},
		[CLASS_ROGUE]		= {  [1] = { aslevel = 1, maxlvl = 50 , skillname="ROGUE_SHADOWSTAB" },
								 [2] = { aslevel = 2, maxlvl = 50 , skillname="ROGUE_LOW_BLOW" },
								 [3] = { aslevel = 6, maxlvl = 50 , skillname="ROGUE_WOUND_ATTACK" }, },
		[CLASS_MAGE]		= {  [1] = { aslevel = 1, maxlvl = 50 , skillname="MAGE_FLAME" },
								 [2] = { aslevel = 4, maxlvl = 50 , skillname="MAGE_FIREBALL" }, },
		[CLASS_PRIEST]		= {  [1] = { aslevel = 1, maxlvl = 50 , skillname="PRIEST_RISING_TIDE" },
								 [2] = { aslevel = 1, maxlvl = 50 , skillname="PRIEST_URGENT_HEAL" },
								 [3] = { aslevel = 4, maxlvl = 50 , skillname="PRIEST_REGENERATE" }, },
		[CLASS_KNIGHT]		= {  [1] = { aslevel = 1, maxlvl = 50 , skillname="KNIGHT_PUNISHMENT" },
								 [2] = { aslevel = 1, maxlvl = 50 , skillname="KNIGHT_HOLY_STRIKE" },
								 [3] = { aslevel = 1, maxlvl = 50 , skillname="KNIGHT_MANA_RETURN" }, },
		[CLASS_WARDEN]		= {  [1] = { aslevel = 1, maxlvl = 50 , skillname="WARDEN_CHARGED_CHOP" },
								 [2] = { aslevel = 1, maxlvl = 50 , skillname="WARDEN_ENERGY_ABSORB" },
								 [3] = { aslevel = 2, maxlvl = 50 , skillname="WARDEN_THORNY_VINE" },
								 [4] = { aslevel = 4, maxlvl = 50 , skillname="WARDEN_BRIAR_SHIELD" },
								 [5] = { aslevel = 8, maxlvl = 50 , skillname="WARDEN_POWER_OF_THE_WOOD_SPIRIT" } },
		[CLASS_DRUID]		= {  [1] = { aslevel = 1, maxlvl = 50 , skillname="DRUID_RECOVER" },
								 [2] = { aslevel = 1, maxlvl = 50 , skillname="DRUID_EARTH_ARROW" },
								 [3] = { aslevel = 2, maxlvl = 50 , skillname="DRUID_BRIAR_ENTWINEMENT" },
								 [4] = { aslevel = 6, maxlvl = 50 , skillname="DRUID_RESTORE_LIFE" } },
		};
	local leveluptable = skillLevelupMap[player.Class1];
	for i,v in pairs(leveluptable)  do
		if( player.Level >= v.aslevel ) then 
			for k,p in pairs(settings.profile.skillsData) do
				for s,t in pairs(p) do
					if v.skillname == t.Name then
						if player.Level >= v.maxlvl then
							levelupSkill(v.skillname, (v.maxlvl-t.Level));
						else
							levelupSkill(v.skillname, (player.Level-t.Level));
						end
					end
				end
			end
		end
	end
end
it makes a lovely pyramid lol
Attachments
functions.lua
rev 679
(46.79 KiB) Downloaded 133 times
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

imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Re: Levelling up Skills beyond 1-10

#17 Post by imaginethat » Thu Dec 08, 2011 8:33 pm

awesome, thanks so much for your help Lisa, really appreciated.
That line...

Code: Select all

local name, _, icon, _, rank, type, upgradeCost, isSkillable, isAvailable = RoMScript("GetSkillDetail("..skill_from_db.skilltab..","..skill_from_db.skillnum..")")
...seems to be the magic juice in this, getting the upgrade cost, and then checking against it.

awesome

cheers

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Levelling up Skills beyond 1-10

#18 Post by lisa » Thu Dec 08, 2011 9:27 pm

I actually put the edited function in the revision I did for patch without realising lol
So you can just do a normal SVN update/revert and it should work fine.
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

imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Re: Levelling up Skills beyond 1-10

#19 Post by imaginethat » Sun Dec 11, 2011 10:13 pm

Hi Lisa
I am still having some trouble here, can you help please.

1. I don't understand where the skilltab and skillnum come from in this code:

Code: Select all

RoMScript("GetSkillDetail("..skill_from_db.skilltab..","..skill_from_db.skillnum..")")
with the checks you have, it looks to me like there should be some parameters "skillnum = " and "skilltab =" in the skills.xml file. Is that correct? If that is the case, how to any skills get updated, as "skillnum" and "skilltab" do not appear in the skills.xml file at all.
I am obviously missing something here.
I am just looking for the rank of the skill.

2. I am having trouble getting the name of the class I am testing on. I have created a mage, and it shows as being class "-1" which is the "unknown" class.why is this mage not coming up as class mage when doing a

Code: Select all

player.Class1

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Levelling up Skills beyond 1-10

#20 Post by lisa » Sun Dec 11, 2011 10:24 pm

Code: Select all

local skill_from_db = database.skills[_skillname];	-- read skill parameters from database
Yes it gets the info from the database which gets it's info directly from memory.

Code: Select all

CLASS_NONE = -1;
If it is printing -1 for player.Class1 then it is saying you have no class for your main class which is very weird.
Did you do a player:update() before the print?
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

Who is online

Users browsing this forum: No registered users and 1 guest