当前位置: 首页>>代码示例>>C++>>正文


C++ CreaturePointer::GetGUID方法代码示例

本文整理汇总了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;
                }
            }
        }
    }
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:27,代码来源:Instance_HallsOfLightning.cpp

示例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;
    }
}
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:74,代码来源:Gossip_Innkeepers.cpp


注:本文中的CreaturePointer::GetGUID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。