mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-11 11:12:25 +00:00
[Cleanup] Utilize IsTaunting(), SetPetPower(), SetPetType(), and SetTaunting() (#3275)
* [Cleanup] Utilize SetPetPower() in zone/pets.cpp # Notes - This wasn't used before. * Utilize other methods. * Update special_attacks.cpp
This commit is contained in:
parent
7523c972fa
commit
ff40dbc710
@ -380,8 +380,8 @@ Mob::Mob(
|
|||||||
spellbonuses.AssistRange = -1;
|
spellbonuses.AssistRange = -1;
|
||||||
SetPetID(0);
|
SetPetID(0);
|
||||||
SetOwnerID(0);
|
SetOwnerID(0);
|
||||||
typeofpet = petNone; // default to not a pet
|
SetPetType(petNone); // default to not a pet
|
||||||
petpower = 0;
|
SetPetPower(0);
|
||||||
held = false;
|
held = false;
|
||||||
gheld = false;
|
gheld = false;
|
||||||
nocast = false;
|
nocast = false;
|
||||||
|
|||||||
@ -162,7 +162,7 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
|
|||||||
size = 15;
|
size = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
taunting = false;
|
SetTaunting(false);
|
||||||
proximity = nullptr;
|
proximity = nullptr;
|
||||||
copper = 0;
|
copper = 0;
|
||||||
silver = 0;
|
silver = 0;
|
||||||
|
|||||||
@ -441,22 +441,24 @@ Pet::Pet(NPCType *type_data, Mob *owner, PetType type, uint16 spell_id, int16 po
|
|||||||
: NPC(type_data, 0, owner->GetPosition() + glm::vec4(2.0f, 2.0f, 0.0f, 0.0f), GravityBehavior::Water)
|
: NPC(type_data, 0, owner->GetPosition() + glm::vec4(2.0f, 2.0f, 0.0f, 0.0f), GravityBehavior::Water)
|
||||||
{
|
{
|
||||||
GiveNPCTypeData(type_data);
|
GiveNPCTypeData(type_data);
|
||||||
typeofpet = type;
|
SetPetType(type);
|
||||||
petpower = power;
|
SetPetPower(power);
|
||||||
SetOwnerID(owner ? owner->GetID() : 0);
|
SetOwnerID(owner ? owner->GetID() : 0);
|
||||||
SetPetSpellID(spell_id);
|
SetPetSpellID(spell_id);
|
||||||
|
|
||||||
// All pets start at false on newer clients. The client
|
// All pets start at false on newer clients. The client
|
||||||
// turns it on and tracks the state.
|
// turns it on and tracks the state.
|
||||||
taunting=false;
|
SetTaunting(false);
|
||||||
|
|
||||||
// Older clients didn't track state, and default taunting is on (per @mackal)
|
// Older clients didn't track state, and default taunting is on (per @mackal)
|
||||||
// Familiar and animation pets don't get taunt until an AA.
|
// Familiar and animation pets don't get taunt until an AA.
|
||||||
if (owner && owner->IsClient()) {
|
if (owner && owner->IsClient()) {
|
||||||
if (!(owner->CastToClient()->ClientVersionBit() & EQ::versions::maskUFAndLater)) {
|
if (!(owner->CastToClient()->ClientVersionBit() & EQ::versions::maskUFAndLater)) {
|
||||||
if ((typeofpet != petFamiliar && typeofpet != petAnimation) ||
|
if (
|
||||||
aabonuses.PetCommands[PET_TAUNT]) {
|
(GetPetType() != petFamiliar && GetPetType() != petAnimation) ||
|
||||||
taunting=true;
|
aabonuses.PetCommands[PET_TAUNT]
|
||||||
|
) {
|
||||||
|
SetTaunting(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1730,7 +1730,13 @@ void NPC::DoClassAttacks(Mob *target) {
|
|||||||
|
|
||||||
//general stuff, for all classes....
|
//general stuff, for all classes....
|
||||||
//only gets used when their primary ability get used too
|
//only gets used when their primary ability get used too
|
||||||
if (taunting && HasOwner() && target->IsNPC() && target->GetBodyType() != BT_Undead && taunt_time) {
|
if (
|
||||||
|
IsTaunting() &&
|
||||||
|
HasOwner() &&
|
||||||
|
target->IsNPC() &&
|
||||||
|
target->GetBodyType() != BT_Undead &&
|
||||||
|
taunt_time
|
||||||
|
) {
|
||||||
GetOwner()->MessageString(Chat::PetResponse, PET_TAUNTING);
|
GetOwner()->MessageString(Chat::PetResponse, PET_TAUNTING);
|
||||||
Taunt(target->CastToNPC(), false);
|
Taunt(target->CastToNPC(), false);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user