Merge pull request #362 from KayenEQ/Development

Improvements to the pet type (5) code.
This commit is contained in:
KayenEQ 2015-02-03 08:01:15 -05:00
commit bfa6bd3458
5 changed files with 15 additions and 6 deletions

View File

@ -1508,9 +1508,6 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
}
}
}
if (killerMob && killerMob->IsPet() && killerMob->GetPetType() == petTargetLock && killerMob->GetID() != GetID())
killerMob->Kill();
}
entity_list.RemoveFromTargets(this);
@ -2383,9 +2380,6 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack
}
}
if (killerMob && killerMob->IsPet() && killerMob->GetPetType() == petTargetLock && killerMob->GetID() != GetID())
killerMob->Kill();
WipeHateList();
p_depop = true;
if(killerMob && killerMob->GetTarget() == this) //we can kill things without having them targeted

View File

@ -300,6 +300,7 @@ Mob::Mob(const char* in_name,
focused = false;
_IsTempPet = false;
pet_owner_client = false;
pet_targetlock_id = 0;
attacked_count = 0;
mezzed = false;

View File

@ -676,6 +676,8 @@ public:
bool IsAnimation() const { return(typeofpet == petAnimation); }
bool IsCharmed() const { return(typeofpet == petCharmed); }
bool IsTargetLockPet() const { return(typeofpet == petTargetLock); }
inline uint32 GetPetTargetLockID() { return pet_targetlock_id; };
inline void SetPetTargetLockID(uint32 value) { pet_targetlock_id = value; };
void SetOwnerID(uint16 NewOwnerID);
inline uint16 GetOwnerID() const { return ownerid; }
inline virtual bool HasOwner() { if(GetOwnerID()==0){return false;} return( entity_list.GetMob(GetOwnerID()) != 0); }
@ -1245,6 +1247,7 @@ protected:
bool _IsTempPet;
int16 count_TempPet;
bool pet_owner_client; //Flags regular and pets as belonging to a client
uint32 pet_targetlock_id;
EGNode *_egnode; //the EG node we are in
glm::vec3 m_TargetLocation;

View File

@ -2419,4 +2419,14 @@ void NPC::DepopSwarmPets()
}
}
}
if (IsPet() && GetPetType() == petTargetLock && GetPetTargetLockID()){
Mob *targMob = entity_list.GetMob(GetPetTargetLockID());
if(!targMob || (targMob && targMob->IsCorpse())){
Kill();
return;
}
}
}

View File

@ -434,6 +434,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
if (target){
npc->AddToHateList(target, 1);
npc->SetPetTargetLockID(target->GetID());
npc->SetSpecialAbility(IMMUNE_AGGRO, 1);
}
else