updates
- runback now primarily uses nav even with line of sight with destination due to falling off bridges - NPC stop attacking each other - Can't add to encounter when part of spawn group, can't add hate. - WS_EnterCombat omitted for KoS and earlier clients not a packet
This commit is contained in:
parent
8ac01db525
commit
dc1430d52e
@ -1297,6 +1297,9 @@ void Entity::AddHate(Entity* attacker, sint32 hate) {
|
||||
if(!attacker || GetHP() <= 0 || attacker->GetHP() <= 0)
|
||||
return;
|
||||
|
||||
if(IsInSpawnGroup(attacker))
|
||||
return; // can't aggro your own members
|
||||
|
||||
// If a players pet and protect self is off
|
||||
if (IsPet() && ((NPC*)this)->GetOwner() && ((NPC*)this)->GetOwner()->IsPlayer() && ((((Player*)((NPC*)this)->GetOwner())->GetInfoStruct()->get_pet_behavior() & 2) == 0))
|
||||
return;
|
||||
@ -1414,7 +1417,7 @@ void Entity::KillSpawn(Spawn* dead, int8 type, int8 damage_type, int16 kill_blow
|
||||
if(!dead)
|
||||
return;
|
||||
|
||||
if (IsPlayer()) {
|
||||
if (IsPlayer() && GetVersion() > 561) { // old clients do not support WS_EnterCombat, uses activity_status in spawn info
|
||||
Client* client = ((Player*)this)->GetClient();
|
||||
if(client) {
|
||||
PacketStruct* packet = configReader.getStruct("WS_EnterCombat", client->GetVersion());
|
||||
|
@ -263,7 +263,7 @@ void NPC::Runback(float distance, bool stopFollowing){
|
||||
m_runningBack = true;
|
||||
SetSpeed(GetMaxSpeed()*2);
|
||||
|
||||
if (CheckLoS(glm::vec3(runback->x, runback->z, runback->y + 1.0f), glm::vec3(GetX(), GetZ(), GetY() + 1.0f)))
|
||||
if (distance <= 5.0f && CheckLoS(glm::vec3(runback->x, runback->z, runback->y + 1.0f), glm::vec3(GetX(), GetZ(), GetY() + 1.0f)))
|
||||
{
|
||||
FaceTarget(runback->x, runback->z);
|
||||
ClearRunningLocations();
|
||||
|
@ -3889,6 +3889,8 @@ void Spawn::CheckEncounterState(Entity* victim, bool test_auto_lock) {
|
||||
|
||||
Entity* ent = ((Entity*)this);
|
||||
if (victim->GetLockedNoLoot() == ENCOUNTER_STATE_AVAILABLE) {
|
||||
if(IsInSpawnGroup(victim))
|
||||
return; // can't aggro your own members
|
||||
|
||||
Entity* attacker = nullptr;
|
||||
if (ent->GetOwner())
|
||||
|
Loading…
x
Reference in New Issue
Block a user