mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-13 10:52:28 +00:00
Implemented new pet type (5) which summons a regular pet that locks onto
the casters target exclusively until the target dies, when target dies the pet is killed. (Pets don't respond to commands except get lost). This does not stack with regular pets. Note: On live these pets cast an actual spell (Unsummon) that kills them for 20k damage, due to how limiting that is to be hard coded, the pets will simply just kill themselves instead. Pending, will needd to add an optional SQL to update pet tables to convert known live spells that use this.
This commit is contained in:
parent
aed3d9ef85
commit
379219aff1
@ -1508,6 +1508,9 @@ 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);
|
entity_list.RemoveFromTargets(this);
|
||||||
@ -2378,6 +2381,9 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (killerMob && killerMob->IsPet() && killerMob->GetPetType() == petTargetLock && killerMob->GetID() != GetID())
|
||||||
|
killerMob->Kill();
|
||||||
|
|
||||||
WipeHateList();
|
WipeHateList();
|
||||||
p_depop = true;
|
p_depop = true;
|
||||||
if(killerMob && killerMob->GetTarget() == this) //we can kill things without having them targeted
|
if(killerMob && killerMob->GetTarget() == this) //we can kill things without having them targeted
|
||||||
|
|||||||
@ -9863,6 +9863,9 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mypet->GetPetType() == petTargetLock && (pet->command != PET_HEALTHREPORT && pet->command != PET_GETLOST))
|
||||||
|
return;
|
||||||
|
|
||||||
if (mypet->GetPetType() == petAnimation && (pet->command != PET_HEALTHREPORT && pet->command != PET_GETLOST) && !GetAA(aaAnimationEmpathy))
|
if (mypet->GetPetType() == petAnimation && (pet->command != PET_HEALTHREPORT && pet->command != PET_GETLOST) && !GetAA(aaAnimationEmpathy))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@ -505,7 +505,7 @@ typedef enum {
|
|||||||
petOther,
|
petOther,
|
||||||
petCharmed,
|
petCharmed,
|
||||||
petNPCFollow,
|
petNPCFollow,
|
||||||
petHatelist //remain active as long something is on the hatelist. Don't listen to any commands
|
petTargetLock //remain active as long something is on the hatelist. Don't listen to any commands
|
||||||
} PetType;
|
} PetType;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
@ -675,6 +675,7 @@ public:
|
|||||||
bool IsFamiliar() const { return(typeofpet == petFamiliar); }
|
bool IsFamiliar() const { return(typeofpet == petFamiliar); }
|
||||||
bool IsAnimation() const { return(typeofpet == petAnimation); }
|
bool IsAnimation() const { return(typeofpet == petAnimation); }
|
||||||
bool IsCharmed() const { return(typeofpet == petCharmed); }
|
bool IsCharmed() const { return(typeofpet == petCharmed); }
|
||||||
|
bool IsTargetLockPet() const { return(typeofpet == petTargetLock); }
|
||||||
void SetOwnerID(uint16 NewOwnerID);
|
void SetOwnerID(uint16 NewOwnerID);
|
||||||
inline uint16 GetOwnerID() const { return ownerid; }
|
inline uint16 GetOwnerID() const { return ownerid; }
|
||||||
inline virtual bool HasOwner() { if(GetOwnerID()==0){return false;} return( entity_list.GetMob(GetOwnerID()) != 0); }
|
inline virtual bool HasOwner() { if(GetOwnerID()==0){return false;} return( entity_list.GetMob(GetOwnerID()) != 0); }
|
||||||
|
|||||||
@ -426,6 +426,19 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
|
|||||||
entity_list.AddNPC(npc, true, true);
|
entity_list.AddNPC(npc, true, true);
|
||||||
SetPetID(npc->GetID());
|
SetPetID(npc->GetID());
|
||||||
// We need to handle PetType 5 (petHatelist), add the current target to the hatelist of the pet
|
// We need to handle PetType 5 (petHatelist), add the current target to the hatelist of the pet
|
||||||
|
|
||||||
|
|
||||||
|
if (record.petcontrol == petTargetLock)
|
||||||
|
{
|
||||||
|
Mob* target = GetTarget();
|
||||||
|
|
||||||
|
if (target){
|
||||||
|
npc->AddToHateList(target, 1);
|
||||||
|
npc->SetSpecialAbility(IMMUNE_AGGRO, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
npc->Kill(); //On live casts spell 892 Unsummon (Kayen - Too limiting to use that for emu since pet can have more than 20k HP)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* This is why the pets ghost - pets were being spawned too far away from its npc owner and some
|
/* This is why the pets ghost - pets were being spawned too far away from its npc owner and some
|
||||||
into walls or objects (+10), this sometimes creates the "ghost" effect. I changed to +2 (as close as I
|
into walls or objects (+10), this sometimes creates the "ghost" effect. I changed to +2 (as close as I
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user