[FullRelease] 100% working Disguise Skills (5165)

03/13/2010 05:51 kamote#1
Hi guys, If you have problem with Disguise Skill on your 5165 server, you may able to use this release. I hope my work may help a bit on your server.

some credits goes to glover.
here are some Screen shots:

here are the Steps:

1. Under Features folder create a new class with a name of CastEffect.cs (this class will make the effect viewable by all

players troughout the lifespan of the desguise effect)

2. paste this code to CastEffect.cs just below the { under namespace.
Code:
class CastEffect
    {
        public int countdown;
        public System.Threading.Timer timer;
        public Buff B;
        public Character C;
        public ulong transValue;
        public void executeEffect()
        {
            System.Threading.TimerCallback cb = new System.Threading.TimerCallback(ProcessTimerEvent);
            timer = new System.Threading.Timer(cb, B, 0, 100);            
        }
        private void ProcessTimerEvent(object obj)
        {
            --countdown;
            Game.Buff B = (Game.Buff)obj;
            if (countdown == 0)
            {
                C.MyClient.MyChar.RemoveBuff(B);
                return;
            }

            if (obj is Game.Buff)
            {
                SendEffect(Packets.Status(C.EntityID, Status.Mesh, transValue), countdown);
            }
        }
        public void SendEffect(COPacket Data, int c)
        {
            Game.Character[] Chars = new Game.Character[Game.World.H_Chars.Count];
            Game.World.H_Chars.Values.CopyTo(Chars, 0);
            if (c > 0)
                foreach (Game.Character C in Chars)
                   if (MyMath.PointDistance(C.Loc.X, C.Loc.Y, CC.Loc.X, CC.Loc.Y) <= 20)
                    C.MyClient.AddSend(Data);
            Chars = null;
        }
    }
3.open your Character.cs and search for..
Code:
public void AddBuff(Buff B)
4. and change the entire method with this code
Code:
        public void AddBuff(Buff B)
        {
            
            Buff ExBuff = BuffOf(B.Eff);
            if (ExBuff.Eff == B.Eff)
              Buffs.Remove(ExBuff);
            if (B.Eff == SkillsClass.ExtraEffect.Transform)
              {
                  switch (B.Transform)
                  {
                      case 2000:
                      case 2001:
                      case 2002:
                      case 2003:
                      case 2010:
                      case 2011:
                      case 2012:
                      case 2013:
                          transValue=(ulong)2141000000;
                          MyClient.AddSend(Packets.Status(EntityID, Status.Mesh,transValue));
                          break;
                      case 2005:
                      case 2006:
                      case 2007:
                      case 2008:
                      case 2009:
                      case 2040:
                      case 2041:
                      case 2042:
                      case 2043:
                          transValue=(ulong)2131000000;
                          MyClient.AddSend(Packets.Status(EntityID, Status.Mesh,transValue));
                          break;
                      case 2020:
                      case 2021:
                      case 2022:
                      case 2023:
                      case 2024:
                          transValue = (ulong)2071000000;
                          MyClient.AddSend(Packets.Status(EntityID, Status.Mesh, transValue));
                          break;
                      case 2030:
                      case 2031:
                      case 2032:
                      case 2033:
                      case 2034:
                          transValue = (ulong)2171000000;
                          MyClient.AddSend(Packets.Status(EntityID, Status.Mesh, transValue));
                          break;

                      default:
                          transValue=(ulong)(B.Transform * 10000000 + Avatar * 10000 + Mesh);
                          MyClient.AddSend(Packets.Status(EntityID, Status.Mesh, transValue));
                          break;
                  }
                  transEffect = new CastEffect();  
                  transEffect.countdown = B.Lasts*10;
                  transEffect.B = B;
                  transEffect.C = this;
                  transEffect.transValue = transValue;
                  transEffect.executeEffect();                 
              }
              Buffs.Add(B);
              StatEff.Add(B.StEff);
        }
5. above public void AddBuff(Buff B) , add this codes

Code:
        CastEffect transEffect;
        static ulong transValue;
6. look for
Code:
        public void RemoveBuff(Buff B)
7. and change the entire method with this codes..
Code:
        public void RemoveBuff(Buff B)
        {     
            Buffs.Remove(B);
            StatEff.Remove(B.StEff);
            if (B.Eff == SkillsClass.ExtraEffect.Transform)
            {
                transEffect.timer.Dispose();
                transEffect.countdown = 0;
                Body = Body;
                Hair = Hair;
                Equips.Send(MyClient, false);
            }
        }
8. search for
Code:
case 725018:
9. above it add this code
Code:
  case 725016:
  {
   if (Level >= 80)
    {
      NewSkill(new Skill() { ID = 1360 });
      RemoveItem(I);
    }
    else
    {
     MyClient.LocalMessage(2005, "Cannot use NightDevil at your Level!");
    }
   break;
 }
10. Open PacketHandler.cs and search for
Code:
 switch (Data[16])
 {
11. Below it add this code
Code:
case 118:
        {
            Game.Buff B = GC.MyChar.BuffOf(CoPinoy.Features.SkillsClass.ExtraEffect.Transform);
            GC.MyChar.RemoveBuff(B);
            break;
       }
12. Open Database.cs and search for
Code:
    Trojan.Add(new SkillLearn() { ID = (ushort)1190, LevelReq = (byte)40 });
13. and add the code below, in between SkillForLearning.Add((byte)1, Trojan);
Code:
Trojan.Add(new SkillLearn() { ID = (ushort)1270, LevelReq = (byte)41 });
14. search again for
Code:
WaterTaoist.Add(new SkillLearn() { ID = (ushort)5001, LevelReq = (byte)70 });
15. and add the code below, in between SkillForLearning.Add((byte)13, WaterTaoist);
Code:
WaterTaoist.Add(new SkillLearn() { ID = (ushort)1280, LevelReq = (byte)50 });
16. Open Mob.cs and search for
Code:
     else if (MyMath.ChanceSuccess(DropRates.Gem))
     {
      DI2.Info.ID = (uint)(700001 + Rnd.Next(8) * 10);
      if (MyMath.ChanceSuccess(15)) DI2.Info.ID = 700121;
      if (MyMath.ChanceSuccess(15)) DI2.Info.ID = 700101;
      DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
      DI2.Info.CurDur = DI2.Info.MaxDur;
     }
17. just below } add this region
Code:
#region NightDevil
                    else if (MyMath.ChanceSuccess([COLOR="Red"]0.5[/COLOR]) && Name == "HeavyGhostL23")
                    {
                        DI2.Info.ID = (uint)(725016);
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess([COLOR="Red"]0.5[/COLOR]) && Name == "Poltergeist")
                    {
                        DI2.Info.ID = (uint)(725016);
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    #endregion
you may change the value in color red to change the drop rate of NightDevil scroll..

Test Run Note: just like in real CO.
Quote:
* to attain NightDevil you need hunt the NightDevil Scroll from HeavyGhostL23 and Poltergeist. (for everyone)
* to attain Divine Hare buy it from Pharmacys in the Market (for firetao only)
* Water Tao can learn WaterElf from TaoistGod
* Trojan can learn Robot/Golem from TrojanGod
That's all! godspeed everyone!
03/13/2010 06:43 mynoob1#2
Just so you know, It's only Water Taos who can obtain divine hare and actually learn it.
In 5165 source

1190- Is Spirit Healing...
5001- Is Speed Lightning...

Neither of which are disguises. Just thought that might be a good note for you.
03/13/2010 07:06 -Shunsui-#3
Nice release,
03/13/2010 08:36 xI NiNJA DuCKey#4
Nice Release.
03/13/2010 08:53 NukingFuts#5
nice work bro :D
03/13/2010 10:41 salem rey#6
wow thankssssss...
03/13/2010 11:13 ~Yuki~#7
nice one
03/13/2010 11:16 Paralyzer[GM]#8
Very, very neat

+Thanks
03/13/2010 12:57 .Beatz#9
nice release bro. keep up the good work.
Q) How do i change it to work on watertaos instead of fire taos?

**EDIT**
no worries i figured it out. i wasnt looking at the code properly lol
03/13/2010 15:10 ramix#10
great release bro keep it up ;)

but i have problem in this code give error in red

Quote:
CastEffect transEffect;
03/13/2010 16:05 killersub#11
Quote:
Originally Posted by ramix View Post
great release bro keep it up ;)

but i have problem in this code give error in red
Make it so it uses
Code:
NewestCOServer.Game.Extra
instead of the normal one you have....i.e. click on it and a lil red line will appear at da end of da word, go over it with your mouse carefully den a lil box will show...click it and click the first option...:D hope I helped
03/14/2010 03:06 gulpi_de_gulat#12
anak ng Kamote Oo. ang galing, thankz bro
03/14/2010 15:08 glover#13
Very great realease you got karma + from me.
03/14/2010 19:19 -NewDawn-#14
awesome release. =]

i'm just trying to figure out how to make it to that it sets your max hp to 4000 and curhp to 4000 but i'm having no luck.
03/14/2010 22:48 xDestroy#15
Can someone help me fix these errors?

[Only registered and activated users can see links. Click Here To Register...]


Code:
Game.Buff B = GC.MyChar.BuffOf([COLOR="Red"]CoPinoy[/COLOR].Features.SkillsClass.ExtraEffect.Transform);
Code:
SendEffect(Packets.[COLOR="Red"]Status[/COLOR](C.EntityID, Status.Mesh, transValue), countdown);