EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Buff your players example aint working (https://www.eqemulator.org/forums/showthread.php?t=42377)

Kattamaran.CH 03-30-2019 02:55 AM

Buff your players example aint working
 
Howdy all

So i tryed to implement the scripts for "buff your players" and nothing happens. i am referencing: https://github.com/EQEmu/Server/wiki/Buff-your-Players

Maybe i missinterpret things here. It sais i can simply add the code to global_player.pl:

Code:

sub EVENT_LEVEL_UP {
        #:: Train all disciplines, maximum set to player's level, minimum set to the level prior
        quest::traindiscs($ulevel,$ulevel - 1);
}

what i dont understand when i read this code (as a novice) i kinda interpret that it triggers the quest named "traindiscs". But i dont think i have that quest/script anywhere.
Is that the problem? Do i have to add those quests (train discs, skills, spells) first? If so where do i put them?

And what or where is the trigger for "sub Event_LEVEL_UP"? Do i need to add a trigger somewhere as well?

Thanks guys

EDIT: Im using the windows installer: https://github.com/EQEmu/Server/wiki/Windows-Server

Kattamaran.CH 03-30-2019 03:13 AM

After further googling around i found out, that the quests should be present within "questmgr.cpp".
Is that a physical file wich should be in the eqemu directory?

Maybe the windows installer comes without it?

chrsschb 03-30-2019 09:23 AM

You just need to add what you're trying to do to the global_player.pl. The subroutine SUB EVENT_LEVEL_UP would trigger anytime a player levels. The example given would train discs on level up.

I've referenced the ones you're probably intersted in:
Code:

quest::scribespells(maxlevel, minlevel) # Scribes all spells up to the specified level.
quest::setallskill(value) # Sets all skills to 'value'.
quest::traindiscs(maxlevel, minlevel) # Trains all disciplines up to the specified level. To train up to any level, use $ulevel as the variable.

From: http://wiki.eqemulator.org/p?Ultimate_Perl_Reference

So your global_player.pl would look something like:

Code:

sub EVENT_LEVEL_UP {
        quest::traindiscs($ulevel,$ulevel - 1);
        quest::scribespells($ulevel,$ulevel -1);
}

I would caution using setallskills cause it raises ALL skills, including tradeskills and resets specializations.

Kattamaran.CH 03-30-2019 09:36 AM

Hmm your code reflects what i posted without the comment. I can try it again but i dont think it will work.

On a side note, when i use #level command to test it out, it should trigger as well right?

chrsschb 03-30-2019 09:45 AM

Quote:

Originally Posted by Kattamaran.CH (Post 262033)
Hmm your code reflects what i posted without the comment. I can try it again but i dont think it will work.

On a side note, when i use #level command to test it out, it should trigger as well right?

Yes, make sure you're reloading quests after making changes to quest files #reloadqst

Kattamaran.CH 03-30-2019 10:03 AM

This should handle all but trading- and spec skills:

Code:

sub EVENT_LEVEL_UP {
        #:: Set available (non-trade, non-casting specialization) skills to maximum for race/class at current level
        foreach my $skill ( 0 .. 42, 48 .. 54, 70 .. 74 ) {
                next unless $client->CanHaveSkill($skill);
                #:: Create a scalar variable to store each skill's maximum skill level at the player's current level
                my $maxSkill = $client->MaxSkill($skill, $client->GetClass(), $ulevel);
                #:: Check that the player's skill does not already exceed the maximum skill based on level
                next unless $maxSkill > $client->GetRawSkill($skill);
                #:: Set the skill to the maximum
                $client->SetSkill($skill, $maxSkill);
        }
}


Kattamaran.CH 03-31-2019 07:39 AM

it still doesent work :confused:

i tryed your examples and it does not work.
why do i have a global_player.lua file next to the global_player.pl
do i need to add it to the lua one? is maybe perl old and lua is new?

but if i need to add it to the lua one, i guess it might need to be altered to work there?

Kattamaran.CH 03-31-2019 03:15 PM

Went throu the trouble to add NPCs and add the scripts to them for skills, disc and spell trainer.
That works .. guess it will have to do :)

Huppy 03-31-2019 04:23 PM

Quote:

Originally Posted by Kattamaran.CH (Post 262047)
why do i have a global_player.lua file next to the global_player.pl
do i need to add it to the lua one? is maybe perl old and lua is new?

If you have two files in the same quest folder with the same name (one being .lua and other .pl), the .lua script will take priority and be used. global_player.lua would have to be disabled(renamed) for the global_player.pl to be used. This applies to any quest scripts of the same name in the same quest folder. lua is an alternative to perl.

belvino 04-03-2019 12:55 PM

I found it easier to make the npc version where you just hail and it trains for you. it should be on the same page. the skill on the npc only does the class skills I believe.


All times are GMT -4. The time now is 12:29 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.