当前位置: 首页>>代码示例>>C++>>正文


C++ TO_CREATURE函数代码示例

本文整理汇总了C++中TO_CREATURE函数的典型用法代码示例。如果您正苦于以下问题:C++ TO_CREATURE函数的具体用法?C++ TO_CREATURE怎么用?C++ TO_CREATURE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了TO_CREATURE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GossipSelectOption

        void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char* Code)
        {
            GossipMenu* Menu;
            if(!pObject->IsCreature())
                return;
            Creature* pCreature = TO_CREATURE(pObject);

            switch(IntId)

            {
                case 1:
                    objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 60036, plr);            // What can I purchase?
                    Menu->SendTo(plr);
                    break;

                case 2:
                    objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 60037, plr);            // What are Darkmoon Faire Prize Tickets and how do I get them?
                    Menu->SendTo(plr);
                    break;

                case 3:
                    objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 60038, plr);            // What are Darkmoon Cards?
                    Menu->AddItem(0, "<more>", 10);
                    Menu->SendTo(plr);
                    break;

                case 4:
                    objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 60040, plr);            // What other things can I do at the faire?
                    Menu->AddItem(0, "What are these Tonk Control Consoles?", 20);
                    Menu->AddItem(0, "Tell me about the cannon.", 21);
                    Menu->SendTo(plr);
                    break;

                case 10:
                    objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 60039, plr);            // What are Darkmoon Cards? <more>
                    Menu->SendTo(plr);
                    break;

                case 20:
                    objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 60041, plr);            // What are these Tonk Control Consoles?
                    Menu->SendTo(plr);
                    break;

                case 21:
                    objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 60042, plr);            // Tell me about the cannon.
                    Menu->SendTo(plr);
                    break;
            }
        }
开发者ID:lev1976g,项目名称:easywow,代码行数:49,代码来源:Gossip_DarkmoonFaire.cpp

示例2: GossipSelectOption

    void GossipSelectOption(ObjectPointer pObject, PlayerPointer plr, uint32 Id, uint32 IntId, const char * Code)
    {
		CreaturePointer pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?(TO_CREATURE(pObject)):NULLCREATURE;
		if(pObject->GetTypeId()!=TYPEID_UNIT)
			return;
		
		switch(IntId)
        {
        case 1:
			{
				plr->Gossip_Complete();
				pCreature->CastSpell(plr, dbcSpell.LookupEntry(42711), true);
            }break;
		}
    }
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:15,代码来源:Gossip_Stormwind.cpp

示例3: TO_PLAYER

/// Spell Target Handling for type 18: All Party Members around the Caster in given range NOT RAID
void Spell::SpellTargetAllPartyMembersRangeNR(uint32 i, uint32 j)
{
	Player* p = p_caster;

	if( p == NULL )
	{
		if( TO_CREATURE( u_caster)->IsTotem() )
			p = TO_PLAYER( TO_CREATURE(u_caster)->GetSummonOwner());
		else if( u_caster->IsPet() && TO_PET( u_caster )->GetPetOwner() )
			p = TO_PET( u_caster )->GetPetOwner();
	}

	if( p == NULL )
		return;

	float r = GetDBCCastTime(i);

	r *= r;
	if( IsInrange( m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), p, r ) )
		_AddTargetForced(p->GetGUID(), i);

	SubGroup* subgroup = p->GetGroup() ? p->GetGroup()->GetSubGroup( p->GetSubGroup() ) : 0;

	if( subgroup != NULL )
	{
		p->GetGroup()->Lock();
		for(GroupMembersSet::iterator itr = subgroup->GetGroupMembersBegin(); itr != subgroup->GetGroupMembersEnd(); itr++)
		{
			if(!(*itr)->m_loggedInPlayer || m_caster == (*itr)->m_loggedInPlayer)
				continue;
			if(IsInrange(m_caster->GetPositionX(),m_caster->GetPositionY(),m_caster->GetPositionZ(),(*itr)->m_loggedInPlayer,r))
				_AddTargetForced( (*itr)->m_loggedInPlayer->GetGUID(), i );
		}
		p->GetGroup()->Unlock();
	}
}
开发者ID:Bootz,项目名称:arcticdev,代码行数:37,代码来源:SpellTarget.cpp

示例4: OnDamageTaken

	void OnDamageTaken(UnitPointer mAttacker, float fAmount)
	{
		if( _unit->GetHealthPct() < 3 )
		{//freeze, some kinda of animation here maybe?
			_unit->Root();
			_unit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
			for( uint8 i=0; i<7; i++ )
				_unit->SchoolImmunityList[i] = 1;
			_unit->GetAIInterface()->disable_combat = true;
			RemoveAIUpdateEvent();
			UnitPointer Volkhan = _unit->GetMapMgr()->GetUnit( _unit->GetUInt64Value( UNIT_FIELD_SUMMONEDBY ) );
			if( Volkhan )
				TO_CREATURE( Volkhan )->GetScript()->OnReachWP( 1337, true );
		}
	}
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:15,代码来源:Instance_HallsOfLightning.cpp

示例5: GossipSelectOption

		void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char* Code)
		{
			GossipMenu* Menu;
			if(!pObject->IsCreature())
				return;
			Creature* pCreature = TO_CREATURE(pObject);

			switch(IntId)
			{
				case 1:
					objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 60014, plr);			// Silas, why is most everything at the fair free? How do you make a profit?
					Menu->SendTo(plr);
					break;
			}
		}
开发者ID:Antares84,项目名称:arcemu,代码行数:15,代码来源:Gossip_DarkmoonFaire.cpp

示例6: GossipHello

        void GossipHello(Object* pObject, Player* plr)
        {
            if(!plr)
                return;

            GossipMenu* Menu;
            Creature* highchief = TO_CREATURE(pObject);
            if(highchief == NULL)
                return;

            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, plr);
            if(plr->HasQuest(9663))
                Menu->AddItem(ICON_CHAT, plr->GetSession()->LocalizedGossipOption(454), 1);     // Warn him

            Menu->SendTo(plr);
        }
开发者ID:TheGhostGroup,项目名称:AscEmu,代码行数:16,代码来源:Quest_BloodmystIsle.cpp

示例7: GossipHello

		void GossipHello(Object* pObject, Player* plr)
		{
			if(!plr)
				return;

			GossipMenu* Menu;
			Creature* general = TO_CREATURE(pObject);
			if(general == NULL)
				return;

			objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, plr);
			if(plr->GetQuestLogForEntry(2702) || plr->HasFinishedQuest(2702))
				Menu->AddItem(0, "I need to speak with Corporal.", 1);

			Menu->SendTo(plr);
		}
开发者ID:Antares84,项目名称:arcemu,代码行数:16,代码来源:Quest_BlastedLands.cpp

示例8: GossipHello

        void GossipHello(Object* pObject, Player* plr)
        {
            if(!plr)
                return;

            GossipMenu* Menu;
            Creature* doctor = TO_CREATURE(pObject);
            if(doctor == NULL)
                return;

            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, plr);
            if(plr->HasQuest(10201) && plr->GetItemInterface()->GetItemCount(28500, 0))
                Menu->AddItem(ICON_CHAT, plr->GetSession()->LocalizedGossipOption(497), 1);     // Try this

            Menu->SendTo(plr);
        }
开发者ID:Declipe,项目名称:AscEmu,代码行数:16,代码来源:Quest_Terrokar_Forest.cpp

示例9: GossipHello

		void GossipHello(Object* pObject, Player* plr)
		{
			if(!plr)
				return;

			GossipMenu* Menu;
			Creature* windwatcher = TO_CREATURE(pObject);
			if(windwatcher == NULL)
				return;

			objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, plr);
			if(plr->GetQuestLogForEntry(1713))
				Menu->AddItem(0, "I'm ready, Summon Him!", 1);

			Menu->SendTo(plr);
		}
开发者ID:DebugProject,项目名称:Lua-Other,代码行数:16,代码来源:Quest_Warrior.cpp

示例10: GossipSelectOption

    void GossipSelectOption(Object* pObject, Player*  pPlayer, uint32 Id, uint32 IntId, const char * Code)
    {
        if( !pObject->IsCreature() )
            return;

        switch (IntId)
        {
        case 1:
            pPlayer->Gossip_Complete();
            pPlayer->CastSpell( pPlayer, SPELL_ABMER_TO_COLDARRA, true );
            break;
        case 2:
            pPlayer->GetSession()->SendTaxiList( TO_CREATURE( pObject ) );
            break;
        };
    };
开发者ID:Sandshroud,项目名称:Sandshroud-Prodigy,代码行数:16,代码来源:Borean_Tundra.cpp

示例11: GossipHello

    void GossipHello(Object* pObject, Player* plr)
    {
        if (!plr)
            return;

        GossipMenu* Menu;
        Creature* Prisoner12 = TO_CREATURE(pObject);
        if (Prisoner12 == nullptr)
            return;

        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, plr);
        if (plr->HasQuest(9164))
            Menu->AddItem(ICON_CHAT, plr->GetSession()->LocalizedGossipOption(462), 1);     // Release Him.

        Menu->SendTo(plr);
    }
开发者ID:TheGhostGroup,项目名称:AscEmu,代码行数:16,代码来源:Quest_Ghostlands.cpp

示例12: GossipHello

    void GossipHello(Object* pObject, Player* plr, bool AutoSend)
    {
        if(!plr)
            return;
        GossipMenu *Menu;
        Creature* Prisoner12 = TO_CREATURE(pObject);
        if (Prisoner12 == NULL)
            return;

        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, plr);
        if(plr->GetQuestLogForEntry(9164))
            Menu->AddItem( 0, "Release Him.", 1);

        if(AutoSend)
            Menu->SendTo(plr);
    }
开发者ID:Bootz,项目名称:arcticdev,代码行数:16,代码来源:Ghostlands.cpp

示例13: GossipHello

		void GossipHello(Object* pObject, Player* plr)
		{
			if(!plr)
				return;

			GossipMenu* Menu;
			Creature* highchief = TO_CREATURE(pObject);
			if(highchief == NULL)
				return;

			objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, plr);
			if(plr->GetQuestLogForEntry(9663))
				Menu->AddItem(0, "Warn him", 1);

			Menu->SendTo(plr);
		}
开发者ID:Refuge89,项目名称:Edge-of-Chaos,代码行数:16,代码来源:Quest_BloodmystIsle.cpp

示例14: GossipSelectOption

	void GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    {
		Creature* pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?(TO_CREATURE(pObject)):NULL;
		if(!pCreature)
			return;

        switch(IntId)
        {
			case 1: //Mission: The Abyssal Shelf ( GOSSIP_MISSIONA )
			{       
				//We need Horde / Alliance Check
				if ( Plr->GetTeam() == 1)
				{
					TaxiPath * taxipath = sTaxiMgr.GetTaxiPath(587);
                    Plr->TaxiStart(taxipath, 18712, 0);
				}
				else
				{
					TaxiPath * taxipath = sTaxiMgr.GetTaxiPath(589);
					Plr->TaxiStart(taxipath, 18736, 0);
				}
			}break;
			case 2:
			{
				if ( Plr->GetTeam() == 1)
					pCreature->CastSpell(Plr, 33659, true); //Gateways Murket and Shaadraz H
				else
					pCreature->CastSpell(Plr, 33768, true); // Gateways Murket and Shaadraz A                
			}break;
			case 3: //SPINEBRIDGE
			{
				pCreature->CastSpell(Plr, 34578, true); // Taxi - Reaver's Fall to Spinebreaker Ridge
			}break;
			case 4:
			{       
				if(pCreature->GetEntry() == TAXI_DABIREE) 
					pCreature->CastSpell(Plr, 35069, true); // Taxi - Hellfire Peninsula - Expedition Point to Shatter Point
				if(pCreature->GetEntry() == TAXI_LEAFBEARD) 
					pCreature->CastSpell(Plr, 35066, true); // Taxi - Hellfire Peninsula - Beach Head to Shatter Point
			}break;
			case 5: 
			{
				pCreature->CastSpell(Plr, 35065, true); // Taxi - Hellfire Peninsula - Shatter Point to Beach Head
			}break;
		}
    }
开发者ID:wow4all,项目名称:wowtbc,代码行数:46,代码来源:Hellfire_Peninsula.cpp

示例15: GossipHello

	void GossipHello(ObjectPointer pObject, PlayerPointer plr, bool AutoSend)
	{
		if(!plr)
			return;

		GossipMenu *Menu;
		CreaturePointer doctor = TO_CREATURE(pObject);
		if (doctor == NULL)
			return;

		objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, plr);
		if(plr->GetQuestLogForEntry(348) && plr->GetItemInterface()->GetItemCount(2799, 0) && !plr->GetItemInterface()->GetItemCount(2797, 0))
			Menu->AddItem( 0, "I'm ready, Summon Him!", 1);

		if(AutoSend)
			Menu->SendTo(plr);
	}
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:17,代码来源:StranglethornVale.cpp


注:本文中的TO_CREATURE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。