mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-19 20:41:33 +00:00
Add PetType petNone so IsCharmed stops lying
This commit is contained in:
parent
8646791d1d
commit
a41fd122bc
@ -521,7 +521,8 @@ typedef enum {
|
|||||||
petOther,
|
petOther,
|
||||||
petCharmed,
|
petCharmed,
|
||||||
petNPCFollow,
|
petNPCFollow,
|
||||||
petTargetLock //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
|
||||||
|
petNone = 0xFF // not a pet
|
||||||
} PetType;
|
} PetType;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
@ -338,7 +338,7 @@ Mob::Mob(const char* in_name,
|
|||||||
pLastChange = 0;
|
pLastChange = 0;
|
||||||
SetPetID(0);
|
SetPetID(0);
|
||||||
SetOwnerID(0);
|
SetOwnerID(0);
|
||||||
typeofpet = petCharmed; //default to charmed...
|
typeofpet = petNone; // default to not a pet
|
||||||
petpower = 0;
|
petpower = 0;
|
||||||
held = false;
|
held = false;
|
||||||
nocast = false;
|
nocast = false;
|
||||||
@ -2296,8 +2296,10 @@ void Mob::SetOwnerID(uint16 NewOwnerID) {
|
|||||||
if (NewOwnerID == GetID() && NewOwnerID != 0) // ok, no charming yourself now =p
|
if (NewOwnerID == GetID() && NewOwnerID != 0) // ok, no charming yourself now =p
|
||||||
return;
|
return;
|
||||||
ownerid = NewOwnerID;
|
ownerid = NewOwnerID;
|
||||||
if (ownerid == 0 && this->IsNPC() && this->GetPetType() != petCharmed)
|
// if we're setting the owner ID to 0 and they're not either charmed or not-a-pet then
|
||||||
this->Depop();
|
// they're a normal pet and should be despawned
|
||||||
|
if (ownerid == 0 && IsNPC() && GetPetType() != petCharmed && GetPetType() != petNone)
|
||||||
|
Depop();
|
||||||
}
|
}
|
||||||
|
|
||||||
// used in checking for behind (backstab) and checking in front (melee LoS)
|
// used in checking for behind (backstab) and checking in front (melee LoS)
|
||||||
|
|||||||
@ -773,6 +773,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
|||||||
caster->SetPet(this);
|
caster->SetPet(this);
|
||||||
SetOwnerID(caster->GetID());
|
SetOwnerID(caster->GetID());
|
||||||
SetPetOrder(SPO_Follow);
|
SetPetOrder(SPO_Follow);
|
||||||
|
SetPetType(petCharmed);
|
||||||
|
|
||||||
if(caster->IsClient()){
|
if(caster->IsClient()){
|
||||||
EQApplicationPacket *app = new EQApplicationPacket(OP_Charm, sizeof(Charm_Struct));
|
EQApplicationPacket *app = new EQApplicationPacket(OP_Charm, sizeof(Charm_Struct));
|
||||||
@ -3915,6 +3916,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
|
|||||||
SendAppearancePacket(AT_Pet, 0, true, true);
|
SendAppearancePacket(AT_Pet, 0, true, true);
|
||||||
Mob* tempmob = GetOwner();
|
Mob* tempmob = GetOwner();
|
||||||
SetOwnerID(0);
|
SetOwnerID(0);
|
||||||
|
SetPetType(petNone);
|
||||||
if(tempmob)
|
if(tempmob)
|
||||||
{
|
{
|
||||||
tempmob->SetPet(0);
|
tempmob->SetPet(0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user