StartEffectTimer() public method

public StartEffectTimer ( int time, byte e_index ) : void
time int
e_index byte
return void
示例#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)
         *  {
         *      deBug.Write(ex);
         *      Console.WriteLine("StartEffectDamage() Error {0}", ex);
         *  }
         * }
         */
        ///////////////////////////////////////////////////////////////////////////
        // Shock state
        ///////////////////////////////////////////////////////////////////////////
        public static void GenerateEffect_es(object target, int skillid)
        {
            // Get effects parameters
            int Power       = Data.SkillBase[skillid].Properties1["es"];
            int Probability = Data.SkillBase[skillid].Properties2["es"];

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

            byte slot;

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

                    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.Send(Packet.EffectUpdate(sys.Character.Information.UniqueID, EffectNumbers.SHOCKED, true));

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

                    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).
                }
            }
        }
示例#2
0
        ///////////////////////////////////////////////////////////////////////////
        // Frostbite state
        ///////////////////////////////////////////////////////////////////////////
        #region Frost Bite
        public static void GenerateEffect_fb(object target, int skillid)
        {
            // Get effects parameters
            int Power       = Data.SkillBase[skillid].Properties1["fb"];
            int Probability = Data.SkillBase[skillid].Properties2["fb"];

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

            byte slot;


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

                    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() == "DarkEmu_GameServer.obj") // mob
                {
                    obj os = target as obj;

                    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.SpeedRun  /= 2;
                    os.SpeedWalk /= 2;

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

                    os.Send(Packet.SetSpeed(os.UniqueID, os.SpeedWalk, os.SpeedRun));
                }
            }
        }