Mercenaries
Since EQ is now F2P, I spent some time collecting data from Live for Mercenaries. There does not seem to be too many packets related to Mercs. Below is what I have figured out for mercenary packet structures. Hopefully I can get time to test some of this and maybe implement some basic handling for these packets, but I figured it would be good to post in case I don't get time to do that soon.
Mercenary Packet Structures: Code:
// Currently unused, but may be good to have These are the opcodes that appear to be directly Mercenary related: 0x6537 Server->Client - Some kinda merc info update. Much smaller with no merc 0x0327 Client->Server - Labelled OP_MercenaryDataResponse in EQExtractor2 (size 0) 0x2ef8 Client->Server - Request dismiss merc (size 0) 0x495d Server->Client - Some merc status update from server - Maybe response to 0x4c6c 0x1a79 Client->Server - Requesting to suspend merc 0x2528 Server->Client - Response to suspend merc 0x4c6c Client->Server - Some kind of merc status change request from client - Examples: 24 00 00 00 01 00 00 00 - Zoning in 01 00 00 00 01 00 00 00 - Dismiss merc 05 00 00 00 01 00 00 00 - Right after purchasing merc 05 00 00 00 00 00 00 00 - Setting merc to passive 05 00 00 00 01 00 00 00 - Setting merc back to balanced 00 00 00 00 ff ff ff ff - Zoning in with no merc 01 00 00 00 01 00 00 00 - Right after previous update of zoning in with no merc Using Mercenary Merchant: 0x4dd9 Client->Server - Right clicking merchant request 0x27ac Server->Client - Merc merchant response 0x3887 Server->Client - After merchant response 0x5e78 Client->Server - Request to view merc info while browsing merchant? 90 01 00 00 01 00 00 00 46 22 00 00 00 6e e4 03 0x5e78 Server->Client - Server response to 0x5e78 06 00 00 00 0x528f Server->Client - Seen after purchasing merc and when camping 0x6942 Server->Client - Response after purchasing merc - Purchase approval response? I have a ton more data than I am showing here, but I don't want to post it all until I can organize it a bit more. I will post the rest of the structs for the above lists when I have time. At least the more complex structs should be in pretty good shape from the ones I posted above. The rest are all really small (16 bytes or less). |
Quote:
|
Trev, I have a lot of this worked out for SoD and UF, with the help of Derision. We are able to display the info in the merc merchant's window, and can spawn an npc that uses the merc window, changing stances, etc. I spent a lot of time getting all of the data (I generated quite a few hundred inserts for a basic db structure for mercs for types, subtypes, stances, handling different clients, and started on inventory and spells) for the freely available mercs before free to play which further restricted to just apprentice mercs (was apprentice t1-5 and journeymen 1-2).
If you plan on working on mercs, I can send all of it to you, or if you are just getting the info out there, I can use anything you have. I was trying to get to mercs within a few weeks. I've been really busy lately though. Things have changed recently with the ability to have multiple mercs and such, but the basics should still be the same. I am on live trying to lvl up my toons to have a full group with mercs so I can continue to get spells cast as well as screenshots of equipment, etc. Let me know if there's anything you need. |
Most of the data I have is related to what I already posted. Just the basic purchasing and usage packets and structs from Live. It sounds like you guys are a lot further along than I am lol. I only really worked on it for 1 day though. I didn't know anyone else was working on it. With your recent implementation of stances, I figured it would make it that much easier to add in a merc system.
I am a bit interested in the DB work you have done for them. I didn't think it would take hundreds of entries for it. I was figuring on 1 entry per merc subtype in a new merc table that just points to an NPC ID in the npc_types table. I haven't really played Live since 2005 until now (since it went free), so I am still really new to mercs. I guess there would be a lot of variations for merc races, and multiple types and subtypes. I am not really too concerned with the DB entries, as I would probably just add somewhat customized entries anyway. I was more looking to get some basic functionality implemented that could be built upon. It sounds like you guys have already made it that far and are working on finishing stuff off. I am no where near as skilled as Derision or you when it comes to that type of thing, so I will leave it up to the 2 of you :) Maybe I can help you guys out if there is something you still need done. I am better with dissecting packets than I am with coding normally. I have quite a few characters in the 50 to 67 range, if there is something I can get with them that would be useful. I can post the rest of the smaller structs later tonight (I still have to make them) if they would be useful. I also plan to write a script to help with opcode work a bit hopefully. You should join the dev IRC channel. It might be easier to discuss and share info there. PM me if you don't know the channel name. |
Bad_captain, did you ever get anywhere with this? I am curious how close this was to being functional. Even if it is only partly functional, it might be good to get it on the SVN so the rest can be completed as time permits. I could probably put some more work in on it, but didn't want to double any efforts that have already been made.
|
i'll post the newer opcodes real soon
Code:
Listing of hired mercenaries |
Sorry I dropped the ball on this one. I have meant to get back to this, but keep finding stuff to fix in bots, and with school just starting back up, I've been pretty busy. I'm in the middle of a bot AA rewrite, then I plan on getting back to this. I know I was slowed down working on all of the packet encoding/decoding, which I know you are adept at. If I can't get something going by next weekend (hopefully I will have time to at least get it somewhat respectable), I'll shoot you a diff or something.
I have been trying to level up on live to get some better logs/collects, but it's been slow going. I've been getting screenshots though, as weapons appear to change every 5 levels (not that I think we can get all equipment correct, but it's at least a start). |
Bad_captain go grab my post of newer opcode and please update as needed thank you.
http://www.eqemulator.org/forums/sho...t=35640&page=2 |
I went through and refined, corrected, and added to the previous list of Mercenary related packet structures that I had posted. Each includes the opcode used on Live as well as the opcode name used on EQEmu currently where I could find them. I added notes for each struct to explain the packet a bit.
This should compile find on windows now, and should work for the initial changes to get mercs to be purchaseable and spawning at least. These structs are the ones used on Live as of April 12 2012, so these would go in eq_packet_structs.h. I will go through the SoD and UF clients and add the structs for those patch files as well in the next post. Right now, there are still a couple of struct issues remaining due to how the variable sized packets for the Mercenary Data has variable sized arrays within it. To prevent it from breaking anything, I just hard set the variable sized structs that are inside the already variable sized structs. This only effects a few fields, but it is something that will need to be corrected to make these packets work exactly like they do on Live. For example, the MercName, MercTypes,and Stances fields are all hard set to values that should make them functional enough for now, but ideally those should all be able to vary in size. I am not really sure of the best way to do this and still allow the data to be sent to patch .cpp files so they can be encoded accordingly for each client. Code:
// Used by MercenaryListEntry_Struct |
Here are the only struct differences for UF and SoD that I know so far based on the packets bad_captain and Derision were generating for each client:
SoD Code:
// Used by MercenaryMerchantList_Struct Code:
// Used by MercenaryMerchantList_Struct |
Trev; will mercs piggyback off any of the bot code or are they standalone?
|
I will leave that type of thing up to the bot dev people like bad_captain. I assume they will get their own merc class that is basically just a copy of the bot class, but tweaked for mercs.
|
I had a conversation about 2 years ago with Wildcard, who did a lot of the work on bots before me, and he had planned to change bots to be inherited off of mercs when they were finished. After doing a little bit of work on mercs, I'm not sure how easy or beneficial that would be, but I guess we'll see. The one real problem with bots (that won't be an issue with mercs), is the option to build without them, meaning a lot of code has to be rewritten or copied to get bots to work and still compile when they aren't enabled. Mercs should be built into the actual build so that they work a little more seamlessly than bots, even if they are less flexible.
On the other hand, with some changes on the live client, switching between multiple mercs, and editing the dbstring files, I think a lot could be done to merge the two. Incorporating the upkeep system into bots would be a benefit as well. Once mercs get closer to being viable, I think the decision will have to be made whether to keep bots as is or inherit off of mercs, but unless someone can find other advantages to doing so, I see bots remaining as is. |
Note: your comment regarding the first field in the MercenaryMerchantRequest_Struct, is I believe the Merc ID, instead of RequestType.
|
Quote:
|
Going to chime in: I think bots are a clusterfuck and if we're implementing mercs we should implement them as a new system and not shoehorn them into the gap we've made with bots(esp since they don't work 100% the same).
|
Maybe once Mercs are in, trunk drops support for bots, who are then maintained in the MercsAndBots branch. Seems like an acceptable solution to me.
|
Here are some more Mercenary related opcodes for SoD and UF:
SoD Code:
OP_MercenaryDataUpdate=0x0786 # Code:
OP_MercenaryDataUpdate=0x57f2 # Also, it looks like OP_MercenaryAssign may actually just be OP_WeaponEquip1 according to the info I can find in my last collects. It is the same size packet and seems like the same struct. If we can verify this, it is one less thing to deal with for merc stuff. Code:
// 0x7404 - OP_MercenaryAssign (Same packet as NoMercenaryHired_Struct?) [Server->Client] Code:
[OPCode: 0x7404] OP_WeaponEquip1 [Server->Client] [Size: 12] |
And here are some roughed in packet handling for mercs for client_packet.cpp. These are mostly just hard set with the basic packet responses so they can be corrected later with actual functions supporting them.
Code:
ConnectedOpcodes[OP_MercenaryCommand] = &Client::Handle_OP_MercenaryCommand; Code:
void Client::Handle_OP_MercenarySuspendRequest(const EQApplicationPacket *app) |
I think it may need some testing, but based on my VoA merc collects, I found a couple more opcodes that appear to be mercenary related:
SoD: Code:
OP_MercenaryDismiss=0x319a # Code:
OP_MercenaryDismiss=0x0bd0 # All of these new packets will probably take some playing around with to figure out which are required for what and which may not be required at all (if any). I will work on some basic handling for these as well, which can be refined later. |
I think this should be the basic handling for those 2 new opcodes:
client_packet.h Code:
void Handle_OP_MercenaryDismiss(const EQApplicationPacket *app); Code:
ConnectedOpcodes[OP_MercenaryDismiss] = &Client::Handle_OP_MercenaryDismiss; Code:
void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app) |
The last commit I did for Rev2234 is causing a zone crash when sending the mercenary merchant list. Simple fix is this:
client_packet.cpp in Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app) Replace: Code:
packetSize = sizeof(MercenaryMerchantList_Struct) - 12 + mercTypeCount * 4 + ( sizeof(MercenaryListEntry_Struct) - 40 + sizeof(MercenaryStance_Struct) * mercStanceCount ) * mercCount; Code:
packetSize = sizeof(MercenaryMerchantList_Struct) + sizeof(MercenaryListEntry_Struct) * mercCount; I don't have access to test this right now, but will check it in the morning and commit the fix. Just noting it here for anyone following the merc branch changes. |
See this is why we need automatic packet encoding/decoding even at the application level. =/
|
I did some spawn work last night. I cleaned up some code in client_packet.cpp and tried to flesh out the hiring / spawning process.
I was able to get the merc when hired added to my group. I had added some code for the merc to follow me, but it doesn't work yet. I didn't get a chance to test it out other than seeing it didn't work. I added some code for dismiss, but it didn't seem to work either. It may have been an issue with getting the merc owner, as I had a similar issue on spawning I was able to fix. I just ran out of time to test out why. My plan is to clean up the spawning process a little more, get my merc to follow me, get suspend/unsuspending & dismiss working tonight. A little more work needs to be done before being able to save the merc to the database (definitely not in the player profile). The merc templates are currently being stored in the zone, so there is duplication. It could be moved to EQSharedMem to eliminate that, but to get it up and running, that's where I put them. The shared memory stuff may be beyond my pay grade, but there's plenty of time before anyone needs to worry about it. I think it's around 150kb per zone if my math is close. If anyone has a live paid account on EQ that has mercs, I have some things I need to check on that I can't on my account. If anyone is able and willing, I'd appreciate it. |
Also, I think I have everything to put the correct stances in. Is there anything else that needs to be done besides modifying the packet size when creating it to account for the extra stances? Besides actually loading the correct stances, of course.. I'm in no hurry to add them, but wanted to check so I knew what changes would be needed. Passive and Balanced are fine for what we need to do yet.
|
Quote:
|
Quote:
If we need to increase the number of merc types or stances at some point, I think we just have to adjust the related structs in eq_packet_structs.h. |
Okay, good to know.
5 stances should be okay, I believe. I'll have to check for any that might have more. Caster has the most - Passive, Balanced, Burn, and BurnAE for sure, maybe Efficient or Aggressive (I don't have them right in front of me). Healers have Passive, Balanced, Efficient and Reactive. We will need to increase Merc Types, though. While I'm not even sure if they have any Master Mercenaries, there are a few Mercenary Merchants who have 2 races, so they will have at least 4 (6 if you include master). I was able to get mercs to follow last night, and dismiss and suspend mostly working. Also, I fixed a couple of issues that allow the illusion packet to work (purchasing mercs from Guardian Norerd in PoK who needs to be changed to be a froglok now results in a froglok merc). I still need to add the SQL to fix the mercenary merchants, but i know him and Mercenary Mdjai in Crescent Reach work. |
I apparently made a few changes before I committed that I forgot about. One is causing a crash when hiring a merc. To fix this, add the following to the Merc constructor:
Code:
p_depop = false; |
Quote:
|
Ok ya the high tier mercs t3 to t5 are the harder to get usually you have to know someone high enough to run you through the unlock quests or pay someone too run you through the quest and its not cheap from what I use to charge was about half a million plat plus also I made a mistake have the T5 mercs on my guys not the T3 like I said been awhile but just peaked at them yesterday here is the guide i used for the mercs. http://articles.eqresource.com/mercoverview.php
Also just FYI the diffrence between Tier 1 - Tier 4 and Tier 5 mercs is very huge btw the T5 mercs can solo raid targets that are outdoor zones since mercs don't work in closed raid zones example (can't do 2.5 epics with mercs since the Dreadspire Keep: Demi-Plane of Blood is indoor raid zone.) Also some other useful links for mercs sure you could find them yourself but just to help out since information is fairly scattered. These links made coming back and learning how mercs work and what they could do really easy. Everything about mercs stances/upgrades etc http://almarsguides.com/eq/general/mercenaries.cfm Bottom of page has most the race/class combos for mercs http://everquest.allakhazam.com/wiki/EQ:Mercenaries Only big things I am not sure how ya would figure out is T5 mercs obviously have AA bonuses the clerics heals amazingly and the tank merc hardly ever take a lot of damage even against raid targets so not sure if there is a way to figure that out also since merc armor auto upgrades as you level up (you can see the armor change per couple levels) not sure what armor and weapons they change to as they level up with you. I guess I could see if I took a alt and power leveled it up at what levels it changes and take pictures of it but not sure how to get the stats of the armor they are wearing or what they are wearing. |
Unless we plan to allow mercs to be given items to equip like Bots (which might be a nice option for custom servers), then the easiest solution would just be to simulate it by changing armor textures and tint. We can also set them to use specific weapon models and attack types right in the npc_types table so we don't have to give them actual weapons. Then their stats just need to be adjusted to whatever we want. Unless they get racial benefits, we could probably save some effort by making a single npc_type entry for each merc and then adjusting the race at the time it is created. Otherwise you are going to end up with thousands of entries to do what could otherwise be done with a small percentage of that.
Also, bad_captain, we will probably need to remove the 2 assign mercenary packets from the hire handling, since those are actually just used for setting weapon models. Those won't be required if we set the weapon models on the npc_type. That, or we can just send normal wearchanges or whatever. Mercs are looking pretty good so far. Since using them is optional, we could probably merge them into the trunk anytime now even though they are still being worked on. Can probably wait until at least the rest of the packet stuff is worked out I guess. I will probably leave most of the merc supporting code up to you, since you probably know what is needed better than I due to your experience with Bots. I definitely want to keep helping to make sure all of the packet stuff is worked out though. It looks like we still need to get the timer stuff working, so maybe I will work on that next. I am willing to help with more though, if you want to divvy anything out. |
I had planned to write up some stuff over the weekend, but was too busy to get to it. I started to work on stats last night and did give them an inventory, but could take it away just as easily. I would lean towards having it for customization reasons, and it allows for better code reuse from clients. But, I could be convinced otherwise. It would save the hassle of coming up with equipment sets, since they change weapons every 5 levels. They also change weapon types, as I had seen 1hs, 1hp, and 1hb all used by like level 30.
As far as race and npc_types, there is no different between races, and actually, they are all the same race (human?) with an illusion of their actual race. That is already in. I'm not sure I see the need for any entries in npc_types for a couple of reasons. First, everything needed is already in the current merc tables (most everything is dependent on class, proficiency (apprentice, journeyman) and tier). I think its very similar to pet power, which I believe was poorly implemented by having to use different records for each power for each pet. The rest just need to be handled in code based on those factors. Also, I think most fields in the npc_types table are not relevant to mercs (or at least won't vary among them) while there are also additional fields that aren't relevant to npcs but are for mercs. Once I get a bit of time to write up what's done and what's not, I will have a better idea what can easily be delegated without us tripping over one another. I don't have a problem with others working on it, as another opinion from someone who doesn't work on bots may be beneficial, since I think of how to attack problems like they are bots. A fresh perspective is definitely helpful. Once a little more work is done to handle the packets and most of the work is done that affects clients ( suspending, hiring, etc), I would feel better about merging. I don't want one of these big changes to mess anyone up. Once most of the work is just getting merc behavior correct, I say go ahead. Also regarding equipment and stats. We need to decide on a way to scale spell casting as well as melee damage, especially if we choose not to give them an inventory. For journeyman healers, there can be almost a 100% increase in healing on a rank II spell at level 85. We need to determine if that holds true across the board, or if they also receive AA like bonuses that increase with levels (my assumption). I don't think my mercs currently heal for more than the base amount (level in mid 50s) but I would have to look through my logs. |
Yeah, definitely not all fields in npc_types would be relevant for mercs. I was just thinking it would be a nice way for servers to be able to adjust merc stats so they aren't hard coded in the source. If it used npc_types, it would let servers adjust stats and min/max damage etc so you could scale them in any way you want. This would remove the issue of trying to have gear come into play for mercs. I think having a gearing option for mercs might be nice as well to make them more flexible, but it might also be nice to be able to just create them similar to creating a pet. Though, given that mercs can range to any level and there are quite a few variations of mercs, that could mean quite a few npc_types entries to do it that way.
One possibility might be to have it load the base stats, min/max damage, health/mana, regen, weapon models, and so on from the db along with maybe a scaling ratio or something right from the merc_types table with a few new fields. Just like NPCs, they could use the npc_types_tint table to load the armor colors. If material/texture was added to that table as well, it would make it easy to simulate the appearance of any armor set on live for mercs. The main argument I would have for allowing mercs to use stats over armor sets is that stats are much easier to tweak than armor sets are. It seems pretty clear to me that mercs on Live don't reflect exactly what a character of the same class type (such as warrior compared to merc tank) is capable of. I leveled a trio on Live recently from 1 to 60 and had a tank merc that is able to well out tank my warrior that is fairly well geared for his level now. I don't know if it is just that his mitigation is higher or if he just has a ton more HPs, but he probably tanks 2 or 3 times as well as my warrior does. Unless he is geared far beyond the standard gear for that level, I assume Live uses different base stats and/or formulas for mercs from what player characters use. I am sure there is more solid data out there somewhere from the crazy number crunchers, but I haven't done enough research to find it yet. It could just be that mercs on Live are wearing the same armor set until they reach the higher levels or maybe only the higher tier mercs. If the set has a recommended level on it, maybe the armor just scales as the merc levels, which makes sense for simplifying the process. If that is the case, armor sets might not be a bad option and then we would just need to adjust the weapons that are used, which is much less work. I am guessing we would have to add support to make sure gear scales to level for recommended level gear that mercs are wearing. You are probably right that AAs are used to increase spell effects. I don't think it would be hard to get that working for mercs. The other possibility would be if they use focus effects on gear they wear. If using the same armor set as they level as mentioned above, the focus effects wouldn't kick in until they reached the recommended level I think. I wasn't aware that they are all a single race with an illusion cast on them. That should simplify things a bit as far as DB entries go. |
Just create a mercs table to store stats. A lot of the npc_types info is completely useless to mercs and it sucks having to give up valuable npc type ids.
|
That seems like a good idea to just maintain it all in a new table. I think it will be important to decide how to scale the stats based on level. Tier also must affect stats since otherwise, why get the highest tier tank, when the lower tier and cheaper one would work almost as well.
With regards to equipment, just for testing, I had planned to give them the defiant gear for their level, with it changing every 20 levels or so. Weapons are a different story, but they are already in with pretty easy to determine effective level ranges. But, that also adds in another level of complexity. But, then we still need to figure out a way to give the mercs bonuses. Also, Trevius, I think a lot of the merc tank's ability to tank is its regen. I can't remember the exact numbers, but I know at least at lower levels, they would regen more than 10% (I think closer to 15%) of their hps every tick. They could easily tank 3-4 even con mobs at least through level 30-35 or so without a heal. |
Below is a first attempt at breaking up the remaining work to be done for mercs. Some of the areas are very broad, but will get refined once work is done on them or in other areas. I have done some work on stats, but until the exact method of giving mercs stats and skills is decided, a lot of the other areas can't be worked on (such as combat). I will try to update this as work is done and further clarify the remaining items to do.
Packets Merc Merchant List- send correct stances instead of hard coded ones Merc Hire- check if client has enough coin, deduct purchase cost from client Timer- send response packet, check if client has enough coin, if so- deduct upkeep from client; if not- dismiss merc Merc Command- zone, change stance, etc Remove most if not all of the hard coded values left Finish extracting packet sending functions Stats NPC style stats or equipment based? Weapons or Max/Min hit? Stats db table Skills stored in db table? if using equipment, need equipment lists stat scaling based on lvl, proficiency, tier Spells Spell & Skill lists per lvl & proficiency Combat Melee Attacks Spell Casting AI based on proximity Group Roles Flee based on confidence & situation Out of Combat Buffs Resurrections Misc Save merc to DB |
I may be tired and not thinking correctly, but was trying to figure out the upkeep part. I looked at a log I did in December on live, and was watching for when I had my upkeep deducted. Here are the only unknown packets arriving at that time. Note: I was charged the upkeep just before I said 'Upkeep' as shown in the last packet. I was charged 1 platinum, 9 gold. I'm having trouble getting 1 platinum, 9 gold out of that, as well as matching it up with one of the existing structs. Am I missing something?
Code:
12/8/2011 9:02:45 PM |
Are there any AA or faction type mods that might change the amount you're charged?
|
Quote:
Code:
12/8/2011 9:02:45 PM Code:
12/8/2011 9:02:45 PM Mind you thats really just a guess. |
All times are GMT -4. The time now is 03:52 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.