コード例 #1
0
ファイル: NPCHandler.cpp プロジェクト: Carbinfibre/ArcPro
//////////////////////////////////////////////////////////////
/// 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", Arcpro::Util::GUID_LOPART(guid));

		Arcpro::Gossip::Script* script = Arcpro::Gossip::Script::GetInterface(qst_giver);
		if(script != NULL)
			script->OnHello(qst_giver, GetPlayer());
	}
}
コード例 #2
0
ファイル: ScriptMgr.cpp プロジェクト: Ikesters/ArcPro
bool ScriptMgr::CallScriptedItem(Item* pItem, Player* pPlayer)
{
	Arcpro::Gossip::Script* script = this->get_item_gossip(pItem->GetEntry());
	if(script != NULL)
	{
		script->OnHello(pItem, pPlayer);
		return true;
	}
	return false;
}