Esempio n. 1
0
 bool GossipSelectWithCode(Player *player, Creature *_creature, uint32 sender, uint32 action, const char* sCode)
 {
 if (sender == GOSSIP_SENDER_MAIN)
 {
 if (action == ACTION_SELL_GUILDHOUSE)
 {
 int i = -1;
 try
 {
 //compare code

 if (strlen(sCode) + 1 == sizeof CODE_SELL)
 i = strcmp(CODE_SELL, sCode);
 }

 catch(char *str) {sLog->outErrorDb(str);
 }

 if (i == 0)
 {
 //right code
 sellGuildhouse(player, _creature);
 }

 player->CLOSE_GOSSIP_MENU();
 return true;
 }
 }
 return false;
}
Esempio n. 2
0
bool GossipSelectWithCode_guildmaster( Player *player, Creature *_creature,
									  uint32 sender, uint32 action, const char* sCode )
{
    if(sender == GOSSIP_SENDER_MAIN)
    {
        if(action == ACTION_SELL_GUILDHOUSE)
        {
			if (std::strcmp(sCode, CODE_SELL )==0)
            {
				sellGuildhouse(player, _creature);
			
			}
			else
            {
				char msg[1000];
			sprintf(msg, MSG_WRONG);
			_creature->MonsterWhisper(msg, player->GetGUID());
			}
		
			player->CLOSE_GOSSIP_MENU();
			return true;
		}
	}
	return false;
}
Esempio n. 3
0
 bool OnGossipSelect(Player *player, Creature *_creature, uint32 sender, uint32 action)
 {
 player->PlayerTalkClass->ClearMenus();
 if (sender != GOSSIP_SENDER_MAIN)
 return false;

 switch (action)
 {
 case ACTION_TELE:
 //teleport player to GH
 player->CLOSE_GOSSIP_MENU();
 teleportPlayerToGuildHouse(player, _creature);
 break;
 case ACTION_SHOW_BUYLIST:
 //show list of GHs which currently not occupied
 showBuyList(player, _creature);
 break;

 case ACTION_SELL_GUILDHOUSE_OPT:
 player->CLOSE_GOSSIP_MENU();
 player->ADD_GOSSIP_ITEM(0, "Yes, Sell my guild", GOSSIP_SENDER_MAIN, ACTION_SELL_GUILDHOUSE_YES);
 player->ADD_GOSSIP_ITEM(0, "No, Close this", GOSSIP_SENDER_MAIN, ACTION_SELL_GUILDHOUSE_NO);
 player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
 break;
 
 case ACTION_SELL_GUILDHOUSE_YES:
 sellGuildhouse(player, _creature);
 player->CLOSE_GOSSIP_MENU();
 break;
 
 case ACTION_SELL_GUILDHOUSE_NO:
 player->CLOSE_GOSSIP_MENU();
 break;

 default:
 if (action > OFFSET_SHOWBUY_FROM)
 {
 showBuyList(player, _creature, action - OFFSET_SHOWBUY_FROM);
 }
 else if (action > OFFSET_GH_ID_TO_ACTION)
 {
 //player clicked on buy list
 player->CLOSE_GOSSIP_MENU();

 //get guildhouseId from action
 //guildhouseId = action - OFFSET_GH_ID_TO_ACTION
 buyGuildhouse(player, _creature, action - OFFSET_GH_ID_TO_ACTION);
 }
 break;
 }

 return true;
 }
Esempio n. 4
0
 bool OnGossipSelect(Player *player, Creature *_creature, uint32 sender, uint32 action)
 {
 player->PlayerTalkClass->ClearMenus();
 if (sender != GOSSIP_SENDER_MAIN)
 return false;

 switch (action)
 {
 case ACTION_TELE:
 //teleport player to GH
 CloseGossipMenuFor(player);;
 teleportPlayerToGuildHouse(player, _creature);
 break;
 case ACTION_SHOW_BUYLIST:
 //show list of GHs which currently not occupied
 showBuyList(player, _creature);
 break;
 case ACTION_SELL_GUILDHOUSE:
  sellGuildhouse(player, _creature);
  CloseGossipMenuFor(player);;
 break;
 default:
 if (action > OFFSET_SHOWBUY_FROM)
 {
 showBuyList(player, _creature, action - OFFSET_SHOWBUY_FROM);
 }
 else if (action > OFFSET_GH_ID_TO_ACTION)
 {
 //player clicked on buy list
 CloseGossipMenuFor(player);;

 //get guildhouseId from action
 //guildhouseId = action - OFFSET_GH_ID_TO_ACTION
 buyGuildhouse(player, _creature, action - OFFSET_GH_ID_TO_ACTION);
 }
 break;
 }

 return true;
 }