Register for your free account! | Forgot your password?

Go Back   elitepvpers > Conquer Online 2 > CO2 PServer - Discussions / Questions
You last visited: Today at 17:55

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


(Monk Skill) Triple Attack Problem

Discussion on (Monk Skill) Triple Attack Problem within the CO2 PServer - Discussions / Questions forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2011
Posts: 84
Received Thanks: 2
(Monk Skill) Triple Attack Problem

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

Code:
case 10490:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            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;

                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
                                            {
                                                if (attackedsob != null)
                                                {
                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        suse.MakeConst();
                                                        [B][COLOR="Red"]for (uint c = 0; c < 3; c++)[/COLOR][/B]
                                                        {
                                                            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);
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        suse.MakeConst();
                                                        [B][COLOR="red"]for (uint c = 0; c < 3; c++)[/COLOR][/B]
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);
                                                            if (damage > attacked.Hitpoints)
                                                                damage = attacked.Hitpoints;
                                                            damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);

                                                            suse.Targets.Add(attacked.UID + c, damage);
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.Screen.SendScreen(suse, true);
                                        }
                                        break;
                                    }



HerpDerpNigga is offline  
Old 09/17/2011, 14:12   #2
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 755
Well it's supposed to attack 3 times, make a check where the mob dies, if it's already dead.

If (Mob.IsDead)
return;

It's most likely something like that you have forgot and because you don't have a check like that it will kill the same mob all 3 times.


BaussHacker is offline  
Thanks
1 User
Old 09/17/2011, 21:06   #3
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,320
I think my system for it may actually be a bit better...

What I do is I do a Target structure which contains target uid, damage dealt and a hit bool as well as an option for activation type/effect for refineries.

I create a list of those and instead of performing the attack inside the spell handler I simply add valid targets with correct damage and refinery effects to the targeting list.

Then at the END of all the targeting I say "ok, lets take all these targets and perform these actions on them and send the final spell display packet!".

In my DealDamage method I don't let the target take damage if it's already dead.

This solves the problem AND will make triple attack still display correctly (cause even if they die it should still be hitting all 3 attacks should it not?)


It's not pretty but here's an example of my struct and implementation

Code:
public struct Targ
        {
            public Targ(Entity target, int dmg, bool hit = true, uint activType = 0, uint activValue = 0)
            {
                Who = target;
                Dmg = dmg;
                Hit = hit;
                ActivationType = activType;
                ActivationValue = activValue;
            }
            public Entity Who;
            public int Dmg;
            public bool Hit;
            public uint ActivationType;
            public uint ActivationValue;
        }
Fill in the values during your targeting method annnddd...

if (SpellTargets.Count > 0)
foreach (Targ t in SpellTargets)
DealDamage(packet, user, t.Who, (uint)t.Dmg);

Something like that + lots of other checks ususally.
pro4never is offline  
Thanks
1 User
Old 09/17/2011, 21:45   #4
 
elite*gold: 0
Join Date: May 2011
Posts: 84
Received Thanks: 2
Thanks both of you, gonna try and see what I will done lol.


HerpDerpNigga is offline  
Old 09/19/2011, 13:02   #5
 
elite*gold: 0
Join Date: Feb 2009
Posts: 919
Received Thanks: 3,513
Quote:
Originally Posted by pro4never View Post
in your source monsters gets confused and refuse to die, and i think if a monsters die from the 1st hit of the triple attack the dmg shouldn't show up, however the char should do the triple attack effect/movement
m7mdxlife is offline  
Old 09/19/2011, 14:55   #6
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,320
Actually monsters do not exist in the source I released. You're supposed to add their related systems yourself. I wish ppl would stop claiming things about it that simply are irrelevant.
pro4never is offline  
Old 09/19/2011, 15:04   #7
 
elite*gold: 0
Join Date: Feb 2009
Posts: 919
Received Thanks: 3,513
Quote:
Originally Posted by pro4never View Post
Actually monsters do not exist in the source I released. You're supposed to add their related systems yourself. I wish ppl would stop claiming things about it that simply are irrelevant.
was referring to hellmouthco server you got running bro, i know its beta but still...

P.S: rolling back to before the wipe was a mean thing to do
m7mdxlife is offline  
Old 09/19/2011, 17:29   #8
 
elite*gold: 0
Join Date: Aug 2010
Posts: 987
Received Thanks: 1,068
first thing the trip attack skill does not hit 3 times ALL THE TIME it depends on the skill level .

and you dont recalculate the damage for each hit and send the whole damage amount you are gonna have to split it and give it a damage % depending on the skill level

number 2 TQ has something that works as a multi attack packet IE scatter/fire of hell/trip attack/ etc so the packet should look something like this for the trip attack

Quote:
UInt16(length, 0, Buffer);
UInt16(1105, 2, Buffer);
UInt32(AttackerUID, 4, Buffer);
UInt32(AttackedUID, 8, Buffer);
UInt16(S.ID, 12, Buffer);
UInt16(S.Level, 14, Buffer);
UInt32(hitsCount, 16, Buffer);

UInt32(AttackedUID, 20, Buffer); > 0 = first hit
UInt32(Dmg, 24, Buffer); if data 20 > 0 damage is required or its gonna miss with the miss effect
UInt32(AttackedUID, 52, Buffer); > 0 = 2nd hit
UInt32(Dmg, 56, Buffer); if data 52 > 0 damage is required or its gonna miss with the miss effect
UInt32(AttackedUID, 84, Buffer); > 0 = 3rd hit
UInt32(Dmg, 88, Buffer); if data 84 > 0 damage is required or its gonna miss with the miss effect
simply you need to recode the skill/the skill use packet

oh and btw as long as your ReceiveAttack void is killing the target 3 times you will get cps 3 times . so you better find another way to handle the skill

good luck
{ Angelius } is offline  
Old 09/19/2011, 18:15   #9
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,320
Quote:
Originally Posted by m7mdxlife View Post
was referring to hellmouthco server you got running bro, i know its beta but still...

P.S: rolling back to before the wipe was a mean thing to do
Hellmouth.is considered shut down till staff have time to work on it. We've been over thiis w. Users a few times leave this thread on topic


pro4never is offline  
Reply



« need help from experts only | LuckyTime Not Work in Market »

Similar Threads
Agbot - problem with imbue / attack skill order
09/24/2013 - SRO Ask the Experts - 11 Replies
hello @ all. Is it possible to activate the imbue earlier? I am a nuker, my primaray attack is the fire nuke.. if my char is standing too close to the mob the nuke will get shot before my imbue is active.. this will return a lower damage. Same happens when the first attack is the flying dragon spear, with imbue first it is a great attack, without it does nearly no damage. Can I "train" the attacking? My char is sometimes nuking twice even if the mob has almost no engery after the...
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.
server 5380 vps all new items tiger-monk-peor skill-drops 50Cps H-Co
09/20/2011 - CO2 PServer Archive - 23 Replies
Greetings and after .... Today I am a server 5380 Full Praise God After that features images ----------------------------- 1 - monak works 100% like TQ ----------------------------- 2 - Skills monak works 100% like TQ ----------------------------- 3 - Ninja works 100% like TQ -----------------------------
Triple attack ?
08/16/2011 - CO2 PServer - Discussions / Questions - 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 +2. The time now is 17:55.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

BTC: 3KeUpz52VCbhmLwuwydqxu6U1xsgbT8YT5
ETH: 0xc6ec801B7563A4376751F33b0573308aDa611E05

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