|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Custom Custom Quests here |
|
|
|
11-23-2020, 09:31 PM
|
Fire Beetle
|
|
Join Date: Apr 2009
Location: UTah
Posts: 28
|
|
Quote:
Originally Posted by macdaddy02
I'm not sure if this is old or I should post here anymore, however I got a .lua code that works and thought I'd share it with everyone.
Code:
function event_level_up(e)
e.self:Message(15, "You have gained the knowledge of learning new skills, spells and discs!!");
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
-- 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());
--Train all skills for current level
e.self:SetSkill(curskill, maxskill);
end
end
end
|
To use this would you just replace the current Event_Level_Up that's in the global_player.lua or just add it below?
|
|
|
|
11-23-2020, 10:42 PM
|
Hill Giant
|
|
Join Date: Aug 2008
Location: melbourne
Posts: 187
|
|
You could add it to the existing function.
It would probably be better to put it in a separate function like grantsSkills(), and then call it.
That code can be simplified a bit, the negative checks are not needed (if false then do nothing + if false then do nothing + if true then do something == if true then do something).
|
11-23-2020, 11:35 PM
|
Fire Beetle
|
|
Join Date: Apr 2009
Location: UTah
Posts: 28
|
|
If there are two function calls for the same event, would that cause issue?
Edit: I did add this into the lua file. Seems to work just fine id the skill isn't 1 or greater.
|
11-24-2020, 07:40 PM
|
Hill Giant
|
|
Join Date: Aug 2008
Location: melbourne
Posts: 187
|
|
I'm not quite sure how it will handle the same function twice, but it's not a good idea. Most languages won't allow it. If it does allow it, then its a bad idea from a maintenance perspective.
|
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 11:29 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|