mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Hunter pet happiness set
This commit is contained in:
parent
111109b112
commit
3525e30305
@ -679,7 +679,7 @@ void PlayerbotFactory::InitPet()
|
|||||||
{
|
{
|
||||||
pet->InitStatsForLevel(bot->getLevel());
|
pet->InitStatsForLevel(bot->getLevel());
|
||||||
pet->SetLevel(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());
|
pet->SetHealth(pet->GetMaxHealth());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -105,6 +105,11 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
|
|||||||
context->GetValue<Unit*>("current target")->Set(target);
|
context->GetValue<Unit*>("current target")->Set(target);
|
||||||
context->GetValue<LootObjectStack*>("available loot")->Get()->Add(guid);
|
context->GetValue<LootObjectStack*>("available loot")->Get()->Add(guid);
|
||||||
|
|
||||||
|
bool attacked = bot->Attack(target, true);
|
||||||
|
|
||||||
|
if (!attacked) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
/* prevent pet dead immediately in group */
|
/* prevent pet dead immediately in group */
|
||||||
if (bot->GetMap()->IsDungeon() && bot->GetGroup() && !target->IsInCombat()) {
|
if (bot->GetMap()->IsDungeon() && bot->GetGroup() && !target->IsInCombat()) {
|
||||||
with_pet = false;
|
with_pet = false;
|
||||||
@ -130,10 +135,10 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
|
|||||||
}
|
}
|
||||||
// bot->SetFacingToObject(target);
|
// bot->SetFacingToObject(target);
|
||||||
|
|
||||||
bool attacked = bot->Attack(target, true);
|
|
||||||
botAI->ChangeEngine(BOT_STATE_COMBAT);
|
botAI->ChangeEngine(BOT_STATE_COMBAT);
|
||||||
|
|
||||||
return attacked;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AttackDuelOpponentAction::isUseful()
|
bool AttackDuelOpponentAction::isUseful()
|
||||||
|
|||||||
@ -31,7 +31,7 @@ bool FeedPetAction::Execute(Event event)
|
|||||||
{
|
{
|
||||||
if (Pet* pet = bot->GetPet())
|
if (Pet* pet = bot->GetPet())
|
||||||
if (pet->getPetType() == HUNTER_PET && pet->GetHappinessState() != HAPPY)
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user