public static void WriteAll() { DBSetup.Initialize(); World.EnsureMapDataLoaded(); SpellHandler.Initialize(); FactionMgr.Initialize(); SkillHandler.Initialize(); TalentMgr.Initialize(); WriteZoneEnum(); WriteMapEnum(); WriteSkillEnums(); WriteRangeEnum(); WriteFactionEnums(); WriteSpellFocusEnum(); WriteSpellId(); WriteSpellMechanicEnum(); WriteTalentEnums(); WriteItemId(); WriteItemSetId(); WriteNpcId(); WriteGOEntryId(); WriteRealmCategory(); NPCMgr.ForceInitialize(); WriteRideEnum(); }
public static void WriteNpcId() { RealmDBMgr.Initialize(); SpellHandler.LoadSpells(); FactionMgr.Initialize(); NPCMgr.LoadAll(); WriteEnum("NPCId", " : uint", "NPCs", NPCMgr.GetAllEntries(), false, (item) => { return(item != null); }, (item) => { return(item.DefaultName); }, entry => { var strs = new List <string>(); if (entry.DefaultTitle.Length > 0) { strs.Add("Title: " + entry.DefaultTitle); } if (entry.MinLevel > 0) { strs.Add("Level: " + entry.MinLevel + (entry.MaxLevel != entry.MinLevel ? " - " + entry.MaxLevel : "")); } if (entry.Rank != CreatureRank.Normal) { strs.Add("Rank: " + entry.Rank + (entry.IsLeader ? " (Leader)" : "")); } else if (entry.IsLeader) { strs.Add("Leader"); } return(strs.ToString("\n")); }, (item, name) => null, (item) => { return(item.Id.ToString()); }); }
public static void WriteAllEnums() { RealmDBMgr.Initialize(); ContentMgr.Initialize(); World.InitializeWorld(); SpellHandler.LoadSpells(); FactionMgr.Initialize(); SpellHandler.Initialize2(); AreaTriggerMgr.Initialize(); WriteZoneEnum(); WriteMapEnum(); WriteSkillEnums(); WriteRangeEnum(); WriteFactionEnums(); WriteSpellFocusEnum(); WriteSpellId(); WriteSpellMechanicEnum(); WriteTalentEnums(); WriteItemId(); WriteItemSetId(); WriteNpcId(); WriteCreatureFamilyId(); WriteGOEntryId(); WriteRealmCategory(); WriteTotemCategories(); WriteAreaTriggers(); //NPCMgr.ForceInitialize(); //WriteRideEnum(); }
public static void LoadEntries(bool force) { if (!force && entriesLoaded) { return; } try { Loading = true; FactionMgr.Initialize(); ContentMgr.Load <NPCEquipmentEntry>(force); //Dont move this into LoadTrainers, the templates must //be loaded before NPC Entries ContentMgr.Load <TrainerSpellTemplate>(force); ContentMgr.Load <NPCEntry>(force); //foreach (var entry in Entries) //{ // if (entry != null && entry.Template == null) // { // ContentHandler.OnInvalidData("NPCEntry had no corresponding NPCTemplate: " + entry.NPCId); // } //} LoadTrainers(force); // mount-entries //foreach (var spell in SpellHandler.ById) //{ // if (spell != null && spell.IsMount) // { // var id = (MountId)spell.Effects[0].MiscValue; // if ((int)id >= Entries.Length) // { // log.Warn("Invalid Mount Id: " + id); // spell.Effects[0].EffectType = SpellEffectType.Dummy; // reach-around fix for the time being // continue; // } // var entry = Entries[(int)id]; // if (entry != null) // { // Mounts[id] = entry; // } // } //} EntriesLoaded = true; } finally { Loading = false; } }
public static void Init() { RealmDBMgr.Initialize(); var mgr = RealmServer.RealmServer.InitMgr; RealmAddonMgr.Initialize(mgr); mgr.PerformInitialization(); ContentMgr.Initialize(); SpellHandler.LoadSpells(); FactionMgr.Initialize(); SpellHandler.Initialize2(); }
public void TestInitialReputations() { Setup.EnsureDBSetup(); FactionMgr.Initialize(); var stormWind = FactionMgr.Get(FactionId.Stormwind); var bootyBay = FactionMgr.Get(FactionId.BootyBay); Assert.IsNotNull(bootyBay); var reputation = new Reputation(new ReputationRecord(), bootyBay, 1000, ReputationFlags.None); Asser.FlatNotSet(reputation.Flags, ReputationFlags.AtWar); }
public static void WriteNpcId() { SpellHandler.Initialize(); FactionMgr.Initialize(); NPCMgr.ForceInitialize(); WriteEnum("NPCId", "NPCs", NPCMgr.Prototypes, false, (item) => { return(item.Entry != null); }, (item) => { return(item.Entry.Name); }, prototype => { var strs = new List <string>(); if (prototype.Entry.Title.Length > 0) { strs.Add("Title: " + prototype.Entry.Title); } if (prototype.MinLevel > 0) { strs.Add("Level: " + prototype.MinLevel + (prototype.MaxLevel != prototype.MinLevel ? " - " + prototype.MaxLevel : "")); } if (prototype.DefaultFaction != null) { strs.Add("Faction: " + prototype.DefaultFaction); } if (prototype.Entry.Rank != CreatureRank.Normal) { strs.Add("Rank: " + prototype.Entry.Rank + (prototype.Entry.IsLeader ? " (Leader)" : "")); } else if (prototype.Entry.IsLeader) { strs.Add("Leader"); } if (prototype.Entry.Spells != null && prototype.Entry.Spells.Length > 0) { strs.Add("Spells: " + prototype.Entry.Spells.ToString(", ")); } if (prototype.Auras != null && prototype.Auras.Length > 0) { strs.Add("Auras: " + prototype.Auras.ToString(", ")); } return(strs.ToString("\n")); }, (item, name) => null, (item) => { return(item.Entry.Id.ToString()); }); }
public static void WriteFactionEnums() { FactionMgr.Initialize(); WriteEnum <Faction>("FactionId", "Factions", FactionMgr.ById, (faction) => { return(true); }, (faction) => { return(faction.Entry.Name); }, (faction) => { return(((int)faction.Id).ToString()); }); WriteEnum <Faction>("FactionRepListId", "Factions", FactionMgr.ByRepId, (faction) => { return(true); }, (faction) => { return(faction.Entry.Name); }, (faction) => { return(((int)faction.RepListId).ToString()); }); WriteEnum <Faction>("FactionTemplateId", "Factions", FactionMgr.ByTemplateId, (faction) => { return(true); }, (faction) => { return(faction.Entry.Name); }, (faction) => { return(((int)faction.Template.Id).ToString()); }); }
public static void WriteFactionEnums() { FactionMgr.Initialize(); WriteEnum("FactionId", " : uint", "Factions", FactionMgr.ById, (faction) => { return(true); }, (faction) => { return(faction.Entry.Name); }, (faction) => { return(((int)faction.Id).ToString()); }); WriteEnum("FactionReputationIndex", "", "Factions", FactionMgr.ByReputationIndex, (faction) => true, (faction) => faction.Entry.Name, (faction) => ((int)faction.ReputationIndex).ToString()); WriteEnum("FactionTemplateId", " : uint", "Factions", FactionMgr.ByTemplateId, (faction) => { return(true); }, (faction) => { return(faction.Entry.Name); }, (faction) => { return(((int)faction.Template.Id).ToString()); }); }
public static void LoadEntries(bool force) { if (!force) { if (NPCMgr.entriesLoaded) { return; } } try { NPCMgr.Loading = true; FactionMgr.Initialize(); ContentMgr.Load <NPCEntry>(force); NPCMgr.EntriesLoaded = true; } finally { NPCMgr.Loading = false; } }
public static void WriteItemId() { World.InitializeWorld(); SpellHandler.LoadSpells(); FactionMgr.Initialize(); NPCMgr.LoadAll(); ItemMgr.ForceInitialize(); WriteEnum("ItemId", " : uint", "Items", ItemMgr.Templates, false, (item) => { return(item.DefaultName != null); }, (item) => { return(item.DefaultName); }, template => { var strs = new List <string>(); if (!string.IsNullOrEmpty(template.DefaultDescription)) { strs.Add("Desc: " + template.DefaultDescription); } if (template.InventorySlotType != InventorySlotType.None) { strs.Add(template.InventorySlotType.ToString()); } if (template.Level > 0) { strs.Add("Level: " + template.Level); } if (template.Set != null) { strs.Add("Set: " + template.Set); } if (template.Class != ItemClass.None) { strs.Add("Class: " + template.Class); } return(strs.ToString("\n")); }, (item, name) => null, (item) => { return(item.Id.ToString()); }); }
public NPC CreateVendor(FactionId faction) { FactionMgr.Initialize(); return(CreateVendor(FactionMgr.Get(faction))); }
public NPC CreateMob(FactionId factionId) { FactionMgr.Initialize(); return(CreateMob(FactionMgr.Get(factionId))); }
public static void WriteSpellId() { RealmDBMgr.Initialize(); ContentMgr.Initialize(); World.InitializeWorld(); SpellHandler.LoadSpells(); FactionMgr.Initialize(); SpellHandler.Initialize2(); var noSpell = new Spell { Name = "None", Effects = new SpellEffect[0] }; SpellHandler.ById[0] = noSpell; WriteEnum("SpellId", " : uint", "Spells", SpellHandler.ById, false, (spell) => { return(true); }, (spell) => { return(spell.FullName + spell.RankDesc); }, (spell) => { TalentEntry talent = spell.Talent; var descs = new List <string>(); if (spell.IsPassive) { descs.Add("Passive"); } if (talent != null) { descs.Add("Talent"); } else if (spell.Ability != null && spell.Ability.Skill != null && spell.Ability.Skill.Category != SkillCategory.Invalid) { descs.Add(spell.Ability.Skill.Category.ToString()); } if (spell.IsTeachSpell) { descs.Add("Teachspell"); } if (spell.Level > 0) { descs.Add("Level: " + spell.Level); } string desc = string.Join(", ", descs.ToArray()); if (!string.IsNullOrEmpty(spell.Description)) { if (desc.Length > 0) { desc += "\n"; } desc += spell.Description; } return(desc); }, (spell, name) => { return(null); }, (spell) => { return(spell.Id.ToString()); }); }
public override void Process(CmdTrigger <ToolCmdArgs> trigger) { FactionMgr.Initialize(); Pepsi.FactionStudies.WriteFactionTemplatesByFlag(); }
public static void Init(TestContext testContext) { Setup.EnsureBasicSetup(); FactionMgr.Initialize(); ArchetypeMgr.EnsureInitialize(); }