Core/Pets

Fixed infinite cooldown bugging after relogging
Restored pet create health for pets without pet_levelstats data
Corrected health gain from stamina for DK Ghouls
This commit is contained in:
Shauren
2011-03-15 13:23:52 +01:00
parent 119bb6fcd5
commit 12b65aa206
4 changed files with 8 additions and 8 deletions
+4 -3
View File
@@ -280,7 +280,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
data << uint32(GetUInt32Value(UNIT_CREATED_BY_SPELL));
data << uint32(256); // CAST_FLAG_UNKNOWN3
data << uint32(0);
SendMessageToSet(&data, true);
owner->SendMessageToSet(&data, true);
}
owner->SetMinion(this, true);
@@ -893,8 +893,9 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
else // not exist in DB, use some default fake data
{
// remove elite bonuses included in DB values
//SetCreateHealth(uint32(((float(cinfo->maxhealth) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel));
//SetCreateMana(uint32(((float(cinfo->maxmana) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel));
CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(petlevel, cinfo->unit_class);
SetCreateHealth(stats->BaseHealth[cinfo->expansion]);
SetCreateMana(stats->BaseMana);
SetCreateStat(STAT_STRENGTH, 22);
SetCreateStat(STAT_AGILITY, 22);
+2 -2
View File
@@ -20603,10 +20603,10 @@ void Player::AddSpellCooldown(uint32 spellid, uint32 itemid, time_t end_time)
void Player::SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId, Spell* spell)
{
// start cooldowns at server side, if any
AddSpellAndCategoryCooldowns(spellInfo,itemId,spell);
AddSpellAndCategoryCooldowns(spellInfo, itemId, spell);
// Send activate cooldown timer (possible 0) at client side
WorldPacket data(SMSG_COOLDOWN_EVENT, (4+8));
WorldPacket data(SMSG_COOLDOWN_EVENT, 4 + 8);
data << uint32(spellInfo->Id);
data << uint64(GetGUID());
SendDirectMessage(&data);
+1 -2
View File
@@ -1091,11 +1091,10 @@ void Guardian::UpdateMaxHealth()
case ENTRY_SUCCUBUS: multiplicator = 9.1f; break;
case ENTRY_FELHUNTER: multiplicator = 9.5f; break;
case ENTRY_FELGUARD: multiplicator = 11.0f; break;
case ENTRY_GHOUL: multiplicator = 5.4f; break;
default: multiplicator = 10.0f; break;
}
float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
value *= GetModifierValue(unitMod, BASE_PCT);
value += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * multiplicator;
value *= GetModifierValue(unitMod, TOTAL_PCT);
+1 -1
View File
@@ -9622,7 +9622,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
// Send infinity cooldown - client does that automatically but after relog cooldown needs to be set again
SpellEntry const *spellInfo = sSpellStore.LookupEntry(minion->GetUInt32Value(UNIT_CREATED_BY_SPELL));
if (spellInfo && (spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE))
this->ToPlayer()->AddSpellAndCategoryCooldowns(spellInfo, 0, NULL ,true);
this->ToPlayer()->AddSpellAndCategoryCooldowns(spellInfo, 0, NULL, true);
}
}
else