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

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #61  
Old 11-23-2020, 09:31 PM
Rakkoraz05
Fire Beetle
 
Join Date: Apr 2009
Location: UTah
Posts: 28
Default

Quote:
Originally Posted by macdaddy02 View Post
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?
Reply With Quote
  #62  
Old 11-23-2020, 10:42 PM
jsr
Hill Giant
 
Join Date: Aug 2008
Location: melbourne
Posts: 187
Default

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).
Reply With Quote
  #63  
Old 11-23-2020, 11:35 PM
Rakkoraz05
Fire Beetle
 
Join Date: Apr 2009
Location: UTah
Posts: 28
Default

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.
Reply With Quote
  #64  
Old 11-24-2020, 07:40 PM
jsr
Hill Giant
 
Join Date: Aug 2008
Location: melbourne
Posts: 187
Default

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