Ejemplo n.º 1
0
        public override void Tick(RealmTime time)
        {
            if (t / 500 == p)
            {
                Owner.BroadcastPacket(new ShowEffectPacket
                {
                    EffectType = EffectType.Trap,
                    Color      = new ARGB(0xff9000ff),
                    TargetId   = Id,
                    PosA       = new Position {
                        X = radius
                    }
                }, null);
                p++;
                if (p == LIFETIME * 2)
                {
                    Explode(time);
                    return;
                }
            }
            t += time.thisTickTimes;

            var monsterNearby = false;

            BehaviorBase.AOE(Owner, this, radius / 2, false, enemy => monsterNearby = true);
            if (monsterNearby)
            {
                Explode(time);
            }

            base.Tick(time);
        }
Ejemplo n.º 2
0
 private void Explode(RealmTime time)
 {
     Owner.BroadcastPacket(new ShowEffectPacket
     {
         EffectType = EffectType.AreaBlast,
         Color      = new ARGB(0xff9000ff),
         TargetId   = Id,
         PosA       = new Position {
             X = radius
         }
     }, null);
     BehaviorBase.AOE(Owner, this, radius, false, enemy =>
     {
         (enemy as Enemy).Damage(player, time, dmg, false, new ConditionEffect
         {
             Effect     = effect,
             DurationMS = duration
         });
     });
     Owner.LeaveWorld(this);
 }
Ejemplo n.º 3
0
 public override void Tick(RealmTime time)
 {
     if (t / 500 == p2)
     {
         Owner.BroadcastPacket(new ShowEffectPacket
         {
             EffectType = EffectType.Trap,
             Color      = new ARGB(0xffd700),
             TargetId   = Id,
             PosA       = new Position {
                 X = radius
             }
         }, null);
         p2++;
         //Stuff
     }
     if (t / 2000 == p)
     {
         var pkts = new List <Packet>();
         BehaviorBase.AOE(Owner, this, radius, true,
                          player => { Player.ActivateHealHp(player as Player, amount, pkts); });
         pkts.Add(new ShowEffectPacket
         {
             EffectType = EffectType.AreaBlast,
             TargetId   = Id,
             Color      = new ARGB(0xffd700),
             PosA       = new Position {
                 X = radius
             }
         });
         Owner.BroadcastPackets(pkts, null);
         p++;
     }
     t += time.thisTickTimes;
     base.Tick(time);
 }
Ejemplo n.º 4
0
 public override void Tick(RealmTime time)
 {
     if (t / 1500 == p)
     {
         p = 100;
         var   pkts    = new List <Packet>();
         var   enemies = new List <Enemy>();
         short obj;
         var   pt = monster;
         db.data.XmlDatas.IdToType.TryGetValue(pt, out obj);
         BehaviorBase.AOE(Owner, this, radius, false, enemy =>
         {
             enemies.Add(enemy as Enemy);
         });
         Owner.BroadcastPacket(new ShowEffectPacket
         {
             EffectType = EffectType.AreaBlast,
             Color      = new ARGB(0x4E6C00),
             TargetId   = this.Id,
             PosA       = new Position {
                 X = radius
             }
         }, null);
         foreach (var i in enemies)
         {
             try
             {
                 if (i.HasConditionEffect(ConditionEffects.StasisImmune) || i.ObjectDesc.MaxHp > amount || i.Name == monster || i.isPet || i.isSummon || !i.ObjectDesc.Enemy || i.Name == "Pentaract Tower" || i.HasConditionEffect(ConditionEffects.Invincible) || i.HasConditionEffect(ConditionEffects.Invulnerable) || i.ObjectDesc.StasisImmune)
                 {
                     pkts.Add(new NotificationPacket
                     {
                         ObjectId = i.Id,
                         Color    = new ARGB(0x4E6C00),
                         Text     = "Immune"
                     });
                 }
                 else
                 {
                     Position pos = new Position();
                     pos.X = i.X;
                     pos.Y = i.Y;
                     Owner.LeaveWorld(i);
                     var newenemy = Resolve(obj);
                     Owner.EnterWorld(newenemy);
                     newenemy.Move(pos.X, pos.Y);
                     maximumtransforms++;
                     if (maximumtransforms == 10)
                     {
                         break;
                     }
                 }
             }
             catch
             {
                 Console.ForegroundColor = ConsoleColor.DarkBlue;
                 Console.Out.WriteLine("Crash halted - Totem error!");
                 Console.Out.WriteLine(i.Name);
                 Console.ForegroundColor = ConsoleColor.White;
             }
         }
         Owner.BroadcastPackets(pkts, null);
         t += time.thisTickTimes;
     }
     t += time.thisTickTimes;
     base.Tick(time);
 }