diff --git a/sql/migrations/20170601215440_world.sql b/sql/migrations/20170601215440_world.sql new file mode 100644 index 000000000..ead762b69 --- /dev/null +++ b/sql/migrations/20170601215440_world.sql @@ -0,0 +1,26 @@ +INSERT INTO `migrations` VALUES ('20170601215440'); + +-- dungeons summuning ritual spells trigger events +-- uldaman +INSERT INTO `scripted_event_id` (`id`, `ScriptName`) VALUES ('2228', 'event_awaken_stone_keeper'); +INSERT INTO `scripted_event_id` (`id`, `ScriptName`) VALUES ('2268', 'event_awaken_archaedas'); +-- ubrs +INSERT INTO `scripted_event_id` (`id`, `ScriptName`) VALUES ('4884', 'event_free_pyroguard_emberseer'); + +-- trigger spell +-- blackrock altar +UPDATE `gameobject_template` SET `data1`='16533' WHERE `entry`='175706'; +-- visual spell +-- ritual of doom +UPDATE `gameobject_template` SET `data2`='18540' WHERE `entry`='177193'; +-- ritual of summoning +UPDATE `gameobject_template` SET `data2`='698' WHERE `entry`='36727'; + +-- av summoning rituals must be persistent, despawn by script +UPDATE `gameobject_template` SET `data3`='1' WHERE `entry`='178465'; +UPDATE `gameobject_template` SET `data3`='1' WHERE `entry`='178670'; + +-- av summoning rituals secondary spell value must be none +UPDATE `gameobject_template` SET `data4`='0' WHERE `entry`='178465'; +UPDATE `gameobject_template` SET `data4`='0' WHERE `entry`='178670'; + diff --git a/src/game/Chat/Chat.cpp b/src/game/Chat/Chat.cpp index 49cec7441..c1f9d7e48 100644 --- a/src/game/Chat/Chat.cpp +++ b/src/game/Chat/Chat.cpp @@ -215,6 +215,8 @@ ChatCommand * ChatHandler::getCommandTable() { NODE, "sellerror", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendSellErrorCommand, "", nullptr }, { NODE, "spellfail", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendSpellFailCommand, "", nullptr }, { NODE, "visual", SEC_GAMEMASTER, true, &ChatHandler::HandleSendSpellVisualCommand, "", nullptr }, + { NODE, "chanvisual", SEC_GAMEMASTER, true, &ChatHandler::HandleSendSpellChannelVisualCommand, "", nullptr }, + { NODE, "chanvisualnext", SEC_GAMEMASTER, true, &ChatHandler::HandleDebugSendNextChannelSpellVisualCommand, "", nullptr }, { NODE, "impact", SEC_GAMEMASTER, true, &ChatHandler::HandleSendSpellImpactCommand, "", nullptr }, { MSTR, nullptr, 0, false, nullptr, "", nullptr } }; diff --git a/src/game/Chat/Chat.h b/src/game/Chat/Chat.h index 9032993a9..81dfe86b3 100644 --- a/src/game/Chat/Chat.h +++ b/src/game/Chat/Chat.h @@ -408,6 +408,13 @@ class MANGOS_DLL_SPEC ChatHandler bool HandleDebugSendSellErrorCommand(char* args); bool HandleDebugSendSpellFailCommand(char* args); + /* + Send the visual of the next channeled spell after args, suggested macro : + /run if not f then f=ChatFrame_OnEvent ChatFrame_OnEvent=function(e)f(e)if p==0 and e=='CHAT_MSG_SYSTEM'then n=gsub(arg1,'%D*(%d*)%s.*','%1')end end end n=n or 0 SendChatMessage('.debug send chanvisualnext '..(p==1 and n or -1))p=p==1 and 0 or 1 + */ + bool HandleDebugSendNextChannelSpellVisualCommand(char* args); + bool HandleSendSpellChannelVisualCommand(char* args); + bool HandleEventListCommand(char* args); bool HandleEventStartCommand(char* args); bool HandleEventStopCommand(char* args); diff --git a/src/game/Commands/debugcmds.cpp b/src/game/Commands/debugcmds.cpp index e66c925c8..cbd602472 100644 --- a/src/game/Commands/debugcmds.cpp +++ b/src/game/Commands/debugcmds.cpp @@ -71,6 +71,77 @@ bool ChatHandler::HandleDebugSendSpellFailCommand(char* args) return true; } +bool ChatHandler::HandleDebugSendNextChannelSpellVisualCommand(char *args) +{ + uint32 uiPlayId = 0; + char* playIdStr = strtok(args, " "); + if (playIdStr) + uiPlayId = int32(atoi(playIdStr)); + + if (uiPlayId == -1) + { + m_session->GetPlayer()->SetUInt32Value(UNIT_CHANNEL_SPELL, 0); + WorldPacket data(MSG_CHANNEL_UPDATE, (4)); + data << uint32(0); + m_session->GetPlayer()->SendDirectMessage(&data); + PSendSysMessage("Sending channel stop"); + return true; + } + uint32 id = 0; + SpellEntry const *spellInfo = NULL; + for (id = uiPlayId + 1; id <= sSpellStore.GetNumRows(); id++) + { + spellInfo = sSpellMgr.GetSpellEntry(id); + if (!spellInfo || uiPlayId >= spellInfo->Id || !spellInfo->SpellVisual || !IsChanneledSpell(spellInfo)) + continue; + else + break; + } + if (id && id <= sSpellStore.GetNumRows()) + { + WorldPacket data(MSG_CHANNEL_START, (4 + 4)); + data << uint32(id); + data << uint32(60000); + m_session->GetPlayer()->SendDirectMessage(&data); + m_session->GetPlayer()->SetUInt32Value(UNIT_CHANNEL_SPELL, id); + PSendSysMessage("Playing channel visual of spell %u %s %s", id, spellInfo->SpellName[0], spellInfo->Rank[0]); + return true; + } + PSendSysMessage("Spell Id range 0 to %u, -1 to stop animation", sSpellStore.GetNumRows()); + return true; +} + +bool ChatHandler::HandleSendSpellChannelVisualCommand(char *args) +{ + uint32 uiPlayId = 0; + char* playIdStr = strtok(args, " "); + if (playIdStr) + uiPlayId = int32(atoi(playIdStr)); + + if (uiPlayId && uiPlayId <= sSpellStore.GetNumRows()) + { + WorldPacket data(MSG_CHANNEL_START, (4 + 4)); + data << uint32(uiPlayId); + data << uint32(60000); + m_session->GetPlayer()->SendDirectMessage(&data); + m_session->GetPlayer()->SetUInt32Value(UNIT_CHANNEL_SPELL, uiPlayId); + SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(uiPlayId); + PSendSysMessage("Playing channel visual of spell %u %s %s", uiPlayId, spellInfo->SpellName[0], spellInfo->Rank[0]); + return true; + } + else if (!uiPlayId) + { + m_session->GetPlayer()->SetUInt32Value(UNIT_CHANNEL_SPELL, 0); + WorldPacket data(MSG_CHANNEL_UPDATE, (4)); + data << uint32(0); + m_session->GetPlayer()->SendDirectMessage(&data); + PSendSysMessage("Sending channel stop"); + return true; + } + PSendSysMessage("Spell Id range 1 to %u, 0 to stop animation", sSpellStore.GetNumRows()); + return true; +} + bool ChatHandler::HandleDebugSendPoiCommand(char* args) { Player *pPlayer = m_session->GetPlayer(); diff --git a/src/game/Objects/GameObject.cpp b/src/game/Objects/GameObject.cpp index 02f6277d8..e5dd73b13 100644 --- a/src/game/Objects/GameObject.cpp +++ b/src/game/Objects/GameObject.cpp @@ -490,6 +490,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/) if (spellId) { + // TODO find out why this is here, because m_UniqueUsers is empty for GAMEOBJECT_TYPE_GOOBER for (GuidsSet::const_iterator itr = m_UniqueUsers.begin(); itr != m_UniqueUsers.end(); ++itr) { if (Player* owner = GetMap()->GetPlayer(*itr)) @@ -597,18 +598,116 @@ void GameObject::Refresh() void GameObject::AddUniqueUse(Player* player) { + std::unique_lock guard(m_UniqueUsers_lock); + AddUse(); + if (m_UniqueUsers.find(player->GetObjectGuid()) != m_UniqueUsers.end()) + return; + if (!m_firstUser) m_firstUser = player->GetObjectGuid(); m_UniqueUsers.insert(player->GetObjectGuid()); + guard.unlock(); + + if (GameObjectInfo const* info = GetGOInfo()) + if (info->type == GAMEOBJECT_TYPE_SUMMONING_RITUAL && + info->summoningRitual.animSpell && + GetOwnerGuid() != player->GetObjectGuid()) + { + SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(info->summoningRitual.animSpell); + if (!spellInfo) + { + sLog.outError("WORLD: unknown spell id %u at play anim for gameobject (Entry: %u GoType: %u )", info->summoningRitual.animSpell, GetEntry(), GetGoType()); + return; + } + Spell* spell = new Spell(player, spellInfo, true, GetObjectGuid()); + spell->SetChannelingVisual(true); + SpellCastTargets targets; + targets.setGOTarget(this); + spell->prepare(std::move(targets)); + } +} + +void GameObject::RemoveUniqueUse(Player* player) +{ + std::lock_guard guard(m_UniqueUsers_lock); + + auto itr = m_UniqueUsers.find(player->GetObjectGuid()); + if (itr == m_UniqueUsers.end()) + return; + m_UniqueUsers.erase(itr); + + if (GameObjectInfo const* info = GetGOInfo()) + // owner cancelled + if (player->GetObjectGuid() == GetOwnerGuid() || + // too many helpers cancelled while it's activated + (GetGoState() == GO_STATE_ACTIVE && + m_UniqueUsers.size() < info->summoningRitual.reqParticipants)) + { + if (!info->summoningRitual.ritualPersistent) + { + if (GetGoState() != GO_STATE_ACTIVE) + SetLootState(GO_JUST_DEACTIVATED); + else if (GetOwner()) + // if active it'll be destroyed in Spell::update + // remove it from owner's list to keep it running + GetOwner()->RemoveGameObject(this, false); + } + SetGoState(GO_STATE_READY); + } +} + +void GameObject::FinishRitual() +{ + std::unique_lock guard(m_UniqueUsers_lock); + + if (GameObjectInfo const* info = GetGOInfo()) + { + // take spell cooldown + if (GetOwner() && GetOwner()->IsPlayer()) + if (SpellEntry const* createBySpell = sSpellMgr.GetSpellEntry(GetSpellId())) + GetOwner()->CooldownEvent(createBySpell); + if (!info->summoningRitual.ritualPersistent) + SetLootState(GO_JUST_DEACTIVATED); + // Only ritual of doom deals a second spell + if (uint32 spellid = info->summoningRitual.casterTargetSpell) + { + // On a random user + auto it = m_UniqueUsers.begin(); + if (it != m_UniqueUsers.end()) + { + std::advance(it, urand(0, m_UniqueUsers.size() - 1)); + + guard.unlock(); + + if (Player* target = GetMap()->GetPlayer(*it)) + target->CastSpell(target, spellid, true); + } + } + } +} + +bool GameObject::HasUniqueUser(Player* player) +{ + std::lock_guard guard(m_UniqueUsers_lock); + return m_UniqueUsers.find(player->GetObjectGuid()) != m_UniqueUsers.end(); +} + +uint32 GameObject::GetUniqueUseCount() +{ + std::lock_guard guard(m_UniqueUsers_lock); + return m_UniqueUsers.size(); } void GameObject::Delete() { - SendObjectDeSpawnAnim(GetObjectGuid()); + // no despawn animation for not activated rituals + if (GetGoType() != GAMEOBJECT_TYPE_SUMMONING_RITUAL || + GetGoState() == GO_STATE_ACTIVE) + SendObjectDeSpawnAnim(GetObjectGuid()); SetGoState(GO_STATE_READY); SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags); @@ -1489,16 +1588,10 @@ void GameObject::Use(Unit* user) AddUniqueUse(player); - if (info->summoningRitual.animSpell) - { - player->CastSpell(player, info->summoningRitual.animSpell, true); - - // for this case, summoningRitual.spellId is always triggered - triggered = true; - } - // full amount unique participants including original summoner, need more - if (GetUniqueUseCount() < info->summoningRitual.reqParticipants) + if (GetUniqueUseCount() < info->summoningRitual.reqParticipants || + !info->summoningRitual.spellId || + GetGoState() == GO_STATE_ACTIVE) // spell already sent return; // owner is first user for non-wild GO objects, if it offline value already set to current user @@ -1506,35 +1599,15 @@ void GameObject::Use(Unit* user) if (Player* firstUser = GetMap()->GetPlayer(m_firstUser)) spellCaster = firstUser; + // Some have a visual effect + SetGoState(GO_STATE_ACTIVE); + spellId = info->summoningRitual.spellId; // spell have reagent and mana cost but it not expected use its // it triggered spell in fact casted at currently channeled GO triggered = true; - // finish owners spell - if (owner) - owner->FinishSpell(CURRENT_CHANNELED_SPELL); - - // finish clickers spell - for (GuidsSet::const_iterator itr = m_UniqueUsers.begin(); itr != m_UniqueUsers.end(); ++itr) - { - if (Player* user = GetMap()->GetPlayer(*itr)) - if (user && user != owner && !info->summoningRitual.ritualPersistent) - { - Spell *channeled = user->GetCurrentSpell(CURRENT_CHANNELED_SPELL); - if (channeled && channeled->m_spellInfo->Id == info->summoningRitual.animSpell) - user->FinishSpell(CURRENT_CHANNELED_SPELL); - } - } - - // can be deleted now, if - if (!info->summoningRitual.ritualPersistent) - SetLootState(GO_JUST_DEACTIVATED); - // reset ritual for this GO - else - ClearAllUsesData(); - // go to end function to spell casting break; } @@ -1772,16 +1845,21 @@ void GameObject::Use(Unit* user) Spell *spell = new Spell(spellCaster, spellInfo, triggered, GetObjectGuid()); - // spell target is user of GO SpellCastTargets targets; // If summoning ritual GO use the summon target instead - Player* summonTarget = nullptr; - if (GetGoType() == GAMEOBJECT_TYPE_SUMMONING_RITUAL && getSummonTarget()) - summonTarget = sObjectMgr.GetPlayer(getSummonTarget()); - - if (summonTarget) - targets.setUnitTarget(summonTarget); + if (GetGoType() == GAMEOBJECT_TYPE_SUMMONING_RITUAL) + { + Player* summonTarget = nullptr; + // Only player summoning requires a target + if (GetEntry() == 36727 && getSummonTarget()) + { + summonTarget = sObjectMgr.GetPlayer(getSummonTarget()); + targets.setUnitTarget(summonTarget); + } + // Object coordinates are needed later + targets.setGOTarget(this); + } else targets.setUnitTarget(user); diff --git a/src/game/Objects/GameObject.h b/src/game/Objects/GameObject.h index f042992ef..67c9a3640 100644 --- a/src/game/Objects/GameObject.h +++ b/src/game/Objects/GameObject.h @@ -27,6 +27,7 @@ #include "Object.h" #include "LootMgr.h" #include "Database/DatabaseEnv.h" +#include // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform #if defined( __GNUC__ ) @@ -654,11 +655,17 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject m_UniqueUsers.clear(); } + // Used for GAMEOBJECT_TYPE_SUMMONING_RITUAL + ObjectGuid getSummonTarget() const { return m_summonTarget; } + void SetSummonTarget(ObjectGuid o) { m_summonTarget = o; } + void FinishRitual(); void AddUniqueUse(Player* player); - void AddUse() { ++m_useTimes; } + void RemoveUniqueUse(Player* player); + bool HasUniqueUser(Player* player); + uint32 GetUniqueUseCount(); + void AddUse() { ++m_useTimes; } uint32 GetUseCount() const { return m_useTimes; } - uint32 GetUniqueUseCount() const { return m_UniqueUsers.size(); } void SaveRespawnTime(); @@ -707,9 +714,6 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject bool IsVisible() const { return m_visible; } void SetVisible(bool b); - // Used for GAMEOBJECT_TYPE_SUMMONING_RITUAL - ObjectGuid getSummonTarget() const { return m_summonTarget; } - void SetSummonTarget(ObjectGuid o) { m_summonTarget = o; } protected: bool m_visible; uint32 m_spellId; @@ -729,6 +733,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject // collected only for GAMEOBJECT_TYPE_SUMMONING_RITUAL ObjectGuid m_firstUser; // first GO user, in most used cases owner, but in some cases no, for example non-summoned multi-use GAMEOBJECT_TYPE_SUMMONING_RITUAL GuidsSet m_UniqueUsers; // all players who use item, some items activated after specific amount unique uses + std::mutex m_UniqueUsers_lock; ObjectGuid m_summonTarget; // The player who is being summoned uint64 m_rotation; diff --git a/src/game/Objects/Unit.cpp b/src/game/Objects/Unit.cpp index 9248cb194..40a599dd0 100644 --- a/src/game/Objects/Unit.cpp +++ b/src/game/Objects/Unit.cpp @@ -4933,8 +4933,9 @@ void Unit::RemoveGameObject(GameObject* gameObj, bool del) RemoveAurasDueToSpell(spellid); SpellEntry const* createBySpell = sSpellMgr.GetSpellEntry(spellid); - // Need activate spell use for owner - if (createBySpell && createBySpell->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE) + // Need activate spell use for owner, for summoning rituals it happens at ritual success + if (createBySpell && createBySpell->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE && + gameObj->GetGoType() != GAMEOBJECT_TYPE_SUMMONING_RITUAL) // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases) CooldownEvent(createBySpell); } diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index 137db62e2..4c471cbfc 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -275,6 +275,7 @@ Spell::Spell(Unit* caster, SpellEntry const *info, bool triggered, ObjectGuid or m_executeStack = 0; m_delayStart = 0; m_delayAtDamageCount = 0; + m_isChannelingVisual = false; m_applyMultiplierMask = 0; @@ -3000,23 +3001,26 @@ void Spell::prepare(Aura* triggeredByAura) if (pPlayerCaster->HasOption(PLAYER_CHEAT_NO_POWER)) m_powerCost = 0; - SpellCastResult result = CheckCast(true); - Unit* pTarget = m_targets.getUnitTarget(); - if (result != SPELL_CAST_OK || (IsAutoRepeat() && m_caster == pTarget)) + if (!IsChannelingVisual()) { - if (!IsAutoRepeat() || !IsAcceptableAutorepeatError(result)) + SpellCastResult result = CheckCast(true); + Unit* pTarget = m_targets.getUnitTarget(); + if (result != SPELL_CAST_OK || (IsAutoRepeat() && m_caster == pTarget)) { - DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Spell %u failed for reason 0x%x (target %u)", m_spellInfo->Id, result, pTarget ? pTarget->GetGUIDLow() : 0); - if (triggeredByAura && !triggeredByAura->GetHolder()->IsPassive()) + if (!IsAutoRepeat() || !IsAcceptableAutorepeatError(result)) { - SendChannelUpdate(0); - triggeredByAura->GetHolder()->SetAuraDuration(0); - } + DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Spell %u failed for reason 0x%x (target %u)", m_spellInfo->Id, result, pTarget ? pTarget->GetGUIDLow() : 0); + if (triggeredByAura && !triggeredByAura->GetHolder()->IsPassive()) + { + SendChannelUpdate(0); + triggeredByAura->GetHolder()->SetAuraDuration(0); + } - SendCastResult(result); - //SendInterrupted(0); - finish(false); - return; + SendCastResult(result); + //SendInterrupted(0); + finish(false); + return; + } } } // Prepare data for triggers @@ -3126,9 +3130,18 @@ void Spell::cancel() SendChannelUpdate(0); SendInterrupted(0); - // spell is canceled-take mods and clear list if (m_caster->GetTypeId() == TYPEID_PLAYER) + { + // spell is canceled-take mods and clear list m_caster->ToPlayer()->RemoveSpellMods(this); + + // summoning rituals, if a user has cancelled inform the go + if (GameObject* go = m_targets.getGOTarget()) + if (go->GetGoType() == GAMEOBJECT_TYPE_SUMMONING_RITUAL && + go->getLootState() != GO_JUST_DEACTIVATED && + go->HasUniqueUser(m_caster->ToPlayer())) + go->RemoveUniqueUse(m_caster->ToPlayer()); + } if (sendInterrupt) SendCastResult(SPELL_FAILED_INTERRUPTED); } @@ -3190,7 +3203,7 @@ void Spell::cast(bool skipCheck) } SpellCastResult castResult = SPELL_CAST_OK; - if (!skipCheck) + if (!skipCheck && !IsChannelingVisual()) { // Nostalrius - compute power cost once again at cast finished // (in case of mana reduction buff proc while casting) @@ -3622,6 +3635,28 @@ void Spell::update(uint32 difftime) cancel(); } + // summoning ritual + if (GameObject* pGo = m_targets.getGOTarget()) + { + if (GameObjectInfo const* pInfo = pGo->GetGOInfo()) + // triggered spell + if (pGo->GetGoType() == GAMEOBJECT_TYPE_SUMMONING_RITUAL && + m_spellInfo->Id == pInfo->summoningRitual.spellId && + // too many helpers cancelled + (pGo->GetUniqueUseCount() < pInfo->summoningRitual.reqParticipants|| + // the warlock cancelled + !pInfo->summoningRitual.ritualPersistent && !pGo->GetOwner())) + { + cancel(); + pGo->SetGoState(GO_STATE_READY); + if (!pInfo->summoningRitual.ritualPersistent) + pGo->Delete(); + } + } + // visual spell and deleted ritual object + else if (IsChannelingVisual()) + cancel(); + switch (m_spellState) { case SPELL_STATE_PREPARING: @@ -3784,10 +3819,20 @@ void Spell::finish(bool ok) m_spellState = SPELL_STATE_FINISHED; - // Nostalrius: unstun du pet si cast de l'invocation interrompu. - if (!ok && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK && m_caster->GetPetGuid()) - if (Pet* pet = ((Player*)m_caster)->GetPet()) - pet->RemoveAurasDueToSpell(29825); + if (!ok && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK) + { + // Nostalrius: unstun du pet si cast de l'invocation interrompu. + if (m_caster->GetPetGuid()) + if (Pet* pet = ((Player*)m_caster)->GetPet()) + pet->RemoveAurasDueToSpell(29825); + + // Fix a client problem with ritual of doom, by itself it disables + // the spell during cast and then the spell stays disabled + // Ignore the spell when it's triggered (ritual helper) + if (m_spellInfo->Id == 18540 && !m_IsTriggeredSpell + && !m_caster->HasSpellCooldown(m_spellInfo->Id)) + m_caster->ToPlayer()->SendClearCooldown(18540, m_caster); + } // Restore pet movement after spell (succubus after seduce) if (CharmInfo* ci = m_caster->GetCharmInfo()) @@ -3863,7 +3908,15 @@ void Spell::finish(bool ok) } if (m_caster->GetTypeId() == TYPEID_PLAYER) + { m_caster->ToPlayer()->RemoveSpellMods(this); + + // summoning ritual triggered spell successfull hit + if (GameObject* pGo = m_targets.getGOTarget()) + if (pGo->GetGoType() == GAMEOBJECT_TYPE_SUMMONING_RITUAL) + if (m_spellInfo->Id == pGo->GetGOInfo()->summoningRitual.spellId) + pGo->FinishRitual(); + } // Stop Attack for some spells if (m_spellInfo->Attributes & SPELL_ATTR_STOP_ATTACK_TARGET) { @@ -4414,7 +4467,7 @@ void Spell::TakeCastItem() void Spell::TakePower() { - if (m_CastItem || m_triggeredByAuraSpell) + if (m_CastItem || m_triggeredByAuraSpell || IsChannelingVisual()) return; // health as power used @@ -4594,6 +4647,10 @@ void Spell::HandleThreatSpells() void Spell::HandleEffects(Unit *pUnitTarget, Item *pItemTarget, GameObject *pGOTarget, SpellEffectIndex i, float DamageMultiplier) { + // a summoning ritual visual has no effect + if (IsChannelingVisual()) + return; + unitTarget = pUnitTarget; itemTarget = pItemTarget; gameObjTarget = pGOTarget; @@ -7129,8 +7186,8 @@ bool Spell::CheckTarget(Unit* target, SpellEffectIndex eff) bool Spell::IsNeedSendToClient() const { - return m_spellInfo->SpellVisual != 0 || IsChanneledSpell(m_spellInfo) || - m_spellInfo->speed > 0.0f || (!m_triggeredByAuraSpell && !m_IsTriggeredSpell); + return !IsChannelingVisual() && (m_spellInfo->SpellVisual != 0 || IsChanneledSpell(m_spellInfo) || + m_spellInfo->speed > 0.0f || (!m_triggeredByAuraSpell && !m_IsTriggeredSpell)); } bool Spell::IsTriggeredSpellWithRedundentData() const diff --git a/src/game/Spells/Spell.h b/src/game/Spells/Spell.h index e7feab1d0..1e528a7ad 100644 --- a/src/game/Spells/Spell.h +++ b/src/game/Spells/Spell.h @@ -481,6 +481,10 @@ class Spell // Stryg uint8 GetTargetNum() const { return m_targetNum; } + + // For summoning ritual helpers visual spell + void SetChannelingVisual(bool value) { m_isChannelingVisual = value; } + bool IsChannelingVisual() const { return m_isChannelingVisual; } protected: bool HasGlobalCooldown() const; void TriggerGlobalCooldown(); @@ -507,6 +511,8 @@ class Spell bool m_autoRepeat; bool m_delayed; bool m_successCast; + bool m_isChannelingVisual; // For summoning ritual helpers visual spell + // no effect handled, only channel start/update is sent uint8 m_delayAtDamageCount; int32 GetNextDelayAtDamageMsTime() { return m_delayAtDamageCount < 5 ? 1000 - (m_delayAtDamageCount++)* 200 : 200; } diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index 3df042b56..320cae19b 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -4775,7 +4775,13 @@ void Spell::EffectSummonPlayer(SpellEffectIndex /*eff_idx*/) return; float x, y, z; - m_caster->GetClosePoint(x, y, z, unitTarget->GetObjectBoundingRadius()); + WorldObject* landingObject = m_caster; + // summon to the ritual go location if any + if (GameObject* pGo = m_targets.getGOTarget()) + if (pGo->GetGoType() == GAMEOBJECT_TYPE_SUMMONING_RITUAL) + landingObject = pGo; + + landingObject->GetClosePoint(x, y, z, unitTarget->GetObjectBoundingRadius()); ((Player*)unitTarget)->SetSummonPoint(m_caster->GetMapId(), x, y, z); @@ -5651,11 +5657,16 @@ void Spell::EffectTransmitted(SpellEffectIndex eff_idx) if (m_caster->GetTypeId() == TYPEID_PLAYER) { // Set the summoning target - if (m_caster->GetTypeId() == TYPEID_PLAYER && ((Player*)m_caster)->GetSelectionGuid()) - pGameObj->SetSummonTarget(((Player*)m_caster)->GetSelectionGuid()); + if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->GetSelectionGuid()) + pGameObj->SetSummonTarget(m_caster->ToPlayer()->GetSelectionGuid()); - pGameObj->AddUniqueUse((Player*)m_caster); - m_caster->AddGameObject(pGameObj); // will removed at spell cancel + // will be removed at Spell::Cancel or GameObject::RemoveUniqueUse if activated + m_caster->AddGameObject(pGameObj); + + // the caster becomes a go user too + pGameObj->AddUniqueUse(m_caster->ToPlayer()); + m_targets.setGOTarget(pGameObj); + SetChannelingVisual(true); } break; } @@ -5699,6 +5710,11 @@ void Spell::EffectSummonDemon(SpellEffectIndex eff_idx) float py = m_targets.m_destY; float pz = m_targets.m_destZ; + // summon to the ritual object location if any + if (GameObject* pGo = m_targets.getGOTarget()) + if (pGo->GetGoType() == GAMEOBJECT_TYPE_SUMMONING_RITUAL) + pGo->GetPosition(px, py, pz); + Creature* Charmed = m_caster->SummonCreature(m_spellInfo->EffectMiscValue[eff_idx], px, py, pz, m_caster->GetOrientation(), TEMPSUMMON_TIMED_COMBAT_OR_DEAD_DESPAWN, 3600000); if (!Charmed) return; diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/blackrock_spire.h b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/blackrock_spire.h index 0f4a2c369..94d0aca2c 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/blackrock_spire.h +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/blackrock_spire.h @@ -42,6 +42,7 @@ enum GO_GYTH_COMBAT_DOOR = 175185, // control in boss_script, because will auto-close after each wave GO_GYTH_EXIT_DOOR = 175186, + GO_BLACKROCK_ALTAR = 175706, GO_ROOM_7_RUNE = 175194, GO_ROOM_3_RUNE = 175195, @@ -137,6 +138,8 @@ class instance_blackrock_spire : public ScriptedInstance uint64 m_uiEmberseerRune06GUID; uint64 m_uiEmberseerRune07GUID; + uint64 m_uiBlackRockAltarGUID; + uint32 m_uiUBRSDoor_Timer; uint32 m_uiUBRSDoor_Step; diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_pyroguard_emberseer.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_pyroguard_emberseer.cpp index 2aa15b69a..87e538547 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_pyroguard_emberseer.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_pyroguard_emberseer.cpp @@ -60,6 +60,8 @@ struct boss_pyroguard_emberseerAI : public ScriptedAI uint32 m_uiFlameBuffetTimer; uint32 m_uiPyroBlastTimer; + std::set sSummoners; + // NOSTALRIUS bool initialized; bool bCanalisationEnCours; @@ -93,6 +95,8 @@ struct boss_pyroguard_emberseerAI : public ScriptedAI // Tous doivent etre en vie au debut de l'event. RespawnAddWarlocks(); + if (!m_creature->HasAura(SPELL_SELF_CAGE)) + m_creature->CastSpell(m_creature, SPELL_SELF_CAGE, false); return true; } @@ -107,49 +111,51 @@ struct boss_pyroguard_emberseerAI : public ScriptedAI return true; } - void RefreshCanalisation(uint32 const diff) + void RefreshCanalisation() { if (!m_pInstance) return; - std::vector::iterator it; - if (!m_creature->HasAura(SPELL_SELF_CAGE)) - m_creature->CastSpell(m_creature, SPELL_SELF_CAGE, false); - // Verification si la canalisation a commence - uint32 playerSummonersCount = 0; - uint32 requiredSummoners = REQUIRED_SUMMONERS; - Player* pSummoners[REQUIRED_SUMMONERS] = {NULL}; + std::set::iterator it; + GameObject* pGo = m_creature->GetMap()->GetGameObject(m_pInstance->GetData64(GO_BLACKROCK_ALTAR)); Map::PlayerList const &pl = m_creature->GetMap()->GetPlayers(); for (Map::PlayerList::const_iterator it2 = pl.begin(); it2 != pl.end(); ++it2) { Player* currPlayer = it2->getSource(); - if (currPlayer && currPlayer->HasAura(AURA_PLAYER_CANALISATION)) + if (currPlayer) { - pSummoners[playerSummonersCount] = currPlayer; - if (currPlayer->isGameMaster()) // Debug mode - requiredSummoners = 1; - playerSummonersCount++; - if (playerSummonersCount >= requiredSummoners) - break; + it = sSummoners.find(currPlayer); + bool isUsing = pGo->HasUniqueUser(currPlayer); + if (isUsing && it == sSummoners.end()) + sSummoners.insert(currPlayer); + else if (!isUsing && it != sSummoners.end()) + sSummoners.erase(currPlayer); } } + } - if (playerSummonersCount >= requiredSummoners) + void StartWarlocksCombat() + { + std::set::const_iterator itSummoners; + + // Le combat avec les adds commence + m_pInstance->SetData(TYPE_EMBERSEER, SPECIAL); + for (auto it = canaliseurs.begin(); it != canaliseurs.end(); ++it) { - // Le combat avec les adds commence - m_pInstance->SetData(TYPE_EMBERSEER, SPECIAL); - for (it = canaliseurs.begin(); it != canaliseurs.end(); ++it) + Creature *currCanaliseur = m_creature->GetMap()->GetCreature(*it); + if (!currCanaliseur) + continue; + currCanaliseur->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PASSIVE); + currCanaliseur->InterruptNonMeleeSpells(false); + if (currCanaliseur->AI()) { - Creature *currCanaliseur = m_creature->GetMap()->GetCreature(*it); - if (!currCanaliseur) - continue; - currCanaliseur->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PASSIVE); - currCanaliseur->InterruptNonMeleeSpells(false); - if (currCanaliseur->AI()) - currCanaliseur->AI()->AttackStart(pSummoners[urand(0, requiredSummoners - 1)]); + itSummoners = sSummoners.begin(); + if (itSummoners != sSummoners.end()) + std::advance(itSummoners, urand(0, sSummoners.size() - 1)); + currCanaliseur->AI()->AttackStart(*itSummoners); } - bCanalisationEnCours = false; - bBossEnferme = true; } + bCanalisationEnCours = false; + bBossEnferme = true; } void EventBossLiberation() @@ -237,6 +243,8 @@ struct boss_pyroguard_emberseerAI : public ScriptedAI m_pInstance->SetData(TYPE_EMBERSEER, FAIL); RespawnAddWarlocks(); bCanalisationEnCours = true; + if (!m_creature->HasAura(SPELL_SELF_CAGE)) + m_creature->CastSpell(m_creature, SPELL_SELF_CAGE, false); } void UpdateAI(const uint32 uiDiff) @@ -251,7 +259,7 @@ struct boss_pyroguard_emberseerAI : public ScriptedAI // Return since we have no target if (bCanalisationEnCours) { - RefreshCanalisation(uiDiff); + RefreshCanalisation(); return; } if (bBossEnferme) @@ -300,6 +308,18 @@ struct boss_pyroguard_emberseerAI : public ScriptedAI } }; +// Return true to avoid db script attempt +bool ProcessEventId_event_free_pyroguard_emberseer(uint32 eventId, Object* source, Object* target, bool isStart) +{ + if (!source || source->GetTypeId() != TYPEID_PLAYER) + return true; + if (ScriptedInstance* instance = (ScriptedInstance*)((Player*)source)->GetInstanceData()) + if (Creature* pyroguardEmberseer = source->ToPlayer()->GetMap()->GetCreature(instance->GetData64(NPC_PYROGUARD_EMBERSEER))) + if (boss_pyroguard_emberseerAI* bossAI = dynamic_cast(pyroguardEmberseer->AI())) + bossAI->StartWarlocksCombat(); + return true; +} + CreatureAI* GetAI_boss_pyroguard_emberseer(Creature* pCreature) { return new boss_pyroguard_emberseerAI(pCreature); @@ -410,4 +430,9 @@ void AddSC_boss_pyroguard_emberseer() pNewScript->Name = "npc_geolier_main_noire"; pNewScript->GetAI = &GetAI_npc_geolier_main_noire; pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "event_free_pyroguard_emberseer"; + pNewScript->pProcessEventId = &ProcessEventId_event_free_pyroguard_emberseer; + pNewScript->RegisterSelf(); } diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/instance_blackrock_spire.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/instance_blackrock_spire.cpp index fa215f1b2..b8851fd5f 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/instance_blackrock_spire.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/instance_blackrock_spire.cpp @@ -82,6 +82,8 @@ instance_blackrock_spire::instance_blackrock_spire(Map* pMap) : ScriptedInstance m_uiEmberseerRune06GUID(0), m_uiEmberseerRune07GUID(0), + m_uiBlackRockAltarGUID(0), + m_uiUBRSDoor_Timer(0), m_uiUBRSDoor_Step(0), @@ -104,6 +106,9 @@ void instance_blackrock_spire::OnObjectCreate(GameObject* pGo) { switch (pGo->GetEntry()) { + case GO_BLACKROCK_ALTAR: + m_uiBlackRockAltarGUID = pGo->GetGUID(); + break; case GO_EMBERSEER_IN: m_uiEmberseerInDoorGUID = pGo->GetGUID(); if (GetData(TYPE_ROOM_EVENT) == DONE) @@ -225,7 +230,7 @@ void instance_blackrock_spire::OnCreatureCreate(Creature* pCreature) switch (pCreature->GetEntry()) { case NPC_PYROGUARD_EMBERSEER: - m_uiEmberseerGUID = pCreature->GetEntry(); + m_uiEmberseerGUID = pCreature->GetGUID(); break; case NPC_LORD_VICTOR_NEFARIUS: m_uiNefariusGUID = pCreature->GetGUID(); @@ -494,6 +499,8 @@ uint64 instance_blackrock_spire::GetData64(uint32 uiType) { switch (uiType) { + case GO_BLACKROCK_ALTAR: + return m_uiBlackRockAltarGUID; case NPC_PYROGUARD_EMBERSEER: return m_uiEmberseerGUID; case NPC_LORD_VICTOR_NEFARIUS: diff --git a/src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp b/src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp index 53ba82016..19145c858 100644 --- a/src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp +++ b/src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp @@ -45,6 +45,16 @@ EndScriptData */ #define SAY_KILL "Reckless mortal." #define SOUND_KILL 5858 +// Return true to avoid db script attempt +bool ProcessEventId_event_awaken_archaedas(uint32 eventId, Object* source, Object* target, bool isStart) +{ + if (!source || source->GetTypeId() != TYPEID_PLAYER) + return true; + ScriptedInstance* instance = (ScriptedInstance*)((Player*)source)->GetInstanceData(); + instance->SetData(ULDAMAN_ENCOUNTER_ARCHAEDAS, IN_PROGRESS); + return true; +} + struct boss_archaedasAI : public ScriptedAI { boss_archaedasAI(Creature* pCreature) : ScriptedAI(pCreature) @@ -399,122 +409,6 @@ CreatureAI* GetAI_mob_archaedas_minions(Creature* creature) return new mob_archaedas_minionsAI(creature); } -/* ScriptData -SDName: go_altar_archaedas -SD%Complete: 100 -SDComment: Needs 1 person to activate the Archaedas script -SDCategory: Uldaman -EndScriptData */ - - -bool GOHello_go_altar_of_archaedas(Player* pPlayer, GameObject* pGo) -{ - ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); - - if (!pInstance) - return false; - - if (pPlayer) - pPlayer->CastSpell(nullptr, SPELL_ALTAR_SUMMONING_VISUAL, true); - - return true; -} - -struct go_altar_of_archaedasAI : public GameObjectAI -{ - go_altar_of_archaedasAI(GameObject* gobj) : GameObjectAI(gobj) - { - instance = (ScriptedInstance*)gobj->GetInstanceData(); - _gobjGuid = gobj->GetGUID(); - _gobjType = gobj->GetGoType(); - _gobj = gobj; - Reset(); - } - - ScriptedInstance* instance; - - GameObject* _gobj; - uint64 _gobjGuid; - uint32 _gobjType; - - bool _eventStarted; - uint32 _summonTimer; - - void Reset() - { - _eventStarted = false; - _summonTimer = TIMER_ALTAR_SUMMON; - instance->SetData(DATA_ARCHAEDAS_ALTAR, NOT_STARTED); - } - - uint32 CountSummoners() - { - const Map::PlayerList& players = me->GetMap()->GetPlayers(); - uint32 count = 0; - for (auto it = players.begin(); it != players.end(); ++it) - { - if (Player* player = it->getSource()) - { - if (Spell* spell = player->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) - { - if (spell->m_spellInfo->Id == SPELL_ALTAR_SUMMONING_VISUAL) - { - if (_gobj->GetDistance2d(player) <= INTERACTION_DISTANCE) - { - ++count; - } - } - } - } - } - return count; - } - - void UpdateAI(const uint32 diff) - { - if (!instance || - instance->GetData(ULDAMAN_ENCOUNTER_STONE_KEEPERS) != DONE || - instance->GetData(ULDAMAN_ENCOUNTER_ARCHAEDAS) == DONE || - instance->GetData(ULDAMAN_ENCOUNTER_ARCHAEDAS) == IN_PROGRESS) - { - return; - } - if (!_eventStarted) - { - if (CountSummoners() >= NEEDED_SUMMONERS) - { - instance->SetData(DATA_ARCHAEDAS_ALTAR, IN_PROGRESS); // activate the altar - instance->SetData(DATA_ANCIENT_DOOR, IN_PROGRESS); // close the vault door - _eventStarted = true; - } - return; - } - else if (CountSummoners() >= NEEDED_SUMMONERS) - { - if (_summonTimer <= diff) - { - Reset(); - instance->SetData(ULDAMAN_ENCOUNTER_ARCHAEDAS, IN_PROGRESS); // activate archaedas - } - else - { - _summonTimer -= diff; - } - } - else - { - Reset(); - if (instance->GetData(ULDAMAN_ENCOUNTER_ARCHAEDAS) != IN_PROGRESS) - instance->SetData(DATA_ANCIENT_DOOR, FAIL); // open the vault door - } - } -}; - -GameObjectAI* GetAI_go_altar_of_archaedas(GameObject* go) -{ - return new go_altar_of_archaedasAI(go); -} - //This is the actual function called only once during InitScripts() //It must define all handled functions that are to be run in this script void AddSC_boss_archaedas() @@ -532,8 +426,7 @@ void AddSC_boss_archaedas() newscript->RegisterSelf(); newscript = new Script; - newscript->Name = "go_altar_of_archaedas"; - newscript->GOGetAI = &GetAI_go_altar_of_archaedas; - newscript->pGOHello = &GOHello_go_altar_of_archaedas; + newscript->Name = "event_awaken_archaedas"; + newscript->pProcessEventId = &ProcessEventId_event_awaken_archaedas; newscript->RegisterSelf(); } diff --git a/src/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp b/src/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp index 6bf8bd213..a8c1f9051 100644 --- a/src/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp +++ b/src/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp @@ -412,6 +412,8 @@ struct instance_uldaman : public ScriptedInstance { if (m_auiEncounter[ULDAMAN_ENCOUNTER_ARCHAEDAS] != IN_PROGRESS) { + if (m_auiEncounter[ULDAMAN_ENCOUNTER_ARCHAEDAS] != DONE) + SetData(DATA_ANCIENT_DOOR, IN_PROGRESS); if (archaedas) { if (archaedas->isAlive() && archaedas->getFaction() != FACTION_AWAKE) diff --git a/src/scripts/eastern_kingdoms/uldaman/uldaman.cpp b/src/scripts/eastern_kingdoms/uldaman/uldaman.cpp index f06072fa2..4674dab43 100644 --- a/src/scripts/eastern_kingdoms/uldaman/uldaman.cpp +++ b/src/scripts/eastern_kingdoms/uldaman/uldaman.cpp @@ -52,6 +52,16 @@ bool GOHello_go_keystone_chamber(Player* pPlayer, GameObject* pGo) return false; } +// Return true to avoid db script attempt +bool ProcessEventId_event_awaken_stone_keeper(uint32 eventId, Object* source, Object* target, bool isStart) +{ + if (!source || source->GetTypeId() != TYPEID_PLAYER) + return true; + ScriptedInstance* instance = (ScriptedInstance*)((Player*)source)->GetInstanceData(); + instance->SetData(ULDAMAN_ENCOUNTER_STONE_KEEPERS, IN_PROGRESS); + return true; +} + struct mob_stone_keeperAI : public ScriptedAI { mob_stone_keeperAI(Creature* pCreature) : ScriptedAI(pCreature) @@ -272,99 +282,6 @@ bool OnTrigger_at_map_chamber(Player* pPlayer, const AreaTriggerEntry *at) return true; } -bool GOHello_go_altar_of_the_keepers(Player* pPlayer, GameObject* pGo) -{ - ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); - - if (!pInstance) - return false; - - if (pPlayer) - pPlayer->CastSpell(nullptr, SPELL_ALTAR_SUMMONING_VISUAL, true); - - return true; -} - -struct go_altar_of_the_keepersAI : public GameObjectAI -{ - go_altar_of_the_keepersAI(GameObject* gobj) : GameObjectAI(gobj) - { - instance = (ScriptedInstance*)gobj->GetInstanceData(); - Reset(); - } - - ScriptedInstance* instance; - - bool _eventStarted; - uint32 _summonTimer; - void Reset() - { - _eventStarted = false; - _summonTimer = TIMER_ALTAR_SUMMON; - instance->SetData(DATA_KEEPERS_ALTAR, NOT_STARTED); - } - - uint32 CountSummoners() - { - const Map::PlayerList& players = me->GetMap()->GetPlayers(); - uint32 count = 0; - for (auto it = players.begin(); it != players.end(); ++it) - { - if (Player* player = it->getSource()) - { - if (Spell* spell = player->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) - { - if (spell->m_spellInfo->Id == SPELL_ALTAR_SUMMONING_VISUAL) - { - ++count; - } - } - } - } - return count; - } - - void UpdateAI(const uint32 diff) - { - if (!instance || - instance->GetData(ULDAMAN_ENCOUNTER_STONE_KEEPERS) == DONE || - instance->GetData(ULDAMAN_ENCOUNTER_STONE_KEEPERS) == IN_PROGRESS) - { - return; - } - if (!_eventStarted) - { - if (CountSummoners() >= NEEDED_SUMMONERS) - { - instance->SetData(DATA_KEEPERS_ALTAR, IN_PROGRESS); // activate the altar - _eventStarted = true; - } - return; - } - else if (CountSummoners() >= NEEDED_SUMMONERS) - { - if (_summonTimer <= diff) - { - Reset(); - instance->SetData(ULDAMAN_ENCOUNTER_STONE_KEEPERS, IN_PROGRESS); - } - else - { - _summonTimer -= diff; - } - } - else - { - Reset(); - } - } -}; - -GameObjectAI* GetAI_go_altar_of_the_keepers(GameObject* go) -{ - return new go_altar_of_the_keepersAI(go); -} - struct AnnoraAI : public ScriptedAI { AnnoraAI(Creature* pCreature) : ScriptedAI(pCreature) @@ -524,9 +441,8 @@ void AddSC_uldaman() newscript->RegisterSelf(); newscript = new Script; - newscript->Name = "go_altar_of_the_keepers"; - newscript->GOGetAI = &GetAI_go_altar_of_the_keepers; - newscript->pGOHello = &GOHello_go_altar_of_the_keepers; + newscript->Name = "event_awaken_stone_keeper"; + newscript->pProcessEventId = &ProcessEventId_event_awaken_stone_keeper; newscript->RegisterSelf(); newscript = new Script; diff --git a/src/scripts/eastern_kingdoms/uldaman/uldaman.h b/src/scripts/eastern_kingdoms/uldaman/uldaman.h index 17fc964f0..bf37460d1 100644 --- a/src/scripts/eastern_kingdoms/uldaman/uldaman.h +++ b/src/scripts/eastern_kingdoms/uldaman/uldaman.h @@ -33,9 +33,6 @@ enum DATA_ANCIENT_DOOR = 11, DATA_ARCHAEDAS_ALTAR = 12, - // Altar summoning ritual - TIMER_ALTAR_SUMMON = 5000, // "Uldaman Boss Aggro" spellid=10340 has 5s cast - NEEDED_SUMMONERS = 3, // 3 in vanilla, 1 since 3.0.8 FACTION_AWAKE = 14, // aggressive FACTION_STONED = 35, // friendly @@ -67,10 +64,9 @@ enum SPELL_ARCHAEDAS_AWAKEN = 10347, SPELL_AWAKEN_EARTHEN_GUARDIAN = 10252, SPELL_AWAKEN_VAULT_WARDER = 10258, - /* Not used here, supposed cast from altars summoning ritual objects - TODO when summoning rituals GO will work. - SPELL_ULDMANA_BOSS_AGGRO = 10340, - SPELL_ULDMANA_SUB_BOSS_AGGRO = 11568,*/ + /* spells cast from summoning ritual altars, send scripted_event_id events + SPELL_ULDMAN_SUB_BOSS_AGGRO = 11568, event 2228 event_awaken_stone_keeper + SPELL_ULDMAN_BOSS_AGGRO = 10340, event 2268 event_awaken_archaedas*/ // Earthen Custodians SPELL_RECONSTRUCT = 10260, // Ironaya