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

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 05-26-2015, 04:41 PM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default Gain AA points each level

I am trying to get 2 AA added to a character each level up to and including level 50. I have pieced this together from other peoples code to try and get it to work. I am placing this in the ...quest/global/global_player.lua file. I am not sure what I am doing but trying to learn lol.


Code:
sub EVENT_LEVEL_UP
	if ($ulevel < 51) {
		$client-AddAAPoints(2);
	}
}
Reply With Quote
  #2  
Old 05-26-2015, 04:45 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Try this:
Code:
sub EVENT_LEVEL_UP {
    if ($ulevel < 51) {
        $client->AddAAPoints(2);
    }
}
Edit: You were missing a { on the subroutine at the top and missing a > on $client->AddAAPoints.

Edit 2: This is Perl, not Lua, I didn't notice you said you were putting it in a Lua file.

Last edited by Kingly_Krab; 05-26-2015 at 04:51 PM..
Reply With Quote
  #3  
Old 05-26-2015, 04:56 PM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

I still seem to be doing something wrong. It doesn't seem to do anything. This is what is looks like in the global_player.lua. After adding it the file has a red exclamation point in the icon instead of a green check that used to be there. All I did was past the code in the end. Did i add it correclty? Thank you for the reply.

Code:
function event_enter_zone(e)
	local qglobals = eq.get_qglobals(e.self);
	if(e.self:GetLevel() >= 15 and qglobals['Wayfarer'] == nil) then
		local zoneid = eq.get_zone_id();
		if(e.self:GetStartZone() ~= zoneid and (zoneid == 1 or zoneid == 2 or zoneid == 3 or zoneid == 8 or zoneid == 9 
		or zoneid == 10 or zoneid == 19 or zoneid == 22 or zoneid == 23 or zoneid == 24 or zoneid == 29 or zoneid == 30 
		or zoneid == 34 or zoneid == 35 or zoneid == 40 or zoneid == 41 or zoneid == 42 or zoneid == 45 or zoneid == 49 
		or zoneid == 52 or zoneid == 54 or zoneid == 55 or zoneid == 60 or zoneid == 61 or zoneid == 62 or zoneid == 67 
		or zoneid == 68 or zoneid == 75 or zoneid == 82 or zoneid == 106 or zoneid == 155 or zoneid == 202 or zoneid == 382 
		or zoneid == 383 or zoneid == 392 or zoneid == 393 or zoneid == 408)) then
			e.self:Message(15, 
				"A mysterious voice whispers to you, \'If you can feel me in your thoughts, know this -- "
				.. "something is changing in the world and I reckon you should be a part of it. I do not know much, but I do know "
				.. "that in every home city and the wilds there are agents of an organization called the Wayfarers Brotherhood. They "
				.. "are looking for recruits . . . If you can hear this message, you are one of the chosen. Rush to your home city, or "
				.. "search the West Karanas and Rathe Mountains for a contact if you have been exiled from your home for your deeds, "
				.. "and find out more. Adventure awaits you, my friend.\'");
		end
	end
end

function event_combine_success(e)
	if (e.recipe_id == 10904 or e.recipe_id == 10905 or e.recipe_id == 10906 or e.recipe_id == 10907) then
		e.self:Message(1,
		"The gem resonates with power as the shards placed within glow unlocking some of the stone's power. "
		.. "You were successful in assembling most of the stone but there are four slots left to fill, "
		.. "where could those four pieces be?"
		);
	elseif(e.recipe_id == 10903 or e.recipe_id == 10346 or e.recipe_id == 10334) then
		local reward = { };
		reward["melee"] =  { ["10903"] = 67665, ["10346"] = 67660, ["10334"] = 67653 };
		reward["hybrid"] = { ["10903"] = 67666, ["10346"] = 67661, ["10334"] = 67654 };
		reward["priest"] = { ["10903"] = 67667, ["10346"] = 67662, ["10334"] = 67655 };
		reward["caster"] = { ["10903"] = 67668, ["10346"] = 67663, ["10334"] = 67656 };

		local ctype = eq.ClassType(e.self:GetClass());
		e.self:SummonItem(reward[ctype][tostring(e.recipe_id)]);
		e.self:SummonItem(67704);
		e.self:Message(1, "Success");
	end
end

function event_command(e)
	return eq.DispatchCommands(e);
end

sub EVENT_LEVEL_UP {
    if ($ulevel < 51) {
        $client->SetAAPoints(($client->GetAAPoints() + 2));
    }
}
Reply With Quote
  #4  
Old 05-26-2015, 04:57 PM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

oh crap ok. so is there a global quest that is perl that this can be placed in?
Reply With Quote
  #5  
Old 05-26-2015, 05:01 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Yes, just make a global_player.pl in the quests/global folder. global_player.lua will have precedence though, so if you're not using that file you may want to delete it or rename it to something else.
Reply With Quote
  #6  
Old 05-26-2015, 05:05 PM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

Quote:
Originally Posted by Kingly_Krab View Post
Yes, just make a global_player.pl in the quests/global folder. global_player.lua will have precedence though, so if you're not using that file you may want to delete it or rename it to something else.
Thats why my global_player.pl file never workes then lol. Great thank you for the help you are awesome.
Reply With Quote
  #7  
Old 05-26-2015, 05:15 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Let me know if it all works.
Reply With Quote
  #8  
Old 05-26-2015, 05:20 PM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

It does work. It only seems to register one level up even if you get several, but that is almost a non issue as you should never get more then one level at a time. Thank you again for your time.
Reply With Quote
  #9  
Old 05-26-2015, 05:32 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

No problem, just private message me or add my Skype (Kingly.krab) if you have any Perl/Lua related questions.
Reply With Quote
  #10  
Old 01-23-2017, 07:35 PM
warbleeder
Fire Beetle
 
Join Date: Feb 2011
Location: england
Posts: 7
Default

cant seem to get it working

im guessing im missing something

heres ho i have it

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 .. 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 );

}

}sub EVENT_LEVEL_UP {
if ($ulevel < 51) {
$client->AddAAPoints(3);
}
Reply With Quote
  #11  
Old 01-25-2017, 07:01 AM
warbleeder
Fire Beetle
 
Join Date: Feb 2011
Location: england
Posts: 7
Default

fixed it got rid of part of code and moved rest and it works like a charm
Reply With Quote
  #12  
Old 10-07-2023, 10:06 AM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

I hate to necro my old thread but I am trying to remake my old server and having an issue getting this to work again. I have added the code to the global.player.pl file, but can not seem to get it to work. (I renamed the .lua file of the same name)

I see someone above had an issue and said they found a way to fix it but didn't post the fix. Is there a new way to write this code to get it to work?

this is what I put in the file

sub EVENT_LEVEL_UP {
if ($ulevel < 51) {
$client->SetAAPoints(($client->GetAAPoints() + 2));
}
Reply With Quote
  #13  
Old 10-07-2023, 12:21 PM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

Ok so I have found out it has something to do with the level triggers is why it is not working. If I remove that line, it works fine. Below is what I used and it now works. Good enough for me.


sub EVENT_LEVEL_UP {
$client->SetAAPoints($client->GetAAPoints()+2);
}
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 06:25 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