mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-04 22:56:37 +00:00
[Spells] Updated pet suspend code to use spell effect data and bonuses (#1501)
This commit is contained in:
@@ -1658,6 +1658,10 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
||||
newbon->ItemEnduranceRegenCap += base1;
|
||||
break;
|
||||
|
||||
case SE_ZoneSuspendMinion:
|
||||
newbon->ZoneSuspendMinion = base1;
|
||||
break;
|
||||
|
||||
// to do
|
||||
case SE_PetDiscipline:
|
||||
break;
|
||||
@@ -3648,6 +3652,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
||||
break;
|
||||
}
|
||||
|
||||
case SE_ZoneSuspendMinion:
|
||||
new_bonus->ZoneSuspendMinion = effect_value;
|
||||
break;
|
||||
|
||||
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
|
||||
if (IsAISpellEffect) {
|
||||
|
||||
|
||||
+13
-11
@@ -5596,18 +5596,20 @@ void Client::AddLDoNWin(uint32 theme_id)
|
||||
}
|
||||
|
||||
|
||||
void Client::SuspendMinion()
|
||||
void Client::SuspendMinion(int value)
|
||||
{
|
||||
/*
|
||||
SPA 151 Allows an extra pet to be saved and resummoned later.
|
||||
Casting with a pet but without a suspended pet will suspend the pet
|
||||
Casting without a pet and with a suspended pet will unsuspend the pet
|
||||
effect value 0 = save pet with no buffs or equipment
|
||||
effect value 1 = save pet with buffs and equipment
|
||||
effect value 2 = unknown
|
||||
Note: SPA 308 allows for suspended pets to be resummoned after zoning.
|
||||
*/
|
||||
|
||||
NPC *CurrentPet = GetPet()->CastToNPC();
|
||||
|
||||
int AALevel = GetAA(aaSuspendedMinion);
|
||||
|
||||
if(AALevel == 0)
|
||||
return;
|
||||
|
||||
if(GetLevel() < 62)
|
||||
return;
|
||||
|
||||
if(!CurrentPet)
|
||||
{
|
||||
if(m_suspendedminion.SpellID > 0)
|
||||
@@ -5629,7 +5631,7 @@ void Client::SuspendMinion()
|
||||
return;
|
||||
}
|
||||
|
||||
if(AALevel >= 2)
|
||||
if(value >= 1)
|
||||
{
|
||||
CurrentPet->SetPetState(m_suspendedminion.Buffs, m_suspendedminion.Items);
|
||||
|
||||
@@ -5698,7 +5700,7 @@ void Client::SuspendMinion()
|
||||
m_suspendedminion.petpower = CurrentPet->GetPetPower();
|
||||
m_suspendedminion.size = CurrentPet->GetSize();
|
||||
|
||||
if(AALevel >= 2)
|
||||
if(value >= 1)
|
||||
CurrentPet->GetPetState(m_suspendedminion.Buffs, m_suspendedminion.Items, m_suspendedminion.Name);
|
||||
else
|
||||
strn0cpy(m_suspendedminion.Name, CurrentPet->GetName(), 64); // Name stays even at rank 1
|
||||
|
||||
+1
-1
@@ -1383,7 +1383,7 @@ public:
|
||||
uint32 GetCorpseCount() { return database.GetCharacterCorpseCount(CharacterID()); }
|
||||
uint32 GetCorpseID(int corpse) { return database.GetCharacterCorpseID(CharacterID(), corpse); }
|
||||
uint32 GetCorpseItemAt(int corpse_id, int slot_id) { return database.GetCharacterCorpseItemAt(corpse_id, slot_id); }
|
||||
void SuspendMinion();
|
||||
void SuspendMinion(int value);
|
||||
void Doppelganger(uint16 spell_id, Mob *target, const char *name_override, int pet_count, int pet_duration);
|
||||
void NotifyNewTitlesAvailable();
|
||||
void Signal(uint32 data);
|
||||
|
||||
@@ -1659,8 +1659,9 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
m_petinfo.SpellID = 0;
|
||||
}
|
||||
/* Moved here so it's after where we load the pet data. */
|
||||
if (!GetAA(aaPersistentMinion))
|
||||
if (!aabonuses.ZoneSuspendMinion && !spellbonuses.ZoneSuspendMinion && !itembonuses.ZoneSuspendMinion) {
|
||||
memset(&m_suspendedminion, 0, sizeof(PetInfo));
|
||||
}
|
||||
|
||||
/* Server Zone Entry Packet */
|
||||
outapp = new EQApplicationPacket(OP_ZoneEntry, sizeof(ServerZoneEntry_Struct));
|
||||
|
||||
+1
-1
@@ -553,7 +553,7 @@ struct StatBonuses {
|
||||
int32 Pet_Add_Atk; // base = Pet ATK bonus from owner
|
||||
int32 ItemEnduranceRegenCap; // modify endurance regen cap
|
||||
int32 WeaponStance[WEAPON_STANCE_TYPE_MAX +1];// base = trigger spell id, base2 = 0 is 2h, 1 is shield, 2 is dual wield, [0]spid 2h, [1]spid shield, [2]spid DW
|
||||
|
||||
bool ZoneSuspendMinion; // base 1 allows suspended minions to zone
|
||||
|
||||
// AAs
|
||||
int32 ShieldDuration; // extends duration of /shield ability
|
||||
|
||||
@@ -2534,11 +2534,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
break;
|
||||
}
|
||||
|
||||
case SE_SuspendMinion:
|
||||
case SE_SuspendPet:
|
||||
{
|
||||
if(IsClient())
|
||||
CastToClient()->SuspendMinion();
|
||||
CastToClient()->SuspendMinion(spell.base[i]);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user