CheckEncounterState behavior added
This commit is contained in:
parent
0ac5658535
commit
d03c86efef
@ -307,6 +307,7 @@ void Entity::MeleeAttack(Spawn* victim, float distance, bool primary, bool multi
|
||||
SetAttackDelay(primary);
|
||||
|
||||
if(victim->IsNPC() && victim->EngagedInCombat() == false) {
|
||||
CheckEncounterState((Entity*)victim);
|
||||
((NPC*)victim)->AddHate(this, 50);
|
||||
}
|
||||
|
||||
@ -379,6 +380,7 @@ void Entity::RangeAttack(Spawn* victim, float distance, Item* weapon, Item* ammo
|
||||
}
|
||||
|
||||
if(victim->IsNPC() && victim->EngagedInCombat() == false) {
|
||||
CheckEncounterState((Entity*)victim);
|
||||
((NPC*)victim)->AddHate(this, 50);
|
||||
}
|
||||
|
||||
|
@ -1757,8 +1757,12 @@ bool SpellProcess::CastProcessedSpell(LuaSpell* spell, bool passive, bool in_her
|
||||
continue;
|
||||
|
||||
// TODO: Establish actual hate per spell
|
||||
if (!spell->spell->GetSpellData()->friendly_spell && target->IsNPC())
|
||||
((NPC*)target)->AddHate((Entity*)spell->caster, 50);
|
||||
if (!spell->spell->GetSpellData()->friendly_spell && target->IsNPC()) {
|
||||
if(spell->caster) {
|
||||
spell->caster->CheckEncounterState((Entity*)target);
|
||||
((NPC*)target)->AddHate((Entity*)spell->caster, 50);
|
||||
}
|
||||
}
|
||||
|
||||
if(spell->spell->GetSpellData()->success_message.length() > 0){
|
||||
if(client){
|
||||
|
@ -941,6 +941,8 @@ bool ZoneServer::AggroVictim(NPC* npc, Spawn* victim, Client* client)
|
||||
if(isEntity && !npc->AttackAllowed((Entity*)victim))
|
||||
return false;
|
||||
|
||||
victim->CheckEncounterState((Entity*)npc, true);
|
||||
|
||||
if (npc->HasSpawnGroup()) {
|
||||
vector<Spawn*>* groupVec = npc->GetSpawnGroup();
|
||||
for (int32 i = 0; i < groupVec->size(); i++) {
|
||||
@ -965,8 +967,6 @@ bool ZoneServer::AggroVictim(NPC* npc, Spawn* victim, Client* client)
|
||||
else
|
||||
npc->InCombat(true);
|
||||
}
|
||||
|
||||
victim->CheckEncounterState((Entity*)npc, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user