//////////////////////////////////////////////////////////////
/// This function handles CMSG_GOSSIP_HELLO:
//////////////////////////////////////////////////////////////
void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
{
	CHECK_INWORLD_RETURN

	uint64 guid;

	recv_data >> guid;
	Creature* qst_giver = _player->GetMapMgr()->GetCreature(GET_LOWGUID_PART(guid));

	if(qst_giver != NULL)
	{
		//stop when talked to
		if(qst_giver->GetAIInterface())
			qst_giver->GetAIInterface()->StopMovement(30000);

		// unstealth meh
		if(_player->IsStealth())
			_player->RemoveAllAuraType(SPELL_AURA_MOD_STEALTH);

		// reputation
		_player->Reputation_OnTalk(qst_giver->m_factionDBC);

		LOG_DEBUG("WORLD: Received CMSG_GOSSIP_HELLO from %u", Arcemu::Util::GUID_LOPART(guid));

		Arcemu::Gossip::Script* script = Arcemu::Gossip::Script::GetInterface(qst_giver);
		if(script != NULL)
			script->OnHello(qst_giver, GetPlayer());
	}
}
Exemple #2
0
bool ScriptMgr::CallScriptedItem(Item* pItem, Player* pPlayer)
{
    Arcemu::Gossip::Script* script = this->get_item_gossip(pItem->GetEntry());
    if (script != NULL)
    {
        script->OnHello(pItem, pPlayer);
        return true;
    }
    return false;
}