Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-20-2018, 11:25 PM
Rakkoraz05
Fire Beetle
 
Join Date: Apr 2009
Location: UTah
Posts: 28
Default

Quote:
Originally Posted by Kingly_Krab View Post
As for Shendare's resolution, you can also do that in Perl (this would go in your global_player.pl):
Code:
sub EVENT_LEVEL_UP {
    foreach my $skill (0..55, 62, 66, 67, 70..74) {
        if($client->CanHaveSkill($skill) && $client->MaxSkill($skill, $client->GetClass(), $ulevel) > $client->GetRawSkill($skill)) {
            $client->SetSkill($skill, $client->MaxSkill($skill, $client->GetClass(), $ulevel));
        }
    }
}
So i added the above to the global_player.pl and it doesn't seem to be working for me. Are there syntax that need to be updated?
Reply With Quote
  #2  
Old 09-29-2018, 01:49 AM
Andvari
Fire Beetle
 
Join Date: Jul 2011
Posts: 4
Default

Quote:
Originally Posted by Rakkoraz05 View Post
So i added the above to the global_player.pl and it doesn't seem to be working for me. Are there syntax that need to be updated?
Unless I'm mistaken (I'm new here), EQEmu now prioritizes .lua files over .pl files. So if there is a .lua file of the same name, the .pl file will be ignored.

That being said, here's some lua for you! This is the first piece of lua I've ever written, so it could probably be optimized by somebody that knows what they're doing. But this works to, on each level up 1) maximize [I]all[I] skills, including tradeskills and lockpicking etc., 2) scribe all spells up to current level, and 3) train all disciplines up to current level.

This goes in your server/quests/global/global_player.lua file.

View it on GitHub for some syntax highlighting

Code:
function event_level_up(e)

	-- All skills except caster specializations
	local skills = { 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,                     48, 49,
			50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
			60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
			70, 71, 72, 73, 74, 75, 76 };

	-- Determine max possible skill and assign it at each level up
	for k,v in ipairs(skills) do
		local max_skill = e.self:MaxSkill(v);
		local raw_skill = e.self:GetRawSkill(v);
		local can_have = e.self:CanHaveSkill(v);
		if ( max_skill > 0 and raw_skill < max_skill and can_have ) then 
			e.self:SetSkill(v, max_skill);
		end
	end

	-- Determine if client is a caster and can specialize
	if ( e.self:CanHaveSkill(43) ) then

		-- Specialization skills
		local special = { 43, 44, 45, 46, 47 };
		-- Create tables of raw skills and max skills
		local raw_skills = {};
		local max_skills = {};
		for k,v in ipairs(special) do
			raw_skills[k] = e.self:GetRawSkill(v);
			max_skills[k] = e.self:MaxSkill(v);
		end

		-- Check each specialization and determine what to do
		for k,v in ipairs(special) do
			if ( raw_skills[k] == 50 ) then
				-- do nothing
			elseif ( raw_skills[k] > 50 and raw_skills[k] < max_skills[k] ) then
				e.self:SetSkill(v, max_skills[k]);
			elseif ( raw_skills[k] < 50 and raw_skills[k] < max_skills[k] ) then
				if ( max_skills[k] <= 50 ) then
					e.self:SetSkill(v, max_skills[k]);
				else
					e.self:SetSkill(v, 50);
				end
			end
		end
	end

	-- Scribe all spells up to current level
	eq.scribe_spells(e.self:GetLevel());

	-- Train all disciplines up to current level
	eq.train_discs(e.self:GetLevel());
end
The conditional checks for caster specialization skills seem to be necessary. At least on the RoF2 client, if you have multiple specializations above 50, all specializations then get reset to 1 as soon as you cast a spell that would trigger a specialization skill-up. Not sure if other clients behave the same way.

The basic idea for the specialization conditionals came from this post. Sadly, I know even less about perl than lua. I did my best to translate c0ncrete's idea.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 09:45 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3