bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override { player->PlayerTalkClass->ClearMenus(); Battleground* bg = player->GetBattleground(); if (!bg) return true; BattlegroundVoteOption const* bgvote = sBattlegroundMgr->GetVoteOptionById(action); if (!bgvote) return false; if (bgvote->phase != bg->GetVotePhase()) creature->Whisper("The voting period for that vote has closed. Please cast a new vote.", LANG_UNIVERSAL, player); else if (!bg->HasVoted(player->GetGUID())) bg->CastVote(player->GetGUID(), action); player->CLOSE_GOSSIP_MENU(); return true; };