• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetPlayerBot函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetPlayerBot

void PlayerbotHunterAI::Pull()
{
    if (!AUTO_SHOT) return;

    // check ammo
    uint32 ammo_id = GetPlayerBot()->GetUInt32Value(PLAYER_AMMO_ID);
    if (!ammo_id) {
        GetPlayerBot()->Say("I'm out of ammo.", LANG_UNIVERSAL);
        return;
    }

    Unit* pTarget = ObjectAccessor::GetUnit(*GetMaster(), GetMaster()->GetSelection());
    if (pTarget==NULL || pTarget->IsFriendlyTo(GetMaster()))
    {
        GetPlayerBot()->Say("Invalid target", LANG_UNIVERSAL);
        GetAI()->Follow(*GetMaster());
        return;
    }

    m_role = BOT_ROLE_DPS_RANGED;
    m_pulling = true;
    GetAI()->SetIgnoreUpdateTime(0);

    if(GetPlayerBot()->GetPet())
        GetPlayerBot()->GetPet()->SetReactState(REACT_PASSIVE);
}
开发者ID:Anonymus111,项目名称:chaoscore,代码行数:26,代码来源:PlayerbotHunterAI.cpp


示例2: GetHealthPercentRaid

uint8 PlayerbotClassAI::GetHealthPercentRaid(Player *gPlayer, uint8 &countNeedHealing)
{
    uint8 validMemberCount=0;
    uint16 totalHPPercent=0;
    std::list<Unit*> unitList;
    gPlayer->GetRaidMember(unitList,30);
    if(!unitList.empty()){
      for (std::list<Unit*>::iterator itr = unitList.begin() ; itr!=unitList.end();++itr) {
        //Player *tPlayer = GetPlayerBot()->GetObjPlayer((*itr)->GetGUID());
        Unit *tPlayer = sObjectMgr->GetPlayer((*itr)->GetGUID());
        if(tPlayer == NULL) continue;
        if(tPlayer->isDead()) continue;
        if(GetPlayerBot()->GetAreaId() != tPlayer->GetAreaId()) continue;
        //if(tPlayer->GetGUID() == GetPlayerBot()->GetGUID()) continue;
        if(GetPlayerBot()->GetDistance(tPlayer) > 30) continue;
        uint8 fndHPPercent =  tPlayer->GetHealth()*100 / tPlayer->GetMaxHealth();
        totalHPPercent+=fndHPPercent;
        validMemberCount++;
        if (fndHPPercent < 100) countNeedHealing++;

        //const std::string myname = GetPlayerBot()->GetName();
        //const std::string hisname = tPlayer->GetName();
        //sLog->outDebug("me = %s, checked= %s %u [%u / %u]", myname.c_str(), hisname.c_str(), fndHPPercent, tPlayer->GetHealth(), tPlayer->GetMaxHealth());

      }
    }
    if (validMemberCount == 0) return 100;
    return totalHPPercent / validMemberCount;
}
开发者ID:Togy,项目名称:prydevserv_backup,代码行数:29,代码来源:PlayerbotClassAI.cpp


示例3: GetPlayerBot

bool PlayerbotDruidAI::RezTarget (Unit *target)
{
    if(!target || target->isAlive()) return false;
    Player *m_bot = GetPlayerBot();
    if (target->IsNonMeleeSpellCasted(true)) { return false; } //Already resurrected

    if (m_bot->isInCombat())
    {
        if (!CanCast(REBIRTH,target)) return false;
        Unit *m_tank = FindMainTankInRaid(m_bot);
        if (!m_tank) m_tank = m_bot;
        if (target->GetGUID() != m_tank->GetGUID() &&
            (target->getClass() != (uint8) CLASS_PRIEST || target->getClass() != (uint8) CLASS_DRUID || target->getClass() != (uint8) CLASS_PALADIN) ) return false;
        std::string msg = "Rezzing ";
        msg += target->GetName();
       // msg += " with ";
       // msg += *REZZSpell->SpellName;
        GetPlayerBot()->Say(msg, LANG_UNIVERSAL);
        return CastSpell(REBIRTH, target);
    }
    else
    {
        if (!CanCast(REVIVE,target)) return false;
        std::string msg = "Rezzing ";
        msg += target->GetName();
       // msg += " with ";
       // msg += *REZZSpell->SpellName;
        GetPlayerBot()->Say(msg, LANG_UNIVERSAL);
        return CastSpell(REVIVE, target);
    }
    return false;
}
开发者ID:Anonymus111,项目名称:chaoscore,代码行数:32,代码来源:PlayerbotDruidAI.cpp


示例4: u_check

Unit *PlayerbotClassAI::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
{
    Unit *pUnit = NULL;
    Trinity::MostHPMissingInRange u_check(GetPlayerBot(), range, MinHPDiff);
    Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(GetPlayerBot(), pUnit, u_check);

    GetPlayerBot()->VisitNearbyObject(range, searcher);

    return pUnit;
}
开发者ID:Togy,项目名称:prydevserv_backup,代码行数:10,代码来源:PlayerbotClassAI.cpp


示例5: GetPlayerBot

bool PlayerbotPaladinAI::RezTarget (Unit *target)
{
    if(!target || target->isAlive()) return false;
    Player *m_bot = GetPlayerBot();
    if (target->IsNonMeleeSpellCasted(true)) { return false; } //Already resurrected
    if (m_bot->isInCombat()) { return false; }

    if (!CanCast(REDEMPTION,target)) return false;
    std::string msg = "Rezzing ";
    msg += target->GetName();
    GetPlayerBot()->Say(msg, LANGUAGE_UNIVERSAL);
    return CastSpell(REDEMPTION, target, false);
}
开发者ID:Crash911,项目名称:RaptoredSkyFire,代码行数:13,代码来源:PlayerbotPaladinAI.cpp


示例6: GetAI

bool PlayerbotRogueAI::ChangeWeaponEnchants()
{
    PlayerbotAI *ai = GetAI();
    Player *m_bot = GetPlayerBot();
    if (!m_bot || !ai || m_bot->isDead()) { return false; }

    Item *weap;
    Item *poison;
        
    weap = m_bot->GetWeaponForAttack(BASE_ATTACK);
    if (weap && !weap->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
    {
        poison = GetAI()->FindPoisonForward();
        if(poison == NULL) return false;
        GetAI()->PoisonWeapon(*poison, poison->GetProto()->Spells[0].SpellId, TARGET_FLAG_ITEM, EQUIPMENT_SLOT_MAINHAND);
        return true;
    }
    weap = m_bot->GetWeaponForAttack(OFF_ATTACK);
    if (weap && !weap->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
    {
        poison = GetAI()->FindPoisonBackward();
        if(poison == NULL) return false;
        GetAI()->PoisonWeapon(*poison, poison->GetProto()->Spells[0].SpellId, TARGET_FLAG_ITEM, EQUIPMENT_SLOT_OFFHAND);
        return true;
    }
    return false;
}
开发者ID:Mferrill,项目名称:BotCore,代码行数:27,代码来源:PlayerbotRogueAI.cpp


示例7: GetAI

void PlayerbotDeathKnightAI::DoNonCombatActions()
{
	PlayerbotAI* ai = GetAI();
	Player *m_bot = GetPlayerBot();
    if (!m_bot)
        return;

    SpellSequence = SPELL_DK_UNHOLY;

    // buff master with HORN_OF_WINTER
    if (HORN_OF_WINTER> 0)
        (!GetMaster()->HasAura(HORN_OF_WINTER,0) && ai->CastSpell (HORN_OF_WINTER, *GetMaster()));

    // hp check
    if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
        m_bot->SetStandState(UNIT_STAND_STATE_STAND);

    Item* pItem = ai->FindFood();
    Item* fItem = ai->FindBandage();

    if (pItem != NULL && ai->GetHealthPercent() < 30)
    {
        ai->TellMaster("I could use some food.");
        ai->UseItem(*pItem);
        ai->SetIgnoreUpdateTime(30);
        return;
    }
    else if (pItem == NULL && fItem != NULL && !m_bot->HasAura(RECENTLY_BANDAGED, 0) && ai->GetHealthPercent() < 70)
    {
        ai->TellMaster("I could use first aid.");
        ai->UseItem(*fItem);
        ai->SetIgnoreUpdateTime(8);
        return;
    }
} // end DoNonCombatActions
开发者ID:Chrissuit33,项目名称:mangos,代码行数:35,代码来源:PlayerbotDeathKnightAI.cpp


示例8: GetAI

void PlayerbotDruidAI::HealTarget(Unit &target, uint8 hp)
{
    PlayerbotAI* ai = GetAI();
    Player *m_bot = GetPlayerBot();

    if (hp < 70 && REJUVENATION > 0 && !target.HasAura(REJUVENATION, EFFECT_INDEX_0) && !target.HasAura(REGROWTH, EFFECT_INDEX_0) && ai->GetManaPercent() >=21)
        ai->CastSpell(REJUVENATION, target);

	if (hp < 60 && LIFEBLOOM > 0 && !target.HasAura(LIFEBLOOM, EFFECT_INDEX_0) && ai->GetManaPercent() >= 28)
        ai->CastSpell(LIFEBLOOM, target);

    if (hp < 55 && REGROWTH > 0 && !target.HasAura(REGROWTH, EFFECT_INDEX_0) && !target.HasAura(REJUVENATION, EFFECT_INDEX_0) && ai->GetManaPercent() >= 33)
        ai->CastSpell(REGROWTH, target);

	if (hp < 50 && SWIFTMEND > 0 && target.HasAura(REJUVENATION, EFFECT_INDEX_0) || target.HasAura(REGROWTH, EFFECT_INDEX_0) && ai->GetManaPercent() >= 16)
        ai->CastSpell(SWIFTMEND, target);

    if (hp < 45 && WILD_GROWTH > 0 && !target.HasAura(WILD_GROWTH, EFFECT_INDEX_0) && ai->GetManaPercent() >= 26)
        ai->CastSpell(WILD_GROWTH, target);

	if (hp < 30 && NOURISH > 0 && ai->GetManaPercent() >= 18)
        ai->CastSpell(NOURISH, target);

	if (hp < 25 && HEALING_TOUCH > 0 && ai->GetManaPercent() >= 38)
        ai->CastSpell(HEALING_TOUCH, target);
} // end HealTarget
开发者ID:aresxii,项目名称:aresxii,代码行数:26,代码来源:PlayerbotDruidAI.cpp


示例9: GetPlayerBot

bool PlayerbotShamanAI::HealTarget(Unit *target, uint8 hp)
{
    if(!target || target->isDead()) return false;
    Player *m_bot = GetPlayerBot();

    if(hp < 30 && m_bot->isInCombat() && CastSpell(NATURES_SWIFTNESS, m_bot)) {} // NO gcd
    if(hp < 60 && CanCast(HEAL,target,true) && m_bot->HasAura(NATURES_SWIFTNESS) && CastSpell(HEAL, target, false)) {
        return true;
    }
    if(hp < 30 && CastSpell(LESSER_HEAL,target,true,true)) {
        return true;
    }
    if(hp < 40 && m_bot->getRace() == (uint8) RACE_DRAENEI && CastSpell(R_GIFT_OF_NAARU,target)) {} // no GCD
    if(hp < 65 && CanCast(EARTH_SHIELD,target) && !m_bot->HasAura(EARTH_SHIELD,m_bot->GetGUID()) && CastSpell(EARTH_SHIELD,target,false)) {
        return true;
    }
    if(hp < 65 && CastSpell(HEAL,target,true,true)) {
        return true;
    }
    if(hp < 85 && CastSpell(LESSER_HEAL,target,true,true)) {
        return true;
    }

    return false;
} //end HealTarget
开发者ID:Crash911,项目名称:RaptoredSkyFire,代码行数:25,代码来源:PlayerbotShamanAI.cpp


示例10: GetAI

void PlayerbotDruidAI::DoNonCombatActions()
{
    PlayerbotAI *ai = GetAI();
    Player *m_bot = GetPlayerBot();
    if (!m_bot || !ai || m_bot->isDead()) { return; }

    //If Casting or Eating/Drinking return
    if (m_bot->HasUnitState(UNIT_STAT_CASTING)) { return; }
    if (m_bot->getStandState() == UNIT_STAND_STATE_SIT) { return; }

    //buff and heal raid
    if (DoSupportRaid(GetMaster())) { return; }
    if (m_bot->GetGroup() && GetMaster()->GetGroup() != m_bot->GetGroup() && DoSupportRaid(m_bot)) { return; }

    //heal pets and bots
    Unit *target = DoSelectLowestHpFriendly(30, 1000);
    if (target && target->isAlive() && HealTarget(target, target->GetHealth()*100 / target->GetMaxHealth())) { return; }

    //mana/hp check
    //Don't bother with eating, if low on hp, just let it heal themself
    if (m_bot->getRace() == (uint8) RACE_UNDEAD_PLAYER && ai->GetHealthPercent() < 75 && CastSpell(R_CANNIBALIZE,m_bot)) { return; }
    if (ai->GetManaPercent() < 10 && CastSpell (INNERVATE, m_bot)) { return; } //Need mana fast
    if (m_bot->GetHealth() < m_bot->GetMaxHealth() &&
        (ai->GetForm() != FORM_CAT && ai->GetForm() != FORM_MOONKIN && ai->GetForm() != FORM_DIREBEAR && ai->GetForm() != FORM_BEAR)
        && CastSpell(REGROWTH,m_bot)) { return; }
    if (ai->GetManaPercent() < 50) { ai->Feast(); }

} //end DoNonCombatActions
开发者ID:Anonymus111,项目名称:chaoscore,代码行数:28,代码来源:PlayerbotDruidAI.cpp


示例11:

Player * PlayerbotClassAI::FindMage(Player *gPlayer)
{
    Group::MemberSlotList const &groupSlot = gPlayer->GetGroup()->GetMemberSlots();
    for(Group::member_citerator itr = groupSlot.begin(); itr != groupSlot.end(); itr++)
    {
        Player *tPlayer = sObjectMgr->GetPlayer(itr->guid);

        if(tPlayer == NULL) continue;
        if(tPlayer->GetGUID() == GetPlayerBot()->GetGUID()) continue;
        if(GetPlayerBot()->GetAreaId() != gPlayer->GetAreaId()) continue;
        if(GetPlayerBot()->GetDistance(tPlayer) > 30) continue;

        if (tPlayer->getClass() == CLASS_MAGE) return tPlayer;
    }
    return NULL;
}
开发者ID:Togy,项目名称:prydevserv_backup,代码行数:16,代码来源:PlayerbotClassAI.cpp


示例12: GetPlayerBot

//Playerbot mod: logs out a Playerbot.
void WorldSession::LogoutPlayerBot(uint64 guid, bool Save)
{
    Player *pPlayerBot = GetPlayerBot(guid);

    if(pPlayerBot) //log out any playbots I have
    {
        //if (pPlayerBot->IsMounted()) pPlayerBot->GetPlayerbotAI()->GetClassAI()->Unmount();

        pPlayerBot->CombatStop();
        if(pPlayerBot->HaveBot())
            pPlayerBot->SetBotMustDie();

        // remove from group
        Group* m_group = pPlayerBot->GetGroup();
        if (m_group) {
            if (m_group->RemoveMember(pPlayerBot->GetGUID(),GROUP_REMOVEMETHOD_DEFAULT) <= 1) {
                delete m_group;
            }
        }

        WorldSession *pPlayerBotWorldSession = pPlayerBot->m_session;
        m_playerBots.erase(guid); //deletes bot player ptr inside this WorldSession PlayerBotMap
        pPlayerBotWorldSession->LogoutPlayer(Save); //this will delete the bot Player object and PlayerbotAI object
        delete pPlayerBotWorldSession; //finally delete the bot's WorldSession
    }
}
开发者ID:Erotix8210,项目名称:prydevserv_backup,代码行数:27,代码来源:WorldSession.cpp


示例13: GetAI

void PlayerbotDeathKnightAI::DoNonCombatActions()
{
    PlayerbotAI *ai = GetAI();
    Player *m_bot = GetPlayerBot();
    if (!m_bot || !ai || m_bot->isDead()) { return; }

    //If Casting or Eating/Drinking return
    if (m_bot->HasUnitState(UNIT_STATE_CASTING)) { return; }
    if (m_bot->getStandState() == UNIT_STAND_STATE_SIT) { return; }

    //Buff UP
    if (CastSpell(HORN_OF_WINTER,m_bot)) { return; }
    if (CastSpell(BONE_SHIELD,m_bot)) { return; }

    //mana/hp check
    if (m_bot->getRace() == (uint8) RACE_UNDEAD_PLAYER && ai->GetHealthPercent() < 75 && CastSpell(R_CANNIBALIZE,m_bot)) { return; }
    if (m_bot->GetHealth() < m_bot->GetMaxHealth() && CastSpell(RUNE_TAP,m_bot)) { return; } //no gcd but lets give the others a time to heal
    if (ai->GetHealthPercent() < 30) { ai->Feast(); }
    //Item* fItem = ai->FindBandage();
    /* if (pItem == NULL && fItem != NULL && !m_bot->HasAura(RECENTLY_BANDAGED, 0) && ai->GetHealthPercent() < 70)
    {
        ai->TellMaster("I could use first aid.");
        ai->UseItem(*fItem);
        ai->SetIgnoreUpdateTime(8);
        return;
    }  */
} // end DoNonCombatActions
开发者ID:Crash911,项目名称:RaptoredSkyFire,代码行数:27,代码来源:PlayerbotDeathKnightAI.cpp


示例14: GetPlayerBot

void PlayerbotMgr::LogoutPlayerBot(ObjectGuid guid)
{
    Player* bot = GetPlayerBot(guid);
    if (bot)
    {
        for (uint8 i = 0; i < MAX_ARENA_SLOT; ++i)
        {
            uint32 a_id = bot->GetArenaTeamId(i);
            if (a_id==0)
                continue;

            ArenaTeam *at = sObjectMgr.GetArenaTeamById(a_id);
            if (!at)
                continue;

            if (at->DisbandNoSave(bot))
                delete at;
        }

        if (bot->GetGroup())
            bot->RemoveFromGroup();

        WorldSession * botWorldSessionPtr = bot->GetSession();
        botWorldSessionPtr->LogoutPlayer(true); // this will delete the bot Player object and PlayerbotAI object
        delete botWorldSessionPtr;  // finally delete the bot's WorldSession
    }
}
开发者ID:Archives,项目名称:easy-mangos,代码行数:27,代码来源:PlayerbotMgr.cpp


示例15: GetAI

void PlayerbotShamanAI::DoNonCombatActions()
{
    PlayerbotAI *ai = GetAI();
    Player *m_bot = GetPlayerBot();
    if (!m_bot || !ai || m_bot->isDead()) { return; }

    //If Casting or Eating/Drinking return
    if (m_bot->HasUnitState(UNIT_STAT_CASTING)) { return; }
    if (m_bot->getStandState() == UNIT_STAND_STATE_SIT) { return; }

    //buff and heal raid
    if (DoSupportRaid(m_bot)) { return; }

    //heal pets and bots
    Unit *target = DoSelectLowestHpFriendly(40, 1000);
    if (target && target->isAlive() && HealTarget(target, target->GetHealth()*100 / target->GetMaxHealth())) { return; }

    //Buffs
    if (ChangeWeaponEnchants()) { return; }
    if (CastSpell(WATER_SHIELD,m_bot)) { return; }
    if (CastSpell(EARTH_SHIELD,m_bot)) { return; }

    //mana/hp check
    //Don't bother with eating, if low on hp, just let it heal themself
    if (m_bot->getRace() == (uint8) RACE_UNDEAD_PLAYER && ai->GetHealthPercent() < 75 && CastSpell(R_CANNIBALIZE,m_bot)) { return; }
    if (m_bot->GetHealth() < m_bot->GetMaxHealth() && CastSpell(LESSER_HEAL,m_bot)) { return; }
	if (ai->GetManaPercent() < 50) { ai->Feast(); }

} //end DoNonCombatActions
开发者ID:Anonymus111,项目名称:chaoscore,代码行数:29,代码来源:PlayerbotShamanAI.cpp


示例16: GetAI

bool PlayerbotDruidAI::HealTarget(Unit *target)
{
    PlayerbotAI* ai = GetAI();
    uint8 hp = target->GetHealth() * 100 / target->GetMaxHealth();

    if (hp >= 70)
        return false;

    // Reset form if needed
    GoBuffForm(GetPlayerBot());

    if (hp < 70 && REJUVENATION > 0 && !target->HasAura(REJUVENATION) && ai->CastSpell(REJUVENATION, *target))
        return true;

    if (hp < 60 && LIFEBLOOM > 0 && !target->HasAura(LIFEBLOOM) && ai->CastSpell(LIFEBLOOM, *target))
        return true;

    if (hp < 55 && REGROWTH > 0 && !target->HasAura(REGROWTH) && ai->CastSpell(REGROWTH, *target))
        return true;

    if (hp < 50 && SWIFTMEND > 0 && (target->HasAura(REJUVENATION) || target->HasAura(REGROWTH)) && ai->CastSpell(SWIFTMEND, *target))
        return true;

    if (hp < 45 && WILD_GROWTH > 0 && !target->HasAura(WILD_GROWTH) && ai->CastSpell(WILD_GROWTH, *target))
        return true;

    if (hp < 30 && NOURISH > 0 && ai->CastSpell(NOURISH, *target))
        return true;

    if (hp < 25 && HEALING_TOUCH > 0 && ai->CastSpell(HEALING_TOUCH, *target))
        return true;

    return false;
} // end HealTarget
开发者ID:BACKUPLIB,项目名称:Darkportalwow,代码行数:34,代码来源:PlayerbotDruidAI.cpp


示例17: GetHealthPercentRaid

bool PlayerbotClassAI::DoSupportRaid(Player *gPlayer, float radius, bool dResurrect, bool dGroupHeal, bool dHeal, bool dCure, bool dBuff)
{
    bool needHeal = false;
    if (dGroupHeal || dHeal)
    {
        uint8 cntNeedHeal = 0;
        uint8 raidHPPercent = GetHealthPercentRaid(gPlayer, cntNeedHeal);
        if (dGroupHeal && raidHPPercent <=90 && cntNeedHeal > 1)
        {
            if (HealGroup(gPlayer, raidHPPercent, cntNeedHeal)) return true;
        }
        if (raidHPPercent < 60 ) needHeal = true;
    }
    //std::list<Unit*> unitList;
    //gPlayer->GetRaidMember(unitList,30);
    Group *pGroup = gPlayer->GetGroup();
    if (!pGroup) return false;
    for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
    {
        Unit* tPlayer = itr->getSource();
        if(!tPlayer || gPlayer->IsHostileTo(tPlayer)) continue;
        if(GetPlayerBot()->GetAreaId() != tPlayer->GetAreaId()) continue;
        if(!m_bot->IsWithinDistInMap(tPlayer, radius)) {
            continue;
        }
        if(tPlayer->isDead()) // May be we can rez
        {
            if(!dResurrect) continue;
            if(needHeal) continue; //First heal others needing heal
            if(tPlayer->GetGUID() == GetPlayerBot()->GetGUID()) continue;
            if(tPlayer->IsNonMeleeSpellCasted(true)) continue; //Already rez
            if(RezTarget(tPlayer)) {
                return true;
            }
            else continue;
        }
        if (dHeal)
        {
            uint8 tarHPPercent = tPlayer->GetHealth()*100 / tPlayer->GetMaxHealth();
            if (tarHPPercent < 100 && HealTarget(tPlayer, tarHPPercent)) return true;
        }
        if (needHeal && dHeal) continue; //First heal others needing heal
        if (dCure && CureTarget(tPlayer)) return true;
        if (dBuff && BuffPlayer(tPlayer)) return true;
    }
    return false;
}
开发者ID:Sharki,项目名称:TC,代码行数:47,代码来源:PlayerbotClassAI.cpp


示例18: GetAI

bool PlayerbotWarriorAI::DoCombatManeuver(Unit *pTarget, bool cac)
{
    PlayerbotAI* ai = GetAI();
    Player* m_bot = GetPlayerBot();
    Player* m_master = ai->GetLeader();

    switch (m_bot->getRole())
    {
        case WarriorArms:
        {
            static const uint32 SpellArms[] = {BLOODTHIRST, WHIRLWIND, BLOODTHIRST, BLOODTHIRST, CLEAVE,
                WHIRLWIND, BLOODTHIRST, BLOODTHIRST, WHIRLWIND, BLOODTHIRST, HEROIC_STRIKE};
            static uint32 elt = sizeof(SpellArms)/sizeof(uint32);

            for (uint32 i = 1; i <= elt; ++i)
            {
                if (ai->CastSpell(SpellArms[(i+LastSpellArms)%elt], pTarget))
                {
                    LastSpellArms = (i+LastSpellArms)%elt;
                    return true;
                }
            }
            break;
        }
        case WarriorProtection:
        {
            static const uint32 SpellProtection[] = {CHARGE, REND, THUNDER_CLAP, CLEAVE, SHOCKWAVE,
                SUNDER_ARMOR, HEROIC_STRIKE, DEVASTATE, SHIELD_SLAM, REVENGE};
            static uint32 elt = sizeof(SpellProtection)/sizeof(uint32);

            for (uint32 i = 1; i <= elt; ++i)
            {
                if (ai->CastSpell(SpellProtection[(i+LastSpellProtection)%elt], pTarget))
                {
                    LastSpellProtection = (i+LastSpellProtection)%elt;
                    return true;
                }
            }
            break;
        }
        case WarriorFury:
        {
            static const uint32 SpellFury[] = {BLOODTHIRST, WHIRLWIND, BLOODTHIRST, BLOODTHIRST, CLEAVE,
                WHIRLWIND, BLOODTHIRST, BLOODTHIRST, WHIRLWIND, BLOODTHIRST, HEROIC_STRIKE};
            static uint32 elt = sizeof(SpellFury)/sizeof(uint32);

            for (uint32 i = 1; i <= elt; ++i)
            {
                if (ai->CastSpell(SpellFury[(i+LastSpellFury)%elt], pTarget))
                {
                    LastSpellFury = (i+LastSpellFury)%elt;
                    return true;
                }
            }
            break;
        }
    }
    return false;
}
开发者ID:Archives,项目名称:easy-mangos,代码行数:59,代码来源:PlayerbotWarriorAI.cpp


示例19: GetMaster

void PlayerbotDeathKnightAI::Pull()
{
    Unit* pTarget = ObjectAccessor::GetUnit(*GetMaster(), GetMaster()->GetSelection());
    if (pTarget==NULL || pTarget->IsFriendlyTo(GetMaster()))
    {
        GetPlayerBot()->Say("Invalid target", LANGUAGE_UNIVERSAL);
        m_pulling = false;
        GetAI()->Follow(*GetMaster());
        return;
    }

    m_role = BOT_ROLE_DPS_RANGED;
    m_pulling = true;
    GetAI()->SetIgnoreUpdateTime(0);

    if (GetPlayerBot()->GetPet()) GetPlayerBot()->GetPet()->SetReactState (REACT_PASSIVE);
}
开发者ID:Crash911,项目名称:RaptoredSkyFire,代码行数:17,代码来源:PlayerbotDeathKnightAI.cpp


示例20: GetPlayerBot

bool PlayerbotMageAI::CureTarget(Unit *target)
{
	//Cures the target
    Player *m_bot = GetPlayerBot();

    if(!target || target->isDead()) { return false; }
    if (castDispel(DISPEL_CURSE, target)) return true;
    return false;
}
开发者ID:dsstest,项目名称:Mojo-Tec-Skyfire-4.0.6a-,代码行数:9,代码来源:PlayerbotMageAI.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetPlayerBotsBegin函数代码示例发布时间:2022-05-30
下一篇:
C++ GetPlayer函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap