Example #1
0
        public static void LoadAll()
        {
            if (GOMgr.Loaded)
            {
                return;
            }
            ContentMgr.Load <GOEntry>();
            ContentMgr.Load <GOSpawnEntry>();
            ContentMgr.Load <Asda2Portal>();
            new GOPortalEntry().FinalizeDataHolder();
            foreach (GOEntry goEntry in GOMgr.Entries.Values)
            {
                if (goEntry.LinkedTrapId > 0U)
                {
                    goEntry.LinkedTrap = GOMgr.GetEntry(goEntry.LinkedTrapId) as GOTrapEntry;
                }
                if (goEntry.SpawnEntries.Count == 0)
                {
                    goEntry.SpawnEntries.Add(new GOSpawnEntry()
                    {
                        Entry     = goEntry,
                        Rotations = new float[0],
                        State     = GameObjectState.Enabled
                    });
                }
            }

            GOMgr.SetSummonSlots();
            GOMgr.Loaded = true;
        }
Example #2
0
        public static Portal Create(IWorldLocation where, IWorldLocation target)
        {
            GOEntry entry = GOMgr.GetEntry(GOEntryId.Portal, true);

            if (entry == null)
            {
                return(null);
            }
            Portal portal = (Portal)GameObject.Create(entry, where, null, null);

            portal.Target = target;
            return(portal);
        }
Example #3
0
        public static Portal Create(IWorldLocation where, IWorldLocation target)
        {
            var entry = GOMgr.GetEntry(GOPortalEntry.PortalId);

            if (entry == null)
            {
                return(null);
            }
            var portal = (Portal)Create(entry, where);

            portal.Target = target;
            return(portal);
        }
Example #4
0
        public static void HandleGOQuery(IRealmClient client, RealmPacketIn packet)
        {
            uint id = packet.ReadUInt32();

            if (!GOMgr.Loaded)
            {
                return;
            }
            GOEntry entry = GOMgr.GetEntry(id);

            if (entry == null)
            {
                return;
            }
            GOMgr.SendGameObjectInfo(client, entry);
        }
Example #5
0
        public static Portal Create(MapId mapId, Vector3 pos, MapId targetMap, Vector3 targetPos)
        {
            GOEntry entry = GOMgr.GetEntry(GOEntryId.Portal, true);

            if (entry == null)
            {
                return(null);
            }
            Map nonInstancedMap = World.GetNonInstancedMap(mapId);

            if (nonInstancedMap == null)
            {
                throw new ArgumentException("Invalid MapId (not a Continent): " + mapId);
            }
            Portal portal = (Portal)GameObject.Create(entry, new WorldLocationStruct(mapId, pos, 1U),
                                                      null, null);

            portal.Target = new WorldLocation(targetMap, targetPos, 1U);
            nonInstancedMap.AddObject(portal);
            return(portal);
        }
Example #6
0
        public static Portal Create(MapId mapId, Vector3 pos, MapId targetMap, Vector3 targetPos)
        {
            GOEntry entry = GOMgr.GetEntry(GOEntryId.Portal, true);

            if (entry == null)
            {
                return((Portal)null);
            }
            Map nonInstancedMap = WCell.RealmServer.Global.World.GetNonInstancedMap(mapId);

            if (nonInstancedMap == null)
            {
                throw new ArgumentException("Invalid MapId (not a Continent): " + (object)mapId);
            }
            Portal portal = (Portal)GameObject.Create(entry, (IWorldLocation) new WorldLocationStruct(mapId, pos, 1U),
                                                      (GOSpawnEntry)null, (GOSpawnPoint)null);

            portal.Target = (IWorldLocation) new WorldLocation(targetMap, targetPos, 1U);
            nonInstancedMap.AddObject((WorldObject)portal);
            return(portal);
        }
Example #7
0
        public static Portal Create(MapId mapId, Vector3 pos, MapId targetMap, Vector3 targetPos)
        {
            var entry = GOMgr.GetEntry(GOPortalEntry.PortalId);

            if (entry == null)
            {
                return(null);
            }
            var rgn = World.GetNonInstancedMap(mapId);

            if (rgn == null)
            {
                throw new ArgumentException("Invalid MapId (not a Continent): " + mapId);
            }

            var portal = (Portal)Create(entry, new WorldLocationStruct(mapId, pos));

            portal.Target = new WorldLocation(targetMap, targetPos);
            rgn.AddObject(portal);
            return(portal);
        }
Example #8
0
 private static void SetSummonSlots()
 {
     foreach (Spell spell in SpellHandler.ById)
     {
         if (spell != null)
         {
             foreach (SpellEffect effect in spell.Effects)
             {
                 if (effect.EffectType >= SpellEffectType.SummonObjectSlot1 &&
                     effect.EffectType <= SpellEffectType.SummonObjectSlot4)
                 {
                     GOEntry entry = GOMgr.GetEntry((uint)effect.MiscValue);
                     if (entry != null)
                     {
                         entry.SummonSlotId = (uint)(effect.EffectType - 104);
                     }
                 }
             }
         }
     }
 }
Example #9
0
 public static void LoadAllLater()
 {
     ServerApp <WCell.RealmServer.RealmServer> .IOQueue.AddMessage((Action)(() => GOMgr.LoadAll()));
 }
Example #10
0
 public static void Initialize()
 {
     GOMgr.LoadAll();
 }