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


C++ GetSpell函数代码示例

本文整理汇总了C++中GetSpell函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSpell函数的具体用法?C++ GetSpell怎么用?C++ GetSpell使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetSpell函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SendObjectDeSpawnAnim

void Totem::UnSummon()
{
    SendObjectDeSpawnAnim(GetGUID());

    CombatStop();
    RemoveAurasDueToSpell(GetSpell());
    Unit *owner = GetOwner();
    if (owner)
    {
        owner->_RemoveTotem(this);
        owner->RemoveAurasDueToSpell(GetSpell());

        //remove aura all party members too
        if (owner->GetTypeId() == TYPEID_PLAYER)
        {
            // Not only the player can summon the totem (scripted AI)
            if(Group *pGroup = ((Player*)owner)->GetGroup())
            {
                for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
                {
                    Player* Target = itr->getSource();
                    if(Target && pGroup->SameSubGroup((Player*)owner, Target))
                        Target->RemoveAurasDueToSpell(GetSpell());
                }
            }
        }

        if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
            ((Creature*)owner)->AI()->SummonedCreatureDespawn((Creature*)this);
    }

    AddObjectToRemoveList();
}
开发者ID:dythzer,项目名称:mangoszero,代码行数:33,代码来源:Totem.cpp

示例2: GetCreatureInfo

void Totem::Summon(Unit* owner)
{
    owner->GetMap()->Add((Creature*)this);

    // select totem model in dependent from owner team
    CreatureInfo const *cinfo = GetCreatureInfo();
    if(owner->GetTypeId() == TYPEID_PLAYER && cinfo)
    {
        uint32 display_id = objmgr.ChooseDisplayId(((Player*)owner)->GetTeam(), cinfo);
        CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
        if (minfo)
            display_id = minfo->modelid;
        SetDisplayId(display_id);
    }

    AIM_Initialize();

    switch(m_type)
    {
        case TOTEM_PASSIVE:
            CastSpell(this, GetSpell(), true);
            break;
        case TOTEM_STATUE:
            CastSpell(GetOwner(), GetSpell(), true);
            break;
        default: break;
    }
}
开发者ID:1thew,项目名称:mangos,代码行数:28,代码来源:Totem.cpp

示例3: AIM_Initialize

void Totem::Summon(Unit* owner)
{
    AIM_Initialize();
    owner->GetMap()->Add((Creature*)this);

    if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
        ((Creature*)owner)->AI()->JustSummoned((Creature*)this);

    switch(m_type)
    {
        case TOTEM_PASSIVE:
        {
            for (uint32 i = 0; i <= GetSpellMaxIndex(); ++i)
            {
                if (uint32 spellId = GetSpell(i))
                    CastSpell(this, spellId, true);
            }
            break;
        }
        case TOTEM_STATUE:
        {
            if (GetSpell(0))
                CastSpell(GetOwner(), GetSpell(0), true);
            break;
        }
        default:
            break;
    }
}
开发者ID:mynew3,项目名称:mangos,代码行数:29,代码来源:Totem.cpp

示例4: CombatStop

void Totem::UnSummon() {
	CombatStop();
	RemoveAurasDueToSpell(GetSpell());

	// clear owner's totem slot
	for (int i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i) {
		if (m_owner->m_SummonSlot[i] == GetGUID()) {
			m_owner->m_SummonSlot[i] = 0;
			break;
		}
	}

	m_owner->RemoveAurasDueToSpell(GetSpell());

	//remove aura all party members too
	Group *pGroup = NULL;
	if (m_owner->GetTypeId() == TYPEID_PLAYER) {
		m_owner->ToPlayer()->SendAutoRepeatCancel(this);
		// Not only the player can summon the totem (scripted AI)
		pGroup = m_owner->ToPlayer()->GetGroup();
		if (pGroup) {
			for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL;
					itr = itr->next()) {
				Player* Target = itr->getSource();
				if (Target && pGroup->SameSubGroup((Player*) m_owner, Target))
					Target->RemoveAurasDueToSpell(GetSpell());
			}
		}
	}

	AddObjectToRemoveList();
}
开发者ID:FrenchCORE,项目名称:OLD_FrenchCORE,代码行数:32,代码来源:Totem.cpp

示例5: GetSpell

void CMagicState::SpendCost()
{
    if (m_PSpell->getSpellGroup() == SPELLGROUP_NINJUTSU)
    {
        if (!(m_flags & MAGICFLAGS_IGNORE_TOOLS))
        {
            // handle ninja tools
            battleutils::HasNinjaTool(m_PEntity, GetSpell(), true);
        }
    }
    else if (m_PSpell->hasMPCost() && !m_PEntity->StatusEffectContainer->HasStatusEffect(EFFECT_MANAFONT) && !(m_flags & MAGICFLAGS_IGNORE_MP))
    {
        int16 cost = battleutils::CalculateSpellCost(m_PEntity, GetSpell());

        // conserve mp
        int16 rate = m_PEntity->getMod(MOD_CONSERVE_MP);

        if (dsprand::GetRandomNumber(100) < rate)
        {
            cost *= (dsprand::GetRandomNumber(8.f, 16.f) / 16.0f);
        }

        m_PEntity->addMP(-cost);
    }
}
开发者ID:Kosmos82,项目名称:kosmosdarkstar,代码行数:25,代码来源:magic_state.cpp

示例6: SetInstanceId

void Totem::Summon(Unit* owner)
{
    sLog.outDebug("AddObject at Totem.cpp line 49");

    SetInstanceId(owner->GetInstanceId());
    owner->GetMap()->Add((Creature*)this);

    // select totem model in dependent from owner team
    CreatureInfo const *cinfo = GetCreatureInfo();
    if(owner->GetTypeId()==TYPEID_PLAYER && cinfo)
    {
        uint32 display_id = objmgr.ChooseDisplayId(((Player*)owner)->GetTeam(),cinfo);
        CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
        if (minfo)
            display_id = minfo->modelid;
        SetDisplayId(display_id);
    }

    WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
    data << GetGUID();
    SendMessageToSet(&data,true);

    AIM_Initialize();

    switch(m_type)
    {
        case TOTEM_PASSIVE: CastSpell(this, GetSpell(), true); break;
        case TOTEM_STATUE:  CastSpell(GetOwner(), GetSpell(), true); break;
        default: break;
    }
}
开发者ID:Aemu,项目名称:mangos,代码行数:31,代码来源:Totem.cpp

示例7: AIM_Initialize

void Totem::Summon(Unit* owner)
{
    AIM_Initialize();
    owner->GetMap()->Add((Creature*)this);

    if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
        ((Creature*)owner)->AI()->JustSummoned((Creature*)this);

    // there are some totems, which exist just for their visual appeareance
    if (!GetSpell())
        return;

    switch(m_type)
    {
    case TOTEM_PASSIVE:
        for (int i=0; i<MAX_CREATURE_SPELL_DATA_SLOT; ++i)
            if (m_spells[i])
                CastSpell(this, m_spells[i], true);
        break;
    case TOTEM_STATUE:
        CastSpell(GetOwner(), GetSpell(), true);
        break;
    default:
        break;
    }
}
开发者ID:koksneo,项目名称:MangosBack,代码行数:26,代码来源:Totem.cpp

示例8: AIM_Initialize

void Totem::Summon(Unit* owner)
{
    AIM_Initialize();
    owner->GetMap()->Add((Creature*)this);

    if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
        ((Creature*)owner)->AI()->JustSummoned((Creature*)this);
#ifdef ENABLE_ELUNA
    sEluna->OnSummoned(this, owner);
#endif /* ENABLE_ELUNA */

    // there are some totems, which exist just for their visual appeareance
    if (!GetSpell())
        return;

    switch (m_type)
    {
        case TOTEM_PASSIVE:
            CastSpell(this, GetSpell(), true);
            break;
        case TOTEM_STATUE:
            CastSpell(GetOwner(), GetSpell(), true);
            break;
        default: break;
    }
}
开发者ID:mangosthree,项目名称:server,代码行数:26,代码来源:Totem.cpp

示例9: SetMaxHealth

void Totem::Summon(Unit* owner)
{
    // Mana Tide Totem should have 10% of caster's health
    if(GetSpell() == 16191)
    {
        SetMaxHealth(owner->GetMaxHealth()*10/100);
        SetHealth(GetMaxHealth());
    }

    owner->GetMap()->Add((Creature*)this);

    AIM_Initialize();

    if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
        ((Creature*)owner)->AI()->JustSummoned((Creature*)this);

    // there are some totems, which exist just for their visual appeareance
    if (!GetSpell())
        return;

    switch(m_type)
    {
    case TOTEM_PASSIVE:
        CastSpell(this, GetSpell(), true);
        break;
    case TOTEM_STATUE:
        CastSpell(GetOwner(), GetSpell(), true);
        break;
    default:
        break;
    }
}
开发者ID:christof69,项目名称:fusion,代码行数:32,代码来源:Totem.cpp

示例10: AIM_Initialize

void Totem::Summon(Unit* owner)
{
    AIM_Initialize();
    owner->GetMap()->Add((Creature*)this);

    WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
    data << GetObjectGuid();
    SendMessageToSet(&data, true);

    if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
        ((Creature*)owner)->AI()->JustSummoned((Creature*)this);

    // there are some totems, which exist just for their visual appeareance
    if (!GetSpell())
        return;

    switch (m_type)
    {
        case TOTEM_PASSIVE:
            CastSpell(this, GetSpell(), true);
            break;
        case TOTEM_STATUE:
            CastSpell(GetOwner(), GetSpell(), true);
            break;
        default: break;
    }
}
开发者ID:ShyoZarak,项目名称:mangos-classic,代码行数:27,代码来源:Totem.cpp

示例11: CombatStop

void Totem::UnSummon()
{
    CombatStop();

    uint32 maxIdx = GetSpellMaxIndex();

    for (int32 i = maxIdx; i >= 0; --i)
    {
        if (uint32 spellId = GetSpell(i))
            RemoveAurasDueToSpell(spellId);
    }

    if (Unit* owner = GetOwner())
    {
        owner->_RemoveTotem(this);

        for (int32 i = maxIdx; i >= 0; --i)
        {
            if (uint32 spellId = GetSpell(i))
                owner->RemoveAurasDueToSpell(spellId);
        }

        // Remove Sentry Totem aura on totem unsummon
        if (GetEntry() == SENTRY_TOTEM_ENTRY)
            owner->RemoveAurasDueToSpell(6495);

        //remove aura all party members too
        if (owner->GetTypeId() == TYPEID_PLAYER)
        {
            ((Player*)owner)->SendAutoRepeatCancel(this);

            // Not only the player can summon the totem (scripted AI)
            if (Group* pGroup = ((Player*)owner)->GetGroup())
            {
                for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
                {
                    Player* Target = itr->getSource();
                    if (Target && pGroup->SameSubGroup((Player*)owner, Target))
                    {
                        for (int32 i = maxIdx; i >= 0; --i)
                        {
                            if (uint32 spellId = GetSpell(i))
                                Target->RemoveAurasDueToSpell(spellId);
                        }
                    }
                }
            }
        }

        if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
            ((Creature*)owner)->AI()->SummonedCreatureDespawn((Creature*)this);
    }

    // any totem unsummon look like as totem kill, req. for proper animation
    if (isAlive())
        SetDeathState(DEAD);

    AddObjectToRemoveList();
}
开发者ID:gc,项目名称:mangos,代码行数:59,代码来源:Totem.cpp

示例12: ForcedUnsummonDelayEvent

void Totem::UnSummon(uint32 msTime)
{
    if (msTime)
    {
        m_Events.AddEvent(new ForcedUnsummonDelayEvent(*this), m_Events.CalculateTime(msTime));
        return;
    }

    CombatStop();
    RemoveAurasDueToSpell(GetSpell(), GetGUID());

    // clear owner's totem slot
    for (uint8 i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i)
    {
        if (GetOwner()->m_SummonSlot[i] == GetGUID())
        {
            GetOwner()->m_SummonSlot[i].Clear();
            break;
        }
    }

    GetOwner()->RemoveAurasDueToSpell(GetSpell(), GetGUID());

    // Remove Sentry Totem Aura
    if (GetEntry() == SENTRY_TOTEM_ENTRY)
        GetOwner()->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID);

    //remove aura all party members too
    if (Player* owner = GetOwner()->ToPlayer())
    {
        owner->SendAutoRepeatCancel(this);

        if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL)))
            GetSpellHistory()->SendCooldownEvent(spell, 0, nullptr, false);

        if (Group* group = owner->GetGroup())
        {
            for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
            {
                Player* target = itr->GetSource();
                if (target && group->SameSubGroup(owner, target))
                    target->RemoveAurasDueToSpell(GetSpell(), GetGUID());
            }
        }
    }

    //npcbot: send SummonedCreatureDespawn()
    if (GetCreatorGUID().IsCreature())
        if (Unit* bot = ObjectAccessor::FindConnectedPlayer(GetCreatorGUID()))
            if (bot->ToCreature()->GetIAmABot())
                bot->ToCreature()->OnBotDespawn(this);
    //end npcbot

    AddObjectToRemoveList();
}
开发者ID:fannyfinal,项目名称:LordPsyanBots,代码行数:55,代码来源:Totem.cpp

示例13: CastSpell

void Totem::InitSummon()
{
    if (m_type == TOTEM_PASSIVE)
        CastSpell(this, GetSpell(), true);

    // Some totems can have both instant effect and passive spell
    if (GetSpell(1))
        CastSpell(this, GetSpell(1), true);
		
	if (m_owner->HasAuraEffect(58585, 0))
		CastSpell(this, 55277, true);
}
开发者ID:MobileDev,项目名称:P-Core,代码行数:12,代码来源:Totem.cpp

示例14: CastSpell

void Totem::InitSummon()
{
    if (m_type == TOTEM_PASSIVE && GetSpell())
        CastSpell(this, GetSpell(), true);

    // Some totems can have both instant effect and passive spell
    if (GetSpell(1))
        CastSpell(this, GetSpell(1), true);

    if (m_Properties->ID == SUMMON_TYPE_TOTEM_FIRE && GetOwner()->HasAura(SPELL_TOTEMIC_WRATH_TALENT))
        CastSpell(this, SPELL_TOTEMIC_WRATH, true);
}
开发者ID:Abrek,项目名称:My-WoDCore-6.x.x,代码行数:12,代码来源:Totem.cpp

示例15: data

void Totem::InitSummon()
{
    WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
    data << GetGUID();
    SendMessageToSet(&data, true);

    if(m_type == TOTEM_PASSIVE)
        CastSpell(this, GetSpell(), true);
    // Some totems can have both instant effect and passive spell
    if (GetSpell(1))
        CastSpell(this, GetSpell(1), true);
}
开发者ID:executor,项目名称:riboncore,代码行数:12,代码来源:Totem.cpp


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