diff options
author | megamage <none@none> | 2009-06-06 20:13:01 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-06 20:13:01 -0500 |
commit | 54d3b86ffa2a650e08cc9dfda45895c97ba30b26 (patch) | |
tree | 52c59d9a6829039c3bbb85438674a8ca2e9837b7 /src | |
parent | d3d4c76976a40ca9a741efb0da338483ad82c726 (diff) | |
parent | f505101d8f796c638f50635b522b44fb8c40ddce (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp | 28 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 49 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 8 | ||||
-rw-r--r-- | src/game/Unit.cpp | 24 | ||||
-rw-r--r-- | src/game/Unit.h | 1 |
5 files changed, 104 insertions, 6 deletions
diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp index a846195ddda..560d9196d95 100644 --- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp +++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp @@ -493,6 +493,11 @@ bool GossipSelect_npc_death_knight_initiate(Player *player, Creature *_Creature, ## npc_salanar_the_horseman ######*/ +enum +{ + REALM_OF_SHADOWS = 52693 +}; + struct TRINITY_DLL_DECL npc_salanar_the_horsemanAI : public ScriptedAI { npc_salanar_the_horsemanAI(Creature *c) : ScriptedAI(c) {} @@ -507,10 +512,25 @@ struct TRINITY_DLL_DECL npc_salanar_the_horsemanAI : public ScriptedAI { if( charmer->GetTypeId() == TYPEID_PLAYER ) { - if( CAST_PLR(charmer)->GetQuestStatus(12680) == QUEST_STATUS_INCOMPLETE ) - CAST_PLR(charmer)->KilledMonster(28767, me->GetGUID()); - else if( CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE ) - CAST_PLR(charmer)->GroupEventHappens(12687, me); + switch(me->GetEntry()) + { + // for quest Grand Theft Palomino(12680) + case 28653: + if( CAST_PLR(charmer)->GetQuestStatus(12680) == QUEST_STATUS_INCOMPLETE ) + CAST_PLR(charmer)->KilledMonster(28767, me->GetGUID()); + break; + // for quest Into the Realm of Shadows(12687) + case 28788: + if( CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE ) + { + if(CAST_PLR(charmer)->HasAura(REALM_OF_SHADOWS)) + charmer->RemoveAurasDueToSpell(REALM_OF_SHADOWS); + CAST_PLR(charmer)->GroupEventHappens(12687, me); + } + break; + default: + return; + } CAST_PLR(charmer)->ExitVehicle(); //without this we can see npc kill the horse who->setDeathState(DEAD); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index c87fc9b89fc..b6c44b8cc60 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -4335,6 +4335,18 @@ void AuraEffect::HandleModMechanicImmunity(bool apply, bool Real, bool /*changeA m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,SPELL_AURA_MOD_ROOT,apply); m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,SPELL_AURA_MOD_DECREASE_SPEED,apply); } + // Demonic Circle + else if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellProto->SpellIconID == 3221) + { + if (m_target->GetTypeId() != TYPEID_PLAYER) + return; + if (apply) + { + GameObject* obj = m_target->GetGameObject(48018); + if (obj) + ((Player*)m_target)->TeleportTo(obj->GetMapId(),obj->GetPositionX(),obj->GetPositionY(),obj->GetPositionZ(),obj->GetOrientation()); + } + } } //this method is called whenever we add / remove aura which gives m_target some imunity to some spell effect @@ -4491,6 +4503,27 @@ void AuraEffect::HandleAuraPeriodicDummy(bool apply, bool Real, bool changeAmoun SpellEntry const*spell = GetSpellProto(); switch( spell->SpellFamilyName) { + case SPELLFAMILY_WARLOCK: + { + switch (spell->Id) + { + // Demonic Circle + case 48018: + if (apply) + // set to false at initial cast to enable button at next enable in periodic handler + m_target->SendAuraVisualForSelf(false,62388); + else + { + // Do not remove GO when aura is removed by stack + // to prevent remove GO added by new spell + // old one is already removed + if (GetParentAura()->GetRemoveMode()!=AURA_REMOVE_BY_STACK) + m_target->RemoveGameObject(spell->Id,true); + m_target->SendAuraVisualForSelf(false,62388); + } + break; + } + } case SPELLFAMILY_HUNTER: { // Explosive Shot @@ -6614,6 +6647,21 @@ void AuraEffect::PeriodicDummyTick() } break; } + case SPELLFAMILY_WARLOCK: + switch (spell->Id) + { + // Demonic Circle + case 48018: + GameObject* obj = m_target->GetGameObject(spell->Id); + if (!obj) return; + // We must take a range of teleport spell, not summon. + const SpellEntry* goToCircleSpell = sSpellStore.LookupEntry(48020); + if (m_target->IsWithinDist(obj,GetSpellMaxRangeForFriend(sSpellRangeStore.LookupEntry(goToCircleSpell->rangeIndex)))) + m_target->SendAuraVisualForSelf(true,62388, 1); + else + m_target->SendAuraVisualForSelf(false,62388); + } + break; case SPELLFAMILY_DRUID: { switch (spell->Id) @@ -6656,6 +6704,7 @@ void AuraEffect::PeriodicDummyTick() // Killing Spree case 51690: { + // TODO: this should use effect[1] of 51690 std::list<Unit*> targets; { // eff_radius ==0 diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 661eef708ea..dd85148022b 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5669,7 +5669,13 @@ void Spell::EffectSummonObject(uint32 i) if( m_caster ) obj = m_caster->GetMap()->GetGameObject(guid); - if(obj) obj->Delete(); + if(obj) + { + // Recast case - null spell id to make auras not be removed on object remove from world + if (m_spellInfo->Id == obj->GetSpellId()) + obj->SetSpellId(0); + obj->Delete(); + } m_caster->m_ObjectSlot[slot] = 0; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 1546ccdb927..c2d6f77acec 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3769,6 +3769,25 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_ return modifier; } +void Unit::SendAuraVisualForSelf(bool apply, uint32 id, uint8 effmask) +{ + WorldPacket data(SMSG_AURA_UPDATE); + data.append(GetPackGUID()); + // use always free 64+ slots + data << uint8(MAX_AURAS); + if (!apply) + { + data << uint32(0); + SendMessageToSet(&data, true); + return; + } + data << uint32(id); + data << uint8(AFLAG_CASTER | AFLAG_POSITIVE | effmask); + data << uint8(getLevel()); + data << uint8(1); + SendMessageToSet(&data, true); +} + bool Unit::AddAura(Aura *Aur, bool handleEffects) { // aura doesn't apply effects-return @@ -4285,6 +4304,9 @@ bool Unit::HasAura(uint32 spellId, uint64 caster) const //Special case for non existing spell if (spellId==61988) return HasAura(61987, caster) || HasAura(25771, caster); + // Demonic Circle - special aura for client + else if (spellId==62388) + return HasAura(48018, caster); if (Aura * aur = GetAura(spellId, caster)) return true; @@ -6088,7 +6110,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger { if (pVictim->getPowerType() == POWER_MANA) { - // 2% of maximum mana + // 2% of base mana basepoints0 = int32(pVictim->GetCreateMana() * 2 / 100); pVictim->CastCustomSpell(pVictim, 20268, &basepoints0, NULL, NULL, true, 0, triggeredByAura); } diff --git a/src/game/Unit.h b/src/game/Unit.h index fa32a235d3e..ea99f8a2424 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1536,6 +1536,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject } void SetVisibleAura(uint8 slot, Aura * aur){ m_visibleAuras[slot]=aur; } void RemoveVisibleAura(uint8 slot){ m_visibleAuras.erase(slot); } + void SendAuraVisualForSelf(bool apply, uint32 id, uint8 effmask = 0); AuraMap & GetAuras() { return m_Auras; } AuraMap const& GetAuras() const { return m_Auras; } |