mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
fix debuff trigger
This commit is contained in:
@@ -294,5 +294,9 @@ Value<Unit*>* BuffOnMainTankAction::GetTargetValue()
|
|||||||
|
|
||||||
bool CastDebuffSpellAction::isUseful()
|
bool CastDebuffSpellAction::isUseful()
|
||||||
{
|
{
|
||||||
return CastAuraSpellAction::isUseful() && GetTarget() && (GetTarget()->GetHealth() / AI_VALUE(float, "expected group dps")) >= needLifeTime;
|
Unit* target = GetTarget();
|
||||||
|
if (!target || !target->IsAlive() || !target->IsInWorld()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return CastAuraSpellAction::isUseful() && (target->GetHealth() / AI_VALUE(float, "expected group dps")) >= needLifeTime;
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,12 @@ float CastTimeMultiplier::GetValue(Action* action)
|
|||||||
castTime += duration;
|
castTime += duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (castTime > (1000 * action->GetTarget()->GetHealth() / AI_VALUE(float, "expected group dps"))) {
|
Unit* target = action->GetTarget();
|
||||||
|
if (!target || !target->IsAlive() || !target->IsInWorld()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (castTime > (1000 * target->GetHealth() / AI_VALUE(float, "expected group dps"))) {
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,7 +207,11 @@ bool TargetInSightTrigger::IsActive()
|
|||||||
|
|
||||||
bool DebuffTrigger::IsActive()
|
bool DebuffTrigger::IsActive()
|
||||||
{
|
{
|
||||||
return BuffTrigger::IsActive() && GetTarget() && (GetTarget()->GetHealth() / AI_VALUE(float, "expected group dps")) >= needLifeTime;
|
Unit* target = GetTarget();
|
||||||
|
if (!target || !target->IsAlive() || !target->IsInWorld()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return BuffTrigger::IsActive() && (target->GetHealth() / AI_VALUE(float, "expected group dps")) >= needLifeTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DebuffOnBossTrigger::IsActive()
|
bool DebuffOnBossTrigger::IsActive()
|
||||||
|
|||||||
Reference in New Issue
Block a user