View Full Version : Raise max level via quest
tulsplat
10-28-2011, 12:55 PM
I've been searching for a way to disable xp gain at certain levels before unlocking a quest, and I saw "Level cap raised to (77) via quest" on the news page for Storm Haven. That sounds like what I want, does anyone know how to do this, or anyone from SH willing to share what you did?
The only thing I have thought of is hooking into EVENT_KILLED_MERIT or EVENT_LEVEL to decrease their xp if criteria are not met, but would prefer a cleaner method.
Thanks!
trevius
10-28-2011, 02:03 PM
On Storm Haven, our max experience level is 70, but you can get up to 77 max. From 71 to 75 there are 2 routes. One is simply getting some drops and turning them in to complete a quests for each level and it just uses quest::level() to set their level higher (very simple). The 75 to 77 levels are similar where you get drops instead of experience and ultimately turn something in to increase your level.
The other way we do it is an alternate way for the 71-75 levels. This one is just normal experience leveling, but you can only gain normal 71-75 experience in these specific zones made for it. The system for this is a bit more complicated. Basically, I setup 5 zones, and each zone is set to use its own rule set in the zones table. Each zone's rulesets just have their own MaxExpLevel setting for the rule. Since individual zones can load custom rule settings now, it allows this to work.
The complicated part of using the normal experience is that you then have to track their experience earned in these zones so they can't leave and get all experience needed for the level in another (easier) zone and then come back just to ding.
In your case, you could require them to complete a quest to be able to access a higher max level zone.
Another way might be to just set the zone experience multiplier to 0, and just reward experience from EVENT_KILLED_MERIT like you said. You could check their experience each time they kill something and if they have completed a quest requirement and also have their experience bar full when they get a kill, it would just ding them to the next level. Would be pretty easy if you use default.pl. Though you would have to set it up in each zone you wanted them to be able to level in (at least if you plan to have a fair amount of scripted NPCs for other stuff).
tulsplat
10-28-2011, 02:51 PM
Since individual zones can load custom rule settings now, it allows this to work.
..wow I had no idea about this. That sounds like I can make that work for what I want, and also..wow there's a lot of neat stuff you could do with per-zone rulesets aren't there? :)
Thanks so much Trev!
tulsplat
11-24-2011, 11:55 PM
A follow up...
How do you make a zone load a custom rule set? What I tried:
I added a row to rule_sets with ID 1 and a name, cloned the default rows in rule_values using 1 as the ruleset_id for the copy, and modified maxlevel in the copy. Then I set ruleset_id to be 1 in the zone table for the zones I wanted.
However, after restarting the server and going to the modified zones, #rules current still shows it using the default rule set. I can #rules load <name> and that works, but when the zone starts up on its own it reverts to the default.
what am I missing?
trevius
11-25-2011, 02:31 AM
Hmm, sounds like you did everything correct if I am reading your post correctly. I haven't actually checked my zones that use custom rulesets using the #rules command to see what they display, but I know they do work with my custom rules.
I don't think it was actually intended originally, but making a custom ruleset with only 1 or a couple differences is pretty easy. Apparently, a zone will still load the default ruleset that the server is set to, and then load the custom ruleset on top of that. So, if your default for the server is ruleset 0, it would load all of those rules, and if your current zone is set to use ruleset 1, it will then load the ones set as ruleset 1. What this means is that you should only have to add the rule or rules that you are changing from your default into your rule_values table. So, if you only want to change MaxLevel, you can just add that one with id of 1, and set your zone to 1 and you don't need to copy all of your other rules over and have duplicates of tons of rules that you don't actually need.
I would suggest testing it out a bit to see if it works or not even though #rules appears to still show the default ruleset at first. Try a rule that is easy to test with like an Exp multiplier rule or something.
tulsplat
11-25-2011, 12:17 PM
I was wondering if I needed to copy them all, and figured better safe than sorry. I removed the extra rules from my custom set, keeping just the MaxLevel one.
It isn't working properly though. When the zone loads, I can go there and #setxp and it won't ding me past the default max level. If I #rules switch <custom> and then try it, #setxp can take me past the next level. I also tried with a non-GM character at max level, and had him kill some blues in the custom zone...and his experience was capped at the default max level.
I'm gonna have to dig into it some more, unless you or anyone has other suggestions. I may force an ugly workaround with the default player.pl until I can get it figured out.
Thanks for the response, at least it isn't something obvious that I missed.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.