Esempio n. 1
0
        public void OnPoacherKilled(BaseCreature bc)
        {
            if (Poachers != null && Poachers.Contains(bc))
            {
                Poachers.Remove(bc);

                if (Poachers.Count == 0)
                {
                    if (!IsHatching)
                    {
                        IsHatching = true;
                        ColUtility.Free(Poachers);

                        Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(15, 30)), () =>
                        {
                            Hatchling = new DragonTurtleHatchling();
                            Hatchling.MoveToWorld(Location, Map);
                            Hatchling.Tamable = false;

                            SpawnPoachers(Hatchling);

                            if (Egg != null)
                            {
                                Egg.Visible = false;
                            }
                        });
                    }
                    else
                    {
                        if (Hatchling.Alive)
                        {
                            CooldownEnds = DateTime.UtcNow + ResetPeriod;
                            Timer.DelayCall(TimeSpan.FromSeconds(1), OnComplete, new object[] { Hatchling, Focus });

                            if (!FocusList.Contains(Focus))
                            {
                                FocusList.Add(Focus);
                            }
                        }
                        else
                        {
                            Delete();
                        }

                        if (DeadlineTimer != null)
                        {
                            DeadlineTimer.Stop();
                            DeadlineTimer = null;
                        }

                        Hatchling = null;
                        Focus     = null;

                        ColUtility.Free(Poachers);
                        Poachers = null;
                    }
                }
            }
        }
Esempio n. 2
0
        public override void OnHatch(Mobile from)
        {
            BaseCreature bc = new DragonTurtleHatchling();

            from.SendLocalizedMessage(1156239); // You hatch a dragon turtle!

            bc.MoveToWorld(from.Location, from.Map);
            Delete();
        }