本文整理汇总了C++中PlayerPointer::HasAura方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerPointer::HasAura方法的具体用法?C++ PlayerPointer::HasAura怎么用?C++ PlayerPointer::HasAura使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerPointer
的用法示例。
在下文中一共展示了PlayerPointer::HasAura方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GossipHello
void InnkeeperGossip::GossipHello(ObjectPointer pObject, PlayerPointer Plr, bool AutoSend)
{
CreaturePointer pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?(TO_CREATURE(pObject)):NULLCREATURE;
if(pCreature==NULLCREATURE)
return;
GossipMenu *Menu;
uint32 TextID = 820;
uint32 Text = objmgr.GetGossipTextForNpc(pCreature->GetEntry());
if(Text != 0)
{
GossipText * text = NpcTextStorage.LookupEntry(Text);
if(text != 0)
TextID = Text;
}
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), TextID, Plr);
#ifdef EVENT_HALLOWEEN
if(!Plr->HasAura(SPELL_TRICK_OR_TREATED))
Menu->AddItem( 0, TRICK_OR_TREAT, 4 );
#endif
if( pObject->GetUInt32Value(UNIT_NPC_FLAGS) & UNIT_NPC_FLAG_VENDOR )
Menu->AddItem( 1, "I would like to browse your goods.", 1 );
Menu->AddItem( 5, "Make this inn your home.", 2 );
Menu->AddItem( 0, "What can I do at an inn?", 3 );
if(AutoSend)
Menu->SendTo(Plr);
}
示例2: OnActivate
void OnActivate(PlayerPointer pPlayer)
{
if(pPlayer && !pPlayer->HasAura(SILITHYST_SPELL))
pPlayer->CastSpell(pPlayer, SILITHYST_SPELL, true);
if(_gameobject)
_gameobject->Despawn(0);
}
示例3: OnActivate
void OnActivate(PlayerPointer pPlayer)
{
if(!pPlayer)
return;
QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10111);
if(qle == NULL)
return;
if(!pPlayer->HasAura(33382))
pPlayer->CastSpell(pPlayer, 33382, true);
}
示例4: GossipHello
void GossipHello(ObjectPointer pObject, PlayerPointer plr, bool AutoSend)
{
uint32 Team = plr->GetTeam();
if(Team > 1) Team = 1;
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), Team == 0 ? 9433 : 9750, plr);
if( pObject->GetUInt32Value(UNIT_NPC_FLAGS) & UNIT_NPC_FLAG_VENDOR )
Menu->AddItem( 0, "I would like to browse your goods.", 3 );
if( ZMg_superiorTeam == Team && ZMCityOwners != Team && !plr->HasAura( Team == 0 ? 32430 : 32431 ) )
Menu->AddItem( 0, Team == 0 ? "Give me the flag, I'll take it to the Central Tower for the glory of the Alliance!" : "Give me the flag, I'll take it to the Central Tower for the glory of the Horde!" , Team+1);
if(AutoSend)
Menu->SendTo(plr);
}
示例5: GossipSelectOption
void GossipSelectOption(ObjectPointer pObject, PlayerPointer plr, uint32 Id, uint32 IntId, const char * Code)
{
if( !plr )
return;
CreaturePointer pCreature = NULLCREATURE;
pCreature = pObject->IsCreature() ? TO_CREATURE( pObject ) : NULLCREATURE;
if( !pCreature )
return;
if( IntId == 3 )
{
plr->GetSession()->SendInventoryList(pCreature);
return;
}
uint32 CastSpellID = IntId == 1 ? 32430 : 32431;
if( CastSpellID != 0 )
if( !plr->HasAura( CastSpellID ) )
pCreature->CastSpell(plr,CastSpellID,true);
return;
}
示例6: AreatriggerHook
void AreatriggerHook(PlayerPointer pPlayer, uint32 triggerID)
{
if(!pPlayer)
return;
if(triggerID == ALLIANCE_RETURN ||
triggerID == HORDE_RETURN)
{
if(pPlayer->HasAura(SILITHYST_SPELL)) // if we doesn't have it, do nothing
{
pPlayer->RemoveAura(SILITHYST_SPELL);
/* Rewards */
pPlayer->CastSpell(pPlayer, TRACES_OF_SILITHYST, true);
pPlayer->m_honorPoints += REWARD_HONOR;
pPlayer->ModStanding(REWARD_REPUTATION_FACTION, REWARD_REPUTATION_VALUE);
uint32 quest = pPlayer->GetTeam() == ALLIANCE ? ALLIANCE_SILITHYST_QUEST : HORDE_SILITHYST_QUEST;
QuestLogEntry* qle = pPlayer->GetQuestLogForEntry(quest);
if(qle)
qle->SendQuestComplete();
/***********/
if(locked)
return;
silithyst_gathered[ pPlayer->GetTeam() ]++;
uint32 worldstate = pPlayer->GetTeam() == ALLIANCE ? WORLDSTATE_SILITHUS_GATHERED_ALLIANCE : WORLDSTATE_SILITHUS_GATHERED_HORDE;
pPlayer->GetMapMgr()->GetStateManager().UpdateWorldState(worldstate , silithyst_gathered[ pPlayer->GetTeam() ]);
if(silithyst_gathered[ pPlayer->GetTeam() ] >= SILITHYST_MAX)
{
locked = true; // we win, so opposite team must wait for server restart
winners = pPlayer->GetTeam();
pPlayer->GetMapMgr()->CastSpellOnPlayers(winners, CENARION_FAVOR);
pPlayer->GetMapMgr()->RemovePositiveAuraFromPlayers(winners == ALLIANCE ? HORDE : ALLIANCE, CENARION_FAVOR);
}
}
}
}
示例7: GossipSelectOption
void InnkeeperGossip::GossipSelectOption(ObjectPointer pObject, PlayerPointer Plr, uint32 Id, uint32 IntId, const char * Code)
{
CreaturePointer pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?(TO_CREATURE(pObject)):NULLCREATURE;
if(pCreature==NULLCREATURE)
return;
switch(IntId)
{
case 1: // VENDOR
Plr->GetSession()->SendInventoryList(pCreature);
break;
case 2: // BINDER
Plr->GetSession()->SendInnkeeperBind(pCreature);
break;
case 3: // WHAT CAN I DO ?
// Prepare second menu
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 1853, Plr);
Menu->AddItem(5, "Make this inn your home.", 2);
Menu->SendTo(Plr);
break;
case 4: // EVENT OF HALLOWEEN
if(!Plr->HasAura(SPELL_TRICK_OR_TREATED))
{
pCreature->CastSpell(Plr, SPELL_TRICK_OR_TREATED, true);
// either trick or treat, 50% chance
if(rand()%2)
{
Plr->CastSpell(Plr, SPELL_TREAT, true);
}
else
{
int32 trickspell=0;
switch (rand()%9)
{
case 0:
trickspell=24753; // cannot cast, random 30sec
break;
case 1:
trickspell=24713; // lepper gnome costume
break;
case 2:
if(Plr->getGender() == 0){
trickspell=24735; // male ghost costume
}else{
trickspell=24736; // female ghostcostume
}
break;
case 3:
if(Plr->getGender() == 0){
trickspell=24711; // male ninja costume
}else{
trickspell=24710; // female ninja costume
}
break;
case 4:
if(Plr->getGender() == 0){
trickspell=24708; // male pirate costume
}else{
trickspell=24709; // female pirate costume
}
break;
case 5:
trickspell=24723; // skeleton costume
break;
}
pCreature->CastSpell(Plr, trickspell, true);
}
}
Plr->Gossip_Complete();
break;
}
}