Run clang-format

This commit is contained in:
Yunfan Li
2024-08-04 10:23:36 +08:00
parent 44da167492
commit 53611c9040
835 changed files with 35085 additions and 31861 deletions

View File

@@ -1,8 +1,10 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "RogueActions.h"
#include "Event.h"
#include "ObjectGuid.h"
#include "Player.h"
@@ -42,101 +44,123 @@ bool CastVanishAction::isUseful()
return !botAI->HasAura(23333, bot) && !botAI->HasAura(23335, bot) && !botAI->HasAura(34976, bot);
}
bool CastTricksOfTheTradeOnMainTankAction::isUseful() {
bool CastTricksOfTheTradeOnMainTankAction::isUseful()
{
return CastSpellAction::isUseful() && AI_VALUE2(float, "distance", GetTargetName()) < 20.0f;
}
bool UseDeadlyPoisonAction::Execute(Event event) {
bool UseDeadlyPoisonAction::Execute(Event event)
{
std::vector<std::string> poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""};
std::vector<Item*> items;
std::string poison_name;
for (std::string& suffix: poison_suffixs) {
for (std::string& suffix : poison_suffixs)
{
poison_name = "Deadly Poison" + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
if (!items.empty())
{
break;
}
}
if (items.empty()) {
if (items.empty())
{
return false;
}
Item* const itemForSpell = bot->GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND );
Item* const itemForSpell = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
return UseItem(*items.begin(), ObjectGuid::Empty, itemForSpell);
// return UseItemAuto(*items.begin());
}
bool UseDeadlyPoisonAction::isPossible() {
bool UseDeadlyPoisonAction::isPossible()
{
std::vector<std::string> poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""};
std::vector<Item*> items;
std::string poison_name;
for (std::string& suffix: poison_suffixs) {
for (std::string& suffix : poison_suffixs)
{
poison_name = "Deadly Poison" + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
if (!items.empty())
{
break;
}
}
return !items.empty();
}
bool UseInstantPoisonAction::Execute(Event event) {
bool UseInstantPoisonAction::Execute(Event event)
{
std::vector<std::string> poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""};
std::vector<Item*> items;
std::string poison_name;
for (std::string& suffix: poison_suffixs) {
for (std::string& suffix : poison_suffixs)
{
poison_name = "Instant Poison" + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
if (!items.empty())
{
break;
}
}
if (items.empty()) {
if (items.empty())
{
return false;
}
Item* const itemForSpell = bot->GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND );
Item* const itemForSpell = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
return UseItem(*items.begin(), ObjectGuid::Empty, itemForSpell);
}
bool UseInstantPoisonAction::isPossible() {
bool UseInstantPoisonAction::isPossible()
{
std::vector<std::string> poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""};
std::vector<Item*> items;
std::string poison_name;
for (std::string& suffix: poison_suffixs) {
for (std::string& suffix : poison_suffixs)
{
poison_name = "Instant Poison" + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
if (!items.empty())
{
break;
}
}
return !items.empty();
}
bool UseInstantPoisonOffHandAction::Execute(Event event) {
bool UseInstantPoisonOffHandAction::Execute(Event event)
{
std::vector<std::string> poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""};
std::vector<Item*> items;
std::string poison_name;
for (std::string& suffix: poison_suffixs) {
for (std::string& suffix : poison_suffixs)
{
poison_name = "Instant Poison" + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
if (!items.empty())
{
break;
}
}
if (items.empty()) {
if (items.empty())
{
return false;
}
Item* const itemForSpell = bot->GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND );
Item* const itemForSpell = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
return UseItem(*items.begin(), ObjectGuid::Empty, itemForSpell);
}
bool UseInstantPoisonOffHandAction::isPossible() {
bool UseInstantPoisonOffHandAction::isPossible()
{
std::vector<std::string> poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""};
std::vector<Item*> items;
std::string poison_name;
for (std::string& suffix: poison_suffixs) {
for (std::string& suffix : poison_suffixs)
{
poison_name = "Instant Poison" + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
if (!items.empty())
{
break;
}
}