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; } }
/// <summary> /// Constructor initializing menu with body text ID /// </summary> /// <param name="bodyTextID">GossipEntry Id</param> public GossipMenu(uint bodyTextID) { m_textEntry = GossipMgr.GetEntry(bodyTextID); if (m_textEntry == null) { m_textEntry = GossipMgr.DefaultGossipEntry; LogManager.GetCurrentClassLogger().Warn("Tried to create GossipMenu with invalid GossipEntry id: " + bodyTextID); } }
/// <summary>Constructor initializing menu with body text ID</summary> /// <param name="bodyTextID">GossipEntry Id</param> public GossipMenu(uint bodyTextID) { this.m_textEntry = GossipMgr.GetEntry(bodyTextID); if (this.m_textEntry != null) { return; } this.m_textEntry = (IGossipEntry)GossipMgr.DefaultGossipEntry; LogManager.GetCurrentClassLogger() .Warn("Tried to create GossipMenu with invalid GossipEntry id: " + (object)bodyTextID); }