Example #1
0
        /*
         * public static void StartEffectDamage(int intval, int HitPower, byte e_index, object target)
         * {
         *  try
         *  {
         *      if (target.sys.Character.Action.DeBuff.Effect.EffectImpactTimer[e_index] != null) target.sys.Character.Action.DeBuff.Effect.EffectImpactTimer[e_index].Dispose();
         *
         *      target.sys.Character.Action.DeBuff.Effect.EffectImpactTimer[e_index] = new Timer(
         *          new TimerCallback(
         *              delegate(object e)
         *              {
         *                  if (target.type == true) // player
         *                  {
         *                      if (!target.sys.Character.State.Die)
         *                      {
         *                          target.HP(HitPower);
         *                          target.sys.Send(Packet.Effects2Dmg(target.sys.Character.Information.UniqueID, HitPower));
         *                      }
         *                      else return;
         *                  }
         *                  else if (target.type == false) // mob
         *                  {
         *                      if (!target.os.Die)
         *                      {
         *                          target.HP(HitPower);
         *                          target.os.Send(Packet.Effects2Dmg(target.ID, HitPower));
         *                      }
         *                      else return;
         *                  }
         *              }
         *      ), null, 0, intval);
         *  }
         *  catch (Exception ex)
         *  {
         *      Log.Exception(ex);
         *      Console.WriteLine("StartEffectDamage() Error {0}", ex);
         *  }
         * }
         */
        ///////////////////////////////////////////////////////////////////////////
        // Shock state
        ///////////////////////////////////////////////////////////////////////////
        public static void GenerateEffect_es(object target, int skillid)
        {
            // Get effects parameters
            int Power       = ObjData.Manager.SkillBase[skillid].Properties1["es"];
            int Probability = ObjData.Manager.SkillBase[skillid].Properties2["es"];

            int Random = Rnd.Next(1, 100);

            byte slot;

            // if effect succeeded
            if (Random <= Probability)
            {
                if (target.GetType().ToString() == "CLGameServer.PlayerMgr") // player
                {
                    PlayerMgr sys = target as PlayerMgr;

                    if (sys.Character.State.Die == true)
                    {
                        return;
                    }

                    slot = sys.DeBuffGetFreeSlot();
                    sys.Character.Action.DeBuff.Effect.EffectID[slot] = EffectNumbers.SHOCKED;
                    sys.Character.Action.DeBuff.Effect.SkillID[slot]  = skillid;

                    sys.StartEffectTimer(Power * 100, slot);
                    sys.client.Send(Packet.EffectUpdate(sys.Character.Information.UniqueID, EffectNumbers.SHOCKED, true));

                    // Timer for burn state
                }
                else if (target.GetType().ToString() == "CLGameServer.WorldMgr.Monsters") // mob
                {
                    WorldMgr.Monsters os = target as WorldMgr.Monsters;

                    if (os.Die == true)
                    {
                        return;
                    }

                    slot = os.DeBuffGetFreeSlot();
                    os.DeBuff.Effect.EffectID[slot] = EffectNumbers.SHOCKED;
                    os.DeBuff.Effect.SkillID[slot]  = skillid;

                    os.StartEffectTimer(Power * 100, slot);
                    os.Send(Packet.EffectUpdate(os.UniqueID, EffectNumbers.SHOCKED, true));

                    // Burn timer
                    // Add (character details).
                }
            }
        }
Example #2
0
        public static void GenerateEffect_fb(object target, int skillid)
        {
            // Get effects parameters
            int Power       = ObjData.Manager.SkillBase[skillid].Properties1["fb"];
            int Probability = ObjData.Manager.SkillBase[skillid].Properties2["fb"];

            int Random = Rnd.Next(1, 100);

            byte slot;


            // if effect succeeded
            if (Random <= Probability)
            {
                if (target.GetType().ToString() == "CLGameServer.PlayerMgr") // player
                {
                    PlayerMgr sys = target as PlayerMgr;

                    if (sys.Character.State.Die == true)
                    {
                        return;
                    }

                    slot = sys.DeBuffGetFreeSlot();
                    sys.Character.Action.DeBuff.Effect.EffectID[slot] = EffectNumbers.FROSTBITE;
                    sys.Character.Action.DeBuff.Effect.SkillID[slot]  = skillid;

                    sys.StartEffectTimer(Power * 100, slot);
                    sys.Send(Packet.EffectUpdate(sys.Character.Information.UniqueID, EffectNumbers.FROSTBITE, true));

                    // attack speed
                    //sys.Character.Speed.AttackSpeedModifier = 1.5;

                    sys.Character.Speed.RunSpeed     /= 2;
                    sys.Character.Speed.WalkSpeed    /= 2;
                    sys.Character.Speed.BerserkSpeed /= 2;

                    sys.Send(Packet.SetSpeed(sys.Character.Information.UniqueID, sys.Character.Speed.WalkSpeed, sys.Character.Speed.RunSpeed));
                }
                else if (target.GetType().ToString() == "CLGameServer.WorldMgr.Monsters") // mob
                {
                    WorldMgr.Monsters os = target as WorldMgr.Monsters;

                    if (os.Die == true)
                    {
                        return;
                    }

                    slot = os.DeBuffGetFreeSlot();
                    os.DeBuff.Effect.EffectID[slot] = EffectNumbers.FROSTBITE;
                    os.DeBuff.Effect.SkillID[slot]  = skillid;
                    //target.os.DeBuff.Effect.EffectPower[slot] = Power;

                    os.StartEffectTimer(Power * 100, slot);

                    os.Send(Packet.EffectUpdate(os.UniqueID, EffectNumbers.FROSTBITE, true));

                    // attack speed
                    os.AttackSpeed = 1.5;

                    // movement speed
                    os.RunningSpeed /= 2;
                    os.WalkingSpeed /= 2;

                    //Set our bool active
                    os.Frostbite = true;

                    os.Send(Packet.SetSpeed(os.UniqueID, os.WalkingSpeed, os.RunningSpeed));
                }
            }
        }