void AIUpdate() { // Let's see if we are netted Aura* a = _unit->getAuraWithId(51959); if(a != NULL) { Unit* Caster = a->GetUnitCaster(); if (Caster == nullptr) return; if(Caster->IsPlayer()) { QuestLogEntry* qle = static_cast<Player*>(Caster)->GetQuestLogForEntry(12532); if(qle == NULL) qle = static_cast<Player*>(Caster)->GetQuestLogForEntry(12702); if(qle != NULL) { // casting the spell that will create the item for the player _unit->CastSpell(Caster, 51037, true); _unit->Despawn(1000, 360000); } } } }
void AuraInterface::MassDispel(Unit* caster, uint32 index, SpellEntry* Dispelling, uint32 MaxDispel, uint8 start, uint8 end) { WorldPacket data(SMSG_SPELLDISPELLOG, 16); Aura* aur = NULL; for(uint32 x = start; x < end; x++) { if(m_auras.find(x) != m_auras.end()) { aur = m_auras.at(x); //Nothing can dispel resurrection sickness; if(aur != NULL && !aur->IsPassive() && !(aur->GetSpellProto()->Attributes & ATTRIBUTES_IGNORE_INVULNERABILITY)) { int32 resistchance = 0; Unit* caster = aur->GetUnitCaster(); if( caster ) SM_FIValue(caster->SM[SMT_RESIST_DISPEL][0], &resistchance, aur->GetSpellProto()->SpellGroupType); if( !Rand(resistchance) ) { if(Dispelling->DispelType == DISPEL_ALL) { m_Unit->HandleProc( PROC_ON_DISPEL_AURA_VICTIM, NULL, caster, Dispelling, aur->GetSpellId() ); data.clear(); data << caster->GetNewGUID(); data << m_Unit->GetNewGUID(); data << (uint32)1;//probably dispel type data << aur->GetSpellId(); caster->SendMessageToSet(&data,true); aur->AttemptDispel( caster ); if(!--MaxDispel) return; } else if(aur->GetSpellProto()->DispelType == Dispelling->EffectMiscValue[index]) { if( (aur->GetSpellProto()->NameHash != SPELL_HASH_ICE_BARRIER && aur->GetSpellProto()->NameHash != SPELL_HASH_DIVINE_SHIELD) || Dispelling->NameHash == SPELL_HASH_MASS_DISPEL ) { m_Unit->HandleProc( PROC_ON_DISPEL_AURA_VICTIM, NULL, caster, Dispelling, aur->GetSpellId() ); data.clear(); data << caster->GetNewGUID(); data << m_Unit->GetNewGUID(); data << (uint32)1; data << aur->GetSpellId(); caster->SendMessageToSet(&data,true); aur->AttemptDispel( caster ); if(!--MaxDispel) return; } } } else if( !--MaxDispel ) return; } } } }
bool AuraInterface::BuildAuraUpdateAllPacket(WorldPacket* data) { if(!m_auras.size()) return false; bool res = false; Aura* aur = NULL; for (uint32 i=0; i<MAX_AURAS; i++) { if(m_auras.find(i) != m_auras.end()) { res = true; aur = m_auras.at(i); aur->BuildAuraUpdate(); uint8 flags = aur->GetAuraFlags(); *data << uint8(aur->m_auraSlot); int32 stack = aur->stackSize; if(aur->procCharges > stack && stack != 0) stack = aur->procCharges; if(stack < 0) { *data << uint32(0); continue; } *data << uint32(aur->GetSpellId()); *data << uint8(flags); *data << uint8(aur->GetUnitCaster() ? aur->GetUnitCaster()->getLevel() : 0); *data << uint8(stack); if(!(flags & AFLAG_NOT_GUID)) FastGUIDPack(*data, aur->GetCasterGUID()); if(flags & AFLAG_HAS_DURATION) { *data << aur->GetDuration(); *data << aur->GetTimeLeft(); } } } return res; }
/// Spell Target Handling for type 38: Dummy Target (Server-side script effect) void Spell::SpellTargetDummyTarget(uint32 i, uint32 j) { //TargetsList *tmpMap=&m_targetUnits[i]; if( m_spellInfo->Id == 51699 ) { if( p_caster ) { Aura* aur = p_caster->FindAura( 52916 ); if( aur && aur->GetUnitCaster() ) { _AddTargetForced(aur->GetUnitCaster()->GetGUID(), i); return; } } } else if( m_spellInfo->Id == 12938 ) { //FIXME:this ll be immortal targets FillAllTargetsInArea(i,m_targets.m_destX,m_targets.m_destY,m_targets.m_destZ,GetDBCCastTime(i)); } _AddTargetForced(m_caster->GetGUID(), i); }
void AIUpdate() { // Let's see if we are netted Aura* a = _unit->FindAura(38177); if(a != NULL) { Unit* Caster = a->GetUnitCaster(); if(Caster->IsPlayer()) { QuestLogEntry* qle = TO_PLAYER(Caster)->GetQuestLogForEntry(10747); if(qle != NULL) { // casting the spell that will create the item for the player _unit->CastSpell(Caster, 38178, true); _unit->Despawn(1000, 360000); } } } }