本文整理汇总了C++中QuestLogEntry::GetQuest方法的典型用法代码示例。如果您正苦于以下问题:C++ QuestLogEntry::GetQuest方法的具体用法?C++ QuestLogEntry::GetQuest怎么用?C++ QuestLogEntry::GetQuest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QuestLogEntry
的用法示例。
在下文中一共展示了QuestLogEntry::GetQuest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EyesAbove
bool EyesAbove(uint32 i, Spell * pSpell)
{
if( !pSpell->p_caster )
return true;
Unit * target = pSpell->GetUnitTarget();
if( !target || target->GetEntry() != 25432 || !target->isAlive())
return true;
Player * pPlayer = pSpell->p_caster;
QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 12453 );
if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] )
{
en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 );
en->SendUpdateAddKill( 0 );
en->UpdatePlayerFields();
}
return true;
}
示例2: PreparationForBattle
bool PreparationForBattle(uint32 i, Spell* pSpell)
{
if(pSpell->p_caster == NULL)
return true;
Player* pPlayer = pSpell->p_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;
};
示例3: PrayerBeads
bool PrayerBeads(uint32 i, Spell * pSpell)
{
if( !pSpell->p_caster )
return true;
Unit * target = pSpell->GetUnitTarget();
if( !target || target->GetEntry() != 22431 )
return true;
Player * pPlayer = pSpell->p_caster;
QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 10935 );
if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] )
{
en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 );
en->SendUpdateAddKill( 0 );
en->UpdatePlayerFields();
}
return true;
}
示例4: OnActivate
void OnActivate(Player * pPlayer)
{
if(pPlayer->HasFinishedQuest(4284))
{
QuestLogEntry *en = pPlayer->GetQuestLogForEntry(4288);
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");
}
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: ProtectingOurOwn
// Protecting Our Own
bool ProtectingOurOwn(uint32 i, Spell* pSpell)
{
if(pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer())
return true;
Player* plr = TO_PLAYER(pSpell->u_caster);
QuestLogEntry *qle = plr->GetQuestLogForEntry(10488);
if(qle == NULL)
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;
}
示例9: 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;
}
示例10: 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;
}
示例11: LayWreath
bool LayWreath(uint32 i, Spell* pSpell) //Peace at Last quest
{
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( 11152 );
if ( pQuest == NULL || pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] )
return true;
GameObject *pWreath = sEAS.SpawnGameobject( pPlayer, 501541, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 1 );
if ( pWreath != NULL )
{
sEAS.GameobjectDelete( pWreath, 2 * 60 * 1000 );
}
pQuest->SetMobCount( 0, 1 );
pQuest->SendUpdateAddKill( 0 );
pQuest->UpdatePlayerFields();
return true;
}
示例12: 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;
}
示例13: GossipSelectOption
void GossipSelectOption(ObjectPointer pObject, PlayerPointer plr, uint32 Id, uint32 IntId, const char * Code)
{
if(pObject->GetTypeId()!=TYPEID_UNIT)
return;
switch(IntId)
{
case 1:
{
GossipMenu * Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 10614, plr);
Menu->AddItem( 0, "But you are dragons! How could orcs do this to you?", 2);
Menu->SendTo(plr);
}break;
case 2:
{
GossipMenu * Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 10615, plr);
Menu->AddItem( 0, "Your mate?", 3);
Menu->SendTo(plr);
}break;
case 3:
{
GossipMenu * Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 10616, plr);
Menu->AddItem( 0, "I have battled many beasts, dragon. I will help you.", 4);
Menu->SendTo(plr);
}break;
case 4:
{
QuestLogEntry *pQuest = plr->GetQuestLogForEntry(10814);
if ( pQuest && pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] )
{
pQuest->SetMobCount(0, 1);
pQuest->SendUpdateAddKill(0);
pQuest->UpdatePlayerFields();
}
}break;
}
}
示例14: HealingTheLake
bool HealingTheLake(uint32 i, SpellPointer pSpell)
{
if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() )
return true;
PlayerPointer pPlayer = TO_PLAYER( pSpell->u_caster );
QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 9294 );
if ( pQuest == NULL )
return true;
if ( pQuest->GetMobCount( 0 ) < pQuest->GetQuest()->required_mobcount[0] )
{
pQuest->SetMobCount( 0, pQuest->GetMobCount( 0 ) + 1 );
pQuest->SendUpdateAddKill( 0 );
pQuest->UpdatePlayerFields();
return true;
}
return true;
}
示例15: GossipHello
void GossipHello(Object* pObject, Player* pPlayer, bool AutoSend)
{
if ( pPlayer == NULL ) // useless, but who knows
return;
if ( !pObject->IsCreature() ) // can't imagine to get this null lol
return;
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] )
{
if ( pPlayer->GetItemInterface()->GetItemCount( 29501 ) > 0 )
{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer( &Menu, pObject->GetGUID(), 10104, pPlayer );
Menu->AddItem( 0, "Walk free, Elder. Bring the spirits back to your tribe.", 1 );
if ( AutoSend )
Menu->SendTo( pPlayer );
}
}
}