コード例 #1
0
		void OnSelectOption(Object* pObject, Player* Plr, uint32 Id, const char* Code)
		{
			switch(Id)
			{
				case 0: OnHello(pObject, Plr); break;	// Return to start
				case 1:     // The bank
					{
						Plr->Gossip_SendPOI(-1257.8f, 24.14f, 7, 99, 0, "Thunder Bluff Bank");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4051, Plr);
					}break;
				case 2:     // The wind rider master
					{
						Plr->Gossip_SendPOI(-1196.43f, 28.26f, 7, 99, 0, "Wind Rider Roost");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4052, Plr);
					}break;
				case 3:     // The inn
					{
						Plr->Gossip_SendPOI(-2361.38f, -349.19f, 7, 99, 0, "Bloodhoof Village Inn");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4053, Plr);
					}break;
				case 4:     // The stable master
					{
						Plr->Gossip_SendPOI(-2338.86f, -357.56f, 7, 99, 0, "Seikwa");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 5976, Plr);
					}break;
				case 5:     // A class trainer
					{
						Arcemu::Gossip::Menu menu(pObject->GetGUID(), 4069);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Druid"       , 7);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Hunter"      , 8);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Shaman"      , 9);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Warrior"    , 10);
						menu.Send(Plr);
					}break;
				case 6:     // A profession trainer
					{
						Arcemu::Gossip::Menu menu(pObject->GetGUID(), 3541);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Alchemy"           , 11);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Blacksmithing"     , 12);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Cooking"           , 13);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Enchanting"        , 14);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "First Aid"         , 15);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Fishing"           , 16);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Herbalism"         , 17);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Leatherworking"    , 18);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Mining"            , 19);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Skinning"          , 20);
						menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Tailoring"         , 21);
						menu.Send(Plr);
					}break;
				case 7: //Druid
					{
						Plr->Gossip_SendPOI(-2312.15f, -443.69f, 7, 99, 0, "Gennia Runetotem");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4054, Plr);
					}break;
				case 8: //Hunter
					{
						Plr->Gossip_SendPOI(-2178.14f, -406.14f, 7, 99, 0, "Yaw Sharpmane");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4055, Plr);
					}break;
				case 9: //Shaman
					{
						Plr->Gossip_SendPOI(-2301.5f, -439.87f, 7, 99, 0, "Narm Skychaser");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4056, Plr);
					}break;
				case 10: //Warrior
					{
						Plr->Gossip_SendPOI(-2345.43f, -494.11f, 7, 99, 0, "Krang Stonehoof");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4057, Plr);
					}break;
				case 11: //Alchemy
					{
						Plr->Gossip_SendPOI(-1085.56f, 27.29f, 7, 99, 0, "Bena's Alchemy");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4058, Plr);
					}break;
				case 12: //Blacksmithing
					{
						Plr->Gossip_SendPOI(-1239.75f, 104.88f, 7, 99, 0, "Karn's Smithy");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4059, Plr);
					}break;
				case 13: //Cooking
					{
						Plr->Gossip_SendPOI(-2263.34f, -287.91f, 7, 99, 0, "Pyall Silentstride");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4060, Plr);
					}break;
				case 14: //Enchanting
					{
						Plr->Gossip_SendPOI(-1112.65f, 48.26f, 7, 99, 0, "Dawnstrider Enchanters");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4061, Plr);
					}break;
				case 15: //First Aid
					{
						Plr->Gossip_SendPOI(-2353.52f, -355.82f, 7, 99, 0, "Vira Younghoof");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4062, Plr);
					}break;
				case 16: //Fishing
					{
						Plr->Gossip_SendPOI(-2349.21f, -241.37f, 7, 99, 0, "Uthan Stillwater");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4063, Plr);
					}break;
				case 17: //Herbalism
					{
						Plr->Gossip_SendPOI(-1137.7f, -1.51f, 7, 99, 0, "Holistic Herbalism");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4064, Plr);
					}break;
				case 18: //Leatherworking
					{
						Plr->Gossip_SendPOI(-2257.12f, -288.63f, 7, 99, 0, "Chaw Stronghide");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4065, Plr);
					}break;
				case 19: //Mining
					{
						Plr->Gossip_SendPOI(-1249.17f, 155, 7, 99, 0, "Stonehoof Geology");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4066, Plr);
					}break;
				case 20: //Skinning
					{
						Plr->Gossip_SendPOI(-2252.94f, -291.32f, 7, 99, 0, "Yonn Deepcut");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4067, Plr);
					}break;
				case 21: //Tailoring
					{
						Plr->Gossip_SendPOI(-1156.22f, 66.86f, 7, 99, 0, "Thunder Bluff Armorers");
						Arcemu::Gossip::Menu::SendSimpleMenu(pObject->GetGUID(), 4068, Plr);
					}break;
			}
		}
コード例 #2
0
ファイル: DCNeighbour.cpp プロジェクト: ivan386/Shareaza
BOOL CDCNeighbour::OnPacket(CDCPacket* pPacket)
{
	pPacket->SmartDump( &m_pHost, FALSE, FALSE, (DWORD_PTR)this );

	m_nInputCount++;
	m_tLastPacket = GetTickCount();

	if ( pPacket->m_nLength < 2  )
	{
		return OnPing();
	}
	else if ( *pPacket->m_pBuffer == '<' )
	{
		return OnChat( pPacket );
	}
	else if ( *pPacket->m_pBuffer != '$' )
	{
		return OnUnknown( pPacket );
	}

	if ( pPacket->Compare( _P("$Search ") ) )
	{
		return OnQuery( pPacket );
	}
	else if ( pPacket->Compare( _P("$To: ") ) )
	{
		return OnChatPrivate( pPacket );
	}
	else if ( pPacket->Compare( _P("$HubTopic ") ) )
	{
		return OnHubTopic( pPacket );
	}
	else if ( pPacket->Compare( _P("$HubName" ) ) )
	{
		return OnHubName( pPacket );
	}

	// Convert '|' to '\0' (make ASCIIZ)
	pPacket->m_pBuffer[ pPacket->m_nLength - 1 ] = 0;
	LPCSTR szCommand = (LPCSTR)pPacket->m_pBuffer;

	// Split off parameters
	LPSTR szParams = strchr( (LPSTR)pPacket->m_pBuffer, ' ' );
	if ( szParams )
	{
		*szParams++ = 0;
	}

	if ( strcmp( szCommand, "$MyINFO" ) == 0 )
	{
		return OnUserInfo( szParams );
	}
	else if ( strcmp( szCommand, "$Quit" ) == 0 )
	{
		return OnQuit( szParams );
	}
	else if ( strcmp( szCommand, "$Lock" ) == 0 )
	{
		return OnLock( szParams );
	}
	else if ( strcmp( szCommand, "$Supports" ) == 0 )
	{
		return OnSupports( szParams );
	}
	else if ( strcmp( szCommand, "$Hello" ) == 0 )
	{
		return OnHello( szParams );
	}
	else if ( strcmp( szCommand, "$OpList" ) == 0 )
	{
		return OnOpList( szParams );
	}
	else if ( strcmp( szCommand, "$ConnectToMe" ) == 0 )
	{
		return OnConnectToMe( szParams );
	}
	else if ( strcmp( szCommand, "$ForceMove " ) == 0 )
	{
		return OnForceMove( szParams );
	}
	else if ( strcmp( szCommand, "$ValidateDenide" ) == 0 )
	{
		return OnValidateDenide();
	}
	else if ( strcmp( szCommand, "$GetPass" ) == 0 )
	{
		return OnGetPass();
	}
	else if ( strcmp( szCommand, "$UserIP" ) == 0 )
	{
		return OnUserIP( szParams );
	}
	else if ( strcmp( szCommand, "$ZOn" ) == 0 )
	{
		return OnZOn();
	}
	else if ( strcmp( szCommand, "$RevConnectToMe" ) == 0 )
	{
		return OnRevConnectToMe( szParams );
	}

	return OnUnknown( pPacket );
}