本文整理汇总了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;
}
}
示例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;
}
}
示例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();
}
}
示例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 );
}
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
};
};
示例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);
}
示例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);
}
示例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);
}
示例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;
}
}
示例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);
}