PDA

View Full Version : Quest XP multiplier


Rhodan
09-30-2011, 11:11 AM
I was thinking of making my server a bit more WOW like in that questing would give a LOT more experience and people would have an alternative to simply grinding. However, I see the quests are done in perl and have hard coded experience amounts. That usually means modifying each quest file individually to change the XP.

I'm wondering though.... Is the perl exp() function seperate from other methods of adding experience to a character? could a seperate XP modifier be put into the database that affects quest awards only?

Just thinkin'

ChaosSlayerZ
09-30-2011, 11:51 AM
From what I tested, it seems that XP modifier in DB applies to quest as well.
Anything can be coded in, if you know some C ;)

A little off topic, but, in order to achieve the questing level of wow, you will have to put in HUNDREDS of new quests anyway, so modifying XP of existing quests is rather moot point.
Not to mention all EQ xp quests really sucked anyway - give npc 4 bat wings - what kind of quest is that?

Rhodan
09-30-2011, 02:15 PM
I don't think it'd need more quests as there are already a huge number of quests in EQ. Problem was the rewards for questing in EQ were so pitiful that it was rarely worth doing any of them (except for faction or epics).

Early on (like beta 3 early) I tried questing for a while and got some useful items (bearskin boots at lvl14 that let me kick wisps! lol, nobody had magic weapons then) but I found all I really did was get a few mediocre items while falling far behind others in levels.

I never really minded the EQ quest styles and compared to some of the WOW, DAOC, and a few other MMOs the EQ ones weren't all that bad. Just need better rewards for the time and effort spent.

Anyway, I have/can program in C to a (very) limited degree. WHat I was asking is if the point in the server where XP from killing is received mobs is different from the point where XP from questing is added. If it is then it shouldn't be too much trouble to add a modifier to quest XP and add a variable rule value to the database.

Tabasco
09-30-2011, 02:38 PM
In zone/perl_client.cpp
XS(XS_Client_AddEXP)

You could just put something in there like add_exp *= 10 or whatever mutliplier.
Also in zone/perlparser.cpp
XS(XS__exp)

amt *= <multiplier>

Those exp function should only be called from quest scripts.

joligario
09-30-2011, 03:20 PM
I think he wants to keep the killing xp different than the quested xp. If that's the case, just modify the quest files to give more experience.

Edit: Oh yeah, that would work. Sorry, tired.

Rhodan
09-30-2011, 08:03 PM
In zone/perl_client.cpp
XS(XS_Client_AddEXP)

You could just put something in there like add_exp *= 10 or whatever mutliplier.
Also in zone/perlparser.cpp
XS(XS__exp)

amt *= <multiplier>

Those exp function should only be called from quest scripts.

So those two are seperate? I did find quite a bit of experience code but I couldn't tell if it was called by perl as well as by killing mobs.

In the quest scripts it has quest::exp(). I really don't know much at all about C++ and microsoft ways of doing things and I can't figure out what the "::" is about. Is that a sort of casting or a way to show where the function is coming from?

How would I figure out what area of code to look in? There must be someplace where the compiler is told that quest::exp() goes to XS(XS_EXP). If I can figure out how to search for things then I'd have a lot less need to bug you folks 8)

Tabasco
09-30-2011, 09:08 PM
In perl you have quest::exp() and $client->AddExp(). The :: is a separator indicating that exp() is part of quest and the other is calling the AddExp() method of a client object. That's all perl though.
The cpp files referenced above are used to connect a call from perl to a function or method in C++. Those two functions should only be called from within a quest script and would thus leave normal experience gain alone.
If you look at those files and locate the appropriate functions you should be able to identify the area in question as they are small and mostly error checking.
You just add one line of code per function that multiplies the requested experience by your desired multiplier and recompile.

Rhodan
10-01-2011, 09:42 AM
Yeah I can see it'll be easy to change the code to give a bonus to quest XP. I can also see a rule function that appears to retrieve rule values so I can put the quest multuplier in rule_values instead of recompiling to change the multiplier. Hmm, RuleB() and RuleI()? Have to look at those.

However, what I'd really like to know is how to find the owner of a function. quest::exp() for example, how would I find where this is? I searched the entire solution and although I did find the sources mentioned above I saw no obvious connection between the perl calls and the C++ code.

searching for "quest::" or "::exp" doesn't work. Searching for "quest" returns the entire source code almost. There's got to be a simply way to track down the C source for the exp() perl calls.

I ask this not to find the perl experience calls because that's already been told to me. I want to know for future use in areas I haven't contemplated working on.

Thanks for the help!

joligario
10-01-2011, 11:22 AM
zone\questmgr.cpp line 614 shows QuestManager::exp(int amt) which is called by zone\perlparser.cpp block starting at line 769

trevius
10-02-2011, 11:00 PM
Well, it would mean editing all quests manually, but I made a function a while back that makes adding useful amounts of XP for quests easy.

AddLevelBasedExp(exp_percentage, max_level=0)

So, if you want your quest to reward 10% experience up to level 15, you could just do this:

$client->AddLevelBasedExp(10, 15);

In this example, anyone from level 1 to level 15 that completed this quest would get 10% of their level worth of experience. Anyone level 16 or higher would just get the same amount of experience that a level 15 would have gotten. So, for a level 16, they still might get 8% or so, but as your level increases, that particular quest would have lesser returns. This means you can easily make quests that scale up to a certain level range they are intended for. At the same time, they cannot be abused to gain easy experience once you are far above the intended level range.

This command isn't very useful for rewarding AA experience, but it is very nice for normal leveling experience. Instead of having to know the amounts of experience required for every level and then having to do math to figure out the amount you want them to have, you can do it all very quickly and easily with this function.

Also, for people that aren't aware, there is a similar feature built into the tasks system. You can set the experience reward in tasks to a negative value, which then gets used to do experience scaling like the command above. Level based experience percentage rewards for tasks can be set using a negative value of the max level * 100 + experience percent (IE. -510 for 10% exp up to level 5).

More details on the task settings for it can be found at the link below in the xpreward field details:

http://www.eqemulator.net/wiki/wikka.php?wakka=TaskSystemDBTables