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


C++ QuestLogEntry::SendQuestComplete方法代码示例

本文整理汇总了C++中QuestLogEntry::SendQuestComplete方法的典型用法代码示例。如果您正苦于以下问题:C++ QuestLogEntry::SendQuestComplete方法的具体用法?C++ QuestLogEntry::SendQuestComplete怎么用?C++ QuestLogEntry::SendQuestComplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QuestLogEntry的用法示例。


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

示例1: GossipSelectOption

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

            GossipMenu* Menu;
            switch(IntId)
            {
                case 0: // Return to start
                    GossipHello(pCreature, plr);
                    break;

                case 1: //Horde
                    {
                        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4715, plr);
                        Menu->SendTo(plr);

                        QuestLogEntry* qle = plr->GetQuestLogForEntry(6002);
                        if(qle == NULL)
                            return;

                        if(qle->CanBeFinished())
                            return;

                        qle->Complete();
                        qle->SendQuestComplete();
                        qle->UpdatePlayerFields();

                        pCreature->Emote(EMOTE_ONESHOT_WAVE);
                        pCreature->Despawn(240000, 0);
                    }
                    break;

                case 2: //Ally
                    {
                        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4715, plr);
                        Menu->SendTo(plr);

                        QuestLogEntry* qle = plr->GetQuestLogForEntry(6001);
                        if(qle == NULL)
                            return;

                        if(qle->CanBeFinished())
                            return;

                        qle->Complete();
                        qle->SendQuestComplete();
                        qle->UpdatePlayerFields();

                        pCreature->Emote(EMOTE_ONESHOT_WAVE);
                        pCreature->Despawn(240000, 0);
                    }
                    break;

            }
        }
开发者ID:Nupper,项目名称:AscEmu,代码行数:57,代码来源:Quest_Druid.cpp

示例2: OnPlayerExploreArea

void QuestMgr::OnPlayerExploreArea(Player* plr, uint32 AreaID)
{
	uint32 i, j;
	QuestLogEntry *qle;
	for(i = 0; i < 25; ++i)
	{
		if((qle = plr->GetQuestLogInSlot(i)))
		{
			// dont waste time on quests without mobs
			if(qle->GetQuest()->count_requiredtriggers == 0)
				continue;

			for(j = 0; j < 4; ++j)
			{
				if(qle->GetQuest()->required_triggers[j] == AreaID &&
					!qle->m_explored_areas[j])
				{
					qle->SetTrigger(j);
					CALL_QUESTSCRIPT_EVENT(qle, OnExploreArea)(qle->m_explored_areas[j], plr);
					qle->UpdatePlayerFields();
					if(qle->CanBeFinished())
					{
						plr->UpdateNearbyGameObjects();
						qle->SendQuestComplete();
					}
					break;
				}
			}
		}
	}
}
开发者ID:jameyboor,项目名称:Antrix,代码行数:31,代码来源:QuestMgr.cpp

示例3: OnPlayerItemPickup

void QuestMgr::OnPlayerItemPickup(Player* plr, Item* item)
{
	uint32 i, j;
	uint32 pcount;
	uint32 entry = item->GetEntry();
	QuestLogEntry *qle;
	for(i = 0; i < 25; ++i)
	{
		if((qle = plr->GetQuestLogInSlot(i)))
		{
			for(j = 0; j < qle->GetQuest()->count_required_item; ++j)
			{
				if(qle->GetQuest()->required_item[j] == entry)
				{
					pcount = plr->GetItemInterface()->GetItemCount(entry, true);
					CALL_QUESTSCRIPT_EVENT(qle, OnPlayerItemPickup)(entry, pcount, plr);
					if(pcount < qle->GetQuest()->required_itemcount[j])
					{
						WorldPacket data(8);
						data.SetOpcode(SMSG_QUESTUPDATE_ADD_ITEM);
						data << qle->GetQuest()->required_item[j] << uint32(1);
						plr->GetSession()->SendPacket(&data);
						if(qle->CanBeFinished())
						{
							plr->UpdateNearbyGameObjects();
							qle->SendQuestComplete();
						}
						break;
					}
				}
			}
		}
	}
}
开发者ID:jameyboor,项目名称:Antrix,代码行数:34,代码来源:QuestMgr.cpp

示例4: OnSelectOption

        void OnSelectOption(Object* pObject, Player* Plr, uint32 Id, const char* Code)
        {
            switch(Id)
            {
                case 0:  Arcemu::Gossip::Menu::SendQuickMenu(Plr->GetGUID(), 2714, Plr, 1, Arcemu::Gossip::ICON_CHAT, RaggedJohn_GOSSIP_0); break;
                case 1:  Arcemu::Gossip::Menu::SendQuickMenu(Plr->GetGUID(), 2715, Plr, 2, Arcemu::Gossip::ICON_CHAT, RaggedJohn_GOSSIP_1); break;
                case 2:  Arcemu::Gossip::Menu::SendQuickMenu(Plr->GetGUID(), 2716, Plr, 3, Arcemu::Gossip::ICON_CHAT, RaggedJohn_GOSSIP_2); break;
                case 3:  Arcemu::Gossip::Menu::SendQuickMenu(Plr->GetGUID(), 2717, Plr, 4, Arcemu::Gossip::ICON_CHAT, RaggedJphn_GOSSIP_3); break;
                case 4:  Arcemu::Gossip::Menu::SendQuickMenu(Plr->GetGUID(), 2718, Plr, 5, Arcemu::Gossip::ICON_CHAT, RaggedJohn_GOSSIP_4); break;
                case 5:  Arcemu::Gossip::Menu::SendQuickMenu(Plr->GetGUID(), 2719, Plr, 6, Arcemu::Gossip::ICON_CHAT, RaggedJohn_GOSSIP_5); break;
                case 6:  Arcemu::Gossip::Menu::SendQuickMenu(Plr->GetGUID(), 2720, Plr, 7, Arcemu::Gossip::ICON_CHAT, RaggedJohn_GOSSIP_6); break;
                case 7:  Arcemu::Gossip::Menu::SendQuickMenu(Plr->GetGUID(), 2721, Plr, 8, Arcemu::Gossip::ICON_CHAT, RaggedJohn_GOSSIP_7); break;
                case 8:  Arcemu::Gossip::Menu::SendQuickMenu(Plr->GetGUID(), 2722, Plr, 9, Arcemu::Gossip::ICON_CHAT, RaggedJohn_GOSSIP_8); break;
                case 9:  Arcemu::Gossip::Menu::SendQuickMenu(Plr->GetGUID(), 2723, Plr, 10, Arcemu::Gossip::ICON_CHAT, RaggedJohn_GOSSIP_9); break;
                case 10: Arcemu::Gossip::Menu::SendQuickMenu(Plr->GetGUID(), 2725, Plr, 11, Arcemu::Gossip::ICON_CHAT, RaggedJohn_GOSSIP_10); break;
                case 11:
                {
                    QuestLogEntry* pQuest = Plr->GetQuestLogForEntry(4224);
                    if(!pQuest)
                        return;

                    pQuest->Complete();
                    pQuest->SendQuestComplete();
                    pQuest->UpdatePlayerFields();
                    Arcemu::Gossip::Menu::Complete(Plr);
                }
            }
        }
开发者ID:lev1976g,项目名称:easywow,代码行数:28,代码来源:Quest_BurningSteppes.cpp

示例5: OnDamageTaken

 void OnDamageTaken(Unit* mAttacker, uint32 fAmount)
 {
     if(_unit->GetHealthPct() < 10)
     {
         if(mAttacker->IsPlayer())
         {
             _unit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
             RegisterAIUpdateEvent(1000);
             QuestLogEntry* qle = (static_cast<Player*>(mAttacker))->GetQuestLogForEntry(590);
             if(!qle)
                 return;
             qle->SendQuestComplete();
         }
     }
 }
开发者ID:Lbniese,项目名称:AscEmu,代码行数:15,代码来源:Quest_TirisfalGlades.cpp

示例6: OnDamageTaken

 void OnDamageTaken(Unit* mAttacker, uint32 fAmount) override
 {
     if (getCreature()->getHealth() - fAmount <= getCreature()->getMaxHealth() * 0.2f)
     {
         if (mAttacker->isPlayer())
         {
             getCreature()->addUnitFlags(UNIT_FLAG_NOT_SELECTABLE);
             RegisterAIUpdateEvent(1000);
             QuestLogEntry* qle = (static_cast<Player*>(mAttacker))->GetQuestLogForEntry(1447);
             if (!qle)
                 return;
             qle->SendQuestComplete();
         }
     }
 }
开发者ID:AscEmu,项目名称:AscEmu,代码行数:15,代码来源:Quest_Stormwind.cpp

示例7: OnDamageTaken

	void OnDamageTaken(Unit* mAttacker, uint32 fAmount)
	{
		if(_unit->GetHealthPct() < 10)
		{
			if(mAttacker->GetTypeId() == TYPEID_PLAYER)
			{
				_unit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
				RegisterAIUpdateEvent(1000);
				QuestLogEntry *qle = (TO_PLAYER(mAttacker))->GetQuestLogForEntry(590);
				if(!qle)
					return;
				qle->SendQuestComplete();
			}
		}
	}
开发者ID:vata,项目名称:wowice,代码行数:15,代码来源:Quest_TirisfalGlades.cpp

示例8: OnDamageTaken

	void OnDamageTaken(Unit* mAttacker, float fAmount)
	{
		if(_unit->GetUInt32Value(UNIT_FIELD_HEALTH)- fAmount<=_unit->GetUInt32Value(UNIT_FIELD_MAXHEALTH)*0.2)
		{
			if(mAttacker->GetTypeId() == TYPEID_PLAYER)
			{
				_unit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
				RegisterAIUpdateEvent(1000);
				QuestLogEntry *qle = (TO_PLAYER(mAttacker))->GetQuestLogForEntry( 1447 );
				if(!qle)
					return;
				qle->SendQuestComplete();
			}
		}
	}
开发者ID:Ballwinkle,项目名称:Ascent_NG,代码行数:15,代码来源:Stormwind.cpp

示例9: OnDamageTaken

		void OnDamageTaken(Unit* mAttacker, uint32 fAmount)
		{
			if(_unit->GetUInt32Value(UNIT_FIELD_HEALTH) - fAmount <= _unit->GetUInt32Value(UNIT_FIELD_MAXHEALTH) * 0.37f)
			{
				if(mAttacker->IsPlayer())
				{
					_unit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
					RegisterAIUpdateEvent(1000);
					QuestLogEntry* qle = (TO_PLAYER(mAttacker))->GetQuestLogForEntry(1640);
					if(!qle)
						return;
					qle->SendQuestComplete();
				}
			}
		}
开发者ID:Antares84,项目名称:arcemu,代码行数:15,代码来源:Quest_Warrior.cpp

示例10: OpeningTyraliusPrison

bool OpeningTyraliusPrison(uint32 i, Spell* pSpell)
{
	if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() )
		return true;
    
	Player *pPlayer = static_cast< Player* >( pSpell->u_caster );
	QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 10442 );
	if ( pQuest != NULL )
	{
		sEAS.SpawnCreature( pPlayer, 20787, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 2 * 60 * 1000 );
		pQuest->SendQuestComplete();	// not sure if it's enough
	}

	return true;
}
开发者ID:AtVirus,项目名称:Descent-Scripts,代码行数:15,代码来源:QIspells.cpp

示例11: PreparationForBattle

bool PreparationForBattle(uint32 i, Spell* pSpell)
{
	if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() )
	return true;

	Player* pPlayer = TO_PLAYER( pSpell->u_caster );
	QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 12842 );
	if ( pQuest != NULL )
	{
		if ( pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] )
		{
			pQuest->SetMobCount( 0, pQuest->GetMobCount( 0 ) + 1 );
			pQuest->SendUpdateAddKill( 0 );
			pQuest->UpdatePlayerFields();
			pQuest->SendQuestComplete();
		}
	}
	return true;
};
开发者ID:arcticdev,项目名称:arctic-test,代码行数:19,代码来源:DeathKnight.cpp

示例12: OnDamageTaken

 void OnDamageTaken(Unit* mAttacker, uint32 fAmount) override
 {
     uint32 chance = Util::getRandomUInt(100);
     if (chance < 25)
     {
         getCreature()->castSpell(mAttacker, sSpellMgr.getSpellInfo(6749), true);
     }
     if (getCreature()->getHealth() - fAmount <= getCreature()->getMaxHealth() * 0.3f)
     {
         if (mAttacker->isPlayer())
         {
             getCreature()->addUnitFlags(UNIT_FLAG_NOT_SELECTABLE);
             RegisterAIUpdateEvent(1000);
             QuestLogEntry* qle = (static_cast<Player*>(mAttacker))->GetQuestLogForEntry(1173);
             if (!qle)
                 return;
             qle->SendQuestComplete();
         }
     }
 }
开发者ID:AscEmu,项目名称:AscEmu,代码行数:20,代码来源:Quest_Dustwallow_Marsh.cpp

示例13: OnDamageTaken

 void OnDamageTaken(Unit* mAttacker, uint32 fAmount)
 {
     uint32 chance = RandomUInt(100);
     if(chance < 25)
     {
         _unit->CastSpell(mAttacker, dbcSpell.LookupEntry(6749), true);
     }
     if(_unit->GetUInt32Value(UNIT_FIELD_HEALTH) - fAmount <= _unit->GetUInt32Value(UNIT_FIELD_MAXHEALTH) * 0.3f)
     {
         if(mAttacker->IsPlayer())
         {
             _unit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
             RegisterAIUpdateEvent(1000);
             QuestLogEntry* qle = (static_cast<Player*>(mAttacker))->GetQuestLogForEntry(1173);
             if(!qle)
                 return;
             qle->SendQuestComplete();
         }
     }
 }
开发者ID:Lbniese,项目名称:AscEmu,代码行数:20,代码来源:Quest_Dustwallow_Marsh.cpp

示例14: OnDamageTaken

	void OnDamageTaken(Unit* mAttacker, float fAmount)
	{
		uint32 chance = RandomUInt(100);
		if(chance < 25)
		{
			_unit->CastSpell(mAttacker, dbcSpell.LookupEntry(6749), true);
		}
		if(_unit->GetUInt32Value(UNIT_FIELD_HEALTH)- fAmount<=_unit->GetUInt32Value(UNIT_FIELD_MAXHEALTH)*0.3)
		{
			if(mAttacker->GetTypeId() == TYPEID_PLAYER)
			{
				_unit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
				RegisterAIUpdateEvent(1000);
				QuestLogEntry *qle = (TO_PLAYER(mAttacker))->GetQuestLogForEntry(1173);
				if(!qle)
					return;
				qle->SendQuestComplete();
			}
		}
	}
开发者ID:Ballwinkle,项目名称:Ascent_NG,代码行数:20,代码来源:Dustwallow_Marsh.cpp

示例15: RodofPurification

bool RodofPurification(uint32 i, Spell* pSpell)
{
	Player *pPlayer = (Player*)pSpell->u_caster;
	if(!pPlayer)
		return true;

	if(!pSpell->u_caster->IsPlayer())
		return true;

	QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10839);
	if(qle == NULL)
		return true;

	GameObject* Darkstone = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-2512, 5418, 0, 185191);
	if(Darkstone != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, Darkstone) < 15)
			qle->SendQuestComplete();
	}
	return true;
}
开发者ID:AtVirus,项目名称:Descent-Scripts,代码行数:21,代码来源:QIspells.cpp


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