您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetSpell函数代码示例

51自学网 2021-06-01 21:15:14
  C++
这篇教程C++ GetSpell函数代码示例写得很实用,希望能帮到您。

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

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


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例16: 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());            }        }    }    // any totem unsummon look like as totem kill, req. for proper animation    if (IsAlive())        setDeathState(DEAD);    AddObjectToRemoveList();}
开发者ID:AwkwardDev,项目名称:RE,代码行数:52,


示例17: ForcedUnsummonDelayEvent

void Totem::UnSummon(uint32 msTime){     if (msTime)    {        m_Events.AddEvent(new ForcedUnsummonDelayEvent(*this), m_Events.CalculateTime(msTime));        return;    }    CombatStop();    RemoveAurasDueToSpell(GetSpell(), GetGUID());	Unit *m_owner = GetOwner();    // clear owner's totem slot    for (uint8 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(), GetGUID());    // Remove Sentry Totem Aura    if (GetEntry() == SENTRY_TOTEM_ENTRY)        m_owner->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID);    //remove aura all party members too    if (Player* owner = m_owner->ToPlayer())    {        owner->SendAutoRepeatCancel(this);        if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL)))            owner->SendCooldownEvent(spell, 0, NULL, false);        if (Group* group = owner->GetGroup())        {            for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())            {                Player* target = itr->GetSource();				if (target && target->IsInMap(owner) && group->SameSubGroup(owner, target))                    target->RemoveAurasDueToSpell(GetSpell(), GetGUID());            }        }    }    AddObjectToRemoveList();}
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:49,


示例18: GetGUID

void Totem::InitStats(uint32 duration){    // client requires SMSG_TOTEM_CREATED to be sent before adding to world and before removing old totem    if (GetOwner()->GetTypeId() == TYPEID_PLAYER && m_Properties->Slot >= SUMMON_SLOT_TOTEM && m_Properties->Slot < MAX_TOTEM_SLOT)    {        ObjectGuid TotemGUID = GetGUID();        uint32 SpellID = GetUInt32Value(UNIT_FIELD_CREATED_BY_SPELL);        uint8 Slot = uint8(m_Properties->Slot - 1);        GetOwner()->ToPlayer()->GetSession()->SendTotemCreated(TotemGUID, duration, SpellID, Slot);        // set display id depending on caster's race        SetDisplayId(GetOwner()->GetModelForTotem(PlayerTotemType(m_Properties->Id)));    }    Minion::InitStats(duration);    // Get spell cast by totem    if (SpellInfo const* totemSpell = sSpellMgr->GetSpellInfo(GetSpell()))        if (totemSpell->CalcCastTime(getLevel()))   // If spell has cast time -> its an active totem            m_type = TOTEM_ACTIVE;    m_duration = duration;    SetLevel(GetOwner()->getLevel());}
开发者ID:cooler-SAI,项目名称:JadeEmu-5.4.8,代码行数:25,


示例19: GetGUID

void Totem::InitStats(uint32 duration){    // client requires SMSG_TOTEM_CREATED to be sent before adding to world and before removing old totem    if (Player* owner = GetOwner()->ToPlayer())    {        if (m_Properties->Slot >= SUMMON_SLOT_TOTEM && m_Properties->Slot < MAX_TOTEM_SLOT)        {            WorldPackets::Totem::TotemCreated data;            data.Totem = GetGUID();            data.Slot = m_Properties->Slot - SUMMON_SLOT_TOTEM;            data.Duration = duration;            data.SpellID = GetUInt32Value(UNIT_CREATED_BY_SPELL);            owner->SendDirectMessage(data.Write());        }        // set display id depending on caster's race        if (uint32 totemDisplayId = sSpellMgr->GetModelForTotem(GetUInt32Value(UNIT_CREATED_BY_SPELL), owner->getRace()))            SetDisplayId(totemDisplayId);    }    Minion::InitStats(duration);    // Get spell cast by totem    if (SpellInfo const* totemSpell = sSpellMgr->GetSpellInfo(GetSpell()))        if (totemSpell->CalcCastTime(getLevel()))   // If spell has cast time -> its an active totem            m_type = TOTEM_ACTIVE;    m_duration = duration;    SetLevel(GetOwner()->getLevel());}
开发者ID:090809,项目名称:TrinityCore,代码行数:31,


示例20: GetCreatureInfo

void Totem::InitStats(uint32 duration){    Minion::InitStats(duration);    CreatureTemplate const *cinfo = GetCreatureInfo();    if (m_owner->GetTypeId() == TYPEID_PLAYER && cinfo)    {        uint32 displayID = sObjectMgr->ChooseDisplayId(m_owner->ToPlayer()->GetTeam(), cinfo);        sObjectMgr->GetCreatureModelRandomGender(&displayID);        switch (m_owner->ToPlayer()->GetTeam())        {            case ALLIANCE:                displayID = cinfo->Modelid1;                break;            case HORDE:                if (cinfo->Modelid3)                    displayID = cinfo->Modelid3;                else                    displayID = cinfo->Modelid1;                switch (((Player*)m_owner)->getRace())                {                    case RACE_ORC:                        if (cinfo->Modelid2)                            displayID = cinfo->Modelid2;                        else                            displayID = cinfo->Modelid1;                        break;                    case RACE_TROLL:                        if (cinfo->Modelid4)                            displayID = cinfo->Modelid4;                        else                            displayID = cinfo->Modelid1;                        break;                    default:                        break;                }                break;            default:                break;        }        SetDisplayId(displayID);    }    // Get spell casted by totem    SpellEntry const * totemSpell = sSpellStore.LookupEntry(GetSpell());    if (totemSpell)    {        // If spell have cast time -> so its active totem        if (GetSpellCastTime(totemSpell))            m_type = TOTEM_ACTIVE;    }    if (GetEntry() == SENTRY_TOTEM_ENTRY)        SetReactState(REACT_AGGRESSIVE);    m_duration = duration;    SetLevel(m_owner->getLevel());}
开发者ID:CrAzY666,项目名称:TrinityCore,代码行数:60,


示例21: GetCreatureInfo

void Totem::InitStats(uint32 duration){    Minion::InitStats(duration);    CreatureInfo const *cinfo = GetCreatureInfo();    if(m_owner->GetTypeId() == TYPEID_PLAYER && cinfo)    {        uint32 display_id = objmgr.ChooseDisplayId(((Player*)m_owner)->GetTeam(), cinfo);        CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);        if (minfo)            display_id = minfo->modelid;        SetDisplayId(display_id);    }    // Get spell casted by totem    SpellEntry const * totemSpell = sSpellStore.LookupEntry(GetSpell());    if (totemSpell)    {        // If spell have cast time -> so its active totem        if (GetSpellCastTime(totemSpell))            m_type = TOTEM_ACTIVE;    }    if(GetEntry() == SENTRY_TOTEM_ENTRY)        SetReactState(REACT_AGGRESSIVE);    m_duration = duration;    SetLevel(m_owner->getLevel());}
开发者ID:executor,项目名称:riboncore,代码行数:30,


示例22: DoNormalAttack

        void DoNormalAttack(uint32 diff)        {            opponent = me->GetVictim();            if (opponent)            {                if (!IsCasting())                    StartAttack(opponent, true);            }            else                return;            if (MoveBehind(*opponent))                wait = 5;            //float dist = me->GetExactDist(opponent);            float meleedist = me->GetDistance(opponent);            //TORMENT            if (IsSpellReady(TORMENT_1, diff, false) && meleedist < 5 && !IsTank(opponent->GetVictim()))            {                temptimer = GC_Timer;                if (doCast(opponent, GetSpell(TORMENT_1)))                {                    GC_Timer = temptimer;                    return;                }            }        }
开发者ID:GlassFace,项目名称:TrinityCoreOld,代码行数:27,


示例23: data

void Totem::InitStats(uint32 duration){    // client requires SMSG_TOTEM_CREATED to be sent before adding to world and before removing old totem    if (m_owner->GetTypeId() == TYPEID_PLAYER        && m_Properties->Slot >= SUMMON_SLOT_TOTEM        && m_Properties->Slot < MAX_TOTEM_SLOT)    {        WorldPacket data(SMSG_TOTEM_CREATED, 1 + 8 + 4 + 4);        data << uint8(m_Properties->Slot - 1);        data << uint64(GetGUID());        data << uint32(duration);        data << uint32(GetUInt32Value(UNIT_CREATED_BY_SPELL));        m_owner->ToPlayer()->SendDirectMessage(&data);        // set display id depending on caster's race        SetDisplayId(m_owner->GetModelForTotem(PlayerTotemType(m_Properties->Id)));    }    Minion::InitStats(duration);    // Get spell cast by totem    if (SpellInfo const* totemSpell = sSpellMgr->GetSpellInfo(GetSpell()))        if (totemSpell->CalcCastTime())   // If spell has cast time -> its an active totem            m_type = TOTEM_ACTIVE;    if (GetEntry() == SENTRY_TOTEM_ENTRY)        SetReactState(REACT_AGGRESSIVE);    m_duration = duration;    SetLevel(m_owner->getLevel());}
开发者ID:Neecro,项目名称:SkyFireEMU_rebase,代码行数:32,


示例24: GetCreatureInfo

void Totem::Summon(Unit* owner){    CreatureInfo const *cinfo = GetCreatureInfo();    if (owner->GetTypeId()==TYPEID_PLAYER && cinfo)    {        uint32 modelid = 0;        if(((Player*)owner)->GetTeam() == HORDE)        {            if(cinfo->Modelid_H1)                modelid = cinfo->Modelid_H1;            else if(cinfo->Modelid_H2)                modelid = cinfo->Modelid_H2;        }        else        {            if(cinfo->Modelid_A1)                modelid = cinfo->Modelid_A1;            else if(cinfo->Modelid_A2)                modelid = cinfo->Modelid_A2;        }        if (modelid)            SetDisplayId(modelid);        else            sLog.outErrorDb("Totem::Summon: Missing modelid information for entry %u, team %u, totem will use default values.",GetEntry(),((Player*)owner)->GetTeam());    }    // Only add if a display exists.    sLog.outDebug("AddObject at Totem.cpp line 49");    SetInstanceId(owner->GetInstanceId());    owner->GetMap()->Add((Creature*)this);    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;    }    if(GetEntry() == SENTRY_TOTEM_ENTRY)        SetReactState(REACT_AGGRESSIVE);}
开发者ID:Bootz,项目名称:TC-One,代码行数:47,


示例25: QueryPerformanceFrequency

void SpellCreationSystem::ProcessMessage(Message* data) {	/*		Check spellcastingcomponent			If a spell is being cast				Is it done casting?					Yes -> create spell					No -> Finish processing			If spellname contains a string/int not equal to NOCAST				If valid spell from spellbook					Yes -> Check if entity has appropriate resources						Yes -> Subtract resources and update spellcasting component						No -> Finish processing					No -> Finish processing; throw warning			If spellname contains NOCAST				Finish processing	*/	LARGE_INTEGER StartingTime, EndingTime, ElapsedMicroseconds;	LARGE_INTEGER Frequency;	QueryPerformanceFrequency(&Frequency);	QueryPerformanceCounter(&StartingTime);	// Check for valid spell message	if (data->GetID() == SPELLMESSAGEID)// auto msg = dynamic_cast<SpellMessage*>(data))	{		auto msg = static_cast<SpellMessage*>(data);		QueryPerformanceCounter(&EndingTime);		ElapsedMicroseconds.QuadPart = EndingTime.QuadPart - StartingTime.QuadPart;		auto spellcastingcomponent = GetEntityComponent<SpellCastingComponent*>(msg->entity, SpellCastingComponentID);		auto spellbookcomponent = GetEntityComponent<SpellbookComponent*>(msg->entity, SpellbookComponentID);		auto equipmentcomponent = GetEntityComponent<EquipmentComponent*>(msg->entity, EquipmentComponentID);		Spell* queuedspell = spellbookcomponent->GetSpell(msg->spellId);		if (spellcastingcomponent->SpellToCast() == NO_CAST) {			// Check if spell is still coolingdown			if (((TimeRunning() - queuedspell->lastcast) >= (queuedspell->cooldown + queuedspell->duration))) {				// Check any other spell casting requirements				spellcastingcomponent->SetSpellToCast(msg->spellId);				spellcastingcomponent->SetCastTime(queuedspell->casttime);				spellcastingcomponent->SetStartTimeOfCast(TimeRunning());				spellcastingcomponent->SetCancelable(queuedspell->cancelable);				castspells_.push_back(msg->entity);			}		}	}	else {		std::cout << "Invalid message type! Expected: SpellMessage Receieved: " << typeid(*data).name() << std::endl;	}	ElapsedMicroseconds.QuadPart *= 1000000;	ElapsedMicroseconds.QuadPart /= Frequency.QuadPart;	//std::cout << ElapsedMicroseconds.QuadPart << std::endl;}
开发者ID:ekirshey,项目名称:SwordsAndStuff,代码行数:58,


示例26: 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);}
开发者ID:deremix,项目名称:darmixcore,代码行数:9,


示例27: 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);	// xinef: this is better than the script, 100% sure to work    if(GetEntry() == SENTRY_TOTEM_ENTRY)	{        SetReactState(REACT_AGGRESSIVE);		GetOwner()->CastSpell(this, 6277, true);	}	this->GetMotionMaster()->MoveFall();}
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:18,



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


C++ GetSpellInfo函数代码示例
C++ GetSpeed函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。