|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Custom Custom Quests here |
02-18-2015, 07:56 AM
|
Hill Giant
|
|
Join Date: Aug 2008
Location: melbourne
Posts: 188
|
|
It will help if you post your player.pl script and where the file is located. Otherwise are you getting any errors when you load scripts? (Subscribe to errors and #reloadpl)
|
02-25-2015, 01:34 AM
|
Sarnak
|
|
Join Date: May 2011
Posts: 53
|
|
Any way to make this so that it does not train trade skills?
|
02-25-2015, 02:16 AM
|
|
Dragon
|
|
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
|
|
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
|
02-25-2015, 11:35 AM
|
Sarnak
|
|
Join Date: May 2011
Posts: 53
|
|
Ill give it a try later today thank you
|
06-07-2015, 04:17 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,589
|
|
The 'templates' folder was renamed to 'global'.
|
06-07-2015, 06:26 PM
|
Sarnak
|
|
Join Date: Feb 2008
Posts: 80
|
|
Quote:
Originally Posted by Kingly_Krab
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!
|
06-07-2015, 06:30 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,589
|
|
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.
|
10-25-2015, 10:07 PM
|
|
Discordant
|
|
Join Date: Nov 2005
Posts: 270
|
|
How hard would this be to add to LUA?
Celestial
|
10-26-2015, 06:55 PM
|
|
Developer
|
|
Join Date: Dec 2012
Posts: 515
|
|
Quote:
Originally Posted by jpyou127
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
|
12-18-2016, 11:41 AM
|
Sarnak
|
|
Join Date: Apr 2009
Location: LA
Posts: 97
|
|
Quote:
Originally Posted by NatedogEZ
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
|
Do i just add this and replace the other level event in global.lua? Also can you add Spells / Disc to this code?
|
10-26-2015, 01:21 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,589
|
|
Very simple, it's already enabled on the CMake by default. So unless you turn it off, it should be enabled already.
|
10-28-2015, 08:47 AM
|
|
Discordant
|
|
Join Date: Nov 2005
Posts: 270
|
|
Thanks Natedog will give this a try!
Celestial
|
11-05-2015, 12:29 AM
|
Sarnak
|
|
Join Date: May 2011
Posts: 53
|
|
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 );
}
|
11-05-2015, 12:33 PM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
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!
|
11-05-2015, 03:55 PM
|
|
Developer
|
|
Join Date: Dec 2012
Posts: 515
|
|
Quote:
Originally Posted by Shendare
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
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 01:33 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|