View Single Post
  #3  
Old 05-12-2010, 10:46 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

It is really quite simple, but you will want to know at least a bit of C++ to be able to do it right. Basically, you can look for an existing function that might do something similar to what you are planning to do, and then see how that one was added and normally add the new one in almost the exact same way.

To see what is required for adding quest objects or quest commands, simply look at the changelog here and find one that only mentions adding some new quest object/command:
http://code.google.com/p/projecteqemu/source/list

Here is a simple one I recently added:
http://code.google.com/p/projecteqem.../detail?r=1441

Then, once you find your example, you can click the "Diff" link at the end of each file name one at a time and inspect exactly what was changed/added. Here is a link to the diff of the file from the example link above:
http://code.google.com/p/projecteqem...e/perl_mob.cpp

In this case, you see the first part of the change starting after line 1482. Then, if you scroll down to the bottom, that is where the second part of the change is.

There are a few different files that you might need to change depending on what command you are adding. I don't think bots have their own perl_bot.cpp file yet, which I am guessing is why there aren't perl commands for them yet. I haven't messed with bots at all, but maybe some of their commands would work in perl_mob.cpp, I dunno. You may be able to add commands for them in the questmgr.cpp/questmgr.h/perlparser.cpp files similar to the diff posted in this thread:
http://www.eqemulator.org/forums/showthread.php?t=31286

I have learned C++ purely from examples, and the quest stuff is fairly easy to figure out once you read through a few examples to see what is going on. A full guide on how to write them isn't likely to happen, as you might as well be taking a full C++ course if you want everything to be covered. Most of the stuff is the same, but there are a few key points you need to know when adding new quest commands. Honestly, I don't even fully understand every bit of it, but I know enough to make them work just fine the way they should and do it with relative ease now.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote