Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bots

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #16  
Old 02-11-2010, 02:07 PM
iRFNA
Fire Beetle
 
Join Date: Dec 2009
Posts: 23
Default

Well, I think I found the problem. There's a check for seeing if a particular spell is a nuke spell in spdat.cpp called IsPureNukeSpell. While it does check to see if the spell alters a target's HP, it neglects to see if that is a positive or negative change. On around line 355, I changed:

Code:
	return
	(
		spells[spell_id].effectid[0] == SE_CurrentHP &&
		effect_count == 1
	);
to

Code:
	return
	(
		spells[spell_id].effectid[0] == SE_CurrentHP &&
		spells[spell_id].base[0] < 0 &&
		effect_count == 1
	);
and I haven't seen my bots healing enemies anymore.
Reply With Quote
  #17  
Old 02-11-2010, 07:01 PM
Rykeau
Fire Beetle
 
Join Date: Jan 2010
Posts: 27
Default

iRFNA -

Since I'm a noob and still learning how all this works, what would I need to do to implement your change into my server? I am assuming it's simply more than modifying the CPP file.
Reply With Quote
  #18  
Old 02-12-2010, 06:20 PM
iRFNA
Fire Beetle
 
Join Date: Dec 2009
Posts: 23
Default

Quote:
Originally Posted by pfyon View Post
Short answer, no it is not much more than modifying the .cpp file. You just have to change it and recompile.
Oh god, this turned into a lot of text. I'm sorry.

I'm not sure what all you have, so here's the basics. Obviously, skip everything you already have!

First, you need Visual C++ 2008 Express. This is for compiling the source code (including .cpp files).

While it's downloading, get the other stuff too. You'll need to get the source from SVN, and the typical SVN client is TortoiseSVN.

With TortoiseSVN installed, you'll want to make a new folder, right-click it, and click "SVN Checkout...". Set the URL of the repository to "http://projecteqemu.googlecode.com/svn/trunk/EQEmuServer" (without quotes), make sure the checkout directory is set to the one you right-clicked, and hit ok. It'll download lots of stuff, this is all the up to date source code and such.

When it's done and you have VC++ 2008 express installed, double-click the Server.sln file in the folder you checked out into. It'll open the solution for the entire emulator's code. Click the + next to Zone in the left panel, this will open up the tree for the Zone project, which compiles to Zone.exe and does pretty much all of the in-game emulation stuff. Open the "Source Files" folder with another click of a +, and scroll down until you find "spdat.cpp". You'll want to make my changes as I've suggested, by double-clicking the file so it appears in the main window. You should see line numbers, so just follow my post instructions and use a little copy and pasting.

At the top area in a toolbar, there should be a drop-down box that says something like "Debug", "DebugBots", "Release", or "ReleaseBots". You'll want to set it to "ReleaseBots". If there isn't a toolbar for it, go into the Build menu at the top and click "Configuration manager...". The top left dropdown box should be like the one I described, so set it to ReleaseBots if it isn't already and hit ok.

Now go back to that left panel where it says "Zone" that you clicked the + to early on. This part might be a bit annoying. We've gotta link up the directories for various dependencies that are required for Zone to compile. Right-click Zone and click Properties way at the bottom. Now, to run the server you've already got perl and mysql installed, so those directories just need to get linked to. Under "Configuration Properties" -> "C/C++" -> "General" in the left panel, select "Additional Include Directories" in the right panel. A little "..." button should (?) appear with your version on the far right side of that list, so click it. If not, I guess you get to type into the text box. I'm guessing that place-holder directories are already there, but they may not be. If they are, you'll see something that goes to "...\some perl folder\lib\core". You'll want to change that "...\some perl folder\" part to your perl directory, and I'm pretty sure you'll have lib\core in it. So set it to that. Same for the mysql part, you want it to go to "...\MySQL Server x.x\include". If you don't have these 2 things, add them in but with your directories for those 2 things. Hit ok if you're in that box and get out of there.

Now you need to get into "Configuration Properties" -> "Linker" -> "General" and find "Additional Library Directories" on the right. Again, there may or may not be placeholders, I dunno, but what you need to add/edit are 2 directories for perl and mysql again. It's "...\your perl folder\lib\core" and "...\MySQL Server x.x\lib\opt" that you need. Click ok for that whole properties dialog; you're out of there!

Finally, you just need to do one more annoying step... You need to get zlib. Personally, I grabbed it from here. Extract that into your Common folder at the root of your SVN repository, so the Common folder is in the same folder as Server.sln and the zone folder, among others. I was getting pretty bored with setting stuff up at this point, so I just copied the files out of the extracted "include" and "lib" folders from zlib123-dll.zip and put them directly inside the Common folder (overwriting, without errors, zlib.h, I think). You'll need these files directly inside your Common folder for compiling to work, too. I think you need zlib1.dll there too, but I don't remember. I was sort of throwing files at things at this point.

Ok, the awful part is over if you've survived this far. Now cross your fingers, it's time to compile!

Find that nasty "Zone" in the left panel of VC++ again, it's time to show it who's boss. Right-click it, go into "Project Only", and click "Build Only Zone". It'll start spamming stuff at the bottom with hopefully no errors! Eventually it should say it is done. Your shiny new Zone.exe will be in the Build folder, which is in the same folder as Server.sln. Shut down your server if it is running and over-write your current Zone.exe wherever your server is (or back it up if you're extra-cautious, but it shouldn't be a prob). You're good to go.

If it says you're missing files, post that stuff here and I'll (or someone actually involved in the project will) sort it out, I probably forgot about things. There shouldn't be actual errors in the code, but who knows, it's always an adventure.

Once this is all working properly, you can right-click that folder you checked out into and click "SVN Update" whenever you feel like it, and it'll update the folder to the latest version of the emu. Then you can go and recompile things if they get changed instead of waiting for the occasional pre-compiled releases. It's worth it.

Last edited by iRFNA; 02-12-2010 at 07:08 PM.. Reason: fixed things?
Reply With Quote
  #19  
Old 02-12-2010, 06:58 PM
pfyon's Avatar
pfyon
Discordant
 
Join Date: Mar 2009
Location: Ottawa
Posts: 495
Default

Quote:
Originally Posted by Rykeau View Post
iRFNA -

Since I'm a noob and still learning how all this works, what would I need to do to implement your change into my server? I am assuming it's simply more than modifying the CPP file.
Short answer, no it is not much more than modifying the .cpp file. You just have to change it and recompile.
Reply With Quote
  #20  
Old 02-16-2010, 12:56 AM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

Quote:
Originally Posted by iRFNA View Post
Well, I think I found the problem. There's a check for seeing if a particular spell is a nuke spell in spdat.cpp called IsPureNukeSpell. While it does check to see if the spell alters a target's HP, it neglects to see if that is a positive or negative change. On around line 355, I changed:

Code:
	return
	(
		spells[spell_id].effectid[0] == SE_CurrentHP &&
		effect_count == 1
	);
to

Code:
	return
	(
		spells[spell_id].effectid[0] == SE_CurrentHP &&
		spells[spell_id].base[0] < 0 &&
		effect_count == 1
	);
and I haven't seen my bots healing enemies anymore.
Committed to rev 1255. Thanks iRFNA!
Reply With Quote
  #21  
Old 02-23-2010, 05:36 PM
Rykeau
Fire Beetle
 
Join Date: Jan 2010
Posts: 27
Default

Sorry for the delay in responding - thanks all for the great responses. I appreciate it!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:14 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3