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 { |
Why train level and level minus one? Those commands should accept same level as both arguments, is there a bug in them?
|
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.
|
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?
|
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); 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. |
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.
|
got the level requirement working, just not the delevel exploit
|
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(). |
Thanks for the direction. I am learning as I go :)
|
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.
|
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.
|
Somehow my GM 250 character is not allowed to use the #reloadworld command lol. Any idea what that's about?
|
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.*/ |
The only command over 250 is setstat and that's set to 255
|
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. |
Do you happen to know how to close off expansions? So I can have just vanilla open for awhile then have the others unlocked later?
|
I replied to your question in your topic.
|
Train only newly aquired skills?
C0ncrete, is there a way to auto train a newly acquired skill to its minimum? I know on live they auto train your skill when you reach the level that it can be trained and the character gets a message telling them they have gained a new skill. Would this require a script for each individual skill? It is really nice not having to run back to your trainer to train a new skill only to have to run back to where you were hunting.
|
Hmm, I can't seem to find global_player.pl. I see lots of player.pl files though.
Anyone know where I can find global_player.pl? Or maybe I am supposed to create one? Thanks for your time. |
Ward, you can find it in quests/templates then you'll see 'global_player.pl'.
|
Hmm, has quests/templates been replaced by quests/globals? I reinstalled from scratch the other day, and now I can't find the templates directory under quests. I see a globals directory now under quests though. And it does have a global_player.pl listed.
The problem I am having is that I can't get the EVENT_LEVEL_UP to fire when I put it in the global_player.pl script. If I put the EVENT_LEVEL_UP inside player.pl for ecommons it works fine though. Anyone have any ideas as to what I am doing wrong? Thanks for your time. |
Yes, templates is now global. You may need to update your source to work with the new Perl changes.
|
Ahh, I see that in the change log now. Thanks for the information. I will get to updating. :)
|
Rockin. After updating, everything seems to be working. :)
Thanks for all of the help. |
Probably not the place to ask this, but it is along the lines of auto adding spells on level. Sometimes when I level, I get multiple entries for the same spell.
I can't seem to delete any spells from my spell book. If I remember right, you would right click on the spell and then press the delete button. That doesn't seem to be working for me any longer. Is there another way to delete spells? :) Thanks for your time. |
Here is what I am using to train 1 point into each skill. It unlocks the skill at the level you would normally train it by checking max skill > 0 and current skill < 1. It also gives you one point in all the generic skills even if you cant use them.
Quote:
|
Is there any way of altering this to stop at a certain level?
|
yes. check against $ulevel in a conditional.
|
I cant seem to get the auto train code to work for my server. I am using the AXClassic-PEQ Repack and have placed the code in the player.pl file and it is not working. Originally I saw the text "Your experiences across..." but nothing would happen. I am not scribing spells or maxing skills. The only skill that increases is swimming for some reason. Any help would be appreciated.
|
It will help if you post your player.pl script and where the file is located. Otherwise are you getting any errors when you load scripts? (Subscribe to errors and #reloadpl)
|
Any way to make this so that it does not train trade skills?
|
Code:
sub EVENT_LEVEL_UP { |
Ill give it a try later today thank you
|
Quote:
I just built a private local server to play on and learn how to use MQemulator. Is there still a global_player.pl file somewhere because I can't find it in my server. I went into the server folder, quests, but there is no template folder there and a search of my pc only finds a reference to global_player.pl in a SQL update and a changelog.txt Is there a way to still accomplish this on the current windows server build? Just curious because I like the idea of this! |
The 'templates' folder was renamed to 'global'.
|
Quote:
|
If you're not compiling Lua, the .lua file will not work, also, the code in this thread is Perl, so you'll have to use a global_player.pl file, which may require you deleting the global_player.lua file, as Lua has precedence.
|
How hard would this be to add to LUA?
Celestial |
Very simple, it's already enabled on the CMake by default. So unless you turn it off, it should be enabled already.
|
Quote:
Try this... (might want to test it.. lol I r bad at lua) This will train all skills except tradeskills Code:
function event_level_up(e) |
All times are GMT -4. The time now is 05:09 PM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.