Index: game/Player.cpp =================================================================== --- game/Player.cpp (revision 5524) +++ game/Player.cpp (working copy) @@ -14681,6 +14681,131 @@ data << uint32(0x8e8b) << uint64(0); // if count = 3 GetSession()->SendPacket(&data); + + + // Check for Master's dummy spells + if(pet->isControlled() && (pet->getPetType() == HUNTER_PET || cinfo && cinfo->type == CREATURE_TYPE_DEMON && getClass() == CLASS_WARLOCK)) + { + for(PetSpellMap::iterator itr = pet->m_spells.begin();itr != pet->m_spells.end();itr++) + { + if(itr->second->state == PETSPELL_REMOVED) + continue; + ++addlist; + } + + + Unit::AuraList const& dummyList = GetAurasByType(SPELL_AURA_DUMMY); + for(Unit::AuraList::const_iterator itr = dummyList.begin();itr!=dummyList.end();++itr) + { + uint32 MD = 0; + + switch((*itr)->GetSpellProto()->Id) + { + // Spirit Bond + case 19578: + pet->CastSpell(pet, 19579, true); + break; + case 20895: + pet->CastSpell(pet, 24529, true); + break; + // Stalker's Ally + case 28757: + pet->CastSpell(pet, 28758, true); + break; + // Master Demonologist + case 23785: + { + switch(pet->GetEntry()) + { + case 416: MD = 23759; break; // imp + case 1860: MD = 23760; break; // voidwalker + case 1863: MD = 23761; break; // succubus + case 417: MD = 23762; break; // felhunter + case 17252: MD = 35702; break; // felguard + default: break; + } + if(MD) pet->CastSpell(pet, MD, true); + break; + } + case 23822: + { + switch(pet->GetEntry()) + { + case 416: MD = 23826; break; // imp + case 1860: MD = 23841; break; // voidwalker + case 1863: MD = 23833; break; // succubus + case 417: MD = 23837; break; // felhunter + case 17252: MD = 35703; break; // felguard + default: break; + } + if(MD) pet->CastSpell(pet, MD, true); + break; + } + case 23823: + { + switch(pet->GetEntry()) + { + case 416: MD = 23827; break; // imp + case 1860: MD = 23842; break; // voidwalker + case 1863: MD = 23834; break; // succubus + case 417: MD = 23838; break; // felhunter + case 17252: MD = 35704; break; // felguard + default: break; + } + if(MD) pet->CastSpell(pet, MD, true); + break; + } + case 23824: + { + switch(pet->GetEntry()) + { + case 416: MD = 23828; break; // imp + case 1860: MD = 23842; break; // voidwalker + case 1863: MD = 23835; break; // succubus + case 417: MD = 23839; break; // felhunter + case 17252: MD = 35705; break; // felguard + default: break; + } + if(MD) pet->CastSpell(pet, MD, true); + break; + } + case 23825: + { + switch(pet->GetEntry()) + { + case 416: MD = 23829; break; // imp + case 1860: MD = 23844; break; // voidwalker + case 1863: MD = 23836; break; // succubus + case 417: MD = 23840; break; // felhunter + case 17252: MD = 35706; break; // felguard + default: break; + } + if(MD) pet->CastSpell(pet, MD, true); + break; + } + // Focused Fire + case 35029: + pet->CastSpell(pet, 35060, true); + break; + case 35030: + pet->CastSpell(pet, 35061, true); + break; + // Demonic Knowledge + case 35691: + case 35692: + case 35693: + { + int32 DemonKnowledgeBasePoints0 = (*itr)->GetModifier()->m_amount; + pet->CastCustomSpell(pet,35696,&DemonKnowledgeBasePoints0, NULL, NULL, true ); + break; + } + default: break; + } + } + // done + + + } } } Index: game/Player.h =================================================================== --- game/Player.h (revision 5524) +++ game/Player.h (working copy) @@ -83,6 +83,13 @@ Spell const* lastAffected; }; +enum PetLink +{ + PETLINK_NONE = 0, + PETLINK_BOTH = 1, + PETLINK_MASTER = 2, +}; + typedef HM_NAMESPACE::hash_map PlayerSpellMap; typedef std::list SpellModList; Index: game/SpellAuras.cpp =================================================================== --- game/SpellAuras.cpp (revision 5524) +++ game/SpellAuras.cpp (working copy) @@ -305,7 +305,8 @@ m_procCharges(0), m_spellmod(NULL), m_spellId(spellproto->Id), m_effIndex(eff), m_caster_guid(0), m_target(target), m_timeCla(1000), m_castItemGuid(castItem?castItem->GetGUID():0), m_auraSlot(MAX_AURAS), m_positive(false), m_permanent(false), m_isPeriodic(false), m_isTrigger(false), m_isAreaAura(false), m_isPersistent(false), -m_periodicTimer(0), m_PeriodicEventId(0), m_updated(false), m_removeOnDeath(false),m_fearMoveAngle(0), m_isRemovedOnShapeLost(true) +m_periodicTimer(0), m_PeriodicEventId(0), m_updated(false), m_removeOnDeath(false),m_fearMoveAngle(0), m_isRemovedOnShapeLost(true), +m_PetLink(PETLINK_NONE) { assert(target); @@ -413,6 +414,11 @@ m_radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(GetSpellProto()->EffectRadiusIndex[m_effIndex])); if(Player* modOwner = caster_ptr->GetSpellModOwner()) modOwner->ApplySpellMod(GetSpellProto()->Id, SPELLMOD_RADIUS, m_radius); + + if (spellproto->Effect[eff] == 119) + m_PetLink = PETLINK_BOTH; + else if (spellproto->Effect[eff] == 143) + m_PetLink = PETLINK_MASTER; } AreaAura::~AreaAura() @@ -603,7 +609,7 @@ pGroup = ((Player*)owner)->GetGroup(); } - if(pGroup) + if(pGroup && m_PetLink == PETLINK_NONE) { for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { @@ -731,6 +737,10 @@ { AuraType aura = m_modifier.m_auraname; + // Master Type of Auras will add effects only on Master + if (m_target && m_PetLink == PETLINK_MASTER && m_target->GetTypeId() != TYPEID_PLAYER) + return; + if(auraGetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem())) + if((m_PetLink != PETLINK_MASTER || m_target->GetTypeId() == TYPEID_UNIT) && (!m_isPassive || (caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem()))) { if(!samespell) { Index: game/SpellAuras.h =================================================================== --- game/SpellAuras.h (revision 5524) +++ game/SpellAuras.h (working copy) @@ -252,6 +252,7 @@ bool IsPersistent() const { return m_isPersistent; } bool IsDeathPersistent() const { return m_isDeathPersist; } bool IsRemovedOnShapeLost() const { return m_isRemovedOnShapeLost; } + PetLink GetPetLink() const { return m_PetLink; } virtual void Update(uint32 diff); void ApplyModifier(bool apply, bool Real = false); @@ -305,6 +306,7 @@ uint32 m_PeriodicEventId; bool m_updated; bool m_removeOnDeath; + PetLink m_PetLink; private: void UpdateSlotCounterAndDuration(bool add); void CleanupTriggeredSpells(); Index: game/SpellEffects.cpp =================================================================== --- game/SpellEffects.cpp (revision 5524) +++ game/SpellEffects.cpp (working copy) @@ -201,7 +201,7 @@ &Spell::EffectNULL, //140 SPELL_EFFECT_140 &Spell::EffectNULL, //141 SPELL_EFFECT_141 &Spell::EffectTriggerSpellWithValue, //142 SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE - &Spell::EffectNULL, //143 SPELL_EFFECT_143 probably apply aura again :) + &Spell::EffectApplyPetAura, //143 SPELL_EFFECT_143 probably apply aura again :) &Spell::EffectNULL, //144 SPELL_EFFECT_144 &Spell::EffectNULL, //145 SPELL_EFFECT_145 &Spell::EffectNULL, //146 SPELL_EFFECT_146 @@ -884,6 +884,16 @@ m_caster->CastSpell(m_caster,spell_id,true,NULL); return; } + case 19028: // Soul Link + { + if (!unitTarget) + return; + + // Pet will cast aura + unitTarget->CastSpell(unitTarget,25228,true,NULL); + return; + } + } //All IconID Check in there @@ -4855,17 +4865,17 @@ void Spell::EffectApplyPetAura(uint32 i) { - //spell aura for both pet and owner, think the pet has the aura and applies it to owner - EffectApplyAura(i); + if(!unitTarget) + return; + if(!unitTarget->isAlive()) + return; - Unit* owner = unitTarget->GetCharmerOrOwner(); - if(owner) - { - unitTarget = owner; - EffectApplyAura(i); - } + // use area aura + AreaAura* Aur = new AreaAura(m_spellInfo, i, &m_currentBasePoints[i], unitTarget, m_caster); + unitTarget->AddAura(Aur); } + void Spell::EffectSummonDemon(uint32 i) { float px = m_targets.m_destX; Index: game/Unit.cpp =================================================================== --- game/Unit.cpp (revision 5524) +++ game/Unit.cpp (working copy) @@ -3915,7 +3915,7 @@ } //float radius = GetRadius(sSpellRadiusStore.LookupEntry((*i).second->GetSpellProto()->EffectRadiusIndex[(*i).second->GetEffIndex()])); - if(pGroup && pGroupOf) + if(pGroup && pGroupOf && (*i).second->GetPetLink() == PETLINK_NONE) { for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) {