public void Target(Item item)
        {
            MaabusCoffinComponent comp = item as MaabusCoffinComponent;

            if (comp?.Addon is MaabusCoffin addon)
            {
                PlayerMobile pm = Caster as PlayerMobile;

                QuestSystem qs = pm?.Quest;

                if (qs is DarkTidesQuest)
                {
                    QuestObjective objective = qs.FindObjective <AnimateMaabusCorpseObjective>();

                    if (objective?.Completed == false)
                    {
                        addon.Awake(Caster);
                        objective.Complete();
                    }
                }

                return;
            }

            if (!(item is Corpse c))
            {
                Caster.SendLocalizedMessage(1061084); // You cannot animate that.
            }
Exemple #2
0
        public void Target(object obj)
        {
            MaabusCoffinComponent comp = obj as MaabusCoffinComponent;

            if (comp != null)
            {
                MaabusCoffin addon = comp.Addon as MaabusCoffin;

                if (addon != null)
                {
                    PlayerMobile pm = this.Caster as PlayerMobile;

                    if (pm != null)
                    {
                        QuestSystem qs = pm.Quest;

                        if (qs is DarkTidesQuest)
                        {
                            QuestObjective objective = qs.FindObjective(typeof(AnimateMaabusCorpseObjective));

                            if (objective != null && !objective.Completed)
                            {
                                addon.Awake(this.Caster);
                                objective.Complete();
                            }
                        }
                    }

                    return;
                }
            }

            Corpse c = obj as Corpse;

            if (c == null)
            {
                this.Caster.SendLocalizedMessage(1061084); // You cannot animate that.
            }
            else
            {
                Type type = null;

                if (c.Owner != null)
                {
                    type = c.Owner.GetType();
                }

                if (c.ItemID != 0x2006 || c.Animated || type == typeof(PlayerMobile) || type == null || (c.Owner != null && c.Owner.Fame < 100) || ((c.Owner != null) && (c.Owner is BaseCreature) && (((BaseCreature)c.Owner).Summoned || ((BaseCreature)c.Owner).IsBonded)))
                {
                    this.Caster.SendLocalizedMessage(1061085); // There's not enough life force there to animate.
                }
                else
                {
                    CreatureGroup group = FindGroup(type);

                    if (group != null)
                    {
                        if (group.m_Entries.Length == 0 || type == typeof(DemonKnight))
                        {
                            this.Caster.SendLocalizedMessage(1061086); // You cannot animate undead remains.
                        }
                        else if (this.CheckSequence())
                        {
                            Point3D p   = c.GetWorldLocation();
                            Map     map = c.Map;

                            if (map != null)
                            {
                                Effects.PlaySound(p, map, 0x1FB);
                                Effects.SendLocationParticles(EffectItem.Create(p, map, EffectItem.DefaultDuration), 0x3789, 1, 40, 0x3F, 3, 9907, 0);

                                Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(SummonDelay_Callback), new object[] { this.Caster, c, p, map, group });
                            }
                        }
                    }
                }
            }

            this.FinishSequence();
        }