public static void HandleClientEntityInteraction(WorldSession session, ClientEntityInteract entityInteraction) { switch (entityInteraction.Event) { case 37: // Quest NPC { session.EnqueueMessageEncrypted(new Server0357 { UnitId = entityInteraction.Guid }); break; } case 49: // Handle Vendor VendorHandler.HandleClientVendor(session, entityInteraction); break; case 68: // "MailboxActivate" var mailboxEntity = session.Player.Map.GetEntity <Mailbox>(entityInteraction.Guid); break; case 8: // "HousingGuildNeighborhoodBrokerOpen" case 40: case 41: // "ResourceConversionOpen" case 42: // "ToggleAbilitiesWindow" case 43: // "InvokeTradeskillTrainerWindow" case 45: // "InvokeShuttlePrompt" case 46: case 47: case 48: // "InvokeTaxiWindow" case 65: // "MannequinWindowOpen" case 66: // "ShowBank" case 67: // "ShowRealmBank" case 69: // "ShowDye" case 70: // "GuildRegistrarOpen" case 71: // "WarPartyRegistrarOpen" case 72: // "GuildBankerOpen" case 73: // "WarPartyBankerOpen" case 75: // "ToggleMarketplaceWindow" case 76: // "ToggleAuctionWindow" case 79: // "TradeskillEngravingStationOpen" case 80: // "HousingMannequinOpen" case 81: // "CityDirectionsList" case 82: // "ToggleCREDDExchangeWindow" case 84: // "CommunityRegistrarOpen" case 85: // "ContractBoardOpen" case 86: // "BarberOpen" case 87: // "MasterCraftsmanOpen" default: log.Warn($"Received unhandled interaction event {entityInteraction.Event} from Entity {entityInteraction.Guid}"); break; } }
public static void HandleClientEntityInteraction(WorldSession session, ClientEntityInteract entityInteraction) { WorldEntity entity = session.Player.GetVisible <WorldEntity>(entityInteraction.Guid); if (entity != null) { session.Player.QuestManager.ObjectiveUpdate(QuestObjectiveType.ActivateEntity, entity.CreatureId, 1u); session.Player.QuestManager.ObjectiveUpdate(QuestObjectiveType.TalkTo, entity.CreatureId, 1u); foreach (uint targetGroupId in AssetManager.Instance.GetTargetGroupsForCreatureId(entity.CreatureId) ?? Enumerable.Empty <uint>()) { session.Player.QuestManager.ObjectiveUpdate(QuestObjectiveType.TalkToTargetGroup, targetGroupId, 1u); } } switch (entityInteraction.Event) { case 37: // Quest NPC { session.EnqueueMessageEncrypted(new Server0357 { UnitId = entityInteraction.Guid }); break; } case 49: // Handle Vendor VendorHandler.HandleClientVendor(session, entityInteraction); break; case 68: // "MailboxActivate" var mailboxEntity = session.Player.Map.GetEntity <Mailbox>(entityInteraction.Guid); break; case 8: // "HousingGuildNeighborhoodBrokerOpen" case 40: case 41: // "ResourceConversionOpen" case 42: // "ToggleAbilitiesWindow" case 43: // "InvokeTradeskillTrainerWindow" case 45: // "InvokeShuttlePrompt" case 46: case 47: case 48: // "InvokeTaxiWindow" case 65: // "MannequinWindowOpen" case 66: // "ShowBank" case 67: // "ShowRealmBank" case 69: // "ShowDye" case 70: // "GuildRegistrarOpen" case 71: // "WarPartyRegistrarOpen" case 72: // "GuildBankerOpen" case 73: // "WarPartyBankerOpen" case 75: // "ToggleMarketplaceWindow" case 76: // "ToggleAuctionWindow" case 79: // "TradeskillEngravingStationOpen" case 80: // "HousingMannequinOpen" case 81: // "CityDirectionsList" case 82: // "ToggleCREDDExchangeWindow" case 84: // "CommunityRegistrarOpen" case 85: // "ContractBoardOpen" case 86: // "BarberOpen" case 87: // "MasterCraftsmanOpen" default: log.Warn($"Received unhandled interaction event {entityInteraction.Event} from Entity {entityInteraction.Guid}"); break; } }