mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
fix debuff trigger
This commit is contained in:
parent
93b32ce398
commit
63048f2405
@ -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()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user