mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-17 03:20:06 +00:00
Fix buffs applying to non-COMBAT, non-ROAMING mobs
This commit is contained in:
parent
c113ea4a6c
commit
1800334bb7
@ -123,7 +123,7 @@ static SkillResult handleSkillBuff(SkillData* skill, int power, ICombatant* sour
|
||||
int combatLifetime = 0;
|
||||
if(!target->addBuff(timeBuffId,
|
||||
[drainType](EntityRef self, Buff* buff, int status, BuffStack* stack) {
|
||||
if(buff->id == ECSB_BOUNDINGBALL) {
|
||||
if(buff->id == ECSB_BOUNDINGBALL && status == ETBU_ADD) {
|
||||
// drain
|
||||
ICombatant* combatant = dynamic_cast<ICombatant*>(self.getEntity());
|
||||
combatant->takeDamage(buff->getLastSource(), 0); // aggro
|
||||
@ -138,7 +138,7 @@ static SkillResult handleSkillBuff(SkillData* skill, int power, ICombatant* sour
|
||||
Buffs::tickDrain(self, buff, COMBAT_TICKS_PER_DRAIN_PROC); // drain
|
||||
combatLifetime++;
|
||||
},
|
||||
&passiveBuff)) return SkillResult(); // no result if already buffed
|
||||
&passiveBuff)) return SkillResult();
|
||||
|
||||
sSkillResult_Buff result{};
|
||||
result.eCT = target->getCharType();
|
||||
|
@ -179,6 +179,9 @@ bool CombatNPC::addBuff(int buffId, BuffCallback<int, BuffStack*> onUpdate, Buff
|
||||
if(!isAlive())
|
||||
return false;
|
||||
|
||||
if (this->state != AIState::COMBAT && this->state != AIState::ROAMING)
|
||||
return false;
|
||||
|
||||
if(!hasBuff(buffId)) {
|
||||
buffs[buffId] = new Buff(buffId, getRef(), onUpdate, onTick, stack);
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user