Guest User

Untitled

a guest
Nov 19th, 2014
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. //After
  2.  
  3. Player* player = getPlayerByID(playerId);
  4. if (!player) {
  5. return;
  6. }
  7.  
  8. //Add this
  9.  
  10. if (player->cast.isCasting && channelId == player->cast.mCastChannelId) { //Cast System Felipe Monteiro
  11. player->sendTextMessage(MESSAGE_INFO_DESCR, "You have closed your cast.");
  12. player->kickCastViewers();
  13. player->setCasting(false);
  14. IOLoginData::savePlayer(player);
  15. }
  16.  
  17. //After
  18.  
  19. void Game::playerShowQuestLine(uint32_t playerId, uint16_t questId)
  20. {
  21. Player* player = getPlayerByID(playerId);
  22. if (!player) {
  23. return;
  24. }
  25.  
  26. Quest* quest = Quests::getInstance()->getQuestByID(questId);
  27. if (!quest) {
  28. return;
  29. }
  30.  
  31. player->sendQuestLine(quest);
  32. }
  33.  
  34. //Add this
  35.  
  36. void Game::spectatorSay(const std::string& text, ProtocolGame * spectator) //Cast System Felipe Monteiro
  37. {
  38. Player* player = spectator->getPlayer();
  39.  
  40. if (!player)
  41. return;
  42.  
  43. int32_t channelId = player->cast.mCastChannelId;
  44. if (channelId == -1)
  45. return;
  46.  
  47. if (!text.empty() && text.front() == '/' && player->isAccessPlayer())
  48. return;
  49.  
  50. player->sendToChannel(spectator, text);
  51.  
  52. }
  53.  
  54. //Replace
  55.  
  56. g_chat.talkToChannel(*player, type, text, channelId);
  57.  
  58. //With
  59.  
  60. g_chat.talkToChannel(*player, TALKTYPE_CHANNEL_O, text, channelId);
Advertisement
Add Comment
Please, Sign In to add comment