Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #31  
Old 02-25-2015, 01:34 AM
Azrealvect
Sarnak
 
Join Date: May 2011
Posts: 53
Default

Any way to make this so that it does not train trade skills?
Reply With Quote
  #32  
Old 02-25-2015, 02:16 AM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Code:
sub EVENT_LEVEL_UP {

    AutoTrain(1); ## if 1 is passed it will train trade skills
    AutoTrain(); ## will not train trade skills (

}

sub AutoTrain {

    $client->Message( 15, "Your experiences across the realm have infused you with increased power and knowledge..." );

    # set all available skills to maximum for race/class at current level
    if ($_[0]) {my @skillsarray = [0..74];}
    else {my @skillsarray = [0..54,62,66,67,70..74];}
    foreach my $skill (@skillsarray) {
        next unless $client->CanHaveSkill($skill);
        my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
        next unless $maxSkill > $client->GetRawSkill($skill);
        $client->SetSkill( $skill, $maxSkill );
    }

    # scribe all spells for current level
    quest::scribespells( $ulevel, $ulevel - 1 );

    # train all discs for current level
    quest::traindiscs( $ulevel, $ulevel - 1 );

}
untested
Reply With Quote
  #33  
Old 02-25-2015, 11:35 AM
Azrealvect
Sarnak
 
Join Date: May 2011
Posts: 53
Default

Ill give it a try later today thank you
Reply With Quote
  #34  
Old 06-07-2015, 03:45 PM
dew1960
Sarnak
 
Join Date: Feb 2008
Posts: 80
Default

Quote:
Originally Posted by Kingly_Krab View Post
Go in to your server folder, quests, templates, find global_player.pl and add these lines to the script and save it, enter the game, and type #reloadworld to repop all zones and reload scripts world-wide.
I know this is an old post and it may not apply to the current build so if that is the case, please let me know.

I just built a private local server to play on and learn how to use MQemulator.

Is there still a global_player.pl file somewhere because I can't find it in my server. I went into the server folder, quests, but there is no template folder there and a search of my pc only finds a reference to global_player.pl in a SQL update and a changelog.txt

Is there a way to still accomplish this on the current windows server build?

Just curious because I like the idea of this!
__________________
I know we just met and this is crazy but, here's my server, play on it, maybe?

Adventure Unlimted - Underfoot!
Reply With Quote
  #35  
Old 06-07-2015, 04:17 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,596
Default

The 'templates' folder was renamed to 'global'.
Reply With Quote
  #36  
Old 06-07-2015, 06:26 PM
dew1960
Sarnak
 
Join Date: Feb 2008
Posts: 80
Default

Quote:
Originally Posted by Kingly_Krab View Post
The 'templates' folder was renamed to 'global'.
OK, I can see that. There is no global_player.pl but there is a global_player.lua, is that the same thing?
__________________
I know we just met and this is crazy but, here's my server, play on it, maybe?

Adventure Unlimted - Underfoot!
Reply With Quote
  #37  
Old 06-07-2015, 06:30 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,596
Default

If you're not compiling Lua, the .lua file will not work, also, the code in this thread is Perl, so you'll have to use a global_player.pl file, which may require you deleting the global_player.lua file, as Lua has precedence.
Reply With Quote
  #38  
Old 10-25-2015, 10:07 PM
jpyou127's Avatar
jpyou127
Discordant
 
Join Date: Nov 2005
Posts: 270
Default

How hard would this be to add to LUA?


Celestial
Reply With Quote
  #39  
Old 10-26-2015, 01:21 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,596
Default

Very simple, it's already enabled on the CMake by default. So unless you turn it off, it should be enabled already.
Reply With Quote
  #40  
Old 10-26-2015, 06:55 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Quote:
Originally Posted by jpyou127 View Post
How hard would this be to add to LUA?


Celestial

Try this... (might want to test it.. lol I r bad at lua)


This will train all skills except tradeskills

Code:
function event_level_up(e)
	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, 56, 62, 66, 67, 70, 71, 72, 73, 74 };
	for i, curskill in ipairs(skills) do
		local maxskill = e.self:MaxSkill(curskill);
		if (e.self:CanHaveSkill(curskill) == false) then
			--Do nothing...
		elseif (maxskill <= e.self:GetRawSkill(curskill)) then
			--Do nothing...
		else
			--Train!
			e.self:SetSkill(curskill, maxskill);
		end
	end
end
Reply With Quote
  #41  
Old 10-28-2015, 08:47 AM
jpyou127's Avatar
jpyou127
Discordant
 
Join Date: Nov 2005
Posts: 270
Default

Thanks Natedog will give this a try!


Celestial
Reply With Quote
  #42  
Old 11-05-2015, 12:29 AM
Azrealvect
Sarnak
 
Join Date: May 2011
Posts: 53
Default

If anyone is interested this will train everything but trade skills and spell specializations.

Code:
sub EVENT_LEVEL_UP {

    AutoTrain();

}

sub AutoTrain {

    $client->Message( 15, "Your experiences across the realm have infused you with increased power and knowledge..." );

    # set all available skills to maximum for race/class at current level
    foreach my $skill ( 0 .. 42, 48 .. 54, 70 .. 74 ) {
        next unless $client->CanHaveSkill($skill);
        my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
        next unless $maxSkill > $client->GetRawSkill($skill);
        $client->SetSkill( $skill, $maxSkill );
    }

    # scribe all spells for current level
    quest::scribespells( $ulevel, $ulevel - 1 );

    # train all discs for current level
    quest::traindiscs( $ulevel, $ulevel - 1 );

}
Reply With Quote
  #43  
Old 11-05-2015, 12:33 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Wow. That foreach iteration specification is beautiful.

Several people have been wondering about the cleanest way to iterate through numbers while skipping some, without nested ifs or multiple fors.

That's just gorgeous!
Reply With Quote
  #44  
Old 11-05-2015, 03:55 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Quote:
Originally Posted by Shendare View Post
Wow. That foreach iteration specification is beautiful.

Several people have been wondering about the cleanest way to iterate through numbers while skipping some, without nested ifs or multiple fors.

That's just gorgeous!
Its easy in perl.. I have no clue how to do it in lua though :p
Reply With Quote
  #45  
Old 11-05-2015, 05:02 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

I feel like Shendare is kind of like this guy right now.

Reply With Quote
Reply


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 08:47 PM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3