public static void LoadAll() { if (Loaded) { return; } ContentMgr.Load <GOEntry>(); ContentMgr.Load <GOSpawnEntry>(); ContentMgr.Load <Asda2Portal>(); new GOPortalEntry().FinalizeDataHolder(); foreach (GOEntry goEntry in Entries.Values) { if (goEntry.LinkedTrapId > 0U) { goEntry.LinkedTrap = GetEntry(goEntry.LinkedTrapId) as GOTrapEntry; } if (goEntry.SpawnEntries.Count == 0) { goEntry.SpawnEntries.Add(new GOSpawnEntry { Entry = goEntry, Rotations = new float[0], State = GameObjectState.Enabled }); } } SetSummonSlots(); Loaded = true; }
internal static void EnsureBattlemasterRelations() { if (NPCMgr.Loaded && Loaded) { ContentMgr.Load <BattlemasterRelation>(); } }
public void FinalizeDataHolder() { NPCSpawnEntry spawnEntry = NPCMgr.GetSpawnEntry(NPCSpawnId); IGossipEntry entry1 = GossipMgr.GetEntry(GossipId); if (spawnEntry == null) { ContentMgr.OnInvalidDBData("{0} refers to invalid spawn id: {1}", (object)GetType(), (object)this); } else if (entry1 == null) { ContentMgr.OnInvalidDBData("{0} has invalid GossipId: {1}", (object)GetType(), (object)this); } else { NPCEntry entry2 = spawnEntry.Entry; if (spawnEntry.DefaultGossip == null) { spawnEntry.DefaultGossip = new GossipMenu(entry1); } else { spawnEntry.DefaultGossip.GossipEntry = entry1; } } }
public void FinalizeDataHolder() { var spawn = NPCMgr.GetSpawnEntry(NPCSpawnId); var gossipEntry = GossipMgr.GetEntry(GossipId); if (spawn == null) { ContentMgr.OnInvalidDBData("{0} refers to invalid spawn id: {1}", GetType(), this); } else if (gossipEntry == null) { ContentMgr.OnInvalidDBData("{0} has invalid GossipId: {1}", GetType(), this); } else { var entry = spawn.Entry; if (entry.DefaultGossip == null) { entry.DefaultGossip = new GossipMenu(gossipEntry); } else { entry.DefaultGossip.GossipEntry = gossipEntry; } //entry.NPCFlags |= NPCFlags.Gossip; } }
public static void Initialize() { if (ArchetypeMgr.loaded) { return; } ArchetypeMgr.InitClasses(); ArchetypeMgr.InitRaces(); ContentMgr.Load <Archetype>(); if (ItemMgr.Loaded) { ArchetypeMgr.LoadItems(); } for (int index = 0; index < SpellLines.SpellLinesByClass.Length; ++index) { SpellLine[] spellLineArray = SpellLines.SpellLinesByClass[index]; if (spellLineArray != null) { BaseClass baseClass = ArchetypeMgr.GetClass((ClassId)index); if (baseClass != null) { baseClass.SpellLines = spellLineArray; } } } ArchetypeMgr.loaded = true; }
/// <summary> /// Load given Spell-data from DB /// </summary> private static void LoadOverrides() { var mapper = ContentMgr.GetMapper <Spell>(); mapper.AddObjectsUInt(ById); ContentMgr.Load(mapper); }
public static void LoadAll() { if (Loaded) { return; } ContentMgr.Load <ItemTemplate>(); OnLoaded(); foreach (ItemTemplate template in Templates) { if (template != null) { template.InitializeTemplate(); } } TruncSets(); if (ArchetypeMgr.Loaded) { ArchetypeMgr.LoadItems(); } SpellHandler.InitTools(); LoadItemCharRelations(); Singleton <AuctionMgr> .Instance.LoadItems(); if (QuestMgr.Loaded) { EnsureItemQuestRelations(); } ServerApp <RealmServer> .InitMgr.SignalGlobalMgrReady(typeof(ItemMgr)); Loaded = true; }
public static void Init() { ContentMgr.Load <SetItemDataRecord>(); foreach (var itemRecords in ItemSetsRecordsByItemIds) { } }
public void FinalizeDataHolder() { if ((Spell = SpellHandler.Get(SpellId)) == null) { ContentMgr.OnInvalidDBData("SpellId is invalid in " + this); } else if (RequiredSpellId != SpellId.None && SpellHandler.Get(RequiredSpellId) == null) { ContentMgr.OnInvalidDBData("RequiredSpellId is invalid in " + this); } else if (RequiredSkillId != SkillId.None && SkillHandler.Get(RequiredSkillId) == null) { ContentMgr.OnInvalidDBData("RequiredSkillId is invalid in " + this); } else { NPCEntry entry = NPCMgr.GetEntry(TrainerId); if (entry == null) { ContentMgr.OnInvalidDBData("TrainerId is invalid in " + this); } else { if (RequiredLevel == 0) { RequiredLevel = Spell.Level; } if (entry.TrainerEntry == null) { entry.TrainerEntry = new TrainerEntry(); } entry.TrainerEntry.AddSpell(this); } } }
/// <summary> /// Teleports into an instance /// </summary> /// <param name="chr"></param> /// <param name="trigger"></param> /// <returns></returns> public static bool HandleTeleport(Character chr, AreaTrigger trigger) { var mapInfo = World.GetMapTemplate(trigger.Template.TargetMap); #if DEBUG chr.SendSystemMessage("Target location: {0}", trigger.Template.TargetMap); #endif if (mapInfo.IsInstance) { if (mapInfo.Type == MapType.Normal) { InstanceMgr.LeaveInstance(chr, mapInfo, trigger.Template.TargetPos); return(true); } else { return(InstanceMgr.EnterInstance(chr, mapInfo, trigger.Template.TargetPos)); } } else if (mapInfo.BattlegroundTemplate == null) { var rgn = World.GetNonInstancedMap(mapInfo.Id); if (rgn != null) { chr.TeleportTo(rgn, trigger.Template.TargetPos, trigger.Template.TargetOrientation); return(true); } else { ContentMgr.OnInvalidDBData("Invalid Map: " + rgn); } } return(true); }
public static void WriteContentStubs() { Utility.Measure("DBSetup.Initialize()", 1, () => RealmDBMgr.Initialize()); Utility.Measure("ContentHandler.SaveDefaultStubs()", 1, ContentMgr.SaveDefaultStubs); ContentMgr.SaveDefaultStubs(); }
/// <summary>Depends on Table-Creation (Third)</summary> public static void Initialize() { ContentMgr.Load <WorldZoneLocation>(); WorldLocationMgr.LocationCache = WorldLocationMgr.WorldLocations.Values.ToArray <INamedWorldZoneLocation>(); WorldLocationMgr.Stormwind = WorldLocationMgr.GetFirstMatch("Stormwind"); WorldLocationMgr.Orgrimmar = WorldLocationMgr.GetFirstMatch("Orgrimmar"); }
public static void LoadSpells(bool init) { if (!loaded) { InitEffectHandlers(); LoadOtherDBCs(); SpellEffect.InitMiscValueTypes(); loaded = true; Spell.InitDbcs(); new DBCReader <Spell.SpellDBCConverter>(RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_SPELL)); ContentMgr.Load <SpellLearnRelation>(); InitSummonHandlers(); SkillHandler.Initialize(); TalentMgr.Initialize(); SpellLines.InitSpellLines(); ContentMgr.Load <SpellProcEventEntry>(); ProcEventHelper.PatchSpells(ById); } if (init) { Initialize2(); } }
public static void LoadAll() { if (!Loaded) { ContentMgr.Load <ItemStatsInfo>(); ContentMgr.Load <RegularShopRecord>(); ContentMgr.Load <Asda2ItemTemplate>(); ContentMgr.Load <BoosterDrop>(); ContentMgr.Load <PackageDrop>(); ContentMgr.Load <DecompositionDrop>(); ContentMgr.Load <WarShopDataRecord>(); ContentMgr.Load <AvatarDisasembleRecord>(); ContentMgr.Load <Asda2BossSummonRecord>(); ContentMgr.Load <ItemCombineDataRecord>(); ContentMgr.Load <Asda2GuildWaveItemRecord>(); OnLoaded(); foreach (var templ in Templates) { if (templ != null) { templ.InitializeTemplate(); } } Loaded = true; } }
public override void Process(CmdTrigger <RealmServerCmdArgs> trigger) { trigger.Reply("Checking Content-Definitions..."); var count = ContentMgr.Check(trigger.Reply); trigger.Reply("Done - Found {0} error(s).", count); }
public static void Init() { ContentMgr.Load <FishingFishInfoRecord>(); ContentMgr.Load <FishingBaseInfoRecord>(); ContentMgr.Load <FishingSpotInfoRecord>(); ContentMgr.Load <FishingBookTemplate>(); }
public void FinalizeDataHolder() { SpawnEntry = NPCMgr.GetSpawnEntry(SpawnId); if (SpawnEntry == null) { ContentMgr.OnInvalidDBData("{0} had an invalid SpawnId.", this); } else { var added = false; var cur = SpawnEntry.Waypoints.First; while (cur != null) { if (cur.Value.Id > Id) { Node = cur.List.AddBefore(cur, this); added = true; break; } if (cur.Value.Id == Id) { ContentMgr.OnInvalidDBData("Found multiple Waypoints with the same Id {0} for SpawnEntry {1}", Id, SpawnEntry); return; } cur = cur.Next; } if (!added) { SpawnEntry.HasDefaultWaypoints = false; Node = SpawnEntry.Waypoints.AddLast(this); } } }
public void FinalizeDataHolder() { MapId = BattlegroundMgr.BattlemasterListReader.Entries[(int)Id].MapId; MapTemplate = World.GetMapTemplate(MapId); if (MapTemplate == null) { ContentMgr.OnInvalidDBData("BattlegroundTemplate had invalid MapId: {0} (#{1})", MapId, (int)MapId); return; } if (BattlegroundMgr.Templates.Length <= (int)Id) { ContentMgr.OnInvalidDBData("BattlegroundTemplate had invalid BG-Id: {0} (#{1})", Id, (int)Id); return; } MapTemplate.BattlegroundTemplate = this; Difficulties = new PvPDifficultyEntry[BattlegroundMgr.PVPDifficultyReader.Entries.Values.Count(entry => (entry.mapId == MapId))]; foreach (var entry in BattlegroundMgr.PVPDifficultyReader.Entries.Values.Where(entry => (entry.mapId == MapId))) { Difficulties[entry.bracketId] = entry; } MinLevel = MapTemplate.MinLevel = Difficulties.First().minLevel; MaxLevel = MapTemplate.MaxLevel = Difficulties.Last().maxLevel; BattlegroundMgr.Templates[(int)Id] = this; CreateQueues(); SetStartPos(); }
public new void FinalizeDataHolder() { if ((Spell = SpellHandler.Get(SpellId)) == null) { ContentMgr.OnInvalidDBData("SpellId is invalid in " + this); } else if (RequiredSpellId != SpellId.None && SpellHandler.Get(RequiredSpellId) == null) { ContentMgr.OnInvalidDBData("RequiredSpellId is invalid in " + this); } else if (RequiredSkillId != SkillId.None && SkillHandler.Get(RequiredSkillId) == null) { ContentMgr.OnInvalidDBData("RequiredSkillId is invalid in " + this); } else { if (RequiredLevel == 0) { RequiredLevel = Spell.Level; } if (!NPCMgr.TrainerSpellTemplates.ContainsKey(TrainerTemplateId)) { NPCMgr.TrainerSpellTemplates.Add(TrainerTemplateId, new List <TrainerSpellEntry>()); } NPCMgr.TrainerSpellTemplates[TrainerTemplateId].Add(this); } }
/// <summary>Loads the quest templates.</summary> /// <returns></returns> public static bool LoadAll() { if (!QuestMgr.Loaded) { QuestMgr.Templates = new QuestTemplate[30000]; ContentMgr.Load <QuestTemplate>(); ContentMgr.Load <QuestPOI>(); ContentMgr.Load <QuestPOIPoints>(); QuestMgr.CreateQuestRelationGraph(); QuestMgr.EnsureCharacterQuestsLoaded(); QuestMgr.AddSpellCastObjectives(); if (ItemMgr.Loaded) { ItemMgr.EnsureItemQuestRelations(); } foreach (QuestTemplate template1 in QuestMgr.Templates) { if (template1 != null) { ItemTemplate template2 = ItemMgr.GetTemplate(template1.SrcItemId); if (template2 != null && template1.SrcItemId != (Asda2ItemId)0 && !template1.Starters.Contains((IQuestHolderEntry)template2)) { template1.ProvidedItems.Add(new Asda2ItemStackDescription(template1.SrcItemId, 1)); } } } QuestMgr.Loaded = true; QuestMgr.log.Debug("{0} Quests loaded.", QuestMgr._questCount); } return(true); }
public void FinalizeDataHolder() { this.MapId = BattlegroundMgr.BattlemasterListReader.Entries[(int)this.Id].MapId; this.MapTemplate = WCell.RealmServer.Global.World.GetMapTemplate(this.MapId); if (this.MapTemplate == null) { ContentMgr.OnInvalidDBData("BattlegroundTemplate had invalid MapId: {0} (#{1})", (object)this.MapId, (object)this.MapId); } else if (BattlegroundMgr.Templates.Length <= (int)this.Id) { ContentMgr.OnInvalidDBData("BattlegroundTemplate had invalid BG-Id: {0} (#{1})", (object)this.Id, (object)(int)this.Id); } else { this.MapTemplate.BattlegroundTemplate = this; this.Difficulties = new PvPDifficultyEntry[BattlegroundMgr.PVPDifficultyReader.Entries.Values.Count <PvPDifficultyEntry>( (Func <PvPDifficultyEntry, bool>)(entry => entry.mapId == this.MapId))]; foreach (PvPDifficultyEntry pdifficultyEntry in BattlegroundMgr.PVPDifficultyReader.Entries.Values .Where <PvPDifficultyEntry>((Func <PvPDifficultyEntry, bool>)(entry => entry.mapId == this.MapId))) { this.Difficulties[pdifficultyEntry.bracketId] = pdifficultyEntry; } this.MinLevel = this.MapTemplate.MinLevel = ((IEnumerable <PvPDifficultyEntry>) this.Difficulties) .First <PvPDifficultyEntry>().minLevel; this.MaxLevel = this.MapTemplate.MaxLevel = ((IEnumerable <PvPDifficultyEntry>) this.Difficulties) .Last <PvPDifficultyEntry>().maxLevel; BattlegroundMgr.Templates[(int)this.Id] = this; this.CreateQueues(); this.SetStartPos(); } }
public void FinalizeDataHolder() { Template = ItemMgr.GetTemplate(ItemId); if (Template == null) { ContentMgr.OnInvalidDBData("{0} has invalid ItemId: {1} ({2})", this, ItemId, (int)ItemId); } else { var list = NPCMgr.GetOrCreateVendorList(VendorId); // set defaults if (StockAmount < 0) { StockAmount = Template.StockAmount; } if (StockRefillDelay < 0) { StockRefillDelay = Template.StockRefillDelay; } remainingStackAmount = StockAmount; list.Add(this); } }
public static void LoadAll() { if (!Loaded) { ContentMgr.Load <GOEntry>(); ContentMgr.Load <GOSpawnEntry>(); ContentMgr.Load <Asda2Portal>(); new GOPortalEntry().FinalizeDataHolder(); foreach (var entry in Entries.Values) { if (entry.LinkedTrapId > 0) { entry.LinkedTrap = GetEntry(entry.LinkedTrapId) as GOTrapEntry; } if (entry.SpawnEntries.Count == 0) { // make sure, every Entry has at least one template entry.SpawnEntries.Add(new GOSpawnEntry { Entry = entry, Rotations = new float[0], State = GameObjectState.Enabled }); } } SetSummonSlots(); Loaded = true; } }
/// <summary> /// Initializes the duel after a new Duel has been proposed /// </summary> private void Initialize() { this.m_flag = GameObject.Create(GOEntryId.DuelFlag, (IWorldLocation) new WorldLocationStruct(this.m_Map, (this.m_challenger.Position + this.m_rival.Position) / 2f, 1U), (GOSpawnEntry)null, (GOSpawnPoint)null); if (this.m_flag == null) { ContentMgr.OnInvalidDBData("Cannot start Duel: DuelFlag-GameObject (ID: {0}) does not exist.", (object)336); this.Cancel(); } else { this.m_flag.Phase = this.m_challenger.Phase; ((DuelFlagHandler)this.m_flag.Handler).Duel = this; this.m_flag.CreatedBy = this.m_challenger.EntityId; this.m_flag.Level = this.m_challenger.Level; this.m_flag.AnimationProgress = byte.MaxValue; this.m_flag.Position = this.m_challenger.Position; this.m_flag.Faction = this.m_challenger.Faction; this.m_flag.ScaleX = this.m_challenger.ScaleX; this.m_flag.ParentRotation4 = 1f; this.m_flag.Orientation = this.m_challenger.Orientation; this.m_Map.AddMessage((IMessage) new Message((Action)(() => DuelHandler.SendRequest(this.m_flag, this.m_challenger, this.m_rival)))); this.m_challenger.SetEntityId((UpdateFieldId)PlayerFields.DUEL_ARBITER, this.m_flag.EntityId); this.m_rival.SetEntityId((UpdateFieldId)PlayerFields.DUEL_ARBITER, this.m_flag.EntityId); } }
/// <summary> /// Automatically called after NPCs are initialized /// </summary> internal static void LoadNPCRelations() { if (ContentMgr.Load <NPCGossipRelation>()) { AddDefaultGossipOptions(); } }
public static void WriteInstanceStubs() { var dir = ToolConfig.DefaultAddonSourceDir + "Instances/"; RealmDBMgr.Initialize(); ContentMgr.Initialize(); World.InitializeWorld(); InstanceMgr.Initialize(); foreach (var instance in InstanceMgr.InstanceInfos) { var className = instance.Id.ToString(); var baseClass = typeof(BaseInstance).Name; var file = dir + className + ".cs"; if (!File.Exists(file)) { using (var writer = new CodeFileWriter(file, "WCell.Addons.Default.Instances", className, "class", ": " + baseClass, "WCell.RealmServer.Instances")) { } } } }
/// <summary> /// Initializes the duel after a new Duel has been proposed /// </summary> private void Initialize() { m_flag = GameObject.Create(GOEntryId.DuelFlag, new WorldLocationStruct(m_Map, (m_challenger.Position + m_rival.Position) / 2f, 1U), null, null); if (m_flag == null) { ContentMgr.OnInvalidDBData("Cannot start Duel: DuelFlag-GameObject (ID: {0}) does not exist.", (object)336); Cancel(); } else { m_flag.Phase = m_challenger.Phase; ((DuelFlagHandler)m_flag.Handler).Duel = this; m_flag.CreatedBy = m_challenger.EntityId; m_flag.Level = m_challenger.Level; m_flag.AnimationProgress = byte.MaxValue; m_flag.Position = m_challenger.Position; m_flag.Faction = m_challenger.Faction; m_flag.ScaleX = m_challenger.ScaleX; m_flag.ParentRotation4 = 1f; m_flag.Orientation = m_challenger.Orientation; m_Map.AddMessage(new Message(() => DuelHandler.SendRequest(m_flag, m_challenger, m_rival))); m_challenger.SetEntityId(PlayerFields.DUEL_ARBITER, m_flag.EntityId); m_rival.SetEntityId(PlayerFields.DUEL_ARBITER, m_flag.EntityId); } }
private static void LoadMapData() { Instance.WorldStates = new WorldStateCollection(Instance, Constants.World.WorldStates.GlobalStates); new DBCReader <MapConverter>(RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_MAPS)); new DBCReader <MapDifficultyConverter>(RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_MAPDIFFICULTY)); // add existing MapTemplate objects to mapper var mapper = ContentMgr.GetMapper <MapTemplate>(); mapper.AddObjectsUInt(s_MapTemplates); // Add additional data from DB ContentMgr.Load <MapTemplate>(); // when only updating, it won't call FinalizeAfterLoad automatically: foreach (var rgn in s_MapTemplates) { if (rgn != null) { rgn.FinalizeDataHolder(); } } SetupBoundaries(); }
public void FinalizeDataHolder() { var trigger = AreaTriggerMgr.AreaTriggers.Get(Id); if (trigger == null) { ContentMgr.OnInvalidDBData("AreaTriggerEntry {0} (#{1}, Type: {2}) had invalid AreaTrigger-id.", Name, Id, Type); return; } else { trigger.Template = this; } if (TargetPos.IsSet) { var map = World.GetMapTemplate(TargetMap); if (map != null) { Type = AreaTriggerType.Teleport; ArrayUtil.AddOnlyOne(ref map.EntrancePositions, TargetPos); } } Handler = AreaTriggerMgr.GetHandler(Type); }
public void FinalizeDataHolder() { Spell spell = SpellHandler.Get(this.SpellId); if (spell == null) { ContentMgr.OnInvalidDBData(this.GetType().Name + " for \"{0} {1}\" refers to invalid Spell: {2}.", (object)this.Race, (object)this.Class, (object)this); } else { List <Archetype> archetypes = ArchetypeMgr.GetArchetypes(this.Race, this.Class); if (archetypes == null) { ContentMgr.OnInvalidDBData(this.GetType().Name + " \"{0}\" refers to invalid Archetype: {1} {2}.", (object)this, (object)this.Race, (object)this.Class); } else { foreach (Archetype archetype in archetypes) { archetype.Spells.Add(spell); } } } }