Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 13:25

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Monk: Triple Attack Bug

Discussion on Monk: Triple Attack Bug within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2007
Posts: 9
Received Thanks: 0
Monk: Triple Attack Bug

I'm having issues with this Monk skill, when it attacks a Monster, whatever the drop is.. It gets it x2 or 4. And when you Kill another player and triple attack goes off. It show's you killed the player 4 times..

Any ideas? Thanks


Here is the Code:
Code:
 #region TripleAttack
                                case 10490:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            ushort Xx, Yx;
                                            if (attacked != null)
                                            {
                                                Xx = attacked.X;
                                                Yx = attacked.Y;
                                            }
                                            else
                                            {
                                                Xx = attackedsob.X;
                                                Yx = attackedsob.Y;
                                            }
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
                                            {
                                                if (attackedsob != null)
                                                    if (attacker.ContainsFlag(Network.GamePackets.Update.Flags.Fly))
                                                        return;

                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                bool send = false;

                                                if (attackedsob != null)
                                                {
                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        suse.MakeConst();
                                                        for (uint c = 0; c < 4; c++)
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                            if (damage > attackedsob.Hitpoints)
                                                                damage = attackedsob.Hitpoints;

                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                            suse.Targets.Add(attackedsob.UID + c, damage);
                                                            send = true;
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        suse.MakeConst();
                                                        for (uint c = 0; c < 4; c++)
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);
                                                            if (damage > attacked.Hitpoints)
                                                                damage = attacked.Hitpoints;
                                                            ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                            suse.Targets.Add(attacked.UID + c, damage);
                                                            send = true;
                                                        }
                                                    }
                                                }
                                                if (send)
                                                    attacker.Owner.SendScreen(suse, true);
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                        }
                                        break;
                                    }
                            
                                #endregion
snappy is offline  
Old 07/01/2013, 08:14   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
You're not checking if they are dead when dealing damage. As such the death code runs multiple times.

Number of ways to handle this with the simplest being write the source correctly the first time but if you want a bandaid style fix then just go inside the ReceiveAttack handler and check if they are still alive. If not then you can just return as the display of the spell is already handled outside the method.
pro4never is offline  
Old 07/01/2013, 08:17   #3
 
elite*gold: 80
Join Date: Sep 2007
Posts: 642
Received Thanks: 168
Quote:
Originally Posted by snappy View Post
I'm having issues with this Monk skill, when it attacks a Monster, whatever the drop is.. It gets it x2 or 4. And when you Kill another player and triple attack goes off. It show's you killed the player 4 times..

Any ideas? Thanks
Code:
if (damage > attackedsob.Hitpoints)
           damage = attackedsob.Hitpoints;
If that is true, there is no sense in looping it back 3 more times...thats where it seems your problem is. Just don't repeat the loop and you should be good.

Also, please correct me if I am wrong but for skills such as triple kick you only need to send one packet and the client handles the "triple" kick. If not, change your 4 to a 3 so it only sends it 3 times.
Santa is offline  
Old 07/01/2013, 09:14   #4
 
elite*gold: 0
Join Date: Apr 2007
Posts: 9
Received Thanks: 0
Where in recievedattack would this go? I tried this code... It seemed to have stopped the multiple deaths and multiple drops. But now the attack only goes off on Bosses. Not sure what i'm doing wrong here. Thanks

Code:
                                               if (attackedsob != null)
                                                {
                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        suse.MakeConst();
                                                        for (uint c = 0; c < 4; c++)
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                            if (damage > attackedsob.Hitpoints)
                                                                damage = attackedsob.Hitpoints;
                                                            
                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                            suse.Targets.Add(attackedsob.UID + c, damage);
                                                            send = true;
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        suse.MakeConst();
                                                        for (uint c = 0; c < 4; c++)
                                                        {
[B]                                                            //J_newcode
                                                            if (attacked.Dead)
                                                            {
                                                                return;
                                                            }
                                                            //J_newcode ^^^[/B]
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);
                                                            if (damage > attacked.Hitpoints)
                                                                damage = attacked.Hitpoints;
                                                            ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                            suse.Targets.Add(attacked.UID + c, damage);
                                                            send = true;
                                                        }
                                                    }
                                                }
                                                if (send)
                                                    attacker.Owner.SendScreen(suse, true);
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                        }
                                        break;
                                    }
snappy is offline  
Old 07/01/2013, 18:34   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Quote:
Originally Posted by StarBucks View Post
Code:
if (damage > attackedsob.Hitpoints)
           damage = attackedsob.Hitpoints;
If that is true, there is no sense in looping it back 3 more times...thats where it seems your problem is. Just don't repeat the loop and you should be good.

Also, please correct me if I am wrong but for skills such as triple kick you only need to send one packet and the client handles the "triple" kick. If not, change your 4 to a 3 so it only sends it 3 times.
No. The packet needs to contain the target + damage for the # of times that the attack hits (because ideally each attack is a different damages amount)

He needs to go into the handle damage method and check that the targets health is > 0
pro4never is offline  
Old 07/01/2013, 21:47   #6
 
elite*gold: 80
Join Date: Sep 2007
Posts: 642
Received Thanks: 168
Quote:
Originally Posted by pro4never View Post
No. The packet needs to contain the target + damage for the # of times that the attack hits (because ideally each attack is a different damages amount)

He needs to go into the handle damage method and check that the targets health is > 0
Huh. Interesting. I don't know what skill I was thinking of then.
Santa is offline  
Old 07/01/2013, 22:02   #7
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Quote:
Originally Posted by StarBucks View Post
Huh. Interesting. I don't know what skill I was thinking of then.
whirlwind I believe has a simple # of attacks but I could be wrong. Been aggeessssss since I coded either.
pro4never is offline  
Reply


Similar Threads Similar Threads
skill Triple attack
04/19/2013 - CO2 Private Server - 0 Replies
i have problem in skill Triple attack monk and Pirate when i kill monster by skill triple attack monster drop cps 3x example i make drop = 250 when monster kill by triple attack drop = 750
selling ddo account......triple reincarnated monk......all packs.....amazing items...
04/09/2012 - General Gaming Discussion - 2 Replies
basically pm me if you're actually interested at least 3 years worth of gaming in this account only serious offers or i won't consider and must have skype to discuss properly (my rule) or other means of communication other than this site only :D
DDO triple reincarnate monk
10/20/2011 - General Gaming Discussion - 4 Replies
Hi, After 2 years of playing DDO i have decided to stop playing. My account is 3rd life monk with 36 points. It has a every item of gear you can imagine including epic ingredients and greensteel items and matts galore. If you're interested in this let me know and we will make some sort of deal. This is a serious trade for a great account, i repeat a great account with everything needed to have a great time. PM me for full list of items and screenshot etc.
(Monk Skill) Triple Attack Problem
09/19/2011 - CO2 Private Server - 8 Replies
I am having problem with Triple Attack whenever activates it counts as 3 kills, not just 1, so if my pheasant drops 5 cps, and this skill activates it gives me 15 cps by one hit instead of 5 cps...does anyone see something wrong into this code? I think the problem is at those 2 red lines I just highlighted... case 10490: { if (CanUseSpell(spell, attacker.Owner)) { ...
Triple attack ?
08/16/2011 - CO2 Private Server - 2 Replies
Anyone knows how the Calc works for it?, like Missing or not to miss, i know Agility has a big Part in it. but what else and how? Oh And Also does anyone have the Spawn packet Offset for the New Appearance Options ?



All times are GMT +1. The time now is 13:25.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.