Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
BattlePetBattleState.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef BATTLE_PET_BATTLE_STATE_H
7#define BATTLE_PET_BATTLE_STATE_H
8
9#include "BattlePet.h"
10#include "Common.h"
11
12#include <vector>
13
20
32
39
49
51{
52 bool Accepted = false;
53 bool HasRoundResult = false;
54 bool HasFinalRound = false;
55 bool TargetDied = false;
56 bool Abandoned = false;
57 bool Captured = false;
58 bool RequiresFrontPet = false;
65 std::vector<ActivePetBattleCooldown> Cooldowns;
66};
67
74
80
82{
84
85 bool IsActive() const { return EnemyGUID != 0; }
86 bool IsFinished() const { return Finished; }
87 bool IsPvP() const { return PvPBattle; }
90 bool CanAcceptInput(uint32 roundId) const { return CanAcceptRound(roundId); }
91 bool CanTrap(bool canStoreBattlePet = true, bool enemyTameable = true) const
92 {
93 return GetTrapStatus(canStoreBattlePet, enemyTameable) == PET_BATTLE_TRAP_STATUS_ACTIVE;
94 }
95
97 {
98 if (!IsActive() || IsFinished() || !IsAllyPetAlive(frontPet))
99 return false;
100
101 AllyFrontPet = frontPet;
104 return true;
105 }
106
107 void StartWild(uint64 enemyGuid, uint64 allyPetId, uint32 allyMaxHealth, uint32 allyHealth,
108 uint64 enemyPetId, uint32 enemyMaxHealth, uint32 enemyHealth,
109 uint16 enemySpecies = 0, uint8 enemyLevel = 0, uint8 enemyQuality = 0,
110 uint8 enemyBreed = 0, uint8 allyFrontPet = 0)
111 {
112 *this = ActivePetBattle();
113
114 PvPBattle = false;
116 EnemyGUID = enemyGuid;
117 EnemyPetID = enemyPetId;
118 EnemyMaxHealth = enemyMaxHealth;
119 EnemyHealth = NormalizeHealth(enemyHealth, enemyMaxHealth);
120 EnemySpecies = enemySpecies;
121 EnemyLevel = enemyLevel;
122 EnemyQuality = enemyQuality;
123 EnemyBreed = enemyBreed;
124 AllyFrontPet = IsValidAllyPetIndex(allyFrontPet) ? allyFrontPet : 0;
125 SetAllyPet(AllyFrontPet, allyPetId, allyMaxHealth, allyHealth);
126 }
127
128 void StartPvp(uint64 opponentGuid, uint64 allyPetId, uint32 allyMaxHealth, uint32 allyHealth,
129 uint64 enemyPetId, uint32 enemyMaxHealth, uint32 enemyHealth,
130 uint16 enemySpecies = 0, uint8 enemyLevel = 0, uint8 enemyQuality = 0,
131 uint8 allyFrontPet = 0, uint8 enemyFrontPet = 3,
133 {
134 *this = ActivePetBattle();
135
136 PvPBattle = true;
140 EnemyGUID = opponentGuid;
141 EnemyPetID = enemyPetId;
142 EnemyMaxHealth = enemyMaxHealth;
143 EnemyHealth = NormalizeHealth(enemyHealth, enemyMaxHealth);
144 EnemySpecies = enemySpecies;
145 EnemyLevel = enemyLevel;
146 EnemyQuality = enemyQuality;
147 AllyFrontPet = IsValidAllyPetIndex(allyFrontPet) ? allyFrontPet : 0;
148 EnemyFrontPet = enemyFrontPet;
149 SetAllyPet(AllyFrontPet, allyPetId, allyMaxHealth, allyHealth);
150 }
151
153 {
155 return AllyHealth;
156
157 damage = ApplyIncomingDamageReduction(AllyAura, damage);
158
159 if (damage >= AllyTeam[AllyFrontPet].Health)
160 AllyTeam[AllyFrontPet].Health = 0;
161 else
162 AllyTeam[AllyFrontPet].Health -= damage;
163
164 uint32 const remainingHealth = AllyTeam[AllyFrontPet].Health;
165 if (!remainingHealth)
166 {
169 else
171 }
172
174 return remainingHealth;
175 }
176
182
184 {
186 }
187
189 {
191 }
192
194 {
195 return ApplyAbilityRound(roundId, damage, BATTLE_PET_ABILITY_SLOT_INVALID, 0, 0);
196 }
197
199 uint32 abilityId, uint16 abilityCooldown)
200 {
201 ActivePetBattleTurn turn = CreateTurn(roundId);
202 if (!CanAcceptRound(roundId))
203 return turn;
204
206 return turn;
207
208 if (IsValidAbilitySlot(abilitySlot) && IsAllyAbilityOnCooldown(AllyFrontPet, abilitySlot))
209 return turn;
210
211 turn.Accepted = true;
212 turn.HasRoundResult = true;
214 turn.CasterPet = AllyFrontPet;
216 turn.RemainingHealth = ApplyEnemyDamage(damage);
217 turn.TargetDied = turn.RemainingHealth == 0;
218 turn.HasFinalRound = IsFinished();
219 turn.Winner = Winner;
220
221 StartAllyAbilityCooldown(AllyFrontPet, abilitySlot, abilityId, abilityCooldown);
223 return turn;
224 }
225
227 {
228 ActivePetBattleTurn turn = CreateTurn(roundId);
229 if (!CanAcceptRound(roundId))
230 return turn;
231
233 return turn;
234
235 turn.Accepted = true;
236 turn.HasRoundResult = true;
239 turn.TargetPet = AllyFrontPet;
240 turn.RemainingHealth = ApplyAllyDamage(damage);
241 turn.TargetDied = turn.RemainingHealth == 0;
243 turn.HasFinalRound = IsFinished();
244 turn.Winner = Winner;
245
247 return turn;
248 }
249
250 bool ApplyAbilityExchange(uint32 roundId, uint32 allyDamage, uint32 enemyDamage,
251 ActivePetBattleTurn& allyTurn, ActivePetBattleTurn& enemyTurn)
252 {
253 return ApplyAbilityExchange(roundId, allyDamage, enemyDamage, BATTLE_PET_ABILITY_SLOT_INVALID,
254 0, 0, allyTurn, enemyTurn);
255 }
256
257 bool ApplyAbilityExchange(uint32 roundId, uint32 allyDamage, uint32 enemyDamage,
258 uint8 allyAbilitySlot, uint32 allyAbilityId, uint16 allyAbilityCooldown,
259 ActivePetBattleTurn& allyTurn, ActivePetBattleTurn& enemyTurn)
260 {
261 allyTurn = CreateTurn(roundId);
262 enemyTurn = CreateTurn(roundId);
263
264 if (!CanAcceptRound(roundId))
265 return false;
266
268 return false;
269
270 if (IsValidAbilitySlot(allyAbilitySlot) && IsAllyAbilityOnCooldown(AllyFrontPet, allyAbilitySlot))
271 return false;
272
273 allyTurn.Accepted = true;
274 allyTurn.HasRoundResult = true;
276 allyTurn.CasterPet = AllyFrontPet;
277 allyTurn.TargetPet = EnemyFrontPet;
278 allyTurn.RemainingHealth = ApplyEnemyDamage(allyDamage);
279 allyTurn.TargetDied = allyTurn.RemainingHealth == 0;
280 allyTurn.HasFinalRound = IsFinished();
281 allyTurn.Winner = Winner;
282
283 if (!IsFinished())
284 {
285 enemyTurn.Accepted = true;
286 enemyTurn.HasRoundResult = true;
288 enemyTurn.CasterPet = EnemyFrontPet;
289 enemyTurn.TargetPet = AllyFrontPet;
290 enemyTurn.RemainingHealth = ApplyAllyDamage(enemyDamage);
291 enemyTurn.TargetDied = enemyTurn.RemainingHealth == 0;
292 enemyTurn.RequiresFrontPet = enemyTurn.TargetDied && WaitingForAllyFrontPet;
293 enemyTurn.HasFinalRound = IsFinished();
294 enemyTurn.Winner = Winner;
295 }
296
297 StartAllyAbilityCooldown(AllyFrontPet, allyAbilitySlot, allyAbilityId, allyAbilityCooldown);
298 FinishAcceptedRound(allyTurn);
299 return true;
300 }
301
303 {
304 ActivePetBattleTurn turn = CreateTurn(roundId);
305 if (!CanAcceptRound(roundId))
306 return turn;
307
308 if (!IsAllyPetAlive(newFrontPet))
309 return turn;
310
311 turn.Accepted = true;
312 turn.HasRoundResult = true;
314 turn.CasterPet = AllyFrontPet;
315 turn.TargetPet = newFrontPet;
316
317 AllyFrontPet = newFrontPet;
321 return turn;
322 }
323
325 {
326 ActivePetBattleTurn turn = CreateTurn(roundId);
327 if (!CanAcceptRound(roundId))
328 return turn;
329
331
332 turn.Accepted = true;
333 turn.HasFinalRound = true;
334 turn.Abandoned = true;
335 turn.Winner = Winner;
336 return turn;
337 }
338
340 {
341 ActivePetBattleTurn turn = CreateTurn(roundId);
342 if (!CanAcceptRound(roundId))
343 return turn;
344
346 return turn;
347
348 if (!CanTrap())
349 return turn;
350
351 turn.Accepted = true;
352 turn.Captured = captured;
353
354 if (captured)
355 {
357 Captured = true;
358
359 turn.HasFinalRound = true;
360 turn.Winner = Winner;
361 }
362 else
363 {
365 turn.HasRoundResult = true;
367 }
368
369 return turn;
370 }
371
372 bool ApplyTrapRoundWithEnemyResponse(uint32 roundId, bool captured, uint32 enemyDamage,
373 ActivePetBattleTurn& trapTurn, ActivePetBattleTurn& enemyTurn)
374 {
375 trapTurn = CreateTurn(roundId);
376 enemyTurn = CreateTurn(roundId);
377
378 if (!CanAcceptRound(roundId))
379 return false;
380
382 return false;
383
384 if (!CanTrap())
385 return false;
386
387 trapTurn.Accepted = true;
388 trapTurn.Captured = captured;
389
390 if (captured)
391 {
393 Captured = true;
394
395 trapTurn.HasFinalRound = true;
396 trapTurn.Winner = Winner;
397 return true;
398 }
399
401 trapTurn.HasRoundResult = true;
402
403 enemyTurn.Accepted = true;
404 enemyTurn.HasRoundResult = true;
406 enemyTurn.CasterPet = EnemyFrontPet;
407 enemyTurn.TargetPet = AllyFrontPet;
408 enemyTurn.RemainingHealth = ApplyAllyDamage(enemyDamage);
409 enemyTurn.TargetDied = enemyTurn.RemainingHealth == 0;
410 enemyTurn.RequiresFrontPet = enemyTurn.TargetDied && WaitingForAllyFrontPet;
411 enemyTurn.HasFinalRound = IsFinished();
412 enemyTurn.Winner = Winner;
413
414 FinishAcceptedRound(trapTurn);
415 return true;
416 }
417
418 uint8 GetTrapStatus(bool canStoreBattlePet = true, bool enemyTameable = true) const
419 {
420 if (!IsActive() || !enemyTameable)
422
423 if (Captured)
425
426 if (!AllyHealth || !EnemyHealth)
428
429 if (!canStoreBattlePet)
431
434
436 }
437
439 {
440 if (IsActive() && !Finished)
441 ++RoundID;
442 }
443
444 void Finish(uint8 winner)
445 {
446 Finished = true;
447 Winner = winner;
448 }
449
450 bool SetAllyPet(uint8 petIndex, uint64 petId, uint32 maxHealth, uint32 health)
451 {
452 if (!IsValidAllyPetIndex(petIndex) || !petId || !maxHealth)
453 return false;
454
455 AllyTeam[petIndex].PetID = petId;
456 AllyTeam[petIndex].MaxHealth = maxHealth;
457 AllyTeam[petIndex].Health = NormalizeHealth(health, maxHealth);
458
459 if (petIndex == AllyFrontPet)
461
462 return true;
463 }
464
465 bool HasAllyPet(uint8 petIndex) const
466 {
467 return IsValidAllyPetIndex(petIndex) && AllyTeam[petIndex].PetID != 0;
468 }
469
470 bool IsAllyPetAlive(uint8 petIndex) const
471 {
472 return HasAllyPet(petIndex) && AllyTeam[petIndex].Health != 0;
473 }
474
475 bool GetAllyPetHealth(uint64 petId, uint32& health) const
476 {
477 if (!petId)
478 return false;
479
480 for (uint8 i = 0; i < BATTLE_PET_MAX_ACTIVE_TEAM_PETS; ++i)
481 {
482 if (AllyTeam[i].PetID != petId)
483 continue;
484
485 health = AllyTeam[i].Health;
486 return true;
487 }
488
489 return false;
490 }
491
492 uint16 GetAllyAbilityCooldown(uint8 petIndex, uint8 abilitySlot) const
493 {
494 if (!IsValidAllyPetIndex(petIndex) || !IsValidAbilitySlot(abilitySlot))
495 return 0;
496
497 return AllyCooldowns[petIndex][abilitySlot].Cooldown;
498 }
499
509 bool Finished = false;
510 bool Captured = false;
511 bool PvPBattle = false;
513 bool RewardsApplied = false;
524
525private:
529
530 bool CanAcceptRound(uint32 roundId) const
531 {
532 return IsActive() && !Finished && roundId == RoundID;
533 }
534
536 {
538 turn.RoundID = roundId;
539 turn.Winner = Winner;
540 return turn;
541 }
542
543 static uint32 NormalizeHealth(uint32 health, uint32 maxHealth)
544 {
545 return maxHealth && health > maxHealth ? maxHealth : health;
546 }
547
549 {
550 if (!EnemyMaxHealth)
551 return false;
552
553 return uint64(EnemyHealth) * 100 <= uint64(EnemyMaxHealth) * 35;
554 }
555
556 static bool IsValidAllyPetIndex(uint8 petIndex)
557 {
558 return petIndex < BATTLE_PET_MAX_ACTIVE_TEAM_PETS;
559 }
560
561 static bool IsValidAbilitySlot(uint8 abilitySlot)
562 {
563 return abilitySlot < BATTLE_PET_ABILITY_SLOT_COUNT;
564 }
565
566 bool IsAllyAbilityOnCooldown(uint8 petIndex, uint8 abilitySlot) const
567 {
568 return GetAllyAbilityCooldown(petIndex, abilitySlot) != 0;
569 }
570
571 void StartAllyAbilityCooldown(uint8 petIndex, uint8 abilitySlot, uint32 abilityId, uint16 cooldown)
572 {
573 if (!IsValidAllyPetIndex(petIndex) || !IsValidAbilitySlot(abilitySlot) || !abilityId || !cooldown)
574 return;
575
576 ActivePetBattleCooldown& cooldownState = AllyCooldowns[petIndex][abilitySlot];
577 cooldownState.PetPBOID = petIndex;
578 cooldownState.AbilitySlot = abilitySlot;
579 cooldownState.AbilityID = abilityId;
580 cooldownState.Cooldown = cooldown;
581 cooldownState.Lockdown = 0;
582 cooldownState.OnCooldown = true;
583 }
584
585 void SnapshotAllyCooldowns(std::vector<ActivePetBattleCooldown>& cooldowns) const
586 {
587 for (uint8 petIndex = 0; petIndex < BATTLE_PET_MAX_ACTIVE_TEAM_PETS; ++petIndex)
588 {
589 for (uint8 abilitySlot = 0; abilitySlot < BATTLE_PET_ABILITY_SLOT_COUNT; ++abilitySlot)
590 {
591 ActivePetBattleCooldown const& cooldownState = AllyCooldowns[petIndex][abilitySlot];
592 if (cooldownState.OnCooldown)
593 cooldowns.push_back(cooldownState);
594 }
595 }
596 }
597
599 {
600 for (uint8 petIndex = 0; petIndex < BATTLE_PET_MAX_ACTIVE_TEAM_PETS; ++petIndex)
601 {
602 for (uint8 abilitySlot = 0; abilitySlot < BATTLE_PET_ABILITY_SLOT_COUNT; ++abilitySlot)
603 {
604 ActivePetBattleCooldown& cooldownState = AllyCooldowns[petIndex][abilitySlot];
605 if (cooldownState.OnCooldown && !cooldownState.Cooldown)
606 cooldownState = ActivePetBattleCooldown();
607 }
608 }
609 }
610
612 {
613 for (uint8 petIndex = 0; petIndex < BATTLE_PET_MAX_ACTIVE_TEAM_PETS; ++petIndex)
614 {
615 for (uint8 abilitySlot = 0; abilitySlot < BATTLE_PET_ABILITY_SLOT_COUNT; ++abilitySlot)
616 {
617 ActivePetBattleCooldown& cooldownState = AllyCooldowns[petIndex][abilitySlot];
618 if (!cooldownState.Cooldown)
619 continue;
620
621 --cooldownState.Cooldown;
622 }
623 }
624 }
625
627 {
628 if (!amount || !rounds)
629 return;
630
631 aura.IncomingDamageReduction = amount;
632 aura.Rounds = rounds;
633 }
634
636 {
637 if (!damage || !aura.Rounds || !aura.IncomingDamageReduction)
638 return damage;
639
640 return damage > aura.IncomingDamageReduction ? damage - aura.IncomingDamageReduction : 0;
641 }
642
644 {
645 if (!aura.Rounds)
646 return;
647
648 --aura.Rounds;
649 if (!aura.Rounds)
651 }
652
658
667
668 bool HasAliveAllyPetOtherThan(uint8 petIndex) const
669 {
670 for (uint8 i = 0; i < BATTLE_PET_MAX_ACTIVE_TEAM_PETS; ++i)
671 if (i != petIndex && IsAllyPetAlive(i))
672 return true;
673
674 return false;
675 }
676
678 {
680 {
681 AllyPetID = 0;
682 AllyMaxHealth = 0;
683 AllyHealth = 0;
684 return;
685 }
686
688 AllyPetID = activePet.PetID;
689 AllyMaxHealth = activePet.MaxHealth;
690 AllyHealth = activePet.Health;
691 }
692
693 uint32 ApplyDamage(uint32& health, uint32 damage, uint8 winner)
694 {
695 if (!IsActive() || Finished)
696 return health;
697
698 if (damage >= health)
699 {
700 health = 0;
701 Finish(winner);
702 }
703 else
704 health -= damage;
705
706 return health;
707 }
708};
709
710#endif // BATTLE_PET_BATTLE_STATE_H
BattlePetAchievementSource
Definition BattlePet.h:19
@ BATTLE_PET_ACHIEVEMENT_SOURCE_WILD
Definition BattlePet.h:20
@ BATTLE_PET_ACHIEVEMENT_SOURCE_PVP_DUEL
Definition BattlePet.h:21
@ BATTLE_PET_ACHIEVEMENT_SOURCE_PVP_MATCHMAKING
Definition BattlePet.h:22
constexpr uint8 BATTLE_PET_ABILITY_SLOT_INVALID
Definition BattlePet.h:16
constexpr uint8 BATTLE_PET_ABILITY_SLOT_COUNT
Definition BattlePet.h:15
PetBattleTrapStatus
@ PET_BATTLE_TRAP_STATUS_JOURNAL_FULL
@ PET_BATTLE_TRAP_STATUS_UNAVAILABLE
@ PET_BATTLE_TRAP_STATUS_ALREADY_TRAPPED
@ PET_BATTLE_TRAP_STATUS_HEALTH_TOO_HIGH
@ PET_BATTLE_TRAP_STATUS_ACTIVE
@ PET_BATTLE_TRAP_STATUS_NOT_CAPTURABLE
@ PET_BATTLE_TRAP_STATUS_NPC_PET
@ PET_BATTLE_TRAP_STATUS_DEAD_PET
@ PET_BATTLE_WINNER_ALLY
@ PET_BATTLE_WINNER_NONE
@ PET_BATTLE_WINNER_ENEMY
ActivePetBattleTurnEffect
@ ACTIVE_PET_BATTLE_TURN_EFFECT_DAMAGE
@ ACTIVE_PET_BATTLE_TURN_EFFECT_SWAP
@ ACTIVE_PET_BATTLE_TURN_EFFECT_NONE
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::uint64_t uint64
Definition Define.h:76
std::uint16_t uint16
Definition Define.h:78
uint32 ApplyAllyDamage(uint32 damage)
uint8 GetTrapStatus(bool canStoreBattlePet=true, bool enemyTameable=true) const
bool CanTrap(bool canStoreBattlePet=true, bool enemyTameable=true) const
uint32 ApplyEnemyDamage(uint32 damage)
bool ApplyAbilityExchange(uint32 roundId, uint32 allyDamage, uint32 enemyDamage, uint8 allyAbilitySlot, uint32 allyAbilityId, uint16 allyAbilityCooldown, ActivePetBattleTurn &allyTurn, ActivePetBattleTurn &enemyTurn)
static uint32 ApplyIncomingDamageReduction(ActivePetBattleAuraState const &aura, uint32 damage)
ActivePetBattleTurn ApplyEnemyAbilityRound(uint32 roundId, uint32 damage)
void StartPvp(uint64 opponentGuid, uint64 allyPetId, uint32 allyMaxHealth, uint32 allyHealth, uint64 enemyPetId, uint32 enemyMaxHealth, uint32 enemyHealth, uint16 enemySpecies=0, uint8 enemyLevel=0, uint8 enemyQuality=0, uint8 allyFrontPet=0, uint8 enemyFrontPet=3, BattlePetAchievementSource source=BATTLE_PET_ACHIEVEMENT_SOURCE_PVP_DUEL)
static bool IsValidAllyPetIndex(uint8 petIndex)
bool SelectAllyFrontPet(uint8 frontPet)
bool IsAllyPetAlive(uint8 petIndex) const
void SnapshotAllyCooldowns(std::vector< ActivePetBattleCooldown > &cooldowns) const
bool IsAllyAbilityOnCooldown(uint8 petIndex, uint8 abilitySlot) const
static void DecrementAura(ActivePetBattleAuraState &aura)
static bool IsValidAbilitySlot(uint8 abilitySlot)
bool CanAcceptRound(uint32 roundId) const
uint32 ApplyDamage(uint32 &health, uint32 damage, uint8 winner)
void StartAllyAbilityCooldown(uint8 petIndex, uint8 abilitySlot, uint32 abilityId, uint16 cooldown)
ActivePetBattleTurn ApplyTrapRound(uint32 roundId, bool captured)
ActivePetBattleTurn ApplyAbilityRound(uint32 roundId, uint32 damage)
void ActivateAllyIncomingDamageReduction(uint32 amount, uint8 rounds)
ActivePetBattleTurn CreateTurn(uint32 roundId) const
bool HasAliveAllyPetOtherThan(uint8 petIndex) const
ActivePetBattleCooldown AllyCooldowns[BATTLE_PET_MAX_ACTIVE_TEAM_PETS][BATTLE_PET_ABILITY_SLOT_COUNT]
BattlePetAchievementSource GetAchievementSource() const
void FinishAcceptedRound(ActivePetBattleTurn &turn)
ActivePetBattleTurn ApplyForfeit(uint32 roundId)
uint16 GetAllyAbilityCooldown(uint8 petIndex, uint8 abilitySlot) const
static uint32 NormalizeHealth(uint32 health, uint32 maxHealth)
bool ApplyAbilityExchange(uint32 roundId, uint32 allyDamage, uint32 enemyDamage, ActivePetBattleTurn &allyTurn, ActivePetBattleTurn &enemyTurn)
bool IsMatchmaking() const
bool CanAcceptInput(uint32 roundId) const
ActivePetBattleTurn ApplyAbilityRound(uint32 roundId, uint32 damage, uint8 abilitySlot, uint32 abilityId, uint16 abilityCooldown)
ActivePetBattlePetState AllyTeam[BATTLE_PET_MAX_ACTIVE_TEAM_PETS]
bool HasAllyPet(uint8 petIndex) const
void ActivateEnemyIncomingDamageReduction(uint32 amount, uint8 rounds)
void Finish(uint8 winner)
bool SetAllyPet(uint8 petIndex, uint64 petId, uint32 maxHealth, uint32 health)
ActivePetBattleAuraState EnemyAura
ActivePetBattleTurn ApplySwapRound(uint32 roundId, uint8 newFrontPet)
bool GetAllyPetHealth(uint64 petId, uint32 &health) const
static constexpr uint8 BATTLE_PET_MAX_ACTIVE_TEAM_PETS
BattlePetAchievementSource Source
void StartWild(uint64 enemyGuid, uint64 allyPetId, uint32 allyMaxHealth, uint32 allyHealth, uint64 enemyPetId, uint32 enemyMaxHealth, uint32 enemyHealth, uint16 enemySpecies=0, uint8 enemyLevel=0, uint8 enemyQuality=0, uint8 enemyBreed=0, uint8 allyFrontPet=0)
ActivePetBattleAuraState AllyAura
bool IsEnemyHealthTrapEligible() const
static void ActivateIncomingDamageReduction(ActivePetBattleAuraState &aura, uint32 amount, uint8 rounds)
bool ApplyTrapRoundWithEnemyResponse(uint32 roundId, bool captured, uint32 enemyDamage, ActivePetBattleTurn &trapTurn, ActivePetBattleTurn &enemyTurn)
std::vector< ActivePetBattleCooldown > Cooldowns