Go Back   EQEmulator Home > EQEmulator Forums > Development > Development: Custom Code

Development: Custom Code This is for code thatdoes not emulate live and wont be added to the official code.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-05-2008, 01:02 PM
zeiksz2
Fire Beetle
 
Join Date: Oct 2007
Posts: 20
Default custom NPC melee

i never liked 500+ hitting mobs, but not even fluffy darkpaw who could smash my face without having a weapon for 20+ what i barely could manage with a tarnished two handed sword.. well.. first time in my eq life i can take revenge on these fippies

the following code part goes into attack.cpp, our target is the npc::attack

Code:
		if((max_dmg+eleBane) != 0 && damage > (max_dmg+eleBane)) {
			mlog(COMBAT__DAMAGE, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane));
		    damage = (max_dmg+eleBane);
		}

******* above is just for finding the place.. start is here *******
		//this goes only for pets
		if (this->GetOwnerID())
		{
			//this applies only for h2h, so that is not so low dam
			if (skillinuse==HAND_TO_HAND)
			{
				damage=mylevel/20;
			}
			//formula is after player formula
			//no "weapon skill" is counted, instead we say level * 10, saying "max weapon skill" with that
			damage=MakeRandomInt(1,(weapon_damage * ((GetSTR()*20) + (GetSkill(OFFENSE)*15) + (mylevel*10)) / 1000)+eleBane);
		}
******* code ends here *****

		//THIS IS WHERE WE CHECK TO SEE IF WE HIT:
		if(other->IsClient() && other->CastToClient()->IsSitting()) {
			mlog(COMBAT__DAMAGE, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane));
			damage = (max_dmg+eleBane);
		} else {
so.. all we do is putting the melee formula of client into npc.. this above goes only for pets by default (so you will have to put weapon in their hands). if you want to apply it for all the NPCs then remove the first "if". if you want to leave them on poor hand-to-hand melee then comment the second "if" out as well. this second makes sure to improve the "damage" if mob is fighting with hand to hand.. so previously quad150ing guards will not start quad1punching you just because you gave them no rusty weapon

todo: check if the creature is humanoid.. creatures biting actually do not need weapon - wont do it at 2am..
Reply With Quote
 


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 11:02 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3