Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 10-18-2008, 02:13 AM
seveianrex
Sarnak
 
Join Date: Sep 2008
Location: asdf
Posts: 60
Default Slay Undead Fix

{attack.cpp}

~2631, right after the definition of Mob::TryCriticalHit, add:

Code:
	bool slayUndeadCrit = false;
A few lines down, find the following:

Code:
	if(defender && defender->GetBodyType() == BT_Undead || defender->GetBodyType() == BT_SummonedUndead || defender->GetBodyType() == BT_Vampire){
		switch(GetAA(aaSlayUndead)){
			case 1:
				critMod += 33;
				break;
			case 2:
				critMod += 66;
				break;
			case 3:
				critMod += 100;
				break;
		}
	}
And add the following immediately after the switch close bracket:

Code:
		slayUndeadCrit = true;
Then, a few more lines down find the following:

Code:
	if(critChance > 0){
		if(MakeRandomFloat(0, 1) <= critChance)
		{
And add immediately below:

Code:
			if (slayUndeadCrit)
			{
				damage = (damage * (critMod * 1.65)) / 100;
				entity_list.MessageClose(this, false, 200, MT_CritMelee, "%s cleanses %s target!(%d)", GetCleanName(), this->GetGender() == 0 ? "his" : "her", damage);
				return;
			}
Reply With Quote
  #2  
Old 10-18-2008, 02:18 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Just to clarify, by "And add the following immediately after the switch close bracket:" I assume you mean in between the two brackets you have in the snippet? The first closing bracket is the switch bracket, the second belongs to the if statement above it.
Reply With Quote
  #3  
Old 10-18-2008, 03:11 PM
seveianrex
Sarnak
 
Join Date: Sep 2008
Location: asdf
Posts: 60
Default

For clarity's sake, the end result should look like this:

Code:
	if(defender && defender->GetBodyType() == BT_Undead || defender->GetBodyType() == BT_SummonedUndead || defender->GetBodyType() == BT_Vampire){
		switch(GetAA(aaSlayUndead)){
			case 1:
				critMod += 33;
				break;
			case 2:
				critMod += 66;
				break;
			case 3:
				critMod += 100;
				break;
		}
		slayUndeadCrit = true;
	}
Reply With Quote
  #4  
Old 10-18-2008, 03:34 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Good, we're on the same page
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 09:52 AM.


 

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