本文整理汇总了C++中CreaturePointer::GetGUID方法的典型用法代码示例。如果您正苦于以下问题:C++ CreaturePointer::GetGUID方法的具体用法?C++ CreaturePointer::GetGUID怎么用?C++ CreaturePointer::GetGUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreaturePointer
的用法示例。
在下文中一共展示了CreaturePointer::GetGUID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCombatStart
void OnCombatStart(UnitPointer mTarget)
{
_unit->SendChatMessage( CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "You wish to confront the master? You must weather the storm!");
spark_timer = 0;
last_creation_hp = 100;
RegisterAIUpdateEvent(_unit->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME));
for( uint8 i=0; i<SPARKS_COUNT; i++)
{
CreatureProto *cp = CreatureProtoStorage.LookupEntry(28926);
CreatureInfo *ci = CreatureNameStorage.LookupEntry(28926);
CreaturePointer c = NULLCREATURE;
if (cp && ci)
{
c = _unit->GetMapMgr()->CreateCreature( 28926 );
if (c)
{
c->Load(cp,_unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), _unit->GetOrientation());
c->PushToWorld(_unit->GetMapMgr());
sparks[i] = c->GetGUID();
c->Root();
c->GetAIInterface()->disable_combat = true;
for( uint8 i=0; i<7; i++ )
c->SchoolImmunityList[i] = 1;
}
}
}
}
示例2: 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;
}
}