*Fix frenzy and Ferocious Inspiration proc.

*Add command .reset all pet_spells - use it if you still have problems with pet talents after recent revs changes (like pets with all talents for example)

--HG--
branch : trunk
This commit is contained in:
QAston
2009-04-23 20:57:17 +02:00
parent cedc328d1f
commit 066af701d3
9 changed files with 68 additions and 1 deletions
@@ -0,0 +1,9 @@
DELETE FROM `spell_proc_event` WHERE `entry` IN (34457);
INSERT INTO `spell_proc_event` VALUES
(34457, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000002, 0.000000, 0.000000, 0);
DELETE FROM `spell_proc_event` WHERE `entry` IN (34456);
INSERT INTO `spell_proc_event` VALUES
(19615, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000002, 0.000000, 0.000000, 0);
INSERT INTO trinity_string (entry, content_default)VALUES (6616 , "Pet spells will reset for all players at login. Strongly recommend re-login!");
+1
View File
@@ -853,6 +853,7 @@ enum TrinityStrings
LANG_GM_BROADCAST = 6613,
LANG_GM_NOTIFY = 6614,
LANG_GM_ANNOUNCE_COLOR = 6615,
LANG_RESETALL_PET_SPELLS = 6616,
LANG_WORLD_CLOSED = 7523,
LANG_WORLD_OPENED = 7524,
+5
View File
@@ -5390,6 +5390,11 @@ bool ChatHandler::HandleResetAllCommand(const char * args)
atLogin = AT_LOGIN_RESET_TALENTS;
sWorld.SendWorldText(LANG_RESETALL_TALENTS);
}
else if(casename=="pet_spells")
{
atLogin = AT_LOGIN_RESET_PET_SPELLS;
sWorld.SendWorldText(LANG_RESETALL_PET_SPELLS);
}
else
{
PSendSysMessage(LANG_RESETALL_UNKNOWN_CASE,args);
+1
View File
@@ -195,6 +195,7 @@ class Pet : public Guardian
bool unlearnSpell(uint32 spell_id);
bool removeSpell(uint32 spell_id);
bool _removeSpell(uint32 spell_id);
void _resetSpells();
PetSpellMap m_spells;
TeachSpellMap m_teachspells;
+44
View File
@@ -14521,6 +14521,12 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
InitTalentForLevel();
learnDefaultSpells();
// must be done after aura loading for correct pet talent amount calculation
if(HasAtLoginFlag(AT_LOGIN_RESET_PET_SPELLS))
{
_resetAllPetSpells();
}
_LoadTutorials(holder->GetResult(PLAYER_LOGIN_QUERY_LOADTUTORIALS));
// must be before inventory (some items required reputation check)
@@ -18585,6 +18591,44 @@ void Player::resetSpells()
learnQuestRewardedSpells();
}
void Player::_resetAllPetSpells()
{
if(HasAtLoginFlag(AT_LOGIN_RESET_PET_SPELLS))
{
m_atLoginFlags = m_atLoginFlags & ~AT_LOGIN_RESET_PET_SPELLS;
CharacterDatabase.PExecute("UPDATE characters set at_login = at_login & ~ %u WHERE guid ='%u'", uint32(AT_LOGIN_RESET_PET_SPELLS), GetGUIDLow());
}
if (QueryResult * result = CharacterDatabase.PQuery("SELECT id, level, entry FROM character_pet WHERE owner = '%u'", GetGUIDLow()))
{
// Mod points from owner SPELL_AURA_MOD_PET_TALENT_POINTS
uint32 pointMod = GetTotalAuraModifier(SPELL_AURA_MOD_PET_TALENT_POINTS);
do
{
Field *fields = result->Fetch();
uint32 petId = fields[0].GetUInt32();
uint32 level = fields[1].GetUInt32();
uint32 entry = fields[2].GetUInt32();
CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
if (!ci)
sLog.outError("Unknown pet (id %d) type saved in character_pet!", petId);
CreatureFamilyEntry const *pet_family = sCreatureFamilyStore.LookupEntry(ci->family);
if (!pet_family)
sLog.outError("Unknown pet (id %d) type saved in character_pet!", petId);
if(pet_family && pet_family->petTalentType <= 0)
{
uint32 points = (level >= 20) ? ((level - 16) / 4) : 0;
CharacterDatabase.PExecute("DELETE FROM pet_spell WHERE guid = '%u'", petId);
std::ostringstream ss;
ss << "UPDATE character_pet SET talentpoints = '"<<points + pointMod<<"' WHERE id = '"<<petId<<"'";
sLog.outDebug(ss.str().c_str());
CharacterDatabase.Execute(ss.str().c_str());
}
}
while( result->NextRow() );
}
}
void Player::learnDefaultSpells()
{
// learn default race/class spells
+3 -1
View File
@@ -497,7 +497,8 @@ enum AtLoginFlags
AT_LOGIN_RENAME = 1,
AT_LOGIN_RESET_SPELLS = 2,
AT_LOGIN_RESET_TALENTS = 4,
AT_LOGIN_CUSTOMIZE = 8
AT_LOGIN_CUSTOMIZE = 8,
AT_LOGIN_RESET_PET_SPELLS = 16
};
typedef std::map<uint32, QuestStatusData> QuestStatusMap;
@@ -1342,6 +1343,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void learnSpell(uint32 spell_id, bool dependent);
void removeSpell(uint32 spell_id, bool disabled = false, bool update_action_bar_for_low_rank = false);
void resetSpells();
void _resetAllPetSpells();
void learnDefaultSpells();
void learnQuestRewardedSpells();
void learnQuestRewardedSpells(Quest const* quest);
+1
View File
@@ -2636,6 +2636,7 @@ void Spell::update(uint32 difftime)
// check if there are alive targets left
if (!UpdateChanneledTargetList())
{
sLog.outDebug("Channeled spell %d is removed due to lack of targets", m_spellInfo->Id);
SendChannelUpdate(0);
finish();
}
+1
View File
@@ -582,6 +582,7 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep)
}
case SPELL_AURA_ADD_TARGET_TRIGGER:
return true;
case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE:
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
if(!deep)
{
+3
View File
@@ -5524,6 +5524,9 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
// Glyph of Dispel Magic
case 55677:
{
// Dispel Magic shares spellfamilyflag with abolish disease
if (procSpell->SpellIconID!=74)
return false;
if(!target->IsFriendlyTo(this))
return false;