Ejemplo n.º 1
0
        // static method hooks that interface with the distro Paragon system

        public static bool CheckConvert(BaseCreature bc, Point3D location, Map m)
        {
            XmlParagon xa = GetXmlParagon(bc);

            if (xa != null)
            {
                return(xa.XmlCheckConvert(bc, location, m));
            }
            else
            {
                return(Paragon.CheckConvert(bc, location, m));
            }
        }
Ejemplo n.º 2
0
        public static BaseCreature Spawn(int level, Point3D p, Map map, Mobile target, bool guardian)
        {
            if (map == null)
            {
                return(null);
            }

            BaseCreature c = Spawn(level, p, guardian);



            if (c != null)
            {
                bool spawned = false;

                for (int i = 0; !spawned && i < 10; ++i)
                {
                    int x = p.X - 3 + Utility.Random(7);
                    int y = p.Y - 3 + Utility.Random(7);

                    if (map.CanSpawnMobile(x, y, p.Z))
                    {
                        c.MoveToWorld(new Point3D(x, y, p.Z), map);

                        if (HalloweenEventController.Instance != null && HalloweenEventController.Halloween && HalloweenCorruption.CheckCorrupt(c, new Point3D(x, y, p.Z), map))
                        {
                            c.IsCorrupt = true;
                        }

                        if (!c.IsCorrupt && Paragon.CheckConvert(c, new Point3D(x, y, p.Z), map))
                        {
                            c.IsParagon = true;
                        }

                        spawned = true;
                    }
                    else
                    {
                        int z = map.GetAverageZ(x, y);

                        if (map.CanSpawnMobile(x, y, z))
                        {
                            c.MoveToWorld(new Point3D(x, y, z), map);
                            spawned = true;

                            if (HalloweenEventController.Instance != null && HalloweenEventController.Halloween && HalloweenCorruption.CheckCorrupt(c, new Point3D(x, y, z), map))
                            {
                                c.IsCorrupt = true;
                            }

                            if (!c.IsCorrupt && Paragon.CheckConvert(c, new Point3D(x, y, z), map))
                            {
                                c.IsParagon = true;
                            }
                        }
                    }
                }

                if (!spawned)
                {
                    c.Delete();
                    return(null);
                }

                c.HomeMap = c.Map;

                if (target != null)
                {
                    c.Combatant = target;
                }

                return(c);
            }

            return(null);
        }