[7137] Implement SPELL_EFFECT_ALLOW_RENAME_PET, and then item 43850 work.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
evilstar 2009-01-21 23:58:17 +03:00 committed by VladimirMangos
parent 6bc449d053
commit c54383360a
3 changed files with 17 additions and 7 deletions

View file

@ -290,6 +290,7 @@ class Spell
void EffectCharge(uint32 i); void EffectCharge(uint32 i);
void EffectProspecting(uint32 i); void EffectProspecting(uint32 i);
void EffectMilling(uint32 i); void EffectMilling(uint32 i);
void EffectRenamePet(uint32 i);
void EffectSendTaxi(uint32 i); void EffectSendTaxi(uint32 i);
void EffectSummonCritter(uint32 i); void EffectSummonCritter(uint32 i);
void EffectKnockBack(uint32 i); void EffectKnockBack(uint32 i);

View file

@ -215,9 +215,9 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectNULL, //154 unused &Spell::EffectNULL, //154 unused
&Spell::EffectTitanGrip, //155 SPELL_EFFECT_TITAN_GRIP Allows you to equip two-handed axes, maces and swords in one hand, but you attack $49152s1% slower than normal. &Spell::EffectTitanGrip, //155 SPELL_EFFECT_TITAN_GRIP Allows you to equip two-handed axes, maces and swords in one hand, but you attack $49152s1% slower than normal.
&Spell::EffectNULL, //156 Add Socket &Spell::EffectNULL, //156 Add Socket
&Spell::EffectCreateItem, //157 SPELL_EFFECT_CREATE_ITEM_2 create/learn item/spell for profession &Spell::EffectCreateItem, //157 SPELL_EFFECT_CREATE_ITEM_2 create/learn item/spell for profession
&Spell::EffectMilling, //158 milling &Spell::EffectMilling, //158 SPELL_EFFECT_MILLING milling
&Spell::EffectNULL //159 allow rename pet once again &Spell::EffectRenamePet //159 SPELL_EFFECT_ALLOW_RENAME_PET allow rename pet once again
}; };
void Spell::EffectNULL(uint32 /*i*/) void Spell::EffectNULL(uint32 /*i*/)
@ -6426,7 +6426,7 @@ void Spell::EffectQuestFail(uint32 i)
((Player*)unitTarget)->FailQuest(m_spellInfo->EffectMiscValue[i]); ((Player*)unitTarget)->FailQuest(m_spellInfo->EffectMiscValue[i]);
} }
void Spell::EffectActivateRune(uint32 i) void Spell::EffectActivateRune(uint32 eff_idx)
{ {
if(m_caster->GetTypeId() != TYPEID_PLAYER) if(m_caster->GetTypeId() != TYPEID_PLAYER)
return; return;
@ -6438,15 +6438,24 @@ void Spell::EffectActivateRune(uint32 i)
for(uint32 j = 0; j < MAX_RUNES; ++j) for(uint32 j = 0; j < MAX_RUNES; ++j)
{ {
if(plr->GetRuneCooldown(j) && plr->GetCurrentRune(j) == m_spellInfo->EffectMiscValue[i]) if(plr->GetRuneCooldown(j) && plr->GetCurrentRune(j) == m_spellInfo->EffectMiscValue[eff_idx])
{ {
plr->SetRuneCooldown(j, 0); plr->SetRuneCooldown(j, 0);
} }
} }
} }
void Spell::EffectTitanGrip(uint32 i) void Spell::EffectTitanGrip(uint32 /*eff_idx*/)
{ {
if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER) if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER)
((Player*)unitTarget)->SetCanTitanGrip(true); ((Player*)unitTarget)->SetCanTitanGrip(true);
} }
void Spell::EffectRenamePet(uint32 /*eff_idx*/)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT ||
!((Creature*)unitTarget)->isPet() || ((Pet*)unitTarget)->getPetType() != HUNTER_PET)
return;
unitTarget->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_ALLOWED);
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7136" #define REVISION_NR "7137"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__