EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Technique of Master Wu AA (https://www.eqemulator.org/forums/showthread.php?t=26160)

AndMetal 09-13-2008 05:46 AM

Technique of Master Wu AA
 
It looks like support for this was added in a few weeks ago, however, it looks like there's a slight issue: if the check is successful, it adds another regular attack instead of the special attack used. Here's the current code:
Code:

  80                if(max_damage > 0 && GetClass() == MONK && skill != THROWING)
  81                {
  82                        int specl = GetAA(aaTechniqueofMasterWu) * 20;
  83                        if(specl == 100 || specl >= MakeRandomInt(0,100))
  84                        {
  85                                Attack(who);
  86                                if(20 > MakeRandomInt(0,100))
  87                                        Attack(who);
  88                        }
  89                }

If it's changed to this:
Code:

        if(max_damage > 0 && GetClass() == MONK && skill != THROWING)
        {
                int specl = GetAA(aaTechniqueofMasterWu) * 20;
                if(specl == 100 || specl >= MakeRandomInt(0,100))
                {
                        who->Damage(this, max_damage, SPELL_UNKNOWN, skill, false);
                        if(20 > MakeRandomInt(0,100))
                                who->Damage(this, max_damage, SPELL_UNKNOWN, skill, false);
                }
        }

that should trigger the additional 1-2 special attacks (flying kick, etc).

So_1337 09-26-2008 08:52 PM

Had a pair of monks both mention this lately; I remember it being implemented awhile back, but never heard past that. Didn't even realize it was broken until they'd said so. Great work, hope this makes it in soon =)

So_1337 10-02-2008 04:18 PM

I see this stickied still, but I'm getting reports from our monks saying it's working perfectly for them. Did this go in with one of the recent revisions? Running revision 27.

Derision 10-02-2008 04:34 PM

Quote:

Originally Posted by So_1337 (Post 157536)
I see this stickied still, but I'm getting reports from our monks saying it's working perfectly for them. Did this go in with one of the recent revisions? Running revision 27.

Looking at the ChangeLog, Cavedude incorporated this into Revision 2 on 25th September.

So_1337 10-02-2008 04:56 PM

Sorry. I'm blind, I guess. Thanks for the spare set of eyes, Derision.

In any case, it's working and getting great feedback, so great work AndMetal =)

/unsticky =P

cavedude 10-02-2008 05:58 PM

The stickies are handled by KLS to aid in getting the code into the official CVS.

KLS 10-02-2008 06:33 PM

It wasn't meant to go in because it doesn't handle both versions of AC correctly. Apparently we don't even consider such things anymore though.

Edit: Wow that sounded a lot more emo than I meant it too. Anyway I'd like to fix it for the old system. Are the hits supposed to be affected by melee avoidance or are they a guaranteed thing?

Congdar 10-02-2008 07:27 PM

This aa may need to be moved outside this method so that the second and possibly third stike 'with the special attack' can be properly calculated. this just adds 2 new attacks with the main hand. not special attack 'strikes'

Congdar 10-02-2008 07:35 PM

Technique of Master Wu
This is a passive ability; it does not need to be activated.
You may train 1 rank at each of the following levels: 61, 62, 63, 64, 65
Requirements: No previous ability requirements.

Under the tutelage of Wu, Monks are able to hone their skills to the point of being able to execute a second and sometimes even third strike when scoring a hit with their special attacks. This ability grants a 20 percent increase in the chance of scoring multiple special attacks, per rank.


Changing Attack to Damage just adds the same damage done by this special attack twice, maybe three times. Extra 'strikes' should be new 'strikes'.

KLS 10-02-2008 07:49 PM

Should be a fairly simple implementation.

Congdar 10-02-2008 08:00 PM

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;
        }


Congdar 10-02-2008 08:08 PM

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);       
}


Congdar 10-02-2008 08:12 PM

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))


Congdar 10-02-2008 09:11 PM

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;

So_1337 10-02-2008 10:32 PM

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


All times are GMT -4. The time now is 09:50 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.