Jump to content

megamage

Members
  • Posts

    42
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by megamage

  1. For summon object effect, we have UnitTarget but in spelleffect.cpp the unit target is not checked. If there is no dest then ClosePoint of caster is used. I think we should change the coordinate selection for gobject as the same as that for summoning creatures.
  2. If we do positive check the Arcane Missiles check is no longer needed.
  3. Now when bosses cast channel spells on some invisible trigger creature, the trigger will start to attack boss. There should be a positive spell check. I think players sometimes may also need to cast non-negative spells on netrual creature (some quests) Index: Spell.cpp =================================================================== --- Spell.cpp (revision 6354) +++ Spell.cpp (working copy) @@ -947,10 +947,7 @@ { if( !m_caster->IsFriendlyTo(unit) ) { - // exclude Arcane Missiles Dummy Aura aura for now (attack on hit) - // TODO: find way to not need this? - if(!(m_spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && - m_spellInfo->SpellFamilyFlags & 0x800LL)) + if(!IsPositiveSpell(m_spellInfo->Id)) { unit->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
  4. These two are enemy area aura. Spell 41350 periodicly decrease enemy's max mana. Spell 41337 periodicly add enemy's damage and its dot damage increase per tick. Index: SpellAuras.cpp =================================================================== --- SpellAuras.cpp (revision 6335) +++ SpellAuras.cpp (working copy) @@ -1593,8 +1593,21 @@ // case 40867: break; // // Prismatic Shield // case 40879: break; -// // Aura of Desire -// case 41350: break; +// // Aura of Desire + case 41350: + { + Unit::AuraList const& mMod = m_target->GetAurasByType(SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT); + for(Unit::AuraList::const_iterator i = mMod.begin(); i != mMod.end(); ++i) + { + if ((*i)->GetId() == 41350) + { + (*i)->ApplyModifier(false); + (*i)->GetModifier()->m_amount -= 5; + (*i)->ApplyModifier(true); + break; + } + } + }break; // // Dementia // case 41404: break; // // Chaos Form @@ -5349,6 +5362,21 @@ } break; } + case 41337:// aura of anger + { + Unit::AuraList const& mMod = m_target->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); + for(Unit::AuraList::const_iterator i = mMod.begin(); i != mMod.end(); ++i) + { + if ((*i)->GetId() == 41337) + { + (*i)->ApplyModifier(false); + (*i)->GetModifier()->m_amount += 5; + (*i)->ApplyModifier(true); + break; + } + } + m_modifier.m_amount += 100; + }break; default: break; }
  5. Invisibility aura should only be removed by aura_interrupt_type, but not dealing damage. Example: spell 44801 and 46021 These spells make a boss and players invisible, only so only invisible players can fight the boss, other boss or players cannot join the fight. However, now when players hit the boss, or boss hit the players, they are not invisible. Index: Unit.cpp =================================================================== --- Unit.cpp (revision 6346) +++ Unit.cpp (working copy) @@ -464,8 +490,8 @@ RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); - if(pVictim != this) - RemoveSpellsCausingAura(SPELL_AURA_MOD_INVISIBILITY); + //if(pVictim != this) + // RemoveSpellsCausingAura(SPELL_AURA_MOD_INVISIBILITY); if(pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->IsStandState() && !pVictim->hasUnitState(UNIT_STAT_STUNDED)) pVictim->SetStandState(PLAYER_STATE_NONE); Index: Creature.cpp =================================================================== --- Creature.cpp (revision 6346) +++ Creature.cpp (working copy) @@ -1722,6 +1724,9 @@ if(!pVictim->isInAccessablePlaceFor(this)) return true; + if(pVictim->GetVisibility() != VISIBILITY_ON && !(m_invisibilityMask & pVictim->m_invisibilityMask) && !canDetectInvisibilityOf(pVictim)) + return true; + // we not need get instance map, base map provide all info if(MapManager::Instance().GetBaseMap(GetMapId())->Instanceable()) return false;
  6. Lots of effect 3 spells are used for target selection, examples are: 39992: three targets in a cone (must be player) 41294: the nearest target (must be player) and effect 140 I think is used to only on one target, although there are no target number limit, examples are: 45391: used 140 on one random target sometimes 3 and 140 are used together, such as 41294: effect 3, select the nearest target, then effect 140, used on this target
  7. Please try this: http://www.wowhead.com/?item=22589
  8. It should be AreaAura(m_spellInfo, i, &m_currentBasePoints, unitTarget, m_caster, m_castitem); It now is AreaAura(m_spellInfo, i, &m_currentBasePoints, unitTarget, m_caster); The bug is: if you equip a item which gives you a areaaura, you unequip it, the aura will not disappear. Sorry I did not say clearly.
  9. The area aura function did not consider castitem. And we no longer need it because aura type is checked in createaura() Index: SpellEffects.cpp =================================================================== --- SpellEffects.cpp (revision 6326) +++ SpellEffects.cpp (working copy) @@ -95,7 +95,7 @@ &Spell::EffectTriggerMissileSpell, // 32 SPELL_EFFECT_TRIGGER_MISSILE &Spell::EffectOpenLock, // 33 SPELL_EFFECT_OPEN_LOCK &Spell::EffectSummonChangeItem, // 34 SPELL_EFFECT_SUMMON_CHANGE_ITEM - &Spell::EffectApplyAreaAura, // 35 SPELL_EFFECT_APPLY_AREA_AURA_PARTY + &Spell::EffectApplyAura, // 35 SPELL_EFFECT_APPLY_AREA_AURA_PARTY &Spell::EffectLearnSpell, // 36 SPELL_EFFECT_LEARN_SPELL &Spell::EffectUnused, // 37 SPELL_EFFECT_SPELL_DEFENSE one spell: SPELLDEFENSE (DND) &Spell::EffectDispel, // 38 SPELL_EFFECT_DISPEL @@ -188,8 +188,8 @@ &Spell::EffectReduceThreatPercent, //125 SPELL_EFFECT_REDUCE_THREAT_PERCENT &Spell::EffectStealBeneficialBuff, //126 SPELL_EFFECT_STEAL_BENEFICIAL_BUFF spell steal effect? &Spell::EffectProspecting, //127 SPELL_EFFECT_PROSPECTING Prospecting spell - &Spell::EffectApplyAreaAura, //128 SPELL_EFFECT_APPLY_AREA_AURA_FRIEND - &Spell::EffectApplyAreaAura, //129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY + &Spell::EffectApplyAura, //128 SPELL_EFFECT_APPLY_AREA_AURA_FRIEND + &Spell::EffectApplyAura, //129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY &Spell::EffectNULL, //130 SPELL_EFFECT_REDIRECT_THREAT &Spell::EffectUnused, //131 SPELL_EFFECT_131 used in some test spells &Spell::EffectNULL, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value @@ -2987,7 +2990,7 @@ } } -void Spell::EffectApplyAreaAura(uint32 i) +/*void Spell::EffectApplyAreaAura(uint32 i) { if(!unitTarget) return; @@ -2996,7 +2999,7 @@ AreaAura* Aur = new AreaAura(m_spellInfo, i, &m_currentBasePoints[i], unitTarget, m_caster); unitTarget->AddAura(Aur); -} +}*/ void Spell::EffectSummon(uint32 i) {
  10. In official like, all (as far as I know) summon effects are implemented using spells. But in current SD2, most summon effects are calling summoncreature() function. Because there are some defects for summon spells. One defect is that summoner cannot access minions. Using this patch, creature can access minions which are summoned by spells. For example, a boss summon some minions and then need to cast some buff on these minions. Without this patch we need some complicated method to access its minions. Index: Object.cpp =================================================================== --- Object.cpp (revision 6307) +++ Object.cpp (working copy) @@ -1310,6 +1311,9 @@ pCreature->Summon(spwtype, despwtime); + if(GetTypeId()==TYPEID_UNIT && ((Creature*)this)->AI()) + ((Creature*)this)->AI()->JustSummoned(pCreature); + //return the creature therewith the summoner has access to it return pCreature; } Index: CreatureAI.h =================================================================== --- CreatureAI.h (revision 6307) +++ CreatureAI.h (working copy) @@ -68,6 +68,10 @@ // Called when the creature kills a unit virtual void KilledUnit(Unit *) {} + virtual void JustSummoned(Creature* ) {} + virtual void SummonedCreatureDespawn(Creature* /*unit*/) {} // Called when hit by a spell
  11. The script effect table give better way to implement most script effect spells. For script effect spells, we have four fields: triggering spell, triggering condition, triggered spell, triggered method Examples: 41126 flame burst (effect 77) / when hit / trigger 41131 flame burst / target cast on target (currently in core) 40904 draw soul (effect 77) / hit / 40903 draw doul / target cast on caster 41914 Parasitic Shadowfiend (effect 77) / aura removed when time out / 41915 Summon Parasitic Shadowfiends / target cast on target 39992 Needle Spine Targeting (effect 3) / hit / 39835 Needle Spine / caster cast on target 39835 Needle Spine (effect 77) / hit / 39968 Needle Spine Explosion / target cast on target 24590 Brittle Armor (effect 77) / hit / 24575 Brittle Armor / remove one stack (currently in core) 29213 Curse of the Plaguebringer / aura removed when time out / 29214 Curse of the Plaguebringer / target cast on target (in core, but do not know why need this) 29858 Soulshatter (effect 3) / hit / 32835 Soulshatter / caster cast on target (in core) 21977 Warrior's Wrath (effect 3) / hit / 21887 Warrior's Wrath / caster cast on caster (in core) 31231 Cheat Death (effect 3) / hit / 45182 Cheat Death / caster cast on caster (in core) Linked auras mean the aura have more than three effects, so they should be put into different spells, but still consider as one aura. Once applied, all applied; once removed, all removed. For linked auras, we have two fields: aura 1, aura 2 Examples: 40604 fel rage / 40616 fel rage 2 40616 fel rage 2 / 41625 fel rage 3 41292 Aura of Suffering / 42017 Aura of Suffering 41296 Essence of Suffering Passive / 41623 Essence of Suffering Passive 9634 dire bear form / 9635 dire bear form passive 9635 dire bear form passive / 21178 Bear Form (Passive2) (currently in core) 13139 Net-o-Matic / 13138 Net-o-Matic (in core)
  12. This patch add two new area aura: effect 128 friend aura which affects all nearby friendly units and effect 129 enemy aura which affects all nearby enemy. It also fixes some bugs of the old area aura: effect 35 group aura. Target's aura now can be correctly removed when caster removes his aura or target changes or leaves the group. Pets will also recieve the auras. Patch has been tested and works fine. Index: SpellAuraDefines.h =================================================================== --- SpellAuraDefines.h (revision 6256) +++ SpellAuraDefines.h (working copy) @@ -291,4 +291,11 @@ SPELL_AURA_MOD_ENEMY_DODGE = 251, TOTAL_AURAS=252 }; + +enum AreaAuraType +{ + AREA_AURA_GROUP = 0, + AREA_AURA_FRIEND = 1, + AREA_AURA_ENEMY = 2 +}; #endif Index: SpellAuras.cpp =================================================================== --- SpellAuras.cpp (revision 6256) +++ SpellAuras.cpp (working copy) @@ -42,6 +42,9 @@ #include "BattleGround.h" #include "CreatureAI.h" #include "Util.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" +#include "CellImpl.h" #define NULL_AURA_SLOT 0xFF @@ -399,7 +402,7 @@ } AreaAura::AreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, -Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, target, caster, castItem) +Unit *caster, Item* castItem, AreaAuraType type) : Aura(spellproto, eff, currentBasePoints, target, caster, castItem) { m_isAreaAura = true; @@ -409,6 +412,10 @@ m_radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(GetSpellProto()->EffectRadiusIndex[m_effIndex])); if(Player* modOwner = caster_ptr->GetSpellModOwner()) modOwner->ApplySpellMod(GetId(), SPELLMOD_RADIUS, m_radius); + + m_auraType = type; + if(m_auraType == AREA_AURA_ENEMY && target == caster) + m_modifier.m_auraname = SPELL_AURA_DUMMY; // Do not do any effect on self } AreaAura::~AreaAura() @@ -556,93 +563,101 @@ if(m_caster_guid == m_target->GetGUID()) { Unit* caster = m_target; + Unit* owner = caster->GetCharmerOrOwner() ? caster->GetCharmerOrOwner() : caster; + std::list<Unit *> targets; - Group *pGroup = NULL; - if (caster->GetTypeId() == TYPEID_PLAYER) - pGroup = ((Player*)caster)->GetGroup(); - else if(caster->GetCharmerOrOwnerGUID() != 0) + if (m_auraType == AREA_AURA_GROUP) { - Unit *owner = caster->GetCharmerOrOwner(); - if (owner && owner->GetTypeId() == TYPEID_PLAYER) + Group *pGroup = NULL; + if(owner->GetTypeId() == TYPEID_PLAYER) pGroup = ((Player*)owner)->GetGroup(); - } - if(pGroup) - { - for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + if(pGroup) { - Player* Target = itr->getSource(); - if(!Target) - continue; + for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player* Target = itr->getSource(); - if (caster->GetTypeId() == TYPEID_PLAYER) - { - if(Target->GetGUID() == m_caster_guid || !Target->isAlive() || !pGroup->SameSubGroup((Player*)caster, Target)) - continue; + if(Target && Target->isAlive() && pGroup->SameSubGroup((Player*)owner, Target)) + { + if(caster->IsWithinDistInMap(Target, m_radius) && !Target->GetAura(GetId(), m_effIndex)) + targets.push_back(Target); + Pet *pet = Target->GetPet(); + if(pet && pet->isAlive() && caster->IsWithinDistInMap(pet, m_radius) && !pet->GetAura(GetId(), m_effIndex)) + targets.push_back(pet); + } } - else if(caster->GetCharmerOrOwnerGUID() != 0) - { - Unit *owner = caster->GetCharmerOrOwner(); - if(!Target->isAlive() || (owner->GetTypeId() == TYPEID_PLAYER && !pGroup->SameSubGroup((Player*)owner, Target))) - continue; - } + } + else + { + if(owner != caster && caster->IsWithinDistInMap(owner, m_radius) && !owner->GetAura(GetId(), m_effIndex)) + targets.push_back(owner); + Pet *pet = owner->GetPet(); // Maybe shamans have both totem and pet (fire element totem)? + if(pet && pet->isAlive() && caster->IsWithinDistInMap(pet, m_radius) && !pet->GetAura(GetId(), m_effIndex)) + targets.push_back(pet); + } + } + else if (m_auraType == AREA_AURA_ENEMY) + { + CellPair p(MaNGOS::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY())); + Cell cell(p); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); - Aura *t_aura = Target->GetAura(GetId(), m_effIndex); + { + MaNGOS::AnyAoETargetUnitInObjectRangeCheck u_check(caster, owner, m_radius); // No GetCharmer in searcher + MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck> searcher(targets, u_check); - if(caster->IsWithinDistInMap(Target, m_radius) ) - { - // apply aura to players in range that dont have it yet - if (!t_aura) - { - // if rank not found - if(SpellEntry const *actualSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(GetSpellProto(),Target->getLevel())) - { - int32 actualBasePoints = m_currentBasePoints; + TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); + TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher); - // recalculate basepoints for lower rank (all AreaAura spell not use custom basepoints?) - if(actualSpellInfo != GetSpellProto()) - actualBasePoints = actualSpellInfo->EffectBasePoints[m_effIndex]; + CellLock<GridReadGuard> cell_lock(cell, p); + cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(caster->GetMapId(), caster)); + cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(caster->GetMapId(), caster)); + } + } + else // Unfortunately we do not have an approciate searcher, have to use AnyUnitInObjectRangeCheck + { + CellPair p(MaNGOS::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY())); + Cell cell(p); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); - AreaAura *aur = new AreaAura(actualSpellInfo, m_effIndex, &actualBasePoints, Target, caster); - Target->AddAura(aur); - } - } - } - else - { - // remove auras of the same caster from out of range players - if (t_aura) - if (t_aura->GetCasterGUID() == m_caster_guid) - Target->RemoveAura(GetId(), m_effIndex); - } + { + MaNGOS::AnyUnitInObjectRangeCheck u_check(caster, m_radius); + MaNGOS::UnitListSearcher<MaNGOS::AnyUnitInObjectRangeCheck> searcher(targets, u_check); + + TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); + TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher); + + CellLock<GridReadGuard> cell_lock(cell, p); + cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(caster->GetMapId(), caster)); + cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(caster->GetMapId(), caster)); } } - else if (caster->GetCharmerOrOwnerGUID() != 0) + + for(std::list<Unit *>::iterator tIter = targets.begin(); tIter != targets.end(); tIter++) { - // add / remove auras from the totem's owner - Unit *owner = caster->GetCharmerOrOwner(); - if (owner) + // Additional check for AREA_AURA_FRIEND, maybe we should add a AnyFriendlyUnitInObjectRangeCheck function + if(m_auraType == AREA_AURA_FRIEND && !owner->IsFriendlyTo(*tIter) + || m_auraType != AREA_AURA_GROUP && (*tIter)->GetAura(GetId(), m_effIndex)) // group aura has finished this check + continue; + + if(SpellEntry const *actualSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(GetSpellProto(), (*tIter)->getLevel())) { - Aura *o_aura = owner->GetAura(GetId(), m_effIndex); - if(caster->IsWithinDistInMap(owner, m_radius)) - { - if (!o_aura) - { - AreaAura *aur = new AreaAura(GetSpellProto(), m_effIndex, &m_currentBasePoints, owner, caster); - owner->AddAura(aur); - } - } - else - { - if (o_aura) - if (o_aura->GetCasterGUID() == m_caster_guid) - owner->RemoveAura(GetId(), m_effIndex); - } + int32 actualBasePoints = m_currentBasePoints; + + // recalculate basepoints for lower rank (all AreaAura spell not use custom basepoints?) + if(actualSpellInfo != GetSpellProto()) + actualBasePoints = actualSpellInfo->EffectBasePoints[m_effIndex]; + AreaAura *aur = new AreaAura(actualSpellInfo, m_effIndex, &actualBasePoints, (*tIter), caster, NULL, m_auraType); + (*tIter)->AddAura(aur); } } + + Aura::Update(diff); // Update for caster } - - if(m_caster_guid != m_target->GetGUID()) // aura at non-caster + else // aura at non-caster { Unit * tmp_target = m_target; Unit* caster = GetCaster(); @@ -652,11 +667,37 @@ // DO NOT access its members after update! Aura::Update(diff); - // remove aura if out-of-range from caster (after teleport for example) - if(!caster || !caster->IsWithinDistInMap(tmp_target, m_radius) ) + // remove aura if out-of-range from caster or caster no longer has the aura + if(!caster || !caster->IsWithinDistInMap(tmp_target, m_radius) || !caster->GetAura(tmp_spellId, tmp_effIndex)) tmp_target->RemoveAura(tmp_spellId, tmp_effIndex); + // remove aura if type is group aura and no longer in the same group with caster + else if(m_auraType == AREA_AURA_GROUP) + { + Group *pGroup = NULL; + Unit* owner = caster->GetCharmerOrOwner() ? caster->GetCharmerOrOwner() : caster; + if(owner->GetTypeId() == TYPEID_PLAYER) + pGroup = ((Player*)owner)->GetGroup(); + + if(pGroup) + { + if(tmp_target->GetTypeId() == TYPEID_PLAYER) + { + if(!pGroup->SameSubGroup((Player*)owner, (Player*)tmp_target)) + tmp_target->RemoveAura(tmp_spellId, tmp_effIndex); + } + else // For pet + { + Unit* target_owner = tmp_target->GetCharmerOrOwner(); + if(!target_owner || target_owner->GetTypeId() != TYPEID_PLAYER || !pGroup->SameSubGroup((Player*)owner, (Player*)target_owner)) + tmp_target->RemoveAura(tmp_spellId, tmp_effIndex); + } + } + else if(tmp_target != owner) + tmp_target->RemoveAura(tmp_spellId, tmp_effIndex); + } + + // remove aura if owner changes faction, can this happen? } - else Aura::Update(diff); } void PersistentAreaAura::Update(uint32 diff) Index: SpellAuras.h =================================================================== --- SpellAuras.h (revision 6256) +++ SpellAuras.h (working copy) @@ -346,11 +346,12 @@ class MANGOS_DLL_SPEC AreaAura : public Aura { public: - AreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL); + AreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL, AreaAuraType type = AREA_AURA_GROUP); ~AreaAura(); void Update(uint32 diff); private: float m_radius; + AreaAuraType m_auraType; //0: group, 1: friend, 2: enemy }; class MANGOS_DLL_SPEC PersistentAreaAura : public Aura Index: SpellEffects.cpp =================================================================== --- SpellEffects.cpp (revision 6256) +++ SpellEffects.cpp (working copy) @@ -179,7 +179,7 @@ &Spell::EffectSkinPlayerCorpse, //116 SPELL_EFFECT_SKIN_PLAYER_CORPSE one spell: Remove Insignia, bg usage, required special corpse flags... &Spell::EffectSpiritHeal, //117 SPELL_EFFECT_SPIRIT_HEAL one spell: Spirit Heal &Spell::EffectSkill, //118 SPELL_EFFECT_SKILL professions and more - &Spell::EffectApplyPetAura, //119 SPELL_EFFECT_APPLY_AURA_NEW + &Spell::EffectApplyPetAura, //119 SPELL_EFFECT_APPLY_AURA_PET &Spell::EffectUnused, //120 SPELL_EFFECT_TELEPORT_GRAVEYARD one spell: Graveyard Teleport Test &Spell::EffectWeaponDmg, //121 SPELL_EFFECT_NORMALIZED_WEAPON_DMG &Spell::EffectUnused, //122 SPELL_EFFECT_122 unused @@ -188,8 +188,8 @@ &Spell::EffectReduceThreatPercent, //125 SPELL_EFFECT_REDUCE_THREAT_PERCENT &Spell::EffectStealBeneficialBuff, //126 SPELL_EFFECT_STEAL_BENEFICIAL_BUFF spell steal effect? &Spell::EffectProspecting, //127 SPELL_EFFECT_PROSPECTING Prospecting spell - &Spell::EffectApplyAura, //128 SPELL_EFFECT_APPLY_AURA_NEW2 probably apply aura again - &Spell::EffectNULL, //129 SPELL_EFFECT_APPLY_AURA_NEW3 + &Spell::EffectApplyFriendAura, //128 SPELL_EFFECT_APPLY_AURA_FRIEND + &Spell::EffectApplyEnemyAura, //129 SPELL_EFFECT_APPLY_AURA_ENEMY &Spell::EffectNULL, //130 SPELL_EFFECT_REDIRECT_THREAT &Spell::EffectUnused, //131 SPELL_EFFECT_131 used in some test spells &Spell::EffectNULL, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value @@ -5674,6 +5675,28 @@ } } +void Spell::EffectApplyFriendAura(uint32 i) +{ + if(!unitTarget) + return; + if(!unitTarget->isAlive()) + return; + + AreaAura* Aur = new AreaAura(m_spellInfo, i, &m_currentBasePoints[i], unitTarget, m_caster, NULL, AREA_AURA_FRIEND); + unitTarget->AddAura(Aur); +} + +void Spell::EffectApplyEnemyAura(uint32 i) +{ + if(!unitTarget) + return; + if(!unitTarget->isAlive()) + return; + + AreaAura* Aur = new AreaAura(m_spellInfo, i, &m_currentBasePoints[i], unitTarget, m_caster, NULL, AREA_AURA_ENEMY); + unitTarget->AddAura(Aur); +} + void Spell::EffectSummonDemon(uint32 i) { float px = m_targets.m_destX;
  13. Can I manually prevent a certain grid from going idle? In my case, a npc should return to battlefield when the boss is killed. However, this npc is far away. Now what I can do is let boss relocate it to the active grid.
  14. I have a suggestion. Currently FillTargetMap() function obtains a Unit list. Can we change it so it obtains a SpellCastTargets list or some new class like that? The memeber in the list may be a Unit, or may be a location (x, y, z). For summon spells, they can summon creatures in spelleffects.cpp at these locations in SpellCastTargets list, rather than calculate the locations in spelleffects.cpp. Also, some non-summoning spells may target a location rather than a unit and they can be implemented. For CastSpell(Unit* Victim, ...) fuction, I also suggest to change it to CastSpell(SpellCastTargets *target, ...). Otherwise creatures cannot cast a spell without seleting a Unit target. For example, one boss should throw fireballs at random location, but now we have to choose a player first then let the boss throw fireball at it. Another problem is spell visual. Some aoe spells have a visual effect that it launch multiple missiles. Currently the number of missiles depends on target numbers. If the aoe implicit only one target, you will only see one missile. If there are too many targets nearby, you will see too many missiles. In official like the number of missiles is fixed. For example, a boss should toss many fireballs to a wide area. In official-like you will see the fireballs are uniformly distributed in the area. But here you will see the fireballs go to players one-on-one. If there is no players, then no visual effect. Although every target should be damaged by the aoe spell, the missiles may not target the players. I think the problem is in void Spell::WriteSpellGoTargets( WorldPacket * data ). We have a m_UniqueTargetInfo, we may also need a m_VisualTargetInfo. The spell hit m_UniqueTargetInfo, while the visual is that it hit m_VisualTargetInfo.
  15. I do not know well about the grids. But I know if a creatures is too far away from a player, it will stop update(diff). This is not good for coding creature AI. Is there a way to make a creature always update? Or can we put a "virtual player" somewhere to make the creatures arond it keep updating?
  16. 41,42,43,44,47,48,49,50: summon creatures at eight directions around the caster, and at exactly the spell radius. 47: front, 41: front-left, 49: left, 42:back-left, 48:back, 43:back-right, 50:right, 44:front-right. Currently 41-44 are called TARGET_TOTEM_XXX, but they are not only for totems. 47 is called TARGET_DYNAMIC_OBJECT, in fact 41-44 and 58-50 are the same as it. 46: seems like to be summon creatures at the location of another creature 72: summon creatures at random directions around the caster, at random distince < spell radius. 72 is also used with effect 3 dummy. Usually this spell is periodicly triggered. 72 select a random location and the spell do visual effect at that location. Such as Volcanic Geyser, the volcano periodicly throw fireballs at locations around it. 73: summon creatures at random directions around the caster, at exactly the spell radius. (range = 0) 74: summon creatures within an area, random distance from a selected point. (range > 0, radius > 0) 63, A=53 and B=16: if these are not used for summoning, they are TARGET_ALL_ENEMY_IN_AREA and do aoe damage. If they are used for summoning, they summon a trigger creature in the selected location and the trigger creature do aoe damage. Now these spells are bugged. They are consider as aoe and will summon mutiple creatures for every inflicited enemies within the area. The number of summoned creatures is always decided by field base_point, not number of enemys. These spells have a positive radius because the radius indicates the aoe radius of the trigger creature, not itself. I think we can ignore this radius and only summon one creature at the selected location.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use