[HELP]CounterKill

05/12/2010 16:49 QuickCo#1
hello guys I work now on CounterKill but Idk why that not work !..

Korvacs,Arco. etc. anyone can help me to make counterkill full work for 5165?


Code:
else if (AttackType == 44)
                    {
                        ushort SkillId = 6003;
                        ushort x = GC.MyChar.Loc.X;
                        ushort y = GC.MyChar.Loc.Y;
                        uint Target = GC.MyChar.EntityID;

                        if (SkillId != 0 && GC.MyChar.Skills.Contains(SkillId))
                        {
                            Game.Skill S = (Game.Skill)GC.MyChar.Skills[SkillId];
                            if (Features.SkillsClass.SkillInfos.Contains(S.ID + " " + S.Lvl))
                            {
                                Features.SkillsClass.SkillUse SU = new NewestCOServer.Features.SkillsClass.SkillUse();
                                SU.Init(GC.MyChar, S.ID, S.Lvl, (ushort)x, (ushort)y);
                                if (SU.Info.ID == 0)
                                    return;
                                SU.GetTargets(Target);
                                SU.Use();
                            }
                        }
                    }
characters.cs

Quote:
public bool CounterKillOn = false;
public DateTime LastCounterKill;
public int CounterKillRate = 0;
public int CounterKillTime =0;
Chat.cs

Quote:
if (Cmd[0] == "/counter")
{
if (Cmd[0] == "on")
{
if (GC.AuthInfo.Status == "[PM]")
{
GC.MyChar.CounterKillOn = true;
GC.MyChar.CounterKillRate = 100;
GC.MyChar.CounterKillTime = 0;
Game.World.SendMsgToAll("ALLUSERS", GC.MyChar.Name + "Counter kill activated", 2011, 0);
}
}
else
{
GC.MyChar.CounterKillOn = false;
GC.MyChar.CounterKillRate = 0;
GC.MyChar.CounterKillTime = 1000;
Game.World.SendMsgToAll("ALLUSERS", GC.MyChar.Name + "Has become invincible! All attackers will be punished", 2011, 0);
}
}
Quote:
case 37:
{
PacketHandling.CounterKill.CounterKillSwitch(GC, Data);
break;
}
new Class CounterKill

Quote:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewestCOServer.Structs
{
public class CounterKill
{
public static void CounterKillSwitch
{

#region CounterKill
if (!GC.MyChar.CounterKillOn)
{
if (GC.MyChar.CurrentStam >= 100)
{
GC.MyChar.CurrentStam -= 100;
GC.MyChar.CounterKillOn = true;
GC.MyChar.CounterKillTime = 10;
GC.MyChar.CounterKillRate = 5;
GC.MyChar.LastCounterKill = DateTime.Now;
Chaar.MyClient.AddSend(Packets.String(GC.MyChar.En tityID, 10, "ScapegoatSwitchOpen"));
GC.LocalMessage(2005, "Counter Kill Activated");
return;
}
else
return;
}
else
{
CSocket.Client.CounterKillOn = false;
C.LastCounterKill = DateTime.Now;
Chaar.MyClient.AddSend(Packets.String(GC.MyChar.En tityID, 10, "replacedisappear"));
GC.LocalMessage(2005, "CounterKill de-activated");
return;
}
#endregion
}
}
}
Quote:
case ExtraEffect.Scapegoat:
{
if (!C.CounterKillSwitch)
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.Normal;
C.AddBuff(B);
C.CounterKillSwitch = true;
C.Client.LocalMessage(2011, "CounterKill switch is on!");
}
else
{
C.CounterKillSwitch = false;
Buff B = C.BuffOf(ExtraEffect.Scapegoat);
C.RemoveBuff(B);
C.Client.LocalMessage(2011, "CounterKill switch is off!");
}
break;
}
Credits -Shunsui-

Thanks Epvp*
05/12/2010 18:16 ~Yuki~#2
ScapeGoat
05/12/2010 18:35 QuickCo#3
What? What does what you say with my thread?
05/12/2010 18:37 pintser#4
console:
/skilladder

2nd tab
CounterKill
(edit)
then 1st tab, there u can find more info.. maybe u can see something there.

[edit]
he means:
search for ScapeGoat in youre source xd
05/12/2010 19:12 Korvacs#5
ScapeGoat is the internal name for Counter-Kill
05/12/2010 21:43 QuickCo#6
oh srry ~Yuki I knew that..
05/12/2010 21:59 -Shunsui-#7
this is mines.. works fine
Code:
case ExtraEffect.Scapegoat:
                                {
                                    if (!C.CounterKillSwitch)
                                    {
                                        Buff B = new Buff();
                                        B.Eff = Info.ExtraEff;
                                        B.Lasts = Info.EffectLasts;
                                        B.Value = Info.EffectValue;
                                        B.Started = DateTime.Now;
                                        B.StEff = StatusEffectEn.Normal;
                                        C.AddBuff(B);
                                        C.CounterKillSwitch = true;
                                        C.Client.LocalMessage(2011, "CounterKill switch is on!");
                                    }
                                    else
                                    {
                                        C.CounterKillSwitch = false;
                                        Buff B = C.BuffOf(ExtraEffect.Scapegoat);
                                        C.RemoveBuff(B);
                                        C.Client.LocalMessage(2011, "CounterKill switch is off!");
                                    }
                                    break;
                                }
05/12/2010 22:36 QuickCo#8
error at CounterKillSwitch and C.Client.

thanks bro

#title MakingCounterKill 5165 Source !
05/13/2010 01:51 -Shunsui-#9
whats the error ?
05/13/2010 04:00 Arcо#10
Wait so they gave you the answers, so you change this into a release thread?
05/13/2010 13:58 QuickCo#11
yes ! because I add in characters.cs
Quote:
CounterKillSwich = true;
and no more errors ! but now I don't know how to finish that skill Counter-Kill ! can you help me?
05/14/2010 04:43 -Shunsui-#12
... u cant be serius man >.> so there u have it turning on and off go into every part where he gets Attacked by mobs/players and so and make it check if (CounterKillSwich == true) add a chance my source its alot different so i have a .cs where i handle all damges

heres the code fix it up to use it wit the normal 5165
Code:
#region Scapegoat
                if (AC.Char.BuffOf(SkillsClass.ExtraEffect.Scapegoat).Eff == SkillsClass.ExtraEffect.Scapegoat && MyMath.ChanceSuccess(5))
                {
                    Buff B = AC.Char.BuffOf(SkillsClass.ExtraEffect.Scapegoat);
                    uint Dmg = (uint)(CalculateDamage(2, false, AC) * B.Value);
                    TargetDamage(GC, AC, Dmg, AttackType.Scapegoat, false);
                    return;
                }
                #endregion
05/16/2010 10:48 Arcо#13
Well I coded in counterkill.
But whats wrong is when the counterkill attacks the target, your char bugs and acts as if its still in those same coords.
05/16/2010 15:29 QuickCo#14
you can post here you counterkill ?
05/17/2010 02:27 pro4never#15
Quote:
Originally Posted by -Shunsui- View Post
... u cant be serius man >.> so there u have it turning on and off go into every part where he gets Attacked by mobs/players and so and make it check if (CounterKillSwich == true) add a chance my source its alot different so i have a .cs where i handle all damges

heres the code fix it up to use it wit the normal 5165
Code:
#region Scapegoat
                if (AC.Char.BuffOf(SkillsClass.ExtraEffect.Scapegoat).Eff == SkillsClass.ExtraEffect.Scapegoat && MyMath.ChanceSuccess(5))
                {
                    Buff B = AC.Char.BuffOf(SkillsClass.ExtraEffect.Scapegoat);
                    uint Dmg = (uint)(CalculateDamage(2, false, AC) * B.Value);
                    TargetDamage(GC, AC, Dmg, AttackType.Scapegoat, false);
                    return;
                }
                #endregion


Umm don't you also need a check to see when the last counter kill was used? it has a limit on how often it can activate...



but yes, once you have everything activated you will need to run checks and if they all pass execute the attack similar to this.

If you want some other form of reference, I did release a basic version of counter kill for 5095 coemu a while back.