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

Reply
 
Thread Tools Display Modes
  #1  
Old 10-02-2008, 08:00 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

The MonkSpecialAttack() method is called three times in the source tree. Once for the Monk Return Kick AA and once for when a monk presses the button for a special attack and it's also called once for NPC Monks but I don't think NPC's get AA's.

existing Return Kick AA in attack.cpp at the bottom of the Mob::DoRiposte() method:
Code:
			if(ReturnKickChance >= MakeRandomInt(0, 100)) {
				mlog(COMBAT__ATTACKS, "Preforming a return kick (%d percent chance)", ReturnKickChance);
				defender->MonkSpecialAttack(this, FLYING_KICK);
			}
new:
Code:
			if(ReturnKickChance >= MakeRandomInt(0, 100)) {
				mlog(COMBAT__ATTACKS, "Preforming a return kick (%d percent chance)", ReturnKickChance);
				defender->MonkSpecialAttack(this, FLYING_KICK);

				int specl = GetAA(aaTechniqueofMasterWu) * 20;
				if(specl == 100 || specl >= MakeRandomInt(0,100)) {
					defender->MonkSpecialAttack(this, FLYING_KICK);
					if(20 > MakeRandomInt(0,100)) {
						defender->MonkSpecialAttack(this, FLYING_KICK);
					}
				}
			}
existing special_attacks.cpp in Client::OPCombatAbility() method:
Code:
	case MONK: {
		ReuseTime = MonkSpecialAttack(target, ca_atk->m_skill) - 1;
		if(ReuseTime < 100) {
			//hackish... but we return a huge reuse time if this is an 
			// invalid skill, otherwise, we can safely assume it is a 
			// valid monk skill and just cast it to a SkillType
			CheckIncreaseSkill((SkillType) ca_atk->m_skill);
		}
		break;
	}
new:
Code:
	case MONK: {
		ReuseTime = MonkSpecialAttack(target, ca_atk->m_skill) - 1;

		int specl = GetAA(aaTechniqueofMasterWu) * 20;
		if(specl == 100 || specl >= MakeRandomInt(0,100)) {
			ReuseTime = MonkSpecialAttack(target, ca_atk->m_skill) - 1;
			if(20 > MakeRandomInt(0,100)) {
				ReuseTime = MonkSpecialAttack(target, ca_atk->m_skill) - 1;
			}
		}
		if(ReuseTime < 100) {
			//hackish... but we return a huge reuse time if this is an 
			// invalid skill, otherwise, we can safely assume it is a 
			// valid monk skill and just cast it to a SkillType
			CheckIncreaseSkill((SkillType) ca_atk->m_skill);
		}
		break;
	}
Reply With Quote
  #2  
Old 10-02-2008, 08:08 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

and the existing code needs to be deleted from special_attacks.cpp:
Code:
void Mob::DoSpecialAttackDamage(Mob *who, SkillType skill, sint32 max_damage, sint32 min_damage) {
	//this really should go through the same code as normal melee damage to
	//pick up all the special behavior there

	sint32 hate = max_damage;
	if(max_damage > 0) {
		who->AvoidDamage(this, max_damage);
		who->MeleeMitigation(this, max_damage, min_damage);
		ApplyMeleeDamageBonus(skill, max_damage);
		TryCriticalHit(who, skill, max_damage);
		if(max_damage != 0)
		{
			who->AddToHateList(this, hate);
		}
		else
			who->AddToHateList(this, 0);
		
		if(max_damage > 0 && GetClass() == MONK && skill != THROWING)
		{
			int specl = GetAA(aaTechniqueofMasterWu) * 20;
			if(specl == 100 || specl >= MakeRandomInt(0,100))
			{
				Attack(who);
				if(20 > MakeRandomInt(0,100))
					Attack(who);
			}
		}
	}
	who->Damage(this, max_damage, SPELL_UNKNOWN, skill, false);
	
	if(max_damage == -3)
		DoRiposte(who);	
}
new:
Code:
void Mob::DoSpecialAttackDamage(Mob *who, SkillType skill, sint32 max_damage, sint32 min_damage) {
	//this really should go through the same code as normal melee damage to
	//pick up all the special behavior there

	sint32 hate = max_damage;
	if(max_damage > 0) {
		who->AvoidDamage(this, max_damage);
		who->MeleeMitigation(this, max_damage, min_damage);
		ApplyMeleeDamageBonus(skill, max_damage);
		TryCriticalHit(who, skill, max_damage);
		if(max_damage != 0)
		{
			who->AddToHateList(this, hate);
		}
		else
			who->AddToHateList(this, 0);
	}
	who->Damage(this, max_damage, SPELL_UNKNOWN, skill, false);
	
	if(max_damage == -3)
		DoRiposte(who);	
}
Reply With Quote
  #3  
Old 10-02-2008, 08:12 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

Something I noticed in the existing aa code looks like if the monk had no ranks in this aa they would still get a chance to do the extra attacks if the random returned a 0 so change >= to just >

old code in two places now:
Code:
			int specl = GetAA(aaTechniqueofMasterWu) * 20;
			if(specl == 100 || specl >= MakeRandomInt(0,100))
new:
Code:
			int specl = GetAA(aaTechniqueofMasterWu) * 20;
			if(specl == 100 || specl > MakeRandomInt(0,100))
Reply With Quote
  #4  
Old 10-02-2008, 09:11 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

I missed this cut/paste error in the new Return Kick AA code:
Code:
int specl = GetAA(aaTechniqueofMasterWu) * 20;
should be:
Code:
int specl = defender->GetAA(aaTechniqueofMasterWu) * 20;
Reply With Quote
  #5  
Old 10-02-2008, 10:32 PM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Sorry, didn't mean to interfere with how things were being done around here. Just wanted to give a big thanks to AndMetal since I thought it was completed. Getting out of the way now =X
Reply With Quote
  #6  
Old 10-03-2008, 01:05 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Quote:
Originally Posted by So_1337 View Post
Sorry, didn't mean to interfere with how things were being done around here. Just wanted to give a big thanks to AndMetal since I thought it was completed. Getting out of the way now =X
It's all good I play a monk on Storm Haven, so I've noticed quite a bit that each time you double/triple a special attack, it's always the same amount of damage. I meant to look into it, but it sounds like Congdar's got a handle on things
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #7  
Old 10-09-2008, 05:51 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

This is in the svn now, so i guess can be unstickied? It didn't get in the return kick, cuz I guess you can't stack aa's?
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 07:09 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