Here is code (DIFFs) to add mob melee procs
I've added in code to allow mobs to have melee procs...I'm sure it could be improved.. mainly the chance formula probably sucks, so i'm open to improvements.
The big problem I see here, is that currently in the emu it appears every mob always has a DEX of 75. IMHO, the npc_types DB should be expanded to allow stats to be set. The following info should give you everythign needed to add this change.. You need to recompile both the shared dll and the zone server. You also need to make a small DB addition. To add this code: 1) You will need to modify your npc_types table to add a new column: "mysql.exe" "use eq;" "ALTER TABLE npc_types ADD npcproc int(7);" 2) DIFFs for changed files: zone/attack.cpp Code:
779d778 Code:
2257c2257 Code:
115a116 Code:
88a89,90 Code:
89a90 "mysql" "use eq;" "UPDATE npc_types SET npcproc=901 WHERE id=5509;" The abopve example, would give the proc 901 (GhoulRoot) to the npc_type identified by ID 5509, which is "a_ghoul" If anyone has suggestions on improving the proc formula, once again i'd be glad to hear it. I know it can be improved. Hopefully I haven't left anythign out here that you need, but if I did let me know and I will edit the message. This is tested on my server and it does work. Although since every mob right now has a DEX of 75, the chance of proc is low.. 25% I think it comes out too... In a (short) fight with a ghoul, I got rooted once. |
Damn good addition...
I can tell you've coded professionally, you actually commented your code.. LOL... |
Nice addition. :)
Suggest you make myDEX bigger than int8 though, dex is a int16 value. |
Quote:
That code SHOULD be commented more, but I plan to do some revamping so I wastn' too worried aout it. Thanks for the "comments" though :p |
Quote:
The issue of the NPC stats needs to be looked at though. Currently they are all hardcoded to 75, and no way to change them. Ideally, the stats, and AC, should be added as new columns in the npc_types database. Thats how they are in the real EQ database IIRC. (Not positive, because to be honest 99% of the time we would just copy a record from a similiar mob and alter it as needed.. I do'nt think I ever once set stats on a mob while I worked there lol). |
Do weapons proc at the moment, for either PC or NPC?
If not, I think I will pull this out into its own function, and put tie ins so that PC and PC used weapons will also proc. |
PC weapons proc, npcs should too
|
Ok great.. then I won't worry about that part.
|
Can NPC's even equip weapons?
|
yes.
NPCs drop weapons, and 90% of the time they are wielding it. Example: In Highpass Hold there is a gnoll that drops an axe that has a buff proc, while fighting him there is a chance that he will proc it. But a lot of NPCs have weapons that are in their model.. like some of the PoP gods. |
It appears I can't give a weapon to an NPC though and have them equip it.
I just sumoned up a pet and gave it a weapon.. it never equipped it. I'm diggig through the code now trying to find the trade stuff to see if I can iron it out. |
I meant in EQemu. i haven't seen any code for NPC inventories.
|
Curious, considering pets arent NPCs in the database, how does your code manage their procs?
|
Cool :D
|
Quote:
|
If you look in the MakePet function in spells.cpp I setup a way for the mage epic to cast its spells, its under a switch, if you look above that function, thats where all the pets are you can set a "type" and define it in MakePet, for example:
MakePet(((int)(3 + ((tmp-2) * 3.5) + (rand()%3))), 0, 75, 2, 0, 4 + (((float)(tmp - 2) / 14) * 3),8); //Notice the 8 at the end? thats the type then under the ::MakePet function in the switch add case 8: //Setup whatever for that special pet { //bleh break; } Just an idea for you, sorry if its not clear enough |
Yeah, I saw all the pet stuff in there, but it only worked for Mages, and used the old random levels code.
I am expanding it to work for all pets, and I want it to me easily modifiable via the DB to keep it tweaked, rather than hard coding them. Just personal preferance maybe. Besides, as was earlier commented before.. Marking an NPC to cats "x spells", is not the same as giving them a proc. |
It was to avoid RAND_MAX and floats which dont help the processor too much :) While trying to duplicate EQ we have to realize that our resources are limited compared to them.
|
Actually, that depends on the person running the server doesn't it?
Besides.. RAND_MAX is a constant, so i'm not sure what you are talking about.. Can you enlighten me? A rand() call doesn't take much in the way of performance either. |
All times are GMT -4. The time now is 02:50 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.