mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Hunter pet happiness set
This commit is contained in:
@@ -679,7 +679,7 @@ void PlayerbotFactory::InitPet()
|
||||
{
|
||||
pet->InitStatsForLevel(bot->getLevel());
|
||||
pet->SetLevel(bot->getLevel());
|
||||
pet->SetPower(POWER_HAPPINESS, HAPPINESS_LEVEL_SIZE * 2);
|
||||
pet->SetPower(POWER_HAPPINESS, pet->GetMaxPower(Powers(POWER_HAPPINESS)));
|
||||
pet->SetHealth(pet->GetMaxHealth());
|
||||
}
|
||||
else
|
||||
|
||||
@@ -105,6 +105,11 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
|
||||
context->GetValue<Unit*>("current target")->Set(target);
|
||||
context->GetValue<LootObjectStack*>("available loot")->Get()->Add(guid);
|
||||
|
||||
bool attacked = bot->Attack(target, true);
|
||||
|
||||
if (!attacked) {
|
||||
return false;
|
||||
}
|
||||
/* prevent pet dead immediately in group */
|
||||
if (bot->GetMap()->IsDungeon() && bot->GetGroup() && !target->IsInCombat()) {
|
||||
with_pet = false;
|
||||
@@ -130,10 +135,10 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
|
||||
}
|
||||
// bot->SetFacingToObject(target);
|
||||
|
||||
bool attacked = bot->Attack(target, true);
|
||||
|
||||
botAI->ChangeEngine(BOT_STATE_COMBAT);
|
||||
|
||||
return attacked;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AttackDuelOpponentAction::isUseful()
|
||||
|
||||
@@ -31,7 +31,7 @@ bool FeedPetAction::Execute(Event event)
|
||||
{
|
||||
if (Pet* pet = bot->GetPet())
|
||||
if (pet->getPetType() == HUNTER_PET && pet->GetHappinessState() != HAPPY)
|
||||
pet->SetPower(POWER_HAPPINESS, HAPPINESS_LEVEL_SIZE * 2);
|
||||
pet->SetPower(POWER_HAPPINESS, pet->GetMaxPower(Powers(POWER_HAPPINESS)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user