本文整理汇总了C++中QuestLogEntry类的典型用法代码示例。如果您正苦于以下问题:C++ QuestLogEntry类的具体用法?C++ QuestLogEntry怎么用?C++ QuestLogEntry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QuestLogEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDied
void OnDied(Unit* mKiller)
{
if (mKiller->IsPlayer())
{
QuestLogEntry *en = (TO_PLAYER(mKiller))->GetQuestLogForEntry(11096);
if(en && en->GetMobCount(0) < en->GetQuest()->required_mobcount[0])
{
uint32 newcount = en->GetMobCount(0) + 1;
en->SetMobCount(0, newcount);
en->SendUpdateAddKill(0);
en->UpdatePlayerFields();
return;
}
}
}
示例2: GossipSelectOption
void GossipSelectOption(Object* pObject, Player* pPlayer, uint32 Id, uint32 IntId, const char* EnteredCode)
{
if(pPlayer == NULL)
return;
if(!pObject->IsCreature())
return;
switch(IntId)
{
case 0:
GossipHello(pObject, pPlayer);
break;
case 1:
{
int32 i = -1;
Creature* pPrisoner = static_cast<Creature*>(pObject);
switch(pPrisoner->GetEntry())
{
case 20677:
i = 0;
break;
case 20678:
i = 1;
break;
case 20679:
i = 2;
break;
}
if(i == -1)
return;
QuestLogEntry* pQuest = pPlayer->GetQuestLogForEntry(10368);
if(pQuest != NULL && pQuest->GetMobCount(i) < pQuest->GetQuest()->required_mobcount[i])
{
pQuest->SetMobCount(i, pQuest->GetMobCount(i) + 1);
pQuest->SendUpdateAddKill(i);
pQuest->UpdatePlayerFields();
pPrisoner->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You've freed me! The winds speak to my people one again and grant us their strength. I thank you, stranger.");
pPrisoner->Despawn(5000, 6 * 60 * 1000);
pPrisoner->SetStandState(STANDSTATE_STAND);
}
}
break;
}
}
示例3: 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;
};
示例4: OnActivate
void OnActivate( Player *p ){
QuestLogEntry *qle = p->GetQuestLogForEntry(5097);
if(qle == NULL){
qle = p->GetQuestLogForEntry(5098);
if(qle == NULL)
return;
}
if(qle->GetMobCount(2) < qle->GetQuest()->required_mobcount[2]){
qle->SetMobCount(2, qle->GetMobCount(2)+1);
qle->SendUpdateAddKill(2);
qle->UpdatePlayerFields();
}
}
示例5: OnActivate
void OnActivate(PlayerPointer pPlayer)
{
if(!pPlayer)
return;
QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10447);
if(qle == NULL)
return;
if(qle->GetMobCount(1) < qle->GetQuest()->required_mobcount[1])
{
qle->SetMobCount(1, qle->GetMobCount(1)+1);
qle->SendUpdateAddKill(1);
qle->UpdatePlayerFields();
}
}
示例6: UnlockKarynakuChains
bool UnlockKarynakuChains(uint32 i, SpellPointer pSpell) // Becoming a Shadoweave Tailor
{
if(pSpell->u_caster->IsPlayer() == false)
return true;
PlayerPointer pPlayer= TO_PLAYER(pSpell->u_caster);
QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry(10872);
if(pQuest == NULL)
return true;
if ( pQuest && pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] )
{
pQuest->SetMobCount(0, pQuest->GetMobCount(0)+1);
pQuest->SendUpdateAddKill(0);
pQuest->UpdatePlayerFields();
}
return true;
}
示例7: OnDied
void OnDied(Unit * mKiller)
{
if (mKiller->IsPlayer())
{
QuestLogEntry *qle = TO_PLAYER(mKiller)->GetQuestLogForEntry(11230);
if( qle != NULL )
{
if( qle->GetMobCount( 0 ) < qle->GetQuest()->required_mobcount[ 0 ] )
{
uint32 newcount = qle->GetMobCount( 0 ) + 1;
qle->SetMobCount( 0, newcount );
qle->SendUpdateAddKill( 0 );
qle->UpdatePlayerFields();
return;
}
}
}
}
示例8: OnDied
void OnDied(Unit* pKiller)
{
Player* QuestHolder = NULL;
if(pKiller->IsPlayer())
QuestHolder = TO_PLAYER(pKiller);
else if(pKiller->IsPet() && TO_PET(pKiller)->GetPetOwner() != NULL)
QuestHolder = TO_PET(pKiller)->GetPetOwner();
if(QuestHolder == NULL)
return;
// M4ksiu: I don't think the method is correct, but it can stay the way it was until someone gives proper infos
QuestLogEntry* Quest = QuestHolder->GetQuestLogForEntry(9670);
Creature* RandomCreature = NULL;
if(Quest == NULL)
{
// Creatures from Bloodmyst Isle
uint32 Id[ 51 ] = { 17681, 17887, 17550, 17323, 17338, 17341, 17333, 17340, 17353, 17320, 17339, 17337, 17715, 17322, 17494, 17654, 17342, 17328, 17331, 17325, 17321, 17330, 17522, 17329, 17524, 17327, 17661, 17352, 17334, 17326, 17324, 17673, 17336, 17346, 17589, 17609, 17608, 17345, 17527, 17344, 17347, 17525, 17713, 17523, 17348, 17606, 17604, 17607, 17610, 17358, 17588 };
RandomCreature = _unit->GetMapMgr()->GetInterface()->SpawnCreature(Id[ RandomUInt(50) ], _unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), _unit->GetOrientation(), true, false, 0, 0);
if(RandomCreature != NULL)
{
RandomCreature->m_noRespawn = true;
RandomCreature->Despawn(60000, 0);
};
return;
}
else
{
uint32 Id[ 8 ] = { 17681, 17321, 17330, 17522, 17673, 17336, 17346, 17589 };
RandomCreature = _unit->GetMapMgr()->GetInterface()->SpawnCreature(Id[ RandomUInt(7) ], _unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), _unit->GetOrientation(), true, false, 0, 0);
if(RandomCreature != NULL)
{
RandomCreature->m_noRespawn = true;
RandomCreature->Despawn(60000, 0);
if(RandomCreature->GetEntry() == 17681 && Quest->GetMobCount(0) < Quest->GetQuest()->required_mobcount[ 0 ])
{
Quest->SetMobCount(0, Quest->GetMobCount(0) + 1);
Quest->SendUpdateAddKill(0);
Quest->UpdatePlayerFields();
};
};
};
};
示例9: OnActivate
void OnActivate(Player* pPlayer)
{
if(pPlayer->HasFinishedQuest(4284))
{
QuestLogEntry *en = pPlayer->GetQuestLogForEntry(4287);
if(en && en->GetMobCount(0) < en->GetQuest()->required_mobcount[0])
{
uint32 newcount = en->GetMobCount(0) + 1;
en->SetMobCount(0, newcount);
en->SendUpdateAddKill(0);
en->UpdatePlayerFields();
return;
}
}
else if(pPlayer->HasFinishedQuest(4284) == false)
{
pPlayer->BroadcastMessage("You need to have completed the quest : Crystals of Power");
}
}
示例10: OrbOfMurlocControl
bool OrbOfMurlocControl(uint32 i, Spell* pSpell)
{
if(pSpell->m_caster->IsPlayer() == false)
return true;
Player* plr = TO_PLAYER(pSpell->u_caster);
QuestLogEntry *pQuest = plr->GetQuestLogForEntry(11541);
if(pQuest == NULL)
return true;
Unit* mTarget;
Creature* cTarget;
for(ObjectSet::iterator itr = pSpell->m_caster->GetInRangeSetBegin(); itr != pSpell->m_caster->GetInRangeSetEnd(); itr++)
{
if((*itr)->IsUnit())
mTarget = TO_UNIT(*itr);
else
continue;
if(pSpell->m_caster->CalcDistance(mTarget) > 5 )
continue;
cTarget = TO_CREATURE(mTarget);
if(cTarget->GetEntry() == 25084)
{
if(pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0])
{
pQuest->SetMobCount(0, pQuest->GetMobCount(0) + 1);
pQuest->SendUpdateAddKill(0);
Creature* FreedGreengill = sEAS.SpawnCreature(plr, 25085, cTarget->GetPositionX(), cTarget->GetPositionY(), cTarget->GetPositionZ(), cTarget->GetOrientation(), 0);
FreedGreengill->Despawn(6*60*1000, 0);
cTarget->Despawn(0, 6*60*1000);
pQuest->UpdatePlayerFields();
return true;
}
}
}
return true;
}
示例11: OnActivate
void OnActivate(Player* pPlayer)
{
QuestLogEntry* qle = pPlayer->GetQuestLogForEntry(9667);
if(qle == NULL)
return;
if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
{
qle->SetMobCount(0, qle->GetMobCount(0) + 1);
qle->SendUpdateAddKill(0);
qle->UpdatePlayerFields();
}
Creature* princess = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 17682);
if(!princess)
return;
princess->Despawn(1000, 6 * 60 * 1000);
return;
}
示例12: HodirsHorn
bool HodirsHorn(uint32 i, Spell * pSpell)
{
if( !pSpell->p_caster )
return true;
Unit * target = pSpell->GetUnitTarget();
if( !target || ( target->GetEntry() != 29974 && target->GetEntry() != 30144 && target->GetEntry() != 30135) || !target->IsDead())
return true;
TO_CREATURE(target)->Despawn(500, 360000);
Player * pPlayer = pSpell->p_caster;
QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 12977 );
if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] )
{
en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 );
en->SendUpdateAddKill( 0 );
en->UpdatePlayerFields();
}
return true;
}
示例13: PoweringOurDefenses
bool PoweringOurDefenses(uint32 i, Spell* pSpell)
{
if(pSpell->u_caster->IsPlayer() == false)
return true;
Player * plr = TO_PLAYER(pSpell->u_caster);
QuestLogEntry *qle = plr->GetQuestLogForEntry( 8490 );
if( qle == NULL )
return true;
// Angelis : Need to script the scourge attack
if( qle && qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0] )
{
qle->SetMobCount(0, qle->GetMobCount(0)+1);
qle->SendUpdateAddKill(0);
qle->UpdatePlayerFields();
}
return true;
}
示例14: FindingTheSource
bool FindingTheSource(uint32 i, Spell * pSpell)
{
if(pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer())
return true;
Player *plr = (Player*)pSpell->u_caster;
QuestLogEntry *qle = plr->GetQuestLogForEntry(974);
if( !qle )
return true;
if ( qle->GetMobCount( 0 ) < qle->GetQuest()->required_mobcount[0] )
{
uint32 NewCount = qle->GetMobCount( 0 ) + 1;
qle->SetMobCount( 0, NewCount );
qle->SendUpdateAddKill( 0 );
qle->UpdatePlayerFields();
}
return true;
}
示例15: StoppingtheSpread
bool StoppingtheSpread(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(9874);
if(qle == NULL)
return true;
if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
{
qle->SetMobCount(0, qle->GetMobCount(0)+1);
qle->SendUpdateAddKill(0);
qle->UpdatePlayerFields();
}
return true;
}