/// <summary> /// Creates a new custom NPCEntry with the given Id. /// The id must be hardcoded, so the client will always recognize it in its cache. /// </summary> public static void AddEntry(uint id, NPCEntry entry) { if (id < (uint)NPCId.End) { throw new ArgumentException("Cannot create an NPCEntry with id < NPCId.End (" + (int)NPCId.End + ")"); } entry.Id = id; CustomEntries.Add(id, entry); entry.FinalizeDataHolder(); }
/// <summary> /// Creates a new custom NPCEntry with the given Id. /// The id must be hardcoded, so the client will always recognize it in its cache. /// </summary> public static void AddEntry(uint id, NPCEntry entry) { if (id < 844U) { throw new ArgumentException("Cannot create an NPCEntry with id < NPCId.End (" + (object)844 + ")"); } if (NPCMgr.CustomEntries.ContainsKey(id)) { NPCMgr.CustomEntries.Remove(id); } entry.Id = id; NPCMgr.CustomEntries.Add(id, entry); entry.FinalizeDataHolder(); }
static void SetupGrizzly() { // default settings GrizzlyBear = new NPCEntry { Id = BearId, DefaultName = "Sample Grizzly", EntryFlags = NPCEntryFlags.Tamable, Type = CreatureType.Humanoid, DisplayIds = new[] { 21635u }, Scale = 1, MinLevel = 73, MaxLevel = 74, HordeFactionId = FactionTemplateId.Monster_2, MinHealth = 100000, MaxHealth = 500000, AttackPower = 314, AttackTime = 1500, MinDamage = 250, MaxDamage = 360, WalkSpeed = 2.5f, RunSpeed = 8f, FlySpeed = 14f, MinMana = 2000 }; GrizzlyBear.SetResistance(DamageSchool.Physical, 7600); // AOE damage spell GrizzlyBear.AddSpell(SpellId.ConeOfFire); // A spell with a freeze debuff GrizzlyBear.AddSpell(SpellId.Chilled); // Sample gossip menu GossipMgr.AddText(sampleGossipTextId, new GossipText { Probability = 1, TextMale = "Sample Gossip Menu", TextFemale = "Take a good look" }); GrizzlyBear.DefaultGossip = CreateSampleGossipMenu(); GrizzlyBear.FinalizeDataHolder(); //NPCMgr.AddEntry(BearId, GrizzlyBear); }