Beispiel #1
0
        public ShadowguardApple(OrchardEncounter encounter, ShadowguardCypress tree)
        {
            Encounter = encounter;
            Tree      = tree;

            AttachSocket(new DecayingItemSocket(30, true));
        }
Beispiel #2
0
        public override void Setup()
        {
            Trees = new List <ShadowguardCypress>();
            Spawn = new List <BaseCreature>();

            List <Point3D> points = new List <Point3D>();

            for (int i = 0; i < SpawnPoints.Length; i++)
            {
                Point3D p = SpawnPoints[i];
                ConvertOffset(ref p);
                points.Add(p);
            }

            foreach (int i in Enum.GetValues(typeof(VirtueType)))
            {
                if (i > 7)
                {
                    break;
                }

                ShadowguardCypress tree = new ShadowguardCypress(this, (VirtueType)i);
                Point3D            p    = points[Utility.Random(points.Count)];

                tree.MoveToWorld(p, Map.TerMur);
                points.Remove(p);
                Trees.Add(tree);

                tree = new ShadowguardCypress(this, (VirtueType)i + 8);
                p    = points[Utility.Random(points.Count)];

                tree.MoveToWorld(p, Map.TerMur);
                points.Remove(p);
                Trees.Add(tree);
            }

            Item    bones = new WitheringBones();
            Point3D pnt   = new Point3D(-15, -11, 0);

            ConvertOffset(ref pnt);
            bones.MoveToWorld(pnt, Map.TerMur);
            Bones = bones;

            ColUtility.Free(points);
        }
Beispiel #3
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            Trees = new List <ShadowguardCypress>();

            int count = reader.ReadInt();

            for (int i = 0; i < count; i++)
            {
                ShadowguardCypress tree = reader.ReadItem() as ShadowguardCypress;

                if (tree != null)
                {
                    Trees.Add(tree);
                }
            }

            count = reader.ReadInt();
            for (int i = 0; i < count; i++)
            {
                if (Spawn == null)
                {
                    Spawn = new List <BaseCreature>();
                }

                BaseCreature bc = reader.ReadMobile() as BaseCreature;

                if (bc != null)
                {
                    Spawn.Add(bc);
                }
            }

            Bones = reader.ReadItem();
        }
Beispiel #4
0
 public ShadowguardCypressFoilage(int id, ShadowguardCypress cypress)
     : base(id)
 {
     Movable = false;
     Tree    = cypress;
 }
Beispiel #5
0
        public override void OnDoubleClick(Mobile m)
        {
            if (IsChildOf(m.Backpack) && Tree != null)
            {
                m.SendLocalizedMessage(1010086);                 // What do you want to use this on?
                m.BeginTarget(10, false, Server.Targeting.TargetFlags.None, (from, targeted) =>
                {
                    if (targeted is ShadowguardCypress || targeted is ShadowguardCypress.ShadowguardCypressFoilage)
                    {
                        ShadowguardCypress tree = null;

                        if (targeted is ShadowguardCypress)
                        {
                            tree = targeted as ShadowguardCypress;
                        }
                        else if (targeted is ShadowguardCypress.ShadowguardCypressFoilage)
                        {
                            tree = ((ShadowguardCypress.ShadowguardCypressFoilage)targeted).Tree;
                        }

                        if (tree != null)
                        {
                            Point3D p = tree.Location;
                            Map map   = tree.Map;

                            from.Animate(31, 7, 1, true, false, 0);
                            m.MovingParticles(tree, this.ItemID, 10, 0, false, true, 0, 0, 9502, 6014, 0x11D, EffectLayer.Waist, 0);

                            Timer.DelayCall(TimeSpan.FromSeconds(.7), () =>
                            {
                                if (tree.IsOppositeVirtue(Tree.VirtueType))
                                {
                                    tree.Delete();

                                    Effects.SendLocationParticles(EffectItem.Create(p, map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
                                    Effects.PlaySound(p, map, 0x243);

                                    m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1156213, m.NetState);     // *Your throw releases powerful magics and destroys the tree!*

                                    if (Tree != null)
                                    {
                                        p = Tree.Location;
                                        Tree.Delete();

                                        Effects.SendLocationParticles(EffectItem.Create(p, map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
                                        Effects.PlaySound(p, map, 0x243);     //TODO: Get sound
                                    }

                                    tree.Encounter.CheckEncounter();
                                    Delete();
                                }
                                else
                                {
                                    p            = m.Location;
                                    var creature = new VileTreefellow();

                                    for (int i = 0; i < 10; i++)
                                    {
                                        int x = Utility.RandomMinMax(p.X - 1, p.X + 1);
                                        int y = Utility.RandomMinMax(p.Y - 1, p.Y + 1);
                                        int z = p.Z;

                                        if (map.CanSpawnMobile(x, y, z))
                                        {
                                            p = new Point3D(x, y, z);
                                            break;
                                        }
                                    }

                                    creature.MoveToWorld(p, map);
                                    creature.Combatant = m;
                                    m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1156212, m.NetState);     // *Your throw seems to have summoned an ambush!*

                                    if (Encounter is OrchardEncounter)
                                    {
                                        ((OrchardEncounter)Encounter).AddSpawn(creature);
                                    }

                                    Delete();
                                }
                            });
                        }
                    }
                });
            }
        }
Beispiel #6
0
 public ShadowguardApple(ShadowguardEncounter encounter, ShadowguardCypress tree) : base(0x9D0)
 {
     Encounter = encounter;
     Tree      = tree;
 }