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

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2013, 11:37 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default auto-train on level for the extra lazy

lots of people seem to enjoy skill trainer and spell scriber/disc trainer npcs. since you're going to be increasing skills for free, why not just pop it in global_player.pl and trigger it when the player levels? no need to add a new spawn.

this script will increase skills to the maximum level allowed by the player's race/class/level (and only those that he/she can learn). it also automatically scribes spells and trains discs.

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 .. 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
  #2  
Old 01-13-2013, 01:09 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

Why train level and level minus one? Those commands should accept same level as both arguments, is there a bug in them?
Reply With Quote
  #3  
Old 01-13-2013, 01:30 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

not bug. not sure why i didn't just use $ulevel for both, honestly. i was probably half asleep and thought for sure i had a really good reason at the time. just tried to keep the script from attempting to scribe spells for levels 0 to current every time.
Reply With Quote
  #4  
Old 01-17-2013, 06:09 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 251
Default

When you die and lose a level and then re-ding, it checks and regives all the spells and retrains the skills again. Is there a way to put a level check or something in, so it doesnt re-apply what it already has?
Reply With Quote
  #5  
Old 01-17-2013, 06:20 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

this line should be checking to verify that the max skill available at the level obtained is higher than the current raw skill before setting the skill to the new value:

Code:
next unless $maxSkill > $client->GetRawSkill($skill);
i would think that since the current skill is already at the max for the level when you re-ding, it should skip the skill in question. i believe i'd already tested this and it worked, but i can always test it again to verify.

as for the spells and discs, i'm sure it could be changed to not re-train/scribe already known items, but it would require source code modification as the work is actually done server-side and not in the script.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #6  
Old 01-17-2013, 06:24 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 251
Default

The reason I enquired more about is, bc I have added an AA point to the level ding as well. So when they ding, u get spells, skills, and 1 AA. The death and re-ding with the AA is whats getting me. I didnt want it to let people exploit it. Also tryen to make it start at level 10.
Reply With Quote
  #7  
Old 01-17-2013, 06:38 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 251
Default

got the level requirement working, just not the delevel exploit
Reply With Quote
  #8  
Old 01-17-2013, 06:38 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

fdshjakfhksf...

so the problem isn't as you described it at all. it's with your additions, correct?

thanks for the clarification.

1) use a qglobal to store the highest level the character has obtained and check the value before supplying a new aa point.
2) use a condition to check for the character's level before calling AutoTrain().
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #9  
Old 01-17-2013, 10:11 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 251
Default

Thanks for the direction. I am learning as I go
Reply With Quote
  #10  
Old 05-30-2013, 01:29 PM
xplodr
Sarnak
 
Join Date: Jan 2009
Location: Florida
Posts: 53
Default

How do I do this? I mean how do I find the file you're talking about and where would I put this coding? Also I don't want the auto skill ups business, trying to leave it still somewhat legit. Basically I would just want spells and discs.
__________________
Why Windows Vista is BAD
Reply With Quote
  #11  
Old 05-30-2013, 04:22 PM
Kingly_Krab's Avatar
Kingly_Krab
Developer
 
Join Date: May 2013
Location: United States
Posts: 1,533
Default

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.
Reply With Quote
  #12  
Old 05-30-2013, 06:20 PM
xplodr
Sarnak
 
Join Date: Jan 2009
Location: Florida
Posts: 53
Default

Somehow my GM 250 character is not allowed to use the #reloadworld command lol. Any idea what that's about?
__________________
Why Windows Vista is BAD
Reply With Quote
  #13  
Old 05-30-2013, 06:57 PM
Kingly_Krab's Avatar
Kingly_Krab
Developer
 
Join Date: May 2013
Location: United States
Posts: 1,533
Default

It may require more than 250 status, go in your database to the Commands table and check if anything requires above 250. A simple way to do so below this. If you do, set your status higher and relog.

Code:
/*Finds commands that are above 250 status.*/
SELECT * FROM `commands` WHERE `access` > 250;
Reply With Quote
  #14  
Old 05-30-2013, 11:33 PM
xplodr
Sarnak
 
Join Date: Jan 2009
Location: Florida
Posts: 53
Default

The only command over 250 is setstat and that's set to 255
__________________
Why Windows Vista is BAD
Reply With Quote
  #15  
Old 05-31-2013, 01:08 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,040
Default

command_add("reloadworld",NULL,255,command_reloadworld) ||

There was a time where I was a dipshit and originally implemented it with level 0. So new servers who didn't pay attention to this had this command on for regular players and could really hose up a server, that's tons of Mysql queries, quest reading depending on how many zones you have up.

It could have been 250 like the rest but I think I said something about it in coders and if someone was about to commit something to nail it up high so that's what it ended up being.
__________________


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