diff options
Diffstat (limited to 'src')
136 files changed, 10646 insertions, 5468 deletions
diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 6d295a0bbee..e1d77c60286 100755 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -16,6 +16,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <algorithm> #include <openssl/md5.h> #include "Common.h" @@ -343,6 +344,13 @@ bool AuthSocket::_HandleLogonChallenge() _login = (const char*)ch->I; _build = ch->build; _expversion = (AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : NO_VALID_EXP_FLAG) | (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG); + _os = (const char*)ch->os; + + if (_os.size() > 4) + return false; + + // Restore string order as its byte order is reversed + std::reverse(_os.begin(), _os.end()); pkt << (uint8)AUTH_LOGON_CHALLENGE; pkt << (uint8)0x00; @@ -602,7 +610,8 @@ bool AuthSocket::_HandleLogonProof() stmt->setString(0, K_hex); stmt->setString(1, socket().getRemoteAddress().c_str()); stmt->setUInt32(2, GetLocaleByName(_localizationName)); - stmt->setString(3, _login); + stmt->setString(3, _os); + stmt->setString(4, _login); LoginDatabase.Execute(stmt); OPENSSL_free((void*)K_hex); @@ -741,6 +750,13 @@ bool AuthSocket::_HandleReconnectChallenge() // Reinitialize build, expansion and the account securitylevel _build = ch->build; _expversion = (AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : NO_VALID_EXP_FLAG) | (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG); + _os = (const char*)ch->os; + + if (_os.size() > 4) + return false; + + // Restore string order as its byte order is reversed + std::reverse(_os.begin(), _os.end()); Field* fields = result->Fetch(); uint8 secLevel = fields[2].GetUInt8(); diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h index 490b0db2149..9d59a9f7602 100755 --- a/src/server/authserver/Server/AuthSocket.h +++ b/src/server/authserver/Server/AuthSocket.h @@ -81,6 +81,7 @@ private: // Since GetLocaleByName() is _NOT_ bijective, we have to store the locale as a string. Otherwise we can't differ // between enUS and enGB, which is important for the patch system std::string _localizationName; + std::string _os; uint16 _build; uint8 _expversion; AccountTypes _accountSecurityLevel; diff --git a/src/server/collision/DynamicTree.h b/src/server/collision/DynamicTree.h index 0b4f5908c04..079c0adbf5e 100644 --- a/src/server/collision/DynamicTree.h +++ b/src/server/collision/DynamicTree.h @@ -16,7 +16,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ - + #ifndef _DYNTREE_H #define _DYNTREE_H diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp index cfd50c318df..68ea3ec80cd 100644 --- a/src/server/collision/Maps/TileAssembler.cpp +++ b/src/server/collision/Maps/TileAssembler.cpp @@ -258,7 +258,7 @@ namespace VMAP uint32 groups = raw_model.groupsArray.size(); if (groups != 1) printf("Warning: '%s' does not seem to be a M2 model!\n", modelFilename.c_str()); - + AABox modelBound; bool boundEmpty=true; @@ -308,7 +308,7 @@ namespace VMAP WorldModel_Raw raw_model; if (!raw_model.Read(filename.c_str())) return false; - + // write WorldModel WorldModel model; model.setRootWmoID(raw_model.RootWMOID); @@ -327,12 +327,12 @@ namespace VMAP model.setGroupModels(groupsArray); } - + success = model.writeFile(iDestDir + "/" + pModelFilename + ".vmo"); //std::cout << "readRawFile2: '" << pModelFilename << "' tris: " << nElements << " nodes: " << nNodes << std::endl; return success; } - + void TileAssembler::exportGameobjectModels() { FILE* model_list = fopen((iSrcDir + "/" + GAMEOBJECT_MODELS).c_str(), "rb"); @@ -405,13 +405,13 @@ namespace VMAP READ_OR_RETURN(&mogpflags, sizeof(uint32)); READ_OR_RETURN(&GroupWMOID, sizeof(uint32)); - + Vector3 vec1, vec2; READ_OR_RETURN(&vec1, sizeof(Vector3)); READ_OR_RETURN(&vec2, sizeof(Vector3)); bounds.set(vec1, vec2); - + READ_OR_RETURN(&liquidflags, sizeof(uint32)); // will this ever be used? what is it good for anyway?? @@ -475,7 +475,7 @@ namespace VMAP size = hlq.xtiles*hlq.ytiles; READ_OR_RETURN(liquid->GetFlagsStorage(), size); } - + return true; } @@ -484,7 +484,7 @@ namespace VMAP { delete liquid; } - + bool WorldModel_Raw::Read(const char * path) { FILE* rf = fopen(path, "rb"); @@ -493,7 +493,7 @@ namespace VMAP printf("ERROR: Can't open raw model file: %s\n", path); return false; } - + char ident[8]; int readOperation = 0; diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index 4c0a344f868..1abbc59a5b0 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ - + #include "VMapFactory.h" #include "VMapManager2.h" #include "VMapDefinitions.h" diff --git a/src/server/collision/Models/GameObjectModel.h b/src/server/collision/Models/GameObjectModel.h index 413061c0de0..0bb6c0f47bc 100644 --- a/src/server/collision/Models/GameObjectModel.h +++ b/src/server/collision/Models/GameObjectModel.h @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ - + #ifndef _GAMEOBJECT_MODEL_H #define _GAMEOBJECT_MODEL_H @@ -57,7 +57,7 @@ public: const G3D::Vector3& getPosition() const { return iPos;} - /** Enables\disables collision. */ + /** Enables\disables collision. */ void disable() { phasemask = 0;} void enable(uint32 ph_mask) { phasemask = ph_mask;} diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp index b49538a485d..cda34510058 100644 --- a/src/server/collision/Models/WorldModel.cpp +++ b/src/server/collision/Models/WorldModel.cpp @@ -17,6 +17,7 @@ */ #include "WorldModel.h" +#include "ModelInstance.h" #include "VMapDefinitions.h" #include "MapTree.h" diff --git a/src/server/collision/RegularGrid.h b/src/server/collision/RegularGrid.h index 2c11b1c257d..2867b29cfc1 100644 --- a/src/server/collision/RegularGrid.h +++ b/src/server/collision/RegularGrid.h @@ -135,7 +135,7 @@ public: float ky_inv = ray.invDirection().y, by = ray.origin().y; int stepX, stepY; - float tMaxX, tMaxY; + float tMaxX, tMaxY; if (kx_inv >= 0) { stepX = 1; @@ -215,4 +215,4 @@ public: #undef CELL_SIZE #undef HGRID_MAP_SIZE -#endif +#endif diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 07a8e3fdca7..7838e6891fe 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -450,7 +450,7 @@ void SmartAI::EnterEvadeMode() return; RemoveAuras(); - + me->DeleteThreatList(); me->CombatStop(true); me->LoadCreaturesAddon(); @@ -480,15 +480,15 @@ void SmartAI::MoveInLineOfSight(Unit* who) { if (!who) return; - + GetScript()->OnMoveInLineOfSight(who); - + if (me->HasReactState(REACT_PASSIVE) || AssistPlayerInCombat(who)) return; if (!CanAIAttack(who)) return; - + if (!me->canStartAttack(who, false)) return; @@ -827,7 +827,7 @@ void SmartAI::SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker) GetScript()->mLastInvoker = invoker->GetGUID(); GetScript()->SetScript9(e, entry); } - + void SmartAI::sOnGameEvent(bool start, uint16 eventId) { GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId); diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index a40254fe384..e82b35ec87a 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -195,7 +195,7 @@ class SmartAI : public CreatureAI mDespawnState = t ? 1 : 0; } void StartDespawn() { mDespawnState = 2; } - + void RemoveAuras(); private: diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index c716741371e..67d26ea06dd 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -88,7 +88,7 @@ void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint3 ConditionList conds = sConditionMgr->GetConditionsForSmartEvent((*i).entryOrGuid, (*i).event_id, (*i).source_type); ConditionSourceInfo info = ConditionSourceInfo(unit, GetBaseObject()); meets = sConditionMgr->IsObjectMeetToConditions(info, conds); - + if (meets) ProcessEvent(*i, unit, var0, var1, bvar, spell, gob); } @@ -479,7 +479,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) me->InterruptNonMeleeSpells(false); - me->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false); + if (!(e.action.cast.flags & SMARTCAST_AURA_NOT_PRESENT) || !(*itr)->ToUnit()->HasAura(e.action.cast.spell)) + me->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false); + else + sLog->outDebug(LOG_FILTER_DATABASE_AI, "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId())); sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_CAST:: Creature %u casts spell %u on target %u with castflags %u", me->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags); } @@ -505,7 +508,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) tempLastInvoker->InterruptNonMeleeSpells(false); - tempLastInvoker->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false); + if (!(e.action.cast.flags & SMARTCAST_AURA_NOT_PRESENT) || !(*itr)->ToUnit()->HasAura(e.action.cast.spell)) + tempLastInvoker->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false); + else + sLog->outDebug(LOG_FILTER_DATABASE_AI, "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId())); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker %u casts spell %u on target %u with castflags %u", tempLastInvoker->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags); } @@ -1563,8 +1570,15 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToUnit()->InterruptNonMeleeSpells(false); for (ObjectList::const_iterator it = targets->begin(); it != targets->end(); ++it) + { if (IsUnit(*it)) - (*itr)->ToUnit()->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false); + { + if (!(e.action.cast.flags & SMARTCAST_AURA_NOT_PRESENT) || !(*it)->ToUnit()->HasAura(e.action.cast.spell)) + (*itr)->ToUnit()->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false); + else + sLog->outDebug(LOG_FILTER_DATABASE_AI, "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*it)->GetGUID(), (*it)->GetEntry(), uint32((*it)->GetTypeId())); + } + } } } diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 9a23d9e1390..f99e317454c 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -260,7 +260,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e) } case SMART_TARGET_GAMEOBJECT_GUID: { - if (e.target.goGUID.entry && !IsGameObjectValid(e, e.target.goGUID.entry)) + if (e.target.goGUID.entry && !IsGameObjectValid(e, e.target.goGUID.entry)) return false; break; } diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index e08fe331d3d..0d182e1beb3 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -154,7 +154,7 @@ enum SMART_EVENT SMART_EVENT_IS_BEHIND_TARGET = 67, //1 // cooldownMin, CooldownMax SMART_EVENT_GAME_EVENT_START = 68, //1 // game_event.Entry SMART_EVENT_GAME_EVENT_END = 69, //1 // game_event.Entry - SMART_EVENT_GO_STATE_CHANGED = 70, // go state + SMART_EVENT_GO_STATE_CHANGED = 70, // go state SMART_EVENT_END = 71, }; @@ -341,16 +341,16 @@ struct SmartEvent uint32 cooldownMax; } behindTarget; - struct + struct { uint32 gameEventId; } gameEvent; - + struct { uint32 state; } goStateChanged; - + struct { uint32 param1; @@ -872,7 +872,7 @@ struct SmartAction { uint32 goRespawnTime; } RespawnTarget; - + struct { uint32 gossipMenuId; @@ -883,12 +883,12 @@ struct SmartAction { uint32 state; } setGoLootState; - + struct { uint32 id; } sendTargetToTarget; - + struct { uint32 param1; @@ -1180,7 +1180,7 @@ enum SmartCastFlags //CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range //CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range //CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself - //CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell + SMARTCAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell }; // one line in DB is one event diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp index 3c3d5e1655b..98bb704661e 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -102,7 +102,7 @@ void BattlegroundRV::StartingEventOpenDoors() setState(BG_RV_STATE_OPEN_FENCES); setTimer(BG_RV_FIRST_TIMER); - + TogglePillarCollision(true); } @@ -239,11 +239,11 @@ void BattlegroundRV::TogglePillarCollision(bool apply) if (gob->GetGOInfo()->door.startOpen) _state = GO_STATE_ACTIVE; gob->SetGoState(apply ? (GOState)_state : (GOState)(!_state)); - + if (gob->GetGOInfo()->door.startOpen) gob->EnableCollision(!apply); // Forced collision toggle } - + for (BattlegroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER))) gob->SendUpdateToPlayer(player); diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt index cf24c923655..1f680f6e9b0 100644 --- a/src/server/game/CMakeLists.txt +++ b/src/server/game/CMakeLists.txt @@ -48,6 +48,7 @@ file(GLOB_RECURSE sources_Spells Spells/*.cpp Spells/*.h) file(GLOB_RECURSE sources_Texts Texts/*.cpp Texts/*.h) file(GLOB_RECURSE sources_Tools Tools/*.cpp Tools/*.h) file(GLOB_RECURSE sources_Tickets Tickets/*.cpp Tickets/*.h) +file(GLOB_RECURSE sources_Warden Warden/*.cpp Warden/*.h) file(GLOB_RECURSE sources_Weather Weather/*.cpp Weather/*.h) file(GLOB_RECURSE sources_World World/*.cpp World/*.h) @@ -98,6 +99,7 @@ set(game_STAT_SRCS ${sources_Texts} ${sources_Tools} ${sources_Tickets} + ${sources_Warden} ${sources_Weather} ${sources_World} ) @@ -191,6 +193,8 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/Texts ${CMAKE_CURRENT_SOURCE_DIR}/Tools ${CMAKE_CURRENT_SOURCE_DIR}/Tickets + ${CMAKE_CURRENT_SOURCE_DIR}/Warden + ${CMAKE_CURRENT_SOURCE_DIR}/Warden/Modules ${CMAKE_CURRENT_SOURCE_DIR}/Weather ${CMAKE_CURRENT_SOURCE_DIR}/World ${CMAKE_SOURCE_DIR}/src/server/scripts/PrecompiledHeaders diff --git a/src/server/game/Chat/Commands/TicketCommands.cpp b/src/server/game/Chat/Commands/TicketCommands.cpp index 138466f9623..177899efbf0 100755 --- a/src/server/game/Chat/Commands/TicketCommands.cpp +++ b/src/server/game/Chat/Commands/TicketCommands.cpp @@ -257,7 +257,7 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args) ticket->SaveToDB(trans); sTicketMgr->UpdateLastChange(); - std::string msg = ticket->FormatMessageString(*this, NULL, ticket->GetAssignedToName().c_str(), + std::string msg = ticket->FormatMessageString(*this, NULL, ticket->GetAssignedToName().c_str(), m_session ? m_session->GetPlayer()->GetName() : "Console", NULL); SendGlobalGMSysMessage(msg.c_str()); return true; diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 320a02a30ed..7d21f94f372 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -26,6 +26,7 @@ #include "ConditionMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "Spell.h" // Checks if object meets the condition // Can have CONDITION_SOURCE_TYPE_NONE && !mReferenceId if called from a special event (ie: eventAI) @@ -94,14 +95,14 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) } case CONDITION_CLASS: { - if (Player* player = object->ToPlayer()) - condMeets = player->getClassMask() & ConditionValue1; + if (Unit* unit = object->ToUnit()) + condMeets = unit->getClassMask() & ConditionValue1; break; } case CONDITION_RACE: { - if (Player* player = object->ToPlayer()) - condMeets = player->getRaceMask() & ConditionValue1; + if (Unit* unit = object->ToUnit()) + condMeets = unit->getRaceMask() & ConditionValue1; break; } case CONDITION_SKILL: @@ -153,9 +154,6 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) condMeets = ((InstanceMap*)map)->GetInstanceScript()->GetData(ConditionValue1) == ConditionValue2; break; } - case CONDITION_SPELL_SCRIPT_TARGET: - condMeets = true;//spell target condition is handled in spellsystem, here it is always true - break; case CONDITION_MAPID: condMeets = object->GetMapId() == ConditionValue1; break; @@ -193,7 +191,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) case CONDITION_OBJECT_ENTRY: { if (object->GetTypeId() == ConditionValue1) - condMeets = (!ConditionValue2) || (object->GetEntry() == ConditionValue2); + condMeets = (!ConditionValue2) || (object->GetEntry() == ConditionValue2); break; } case CONDITION_TYPE_MASK: @@ -291,19 +289,160 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) return condMeets && script; } +uint32 Condition::GetSearcherTypeMaskForCondition() +{ + // build mask of types for which condition can return true + // this is used for speeding up gridsearches + if (NegativeCondition) + return (GRID_MAP_TYPE_MASK_ALL); + uint32 mask = 0; + switch (ConditionType) + { + case CONDITION_NONE: + mask |= GRID_MAP_TYPE_MASK_ALL; + break; + case CONDITION_AURA: + mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_ITEM: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_ITEM_EQUIPPED: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_ZONEID: + mask |= GRID_MAP_TYPE_MASK_ALL; + break; + case CONDITION_REPUTATION_RANK: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_ACHIEVEMENT: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_TEAM: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_CLASS: + mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_RACE: + mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_SKILL: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_QUESTREWARDED: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_QUESTTAKEN: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_QUEST_COMPLETE: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_QUEST_NONE: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_ACTIVE_EVENT: + mask |= GRID_MAP_TYPE_MASK_ALL; + break; + case CONDITION_INSTANCE_DATA: + mask |= GRID_MAP_TYPE_MASK_ALL; + break; + case CONDITION_MAPID: + mask |= GRID_MAP_TYPE_MASK_ALL; + break; + case CONDITION_AREAID: + mask |= GRID_MAP_TYPE_MASK_ALL; + break; + case CONDITION_SPELL: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_LEVEL: + mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_DRUNKENSTATE: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_NEAR_CREATURE: + mask |= GRID_MAP_TYPE_MASK_ALL; + break; + case CONDITION_NEAR_GAMEOBJECT: + mask |= GRID_MAP_TYPE_MASK_ALL; + break; + case CONDITION_OBJECT_ENTRY: + switch (ConditionValue1) + { + case TYPEID_UNIT: + mask |= GRID_MAP_TYPE_MASK_CREATURE; + break; + case TYPEID_PLAYER: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; + case TYPEID_GAMEOBJECT: + mask |= GRID_MAP_TYPE_MASK_GAMEOBJECT; + break; + case TYPEID_CORPSE: + mask |= GRID_MAP_TYPE_MASK_CORPSE; + break; + default: + break; + } + case CONDITION_TYPE_MASK: + if (ConditionValue1 & TYPEMASK_UNIT) + mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; + if (ConditionValue1 & TYPEMASK_PLAYER) + mask |= GRID_MAP_TYPE_MASK_PLAYER; + if (ConditionValue1 & TYPEMASK_GAMEOBJECT) + mask |= GRID_MAP_TYPE_MASK_GAMEOBJECT; + if (ConditionValue1 & TYPEMASK_CORPSE) + mask |= GRID_MAP_TYPE_MASK_CORPSE; + break; + case CONDITION_RELATION_TO: + mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_REACTION_TO: + mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_DISTANCE_TO: + mask |= GRID_MAP_TYPE_MASK_ALL; + break; + case CONDITION_ALIVE: + mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_HP_VAL: + mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_HP_PCT: + mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_WORLD_STATE: + mask |= GRID_MAP_TYPE_MASK_ALL; + break; + case CONDITION_PHASEMASK: + mask |= GRID_MAP_TYPE_MASK_ALL; + break; + default: + ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!"); + break; + } + return mask; +} + uint32 Condition::GetMaxAvailableConditionTargets() { // returns number of targets which are available for given source type switch(SourceType) { case CONDITION_SOURCE_TYPE_SPELL: + case CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET: case CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE: case CONDITION_SOURCE_TYPE_VEHICLE_SPELL: + case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT: case CONDITION_SOURCE_TYPE_GOSSIP_MENU: case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION: + case CONDITION_SOURCE_TYPE_SMART_EVENT: return 2; - case CONDITION_SOURCE_TYPE_SMART_EVENT: - return 2; default: return 1; } @@ -327,8 +466,49 @@ ConditionList ConditionMgr::GetConditionReferences(uint32 refId) return conditions; } +uint32 ConditionMgr::GetSearcherTypeMaskForConditionList(ConditionList const& conditions) +{ + if (conditions.empty()) + return GRID_MAP_TYPE_MASK_ALL; + // groupId, typeMask + std::map<uint32, uint32> ElseGroupStore; + for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i) + { + // no point of having not loaded conditions in list + ASSERT((*i)->isLoaded() && "ConditionMgr::GetSearcherTypeMaskForConditionList - not yet loaded condition found in list"); + std::map<uint32, uint32>::const_iterator itr = ElseGroupStore.find((*i)->ElseGroup); + // group not filled yet, fill with widest mask possible + if (itr == ElseGroupStore.end()) + ElseGroupStore[(*i)->ElseGroup] = GRID_MAP_TYPE_MASK_ALL; + // no point of checking anymore, empty mask + else if (!(*itr).second) + continue; + + if ((*i)->ReferenceId) // handle reference + { + ConditionReferenceContainer::const_iterator ref = ConditionReferenceStore.find((*i)->ReferenceId); + ASSERT(ref != ConditionReferenceStore.end() && "ConditionMgr::GetSearcherTypeMaskForConditionList - incorrect reference"); + ElseGroupStore[(*i)->ElseGroup] &= GetSearcherTypeMaskForConditionList((*ref).second); + } + else // handle normal condition + { + // object will match conditions in one ElseGroupStore only when it matches all of them + // so, let's find a smallest possible mask which satisfies all conditions + ElseGroupStore[(*i)->ElseGroup] &= (*i)->GetSearcherTypeMaskForCondition(); + } + } + // object will match condition when one of the checks in ElseGroupStore is matching + // so, let's include all possible masks + uint32 mask = 0; + for (std::map<uint32, uint32>::const_iterator i = ElseGroupStore.begin(); i != ElseGroupStore.end(); ++i) + mask |= i->second; + + return mask; +} + bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, ConditionList const& conditions) { + // groupId, groupCheckPassed std::map<uint32, bool> ElseGroupStore; for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i) { @@ -391,6 +571,33 @@ bool ConditionMgr::IsObjectMeetToConditions(ConditionSourceInfo& sourceInfo, Con return IsObjectMeetToConditionList(sourceInfo, conditions); } +bool ConditionMgr::CanHaveSourceGroupSet(ConditionSourceType sourceType) const +{ + return (sourceType == CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE || + sourceType == CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE || + sourceType == CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE || + sourceType == CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE || + sourceType == CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE || + sourceType == CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE || + sourceType == CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE || + sourceType == CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE || + sourceType == CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE || + sourceType == CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE || + sourceType == CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE || + sourceType == CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE || + sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU || + sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION || + sourceType == CONDITION_SOURCE_TYPE_VEHICLE_SPELL || + sourceType == CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET || + sourceType == CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT || + sourceType == CONDITION_SOURCE_TYPE_SMART_EVENT); +} + +bool ConditionMgr::CanHaveSourceIdSet(ConditionSourceType sourceType) const +{ + return (sourceType == CONDITION_SOURCE_TYPE_SMART_EVENT); +} + ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType sourceType, uint32 entry) { ConditionList spellCond; @@ -410,17 +617,34 @@ ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType return spellCond; } -ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureID, uint32 spellID) + +ConditionList ConditionMgr::GetConditionsForSpellClickEvent(uint32 creatureId, uint32 spellId) { ConditionList cond; - VehicleSpellConditionContainer::const_iterator itr = VehicleSpellConditionStore.find(creatureID); + CreatureSpellConditionContainer::const_iterator itr = SpellClickEventConditionStore.find(creatureId); + if (itr != SpellClickEventConditionStore.end()) + { + ConditionTypeContainer::const_iterator i = (*itr).second.find(spellId); + if (i != (*itr).second.end()) + { + cond = (*i).second; + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForSpellClickEvent: found conditions for Vehicle entry %u spell %u", creatureId, spellId); + } + } + return cond; +} + +ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureId, uint32 spellId) +{ + ConditionList cond; + CreatureSpellConditionContainer::const_iterator itr = VehicleSpellConditionStore.find(creatureId); if (itr != VehicleSpellConditionStore.end()) { - ConditionTypeContainer::const_iterator i = (*itr).second.find(spellID); + ConditionTypeContainer::const_iterator i = (*itr).second.find(spellId); if (i != (*itr).second.end()) { cond = (*i).second; - sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForVehicleSpell: found conditions for Vehicle entry %u spell %u", creatureID, spellID); + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForVehicleSpell: found conditions for Vehicle entry %u spell %u", creatureId, spellId); } } return cond; @@ -470,6 +694,7 @@ void ConditionMgr::LoadConditions(bool isReload) sLog->outString("Re-Loading `gossip_menu_option` Table for Conditions!"); sObjectMgr->LoadGossipMenuItems(); + sSpellMgr->UnloadSpellInfoImplicitTargetConditionLists(); } QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionTarget, " @@ -566,16 +791,23 @@ void ConditionMgr::LoadConditions(bool isReload) } //Grouping is only allowed for some types (loot templates, gossip menus, gossip items) - if (cond->SourceGroup && !isGroupable(cond->SourceType)) + if (cond->SourceGroup && !CanHaveSourceGroupSet(cond->SourceType)) { - sLog->outErrorDb("Condition type %u has not allowed grouping %u!", uint32(cond->SourceType), cond->SourceGroup); + sLog->outErrorDb("Condition type %u has not allowed value of SourceGroup = %u!", uint32(cond->SourceType), cond->SourceGroup); delete cond; continue; } - else if (cond->SourceGroup) + if (cond->SourceId && !CanHaveSourceIdSet(cond->SourceType)) + { + sLog->outErrorDb("Condition type %u has not allowed value of SourceId = %u!", uint32(cond->SourceType), cond->SourceId); + delete cond; + continue; + } + + if (cond->SourceGroup) { bool valid = false; - //handle grouped conditions + // handle grouped conditions switch (cond->SourceType) { case CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE: @@ -620,6 +852,29 @@ void ConditionMgr::LoadConditions(bool isReload) case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION: valid = addToGossipMenuItems(cond); break; + case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT: + { + //if no list for npc create one + if (SpellClickEventConditionStore.find(cond->SourceGroup) == SpellClickEventConditionStore.end()) + { + ConditionTypeContainer cmap; + SpellClickEventConditionStore[cond->SourceGroup] = cmap; + } + //if no list for spellclick spell create one + if (SpellClickEventConditionStore[cond->SourceGroup].find(cond->SourceEntry) == SpellClickEventConditionStore[cond->SourceGroup].end()) + { + ConditionList clist; + SpellClickEventConditionStore[cond->SourceGroup][cond->SourceEntry] = clist; + } + SpellClickEventConditionStore[cond->SourceGroup][cond->SourceEntry].push_back(cond); + valid = true; + ++count; + continue; // do not add to m_AllocatedMemory to avoid double deleting + break; + } + case CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET: + valid = addToSpellImplicitTargetConditions(cond); + break; case CONDITION_SOURCE_TYPE_VEHICLE_SPELL: { //if no list for vehicle create one @@ -754,6 +1009,78 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond) return false; } +bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond) +{ + uint32 conditionEffMask = cond->SourceGroup; + SpellInfo* spellInfo = const_cast<SpellInfo*>(sSpellMgr->GetSpellInfo(cond->SourceEntry)); + ASSERT(spellInfo); + std::list<uint32> sharedMasks; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + // check if effect is already a part of some shared mask + bool found = false; + for (std::list<uint32>::iterator itr = sharedMasks.begin(); itr != sharedMasks.end(); ++itr) + { + if ((1<<i) & *itr) + { + found = true; + break; + } + } + if (found) + continue; + + // build new shared mask with found effect + uint32 sharedMask = (1<<i); + ConditionList* cmp = spellInfo->Effects[i].ImplicitTargetConditions; + for (uint8 effIndex = i+1; effIndex < MAX_SPELL_EFFECTS; ++effIndex) + { + if (spellInfo->Effects[effIndex].ImplicitTargetConditions == cmp) + sharedMask |= 1<<effIndex; + } + sharedMasks.push_back(sharedMask); + } + + for (std::list<uint32>::iterator itr = sharedMasks.begin(); itr != sharedMasks.end(); ++itr) + { + // some effect indexes should have same data + if (uint32 commonMask = *itr & conditionEffMask) + { + uint8 firstEffIndex = 0; + for (; firstEffIndex < MAX_SPELL_EFFECTS; ++firstEffIndex) + if ((1<<firstEffIndex) & *itr) + break; + + // get shared data + ConditionList* sharedList = spellInfo->Effects[firstEffIndex].ImplicitTargetConditions; + + // there's already data entry for that sharedMask + if (sharedList) + { + // we have overlapping masks in db + if (conditionEffMask != *itr) + { + sLog->outErrorDb("SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set - " + "effect masks are overlapping (all SourceGroup values having given bit set must be equal) - ignoring.", cond->SourceEntry, cond->SourceGroup); + return false; + } + } + // no data for shared mask, we can create new submask + else + { + // add new list, create new shared mask + sharedList = new ConditionList(); + for (uint8 i = firstEffIndex; i < MAX_SPELL_EFFECTS; ++i) + if ((1<<i) & commonMask) + spellInfo->Effects[i].ImplicitTargetConditions = sharedList; + } + sharedList->push_back(cond); + break; + } + } + return true; +} + bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (cond->SourceType == CONDITION_SOURCE_TYPE_NONE || cond->SourceType >= CONDITION_SOURCE_TYPE_MAX) @@ -968,64 +1295,54 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) } break; } - case CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET: + case CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET: { - if (cond->ConditionType != CONDITION_SPELL_SCRIPT_TARGET) + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(cond->SourceEntry); + if (!spellInfo) { - sLog->outErrorDb("SourceEntry %u in `condition` table, has ConditionType %u. Only CONDITION_SPELL_SCRIPT_TARGET(18) is valid for CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET(14), ignoring.", cond->SourceEntry, uint32(cond->ConditionType)); + sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry); return false; } - SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cond->SourceEntry); - if (!spellProto) + if ((cond->SourceGroup > MAX_EFFECT_MASK) || !cond->SourceGroup) { - sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry); + sLog->outErrorDb("SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set , ignoring.", cond->SourceEntry, cond->SourceGroup); return false; } - bool targetfound = false; + uint32 origGroup = cond->SourceGroup; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - if (spellProto->Effects[i].TargetA.GetTarget() == TARGET_UNIT_SRC_AREA_ENTRY || - spellProto->Effects[i].TargetB.GetTarget() == TARGET_UNIT_SRC_AREA_ENTRY || - spellProto->Effects[i].TargetA.GetTarget() == TARGET_UNIT_DEST_AREA_ENTRY || - spellProto->Effects[i].TargetB.GetTarget() == TARGET_UNIT_DEST_AREA_ENTRY || - spellProto->Effects[i].TargetA.GetTarget() == TARGET_UNIT_NEARBY_ENTRY || - spellProto->Effects[i].TargetB.GetTarget() == TARGET_UNIT_NEARBY_ENTRY || - spellProto->Effects[i].TargetA.GetTarget() == TARGET_GAMEOBJECT_NEARBY_ENTRY || - spellProto->Effects[i].TargetB.GetTarget() == TARGET_GAMEOBJECT_NEARBY_ENTRY || - spellProto->Effects[i].TargetA.GetTarget() == TARGET_GAMEOBJECT_SRC_AREA || - spellProto->Effects[i].TargetB.GetTarget() == TARGET_GAMEOBJECT_SRC_AREA || - spellProto->Effects[i].TargetA.GetTarget() == TARGET_GAMEOBJECT_DEST_AREA || - spellProto->Effects[i].TargetB.GetTarget() == TARGET_GAMEOBJECT_DEST_AREA || - spellProto->Effects[i].TargetA.GetTarget() == TARGET_DEST_NEARBY_ENTRY || - spellProto->Effects[i].TargetB.GetTarget() == TARGET_DEST_NEARBY_ENTRY || - spellProto->Effects[i].TargetA.GetTarget() == TARGET_UNIT_CONE_ENTRY || - spellProto->Effects[i].TargetB.GetTarget() == TARGET_UNIT_CONE_ENTRY) + if (!((1<<i) & cond->SourceGroup)) + continue; + + switch (spellInfo->Effects[i].TargetA.GetSelectionCategory()) { - targetfound = true; - //break; + case TARGET_SELECT_CATEGORY_NEARBY: + case TARGET_SELECT_CATEGORY_CONE: + case TARGET_SELECT_CATEGORY_AREA: + continue; + default: + break; } - else if (cond->ConditionValue3 & (1 << i)) + + switch (spellInfo->Effects[i].TargetB.GetSelectionCategory()) { - cond->ConditionValue3 &= ~(1 << i); - sLog->outErrorDb("SourceEntry %u in `condition` table does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DEST_NEARBY_ENTRY (46)" - ", TARGET_UNIT_SRC_AREA_ENTRY(7), TARGET_UNIT_DEST_AREA_ENTRY(8), TARGET_UNIT_CONE_ENTRY(60), TARGET_GAMEOBJECT_NEARBY_ENTRY(40)" - "TARGET_GAMEOBJECT_SRC_AREA(51), TARGET_GAMEOBJECT_DEST_AREA(52) in effect %u", cond->SourceEntry, uint32(i)); + case TARGET_SELECT_CATEGORY_NEARBY: + case TARGET_SELECT_CATEGORY_CONE: + case TARGET_SELECT_CATEGORY_AREA: + continue; + default: + break; } + + sLog->outErrorDb("SourceEntry %u SourceGroup %u in `condition` table - spell %u does not have implicit targets of types: _AREA_, _CONE_, _NEARBY_ for effect %u, SourceGroup needs correction, ignoring.", cond->SourceEntry, origGroup, cond->SourceEntry, uint32(i)); + cond->SourceGroup &= ~(1<<i); } - if (!targetfound && !cond->ConditionValue3) // cond->mConditionValue3 already errored up there - { - sLog->outErrorDb("SourceEntry %u in `condition` table does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DEST_NEARBY_ENTRY (46)" - ", TARGET_UNIT_SRC_AREA_ENTRY(7), TARGET_UNIT_DEST_AREA_ENTRY(8), TARGET_UNIT_CONE_ENTRY(60), TARGET_GAMEOBJECT_NEARBY_ENTRY(40)" - "TARGET_GAMEOBJECT_SRC_AREA(51), TARGET_GAMEOBJECT_DEST_AREA(52)", cond->SourceEntry); - return false; - } - if ((cond->ConditionValue1 == SPELL_TARGET_TYPE_DEAD) && !spellProto->IsAllowingDeadTarget()) - { - sLog->outErrorDb("SourceEntry %u in `condition` table does have SPELL_TARGET_TYPE_DEAD specified but spell does not have SPELL_ATTR2_CAN_TARGET_DEAD", cond->SourceEntry); + // all effects were removed, no need to add the condition at all + if (!cond->SourceGroup) return false; - } break; } case CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE: @@ -1074,9 +1391,19 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) return false; } break; - case CONDITION_SOURCE_TYPE_UNUSED_18: - sLog->outErrorDb("Found SourceTypeOrReferenceId = CONDITION_SOURCE_TYPE_UNUSED_18 in `conditions` table - ignoring"); - return false; + case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT: + if (!sObjectMgr->GetCreatureTemplate(cond->SourceGroup)) + { + sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceGroup); + return false; + } + + if (!sSpellMgr->GetSpellInfo(cond->SourceEntry)) + { + sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry); + return false; + } + break; case CONDITION_SOURCE_TYPE_GOSSIP_MENU: case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION: case CONDITION_SOURCE_TYPE_SMART_EVENT: @@ -1111,7 +1438,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) return false; } - if (cond->ConditionValue2 > 2) + if (cond->ConditionValue2 > EFFECT_2) { sLog->outErrorDb("Aura condition has non existing effect index (%u) (must be 0..2), skipped", cond->ConditionValue2); return false; @@ -1291,46 +1618,6 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) sLog->outErrorDb("Race condition has useless data in value3 (%u)!", cond->ConditionValue3); break; } - case CONDITION_SPELL_SCRIPT_TARGET: - { - if (cond->ConditionValue1 >= MAX_SPELL_TARGET_TYPE) - { - sLog->outErrorDb("SpellTarget condition has non existing spell target type (%u), skipped", cond->ConditionValue1); - return false; - } - - switch (cond->ConditionValue1) - { - case SPELL_TARGET_TYPE_GAMEOBJECT: - { - if (cond->ConditionValue2 && !sObjectMgr->GetGameObjectTemplate(cond->ConditionValue2)) - { - sLog->outErrorDb("SpellTarget condition has non existing gameobject (%u) as target, skipped", cond->ConditionValue2); - return false; - } - break; - } - case SPELL_TARGET_TYPE_CONTROLLED: - case SPELL_TARGET_TYPE_CREATURE: - case SPELL_TARGET_TYPE_DEAD: - { - if (cond->ConditionValue2 && !sObjectMgr->GetCreatureTemplate(cond->ConditionValue2)) - { - sLog->outErrorDb("SpellTarget condition has non existing creature template entry (%u) as target, skipped", cond->ConditionValue2); - return false; - } - - const CreatureTemplate* cInfo = sObjectMgr->GetCreatureTemplate(cond->ConditionValue2); - if (cond->SourceEntry == 30427 && !cInfo->SkinLootId) - { - sLog->outErrorDb("SpellTarget condition has creature entry %u as a target of spellid 30427, but this creature has no skinlootid. Gas extraction will not work!, skipped", cond->ConditionValue2); - return false; - } - break; - } - } - break; - } case CONDITION_MAPID: { MapEntry const* me = sMapStore.LookupEntry(cond->ConditionValue1); @@ -1437,7 +1724,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) return false; } if (cond->ConditionValue3) - sLog->outErrorDb("ObjectEntry condition has useless data in value3 (%u)!", cond->ConditionValue3); + sLog->outErrorDb("ObjectEntry condition has useless data in value3 (%u)!", cond->ConditionValue3); break; } case CONDITION_TYPE_MASK: @@ -1571,17 +1858,20 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) sLog->outErrorDb("Phasemask condition has useless data in value3 (%u)!", cond->ConditionValue3); break; } + case CONDITION_UNUSED_18: + sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_18 in `conditions` table - ignoring"); + return false; case CONDITION_UNUSED_19: sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring"); return false; case CONDITION_UNUSED_20: - sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring"); + sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_20 in `conditions` table - ignoring"); return false; case CONDITION_UNUSED_21: - sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring"); + sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_21 in `conditions` table - ignoring"); return false; case CONDITION_UNUSED_24: - sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring"); + sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_24 in `conditions` table - ignoring"); return false; default: break; @@ -1613,7 +1903,7 @@ void ConditionMgr::Clean() ConditionStore.clear(); - for (VehicleSpellConditionContainer::iterator itr = VehicleSpellConditionStore.begin(); itr != VehicleSpellConditionStore.end(); ++itr) + for (CreatureSpellConditionContainer::iterator itr = VehicleSpellConditionStore.begin(); itr != VehicleSpellConditionStore.end(); ++itr) { for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it) { diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 79a2122ae29..5a5e2dd1c2e 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -48,7 +48,7 @@ enum ConditionTypes CONDITION_CLASS = 15, // class 0 0 true if player's class is equal to class CONDITION_RACE = 16, // race 0 0 true if player's race is equal to race CONDITION_ACHIEVEMENT = 17, // achievement_id 0 0 true if achievement is complete - CONDITION_SPELL_SCRIPT_TARGET = 18, // SpellScriptTargetType, TargetEntry, 0 + CONDITION_UNUSED_18 = 18, // CONDITION_UNUSED_19 = 19, // CONDITION_UNUSED_20 = 20, // CONDITION_UNUSED_21 = 21, // @@ -87,12 +87,12 @@ enum ConditionSourceType CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE = 10, CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE = 11, CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE = 12, - CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET = 13, + CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET = 13, CONDITION_SOURCE_TYPE_GOSSIP_MENU = 14, CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION = 15, CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE = 16, CONDITION_SOURCE_TYPE_SPELL = 17, - CONDITION_SOURCE_TYPE_UNUSED_18 = 18, + CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT = 18, CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19, CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20, CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21, @@ -167,12 +167,13 @@ struct Condition ConditionValue2 = 0; ConditionValue3 = 0; ReferenceId = 0; - ErrorTextId = 0; + ErrorTextId = 0; ScriptId = 0; NegativeCondition = false; } bool Meets(ConditionSourceInfo& sourceInfo); + uint32 GetSearcherTypeMaskForCondition(); bool isLoaded() const { return ConditionType > CONDITION_NONE || ReferenceId; } uint32 GetMaxAvailableConditionTargets(); }; @@ -180,7 +181,7 @@ struct Condition typedef std::list<Condition*> ConditionList; typedef std::map<uint32, ConditionList> ConditionTypeContainer; typedef std::map<ConditionSourceType, ConditionTypeContainer> ConditionContainer; -typedef std::map<uint32, ConditionTypeContainer> VehicleSpellConditionContainer; +typedef std::map<uint32, ConditionTypeContainer> CreatureSpellConditionContainer; typedef std::map<std::pair<int32, uint32 /*SAI source_type*/>, ConditionTypeContainer> SmartEventConditionContainer; typedef std::map<uint32, ConditionList> ConditionReferenceContainer;//only used for references @@ -198,46 +199,32 @@ class ConditionMgr bool isConditionTypeValid(Condition* cond); ConditionList GetConditionReferences(uint32 refId); + uint32 GetSearcherTypeMaskForConditionList(ConditionList const& conditions); bool IsObjectMeetToConditions(WorldObject* object, ConditionList const& conditions); bool IsObjectMeetToConditions(WorldObject* object1, WorldObject* object2, ConditionList const& conditions); bool IsObjectMeetToConditions(ConditionSourceInfo& sourceInfo, ConditionList const& conditions); + bool CanHaveSourceGroupSet(ConditionSourceType sourceType) const; + bool CanHaveSourceIdSet(ConditionSourceType sourceType) const; ConditionList GetConditionsForNotGroupedEntry(ConditionSourceType sourceType, uint32 entry); + ConditionList GetConditionsForSpellClickEvent(uint32 creatureId, uint32 spellId); ConditionList GetConditionsForSmartEvent(int32 entryOrGuid, uint32 eventId, uint32 sourceType); - ConditionList GetConditionsForVehicleSpell(uint32 creatureID, uint32 spellID); + ConditionList GetConditionsForVehicleSpell(uint32 creatureId, uint32 spellId); private: bool isSourceTypeValid(Condition* cond); bool addToLootTemplate(Condition* cond, LootTemplate* loot); bool addToGossipMenus(Condition* cond); bool addToGossipMenuItems(Condition* cond); + bool addToSpellImplicitTargetConditions(Condition* cond); bool IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, ConditionList const& conditions); - bool isGroupable(ConditionSourceType sourceType) const - { - return (sourceType == CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE || - sourceType == CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE || - sourceType == CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE || - sourceType == CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE || - sourceType == CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE || - sourceType == CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE || - sourceType == CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE || - sourceType == CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE || - sourceType == CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE || - sourceType == CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE || - sourceType == CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE || - sourceType == CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE || - sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU || - sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION || - sourceType == CONDITION_SOURCE_TYPE_VEHICLE_SPELL || - sourceType == CONDITION_SOURCE_TYPE_SMART_EVENT); - } - void Clean(); // free up resources std::list<Condition*> AllocatedMemoryStore; // some garbage collection :) ConditionContainer ConditionStore; ConditionReferenceContainer ConditionReferenceStore; - VehicleSpellConditionContainer VehicleSpellConditionStore; + CreatureSpellConditionContainer VehicleSpellConditionStore; + CreatureSpellConditionContainer SpellClickEventConditionStore; SmartEventConditionContainer SmartEventConditionStore; }; diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index cccb780e412..e6039880b63 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -83,12 +83,12 @@ void LFGMgr::_LoadFromDB(Field* fields, uint64 guid) uint32 dungeon = fields[16].GetUInt32(); uint8 state = fields[17].GetUInt8(); - + if (!dungeon || !state) return; SetDungeon(guid, dungeon); - + switch (state) { case LFG_STATE_DUNGEON: @@ -104,19 +104,19 @@ void LFGMgr::_SaveToDB(uint64 guid, uint32 db_guid) { if (!IS_GROUP(guid)) return; - + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA); stmt->setUInt32(0, db_guid); CharacterDatabase.Execute(stmt); - + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_LFG_DATA); stmt->setUInt32(0, db_guid); - + stmt->setUInt32(1, GetDungeon(guid)); stmt->setUInt32(2, GetState(guid)); - + CharacterDatabase.Execute(stmt); } @@ -999,7 +999,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) LfgQueueInfo* queue = itQueue->second; if (!queue) continue; - + for (LfgRolesMap::const_iterator itPlayer = queue->roles.begin(); itPlayer != queue->roles.end(); ++itPlayer) { if (*itPlayers == ObjectAccessor::FindPlayer(itPlayer->first)) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index d40ee89e774..3dfa1cece61 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -141,7 +141,7 @@ bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) Creature::Creature(bool isWorldObject): Unit(isWorldObject), MapCreature(), lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), lootingGroupLowGUID(0), -m_PlayerDamageReq(0), m_lootMoney(0), m_lootRecipient(0), m_lootRecipientGroup(0), m_corpseRemoveTime(0), m_respawnTime(0), +m_PlayerDamageReq(0), m_lootRecipient(0), m_lootRecipientGroup(0), m_corpseRemoveTime(0), m_respawnTime(0), m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_reactState(REACT_AGGRESSIVE), m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), @@ -1415,7 +1415,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC)) return false; - + // Do not attack non-combat pets if (who->GetTypeId() == TYPEID_UNIT && who->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET) return false; diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 1e360342852..bfe186329e1 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -721,7 +721,6 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature static float _GetHealthMod(int32 Rank); - uint32 m_lootMoney; uint64 m_lootRecipient; uint32 m_lootRecipientGroup; diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index a4635ca6dfb..a4fece4d301 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -710,7 +710,7 @@ class GameObject : public WorldObject, public GridObject<GameObject> uint8 GetGoAnimProgress() const { return GetByteValue(GAMEOBJECT_BYTES_1, 3); } void SetGoAnimProgress(uint8 animprogress) { SetByteValue(GAMEOBJECT_BYTES_1, 3, animprogress); } static void SetGoArtKit(uint8 artkit, GameObject* go, uint32 lowguid = 0); - + void SetPhaseMask(uint32 newPhaseMask, bool update); void EnableCollision(bool enable); @@ -795,7 +795,7 @@ class GameObject : public WorldObject, public GridObject<GameObject> std::string GetAIName() const; void SetDisplayId(uint32 displayid); - + GameObjectModel * m_model; protected: bool AIM_Initialize(); diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index aadf9f44b0b..c98364ecb2d 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1085,9 +1085,9 @@ bool Object::PrintIndexError(uint32 index, bool set) const return false; } -bool Position::HasInLine(Unit const* target, float distance, float width) const +bool Position::HasInLine(WorldObject const* target, float width) const { - if (!HasInArc(M_PI, target) || !target->IsWithinDist3d(m_positionX, m_positionY, m_positionZ, distance)) + if (!HasInArc(M_PI, target)) return false; width += target->GetObjectSize(); float angle = GetRelativeAngle(target); @@ -1502,14 +1502,14 @@ bool WorldObject::IsInBetween(const WorldObject* obj1, const WorldObject* obj2, return (size * size) >= GetExactDist2dSq(obj1->GetPositionX() + cos(angle) * dist, obj1->GetPositionY() + sin(angle) * dist); } -bool WorldObject::isInFront(WorldObject const* target, float distance, float arc) const +bool WorldObject::isInFront(WorldObject const* target, float arc) const { - return IsWithinDist(target, distance) && HasInArc(arc, target); + return HasInArc(arc, target); } -bool WorldObject::isInBack(WorldObject const* target, float distance, float arc) const +bool WorldObject::isInBack(WorldObject const* target, float arc) const { - return IsWithinDist(target, distance) && !HasInArc(2 * M_PI - arc, target); + return !HasInArc(2 * M_PI - arc, target); } void WorldObject::GetRandomPoint(const Position &pos, float distance, float &rand_x, float &rand_y, float &rand_z) const diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index c14b7599d5f..7b3fcc4a337 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -451,7 +451,7 @@ struct Position bool IsInDist(const Position* pos, float dist) const { return GetExactDistSq(pos) < dist * dist; } bool HasInArc(float arcangle, const Position* pos) const; - bool HasInLine(Unit const* target, float distance, float width) const; + bool HasInLine(WorldObject const* target, float width) const; std::string ToString() const; }; ByteBuffer& operator>>(ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer); @@ -707,8 +707,8 @@ class WorldObject : public Object, public WorldLocation bool IsInRange(WorldObject const* obj, float minRange, float maxRange, bool is3D = true) const; bool IsInRange2d(float x, float y, float minRange, float maxRange) const; bool IsInRange3d(float x, float y, float z, float minRange, float maxRange) const; - bool isInFront(WorldObject const* target, float distance, float arc = M_PI) const; - bool isInBack(WorldObject const* target, float distance, float arc = M_PI) const; + bool isInFront(WorldObject const* target, float arc = M_PI) const; + bool isInBack(WorldObject const* target, float arc = M_PI) const; bool IsInBetween(const WorldObject* obj1, const WorldObject* obj2, float size = 0) const; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 941d898c1fb..fde4f4c6959 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -14828,7 +14828,7 @@ void Player::AddQuest(Quest const* quest, Object* questGiver) uint16 log_slot = FindQuestSlot(0); if (log_slot >= MAX_QUEST_LOG_SIZE) // Player does not have any free slot in the quest log - return; + return; uint32 quest_id = quest->GetQuestId(); @@ -20269,9 +20269,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc // not let cheating with start flight in time of logout process || while in combat || has type state: stunned || has type state: root if (GetSession()->isLogingOut() || isInCombat() || HasUnitState(UNIT_STATE_STUNNED) || HasUnitState(UNIT_STATE_ROOT)) { - WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); - data << uint32(ERR_TAXIPLAYERBUSY); - GetSession()->SendPacket(&data); + GetSession()->SendActivateTaxiReply(ERR_TAXIPLAYERBUSY); return false; } @@ -20284,26 +20282,20 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc // not let cheating with start flight mounted if (IsMounted()) { - WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); - data << uint32(ERR_TAXIPLAYERALREADYMOUNTED); - GetSession()->SendPacket(&data); + GetSession()->SendActivateTaxiReply(ERR_TAXIPLAYERALREADYMOUNTED); return false; } if (IsInDisallowedMountForm()) { - WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); - data << uint32(ERR_TAXIPLAYERSHAPESHIFTED); - GetSession()->SendPacket(&data); + GetSession()->SendActivateTaxiReply(ERR_TAXIPLAYERSHAPESHIFTED); return false; } // not let cheating with start flight in time of logout process || if casting not finished || while in combat || if not use Spell's with EffectSendTaxi if (IsNonMeleeSpellCasted(false)) { - WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); - data << uint32(ERR_TAXIPLAYERBUSY); - GetSession()->SendPacket(&data); + GetSession()->SendActivateTaxiReply(ERR_TAXIPLAYERBUSY); return false; } } @@ -20332,9 +20324,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(sourcenode); if (!node) { - WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); - data << uint32(ERR_TAXINOSUCHPATH); - GetSession()->SendPacket(&data); + GetSession()->SendActivateTaxiReply(ERR_TAXINOSUCHPATH); return false; } @@ -20347,18 +20337,14 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc (node->z - GetPositionZ())*(node->z - GetPositionZ()) > (2*INTERACTION_DISTANCE)*(2*INTERACTION_DISTANCE)*(2*INTERACTION_DISTANCE)) { - WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); - data << uint32(ERR_TAXITOOFARAWAY); - GetSession()->SendPacket(&data); + GetSession()->SendActivateTaxiReply(ERR_TAXITOOFARAWAY); return false; } } // node must have pos if taxi master case (npc != NULL) else if (npc) { - WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); - data << uint32(ERR_TAXIUNSPECIFIEDSERVERERROR); - GetSession()->SendPacket(&data); + GetSession()->SendActivateTaxiReply(ERR_TAXIUNSPECIFIEDSERVERERROR); return false; } @@ -20421,9 +20407,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc // in spell case allow 0 model if ((mount_display_id == 0 && spellid == 0) || sourcepath == 0) { - WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); - data << uint32(ERR_TAXIUNSPECIFIEDSERVERERROR); - GetSession()->SendPacket(&data); + GetSession()->SendActivateTaxiReply(ERR_TAXIUNSPECIFIEDSERVERERROR); m_taxi.ClearTaxiDestinations(); return false; } @@ -20435,9 +20419,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc if (money < totalcost) { - WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); - data << uint32(ERR_TAXINOTENOUGHMONEY); - GetSession()->SendPacket(&data); + GetSession()->SendActivateTaxiReply(ERR_TAXINOTENOUGHMONEY); m_taxi.ClearTaxiDestinations(); return false; } @@ -20459,10 +20441,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc } else { - WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); - data << uint32(ERR_TAXIOK); - GetSession()->SendPacket(&data); - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ACTIVATETAXIREPLY"); + GetSession()->SendActivateTaxiReply(ERR_TAXIOK); GetSession()->SendDoFlight(mount_display_id, sourcepath); } return true; @@ -22386,11 +22365,21 @@ void Player::UpdateForQuestWorldObjects() SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(obj->GetEntry()); for (SpellClickInfoContainer::const_iterator _itr = clickPair.first; _itr != clickPair.second; ++_itr) - if (_itr->second.questStart || _itr->second.questEnd) + { + //! This code doesn't look right, but it was logically converted to condition system to do the exact + //! same thing it did before. It definitely needs to be overlooked for intended functionality. + ConditionList conds = sConditionMgr->GetConditionsForSpellClickEvent(obj->GetEntry(), _itr->second.spellId); + bool buildUpdateBlock = false; + for (ConditionList::const_iterator jtr = conds.begin(); jtr != conds.end() && !buildUpdateBlock; ++jtr) + if ((*jtr)->ConditionType == CONDITION_QUESTREWARDED || (*jtr)->ConditionType == CONDITION_QUESTTAKEN) + buildUpdateBlock = true; + + if (buildUpdateBlock) { obj->BuildCreateUpdateBlockForPlayer(&udata, this); break; } + } } } udata.BuildPacket(&packet); @@ -24163,10 +24152,17 @@ bool Player::canSeeSpellClickOn(Creature const* c) const return true; for (SpellClickInfoContainer::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr) - if (itr->second.IsFitToRequirements(this, c)) - return true; + { + if (!itr->second.IsFitToRequirements(this, c)) + return false; - return false; + ConditionList conds = sConditionMgr->GetConditionsForSpellClickEvent(c->GetEntry(), itr->second.spellId); + ConditionSourceInfo info = ConditionSourceInfo(const_cast<Player*>(this), const_cast<Creature*>(c)); + if (!sConditionMgr->IsObjectMeetToConditions(info, conds)) + return false; + } + + return true; } void Player::BuildPlayerTalentsInfoData(WorldPacket* data) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 7f08f03b5f8..82bbd1b38d5 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -466,23 +466,6 @@ enum PlayerFieldByte2Flags PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW = 0x40 }; -enum ActivateTaxiReplies -{ - ERR_TAXIOK = 0, - ERR_TAXIUNSPECIFIEDSERVERERROR = 1, - ERR_TAXINOSUCHPATH = 2, - ERR_TAXINOTENOUGHMONEY = 3, - ERR_TAXITOOFARAWAY = 4, - ERR_TAXINOVENDORNEARBY = 5, - ERR_TAXINOTVISITED = 6, - ERR_TAXIPLAYERBUSY = 7, - ERR_TAXIPLAYERALREADYMOUNTED = 8, - ERR_TAXIPLAYERSHAPESHIFTED = 9, - ERR_TAXIPLAYERMOVING = 10, - ERR_TAXISAMENODE = 11, - ERR_TAXINOTSTANDING = 12 -}; - enum MirrorTimerType { FATIGUE_TIMER = 0, diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 183267d1dbf..70ca35b7203 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -55,6 +55,7 @@ #include "SpellInfo.h" #include "MoveSplineInit.h" #include "MoveSpline.h" +#include "ConditionMgr.h" #include <math.h> @@ -1884,7 +1885,7 @@ void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool ext else { // attack can be redirected to another target - victim = SelectMagnetTarget(victim); + victim = GetMeleeHitRedirectTarget(victim); CalcDamageInfo damageInfo; CalculateMeleeDamage(victim, 0, &damageInfo, attType); @@ -9768,6 +9769,7 @@ void Unit::SetMinion(Minion *minion, bool apply) { // Send infinity cooldown - client does that automatically but after relog cooldown needs to be set again SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(minion->GetUInt32Value(UNIT_CREATED_BY_SPELL)); + if (spellInfo && (spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)) ToPlayer()->AddSpellAndCategoryCooldowns(spellInfo, 0, NULL, true); } @@ -9987,44 +9989,44 @@ int32 Unit::DealHeal(Unit* victim, uint32 addhealth) return gain; } -Unit* Unit::SelectMagnetTarget(Unit* victim, SpellInfo const* spellInfo) +Unit* Unit::GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo) { - if (!victim) - return NULL; + // Patch 1.2 notes: Spell Reflection no longer reflects abilities + if (spellInfo->Attributes & SPELL_ATTR0_ABILITY || spellInfo->AttributesEx & SPELL_ATTR1_CANT_BE_REDIRECTED || spellInfo->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) + return victim; - // Magic case - if (spellInfo && (spellInfo->DmgClass == SPELL_DAMAGE_CLASS_NONE || spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC)) + Unit::AuraEffectList const& magnetAuras = victim->GetAuraEffectsByType(SPELL_AURA_SPELL_MAGNET); + for (Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr) { - // Patch 1.2 notes: Spell Reflection no longer reflects abilities - if (spellInfo->Attributes & SPELL_ATTR0_ABILITY || spellInfo->AttributesEx & SPELL_ATTR1_CANT_BE_REDIRECTED || spellInfo->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) - return victim; - // I am not sure if this should be redirected. - if (spellInfo->DmgClass == SPELL_DAMAGE_CLASS_NONE) - return victim; + if (Unit* magnet = (*itr)->GetBase()->GetUnitOwner()) + if (spellInfo->CheckExplicitTarget(this, magnet) == SPELL_CAST_OK + && spellInfo->CheckTarget(this, magnet, false) == SPELL_CAST_OK + && _IsValidAttackTarget(magnet, spellInfo) + && IsWithinLOSInMap(magnet)) + { + // TODO: handle this charge drop by proc in cast phase on explicit target + (*itr)->GetBase()->DropCharge(AURA_REMOVE_BY_EXPIRE); + return magnet; + } + } + return victim; +} - Unit::AuraEffectList const& magnetAuras = victim->GetAuraEffectsByType(SPELL_AURA_SPELL_MAGNET); - for (Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr) - if (Unit* magnet = (*itr)->GetBase()->GetUnitOwner()) - if (magnet->isAlive() && IsWithinLOSInMap(magnet)) +Unit* Unit::GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo) +{ + AuraEffectList const& hitTriggerAuras = victim->GetAuraEffectsByType(SPELL_AURA_ADD_CASTER_HIT_TRIGGER); + for (AuraEffectList::const_iterator i = hitTriggerAuras.begin(); i != hitTriggerAuras.end(); ++i) + { + if (Unit* magnet = (*i)->GetBase()->GetCaster()) + if (_IsValidAttackTarget(magnet, spellInfo) && magnet->IsWithinLOSInMap(this) + && (!spellInfo || (spellInfo->CheckExplicitTarget(this, magnet) == SPELL_CAST_OK + && spellInfo->CheckTarget(this, magnet, false) == SPELL_CAST_OK))) + if (roll_chance_i((*i)->GetAmount())) { - (*itr)->GetBase()->DropCharge(AURA_REMOVE_BY_EXPIRE); + (*i)->GetBase()->DropCharge(AURA_REMOVE_BY_EXPIRE); return magnet; } } - // Melee && ranged case - else - { - AuraEffectList const& hitTriggerAuras = victim->GetAuraEffectsByType(SPELL_AURA_ADD_CASTER_HIT_TRIGGER); - for (AuraEffectList::const_iterator i = hitTriggerAuras.begin(); i != hitTriggerAuras.end(); ++i) - if (Unit* magnet = (*i)->GetBase()->GetCaster()) - if (magnet->isAlive() && magnet->IsWithinLOSInMap(this)) - if (roll_chance_i((*i)->GetAmount())) - { - (*i)->GetBase()->DropCharge(AURA_REMOVE_BY_EXPIRE); - return magnet; - } - } - return victim; } @@ -12164,7 +12166,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co if (FactionTemplateEntry const* factionTemplate = creature->getFactionTemplateEntry()) if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction)) if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry)) - if (repState->Flags & FACTION_FLAG_PEACE_FORCED) + if (!(repState->Flags & FACTION_FLAG_AT_WAR)) return false; } } @@ -13690,7 +13692,6 @@ void Unit::RemoveFromWorld() RemoveAllGameObjects(); RemoveAllDynObjects(); - ExitVehicle(); UnsummonAllTotems(); RemoveAllControlled(); @@ -14825,7 +14826,7 @@ Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const // remove current target if (getVictim()) targets.remove(getVictim()); - + if (exclude) targets.remove(exclude); @@ -15327,14 +15328,6 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) if (!victim->GetHealth()) return; - // Inform pets (if any) when player kills target) - if (Player* player = ToPlayer()) - { - Pet* pet = player->GetPet(); - if (pet && pet->isAlive() && pet->isControlled()) - pet->AI()->KilledUnit(victim); - } - // find player: owner of controlled `this` or `this` itself maybe Player* player = GetCharmerOrOwnerPlayerOrPlayerItself(); Creature* creature = victim->ToCreature(); @@ -15463,6 +15456,16 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) victim->setDeathState(JUST_DIED); } + // Inform pets (if any) when player kills target) + // MUST come after victim->setDeathState(JUST_DIED); or pet next target + // selection will get stuck on same target and break pet react state + if (Player* player = ToPlayer()) + { + Pet* pet = player->GetPet(); + if (pet && pet->isAlive() && pet->isControlled()) + pet->AI()->KilledUnit(victim); + } + // 10% durability loss on death // clean InHateListOf if (Player* plrVictim = victim->ToPlayer()) @@ -15587,9 +15590,6 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) if (Player* killed = victim->ToPlayer()) sScriptMgr->OnPlayerKilledByCreature(killerCre, killed); } - - if (victim->GetVehicle()) - victim->ExitVehicle(); } void Unit::SetControlled(bool apply, UnitState state) @@ -16175,26 +16175,6 @@ bool Unit::IsInRaidWith(Unit const* unit) const return false; } -bool Unit::IsTargetMatchingCheck(Unit const* target, SpellTargetSelectionCheckTypes check) const -{ - switch (check) - { - case TARGET_SELECT_CHECK_ENEMY: - if (IsControlledByPlayer()) - return !IsFriendlyTo(target); - else - return IsHostileTo(target); - case TARGET_SELECT_CHECK_ALLY: - return IsFriendlyTo(target); - case TARGET_SELECT_CHECK_PARTY: - return IsInPartyWith(target); - case TARGET_SELECT_CHECK_RAID: - return IsInRaidWith(target); - default: - return true; - } -} - void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius) { Player* owner = GetCharmerOrOwnerPlayerOrPlayerItself(); @@ -16870,57 +16850,61 @@ void Unit::JumpTo(WorldObject* obj, float speedZ) bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) { - bool success = false; uint32 spellClickEntry = GetVehicleKit() ? GetVehicleKit()->GetCreatureEntry() : GetEntry(); SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(spellClickEntry); for (SpellClickInfoContainer::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr) { - if (itr->second.IsFitToRequirements(clicker, this)) - { - Unit* caster = (itr->second.castFlags & NPC_CLICK_CAST_CASTER_CLICKER) ? clicker : this; - Unit* target = (itr->second.castFlags & NPC_CLICK_CAST_TARGET_CLICKER) ? clicker : this; - uint64 origCasterGUID = (itr->second.castFlags & NPC_CLICK_CAST_ORIG_CASTER_OWNER) ? GetOwnerGUID() : clicker->GetGUID(); + //! First check simple relations from clicker to clickee + if (!itr->second.IsFitToRequirements(clicker, this)) + return false; - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(itr->second.spellId); - // if (!spellEntry) should be checked at npc_spellclick load + //! Check database conditions + ConditionList conds = sConditionMgr->GetConditionsForSpellClickEvent(spellClickEntry, itr->second.spellId); + ConditionSourceInfo info = ConditionSourceInfo(clicker, this); + if (!sConditionMgr->IsObjectMeetToConditions(info, conds)) + return false; - if (seatId > -1) - { - uint8 i = 0; - bool valid = false; - while (i < MAX_SPELL_EFFECTS && !valid) - { - if (spellEntry->Effects[i].ApplyAuraName == SPELL_AURA_CONTROL_VEHICLE) - { - valid = true; - break; - } - ++i; - } + Unit* caster = (itr->second.castFlags & NPC_CLICK_CAST_CASTER_CLICKER) ? clicker : this; + Unit* target = (itr->second.castFlags & NPC_CLICK_CAST_TARGET_CLICKER) ? clicker : this; + uint64 origCasterGUID = (itr->second.castFlags & NPC_CLICK_CAST_ORIG_CASTER_OWNER) ? GetOwnerGUID() : clicker->GetGUID(); - if (!valid) - { - sLog->outErrorDb("Spell %u specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId); - return false; - } + SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(itr->second.spellId); + // if (!spellEntry) should be checked at npc_spellclick load - if (IsInMap(caster)) - caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, true, NULL, NULL, origCasterGUID); - else // This can happen during Player::_LoadAuras + if (seatId > -1) + { + uint8 i = 0; + bool valid = false; + while (i < MAX_SPELL_EFFECTS && !valid) + { + if (spellEntry->Effects[i].ApplyAuraName == SPELL_AURA_CONTROL_VEHICLE) { - int32 bp0 = seatId; - Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, &bp0, NULL, origCasterGUID); + valid = true; + break; } + ++i; } - else + + if (!valid) { - if (IsInMap(caster)) - caster->CastSpell(target, spellEntry, true, NULL, NULL, origCasterGUID); - else - Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, NULL, NULL, origCasterGUID); + sLog->outErrorDb("Spell %u specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId); + return false; } - success = true; + if (IsInMap(caster)) + caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, true, NULL, NULL, origCasterGUID); + else // This can happen during Player::_LoadAuras + { + int32 bp0 = seatId; + Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, &bp0, NULL, origCasterGUID); + } + } + else + { + if (IsInMap(caster)) + caster->CastSpell(target, spellEntry, true, NULL, NULL, origCasterGUID); + else + Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, NULL, NULL, origCasterGUID); } } @@ -16928,7 +16912,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) if (creature && creature->IsAIEnabled) creature->AI()->DoAction(EVENT_SPELLCLICK); - return success; + return true; } void Unit::EnterVehicle(Unit* base, int8 seatId) @@ -17014,12 +16998,21 @@ void Unit::ChangeSeat(int8 seatId, bool next) void Unit::ExitVehicle(Position const* exitPosition) { - // This function can be called at upper level code to initialize an exit from the passenger's side. + //! This function can be called at upper level code to initialize an exit from the passenger's side. if (!m_vehicle) return; GetVehicleBase()->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE, GetGUID()); - _ExitVehicle(exitPosition); + //! The following call would not even be executed successfully as the + //! SPELL_AURA_CONTROL_VEHICLE unapply handler already calls _ExitVehicle without + //! specifying an exitposition. The subsequent call below would return on if (!m_vehicle). + /*_ExitVehicle(exitPosition);*/ + //! To do: + //! We need to allow SPELL_AURA_CONTROL_VEHICLE unapply handlers in spellscripts + //! to specify exit coordinates and either store those per passenger, or we need to + //! init spline movement based on those coordinates in unapply handlers, and + //! relocate exiting passengers based on Unit::moveSpline data. Either way, + //! Coming Soon™ } void Unit::_ExitVehicle(Position const* exitPosition) @@ -17393,7 +17386,11 @@ bool CharmInfo::IsCommandAttack() void CharmInfo::SaveStayPosition() { - m_unit->GetPosition(m_stayX, m_stayY, m_stayZ); + //! At this point a new spline destination is enabled because of Unit::StopMoving() + G3D::Vector3 const stayPos = m_unit->movespline->FinalDestination(); + m_stayX = stayPos.x; + m_stayY = stayPos.y; + m_stayZ = stayPos.z; } void CharmInfo::GetStayPosition(float &x, float &y, float &z) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 423f83844d3..e55141a3bae 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1394,7 +1394,6 @@ class Unit : public WorldObject bool IsNeutralToAll() const; bool IsInPartyWith(Unit const* unit) const; bool IsInRaidWith(Unit const* unit) const; - bool IsTargetMatchingCheck(Unit const* target, SpellTargetSelectionCheckTypes check) const; void GetPartyMemberInDist(std::list<Unit*> &units, float dist); void GetPartyMembers(std::list<Unit*> &units); void GetRaidMember(std::list<Unit*> &units, float dist); @@ -2008,7 +2007,8 @@ class Unit : public WorldObject uint32 BuildAuraStateUpdateForTarget(Unit* target) const; bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const ; void UnsummonAllTotems(); - Unit* SelectMagnetTarget(Unit* victim, SpellInfo const* spellInfo = NULL); + Unit* GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo); + Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = NULL); int32 SpellBaseDamageBonus(SpellSchoolMask schoolMask); int32 SpellBaseHealingBonus(SpellSchoolMask schoolMask); int32 SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit* pVictim); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2feb2eddf76..f50d4144b62 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -194,30 +194,8 @@ LanguageDesc const* GetLanguageDescByID(uint32 lang) bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clickee) const { Player const* playerClicker = clicker->ToPlayer(); - if (playerClicker) - { - if (questStart) - { - // not in expected required quest state - if ((!questStartCanActive || !playerClicker->IsActiveQuest(questStart)) && !playerClicker->GetQuestRewardStatus(questStart)) - return false; - } - - if (questEnd) - { - // not in expected forbidden quest state - if (playerClicker->GetQuestRewardStatus(questEnd)) - return false; - } - } - - if (auraRequired) - if (!clicker->HasAura(auraRequired)) - return false; - - if (auraForbidden) - if (clicker->HasAura(auraForbidden)) - return false; + if (!playerClicker) + return true; Unit const* summoner = NULL; // Check summoners for party @@ -226,9 +204,6 @@ bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clicke if (!summoner) summoner = clickee; - if (!playerClicker) - return true; - // This only applies to players switch (userType) { @@ -903,7 +878,8 @@ void ObjectMgr::LoadCreatureAddons() uint32 guid = fields[0].GetUInt32(); - if (_creatureDataStore.find(guid) == _creatureDataStore.end()) + CreatureData const* creData = GetCreatureData(guid); + if (!creData) { sLog->outErrorDb("Creature (GUID: %u) does not exist but has a record in `creature_addon`", guid); continue; @@ -912,6 +888,12 @@ void ObjectMgr::LoadCreatureAddons() CreatureAddon& creatureAddon = _creatureAddonStore[guid]; creatureAddon.path_id = fields[1].GetUInt32(); + if (creData->movementType == WAYPOINT_MOTION_TYPE && !creatureAddon.path_id) + { + const_cast<CreatureData*>(creData)->movementType = IDLE_MOTION_TYPE; + sLog->outErrorDb("Creature (GUID %u) has movement type set to WAYPOINT_MOTION_TYPE but no path assigned", guid); + } + creatureAddon.mount = fields[2].GetUInt32(); creatureAddon.bytes1 = fields[3].GetUInt32(); creatureAddon.bytes2 = fields[4].GetUInt32(); @@ -6701,7 +6683,7 @@ void ObjectMgr::LoadCorpses() PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSES)); if (!result) { - sLog->outString(">> Loaded 0 corpses. DB table `pet_name_generation` is empty."); + sLog->outString(">> Loaded 0 corpses. DB table `corpse` is empty."); sLog->outString(); return; } @@ -7110,8 +7092,8 @@ void ObjectMgr::LoadNPCSpellClickSpells() uint32 oldMSTime = getMSTime(); _spellClickInfoStore.clear(); - // 0 1 2 3 4 5 6 7 8 - QueryResult result = WorldDatabase.Query("SELECT npc_entry, spell_id, quest_start, quest_start_active, quest_end, cast_flags, aura_required, aura_forbidden, user_type FROM npc_spellclick_spells"); + // 0 1 2 3 + QueryResult result = WorldDatabase.Query("SELECT npc_entry, spell_id, cast_flags, user_type FROM npc_spellclick_spells"); if (!result) { @@ -7142,66 +7124,14 @@ void ObjectMgr::LoadNPCSpellClickSpells() continue; } - uint32 auraRequired = fields[6].GetUInt32(); - if (auraRequired) - { - SpellInfo const* aurReqInfo = sSpellMgr->GetSpellInfo(auraRequired); - if (!aurReqInfo) - { - sLog->outErrorDb("Table npc_spellclick_spells references unknown aura required %u. Skipping entry.", auraRequired); - continue; - } - } - - uint32 auraForbidden = fields[7].GetUInt32(); - if (auraForbidden) - { - SpellInfo const* aurForInfo = sSpellMgr->GetSpellInfo(auraForbidden); - if (!aurForInfo) - { - sLog->outErrorDb("Table npc_spellclick_spells references unknown aura forbidden %u. Skipping entry.", auraForbidden); - continue; - } - } - - uint32 quest_start = fields[2].GetUInt32(); - - // quest might be 0 to enable spellclick independent of any quest - if (quest_start) - { - if (_questTemplates.find(quest_start) == _questTemplates.end()) - { - sLog->outErrorDb("Table npc_spellclick_spells references unknown start quest %u. Skipping entry.", quest_start); - continue; - } - } - - bool quest_start_active = fields[3].GetBool(); - - uint32 quest_end = fields[4].GetUInt32(); - // quest might be 0 to enable spellclick active infinity after start quest - if (quest_end) - { - if (_questTemplates.find(quest_end) == _questTemplates.end()) - { - sLog->outErrorDb("Table npc_spellclick_spells references unknown end quest %u. Skipping entry.", quest_end); - continue; - } - } - - uint8 userType = fields[8].GetUInt8(); + uint8 userType = fields[3].GetUInt8(); if (userType >= SPELL_CLICK_USER_MAX) sLog->outErrorDb("Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType)); - uint8 castFlags = fields[5].GetUInt8(); + uint8 castFlags = fields[2].GetUInt8(); SpellClickInfo info; info.spellId = spellid; - info.questStart = quest_start; - info.questStartCanActive = quest_start_active; - info.questEnd = quest_end; info.castFlags = castFlags; - info.auraRequired = auraRequired; - info.auraForbidden = auraForbidden; info.userType = SpellClickUserTypes(userType); _spellClickInfoStore.insert(SpellClickInfoContainer::value_type(npc_entry, info)); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index fc342bfb534..4224f1e2bfd 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -337,12 +337,7 @@ std::string GetScriptCommandName(ScriptCommands command); struct SpellClickInfo { uint32 spellId; - uint32 questStart; // quest start (quest must be active or rewarded for spell apply) - uint32 questEnd; // quest end (quest must not be rewarded for spell apply) - bool questStartCanActive; // if true then quest start can be active (not only rewarded) uint8 castFlags; - uint32 auraRequired; - uint32 auraForbidden; SpellClickUserTypes userType; // helpers diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index 8651680cb49..d096bb7ab63 100644 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -65,6 +65,16 @@ typedef GridRefManager<DynamicObject> DynamicObjectMapType; typedef GridRefManager<GameObject> GameObjectMapType; typedef GridRefManager<Player> PlayerMapType; +enum GridMapTypeMask +{ + GRID_MAP_TYPE_MASK_CORPSE = 0x01, + GRID_MAP_TYPE_MASK_CREATURE = 0x02, + GRID_MAP_TYPE_MASK_DYNAMICOBJECT = 0x04, + GRID_MAP_TYPE_MASK_GAMEOBJECT = 0x08, + GRID_MAP_TYPE_MASK_PLAYER = 0x10, + GRID_MAP_TYPE_MASK_ALL = 0x1F +}; + typedef Grid<Player, AllWorldObjectTypes, AllGridObjectTypes> GridType; typedef NGrid<MAX_NUMBER_OF_CELLS, Player, AllWorldObjectTypes, AllGridObjectTypes> NGridType; diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp index 2446e9d4276..17d3066e64d 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp +++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp @@ -343,24 +343,17 @@ bool AnyDeadUnitObjectInRangeCheck::operator()(Creature* u) bool AnyDeadUnitSpellTargetInRangeCheck::operator()(Player* u) { - return AnyDeadUnitObjectInRangeCheck::operator()(u) - && (i_spellInfo->CheckTarget(i_searchObj, u, true) == SPELL_CAST_OK) - && i_searchObj->IsTargetMatchingCheck(u, i_check); + return AnyDeadUnitObjectInRangeCheck::operator()(u) && i_check(u); } bool AnyDeadUnitSpellTargetInRangeCheck::operator()(Corpse* u) { - Player* owner = ObjectAccessor::FindPlayer(u->GetOwnerGUID()); - return owner && AnyDeadUnitObjectInRangeCheck::operator()(u) - && (i_spellInfo->CheckTarget(i_searchObj, owner, true) == SPELL_CAST_OK) - && i_searchObj->IsTargetMatchingCheck(owner, i_check); + return AnyDeadUnitObjectInRangeCheck::operator()(u) && i_check(u); } bool AnyDeadUnitSpellTargetInRangeCheck::operator()(Creature* u) { - return AnyDeadUnitObjectInRangeCheck::operator()(u) - && (i_spellInfo->CheckTarget(i_searchObj, u, true) == SPELL_CAST_OK) - && i_searchObj->IsTargetMatchingCheck(u, i_check); + return AnyDeadUnitObjectInRangeCheck::operator()(u) && i_check(u); } template void ObjectUpdater::Visit<GameObject>(GameObjectMapType &); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 4112711ad3c..7ffdf687561 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -30,6 +30,7 @@ #include "Player.h" #include "Unit.h" #include "CreatureAI.h" +#include "Spell.h" class Player; //class Map; @@ -168,12 +169,33 @@ namespace Trinity template<class Check> struct WorldObjectSearcher { + uint32 i_mapTypeMask; uint32 i_phaseMask; WorldObject* &i_object; Check &i_check; - WorldObjectSearcher(WorldObject const* searcher, WorldObject* & result, Check& check) - : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {} + WorldObjectSearcher(WorldObject const* searcher, WorldObject* & result, Check& check, uint32 mapTypeMask = GRID_MAP_TYPE_MASK_ALL) + : i_mapTypeMask(mapTypeMask), i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {} + + void Visit(GameObjectMapType &m); + void Visit(PlayerMapType &m); + void Visit(CreatureMapType &m); + void Visit(CorpseMapType &m); + void Visit(DynamicObjectMapType &m); + + template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {} + }; + + template<class Check> + struct WorldObjectLastSearcher + { + uint32 i_mapTypeMask; + uint32 i_phaseMask; + WorldObject* &i_object; + Check &i_check; + + WorldObjectLastSearcher(WorldObject const* searcher, WorldObject* & result, Check& check, uint32 mapTypeMask = GRID_MAP_TYPE_MASK_ALL) + : i_mapTypeMask(mapTypeMask), i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {} void Visit(GameObjectMapType &m); void Visit(PlayerMapType &m); @@ -187,12 +209,13 @@ namespace Trinity template<class Check> struct WorldObjectListSearcher { + uint32 i_mapTypeMask; uint32 i_phaseMask; std::list<WorldObject*> &i_objects; Check& i_check; - WorldObjectListSearcher(WorldObject const* searcher, std::list<WorldObject*> &objects, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) {} + WorldObjectListSearcher(WorldObject const* searcher, std::list<WorldObject*> &objects, Check & check, uint32 mapTypeMask = GRID_MAP_TYPE_MASK_ALL) + : i_mapTypeMask(mapTypeMask), i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) {} void Visit(PlayerMapType &m); void Visit(CreatureMapType &m); @@ -206,14 +229,17 @@ namespace Trinity template<class Do> struct WorldObjectWorker { + uint32 i_mapTypeMask; uint32 i_phaseMask; Do const& i_do; - WorldObjectWorker(WorldObject const* searcher, Do const& _do) - : i_phaseMask(searcher->GetPhaseMask()), i_do(_do) {} + WorldObjectWorker(WorldObject const* searcher, Do const& _do, uint32 mapTypeMask = GRID_MAP_TYPE_MASK_ALL) + : i_mapTypeMask(mapTypeMask), i_phaseMask(searcher->GetPhaseMask()), i_do(_do) {} void Visit(GameObjectMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT)) + return; for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->getSource()->InSamePhase(i_phaseMask)) i_do(itr->getSource()); @@ -221,12 +247,16 @@ namespace Trinity void Visit(PlayerMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER)) + return; for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->getSource()->InSamePhase(i_phaseMask)) i_do(itr->getSource()); } void Visit(CreatureMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE)) + return; for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->getSource()->InSamePhase(i_phaseMask)) i_do(itr->getSource()); @@ -234,6 +264,8 @@ namespace Trinity void Visit(CorpseMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE)) + return; for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->getSource()->InSamePhase(i_phaseMask)) i_do(itr->getSource()); @@ -241,6 +273,8 @@ namespace Trinity void Visit(DynamicObjectMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT)) + return; for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->getSource()->InSamePhase(i_phaseMask)) i_do(itr->getSource()); @@ -527,75 +561,11 @@ namespace Trinity // CHECKS && DO classes // WorldObject check classes - class RaiseDeadObjectCheck - { - public: - RaiseDeadObjectCheck(Unit* source, float range) : _source(source), i_range(range) {} - bool operator()(Creature* u) - { - if (_source->GetTypeId() != TYPEID_PLAYER || !((Player*)_source)->isHonorOrXPTarget(u) || - u->getDeathState() != CORPSE || - (u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1))) == 0 || - (u->GetDisplayId() != u->GetNativeDisplayId())) - return false; - - return _source->IsWithinDistInMap(u, i_range); - } - - bool operator()(Player* u) - { - if (_source == u || _source->GetTypeId() != TYPEID_PLAYER || !((Player*)_source)->isHonorOrXPTarget(u) || - u->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST) || u->isInFlight() || !u->isDead() || - (u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1))) == 0) - return false; - - return _source->IsWithinDistInMap(u, i_range); - } - - bool operator()(Corpse* u) - { - if (_source->GetTypeId() != TYPEID_PLAYER || u->GetType() == CORPSE_BONES) - return false; - - return _source->IsWithinDistInMap(u, i_range); - } - template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED*) { return false; } - private: - Unit* const _source; - float i_range; - }; - - class ExplodeCorpseObjectCheck - { - public: - ExplodeCorpseObjectCheck(Unit* funit, float range) : i_funit(funit), i_range(range) {} - bool operator()(Player* u) - { - if (u->getDeathState() != CORPSE || u->isInFlight() || - u->HasAuraType(SPELL_AURA_GHOST) || (u->GetDisplayId() != u->GetNativeDisplayId())) - return false; - - return i_funit->IsWithinDistInMap(u, i_range); - } - bool operator()(Creature* u) - { - if (u->getDeathState() != CORPSE || u->isInFlight() || - (u->GetDisplayId() != u->GetNativeDisplayId()) || - (u->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL) != 0) - return false; - - return i_funit->IsWithinDistInMap(u, i_range); - } - template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED*) { return false; } - private: - Unit* const i_funit; - float i_range; - }; class AnyDeadUnitObjectInRangeCheck { public: - AnyDeadUnitObjectInRangeCheck(Unit const* searchObj, float range) : i_searchObj(searchObj), i_range(range) {} + AnyDeadUnitObjectInRangeCheck(Unit* searchObj, float range) : i_searchObj(searchObj), i_range(range) {} bool operator()(Player* u); bool operator()(Corpse* u); bool operator()(Creature* u); @@ -608,15 +578,16 @@ namespace Trinity class AnyDeadUnitSpellTargetInRangeCheck : public AnyDeadUnitObjectInRangeCheck { public: - AnyDeadUnitSpellTargetInRangeCheck(Unit const* searchObj, float range, SpellInfo const* spellInfo, SpellTargetSelectionCheckTypes check) - : AnyDeadUnitObjectInRangeCheck(searchObj, range), i_spellInfo(spellInfo), i_check(check) {} + AnyDeadUnitSpellTargetInRangeCheck(Unit* searchObj, float range, SpellInfo const* spellInfo, SpellTargetCheckTypes check) + : AnyDeadUnitObjectInRangeCheck(searchObj, range), i_spellInfo(spellInfo), i_check(searchObj, searchObj, spellInfo, check, NULL) + {} bool operator()(Player* u); bool operator()(Corpse* u); bool operator()(Creature* u); template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED*) { return false; } protected: SpellInfo const* i_spellInfo; - SpellTargetSelectionCheckTypes i_check; + WorldObjectSpellTargetCheck i_check; }; // WorldObject do classes diff --git a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h index 34fe7757c5f..40b3863679b 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h +++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h @@ -51,6 +51,9 @@ inline void Trinity::ObjectUpdater::Visit(CreatureMapType &m) template<class Check> void Trinity::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT)) + return; + // already found if (i_object) return; @@ -71,6 +74,9 @@ void Trinity::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m) template<class Check> void Trinity::WorldObjectSearcher<Check>::Visit(PlayerMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER)) + return; + // already found if (i_object) return; @@ -91,6 +97,9 @@ void Trinity::WorldObjectSearcher<Check>::Visit(PlayerMapType &m) template<class Check> void Trinity::WorldObjectSearcher<Check>::Visit(CreatureMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE)) + return; + // already found if (i_object) return; @@ -111,6 +120,9 @@ void Trinity::WorldObjectSearcher<Check>::Visit(CreatureMapType &m) template<class Check> void Trinity::WorldObjectSearcher<Check>::Visit(CorpseMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE)) + return; + // already found if (i_object) return; @@ -131,6 +143,9 @@ void Trinity::WorldObjectSearcher<Check>::Visit(CorpseMapType &m) template<class Check> void Trinity::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT)) + return; + // already found if (i_object) return; @@ -148,9 +163,93 @@ void Trinity::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m) } } + +template<class Check> +void Trinity::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType &m) +{ + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT)) + return; + + for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) + { + if (!itr->getSource()->InSamePhase(i_phaseMask)) + continue; + + if (i_check(itr->getSource())) + i_object = itr->getSource(); + } +} + +template<class Check> +void Trinity::WorldObjectLastSearcher<Check>::Visit(PlayerMapType &m) +{ + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER)) + return; + + for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) + { + if (!itr->getSource()->InSamePhase(i_phaseMask)) + continue; + + if (i_check(itr->getSource())) + i_object = itr->getSource(); + } +} + +template<class Check> +void Trinity::WorldObjectLastSearcher<Check>::Visit(CreatureMapType &m) +{ + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE)) + return; + + for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) + { + if (!itr->getSource()->InSamePhase(i_phaseMask)) + continue; + + if (i_check(itr->getSource())) + i_object = itr->getSource(); + } +} + +template<class Check> +void Trinity::WorldObjectLastSearcher<Check>::Visit(CorpseMapType &m) +{ + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE)) + return; + + for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr) + { + if (!itr->getSource()->InSamePhase(i_phaseMask)) + continue; + + if (i_check(itr->getSource())) + i_object = itr->getSource(); + } +} + +template<class Check> +void Trinity::WorldObjectLastSearcher<Check>::Visit(DynamicObjectMapType &m) +{ + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT)) + return; + + for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) + { + if (!itr->getSource()->InSamePhase(i_phaseMask)) + continue; + + if (i_check(itr->getSource())) + i_object = itr->getSource(); + } +} + template<class Check> void Trinity::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER)) + return; + for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->getSource()->InSamePhase(i_phaseMask)) if (i_check(itr->getSource())) @@ -160,6 +259,9 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m) template<class Check> void Trinity::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE)) + return; + for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->getSource()->InSamePhase(i_phaseMask)) if (i_check(itr->getSource())) @@ -169,6 +271,9 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m) template<class Check> void Trinity::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE)) + return; + for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->getSource()->InSamePhase(i_phaseMask)) if (i_check(itr->getSource())) @@ -178,6 +283,9 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m) template<class Check> void Trinity::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT)) + return; + for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->getSource()->InSamePhase(i_phaseMask)) if (i_check(itr->getSource())) @@ -187,6 +295,9 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m) template<class Check> void Trinity::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType &m) { + if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT)) + return; + for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->getSource()->InSamePhase(i_phaseMask)) if (i_check(itr->getSource())) diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index fc87d3ed8d6..f99bfe52df3 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -123,6 +123,12 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) uint64 itemGUIDs[MAX_AUCTION_ITEMS]; // 160 slot = 4x 36 slot bag + backpack 16 slot uint32 count[MAX_AUCTION_ITEMS]; + if (itemsCount > MAX_AUCTION_ITEMS) + { + SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR); + return; + } + for (uint32 i = 0; i < itemsCount; ++i) { recv_data >> itemGUIDs[i]; @@ -153,12 +159,6 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) return; } - if (itemsCount > MAX_AUCTION_ITEMS) - { - SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR); - return; - } - etime *= MINUTE; switch(etime) @@ -188,7 +188,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) return; } - if (sAuctionMgr->GetAItem(item->GetGUIDLow()) || !item->CanBeTraded() || item->IsNotEmptyBag() || + if (sAuctionMgr->GetAItem(item->GetGUIDLow()) || !item->CanBeTraded() || item->IsNotEmptyBag() || item->GetTemplate()->Flags & ITEM_PROTO_FLAG_CONJURED || item->GetUInt32Value(ITEM_FIELD_DURATION) || item->GetCount() < count[i]) { diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index be547c84b19..820079a90e1 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -88,7 +88,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) data << uint32(counter); // raid reset count std::set<uint32> sentMaps; - + ResetTimeByMapDifficultyMap const& resets = sInstanceSaveMgr->GetResetTimeMap(); for (ResetTimeByMapDifficultyMap::const_iterator itr = resets.begin(); itr != resets.end(); ++itr) { @@ -102,7 +102,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) continue; sentMaps.insert(mapId); - + data << uint32(mapId); data << uint32(itr->second - cur_time); data << uint32(mapEntry->unk_time); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 310bda92739..a48cf70bd54 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -197,7 +197,7 @@ bool LoginQueryHolder::Initialize() stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_INSTANCELOCKTIMES); stmt->setUInt32(0, m_accountId); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES, stmt); - + return res; } @@ -615,6 +615,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte } Player newChar(this); + newChar.GetMotionMaster()->Initialize(); if (!newChar.Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PLAYER), createInfo)) { // Player not create (race/class/etc problem?) diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index dbe2fc871bc..3b56a0712e1 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1172,16 +1172,6 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recv_data) GetPlayer()->SetByteValue(PLAYER_FIELD_BYTES, 2, ActionBar); } -void WorldSession::HandleWardenDataOpcode(WorldPacket& recv_data) -{ - recv_data.read_skip<uint8>(); - /* - uint8 tmp; - recv_data >> tmp; - sLog->outDebug("Received opcode CMSG_WARDEN_DATA, not resolve.uint8 = %u", tmp); - */ -} - void WorldSession::HandlePlayedTime(WorldPacket& recv_data) { uint8 unk1; diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 1f286a0af05..6a44c7ae5e2 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -615,7 +615,7 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data) Pet* pet = _player->GetPet(); // can't place in stable dead pet - if (!pet||!pet->isAlive()||pet->getPetType() != HUNTER_PET) + if (!pet || !pet->isAlive() || pet->getPetType() != HUNTER_PET) { SendStableResult(STABLE_ERR_STABLE); return; @@ -853,16 +853,22 @@ void WorldSession::HandleStableSwapPetCallback(PreparedQueryResult result, uint3 return; } - // move alive pet to slot or delete dead pet Pet* pet = _player->GetPet(); + // The player's pet could have been removed during the delay of the DB callback + if (!pet) + { + SendStableResult(STABLE_ERR_STABLE); + return; + } + // move alive pet to slot or delete dead pet _player->RemovePet(pet, pet->isAlive() ? PetSaveMode(slot) : PET_SAVE_AS_DELETED); // summon unstabled pet - Pet* newpet = new Pet(_player); - if (!newpet->LoadPetFromDB(_player, petEntry, petId)) + Pet* newPet = new Pet(_player); + if (!newPet->LoadPetFromDB(_player, petEntry, petId)) { - delete newpet; + delete newPet; SendStableResult(STABLE_ERR_STABLE); } else diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 16b6a4bb714..8da7683459e 100755 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -155,6 +155,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid case COMMAND_STAY: //flat=1792 //STAY pet->AttackStop(); pet->InterruptNonMeleeSpells(false); + pet->StopMoving(); pet->GetMotionMaster()->Clear(false); pet->GetMotionMaster()->MoveIdle(); charmInfo->SetCommandState(COMMAND_STAY); diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 8eb1eab06d9..44889e6dda8 100755 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -292,3 +292,12 @@ void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recv_data) GetPlayer()->ActivateTaxiPathTo(nodes, npc); } + +void WorldSession::SendActivateTaxiReply(ActivateTaxiReply reply) +{ + WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); + data << uint32(reply); + SendPacket(&data); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ACTIVATETAXIREPLY"); +} diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index dc0eb2dd857..cf517ccfbb4 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -1544,7 +1544,7 @@ inline GridMap* Map::GetGrid(float x, float y) return GridMaps[gx][gy]; } -float Map::GetWaterOrGroundLevel(float x, float y, float z, float* ground /*= NULL*/, bool swim /*= false*/) const +float Map::GetWaterOrGroundLevel(float x, float y, float z, float* ground /*= NULL*/, bool /*swim = false*/) const { if (const_cast<Map*>(this)->GetGrid(x, y)) { @@ -1556,7 +1556,7 @@ float Map::GetWaterOrGroundLevel(float x, float y, float z, float* ground /*= NU LiquidData liquid_status; ZLiquidStatus res = getLiquidStatus(x, y, ground_z, MAP_ALL_LIQUIDS, &liquid_status); - return res ? ( swim ? liquid_status.level - 2.0f : liquid_status.level) : ground_z; + return res ? liquid_status.level : ground_z; } return VMAP_INVALID_HEIGHT_VALUE; diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 9f4dbb23b63..d8db4c947a3 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -171,7 +171,7 @@ class GridMap uint8 _liquidOffY; uint8 _liquidWidth; uint8 _liquidHeight; - + bool loadAreaData(FILE* in, uint32 offset, uint32 size); bool loadHeihgtData(FILE* in, uint32 offset, uint32 size); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index f5f8133ebef..fbc84b85a80 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3405,4 +3405,21 @@ enum RemoveMethod GROUP_REMOVEMETHOD_LEAVE = 2, }; +enum ActivateTaxiReply +{ + ERR_TAXIOK = 0, + ERR_TAXIUNSPECIFIEDSERVERERROR = 1, + ERR_TAXINOSUCHPATH = 2, + ERR_TAXINOTENOUGHMONEY = 3, + ERR_TAXITOOFARAWAY = 4, + ERR_TAXINOVENDORNEARBY = 5, + ERR_TAXINOTVISITED = 6, + ERR_TAXIPLAYERBUSY = 7, + ERR_TAXIPLAYERALREADYMOUNTED = 8, + ERR_TAXIPLAYERSHAPESHIFTED = 9, + ERR_TAXIPLAYERMOVING = 10, + ERR_TAXISAMENODE = 11, + ERR_TAXINOTSTANDING = 12 +}; + #endif diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index 964b4402438..064a8fc8297 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -38,15 +38,18 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner) return; float x, y, z; - - if (i_offset && i_target->IsWithinDistInMap(&owner,2*i_offset)) - { - if (!owner.movespline->Finalized()) - return; - - owner.GetPosition(x, y, z); - } - else if (!i_offset) + //! Following block of code deleted by MrSmite in issue 4891 + //! Code kept for learning and diagnostical purposes +// +// if (i_offset && i_target->IsWithinDistInMap(&owner,2*i_offset)) +// { +// if (!owner.movespline->Finalized()) +// return; +// +// owner.GetPosition(x, y, z); +// } +// else + if (!i_offset) { if (i_target->IsWithinMeleeRange(&owner)) return; diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 1871454d614..fb2249c508e 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -111,8 +111,8 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature &creature) m_isArrivalDone = false; - creature.AddUnitState(UNIT_STATE_ROAMING_MOVE); - + creature.AddUnitState(UNIT_STATE_ROAMING_MOVE); + Movement::MoveSplineInit init(creature); init.MoveTo(node->x, node->y, node->z); @@ -147,7 +147,7 @@ bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint3 if (CanMove(diff)) return StartMove(creature); } - else + else { if (creature.IsStopped()) Stop(STOP_TIME_FOR_PLAYER); @@ -155,7 +155,7 @@ bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint3 { OnArrived(creature); return StartMove(creature); - } + } } return true; } @@ -293,7 +293,7 @@ bool FlightPathMovementGenerator::GetResetPosition(Player&, float& x, float& y, x = node.x; y = node.y; z = node.z; return true; } - + void FlightPathMovementGenerator::InitEndGridInfo() { /*! Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3ea2d6b690d..4335452635b 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -769,7 +769,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x2E4*/ { "SMSG_AREA_SPIRIT_HEALER_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x2E5*/ { "CMSG_GM_UNTEACH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x2E6*/ { "SMSG_WARDEN_DATA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2E7*/ { "CMSG_WARDEN_DATA", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode }, + /*0x2E7*/ { "CMSG_WARDEN_DATA", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode }, /*0x2E8*/ { "SMSG_GROUP_JOINED_BATTLEGROUND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x2E9*/ { "MSG_BATTLEGROUND_PLAYER_POSITIONS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode}, /*0x2EA*/ { "CMSG_PET_STOP_ATTACK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack }, diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index ab107fd0599..211ca42d310 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -42,6 +42,8 @@ #include "zlib.h" #include "ScriptMgr.h" #include "Transport.h" +#include "WardenWin.h" +#include "WardenMac.h" bool MapSessionFilter::Process(WorldPacket* packet) { @@ -96,6 +98,8 @@ m_sessionDbLocaleIndex(locale), m_latency(0), m_TutorialsChanged(false), recruiterId(recruiter), isRecruiter(isARecruiter), timeLastWhoCommand(0) { + _warden = NULL; + if (sock) { m_Address = sock->GetRemoteAddress(); @@ -122,6 +126,9 @@ WorldSession::~WorldSession() m_Socket = NULL; } + if (_warden) + delete _warden; + ///- empty incoming packet queue WorldPacket* packet = NULL; while (_recvQueue.next(packet)) @@ -142,6 +149,12 @@ char const* WorldSession::GetPlayerName() const return GetPlayer() ? GetPlayer()->GetName() : "<none>"; } +/// Get player guid if available. Use for logging purposes only +uint32 WorldSession::GetGuidLow() const +{ + return GetPlayer() ? GetPlayer()->GetGUIDLow() : 0; +} + /// Send a packet to the client void WorldSession::SendPacket(WorldPacket const* packet) { @@ -348,6 +361,9 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) delete packet; } + if (m_Socket && !m_Socket->IsClosed() && _warden) + _warden->Update(); + ProcessQueryCallbacks(); //check if we are safe to proceed with logout @@ -359,6 +375,9 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) if (ShouldLogOut(currTime) && !m_playerLoading) LogoutPlayer(true); + if (m_Socket && GetPlayer() && _warden) + _warden->Update(); + ///- Cleanup socket pointer if need if (m_Socket && m_Socket->IsClosed()) { @@ -1101,3 +1120,18 @@ void WorldSession::ProcessQueryCallbacks() _stableSwapCallback.FreeResult(); } } + +void WorldSession::InitWarden(BigNumber* k, std::string os) +{ + if (os == "Win") + { + _warden = new WardenWin(); + _warden->Init(this, k); + } + else if (os == "OSX") + { + // Disabled as it is causing the client to crash + // _warden = new WardenMac(); + // _warden->Init(this, k); + } +} diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 951f205c1e2..90772bfeab9 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -29,6 +29,7 @@ #include "DatabaseEnv.h" #include "World.h" #include "WorldPacket.h" +#include "Cryptography/BigNumber.h" struct ItemTemplate; struct AuctionEntry; @@ -46,6 +47,7 @@ class WorldPacket; class WorldSocket; class LoginQueryHolder; class SpellCastTargets; +class Warden; struct AreaTableEntry; struct LfgJoinResultData; struct LfgLockStatus; @@ -242,11 +244,14 @@ class WorldSession uint32 GetAccountId() const { return _accountId; } Player* GetPlayer() const { return _player; } char const* GetPlayerName() const; + uint32 GetGuidLow() const; void SetSecurity(AccountTypes security) { _security = security; } std::string const& GetRemoteAddress() { return m_Address; } void SetPlayer(Player* player); uint8 Expansion() const { return m_expansion; } + void InitWarden(BigNumber* k, std::string os); + /// Session in auth.queue currently void SetInQueue(bool state) { m_inQueue = state; } @@ -488,6 +493,7 @@ class WorldSession void HandleSetActionButtonOpcode(WorldPacket& recvPacket); void HandleGameObjectUseOpcode(WorldPacket& recPacket); + void HandleMeetingStoneInfo(WorldPacket& recPacket); void HandleGameobjectReportUse(WorldPacket& recvPacket); void HandleNameQueryOpcode(WorldPacket& recvPacket); @@ -571,6 +577,7 @@ class WorldSession void HandleActivateTaxiOpcode(WorldPacket& recvPacket); void HandleActivateTaxiExpressOpcode(WorldPacket& recvPacket); void HandleMoveSplineDoneOpcode(WorldPacket& recvPacket); + void SendActivateTaxiReply(ActivateTaxiReply reply); void HandleTabardVendorActivateOpcode(WorldPacket& recvPacket); void HandleBankerActivateOpcode(WorldPacket& recvPacket); @@ -933,6 +940,9 @@ class WorldSession typedef std::list<AddonInfo> AddonsList; + // Warden + Warden* _warden; // Remains NULL if Warden system is not enabled by config + time_t _logoutTime; bool m_inQueue; // session wait in auth.queue bool m_playerLoading; // code processed in LoginPlayer diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index ac6f11660e4..2c6098fb23f 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -778,11 +778,11 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) //uint8 expansion = 0; LocaleConstant locale; std::string account; - SHA1Hash sha1; + SHA1Hash sha; BigNumber v, s, g, N; WorldPacket packet, SendAddonPacked; - BigNumber K; + BigNumber k; if (sWorld->IsClosed()) { @@ -816,21 +816,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) LoginDatabase.EscapeString (safe_account); // No SQL injection, username escaped. - QueryResult result = - LoginDatabase.PQuery ("SELECT " - "id, " //0 - "sessionkey, " //1 - "last_ip, " //2 - "locked, " //3 - "v, " //4 - "s, " //5 - "expansion, " //6 - "mutetime, " //7 - "locale, " //8 - "recruiter " //9 - "FROM account " - "WHERE username = '%s'", - safe_account.c_str()); + // 0 1 2 3 4 5 6 7 8 9 10 + QueryResult result = LoginDatabase.PQuery ("SELECT id, sessionkey, last_ip, locked, v, s, expansion, mutetime, locale, recruiter, os FROM account " + "WHERE username = '%s'", safe_account.c_str()); // Stop if the account is not found if (!result) @@ -882,7 +870,12 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) } id = fields[0].GetUInt32(); - K.SetHexStr (fields[1].GetCString()); + /* + if (security > SEC_ADMINISTRATOR) // prevent invalid security settings in DB + security = SEC_ADMINISTRATOR; + */ + + k.SetHexStr (fields[1].GetCString()); int64 mutetime = fields[7].GetInt64(); //! Negative mutetime indicates amount of seconds to be muted effective on next login - which is now. @@ -903,6 +896,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) locale = LOCALE_enUS; uint32 recruiter = fields[9].GetUInt32(); + std::string os = fields[10].GetString(); // Checks gmlevel per Realm result = @@ -954,8 +948,6 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) } // Check that Key and account name are the same on client and server - SHA1Hash sha; - uint32 t = 0; uint32 seed = m_Seed; @@ -963,7 +955,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) sha.UpdateData ((uint8 *) & t, 4); sha.UpdateData ((uint8 *) & clientSeed, 4); sha.UpdateData ((uint8 *) & seed, 4); - sha.UpdateBigNumbers (&K, NULL); + sha.UpdateBigNumbers (&k, NULL); sha.Finalize(); if (memcmp (sha.GetDigest(), digest, 20)) @@ -1002,12 +994,16 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) // NOTE ATM the socket is single-threaded, have this in mind ... ACE_NEW_RETURN (m_Session, WorldSession (id, this, AccountTypes(security), expansion, mutetime, locale, recruiter, isRecruiter), -1); - m_Crypt.Init(&K); + m_Crypt.Init(&k); m_Session->LoadGlobalAccountData(); m_Session->LoadTutorialsData(); m_Session->ReadAddonsInfo(recvPacket); + // Initialize Warden system only if it is enabled by config + if (sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED)) + m_Session->InitWarden(&k, os); + // Sleep this Network thread for uint32 sleepTime = sWorld->getIntConfig(CONFIG_SESSION_ADD_DELAY); ACE_OS::sleep (ACE_Time_Value (0, sleepTime)); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 73039d15620..99497870a15 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -374,7 +374,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster): m_base(base), m_spellInfo(base->GetSpellInfo()), -m_baseAmount(baseAmount ? *baseAmount : m_spellInfo->Effects[m_effIndex].BasePoints), +m_baseAmount(baseAmount ? *baseAmount : m_spellInfo->Effects[effIndex].BasePoints), m_spellmod(NULL), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex), m_canBeRecalculated(true), m_isPeriodic(false) { diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 490f33f46e1..64079918638 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -104,7 +104,7 @@ class AuraEffect int32 m_periodicTimer; int32 m_amplitude; uint32 m_tickNumber; - + uint8 const m_effIndex; bool m_canBeRecalculated; bool m_isPeriodic; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index ee5827cdb98..5329c1a0914 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1840,6 +1840,10 @@ bool Aura::CanStackWith(Aura const* existingAura) const if (!sameCaster) { + // Channeled auras can stack if not forbidden by db or aura type + if (existingAura->GetSpellInfo()->IsChanneled()) + return true; + if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_STACK_FOR_DIFF_CASTERS) return true; @@ -2041,7 +2045,7 @@ void Aura::TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo) if (aurApp->HasEffect(i)) // TODO: OnEffectProc hook here (allowing prevention of selected effects) GetEffect(i)->HandleProc(aurApp, eventInfo); - // TODO: AfterEffectProc hook here + // TODO: AfterEffectProc hook here // TODO: AfterProc hook here diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 0af8d132211..2f50d47a79b 100755 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -21,6 +21,7 @@ #include "SpellAuraDefines.h" #include "SpellInfo.h" +#include "Unit.h" class Unit; class SpellInfo; @@ -186,7 +187,7 @@ class Aura bool CanStackWith(Aura const* existingAura) const; // Proc system - // this subsystem is not yet in use - the core of it is functional, but still some research has to be done + // this subsystem is not yet in use - the core of it is functional, but still some research has to be done // and some dependant problems fixed before it can replace old proc system (for example cooldown handling) // currently proc system functionality is implemented in Unit::ProcDamageAndSpell bool IsProcOnCooldown() const; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index cc159a613c3..e4724d58a3c 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -592,19 +592,6 @@ Spell::~Spell() CheckEffectExecuteData(); } -template<typename T> -WorldObject* Spell::FindCorpseUsing() -{ - // non-standard target selection - float max_range = m_spellInfo->GetMaxRange(false); - - WorldObject* result = NULL; - T u_check(m_caster, max_range); - Trinity::WorldObjectSearcher<T> searcher(m_caster, result, u_check); - m_caster->GetMap()->VisitFirstFound(m_caster->GetPositionX(), m_caster->GetPositionY(), max_range, searcher); - return result; -} - void Spell::InitExplicitTargets(SpellCastTargets const& targets) { m_targets = targets; @@ -674,9 +661,41 @@ void Spell::InitExplicitTargets(SpellCastTargets const& targets) m_targets.RemoveSrc(); } +void Spell::SelectExplicitTargets() +{ + // here go all explicit target changes made to explicit targets after spell prepare phase is finished + if (Unit* target = m_targets.GetUnitTarget()) + { + // check for explicit target redirection, for Grounding Totem for example + if (m_spellInfo->GetExplicitTargetMask() & TARGET_FLAG_UNIT_ENEMY + || (m_spellInfo->GetExplicitTargetMask() & TARGET_FLAG_UNIT && !m_spellInfo->IsPositive())) + { + Unit* redirect; + switch (m_spellInfo->DmgClass) + { + case SPELL_DAMAGE_CLASS_MAGIC: + redirect = m_caster->GetMagicHitRedirectTarget(target, m_spellInfo); + break; + case SPELL_DAMAGE_CLASS_MELEE: + case SPELL_DAMAGE_CLASS_RANGED: + redirect = m_caster->GetMeleeHitRedirectTarget(target, m_spellInfo); + break; + default: + redirect = NULL; + break; + } + if (redirect && (redirect != target)) + m_targets.SetUnitTarget(redirect); + } + } +} + void Spell::SelectSpellTargets() { - uint32 processedTargets = 0; + // select targets for cast phase + SelectExplicitTargets(); + + uint32 processedAreaEffectsMask = 0; for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) { // not call for empty effect. @@ -684,9 +703,6 @@ void Spell::SelectSpellTargets() if (!m_spellInfo->Effects[i].IsEffect()) continue; - if (processedTargets & (1 << i)) - continue; - // set expected type of implicit targets to be sent to client uint32 implicitTargetMask = GetTargetFlagMask(m_spellInfo->Effects[i].TargetA.GetObjectType()) | GetTargetFlagMask(m_spellInfo->Effects[i].TargetB.GetObjectType()); if (implicitTargetMask & TARGET_FLAG_UNIT) @@ -694,13 +710,8 @@ void Spell::SelectSpellTargets() if (implicitTargetMask & (TARGET_FLAG_GAMEOBJECT | TARGET_FLAG_GAMEOBJECT_ITEM)) m_targets.SetTargetFlag(TARGET_FLAG_GAMEOBJECT); - uint32 targetA = m_spellInfo->Effects[i].TargetA.GetTarget(); - uint32 targetB = m_spellInfo->Effects[i].TargetB.GetTarget(); - - if (targetA) - processedTargets |= SelectEffectTargets(i, m_spellInfo->Effects[i].TargetA); - if (targetB) - processedTargets |= SelectEffectTargets(i, m_spellInfo->Effects[i].TargetB); + SelectEffectImplicitTargets(SpellEffIndex(i), m_spellInfo->Effects[i].TargetA, processedAreaEffectsMask); + SelectEffectImplicitTargets(SpellEffIndex(i), m_spellInfo->Effects[i].TargetB, processedAreaEffectsMask); // Select targets of effect based on effect type // those are used when no valid target could be added for spell effect based on spell target type @@ -762,6 +773,931 @@ void Spell::SelectSpellTargets() } } +void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32& processedEffectMask) +{ + if (!targetType.GetTarget()) + return; + + uint32 effectMask = 1 << effIndex; + // set the same target list for all effects + // some spells appear to need this, however this requires more research + switch (targetType.GetSelectionCategory()) + { + case TARGET_SELECT_CATEGORY_NEARBY: + case TARGET_SELECT_CATEGORY_CONE: + case TARGET_SELECT_CATEGORY_AREA: + // targets for effect already selected + if (effectMask & processedEffectMask) + return; + // choose which targets we can select at once + for (uint32 j = effIndex + 1; j < MAX_SPELL_EFFECTS; ++j) + if (GetSpellInfo()->Effects[effIndex].TargetA.GetTarget() == GetSpellInfo()->Effects[j].TargetA.GetTarget() && + GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == GetSpellInfo()->Effects[j].TargetB.GetTarget() && + GetSpellInfo()->Effects[effIndex].ImplicitTargetConditions == GetSpellInfo()->Effects[j].ImplicitTargetConditions && + GetSpellInfo()->Effects[effIndex].CalcRadius(m_caster) == GetSpellInfo()->Effects[j].CalcRadius(m_caster)) + effectMask |= 1 << j; + processedEffectMask |= effectMask; + break; + default: + break; + } + + switch(targetType.GetSelectionCategory()) + { + case TARGET_SELECT_CATEGORY_CHANNEL: + SelectImplicitChannelTargets(effIndex, targetType); + break; + case TARGET_SELECT_CATEGORY_NEARBY: + SelectImplicitNearbyTargets(effIndex, targetType, effectMask); + break; + case TARGET_SELECT_CATEGORY_CONE: + SelectImplicitConeTargets(effIndex, targetType, effectMask); + break; + case TARGET_SELECT_CATEGORY_AREA: + SelectImplicitAreaTargets(effIndex, targetType, effectMask); + break; + case TARGET_SELECT_CATEGORY_DEFAULT: + switch (targetType.GetObjectType()) + { + case TARGET_OBJECT_TYPE_SRC: + switch(targetType.GetReferenceType()) + { + case TARGET_REFERENCE_TYPE_CASTER: + m_targets.SetSrc(*m_caster); + break; + default: + ASSERT("Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_SRC"); + break; + } + break; + case TARGET_OBJECT_TYPE_DEST: + switch(targetType.GetReferenceType()) + { + case TARGET_REFERENCE_TYPE_CASTER: + SelectImplicitCasterDestTargets(effIndex, targetType); + break; + case TARGET_REFERENCE_TYPE_TARGET: + SelectImplicitTargetDestTargets(effIndex, targetType); + break; + case TARGET_REFERENCE_TYPE_DEST: + SelectImplicitDestDestTargets(effIndex, targetType); + break; + default: + ASSERT("Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_DEST"); + break; + } + break; + default: + switch(targetType.GetReferenceType()) + { + case TARGET_REFERENCE_TYPE_CASTER: + SelectImplicitCasterObjectTargets(effIndex, targetType); + break; + case TARGET_REFERENCE_TYPE_TARGET: + SelectImplicitTargetObjectTargets(effIndex, targetType); + break; + default: + ASSERT("Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT"); + break; + } + break; + } + break; + case TARGET_SELECT_CATEGORY_NYI: + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: target type %u, found in spellID %u, effect %u is not implemented yet!", m_spellInfo->Id, effIndex, targetType.GetTarget()); + break; + default: + ASSERT(false && "Spell::SelectEffectImplicitTargets: received not implemented select target category"); + break; + } +} + +void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) +{ + if (targetType.GetReferenceType() != TARGET_REFERENCE_TYPE_CASTER) + { + ASSERT(false && "Spell::SelectImplicitChannelTargets: received not implemented target reference type"); + return; + } + + Spell* channeledSpell = m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL); + if (!channeledSpell) + { + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::SelectImplicitChannelTargets: cannot find channel spell for spell ID %u, effect %u", m_spellInfo->Id, effIndex); + return; + } + switch (targetType.GetTarget()) + { + case TARGET_UNIT_CHANNEL_TARGET: + // unit target may be no longer avalible - teleported out of map for example + if (Unit* target = Unit::GetUnit(*m_caster, channeledSpell->m_targets.GetUnitTargetGUID())) + AddUnitTarget(target, 1 << effIndex); + else + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: cannot find channel spell target for spell ID %u, effect %u", m_spellInfo->Id, effIndex); + break; + case TARGET_DEST_CHANNEL_TARGET: + if (channeledSpell->m_targets.HasDst()) + m_targets.SetDst(channeledSpell->m_targets); + else if (WorldObject* target = ObjectAccessor::GetWorldObject(*m_caster, channeledSpell->m_targets.GetObjectTargetGUID())) + m_targets.SetDst(*target); + else + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: cannot find channel spell destination for spell ID %u, effect %u", m_spellInfo->Id, effIndex); + break; + case TARGET_DEST_CHANNEL_CASTER: + m_targets.SetDst(*channeledSpell->GetCaster()); + break; + default: + ASSERT(false && "Spell::SelectImplicitChannelTargets: received not implemented target type"); + break; + } +} + +void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32 effMask) +{ + if (targetType.GetReferenceType() != TARGET_REFERENCE_TYPE_CASTER) + { + ASSERT(false && "Spell::SelectImplicitNearbyTargets: received not implemented target reference type"); + return; + } + + float range = 0.0f; + switch (targetType.GetCheckType()) + { + case TARGET_CHECK_ENEMY: + range = m_spellInfo->GetMaxRange(false, m_caster, this); + break; + case TARGET_CHECK_ALLY: + case TARGET_CHECK_PARTY: + case TARGET_CHECK_RAID: + case TARGET_CHECK_RAID_CLASS: + range = m_spellInfo->GetMaxRange(true, m_caster, this); + break; + case TARGET_CHECK_ENTRY: + case TARGET_CHECK_DEFAULT: + range = m_spellInfo->GetMaxRange(m_spellInfo->IsPositive(), m_caster, this); + break; + default: + ASSERT(false && "Spell::SelectImplicitNearbyTargets: received not implemented selection check type"); + break; + } + + ConditionList* condList = m_spellInfo->Effects[effIndex].ImplicitTargetConditions; + + // handle emergency case - try to use other provided targets if no conditions provided + if (targetType.GetCheckType() == TARGET_CHECK_ENTRY && (!condList || condList->empty())) + { + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::SelectImplicitNearbyTargets: no conditions entry for target with TARGET_CHECK_ENTRY of spell ID %u, effect %u - selecting default targets", m_spellInfo->Id, effIndex); + switch (targetType.GetObjectType()) + { + case TARGET_OBJECT_TYPE_GOBJ: + if (m_spellInfo->RequiresSpellFocus) + { + if (focusObject) + AddGOTarget(focusObject, effMask); + return; + } + break; + case TARGET_OBJECT_TYPE_DEST: + if (m_spellInfo->RequiresSpellFocus) + { + if (focusObject) + m_targets.SetDst(*focusObject); + return; + } + break; + default: + break; + } + } + + WorldObject* target = SearchNearbyTarget(range, targetType.GetObjectType(), targetType.GetCheckType(), condList); + if (!target) + { + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::SelectImplicitNearbyTargets: cannot find nearby target for spell ID %u, effect %u", m_spellInfo->Id, effIndex); + return; + } + + switch (targetType.GetObjectType()) + { + case TARGET_OBJECT_TYPE_UNIT: + if (Unit* unitTarget = target->ToUnit()) + AddUnitTarget(unitTarget, effMask, false); + break; + case TARGET_OBJECT_TYPE_GOBJ: + if (GameObject* gobjTarget = target->ToGameObject()) + AddGOTarget(gobjTarget, effMask); + break; + case TARGET_OBJECT_TYPE_DEST: + m_targets.SetDst(*target); + break; + default: + ASSERT(false && "Spell::SelectImplicitNearbyTargets: received not implemented target object type"); + break; + } + + SelectImplicitChainTargets(effIndex, targetType, target, effMask); +} + +void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32 effMask) +{ + if (targetType.GetReferenceType() != TARGET_REFERENCE_TYPE_CASTER) + { + ASSERT(false && "Spell::SelectImplicitConeTargets: received not implemented target reference type"); + return; + } + std::list<WorldObject*> targets; + SpellTargetObjectTypes objectType = targetType.GetObjectType(); + SpellTargetCheckTypes selectionType = targetType.GetCheckType(); + ConditionList* condList = m_spellInfo->Effects[effIndex].ImplicitTargetConditions; + float coneAngle = M_PI/2; + float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster) * m_spellValue->RadiusMod; + + if (uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList)) + { + Trinity::WorldObjectSpellConeTargetCheck check(coneAngle, radius, m_caster, m_spellInfo, selectionType, condList); + Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> searcher(m_caster, targets, check, containerTypeMask); + SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> > (searcher, containerTypeMask, m_caster, m_caster, radius); + + if (!targets.empty()) + { + // Other special target selection goes here + if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) + { + Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); + for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) + if ((*j)->IsAffectedOnSpell(m_spellInfo)) + maxTargets += (*j)->GetAmount(); + + Trinity::RandomResizeList(targets, maxTargets); + } + + // for compability with older code - add only unit and go targets + // TODO: remove this + std::list<Unit*> unitTargets; + std::list<GameObject*> gObjTargets; + + for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr) + { + if (Unit* unitTarget = (*itr)->ToUnit()) + unitTargets.push_back(unitTarget); + else if (GameObject* gObjTarget = (*itr)->ToGameObject()) + gObjTargets.push_back(gObjTarget); + } + + CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex); + + for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr) + AddUnitTarget(*itr, effMask, false); + + for (std::list<GameObject*>::iterator itr = gObjTargets.begin(); itr != gObjTargets.end(); ++itr) + AddGOTarget(*itr, effMask); + } + } +} + +void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32 effMask) +{ + Unit* referer = NULL; + switch (targetType.GetReferenceType()) + { + case TARGET_REFERENCE_TYPE_SRC: + case TARGET_REFERENCE_TYPE_DEST: + case TARGET_REFERENCE_TYPE_CASTER: + referer = m_caster; + break; + case TARGET_REFERENCE_TYPE_TARGET: + referer = m_targets.GetUnitTarget(); + break; + case TARGET_REFERENCE_TYPE_LAST: + { + // find last added target for this effect + for (std::list<TargetInfo>::reverse_iterator ihit = m_UniqueTargetInfo.rbegin(); ihit != m_UniqueTargetInfo.rend(); ++ihit) + { + if (ihit->effectMask & (1<<effIndex)) + { + referer = ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID); + break; + } + } + break; + } + default: + ASSERT(false && "Spell::SelectImplicitAreaTargets: received not implemented target reference type"); + return; + } + if (!referer) + return; + + Position const* center = NULL; + switch (targetType.GetReferenceType()) + { + case TARGET_REFERENCE_TYPE_SRC: + center = m_targets.GetSrc(); + break; + case TARGET_REFERENCE_TYPE_DEST: + center = m_targets.GetDst(); + break; + case TARGET_REFERENCE_TYPE_CASTER: + case TARGET_REFERENCE_TYPE_TARGET: + case TARGET_REFERENCE_TYPE_LAST: + center = referer; + break; + default: + ASSERT(false && "Spell::SelectImplicitAreaTargets: received not implemented target reference type"); + return; + } + std::list<WorldObject*> targets; + float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster) * m_spellValue->RadiusMod; + SearchAreaTargets(targets, radius, center, referer, targetType.GetObjectType(), targetType.GetCheckType(), m_spellInfo->Effects[effIndex].ImplicitTargetConditions); + + // Custom entries + // TODO: remove those + switch (m_spellInfo->Id) + { + case 46584: // Raise Dead + { + if (Player* playerCaster = m_caster->ToPlayer()) + { + for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr) + { + switch ((*itr)->GetTypeId()) + { + case TYPEID_UNIT: + case TYPEID_PLAYER: + { + Unit* unitTarget = (*itr)->ToUnit(); + if (unitTarget->isAlive() || !playerCaster->isHonorOrXPTarget(unitTarget) + || ((unitTarget->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1))) == 0) + || (unitTarget->GetDisplayId() != unitTarget->GetNativeDisplayId())) + break; + AddUnitTarget(unitTarget, effMask, false); + // no break; + } + case TYPEID_CORPSE: // wont work until corpses are allowed in target lists, but at least will send dest in packet + m_targets.SetDst(*(*itr)); + return; // nothing more to do here + default: + break; + } + } + } + return; // don't add targets to target map + } + // Corpse Explosion + case 49158: + case 51325: + case 51326: + case 51327: + case 51328: + // check if our target is not valid (spell can target ghoul or dead unit) + if (!(m_targets.GetUnitTarget() && m_targets.GetUnitTarget()->GetDisplayId() == m_targets.GetUnitTarget()->GetNativeDisplayId() && + ((m_targets.GetUnitTarget()->GetEntry() == 26125 && m_targets.GetUnitTarget()->GetOwnerGUID() == m_caster->GetGUID()) + || m_targets.GetUnitTarget()->isDead()))) + { + // remove existing targets + CleanupTargetList(); + + for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr) + { + switch ((*itr)->GetTypeId()) + { + case TYPEID_UNIT: + case TYPEID_PLAYER: + if (!(*itr)->ToUnit()->isDead()) + break; + AddUnitTarget((*itr)->ToUnit(), 1 << effIndex, false); + return; + default: + break; + } + } + if (m_caster->GetTypeId() == TYPEID_PLAYER) + m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true); + SendCastResult(SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW); + finish(false); + } + return; + default: + break; + } + std::list<Unit*> unitTargets; + std::list<GameObject*> gObjTargets; + // for compability with older code - add only unit and go targets + // TODO: remove this + for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr) + { + if (Unit* unitTarget = (*itr)->ToUnit()) + unitTargets.push_back(unitTarget); + else if (GameObject* gObjTarget = (*itr)->ToGameObject()) + gObjTargets.push_back(gObjTarget); + } + + if (!unitTargets.empty()) + { + // Special target selection for smart heals and energizes + uint32 maxSize = 0; + int32 power = -1; + switch (m_spellInfo->SpellFamilyName) + { + case SPELLFAMILY_GENERIC: + switch (m_spellInfo->Id) + { + case 52759: // Ancestral Awakening + case 71610: // Echoes of Light (Althor's Abacus normal version) + case 71641: // Echoes of Light (Althor's Abacus heroic version) + maxSize = 1; + power = POWER_HEALTH; + break; + case 54968: // Glyph of Holy Light + maxSize = m_spellInfo->MaxAffectedTargets; + power = POWER_HEALTH; + break; + case 57669: // Replenishment + // In arenas Replenishment may only affect the caster + if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->InArena()) + { + unitTargets.clear(); + unitTargets.push_back(m_caster); + break; + } + maxSize = 10; + power = POWER_MANA; + break; + default: + break; + } + break; + case SPELLFAMILY_PRIEST: + if (m_spellInfo->SpellFamilyFlags[0] == 0x10000000) // Circle of Healing + { + maxSize = m_caster->HasAura(55675) ? 6 : 5; // Glyph of Circle of Healing + power = POWER_HEALTH; + } + else if (m_spellInfo->Id == 64844) // Divine Hymn + { + maxSize = 3; + power = POWER_HEALTH; + } + else if (m_spellInfo->Id == 64904) // Hymn of Hope + { + maxSize = 3; + power = POWER_MANA; + } + else + break; + + // Remove targets outside caster's raid + for (std::list<Unit*>::iterator itr = unitTargets.begin() ; itr != unitTargets.end();) + { + if (!(*itr)->IsInRaidWith(m_caster)) + itr = unitTargets.erase(itr); + else + ++itr; + } + break; + case SPELLFAMILY_DRUID: + if (m_spellInfo->SpellFamilyFlags[1] == 0x04000000) // Wild Growth + { + maxSize = m_caster->HasAura(62970) ? 6 : 5; // Glyph of Wild Growth + power = POWER_HEALTH; + } + else if (m_spellInfo->SpellFamilyFlags[2] == 0x0100) // Starfall + { + // Remove targets not in LoS or in stealth + for (std::list<Unit*>::iterator itr = unitTargets.begin() ; itr != unitTargets.end();) + { + if ((*itr)->HasStealthAura() || (*itr)->HasInvisibilityAura() || !(*itr)->IsWithinLOSInMap(m_caster)) + itr = unitTargets.erase(itr); + else + ++itr; + } + break; + } + else + break; + + // Remove targets outside caster's raid + for (std::list<Unit*>::iterator itr = unitTargets.begin() ; itr != unitTargets.end();) + if (!(*itr)->IsInRaidWith(m_caster)) + itr = unitTargets.erase(itr); + else + ++itr; + break; + default: + break; + } + + if (maxSize && power != -1) + { + if (Powers(power) == POWER_HEALTH) + { + if (unitTargets.size() > maxSize) + { + unitTargets.sort(Trinity::HealthPctOrderPred()); + unitTargets.resize(maxSize); + } + } + else + { + for (std::list<Unit*>::iterator itr = unitTargets.begin() ; itr != unitTargets.end();) + if ((*itr)->getPowerType() != (Powers)power) + itr = unitTargets.erase(itr); + else + ++itr; + + if (unitTargets.size() > maxSize) + { + unitTargets.sort(Trinity::PowerPctOrderPred((Powers)power)); + unitTargets.resize(maxSize); + } + } + } + + // Other special target selection goes here + if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) + { + Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); + for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) + if ((*j)->IsAffectedOnSpell(m_spellInfo)) + maxTargets += (*j)->GetAmount(); + + if (m_spellInfo->Id == 5246) //Intimidating Shout + unitTargets.remove(m_targets.GetUnitTarget()); + Trinity::RandomResizeList(unitTargets, maxTargets); + } + + CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex); + + for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr) + AddUnitTarget(*itr, effMask, false); + } + + if (!gObjTargets.empty()) + { + if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) + { + Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); + for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) + if ((*j)->IsAffectedOnSpell(m_spellInfo)) + maxTargets += (*j)->GetAmount(); + + Trinity::RandomResizeList(gObjTargets, maxTargets); + } + for (std::list<GameObject*>::iterator itr = gObjTargets.begin(); itr != gObjTargets.end(); ++itr) + AddGOTarget(*itr, effMask); + } +} + +void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) +{ + switch(targetType.GetTarget()) + { + case TARGET_DEST_CASTER: + m_targets.SetDst(*m_caster); + return; + case TARGET_DEST_HOME: + if (Player* playerCaster = m_caster->ToPlayer()) + m_targets.SetDst(playerCaster->m_homebindX, playerCaster->m_homebindY, playerCaster->m_homebindZ, playerCaster->GetOrientation(), playerCaster->m_homebindMapId); + return; + case TARGET_DEST_DB: + if (SpellTargetPosition const* st = sSpellMgr->GetSpellTargetPosition(m_spellInfo->Id)) + { + // TODO: fix this check + if (m_spellInfo->HasEffect(SPELL_EFFECT_TELEPORT_UNITS)) + m_targets.SetDst(st->target_X, st->target_Y, st->target_Z, st->target_Orientation, (int32)st->target_mapId); + else if (st->target_mapId == m_caster->GetMapId()) + m_targets.SetDst(st->target_X, st->target_Y, st->target_Z, st->target_Orientation); + } + else + { + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id); + WorldObject* target = m_targets.GetObjectTarget(); + m_targets.SetDst(target ? *target : *m_caster); + } + return; + case TARGET_DEST_CASTER_FISHING: + { + float min_dis = m_spellInfo->GetMinRange(true); + float max_dis = m_spellInfo->GetMaxRange(true); + float dis = (float)rand_norm() * (max_dis - min_dis) + min_dis; + float x, y, z, angle; + angle = (float)rand_norm() * static_cast<float>(M_PI * 35.0f / 180.0f) - static_cast<float>(M_PI * 17.5f / 180.0f); + m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dis, angle); + m_targets.SetDst(x, y, z, m_caster->GetOrientation()); + return; + } + default: + break; + } + + float dist; + float angle = targetType.CalcDirectionAngle(); + float objSize = m_caster->GetObjectSize(); + if (targetType.GetTarget() == TARGET_DEST_CASTER_SUMMON) + dist = PET_FOLLOW_DIST; + else + dist = m_spellInfo->Effects[effIndex].CalcRadius(m_caster); + + if (dist < objSize) + dist = objSize; + else if (targetType.GetTarget() == TARGET_DEST_CASTER_RANDOM) + dist = objSize + (dist - objSize) * (float)rand_norm(); + + Position pos; + if (targetType.GetTarget() == TARGET_DEST_CASTER_FRONT_LEAP) + m_caster->GetFirstCollisionPosition(pos, dist, angle); + else + m_caster->GetNearPosition(pos, dist, angle); + m_targets.SetDst(*m_caster); + m_targets.ModDst(pos); +} + +void Spell::SelectImplicitTargetDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) +{ + WorldObject* target = m_targets.GetObjectTarget(); + switch(targetType.GetTarget()) + { + case TARGET_DEST_TARGET_ENEMY: + case TARGET_DEST_TARGET_ANY: + m_targets.SetDst(*target); + return; + default: + break; + } + + float angle = targetType.CalcDirectionAngle(); + float objSize = target->GetObjectSize(); + float dist = m_spellInfo->Effects[effIndex].CalcRadius(m_caster); + if (dist < objSize) + dist = objSize; + else if (targetType.GetTarget() == TARGET_DEST_TARGET_RANDOM) + dist = objSize + (dist - objSize) * (float)rand_norm(); + + Position pos; + target->GetNearPosition(pos, dist, angle); + m_targets.SetDst(*target); + m_targets.ModDst(pos); +} + +void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) +{ + switch(targetType.GetTarget()) + { + case TARGET_DEST_DYNOBJ_ENEMY: + case TARGET_DEST_DYNOBJ_ALLY: + case TARGET_DEST_DYNOBJ_NONE: + case TARGET_DEST_DEST: + return; + case TARGET_DEST_TRAJ: + SelectImplicitTrajTargets(); + return; + default: + break; + } + + float angle = targetType.CalcDirectionAngle(); + float dist = m_spellInfo->Effects[effIndex].CalcRadius(m_caster); + if (targetType.GetTarget() == TARGET_DEST_DEST_RANDOM) + dist *= (float)rand_norm(); + + Position pos = *m_targets.GetDst(); + m_caster->MovePosition(pos, dist, angle); + m_targets.ModDst(pos); +} + +void Spell::SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) +{ + switch(targetType.GetTarget()) + { + case TARGET_UNIT_CASTER: + AddUnitTarget(m_caster, 1 << effIndex, false); + break; + case TARGET_UNIT_MASTER: + if (Unit* owner = m_caster->GetCharmerOrOwner()) + AddUnitTarget(owner, 1 << effIndex); + break; + case TARGET_UNIT_PET: + if (Guardian* pet = m_caster->GetGuardianPet()) + AddUnitTarget(pet, 1 << effIndex); + break; + case TARGET_UNIT_SUMMONER: + if (m_caster->isSummon()) + if (Unit* unit = m_caster->ToTempSummon()->GetSummoner()) + AddUnitTarget(unit, 1 << effIndex); + break; + case TARGET_UNIT_VEHICLE: + if (Unit *vehicle = m_caster->GetVehicleBase()) + AddUnitTarget(vehicle, 1 << effIndex); + break; + case TARGET_UNIT_PASSENGER_0: + case TARGET_UNIT_PASSENGER_1: + case TARGET_UNIT_PASSENGER_2: + case TARGET_UNIT_PASSENGER_3: + case TARGET_UNIT_PASSENGER_4: + case TARGET_UNIT_PASSENGER_5: + case TARGET_UNIT_PASSENGER_6: + case TARGET_UNIT_PASSENGER_7: + if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsVehicle()) + if (Unit *unit = m_caster->GetVehicleKit()->GetPassenger(targetType.GetTarget() - TARGET_UNIT_PASSENGER_0)) + AddUnitTarget(unit, 1 << effIndex); + break; + default: + break; + } +} + +void Spell::SelectImplicitTargetObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) +{ + ASSERT(m_targets.GetObjectTarget() && "Spell::SelectImplicitTargetObjectTargets - no explicit object target available!"); + if (Unit* unit = m_targets.GetUnitTarget()) + AddUnitTarget(unit, 1 << effIndex); + else if (GameObject* gobj = m_targets.GetGOTarget()) + AddGOTarget(gobj, 1 << effIndex); + else + AddItemTarget(m_targets.GetItemTarget(), effIndex); + + if (WorldObject* target = m_targets.GetObjectTarget()) + SelectImplicitChainTargets(effIndex, targetType, target, 1 << effIndex); +} + +void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, WorldObject* target, uint32 effMask) +{ + uint32 maxTargets = m_spellInfo->Effects[effIndex].ChainTarget; + if (Player* modOwner = m_caster->GetSpellModOwner()) + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, maxTargets, this); + + if (maxTargets > 1) + { + // mark damage multipliers as used + for (uint32 k = effIndex; k < MAX_SPELL_EFFECTS; ++k) + if (effMask & (1 << k)) + m_damageMultipliers[k] = 1.0f; + m_applyMultiplierMask |= effMask; + + std::list<WorldObject*> targets; + SearchChainTargets(targets, maxTargets - 1, target, targetType.GetObjectType(), targetType.GetCheckType() + , m_spellInfo->Effects[effIndex].ImplicitTargetConditions, targetType.GetTarget() == TARGET_UNIT_TARGET_CHAINHEAL_ALLY); + + // for backward compability + std::list<Unit*> unitTargets; + for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr) + if (Unit* unitTarget = (*itr)->ToUnit()) + unitTargets.push_back(unitTarget); + + CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex); + + for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr) + AddUnitTarget(*itr, effMask, false); + } +} + +float tangent(float x) +{ + x = tan(x); + //if (x < std::numeric_limits<float>::max() && x > -std::numeric_limits<float>::max()) return x; + //if (x >= std::numeric_limits<float>::max()) return std::numeric_limits<float>::max(); + //if (x <= -std::numeric_limits<float>::max()) return -std::numeric_limits<float>::max(); + if (x < 100000.0f && x > -100000.0f) return x; + if (x >= 100000.0f) return 100000.0f; + if (x <= 100000.0f) return -100000.0f; + return 0.0f; +} + +#define DEBUG_TRAJ(a) //a + +void Spell::SelectImplicitTrajTargets() +{ + if (!m_targets.HasTraj()) + return; + + float dist2d = m_targets.GetDist2d(); + if (!dist2d) + return; + + float srcToDestDelta = m_targets.GetDst()->m_positionZ - m_targets.GetSrc()->m_positionZ; + + std::list<WorldObject*> targets; + Trinity::WorldObjectSpellTrajTargetCheck check(dist2d, m_targets.GetSrc(), m_caster, m_spellInfo); + Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellTrajTargetCheck> searcher(m_caster, targets, check, GRID_MAP_TYPE_MASK_ALL); + SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellTrajTargetCheck> > (searcher, GRID_MAP_TYPE_MASK_ALL, m_caster, m_targets.GetSrc(), dist2d); + if (targets.empty()) + return; + + targets.sort(Trinity::ObjectDistanceOrderPred(m_caster)); + + float b = tangent(m_targets.GetElevation()); + float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d); + if (a > -0.0001f) + a = 0; + DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: a %f b %f", a, b);) + + float bestDist = m_spellInfo->GetMaxRange(false); + + std::list<WorldObject*>::const_iterator itr = targets.begin(); + for (; itr != targets.end(); ++itr) + { + if (Unit* unitTarget = (*itr)->ToUnit()) + if (m_caster == *itr || m_caster->IsOnVehicle(unitTarget) || (unitTarget)->GetVehicle())//(*itr)->IsOnVehicle(m_caster)) + continue; + + const float size = std::max((*itr)->GetObjectSize() * 0.7f, 1.0f); // 1/sqrt(3) + // TODO: all calculation should be based on src instead of m_caster + const float objDist2d = m_targets.GetSrc()->GetExactDist2d(*itr) * cos(m_targets.GetSrc()->GetRelativeAngle(*itr)); + const float dz = (*itr)->GetPositionZ() - m_targets.GetSrc()->m_positionZ; + + DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: check %u, dist between %f %f, height between %f %f.", (*itr)->GetEntry(), objDist2d - size, objDist2d + size, dz - size, dz + size);) + + float dist = objDist2d - size; + float height = dist * (a * dist + b); + DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);) + if (dist < bestDist && height < dz + size && height > dz - size) + { + bestDist = dist > 0 ? dist : 0; + break; + } + +#define CHECK_DIST {\ + DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)\ + if (dist > bestDist)\ + continue;\ + if (dist < objDist2d + size && dist > objDist2d - size)\ + {\ + bestDist = dist;\ + break;\ + }\ + } + + if (!a) + { + height = dz - size; + dist = height / b; + CHECK_DIST; + + height = dz + size; + dist = height / b; + CHECK_DIST; + + continue; + } + + height = dz - size; + float sqrt1 = b * b + 4 * a * height; + if (sqrt1 > 0) + { + sqrt1 = sqrt(sqrt1); + dist = (sqrt1 - b) / (2 * a); + CHECK_DIST; + } + + height = dz + size; + float sqrt2 = b * b + 4 * a * height; + if (sqrt2 > 0) + { + sqrt2 = sqrt(sqrt2); + dist = (sqrt2 - b) / (2 * a); + CHECK_DIST; + + dist = (-sqrt2 - b) / (2 * a); + CHECK_DIST; + } + + if (sqrt1 > 0) + { + dist = (-sqrt1 - b) / (2 * a); + CHECK_DIST; + } + } + + if (m_targets.GetSrc()->GetExactDist2d(m_targets.GetDst()) > bestDist) + { + float x = m_targets.GetSrc()->m_positionX + cos(m_caster->GetOrientation()) * bestDist; + float y = m_targets.GetSrc()->m_positionY + sin(m_caster->GetOrientation()) * bestDist; + float z = m_targets.GetSrc()->m_positionZ + bestDist * (a * bestDist + b); + + if (itr != targets.end()) + { + float distSq = (*itr)->GetExactDistSq(x, y, z); + float sizeSq = (*itr)->GetObjectSize(); + sizeSq *= sizeSq; + DEBUG_TRAJ(sLog->outError("Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);) + if (distSq > sizeSq) + { + float factor = 1 - sqrt(sizeSq / distSq); + x += factor * ((*itr)->GetPositionX() - x); + y += factor * ((*itr)->GetPositionY() - y); + z += factor * ((*itr)->GetPositionZ() - z); + + distSq = (*itr)->GetExactDistSq(x, y, z); + DEBUG_TRAJ(sLog->outError("Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);) + } + } + + Position trajDst; + trajDst.Relocate(x, y, z, m_caster->GetOrientation()); + m_targets.ModDst(trajDst); + } +} + void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex) { // special case for SPELL_EFFECT_SUMMON_RAF_FRIEND and SPELL_EFFECT_SUMMON_PLAYER @@ -834,6 +1770,192 @@ void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex) } } +uint32 Spell::GetSearcherTypeMask(SpellTargetObjectTypes objType, ConditionList* condList) +{ + // this function selects which containers need to be searched for spell target + uint32 retMask = GRID_MAP_TYPE_MASK_ALL; + + // filter searchers based on searched object type + switch (objType) + { + case TARGET_OBJECT_TYPE_UNIT: + case TARGET_OBJECT_TYPE_UNIT_AND_DEST: + case TARGET_OBJECT_TYPE_CORPSE: + case TARGET_OBJECT_TYPE_CORPSE_ENEMY: + case TARGET_OBJECT_TYPE_CORPSE_ALLY: + retMask &= GRID_MAP_TYPE_MASK_PLAYER | GRID_MAP_TYPE_MASK_CORPSE | GRID_MAP_TYPE_MASK_CREATURE; + break; + case TARGET_OBJECT_TYPE_GOBJ: + case TARGET_OBJECT_TYPE_GOBJ_ITEM: + retMask &= GRID_MAP_TYPE_MASK_GAMEOBJECT; + break; + default: + break; + } + if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_DEAD)) + retMask &= ~GRID_MAP_TYPE_MASK_CORPSE; + if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_PLAYERS) + retMask &= GRID_MAP_TYPE_MASK_CORPSE | GRID_MAP_TYPE_MASK_PLAYER; + if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_GHOSTS) + retMask &= GRID_MAP_TYPE_MASK_PLAYER; + + if (condList) + retMask &= sConditionMgr->GetSearcherTypeMaskForConditionList(*condList); + return retMask; +} + +template<class SEARCHER> +void Spell::SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* referer, Position const* pos, float radius) +{ + if (!containerMask) + return; + + // search world and grid for possible targets + bool searchInGrid = containerMask & (GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_GAMEOBJECT); + bool searchInWorld = containerMask & (GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER | GRID_MAP_TYPE_MASK_CORPSE); + if (searchInGrid || searchInWorld) + { + float x,y; + x = pos->GetPositionX(); + y = pos->GetPositionY(); + + CellCoord p(Trinity::ComputeCellCoord(x, y)); + Cell cell(p); + cell.SetNoCreate(); + + Map& map = *(referer->GetMap()); + + if (searchInWorld) + { + TypeContainerVisitor<SEARCHER, WorldTypeMapContainer> world_object_notifier(searcher); + cell.Visit(p, world_object_notifier, map, radius, x, y); + } + if (searchInGrid) + { + TypeContainerVisitor<SEARCHER, GridTypeMapContainer > grid_object_notifier(searcher); + cell.Visit(p, grid_object_notifier, map, radius, x , y); + } + } +} + +WorldObject* Spell::SearchNearbyTarget(float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionList* condList) +{ + WorldObject* target = NULL; + uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList); + if (!containerTypeMask) + return NULL; + Trinity::WorldObjectSpellNearbyTargetCheck check(range, m_caster, m_spellInfo, selectionType, condList); + Trinity::WorldObjectLastSearcher<Trinity::WorldObjectSpellNearbyTargetCheck> searcher(m_caster, target, check, containerTypeMask); + SearchTargets<Trinity::WorldObjectLastSearcher<Trinity::WorldObjectSpellNearbyTargetCheck> > (searcher, containerTypeMask, m_caster, m_caster, range); + return target; +} + +void Spell::SearchAreaTargets(std::list<WorldObject*>& targets, float range, Position const* position, Unit* referer, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionList* condList) +{ + uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList); + if (!containerTypeMask) + return; + Trinity::WorldObjectSpellAreaTargetCheck check(range, position, m_caster, referer, m_spellInfo, selectionType, condList); + Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellAreaTargetCheck> searcher(m_caster, targets, check, containerTypeMask); + SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellAreaTargetCheck> > (searcher, containerTypeMask, m_caster, m_caster, range); +} + +void Spell::SearchChainTargets(std::list<WorldObject*>& targets, uint32 chainTargets, WorldObject* target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, ConditionList* condList, bool isChainHeal) +{ + // max dist for jump target selection + float jumpRadius = 0.0f; + switch (m_spellInfo->DmgClass) + { + case SPELL_DAMAGE_CLASS_RANGED: + // 7.5y for multi shot + jumpRadius = 7.5f; + break; + case SPELL_DAMAGE_CLASS_MELEE: + // 5y for swipe, cleave and similar + jumpRadius = 5.0f; + break; + case SPELL_DAMAGE_CLASS_NONE: + case SPELL_DAMAGE_CLASS_MAGIC: + // 12.5y for chain heal spell since 3.2 patch + if (isChainHeal) + jumpRadius = 12.5f; + // 10y as default for magic chain spells + else + jumpRadius = 10.0f; + break; + } + + // chain lightning/heal spells and similar - allow to jump at larger distance and go out of los + bool isBouncingFar = (m_spellInfo->AttributesEx4 & SPELL_ATTR4_AREA_TARGET_CHAIN + || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_NONE + || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC); + + // max dist which spell can reach + float searchRadius = jumpRadius; + if (isBouncingFar) + searchRadius *= chainTargets; + + std::list<WorldObject*> tempTargets; + SearchAreaTargets(tempTargets, searchRadius, target, m_caster, objectType, selectType, condList); + tempTargets.remove(target); + + // remove targets which are always invalid for chain spells + // for some spells allow only chain targets in front of caster (swipe for example) + if (!isBouncingFar) + { + for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end();) + { + std::list<WorldObject*>::iterator checkItr = itr++; + if (!m_caster->HasInArc(static_cast<float>(M_PI), *checkItr)) + tempTargets.erase(checkItr); + } + } + + while (chainTargets) + { + // try to get unit for next chain jump + std::list<WorldObject*>::iterator foundItr = tempTargets.end(); + // get unit with highest hp deficit in dist + if (isChainHeal) + { + uint32 maxHPDeficit = 0; + for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr) + { + if (Unit* unitTarget = (*itr)->ToUnit()) + { + uint32 deficit = unitTarget->GetMaxHealth() - unitTarget->GetHealth(); + if ((deficit > maxHPDeficit || foundItr == tempTargets.end()) && target->IsWithinDist(unitTarget, jumpRadius) && target->IsWithinLOSInMap(unitTarget)) + { + foundItr = itr; + maxHPDeficit = deficit; + } + } + } + } + // get closest object + else + { + for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr) + { + if (foundItr == tempTargets.end()) + { + if ((!isBouncingFar || target->IsWithinDist(*itr, jumpRadius)) && target->IsWithinLOSInMap(*itr)) + foundItr = itr; + } + else if (target->GetDistanceOrder(*itr, *foundItr) && target->IsWithinLOSInMap(*itr)) + foundItr = itr; + } + } + // not found any valid target - chain ends + if (foundItr == tempTargets.end()) + break; + target = *foundItr; + tempTargets.erase(foundItr); + targets.push_back(target); + --chainTargets; + } +} + void Spell::prepareDataForTriggerSystem(AuraEffect const* /*triggeredByAura*/) { //========================================================================================== @@ -1760,1086 +2882,6 @@ struct ChainHealingOrder : public std::binary_function<const Unit*, const Unit*, } }; -void Spell::SearchChainTarget(std::list<Unit*> &TagUnitMap, float max_range, uint32 num, SpellTargets TargetType) -{ - Unit* cur = m_targets.GetUnitTarget(); - if (!cur) - return; - - //FIXME: This very like horrible hack and wrong for most spells - if (m_spellInfo->DmgClass != SPELL_DAMAGE_CLASS_MELEE) - max_range += num * CHAIN_SPELL_JUMP_RADIUS; - - std::list<Unit*> tempUnitMap; - if (TargetType == SPELL_TARGETS_CHAINHEAL) - { - SearchAreaTarget(tempUnitMap, max_range, PUSH_CHAIN, SPELL_TARGETS_ALLY); - tempUnitMap.sort(ChainHealingOrder(m_caster)); - } - else - SearchAreaTarget(tempUnitMap, max_range, PUSH_CHAIN, TargetType); - tempUnitMap.remove(cur); - - while (num) - { - TagUnitMap.push_back(cur); - --num; - - if (tempUnitMap.empty()) - break; - - std::list<Unit*>::iterator next; - - if (TargetType == SPELL_TARGETS_CHAINHEAL) - { - next = tempUnitMap.begin(); - while (cur->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS || !cur->IsWithinLOSInMap(*next)) - { - ++next; - if (next == tempUnitMap.end()) - return; - } - } - else - { - tempUnitMap.sort(Trinity::ObjectDistanceOrderPred(cur)); - next = tempUnitMap.begin(); - - if (cur->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS) // Don't search beyond the max jump radius - break; - - // Check if (*next) is a valid chain target. If not, don't add to TagUnitMap, and repeat loop. - // If you want to add any conditions to exclude a target from TagUnitMap, add condition in this while () loop. - while ((m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE - && !m_caster->isInFrontInMap(*next, max_range)) - || !m_caster->canSeeOrDetect(*next) - || !cur->IsWithinLOSInMap(*next) - || (*next)->GetCreatureType() == CREATURE_TYPE_CRITTER - || ((GetSpellInfo()->AttributesEx6 & SPELL_ATTR6_CANT_TARGET_CROWD_CONTROLLED) && !(*next)->CanFreeMove())) - { - ++next; - if (next == tempUnitMap.end() || cur->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS) // Don't search beyond the max jump radius - return; - } - } - - cur = *next; - tempUnitMap.erase(next); - } -} - -void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, SpellNotifyPushType type, SpellTargets TargetType, uint32 entry) -{ - if (TargetType == SPELL_TARGETS_GO) - return; - - Position const* pos; - switch (type) - { - case PUSH_DST_CENTER: - CheckDst(); - pos = m_targets.GetDst(); - break; - case PUSH_SRC_CENTER: - CheckSrc(); - pos = m_targets.GetSrc(); - break; - case PUSH_CHAIN: - { - Unit* target = m_targets.GetUnitTarget(); - if (!target) - { - sLog->outError("SPELL: cannot find unit target for spell ID %u\n", m_spellInfo->Id); - return; - } - pos = target; - break; - } - default: - pos = m_caster; - break; - } - - Trinity::SpellNotifierCreatureAndPlayer notifier(m_caster, TagUnitMap, radius, type, TargetType, pos, entry, m_spellInfo); - if ((m_spellInfo->AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_PLAYERS) || (TargetType == SPELL_TARGETS_ENTRY && !entry)) - m_caster->GetMap()->VisitWorld(pos->m_positionX, pos->m_positionY, radius, notifier); - else - m_caster->GetMap()->VisitAll(pos->m_positionX, pos->m_positionY, radius, notifier); -} - -void Spell::SearchGOAreaTarget(std::list<GameObject*> &TagGOMap, float radius, SpellNotifyPushType type, SpellTargets TargetType, uint32 entry) -{ - if (TargetType != SPELL_TARGETS_GO) - return; - - Position const* pos; - switch (type) - { - case PUSH_DST_CENTER: - CheckDst(); - pos = m_targets.GetDst(); - break; - case PUSH_SRC_CENTER: - CheckSrc(); - pos = m_targets.GetSrc(); - break; - default: - pos = m_caster; - break; - } - - Trinity::GameObjectInRangeCheck check(pos->m_positionX, pos->m_positionY, pos->m_positionZ, radius, entry); - Trinity::GameObjectListSearcher<Trinity::GameObjectInRangeCheck> searcher(m_caster, TagGOMap, check); - m_caster->GetMap()->VisitGrid(pos->m_positionX, pos->m_positionY, radius, searcher); -} - -WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType, SpellEffIndex effIndex) -{ - switch (TargetType) - { - case SPELL_TARGETS_ENTRY: - { - ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); - if (conditions.empty()) - { - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell (ID: %u) (caster Entry: %u) does not have record in `conditions` for spell script target (ConditionSourceType 13)", m_spellInfo->Id, m_caster->GetEntry()); - if (m_spellInfo->IsPositive()) - return SearchNearbyTarget(range, SPELL_TARGETS_ALLY, effIndex); - else - return SearchNearbyTarget(range, SPELL_TARGETS_ENEMY, effIndex); - } - - Creature* creatureScriptTarget = NULL; - GameObject* goScriptTarget = NULL; - - for (ConditionList::const_iterator i_spellST = conditions.begin(); i_spellST != conditions.end(); ++i_spellST) - { - if ((*i_spellST)->ConditionType != CONDITION_SPELL_SCRIPT_TARGET) - continue; - if ((*i_spellST)->ConditionValue3 && !((*i_spellST)->ConditionValue3 & (1 << uint32(effIndex)))) - continue; - switch ((*i_spellST)->ConditionValue1) - { - case SPELL_TARGET_TYPE_CONTROLLED: - for (Unit::ControlList::iterator itr = m_caster->m_Controlled.begin(); itr != m_caster->m_Controlled.end(); ++itr) - if ((*itr)->GetEntry() == (*i_spellST)->ConditionValue2 && (*itr)->IsWithinDistInMap(m_caster, range)) - { - goScriptTarget = NULL; - creatureScriptTarget = (*itr)->ToCreature(); - range = m_caster->GetDistance(creatureScriptTarget); - } - break; - case SPELL_TARGET_TYPE_GAMEOBJECT: - if ((*i_spellST)->ConditionValue2) - { - if (GameObject* go = m_caster->FindNearestGameObject((*i_spellST)->ConditionValue2, range)) - { - // remember found target and range, next attempt will find more near target with another entry - goScriptTarget = go; - creatureScriptTarget = NULL; - range = m_caster->GetDistance(goScriptTarget); - } - } - else if (focusObject) //Focus Object - { - float frange = m_caster->GetDistance(focusObject); - if (range >= frange) - { - creatureScriptTarget = NULL; - goScriptTarget = focusObject; - range = frange; - } - } - break; - case SPELL_TARGET_TYPE_CREATURE: - if (m_targets.GetUnitTarget() && m_targets.GetUnitTarget()->GetEntry() == (*i_spellST)->ConditionValue2) - return m_targets.GetUnitTarget(); - case SPELL_TARGET_TYPE_DEAD: - default: - if (Creature* cre = m_caster->FindNearestCreature((*i_spellST)->ConditionValue2, range, (*i_spellST)->ConditionValue1 != SPELL_TARGET_TYPE_DEAD)) - { - creatureScriptTarget = cre; - goScriptTarget = NULL; - range = m_caster->GetDistance(creatureScriptTarget); - } - break; - } - } - - if (creatureScriptTarget) - return creatureScriptTarget; - else - return goScriptTarget; - } - default: - case SPELL_TARGETS_ENEMY: - { - Unit* target = NULL; - Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_caster, m_caster, range); - Trinity::UnitLastSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(m_caster, target, u_check); - m_caster->VisitNearbyObject(range, searcher); - return target; - } - case SPELL_TARGETS_ALLY: - { - Unit* target = NULL; - Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(m_caster, m_caster, range); - Trinity::UnitLastSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(m_caster, target, u_check); - m_caster->VisitNearbyObject(range, searcher); - return target; - } - } -} - -uint32 Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur) -{ - SpellNotifyPushType pushType = PUSH_NONE; - Player* modOwner = NULL; - if (m_originalCaster) - modOwner = m_originalCaster->GetSpellModOwner(); - - uint32 effectMask = 1 << i; - // ENTRY targets may have different selection lists, skip those for now until we can compare lists easily and quickly - if (GetSpellInfo()->Effects[i].TargetA.GetSelectionCheckType() != TARGET_SELECT_CHECK_ENTRY && - GetSpellInfo()->Effects[i].TargetB.GetSelectionCheckType() != TARGET_SELECT_CHECK_ENTRY) - for (uint32 j = i + 1; j < MAX_SPELL_EFFECTS; ++j) - if (GetSpellInfo()->Effects[i].TargetA.GetTarget() == GetSpellInfo()->Effects[j].TargetA.GetTarget() && - GetSpellInfo()->Effects[i].TargetB.GetTarget() == GetSpellInfo()->Effects[j].TargetB.GetTarget() && - GetSpellInfo()->Effects[i].CalcRadius(m_caster) == GetSpellInfo()->Effects[j].CalcRadius(m_caster)) - effectMask |= 1 << j; - - switch (cur.GetType()) - { - case TARGET_TYPE_UNIT_CASTER: - { - switch (cur.GetTarget()) - { - case TARGET_UNIT_CASTER: - AddUnitTarget(m_caster, effectMask, false); - break; - case TARGET_DEST_CASTER_FISHING: - { - float min_dis = m_spellInfo->GetMinRange(true); - float max_dis = m_spellInfo->GetMaxRange(true); - float dis = (float)rand_norm() * (max_dis - min_dis) + min_dis; - float x, y, z, angle; - angle = (float)rand_norm() * static_cast<float>(M_PI * 35.0f / 180.0f) - static_cast<float>(M_PI * 17.5f / 180.0f); - m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dis, angle); - m_targets.SetDst(x, y, z, m_caster->GetOrientation()); - break; - } - case TARGET_UNIT_MASTER: - if (Unit* owner = m_caster->GetCharmerOrOwner()) - AddUnitTarget(owner, effectMask); - break; - case TARGET_UNIT_PET: - if (Guardian* pet = m_caster->GetGuardianPet()) - AddUnitTarget(pet, effectMask); - break; - case TARGET_UNIT_SUMMONER: - if (m_caster->isSummon()) - if (Unit* unit = m_caster->ToTempSummon()->GetSummoner()) - AddUnitTarget(unit, effectMask); - break; - case TARGET_UNIT_CASTER_AREA_PARTY: - case TARGET_UNIT_CASTER_AREA_RAID: - pushType = PUSH_CASTER_CENTER; - break; - case TARGET_UNIT_VEHICLE: - if (Unit* vehicle = m_caster->GetVehicleBase()) - AddUnitTarget(vehicle, effectMask); - break; - case TARGET_UNIT_PASSENGER_0: - case TARGET_UNIT_PASSENGER_1: - case TARGET_UNIT_PASSENGER_2: - case TARGET_UNIT_PASSENGER_3: - case TARGET_UNIT_PASSENGER_4: - case TARGET_UNIT_PASSENGER_5: - case TARGET_UNIT_PASSENGER_6: - case TARGET_UNIT_PASSENGER_7: - if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsVehicle()) - if (Unit* unit = m_caster->GetVehicleKit()->GetPassenger(cur.GetTarget() - TARGET_UNIT_PASSENGER_0)) - AddUnitTarget(unit, effectMask); - break; - default: - break; - } - break; - } - - case TARGET_TYPE_UNIT_TARGET: - { - Unit* target = m_targets.GetUnitTarget(); - if (!target) - { - sLog->outError("SPELL: no unit target for spell ID %u", m_spellInfo->Id); - break; - } - - switch (cur.GetTarget()) - { - case TARGET_UNIT_TARGET_ENEMY: - if (Unit* magnet = m_caster->SelectMagnetTarget(target, m_spellInfo)) - if (magnet != target) - m_targets.SetUnitTarget(magnet); - pushType = PUSH_CHAIN; - break; - case TARGET_UNIT_TARGET_ANY: - if (!m_spellInfo->IsPositive()) - if (Unit* magnet = m_caster->SelectMagnetTarget(target, m_spellInfo)) - if (magnet != target) - m_targets.SetUnitTarget(magnet); - pushType = PUSH_CHAIN; - break; - case TARGET_UNIT_TARGET_CHAINHEAL_ALLY: - pushType = PUSH_CHAIN; - break; - case TARGET_UNIT_TARGET_ALLY: - AddUnitTarget(target, effectMask, false); - break; - case TARGET_UNIT_TARGET_RAID: - case TARGET_UNIT_TARGET_PARTY: - case TARGET_UNIT_TARGET_MINIPET: - AddUnitTarget(target, effectMask, false); - break; - case TARGET_UNIT_TARGET_PASSENGER: - AddUnitTarget(target, effectMask, false); - break; - case TARGET_UNIT_LASTTARGET_AREA_PARTY: - case TARGET_UNIT_TARGET_AREA_RAID_CLASS: - pushType = PUSH_CASTER_CENTER; // not real - break; - default: - break; - } - break; - } - - case TARGET_TYPE_UNIT_NEARBY: - { - WorldObject* target = NULL; - float range; - - switch (cur.GetTarget()) - { - case TARGET_UNIT_NEARBY_ENEMY: - range = m_spellInfo->GetMaxRange(false); - if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this); - target = SearchNearbyTarget(range, SPELL_TARGETS_ENEMY, SpellEffIndex(i)); - break; - case TARGET_UNIT_NEARBY_ALLY: - case TARGET_UNIT_NEARBY_PARTY: // TODO: fix party/raid targets - case TARGET_UNIT_NEARBY_RAID: - range = m_spellInfo->GetMaxRange(true); - if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this); - target = SearchNearbyTarget(range, SPELL_TARGETS_ALLY, SpellEffIndex(i)); - break; - case TARGET_UNIT_NEARBY_ENTRY: - case TARGET_GAMEOBJECT_NEARBY_ENTRY: - range = m_spellInfo->GetMaxRange(m_spellInfo->IsPositive()); - if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this); - target = SearchNearbyTarget(range, SPELL_TARGETS_ENTRY, SpellEffIndex(i)); - break; - default: - break; - } - - if (!target) - return 0; - else if (target->GetTypeId() == TYPEID_GAMEOBJECT) - AddGOTarget((GameObject*)target, effectMask); - else - { - pushType = PUSH_CHAIN; - - if (m_targets.GetUnitTarget() != target) - m_targets.SetUnitTarget((Unit*)target); - } - - break; - } - - case TARGET_TYPE_AREA_SRC: - pushType = PUSH_SRC_CENTER; - break; - - case TARGET_TYPE_AREA_DST: - pushType = PUSH_DST_CENTER; - break; - - case TARGET_TYPE_AREA_CONE: - if (m_spellInfo->AttributesCu & SPELL_ATTR0_CU_CONE_BACK) - pushType = PUSH_IN_BACK; - else if (m_spellInfo->AttributesCu & SPELL_ATTR0_CU_CONE_LINE) - pushType = PUSH_IN_LINE; - else - pushType = PUSH_IN_FRONT; - break; - - case TARGET_TYPE_DEST_CASTER: //4+8+2 - { - if (cur.GetTarget() == TARGET_SRC_CASTER) - { - m_targets.SetSrc(*m_caster); - break; - } - else if (cur.GetTarget() == TARGET_DEST_CASTER) - { - m_targets.SetDst(*m_caster); - break; - } - - float angle, dist; - - float objSize = m_caster->GetObjectSize(); - if (cur.GetTarget() == TARGET_DEST_CASTER_SUMMON) - dist = 0.0f; - else - dist = m_spellInfo->Effects[i].CalcRadius(m_caster); - if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, dist, this); - if (dist < objSize) - dist = objSize; - else if (cur.GetTarget() == TARGET_DEST_CASTER_RANDOM) - dist = objSize + (dist - objSize) * (float)rand_norm(); - - switch (cur.GetTarget()) - { - case TARGET_DEST_CASTER_FRONT_LEFT: angle = static_cast<float>(-M_PI/4); break; - case TARGET_DEST_CASTER_BACK_LEFT: angle = static_cast<float>(-3*M_PI/4); break; - case TARGET_DEST_CASTER_BACK_RIGHT: angle = static_cast<float>(3*M_PI/4); break; - case TARGET_DEST_CASTER_FRONT_RIGHT:angle = static_cast<float>(M_PI/4); break; - case TARGET_DEST_CASTER_SUMMON: - case TARGET_DEST_CASTER_FRONT_LEAP: - case TARGET_DEST_CASTER_FRONT: angle = 0.0f; break; - case TARGET_DEST_CASTER_BACK: angle = static_cast<float>(M_PI); break; - case TARGET_DEST_CASTER_RIGHT: angle = static_cast<float>(-M_PI/2); break; - case TARGET_DEST_CASTER_LEFT: angle = static_cast<float>(M_PI/2); break; - default: angle = (float)rand_norm()*static_cast<float>(2*M_PI); break; - } - - Position pos; - if (cur.GetTarget() == TARGET_DEST_CASTER_FRONT_LEAP) - m_caster->GetFirstCollisionPosition(pos, dist, angle); - else - m_caster->GetNearPosition(pos, dist, angle); - m_targets.SetDst(*m_caster); - m_targets.ModDst(pos); - break; - } - - case TARGET_TYPE_DEST_TARGET: //2+8+2 - { - Unit* target = m_targets.GetUnitTarget(); - if (!target) - { - sLog->outError("SPELL: no unit target for spell ID %u", m_spellInfo->Id); - break; - } - - if (cur.GetTarget() == TARGET_DEST_TARGET_ENEMY || cur.GetTarget() == TARGET_DEST_TARGET_ANY) - { - m_targets.SetDst(*target); - break; - } - - float angle, dist; - - float objSize = target->GetObjectSize(); - dist = m_spellInfo->Effects[i].CalcRadius(m_caster); - if (dist < objSize) - dist = objSize; - else if (cur.GetTarget() == TARGET_DEST_TARGET_RANDOM) - dist = objSize + (dist - objSize) * (float)rand_norm(); - - switch (cur.GetTarget()) - { - case TARGET_DEST_TARGET_FRONT: angle = 0.0f; break; - case TARGET_DEST_TARGET_BACK: angle = static_cast<float>(M_PI); break; - case TARGET_DEST_TARGET_RIGHT: angle = static_cast<float>(M_PI/2); break; - case TARGET_DEST_TARGET_LEFT: angle = static_cast<float>(-M_PI/2); break; - case TARGET_DEST_TARGET_FRONT_LEFT: angle = static_cast<float>(-M_PI/4); break; - case TARGET_DEST_TARGET_BACK_LEFT: angle = static_cast<float>(-3*M_PI/4); break; - case TARGET_DEST_TARGET_BACK_RIGHT: angle = static_cast<float>(3*M_PI/4); break; - case TARGET_DEST_TARGET_FRONT_RIGHT:angle = static_cast<float>(M_PI/4); break; - default: angle = (float)rand_norm()*static_cast<float>(2*M_PI); break; - } - - Position pos; - target->GetNearPosition(pos, dist, angle); - m_targets.SetDst(*target); - m_targets.ModDst(pos); - break; - } - - case TARGET_TYPE_DEST_DEST: //5+8+1 - { - if (!m_targets.HasDst()) - { - sLog->outError("SPELL: no destination for spell ID %u", m_spellInfo->Id); - break; - } - - float angle; - switch (cur.GetTarget()) - { - case TARGET_DEST_DYNOBJ_ENEMY: - case TARGET_DEST_DYNOBJ_ALLY: - case TARGET_DEST_DYNOBJ_NONE: - case TARGET_DEST_DEST: - return effectMask; - case TARGET_DEST_TRAJ: - SelectTrajTargets(); - return effectMask; - case TARGET_DEST_DEST_FRONT: angle = 0.0f; break; - case TARGET_DEST_DEST_BACK: angle = static_cast<float>(M_PI); break; - case TARGET_DEST_DEST_RIGHT: angle = static_cast<float>(M_PI/2); break; - case TARGET_DEST_DEST_LEFT: angle = static_cast<float>(-M_PI/2); break; - case TARGET_DEST_DEST_FRONT_LEFT: angle = static_cast<float>(-M_PI/4); break; - case TARGET_DEST_DEST_BACK_LEFT: angle = static_cast<float>(-3*M_PI/4); break; - case TARGET_DEST_DEST_BACK_RIGHT: angle = static_cast<float>(3*M_PI/4); break; - case TARGET_DEST_DEST_FRONT_RIGHT:angle = static_cast<float>(M_PI/4); break; - default: angle = (float)rand_norm()*static_cast<float>(2*M_PI); break; - } - - float dist = m_spellInfo->Effects[i].CalcRadius(m_caster); - if (cur.GetTarget() == TARGET_DEST_DEST_RANDOM || cur.GetTarget() == TARGET_DEST_DEST_RADIUS) - dist *= (float)rand_norm(); - - // must has dst, no need to set flag - Position pos = *m_targets.GetDst(); - m_caster->MovePosition(pos, dist, angle); - m_targets.ModDst(pos); - break; - } - - case TARGET_TYPE_DEST_SPECIAL: - { - switch (cur.GetTarget()) - { - case TARGET_DEST_DB: - if (SpellTargetPosition const* st = sSpellMgr->GetSpellTargetPosition(m_spellInfo->Id)) - { - //TODO: fix this check - if (m_spellInfo->Effects[0].Effect == SPELL_EFFECT_TELEPORT_UNITS || m_spellInfo->Effects[1].Effect == SPELL_EFFECT_TELEPORT_UNITS || m_spellInfo->Effects[2].Effect == SPELL_EFFECT_TELEPORT_UNITS) - m_targets.SetDst(st->target_X, st->target_Y, st->target_Z, st->target_Orientation, (int32)st->target_mapId); - else if (st->target_mapId == m_caster->GetMapId()) - m_targets.SetDst(st->target_X, st->target_Y, st->target_Z, st->target_Orientation); - } - else - { - sLog->outError("SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id); - Unit* target = NULL; - if (uint64 guid = m_caster->GetUInt64Value(UNIT_FIELD_TARGET)) - target = ObjectAccessor::GetUnit(*m_caster, guid); - m_targets.SetDst(target ? *target : *m_caster); - } - break; - case TARGET_DEST_HOME: - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_targets.SetDst(m_caster->ToPlayer()->m_homebindX, m_caster->ToPlayer()->m_homebindY, m_caster->ToPlayer()->m_homebindZ, m_caster->ToPlayer()->GetOrientation(), m_caster->ToPlayer()->m_homebindMapId); - break; - case TARGET_DEST_NEARBY_ENTRY: - { - float range = m_spellInfo->GetMaxRange(m_spellInfo->IsPositive()); - if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this); - - if (WorldObject* target = SearchNearbyTarget(range, SPELL_TARGETS_ENTRY, SpellEffIndex(i))) - m_targets.SetDst(*target); - break; - } - default: - break; - } - break; - } - - case TARGET_TYPE_CHANNEL: - { - if (!m_originalCaster || !m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) - { - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: no current channeled spell for spell ID %u - spell triggering this spell was interrupted.", m_spellInfo->Id); - break; - } - - switch (cur.GetTarget()) - { - case TARGET_UNIT_CHANNEL_TARGET: - // unit target may be no longer avalible - teleported out of map for example - if (Unit* target = Unit::GetUnit(*m_caster, m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->m_targets.GetUnitTargetGUID())) - AddUnitTarget(target, effectMask); - else - sLog->outError("SPELL: cannot find channel spell target for spell ID %u", m_spellInfo->Id); - break; - case TARGET_DEST_CHANNEL_TARGET: - if (m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->m_targets.HasDst()) - m_targets.SetDst(m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->m_targets); - else if (Unit* target = Unit::GetUnit(*m_caster, m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->m_targets.GetUnitTargetGUID())) - m_targets.SetDst(*target); - else - sLog->outError("SPELL: cannot find channel spell destination for spell ID %u", m_spellInfo->Id); - break; - case TARGET_DEST_CHANNEL_CASTER: - m_targets.SetDst(*m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->GetCaster()); - break; - default: - break; - } - break; - } - - default: - { - switch (cur.GetTarget()) - { - case TARGET_GAMEOBJECT_TARGET: - if (m_targets.GetGOTarget()) - AddGOTarget(m_targets.GetGOTarget(), effectMask); - break; - case TARGET_GAMEOBJECT_ITEM_TARGET: - if (m_targets.GetGOTargetGUID()) - AddGOTarget(m_targets.GetGOTarget(), effectMask); - else if (m_targets.GetItemTarget()) - AddItemTarget(m_targets.GetItemTarget(), effectMask); - break; - default: - sLog->outError("SPELL (caster[type: %u; guidlow: %u], spell: %u): unhandled spell target (%u)", - m_caster->GetTypeId(), m_caster->GetGUIDLow(), m_spellInfo->Id, cur.GetTarget()); - break; - } - break; - } - } - - if (pushType == PUSH_CHAIN) // Chain - { - Unit* target = m_targets.GetUnitTarget(); - if (!target) - { - sLog->outError("SPELL: no chain unit target for spell ID %u", m_spellInfo->Id); - return 0; - } - - //Chain: 2, 6, 22, 25, 45, 77 - uint32 maxTargets = m_spellInfo->Effects[i].ChainTarget; - if (modOwner) - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, maxTargets, this); - - if (maxTargets > 1) - { - //otherwise, this multiplier is used for something else - for (uint32 k = i; k < MAX_SPELL_EFFECTS; ++k) - if (effectMask & (1 << k)) - m_damageMultipliers[k] = 1.0f; - m_applyMultiplierMask |= effectMask; - - float range; - std::list<Unit*> unitList; - - switch (cur.GetTarget()) - { - case TARGET_UNIT_NEARBY_ENEMY: - case TARGET_UNIT_TARGET_ENEMY: - case TARGET_UNIT_NEARBY_ENTRY: // fix me - range = m_spellInfo->GetMaxRange(false); - if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this); - SearchChainTarget(unitList, range, maxTargets, SPELL_TARGETS_ENEMY); - break; - case TARGET_UNIT_TARGET_CHAINHEAL_ALLY: - case TARGET_UNIT_NEARBY_ALLY: // fix me - case TARGET_UNIT_NEARBY_PARTY: - case TARGET_UNIT_NEARBY_RAID: - range = m_spellInfo->GetMaxRange(true); - if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this); - SearchChainTarget(unitList, range, maxTargets, SPELL_TARGETS_CHAINHEAL); - break; - default: - break; - } - - CallScriptAfterUnitTargetSelectHandlers(unitList, SpellEffIndex(i)); - - for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr) - AddUnitTarget(*itr, effectMask, false); - } - else - AddUnitTarget(target, effectMask, false); - } - else if (pushType) - { - float radius; - SpellTargets targetType; - switch (cur.GetTarget()) - { - case TARGET_UNIT_SRC_AREA_ENEMY: - case TARGET_UNIT_DEST_AREA_ENEMY: - case TARGET_UNIT_CONE_ENEMY_24: - case TARGET_UNIT_CONE_ENEMY_54: - case TARGET_UNIT_CONE_ENEMY_104: - radius = m_spellInfo->Effects[i].CalcRadius(); - targetType = SPELL_TARGETS_ENEMY; - break; - case TARGET_UNIT_SRC_AREA_ALLY: - case TARGET_UNIT_DEST_AREA_ALLY: - case TARGET_UNIT_CONE_ALLY: - radius = m_spellInfo->Effects[i].CalcRadius(); - targetType = SPELL_TARGETS_ALLY; - break; - case TARGET_UNIT_DEST_AREA_ENTRY: - case TARGET_UNIT_SRC_AREA_ENTRY: - case TARGET_UNIT_CONE_ENTRY: // fix me - radius = m_spellInfo->Effects[i].CalcRadius(); - targetType = SPELL_TARGETS_ENTRY; - break; - case TARGET_GAMEOBJECT_SRC_AREA: - case TARGET_GAMEOBJECT_DEST_AREA: - case TARGET_GAMEOBJECT_CONE: - radius = m_spellInfo->Effects[i].CalcRadius(); - targetType = SPELL_TARGETS_GO; - break; - default: - radius = m_spellInfo->Effects[i].CalcRadius(); - targetType = SPELL_TARGETS_NONE; - break; - } - - if (modOwner) - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius, this); - radius *= m_spellValue->RadiusMod; - - std::list<Unit*> unitList; - std::list<GameObject*> gobjectList; - switch (targetType) - { - case SPELL_TARGETS_ENTRY: - { - ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); - if (!conditions.empty()) - { - for (ConditionList::const_iterator i_spellST = conditions.begin(); i_spellST != conditions.end(); ++i_spellST) - { - if ((*i_spellST)->ConditionType != CONDITION_SPELL_SCRIPT_TARGET) - continue; - if ((*i_spellST)->ConditionValue3 && !((*i_spellST)->ConditionValue3 & effectMask)) - continue; - if ((*i_spellST)->ConditionValue1 == SPELL_TARGET_TYPE_CREATURE) - SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ENTRY, (*i_spellST)->ConditionValue2); - else if ((*i_spellST)->ConditionValue1 == SPELL_TARGET_TYPE_CONTROLLED) - { - for (Unit::ControlList::iterator itr = m_caster->m_Controlled.begin(); itr != m_caster->m_Controlled.end(); ++itr) - if ((*itr)->GetEntry() == (*i_spellST)->ConditionValue2 && - (*itr)->IsInMap(m_caster)) // For 60243 and 52173 need skip radius check or use range (no radius entry for effect) - unitList.push_back(*itr); - } - } - } - else - { - // Custom entries - // TODO: move these to sql - switch (m_spellInfo->Id) - { - case 46584: // Raise Dead - { - if (WorldObject* result = FindCorpseUsing<Trinity::RaiseDeadObjectCheck>()) - { - switch (result->GetTypeId()) - { - case TYPEID_UNIT: - case TYPEID_PLAYER: - unitList.push_back(result->ToUnit()); - // no break; - case TYPEID_CORPSE: // wont work until corpses are allowed in target lists, but at least will send dest in packet - m_targets.SetDst(*result); - break; - default: - break; - } - } - break; - } - // Corpse Explosion - case 49158: - case 51325: - case 51326: - case 51327: - case 51328: - // Search for ghoul if our ghoul or dead body not valid unit target - if (!(m_targets.GetUnitTarget() && ((m_targets.GetUnitTarget()->GetEntry() == 26125 && m_targets.GetUnitTarget()->GetOwnerGUID() == m_caster->GetGUID()) - || (m_targets.GetUnitTarget()->getDeathState() == CORPSE - && m_targets.GetUnitTarget()->GetTypeId() == TYPEID_UNIT - && !(m_targets.GetUnitTarget()->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL) - && m_targets.GetUnitTarget()->GetDisplayId() == m_targets.GetUnitTarget()->GetNativeDisplayId())))) - { - CleanupTargetList(); - - WorldObject* result = FindCorpseUsing<Trinity::ExplodeCorpseObjectCheck>(); - - if (result) - { - switch (result->GetTypeId()) - { - case TYPEID_UNIT: - case TYPEID_PLAYER: - m_targets.SetUnitTarget((Unit*)result); - break; - default: - break; - } - } - else - { - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true); - SendCastResult(SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW); - finish(false); - } - } - break; - - default: - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell (ID: %u) (caster Entry: %u) does not have type CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET record in `conditions` table.", m_spellInfo->Id, m_caster->GetEntry()); - - if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_TELEPORT_UNITS) - SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ENTRY, 0); - else if (m_spellInfo->IsPositiveEffect(i)) - SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ALLY); - else - SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ENEMY); - } - } - break; - } - case SPELL_TARGETS_GO: - { - ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); - if (!conditions.empty()) - { - for (ConditionList::const_iterator i_spellST = conditions.begin(); i_spellST != conditions.end(); ++i_spellST) - { - if ((*i_spellST)->ConditionType != CONDITION_SPELL_SCRIPT_TARGET) - continue; - if ((*i_spellST)->ConditionValue3 && !((*i_spellST)->ConditionValue3 & effectMask)) - continue; - if ((*i_spellST)->ConditionValue1 == SPELL_TARGET_TYPE_GAMEOBJECT) - SearchGOAreaTarget(gobjectList, radius, pushType, SPELL_TARGETS_GO, (*i_spellST)->ConditionValue2); - } - } - else - { - if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_ACTIVATE_OBJECT) - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell (ID: %u) (caster Entry: %u) with SPELL_EFFECT_ACTIVATE_OBJECT does not have type CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET record in `conditions` table.", m_spellInfo->Id, m_caster->GetEntry()); - SearchGOAreaTarget(gobjectList, radius, pushType, SPELL_TARGETS_GO); - } - break; - } - case SPELL_TARGETS_ALLY: - case SPELL_TARGETS_ENEMY: - case SPELL_TARGETS_CHAINHEAL: - case SPELL_TARGETS_ANY: - SearchAreaTarget(unitList, radius, pushType, targetType); - break; - default: - switch (cur.GetTarget()) - { - case TARGET_UNIT_SRC_AREA_PARTY: - case TARGET_UNIT_DEST_AREA_PARTY: - m_caster->GetPartyMemberInDist(unitList, radius); //fix me - break; - case TARGET_UNIT_LASTTARGET_AREA_PARTY: - m_targets.GetUnitTarget()->GetPartyMemberInDist(unitList, radius); - break; - case TARGET_UNIT_CASTER_AREA_PARTY: - m_caster->GetPartyMemberInDist(unitList, radius); - break; - case TARGET_UNIT_CASTER_AREA_RAID: - m_caster->GetRaidMember(unitList, radius); - break; - case TARGET_UNIT_TARGET_AREA_RAID_CLASS: - { - Player* targetPlayer = m_targets.GetUnitTarget() && m_targets.GetUnitTarget()->GetTypeId() == TYPEID_PLAYER - ? (Player*)m_targets.GetUnitTarget() : NULL; - - Group* group = targetPlayer ? targetPlayer->GetGroup() : NULL; - if (group) - { - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* Target = itr->getSource(); - - // IsHostileTo check duel and controlled by enemy - if (Target && targetPlayer->IsWithinDistInMap(Target, radius) && targetPlayer->getClass() == Target->getClass() && !m_caster->IsHostileTo(Target)) - AddUnitTarget(Target, effectMask); - } - } - else if (m_targets.GetUnitTarget()) - AddUnitTarget(m_targets.GetUnitTarget(), effectMask); - break; - } - default: - break; - } - break; - } - - if (!unitList.empty()) - { - // Special target selection for smart heals and energizes - uint32 maxSize = 0; - int32 power = -1; - switch (m_spellInfo->SpellFamilyName) - { - case SPELLFAMILY_GENERIC: - switch (m_spellInfo->Id) - { - case 52759: // Ancestral Awakening - case 71610: // Echoes of Light (Althor's Abacus normal version) - case 71641: // Echoes of Light (Althor's Abacus heroic version) - maxSize = 1; - power = POWER_HEALTH; - break; - case 54968: // Glyph of Holy Light - maxSize = m_spellInfo->MaxAffectedTargets; - power = POWER_HEALTH; - break; - case 57669: // Replenishment - // In arenas Replenishment may only affect the caster - if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->InArena()) - { - unitList.clear(); - unitList.push_back(m_caster); - break; - } - maxSize = 10; - power = POWER_MANA; - break; - default: - break; - } - break; - case SPELLFAMILY_PRIEST: - if (m_spellInfo->SpellFamilyFlags[0] == 0x10000000) // Circle of Healing - { - maxSize = m_caster->HasAura(55675) ? 6 : 5; // Glyph of Circle of Healing - power = POWER_HEALTH; - } - else if (m_spellInfo->Id == 64844) // Divine Hymn - { - maxSize = 3; - power = POWER_HEALTH; - } - else if (m_spellInfo->Id == 64904) // Hymn of Hope - { - maxSize = 3; - power = POWER_MANA; - } - else - break; - - // Remove targets outside caster's raid - for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end();) - { - if (!(*itr)->IsInRaidWith(m_caster)) - itr = unitList.erase(itr); - else - ++itr; - } - break; - case SPELLFAMILY_DRUID: - if (m_spellInfo->SpellFamilyFlags[1] == 0x04000000) // Wild Growth - { - maxSize = m_caster->HasAura(62970) ? 6 : 5; // Glyph of Wild Growth - power = POWER_HEALTH; - } - else if (m_spellInfo->SpellFamilyFlags[2] == 0x0100) // Starfall - { - // Remove targets not in LoS or in stealth - for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end();) - { - if ((*itr)->HasStealthAura() || (*itr)->HasInvisibilityAura() || !(*itr)->IsWithinLOSInMap(m_caster)) - itr = unitList.erase(itr); - else - ++itr; - } - break; - } - else - break; - - // Remove targets outside caster's raid - for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end();) - if (!(*itr)->IsInRaidWith(m_caster)) - itr = unitList.erase(itr); - else - ++itr; - break; - default: - break; - } - - if (maxSize && power != -1) - { - if (Powers(power) == POWER_HEALTH) - { - if (unitList.size() > maxSize) - { - unitList.sort(Trinity::HealthPctOrderPred()); - unitList.resize(maxSize); - } - } - else - { - for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end();) - if ((*itr)->getPowerType() != (Powers)power) - itr = unitList.erase(itr); - else - ++itr; - - if (unitList.size() > maxSize) - { - unitList.sort(Trinity::PowerPctOrderPred((Powers)power)); - unitList.resize(maxSize); - } - } - } - - // Other special target selection goes here - if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) - { - Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); - for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) - if ((*j)->IsAffectedOnSpell(m_spellInfo)) - maxTargets += (*j)->GetAmount(); - - if (m_spellInfo->Id == 5246) //Intimidating Shout - unitList.remove(m_targets.GetUnitTarget()); - Trinity::RandomResizeList(unitList, maxTargets); - } - } - - CallScriptAfterUnitTargetSelectHandlers(unitList, SpellEffIndex(i)); - - for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr) - AddUnitTarget(*itr, effectMask, false); - - if (!gobjectList.empty()) - { - if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) - { - Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); - for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) - if ((*j)->IsAffectedOnSpell(m_spellInfo)) - maxTargets += (*j)->GetAmount(); - - Trinity::RandomResizeList(gobjectList, maxTargets); - } - for (std::list<GameObject*>::iterator itr = gobjectList.begin(); itr != gobjectList.end(); ++itr) - AddGOTarget(*itr, effectMask); - } - } - - return effectMask; -} - void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura) { if (m_CastItem) @@ -6825,150 +6867,6 @@ void Spell::SetSpellValue(SpellValueMod mod, int32 value) } } -float tangent(float x) -{ - x = tan(x); - //if (x < std::numeric_limits<float>::max() && x > -std::numeric_limits<float>::max()) return x; - //if (x >= std::numeric_limits<float>::max()) return std::numeric_limits<float>::max(); - //if (x <= -std::numeric_limits<float>::max()) return -std::numeric_limits<float>::max(); - if (x < 100000.0f && x > -100000.0f) return x; - if (x >= 100000.0f) return 100000.0f; - if (x <= 100000.0f) return -100000.0f; - return 0.0f; -} - -#define DEBUG_TRAJ(a) //a - -void Spell::SelectTrajTargets() -{ - if (!m_targets.HasTraj()) - return; - - float dist2d = m_targets.GetDist2d(); - if (!dist2d) - return; - - float srcToDestDelta = m_targets.GetDst()->m_positionZ - m_targets.GetSrc()->m_positionZ; - - UnitList unitList; - SearchAreaTarget(unitList, dist2d, PUSH_IN_THIN_LINE, SPELL_TARGETS_ANY); - if (unitList.empty()) - return; - - unitList.sort(Trinity::ObjectDistanceOrderPred(m_caster)); - - float b = tangent(m_targets.GetElevation()); - float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d); - if (a > -0.0001f) - a = 0; - DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: a %f b %f", a, b);) - - float bestDist = m_spellInfo->GetMaxRange(false); - - UnitList::const_iterator itr = unitList.begin(); - for (; itr != unitList.end(); ++itr) - { - if (m_caster == *itr || m_caster->IsOnVehicle(*itr) || (*itr)->GetVehicle())//(*itr)->IsOnVehicle(m_caster)) - continue; - - const float size = std::max((*itr)->GetObjectSize() * 0.7f, 1.0f); // 1/sqrt(3) - // TODO: all calculation should be based on src instead of m_caster - const float objDist2d = m_targets.GetSrc()->GetExactDist2d(*itr) * cos(m_targets.GetSrc()->GetRelativeAngle(*itr)); - const float dz = (*itr)->GetPositionZ() - m_targets.GetSrc()->m_positionZ; - - DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: check %u, dist between %f %f, height between %f %f.", (*itr)->GetEntry(), objDist2d - size, objDist2d + size, dz - size, dz + size);) - - float dist = objDist2d - size; - float height = dist * (a * dist + b); - DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);) - if (dist < bestDist && height < dz + size && height > dz - size) - { - bestDist = dist > 0 ? dist : 0; - break; - } - -#define CHECK_DIST {\ - DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)\ - if (dist > bestDist)\ - continue;\ - if (dist < objDist2d + size && dist > objDist2d - size)\ - {\ - bestDist = dist;\ - break;\ - }\ - } - - if (!a) - { - height = dz - size; - dist = height / b; - CHECK_DIST; - - height = dz + size; - dist = height / b; - CHECK_DIST; - - continue; - } - - height = dz - size; - float sqrt1 = b * b + 4 * a * height; - if (sqrt1 > 0) - { - sqrt1 = sqrt(sqrt1); - dist = (sqrt1 - b) / (2 * a); - CHECK_DIST; - } - - height = dz + size; - float sqrt2 = b * b + 4 * a * height; - if (sqrt2 > 0) - { - sqrt2 = sqrt(sqrt2); - dist = (sqrt2 - b) / (2 * a); - CHECK_DIST; - - dist = (-sqrt2 - b) / (2 * a); - CHECK_DIST; - } - - if (sqrt1 > 0) - { - dist = (-sqrt1 - b) / (2 * a); - CHECK_DIST; - } - } - - if (m_targets.GetSrc()->GetExactDist2d(m_targets.GetDst()) > bestDist) - { - float x = m_targets.GetSrc()->m_positionX + cos(m_caster->GetOrientation()) * bestDist; - float y = m_targets.GetSrc()->m_positionY + sin(m_caster->GetOrientation()) * bestDist; - float z = m_targets.GetSrc()->m_positionZ + bestDist * (a * bestDist + b); - - if (itr != unitList.end()) - { - float distSq = (*itr)->GetExactDistSq(x, y, z); - float sizeSq = (*itr)->GetObjectSize(); - sizeSq *= sizeSq; - DEBUG_TRAJ(sLog->outError("Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);) - if (distSq > sizeSq) - { - float factor = 1 - sqrt(sizeSq / distSq); - x += factor * ((*itr)->GetPositionX() - x); - y += factor * ((*itr)->GetPositionY() - y); - z += factor * ((*itr)->GetPositionZ() - z); - - distSq = (*itr)->GetExactDistSq(x, y, z); - DEBUG_TRAJ(sLog->outError("Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);) - } - } - - Position trajDst; - trajDst.Relocate(x, y, z, m_caster->GetOrientation()); - m_targets.ModDst(trajDst); - } -} - void Spell::PrepareTargetProcessing() { CheckEffectExecuteData(); @@ -7320,3 +7218,152 @@ void Spell::CancelGlobalCooldown() else if (m_caster->GetTypeId() == TYPEID_PLAYER) m_caster->ToPlayer()->GetGlobalCooldownMgr().CancelGlobalCooldown(m_spellInfo); } + +namespace Trinity +{ + +WorldObjectSpellTargetCheck::WorldObjectSpellTargetCheck(Unit* caster, Unit* referer, SpellInfo const* spellInfo, + SpellTargetCheckTypes selectionType, ConditionList* condList) : _caster(caster), _referer(referer), _spellInfo(spellInfo), + _targetSelectionType(selectionType), _condList(condList) +{ + if (condList) + _condSrcInfo = new ConditionSourceInfo(NULL, caster); + else + _condSrcInfo = NULL; +} + +WorldObjectSpellTargetCheck::~WorldObjectSpellTargetCheck() +{ + if (_condSrcInfo) + delete _condSrcInfo; +} + +bool WorldObjectSpellTargetCheck::operator()(WorldObject* target) +{ + if (_spellInfo->CheckTarget(_caster, target, true) != SPELL_CAST_OK) + return false; + Unit* unitTarget = target->ToUnit(); + if (Corpse* corpseTarget = target->ToCorpse()) + { + // use ofter for party/assistance checks + if (Player* owner = ObjectAccessor::FindPlayer(corpseTarget->GetOwnerGUID())) + unitTarget = owner; + else + return false; + } + if (unitTarget) + { + switch (_targetSelectionType) + { + case TARGET_CHECK_ENEMY: + if (unitTarget->isTotem()) + return false; + if (!_caster->_IsValidAttackTarget(unitTarget, _spellInfo)) + return false; + break; + case TARGET_CHECK_ALLY: + if (unitTarget->isTotem()) + return false; + if (!_caster->_IsValidAssistTarget(unitTarget, _spellInfo)) + return false; + break; + case TARGET_CHECK_PARTY: + if (unitTarget->isTotem()) + return false; + if (!_caster->_IsValidAssistTarget(unitTarget, _spellInfo)) + return false; + if (!_referer->IsInPartyWith(unitTarget)) + return false; + break; + case TARGET_CHECK_RAID_CLASS: + if (_referer->getClass() != unitTarget->getClass()) + return false; + // nobreak; + case TARGET_CHECK_RAID: + if (unitTarget->isTotem()) + return false; + if (!_caster->_IsValidAssistTarget(unitTarget, _spellInfo)) + return false; + if (!_referer->IsInRaidWith(unitTarget)) + return false; + break; + default: + break; + } + } + if (!_condSrcInfo) + return true; + _condSrcInfo->mConditionTargets[0] = target; + return sConditionMgr->IsObjectMeetToConditions(*_condSrcInfo, *_condList); +} + +WorldObjectSpellNearbyTargetCheck::WorldObjectSpellNearbyTargetCheck(float range, Unit* caster, SpellInfo const* spellInfo, + SpellTargetCheckTypes selectionType, ConditionList* condList) + : WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList), _range(range), _position(caster) +{ +} + +bool WorldObjectSpellNearbyTargetCheck::operator()(WorldObject* target) +{ + float dist = target->GetDistance(*_position); + if (dist < _range && WorldObjectSpellTargetCheck::operator ()(target)) + { + _range = dist; + return true; + } + return false; +} + +WorldObjectSpellAreaTargetCheck::WorldObjectSpellAreaTargetCheck(float range, Position const* position, Unit* caster, + Unit* referer, SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionList* condList) + : WorldObjectSpellTargetCheck(caster, referer, spellInfo, selectionType, condList), _range(range), _position(position) +{ +} + +bool WorldObjectSpellAreaTargetCheck::operator()(WorldObject* target) +{ + if (!target->IsWithinDist3d(_position, _range)) + return false; + return WorldObjectSpellTargetCheck::operator ()(target); +} + +WorldObjectSpellConeTargetCheck::WorldObjectSpellConeTargetCheck(float coneAngle, float range, Unit* caster, + SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionList* condList) + : WorldObjectSpellAreaTargetCheck(range, caster, caster, caster, spellInfo, selectionType, condList), _coneAngle(coneAngle) +{ +} + +bool WorldObjectSpellConeTargetCheck::operator()(WorldObject* target) +{ + if (_spellInfo->AttributesCu & SPELL_ATTR0_CU_CONE_BACK) + { + if (!_caster->isInBack(target, _coneAngle)) + return false; + } + else if (_spellInfo->AttributesCu & SPELL_ATTR0_CU_CONE_LINE) + { + if (!_caster->HasInLine(target, _caster->GetObjectSize())) + return false; + } + else + { + if (!_caster->isInFront(target, _coneAngle)) + return false; + } + return WorldObjectSpellAreaTargetCheck::operator ()(target); +} + +WorldObjectSpellTrajTargetCheck::WorldObjectSpellTrajTargetCheck(float range, Position const* position, Unit* caster, SpellInfo const* spellInfo) + : WorldObjectSpellAreaTargetCheck(range, position, caster, caster, spellInfo, TARGET_CHECK_DEFAULT, NULL) +{ +} + +bool WorldObjectSpellTrajTargetCheck::operator()(WorldObject* target) +{ + // return all targets on missile trajectory (0 - size of a missile) + if (!_caster->HasInLine(target, 0)) + return false; + return WorldObjectSpellAreaTargetCheck::operator ()(target); +} + +} //namespace Trinity diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index b20ec345cce..971bc1989ab 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -79,19 +79,6 @@ enum SpellRangeFlag SPELL_RANGE_RANGED = 2, //hunter range and ranged weapon }; -enum SpellNotifyPushType -{ - PUSH_NONE = 0, - PUSH_IN_FRONT, - PUSH_IN_BACK, - PUSH_IN_LINE, - PUSH_IN_THIN_LINE, - PUSH_SRC_CENTER, - PUSH_DST_CENTER, - PUSH_CASTER_CENTER, //this is never used in grid search - PUSH_CHAIN, -}; - class SpellCastTargets { public: @@ -210,17 +197,6 @@ enum SpellEffectHandleMode SPELL_EFFECT_HANDLE_HIT_TARGET, }; -enum SpellTargets -{ - SPELL_TARGETS_NONE = 0, - SPELL_TARGETS_ALLY, - SPELL_TARGETS_ENEMY, - SPELL_TARGETS_ENTRY, - SPELL_TARGETS_CHAINHEAL, - SPELL_TARGETS_ANY, - SPELL_TARGETS_GO -}; - namespace Trinity { struct SpellNotifierCreatureAndPlayer; @@ -228,7 +204,6 @@ namespace Trinity class Spell { - friend struct Trinity::SpellNotifierCreatureAndPlayer; friend void Unit::SetCurrentCastedSpell(Spell* pSpell); friend class SpellScript; public: @@ -364,6 +339,32 @@ class Spell Spell(Unit* caster, SpellInfo const* info, TriggerCastFlags triggerFlags, uint64 originalCasterGUID = 0, bool skipCheck = false); ~Spell(); + void InitExplicitTargets(SpellCastTargets const& targets); + void SelectExplicitTargets(); + + void SelectSpellTargets(); + void SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32& processedEffectMask); + void SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType); + void SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32 effMask); + void SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32 effMask); + void SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32 effMask); + void SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType); + void SelectImplicitTargetDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType); + void SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType); + void SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType); + void SelectImplicitTargetObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType); + void SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, WorldObject* target, uint32 effMask); + void SelectImplicitTrajTargets(); + + void SelectEffectTypeImplicitTargets(uint8 effIndex); + + uint32 GetSearcherTypeMask(SpellTargetObjectTypes objType, ConditionList* condList); + template<class SEARCHER> void SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* referer, Position const* pos, float radius); + + WorldObject* SearchNearbyTarget(float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionList* condList = NULL); + void SearchAreaTargets(std::list<WorldObject*>& targets, float range, Position const* position, Unit* referer, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionList* condList); + void SearchChainTargets(std::list<WorldObject*>& targets, uint32 chainTargets, WorldObject* target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, ConditionList* condList, bool isChainHeal); + void prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura = NULL); void cancel(); void update(uint32 difftime); @@ -404,14 +405,6 @@ class Spell void WriteSpellGoTargets(WorldPacket* data); void WriteAmmoToPacket(WorldPacket* data); - void InitExplicitTargets(SpellCastTargets const& targets); - void SelectSpellTargets(); - void SelectEffectTypeImplicitTargets(uint8 effIndex); - uint32 SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur); - void SelectTrajTargets(); - - template<typename T> WorldObject* FindCorpseUsing(); - bool CheckEffectTarget(Unit const* target, uint32 eff) const; bool CanAutoCast(Unit* target); void CheckSrc() { if (!m_targets.HasSrc()) m_targets.SetSrc(*m_caster); } @@ -606,10 +599,6 @@ class Spell void DoAllEffectOnTarget(GOTargetInfo* target); void DoAllEffectOnTarget(ItemTargetInfo* target); bool UpdateChanneledTargetList(); - void SearchAreaTarget(std::list<Unit*> &unitList, float radius, SpellNotifyPushType type, SpellTargets TargetType, uint32 entry = 0); - void SearchGOAreaTarget(std::list<GameObject*> &gobjectList, float radius, SpellNotifyPushType type, SpellTargets TargetType, uint32 entry = 0); - void SearchChainTarget(std::list<Unit*> &unitList, float radius, uint32 unMaxTargets, SpellTargets TargetType); - WorldObject* SearchNearbyTarget(float range, SpellTargets TargetType, SpellEffIndex effIndex); bool IsValidDeadOrAliveTarget(Unit const* target) const; void HandleLaunchPhase(); void DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier); @@ -675,98 +664,52 @@ class Spell namespace Trinity { - struct SpellNotifierCreatureAndPlayer + struct WorldObjectSpellTargetCheck { - std::list<Unit*> *i_data; - SpellNotifyPushType i_push_type; - float i_radius; - SpellTargets i_TargetType; - const Unit* const i_source; - uint32 i_entry; - const Position* const i_pos; - SpellInfo const* i_spellProto; - - SpellNotifierCreatureAndPlayer(Unit* source, std::list<Unit*> &data, float radius, SpellNotifyPushType type, - SpellTargets TargetType = SPELL_TARGETS_ENEMY, const Position* pos = NULL, uint32 entry = 0, SpellInfo const* spellProto = NULL) - : i_data(&data), i_push_type(type), i_radius(radius), i_TargetType(TargetType), - i_source(source), i_entry(entry), i_pos(pos), i_spellProto(spellProto) - { - ASSERT(i_source); - } + Unit* _caster; + Unit* _referer; + SpellInfo const* _spellInfo; + SpellTargetCheckTypes _targetSelectionType; + ConditionSourceInfo* _condSrcInfo; + ConditionList* _condList; + + WorldObjectSpellTargetCheck(Unit* caster, Unit* referer, SpellInfo const* spellInfo, + SpellTargetCheckTypes selectionType, ConditionList* condList); + ~WorldObjectSpellTargetCheck(); + bool operator()(WorldObject* target); + }; - template<class T> inline void Visit(GridRefManager<T>& m) - { - for (typename GridRefManager<T>::iterator itr = m.begin(); itr != m.end(); ++itr) - { - Unit* target = (Unit*)itr->getSource(); - - if (i_spellProto->CheckTarget(i_source, target, true) != SPELL_CAST_OK) - continue; - - switch (i_TargetType) - { - case SPELL_TARGETS_ENEMY: - if (target->isTotem()) - continue; - if (!i_source->_IsValidAttackTarget(target, i_spellProto)) - continue; - break; - case SPELL_TARGETS_ALLY: - if (target->isTotem()) - continue; - if (!i_source->_IsValidAssistTarget(target, i_spellProto)) - continue; - break; - case SPELL_TARGETS_ENTRY: - if (target->GetEntry()!= i_entry) - continue; - break; - case SPELL_TARGETS_ANY: - default: - break; - } - - switch (i_push_type) - { - case PUSH_SRC_CENTER: - case PUSH_DST_CENTER: - case PUSH_CHAIN: - default: - if (target->IsWithinDist3d(i_pos, i_radius)) - i_data->push_back(target); - break; - case PUSH_IN_FRONT: - if (i_source->isInFront(target, i_radius, static_cast<float>(M_PI/2))) - i_data->push_back(target); - break; - case PUSH_IN_BACK: - if (i_source->isInBack(target, i_radius, static_cast<float>(M_PI/2))) - i_data->push_back(target); - break; - case PUSH_IN_LINE: - if (i_source->HasInLine(target, i_radius, i_source->GetObjectSize())) - i_data->push_back(target); - break; - case PUSH_IN_THIN_LINE: // only traj - if (i_pos->HasInLine(target, i_radius, 0)) - i_data->push_back(target); - break; - } - } - } + struct WorldObjectSpellNearbyTargetCheck : public WorldObjectSpellTargetCheck + { + float _range; + Position const* _position; + WorldObjectSpellNearbyTargetCheck(float range, Unit* caster, SpellInfo const* spellInfo, + SpellTargetCheckTypes selectionType, ConditionList* condList); + bool operator()(WorldObject* target); + }; + + struct WorldObjectSpellAreaTargetCheck : public WorldObjectSpellTargetCheck + { + float _range; + Position const* _position; + WorldObjectSpellAreaTargetCheck(float range, Position const* position, Unit* caster, + Unit* referer, SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionList* condList); + bool operator()(WorldObject* target); + }; - #ifdef _WIN32 - template<> inline void Visit(CorpseMapType &) {} - template<> inline void Visit(GameObjectMapType &) {} - template<> inline void Visit(DynamicObjectMapType &) {} - #endif + struct WorldObjectSpellConeTargetCheck : public WorldObjectSpellAreaTargetCheck + { + float _coneAngle; + WorldObjectSpellConeTargetCheck(float coneAngle, float range, Unit* caster, + SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionList* condList); + bool operator()(WorldObject* target); }; - #ifndef _WIN32 - template<> inline void SpellNotifierCreatureAndPlayer::Visit(CorpseMapType&) {} - template<> inline void SpellNotifierCreatureAndPlayer::Visit(GameObjectMapType&) {} - template<> inline void SpellNotifierCreatureAndPlayer::Visit(DynamicObjectMapType&) {} - #endif + struct WorldObjectSpellTrajTargetCheck : public WorldObjectSpellAreaTargetCheck + { + WorldObjectSpellTrajTargetCheck(float range, Position const* position, Unit* caster, SpellInfo const* spellInfo); + bool operator()(WorldObject* target); + }; } typedef void(Spell::*pEffect)(SpellEffIndex effIndex); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index a8f6ece7102..407ddbf6b21 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -751,600 +751,6 @@ void Spell::EffectDummy(SpellEffIndex effIndex) // selection by spell family switch (m_spellInfo->SpellFamilyName) { - case SPELLFAMILY_GENERIC: - { - switch (m_spellInfo->Id) - { - case 31225: // Shimmering Vessel (restore creature to life) - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) - return; - unitTarget->ToCreature()->setDeathState(JUST_ALIVED); - return; - } - case 12162: // Deep wounds - case 12850: // (now good common check for this spells) - case 12868: - { - if (!unitTarget) - return; - - // apply percent damage mods - damage = m_caster->SpellDamageBonus(unitTarget, m_spellInfo, damage, SPELL_DIRECT_DAMAGE); - - switch (m_spellInfo->Id) - { - case 12162: ApplyPctN(damage, 16); break; // Rank 1 - case 12850: ApplyPctN(damage, 32); break; // Rank 2 - case 12868: ApplyPctN(damage, 48); break; // Rank 3 - default: - sLog->outError("Spell::EffectDummy: Spell %u not handled in DW", m_spellInfo->Id); - return; - } - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(12721); - uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude; - - // Add remaining ticks to damage done - if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(12721, EFFECT_0, m_caster->GetGUID())) - damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber()); - - damage = damage / ticks; - m_caster->CastCustomSpell(unitTarget, 12721, &damage, NULL, NULL, true); - return; - } - case 13567: // Dummy Trigger - { - // can be used for different aura triggering, so select by aura - if (!m_triggeredByAuraSpell || !unitTarget) - return; - - switch (m_triggeredByAuraSpell->Id) - { - case 26467: // Persistent Shield - m_caster->CastCustomSpell(unitTarget, 26470, &damage, NULL, NULL, true); - break; - default: - sLog->outError("EffectDummy: Non-handled case for spell 13567 for triggered aura %u", m_triggeredByAuraSpell->Id); - break; - } - return; - } - case 17251: // Spirit Healer Res - { - if (!unitTarget || !m_originalCaster) - return; - - if (m_originalCaster->GetTypeId() == TYPEID_PLAYER) - { - WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8); - data << uint64(unitTarget->GetGUID()); - m_originalCaster->ToPlayer()->GetSession()->SendPacket(&data); - } - return; - } - case 23019: // Crystal Prison Dummy DND - { - if (!unitTarget || !unitTarget->isAlive() || unitTarget->GetTypeId() != TYPEID_UNIT || unitTarget->ToCreature()->isPet()) - return; - - Creature* creatureTarget = unitTarget->ToCreature(); - - m_caster->SummonGameObject(179644, creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetOrientation(), 0, 0, 0, 0, uint32(creatureTarget->GetRespawnTime()-time(NULL))); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019"); - - creatureTarget->DespawnOrUnsummon(); - - return; - } - case 23448: // Transporter Arrival - Ultrasafe Transporter: Gadgetzan - backfires - { - int32 r = irand(0, 119); - if (r < 20) // Transporter Malfunction - 1/6 polymorph - m_caster->CastSpell(m_caster, 23444, true); - else if (r < 100) // Evil Twin - 4/6 evil twin - m_caster->CastSpell(m_caster, 23445, true); - else // Transporter Malfunction - 1/6 miss the target - m_caster->CastSpell(m_caster, 36902, true); - return; - } - case 23453: // Gnomish Transporter - Ultrasafe Transporter: Gadgetzan - if (roll_chance_i(50)) // Gadgetzan Transporter - success - m_caster->CastSpell(m_caster, 23441, true); - else // Gadgetzan Transporter Failure - failure - m_caster->CastSpell(m_caster, 23446, true); - return; - case 25860: // Reindeer Transformation - { - if (!m_caster->HasAuraType(SPELL_AURA_MOUNTED)) - return; - - float flyspeed = m_caster->GetSpeedRate(MOVE_FLIGHT); - float speed = m_caster->GetSpeedRate(MOVE_RUN); - - m_caster->RemoveAurasByType(SPELL_AURA_MOUNTED); - - //5 different spells used depending on mounted speed and if mount can fly or not - if (flyspeed >= 4.1f) - // Flying Reindeer - m_caster->CastSpell(m_caster, 44827, true); //310% flying Reindeer - else if (flyspeed >= 3.8f) - // Flying Reindeer - m_caster->CastSpell(m_caster, 44825, true); //280% flying Reindeer - else if (flyspeed >= 1.6f) - // Flying Reindeer - m_caster->CastSpell(m_caster, 44824, true); //60% flying Reindeer - else if (speed >= 2.0f) - // Reindeer - m_caster->CastSpell(m_caster, 25859, true); //100% ground Reindeer - else - // Reindeer - m_caster->CastSpell(m_caster, 25858, true); //60% ground Reindeer - - return; - } - case 26074: // Holiday Cheer - // implemented at client side - return; - // Polarity Shift - case 28089: - if (unitTarget) - unitTarget->CastSpell(unitTarget, roll_chance_i(50) ? 28059 : 28084, true, NULL, NULL, m_caster->GetGUID()); - break; - // Polarity Shift - case 39096: - if (unitTarget) - unitTarget->CastSpell(unitTarget, roll_chance_i(50) ? 39088 : 39091, true, NULL, NULL, m_caster->GetGUID()); - break; - case 29200: // Purify Helboar Meat - { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; - - spell_id = roll_chance_i(50) - ? 29277 // Summon Purified Helboar Meat - : 29278; // Summon Toxic Helboar Meat - - m_caster->CastSpell(m_caster, spell_id, true, NULL); - return; - } - case 29858: // Soulshatter - if (unitTarget && unitTarget->CanHaveThreatList() - && unitTarget->getThreatManager().getThreat(m_caster) > 0.0f) - m_caster->CastSpell(unitTarget, 32835, true); - return; - case 30458: // Nigh Invulnerability - if (!m_CastItem) return; - if (roll_chance_i(86)) // Nigh-Invulnerability - success - m_caster->CastSpell(m_caster, 30456, true, m_CastItem); - else // Complete Vulnerability - backfire in 14% casts - m_caster->CastSpell(m_caster, 30457, true, m_CastItem); - return; - case 30507: // Poultryizer - if (!m_CastItem) return; - if (roll_chance_i(80)) // Poultryized! - success - m_caster->CastSpell(unitTarget, 30501, true, m_CastItem); - else // Poultryized! - backfire 20% - m_caster->CastSpell(unitTarget, 30504, true, m_CastItem); - return; - case 35745: // Socrethar's Stone - { - switch (m_caster->GetAreaId()) - { - case 3900: - spell_id = 35743; - break; // Socrethar Portal - case 3742: - spell_id = 35744; - break; // Socrethar Portal - default: - return; - } - - m_caster->CastSpell(m_caster, spell_id, true); - return; - } - case 37674: // Chaos Blast - { - if (!unitTarget) - return; - - int32 basepoints0 = 100; - m_caster->CastCustomSpell(unitTarget, 37675, &basepoints0, NULL, NULL, true); - return; - } - // Wrath of the Astromancer - case 42784: - { - uint32 count = 0; - for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) - if (ihit->effectMask & (1<<effIndex)) - ++count; - - damage = 12000; // maybe wrong value - damage /= count; - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(42784); - - // now deal the damage - for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) - if (ihit->effectMask & (1<<effIndex)) - { - if (Unit* casttarget = Unit::GetUnit((*unitTarget), ihit->targetGUID)) - m_caster->DealDamage(casttarget, damage, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, spellInfo, false); - } - - return; - } - // Demon Broiled Surprise - case 43723: - { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; - - Player* player = (Player*)m_caster; - - if (player && player->GetQuestStatus(11379) == QUEST_STATUS_INCOMPLETE) - { - Creature* creature = player->FindNearestCreature(19973, 10, false); - if (!creature) - { - SendCastResult(SPELL_FAILED_NOT_HERE); - return; - } - - player->CastSpell(player, 43753, false); - } - return; - } - case 44875: // Complete Raptor Capture - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) - return; - - unitTarget->ToCreature()->DespawnOrUnsummon(); - - //cast spell Raptor Capture Credit - m_caster->CastSpell(m_caster, 42337, true, NULL); - return; - } - case 47170: // Impale Leviroth - { - if (!unitTarget || (unitTarget->GetEntry() != 26452 && unitTarget->HealthAbovePct(95))) - return; - - m_caster->DealDamage(unitTarget, unitTarget->CountPctFromMaxHealth(93)); - return; - } - case 49357: // Brewfest Mount Transformation - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; - if (!m_caster->HasAuraType(SPELL_AURA_MOUNTED)) - return; - m_caster->RemoveAurasByType(SPELL_AURA_MOUNTED); - // Ram for Alliance, Kodo for Horde - if (m_caster->ToPlayer()->GetTeam() == ALLIANCE) - { - if (m_caster->GetSpeedRate(MOVE_RUN) >= 2.0f) - // 100% Ram - m_caster->CastSpell(m_caster, 43900, true); - else - // 60% Ram - m_caster->CastSpell(m_caster, 43899, true); - } - else - { - if (m_caster->ToPlayer()->GetSpeedRate(MOVE_RUN) >= 2.0f) - // 100% Kodo - m_caster->CastSpell(m_caster, 49379, true); - else - // 60% Kodo - m_caster->CastSpell(m_caster, 49378, true); - } - return; - case 52845: // Brewfest Mount Transformation (Faction Swap) - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; - if (!m_caster->HasAuraType(SPELL_AURA_MOUNTED)) - return; - m_caster->RemoveAurasByType(SPELL_AURA_MOUNTED); - // Ram for Horde, Kodo for Alliance - if (m_caster->ToPlayer()->GetTeam() == HORDE) - { - if (m_caster->GetSpeedRate(MOVE_RUN) >= 2.0f) - // 100% Ram - m_caster->CastSpell(m_caster, 43900, true); - else - // 60% Ram - m_caster->CastSpell(m_caster, 43899, true); - } - else - { - if (m_caster->ToPlayer()->GetSpeedRate(MOVE_RUN) >= 2.0f) - // 100% Kodo - m_caster->CastSpell(m_caster, 49379, true); - else - // 60% Kodo - m_caster->CastSpell(m_caster, 49378, true); - } - return; - case 55004: // Nitro Boosts - if (!m_CastItem) - return; - if (roll_chance_i(95)) // Nitro Boosts - success - m_caster->CastSpell(m_caster, 54861, true, m_CastItem); - else // Knocked Up - backfire 5% - m_caster->CastSpell(m_caster, 46014, true, m_CastItem); - return; - case 50243: // Teach Language - { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; - - // spell has a 1/3 chance to trigger one of the below - if (roll_chance_i(66)) - return; - if (m_caster->ToPlayer()->GetTeam() == ALLIANCE) - { - // 1000001 - gnomish binary - m_caster->CastSpell(m_caster, 50242, true); - } - else - { - // 01001000 - goblin binary - m_caster->CastSpell(m_caster, 50246, true); - } - - return; - } - case 51582: //Rocket Boots Engaged (Rocket Boots Xtreme and Rocket Boots Xtreme Lite) - { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; - - if (Battleground* bg = m_caster->ToPlayer()->GetBattleground()) - bg->EventPlayerDroppedFlag(m_caster->ToPlayer()); - - m_caster->CastSpell(m_caster, 30452, true, NULL); - return; - } - case 52759: // Ancestral Awakening - if (!unitTarget) - return; - m_caster->CastCustomSpell(unitTarget, 52752, &damage, NULL, NULL, true); - return; - case 54171: // Divine Storm - { - if (m_UniqueTargetInfo.size()) - { - int32 heal = damage / m_UniqueTargetInfo.size(); - m_caster->CastCustomSpell(unitTarget, 54172, &heal, NULL, NULL, true); - } - return; - } - case 58418: // Portal to Orgrimmar - case 58420: // Portal to Stormwind - return; // implemented in EffectScript[0] - case 62324: // Throw Passenger - { - if (m_targets.HasTraj()) - { - if (Vehicle* vehicle = m_caster->GetVehicleKit()) - if (Unit* passenger = vehicle->GetPassenger(damage - 1)) - { - std::list<Unit*> unitList; - // use 99 because it is 3d search - SearchAreaTarget(unitList, 99, PUSH_DST_CENTER, SPELL_TARGETS_ENTRY, 33114); - float minDist = 99 * 99; - Unit* target = NULL; - for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr) - { - if (Vehicle* seat = (*itr)->GetVehicleKit()) - if (!seat->GetPassenger(0)) - if (Unit* device = seat->GetPassenger(2)) - if (!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) - { - float dist = (*itr)->GetExactDistSq(m_targets.GetDst()); - if (dist < minDist) - { - minDist = dist; - target = (*itr); - } - } - } - if (target && target->IsWithinDist2d(m_targets.GetDst(), m_spellInfo->Effects[effIndex].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct - passenger->EnterVehicle(target, 0); - else - { - passenger->ExitVehicle(); - float x, y, z; - m_targets.GetDst()->GetPosition(x, y, z); - passenger->GetMotionMaster()->MoveJump(x, y, z, m_targets.GetSpeedXY(), m_targets.GetSpeedZ()); - } - } - } - return; - } - case 64385: // Unusual Compass - { - m_caster->SetOrientation(float(urand(0, 62832)) / 10000.0f); - WorldPacket data; - m_caster->BuildHeartBeatMsg(&data); - m_caster->SendMessageToSet(&data, true); - return; - } - case 53808: // Pygmy Oil - { - Aura* pAura = m_caster->GetAura(53806); - if (pAura) - pAura->RefreshDuration(); - else - { - pAura = m_caster->GetAura(53805); - if (!pAura || pAura->GetStackAmount() < 5 || !roll_chance_i(50)) - m_caster->CastSpell(m_caster, 53805, true); - else - { - pAura->Remove(); - m_caster->CastSpell(m_caster, 53806, true); - } - } - return; - } - case 54577: // U.D.E.D. - { - if (unitTarget->GetEntry() != 29402) - return; - - m_caster->SummonGameObject(192693, unitTarget->GetPositionX(), unitTarget->GetPositionY(), - unitTarget->GetPositionZ(), unitTarget->GetOrientation(), 0, 0, 0, 0, 100); - - for (uint8 i = 0; i < 4; ++i) - m_caster->SummonGameObject(191567, float(unitTarget->GetPositionX() + irand(-7, 7)), - float(unitTarget->GetPositionY() + irand(-7, 7)), unitTarget->GetPositionZ(), unitTarget->GetOrientation(), - 0, 0, 0, 0, 100); - - unitTarget->Kill(unitTarget); - return; - } - case 51961: // Captured Chicken Cover - Quest 12702 & 12532 - { - if (m_caster->GetTypeId() != TYPEID_PLAYER - || !unitTarget->HasAura(51959) - || !(m_caster->ToPlayer()->GetQuestStatus(12702) == QUEST_STATUS_INCOMPLETE || m_caster->ToPlayer()->GetQuestStatus(12532) == QUEST_STATUS_INCOMPLETE)) - return; - - m_caster->CastSpell(m_caster, 51037, true); - unitTarget->Kill(unitTarget); - return; - } - } - - break; - } - case SPELLFAMILY_WARRIOR: - // Charge - if (m_spellInfo->SpellFamilyFlags & SPELLFAMILYFLAG_WARRIOR_CHARGE && m_spellInfo->SpellVisual[0] == 867) - { - int32 chargeBasePoints0 = damage; - m_caster->CastCustomSpell(m_caster, 34846, &chargeBasePoints0, NULL, NULL, true); - - //Juggernaut crit bonus - if (m_caster->HasAura(64976)) - m_caster->CastSpell(m_caster, 65156, true); - return; - } - // Slam - if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_WARRIOR_SLAM && m_spellInfo->SpellIconID == 559) - { - int32 bp0 = damage; - m_caster->CastCustomSpell(unitTarget, 50783, &bp0, NULL, NULL, true, 0); - return; - } - // Execute - if (m_spellInfo->SpellFamilyFlags[EFFECT_0] & SPELLFAMILYFLAG_WARRIOR_EXECUTE) - { - if (!unitTarget) - return; - - spell_id = 20647; - - int32 rageUsed = std::min<int32>(300 - m_powerCost, m_caster->GetPower(POWER_RAGE)); - int32 newRage = std::max<int32>(0, m_caster->GetPower(POWER_RAGE) - rageUsed); - - // Sudden Death rage save - if (AuraEffect* aurEff = m_caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, 1989, EFFECT_0)) - { - int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 10; - newRage = std::max(newRage, ragesave); - } - - m_caster->SetPower(POWER_RAGE, uint32(newRage)); - - // Glyph of Execution bonus - if (AuraEffect* aurEff = m_caster->GetAuraEffect(58367, EFFECT_0)) - rageUsed += aurEff->GetAmount() * 10; - - bp = damage + int32(rageUsed * m_spellInfo->Effects[effIndex].DamageMultiplier + m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.2f); - break; - } - // Concussion Blow - if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_WARRIOR_CONCUSSION_BLOW) - { - m_damage += CalculatePctF(damage, m_caster->GetTotalAttackPowerValue(BASE_ATTACK)); - return; - } - switch (m_spellInfo->Id) - { - // Bloodthirst - case 23881: - { - m_caster->CastCustomSpell(unitTarget, 23885, &damage, NULL, NULL, true, NULL); - return; - } - } - break; - case SPELLFAMILY_WARLOCK: - // Life Tap - if ((m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_WARLOCK_LIFETAP) && m_caster->ToPlayer()) - { - float spFactor = 0.0f; - switch (m_spellInfo->Id) - { - case 11689: spFactor = 0.2f; break; - case 27222: - case 57946: spFactor = 0.5f; break; - } - int32 damage = int32(m_spellInfo->Effects[EFFECT_0].CalcValue() + (6.3875 * m_spellInfo->BaseLevel)); - int32 mana = int32(damage + (m_caster->ToPlayer()->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * spFactor)); - - if (unitTarget && (int32(unitTarget->GetHealth()) > damage)) - { - // Shouldn't Appear in Combat Log - unitTarget->ModifyHealth(-damage); - - // Improved Life Tap mod - if (AuraEffect const* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 208, 0)) - AddPctN(mana, aurEff->GetAmount()); - - m_caster->CastCustomSpell(unitTarget, 31818, &mana, NULL, NULL, false); - - // Mana Feed - int32 manaFeedVal = 0; - if (AuraEffect const* aurEff = m_caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, 1982, 0)) - manaFeedVal = aurEff->GetAmount(); - - if (manaFeedVal > 0) - { - ApplyPctN(manaFeedVal, mana); - m_caster->CastCustomSpell(m_caster, 32553, &manaFeedVal, NULL, NULL, true, NULL); - } - } - else - SendCastResult(SPELL_FAILED_FIZZLE); - return; - } - break; - case SPELLFAMILY_DRUID: - // Starfall - if (m_spellInfo->SpellFamilyFlags[2] & SPELLFAMILYFLAG2_DRUID_STARFALL) - { - //Shapeshifting into an animal form or mounting cancels the effect. - if (m_caster->GetCreatureType() == CREATURE_TYPE_BEAST || m_caster->IsMounted()) - { - if (m_triggeredByAuraSpell) - m_caster->RemoveAurasDueToSpell(m_triggeredByAuraSpell->Id); - return; - } - - //Any effect which causes you to lose control of your character will supress the starfall effect. - if (m_caster->HasUnitState(UNIT_STATE_CONTROLLED)) - return; - - m_caster->CastSpell(unitTarget, damage, true); - return; - } - break; case SPELLFAMILY_PALADIN: switch (m_spellInfo->Id) { @@ -1378,128 +784,40 @@ void Spell::EffectDummy(SpellEffIndex effIndex) } } break; - case SPELLFAMILY_SHAMAN: - // Cleansing Totem Pulse - if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_SHAMAN_TOTEM_EFFECTS && m_spellInfo->SpellIconID == 1673) - { - int32 bp1 = 1; - // Cleansing Totem Effect - if (unitTarget) - m_caster->CastCustomSpell(unitTarget, 52025, NULL, &bp1, NULL, true, NULL, NULL, m_originalCasterGUID); - return; - } - // Healing Stream Totem - if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_SHAMAN_HEALING_STREAM) - { - if (!unitTarget) - return; - if (Unit* owner = m_caster->GetOwner()) - { - if (m_triggeredByAuraSpell) - damage = int32(owner->SpellHealingBonus(unitTarget, m_triggeredByAuraSpell, damage, HEAL)); - - // Restorative Totems - if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 338, 1)) - AddPctN(damage, dummy->GetAmount()); - - // Glyph of Healing Stream Totem - if (AuraEffect const* aurEff = owner->GetAuraEffect(55456, EFFECT_0)) - AddPctN(damage, aurEff->GetAmount()); - } - m_caster->CastCustomSpell(unitTarget, 52042, &damage, 0, 0, true, 0, 0, m_originalCasterGUID); - return; - } - // Mana Spring Totem - if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_SHAMAN_MANA_SPRING) - { - if (!unitTarget || unitTarget->getPowerType() != POWER_MANA) - return; - m_caster->CastCustomSpell(unitTarget, 52032, &damage, 0, 0, true, 0, 0, m_originalCasterGUID); - return; - } - // Lava Lash - if (m_spellInfo->SpellFamilyFlags[2] & SPELLFAMILYFLAG2_SHAMAN_LAVA_LASH) - { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; - - if (m_caster->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) - { - // Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue. - if (m_caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0)) - AddPctN(m_damage, damage); - } - return; - } - break; case SPELLFAMILY_DEATHKNIGHT: - // Death strike - if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_DK_DEATH_STRIKE) - { - uint32 count = unitTarget->GetDiseasesByCaster(m_caster->GetGUID()); - bp = int32(count * m_caster->CountPctFromMaxHealth(int32(m_spellInfo->Effects[EFFECT_0].DamageMultiplier))); - // Improved Death Strike - if (AuraEffect const* aurEff = m_caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, 2751, 0)) - AddPctN(bp, m_caster->CalculateSpellDamage(m_caster, aurEff->GetSpellInfo(), 2)); - m_caster->CastCustomSpell(m_caster, 45470, &bp, NULL, NULL, false); - return; - } - // Death Coil - if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_DK_DEATH_COIL) - { - if (m_caster->IsFriendlyTo(unitTarget)) - { - bp = int32(damage * 1.5f); - m_caster->CastCustomSpell(unitTarget, 47633, &bp, NULL, NULL, true); - } - else - { - bp = damage; - m_caster->CastCustomSpell(unitTarget, 47632, &bp, NULL, NULL, true); - } - return; - } switch (m_spellInfo->Id) { - case 49560: // Death Grip - Position pos; - GetSummonPosition(effIndex, pos); - if (Unit* unit = unitTarget->GetVehicleBase()) // what is this for? - unit->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), damage, true); - else if (!unitTarget->HasAuraType(SPELL_AURA_DEFLECT_SPELLS)) // Deterrence - unitTarget->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), damage, true); - return; - case 46584: // Raise Dead - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; + case 46584: // Raise Dead + if (m_caster->GetTypeId() != TYPEID_PLAYER) + return; - // Do we have talent Master of Ghouls? - if (m_caster->HasAura(52143)) - // summon as pet - bp = 52150; - else - // or guardian - bp = 46585; + // Do we have talent Master of Ghouls? + if (m_caster->HasAura(52143)) + // summon as pet + bp = 52150; + else + // or guardian + bp = 46585; - if (m_targets.HasDst()) - targets.SetDst(*m_targets.GetDst()); - else - { - targets.SetDst(*m_caster); - // Corpse not found - take reagents (only not triggered cast can take them) - triggered = false; - } - // Remove cooldown - summon spellls have category - m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true); - spell_id = 48289; - break; - // Raise dead - take reagents and trigger summon spells - case 48289: - if (m_targets.HasDst()) - targets.SetDst(*m_targets.GetDst()); + if (m_targets.HasDst()) + targets.SetDst(*m_targets.GetDst()); + else + { + targets.SetDst(*m_caster); + // Corpse not found - take reagents (only not triggered cast can take them) + triggered = false; + } + // Remove cooldown - summon spellls have category + m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true); + spell_id = 48289; + break; + // Raise dead - take reagents and trigger summon spells + case 48289: + if (m_targets.HasDst()) + targets.SetDst(*m_targets.GetDst()); - spell_id = CalculateDamage(0, NULL); - break; + spell_id = CalculateDamage(0, NULL); + break; } break; } @@ -3064,6 +2382,9 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) case 629: case 181: case 715: + case 1562: + case 833: + case 1161: numSummons = (damage > 0) ? damage : 1; break; default: diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index ad465767ab0..3365aad1cd9 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -20,6 +20,7 @@ #include "SpellMgr.h" #include "Spell.h" #include "DBCStores.h" +#include "ConditionMgr.h" uint32 GetTargetFlagMask(SpellTargetObjectTypes objType) { @@ -80,7 +81,7 @@ SpellTargetObjectTypes SpellImplicitTargetInfo::GetObjectType() const return _data[_target].ObjectType; } -SpellTargetSelectionCheckTypes SpellImplicitTargetInfo::GetSelectionCheckType() const +SpellTargetCheckTypes SpellImplicitTargetInfo::GetCheckType() const { return _data[_target].SelectionCheckType; } @@ -158,23 +159,25 @@ uint32 SpellImplicitTargetInfo::GetExplicitTargetMask(bool& srcSet, bool& dstSet case TARGET_OBJECT_TYPE_UNIT_AND_DEST: case TARGET_OBJECT_TYPE_UNIT: case TARGET_OBJECT_TYPE_DEST: - switch (GetSelectionCheckType()) + switch (GetCheckType()) { - case TARGET_SELECT_CHECK_ENEMY: + case TARGET_CHECK_ENEMY: targetMask = TARGET_FLAG_UNIT_ENEMY; break; - case TARGET_SELECT_CHECK_ALLY: + case TARGET_CHECK_ALLY: targetMask = TARGET_FLAG_UNIT_ALLY; break; - case TARGET_SELECT_CHECK_PARTY: + case TARGET_CHECK_PARTY: targetMask = TARGET_FLAG_UNIT_PARTY; break; - case TARGET_SELECT_CHECK_RAID: + case TARGET_CHECK_RAID: targetMask = TARGET_FLAG_UNIT_RAID; break; - case TARGET_SELECT_CHECK_PASSENGER: + case TARGET_CHECK_PASSENGER: targetMask = TARGET_FLAG_UNIT_PASSENGER; break; + case TARGET_CHECK_RAID_CLASS: + // nobreak; default: targetMask = TARGET_FLAG_UNIT; break; @@ -344,117 +347,117 @@ SpellSelectTargetTypes SpellImplicitTargetInfo::Type[TOTAL_SPELL_TARGETS]; SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_TARGETS] = { - {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 1 TARGET_UNIT_CASTER - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_SELECT_CHECK_ENEMY, TARGET_DIR_NONE}, // 2 TARGET_UNIT_NEARBY_ENEMY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_SELECT_CHECK_PARTY, TARGET_DIR_NONE}, // 3 TARGET_UNIT_NEARBY_PARTY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_SELECT_CHECK_ALLY, TARGET_DIR_NONE}, // 4 TARGET_UNIT_NEARBY_ALLY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 5 TARGET_UNIT_PET - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_ENEMY, TARGET_DIR_NONE}, // 6 TARGET_UNIT_TARGET_ENEMY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_ENTRY, TARGET_DIR_NONE}, // 7 TARGET_UNIT_SRC_AREA_ENTRY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_ENTRY, TARGET_DIR_NONE}, // 8 TARGET_UNIT_DEST_AREA_ENTRY - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 9 TARGET_DEST_HOME - {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 10 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 11 TARGET_UNIT_SRC_AREA_UNK_11 - {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 12 - {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 13 - {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 14 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_ENEMY, TARGET_DIR_NONE}, // 15 TARGET_UNIT_SRC_AREA_ENEMY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_ENEMY, TARGET_DIR_NONE}, // 16 TARGET_UNIT_DEST_AREA_ENEMY - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 17 TARGET_DEST_DB - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 18 TARGET_DEST_CASTER - {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 19 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_PARTY, TARGET_DIR_NONE}, // 20 TARGET_UNIT_CASTER_AREA_PARTY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_ALLY, TARGET_DIR_NONE}, // 21 TARGET_UNIT_TARGET_ALLY - {TARGET_OBJECT_TYPE_SRC, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 22 TARGET_SRC_CASTER - {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 23 TARGET_GAMEOBJECT_TARGET - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_SELECT_CHECK_ENEMY, TARGET_DIR_FRONT}, // 24 TARGET_UNIT_CONE_ENEMY_24 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 25 TARGET_UNIT_TARGET_ANY - {TARGET_OBJECT_TYPE_GOBJ_ITEM, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 26 TARGET_GAMEOBJECT_ITEM_TARGET - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 27 TARGET_UNIT_MASTER - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_ENEMY, TARGET_DIR_NONE}, // 28 TARGET_DEST_DYNOBJ_ENEMY - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_ALLY, TARGET_DIR_NONE}, // 29 TARGET_DEST_DYNOBJ_ALLY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_ALLY, TARGET_DIR_NONE}, // 30 TARGET_UNIT_SRC_AREA_ALLY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_ALLY, TARGET_DIR_NONE}, // 31 TARGET_UNIT_DEST_AREA_ALLY - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_FRONT_LEFT}, // 32 TARGET_DEST_CASTER_SUMMON - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_PARTY, TARGET_DIR_NONE}, // 33 TARGET_UNIT_SRC_AREA_PARTY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_PARTY, TARGET_DIR_NONE}, // 34 TARGET_UNIT_DEST_AREA_PARTY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_PARTY, TARGET_DIR_NONE}, // 35 TARGET_UNIT_TARGET_PARTY - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 36 TARGET_DEST_CASTER_UNK_36 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_LAST, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_PARTY, TARGET_DIR_NONE}, // 37 TARGET_UNIT_LASTTARGET_AREA_PARTY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_SELECT_CHECK_ENTRY, TARGET_DIR_NONE}, // 38 TARGET_UNIT_NEARBY_ENTRY - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 39 TARGET_DEST_CASTER_FISHING - {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_SELECT_CHECK_ENTRY, TARGET_DIR_NONE}, // 40 TARGET_GAMEOBJECT_NEARBY_ENTRY - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_FRONT_RIGHT}, // 41 TARGET_DEST_CASTER_FRONT_RIGHT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_BACK_RIGHT}, // 42 TARGET_DEST_CASTER_BACK_RIGHT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_BACK_LEFT}, // 43 TARGET_DEST_CASTER_BACK_LEFT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_FRONT_LEFT}, // 44 TARGET_DEST_CASTER_FRONT_LEFT - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_ALLY, TARGET_DIR_NONE}, // 45 TARGET_UNIT_TARGET_CHAINHEAL_ALLY - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_SELECT_CHECK_ENTRY, TARGET_DIR_NONE}, // 46 TARGET_DEST_NEARBY_ENTRY - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 47 TARGET_DEST_CASTER_FRONT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_BACK}, // 48 TARGET_DEST_CASTER_BACK - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_RIGHT}, // 49 TARGET_DEST_CASTER_RIGHT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_LEFT}, // 50 TARGET_DEST_CASTER_LEFT - {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 51 TARGET_GAMEOBJECT_SRC_AREA - {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 52 TARGET_GAMEOBJECT_DEST_AREA - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_ENEMY, TARGET_DIR_NONE}, // 53 TARGET_DEST_TARGET_ENEMY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_SELECT_CHECK_ENEMY, TARGET_DIR_FRONT}, // 54 TARGET_UNIT_CONE_ENEMY_54 - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 55 TARGET_DEST_CASTER_FRONT_LEAP - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_RAID, TARGET_DIR_NONE}, // 56 TARGET_UNIT_CASTER_AREA_RAID - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_RAID, TARGET_DIR_NONE}, // 57 TARGET_UNIT_TARGET_RAID - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_SELECT_CHECK_RAID, TARGET_DIR_NONE}, // 58 TARGET_UNIT_NEARBY_RAID - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_SELECT_CHECK_ALLY, TARGET_DIR_FRONT}, // 59 TARGET_UNIT_CONE_ALLY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_SELECT_CHECK_ENTRY, TARGET_DIR_FRONT}, // 60 TARGET_UNIT_CONE_ENTRY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CHECK_RAID, TARGET_DIR_NONE}, // 61 TARGET_UNIT_TARGET_AREA_RAID_CLASS - {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 62 TARGET_UNK_62 - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 63 TARGET_DEST_TARGET_ANY - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 64 TARGET_DEST_TARGET_FRONT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_BACK}, // 65 TARGET_DEST_TARGET_BACK - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_RIGHT}, // 66 TARGET_DEST_TARGET_RIGHT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_LEFT}, // 67 TARGET_DEST_TARGET_LEFT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_FRONT_RIGHT}, // 68 TARGET_DEST_TARGET_FRONT_RIGHT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_BACK_RIGHT}, // 69 TARGET_DEST_TARGET_BACK_RIGHT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_BACK_LEFT}, // 70 TARGET_DEST_TARGET_BACK_LEFT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_FRONT_LEFT}, // 71 TARGET_DEST_TARGET_FRONT_LEFT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 72 TARGET_DEST_CASTER_RANDOM - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 73 TARGET_DEST_CASTER_RADIUS - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 74 TARGET_DEST_TARGET_RANDOM - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 75 TARGET_DEST_TARGET_RADIUS - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CHANNEL, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 76 TARGET_DEST_CHANNEL_TARGET - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CHANNEL, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 77 TARGET_UNIT_CHANNEL_TARGET - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 78 TARGET_DEST_DEST_FRONT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_BACK}, // 79 TARGET_DEST_DEST_BACK - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_RIGHT}, // 80 TARGET_DEST_DEST_RIGHT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_LEFT}, // 81 TARGET_DEST_DEST_LEFT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_FRONT_RIGHT}, // 82 TARGET_DEST_DEST_FRONT_RIGHT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_BACK_RIGHT}, // 83 TARGET_DEST_DEST_BACK_RIGHT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_BACK_LEFT}, // 84 TARGET_DEST_DEST_BACK_LEFT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_FRONT_LEFT}, // 85 TARGET_DEST_DEST_FRONT_LEFT - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 86 TARGET_DEST_DEST_RANDOM - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 87 TARGET_DEST_DEST - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 88 TARGET_DEST_DYNOBJ_NONE - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 89 TARGET_DEST_TRAJ - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 90 TARGET_UNIT_TARGET_MINIPET - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 91 TARGET_DEST_DEST_RADIUS - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 92 TARGET_UNIT_SUMMONER - {TARGET_OBJECT_TYPE_CORPSE, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_ENEMY, TARGET_DIR_NONE}, // 93 TARGET_CORPSE_SRC_AREA_ENEMY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 94 TARGET_UNIT_VEHICLE - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_PASSENGER, TARGET_DIR_NONE}, // 95 TARGET_UNIT_TARGET_PASSENGER - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 96 TARGET_UNIT_PASSENGER_0 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 97 TARGET_UNIT_PASSENGER_1 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 98 TARGET_UNIT_PASSENGER_2 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 99 TARGET_UNIT_PASSENGER_3 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 100 TARGET_UNIT_PASSENGER_4 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 101 TARGET_UNIT_PASSENGER_5 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 102 TARGET_UNIT_PASSENGER_6 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 103 TARGET_UNIT_PASSENGER_7 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_SELECT_CHECK_ENEMY, TARGET_DIR_FRONT}, // 104 TARGET_UNIT_CONE_ENEMY_104 - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 105 TARGET_UNIT_UNK_105 - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CHANNEL, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 106 TARGET_DEST_CHANNEL_CASTER - {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 107 TARGET_UNK_DEST_AREA_UNK_107 - {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 108 TARGET_GAMEOBJECT_CONE - {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 109 - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_SELECT_CHECK_DEFAULT, TARGET_DIR_NONE}, // 110 TARGET_DEST_UNK_110 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 1 TARGET_UNIT_CASTER + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 2 TARGET_UNIT_NEARBY_ENEMY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_PARTY, TARGET_DIR_NONE}, // 3 TARGET_UNIT_NEARBY_PARTY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_ALLY, TARGET_DIR_NONE}, // 4 TARGET_UNIT_NEARBY_ALLY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 5 TARGET_UNIT_PET + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 6 TARGET_UNIT_TARGET_ENEMY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_ENTRY, TARGET_DIR_NONE}, // 7 TARGET_UNIT_SRC_AREA_ENTRY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_ENTRY, TARGET_DIR_NONE}, // 8 TARGET_UNIT_DEST_AREA_ENTRY + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 9 TARGET_DEST_HOME + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 10 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 11 TARGET_UNIT_SRC_AREA_UNK_11 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 12 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 13 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 14 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 15 TARGET_UNIT_SRC_AREA_ENEMY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 16 TARGET_UNIT_DEST_AREA_ENEMY + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 17 TARGET_DEST_DB + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 18 TARGET_DEST_CASTER + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 19 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_PARTY, TARGET_DIR_NONE}, // 20 TARGET_UNIT_CASTER_AREA_PARTY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_ALLY, TARGET_DIR_NONE}, // 21 TARGET_UNIT_TARGET_ALLY + {TARGET_OBJECT_TYPE_SRC, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 22 TARGET_SRC_CASTER + {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 23 TARGET_GAMEOBJECT_TARGET + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ENEMY, TARGET_DIR_FRONT}, // 24 TARGET_UNIT_CONE_ENEMY_24 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 25 TARGET_UNIT_TARGET_ANY + {TARGET_OBJECT_TYPE_GOBJ_ITEM, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 26 TARGET_GAMEOBJECT_ITEM_TARGET + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 27 TARGET_UNIT_MASTER + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 28 TARGET_DEST_DYNOBJ_ENEMY + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_ALLY, TARGET_DIR_NONE}, // 29 TARGET_DEST_DYNOBJ_ALLY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_ALLY, TARGET_DIR_NONE}, // 30 TARGET_UNIT_SRC_AREA_ALLY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_ALLY, TARGET_DIR_NONE}, // 31 TARGET_UNIT_DEST_AREA_ALLY + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT_LEFT}, // 32 TARGET_DEST_CASTER_SUMMON + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_PARTY, TARGET_DIR_NONE}, // 33 TARGET_UNIT_SRC_AREA_PARTY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_PARTY, TARGET_DIR_NONE}, // 34 TARGET_UNIT_DEST_AREA_PARTY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_PARTY, TARGET_DIR_NONE}, // 35 TARGET_UNIT_TARGET_PARTY + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 36 TARGET_DEST_CASTER_UNK_36 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_LAST, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_PARTY, TARGET_DIR_NONE}, // 37 TARGET_UNIT_LASTTARGET_AREA_PARTY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_ENTRY, TARGET_DIR_NONE}, // 38 TARGET_UNIT_NEARBY_ENTRY + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 39 TARGET_DEST_CASTER_FISHING + {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_ENTRY, TARGET_DIR_NONE}, // 40 TARGET_GAMEOBJECT_NEARBY_ENTRY + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT_RIGHT}, // 41 TARGET_DEST_CASTER_FRONT_RIGHT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_BACK_RIGHT}, // 42 TARGET_DEST_CASTER_BACK_RIGHT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_BACK_LEFT}, // 43 TARGET_DEST_CASTER_BACK_LEFT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT_LEFT}, // 44 TARGET_DEST_CASTER_FRONT_LEFT + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_ALLY, TARGET_DIR_NONE}, // 45 TARGET_UNIT_TARGET_CHAINHEAL_ALLY + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_ENTRY, TARGET_DIR_NONE}, // 46 TARGET_DEST_NEARBY_ENTRY + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 47 TARGET_DEST_CASTER_FRONT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_BACK}, // 48 TARGET_DEST_CASTER_BACK + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_RIGHT}, // 49 TARGET_DEST_CASTER_RIGHT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_LEFT}, // 50 TARGET_DEST_CASTER_LEFT + {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 51 TARGET_GAMEOBJECT_SRC_AREA + {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 52 TARGET_GAMEOBJECT_DEST_AREA + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 53 TARGET_DEST_TARGET_ENEMY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ENEMY, TARGET_DIR_FRONT}, // 54 TARGET_UNIT_CONE_ENEMY_54 + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 55 TARGET_DEST_CASTER_FRONT_LEAP + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_RAID, TARGET_DIR_NONE}, // 56 TARGET_UNIT_CASTER_AREA_RAID + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_RAID, TARGET_DIR_NONE}, // 57 TARGET_UNIT_TARGET_RAID + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_RAID, TARGET_DIR_NONE}, // 58 TARGET_UNIT_NEARBY_RAID + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ALLY, TARGET_DIR_FRONT}, // 59 TARGET_UNIT_CONE_ALLY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ENTRY, TARGET_DIR_FRONT}, // 60 TARGET_UNIT_CONE_ENTRY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_RAID_CLASS,TARGET_DIR_NONE}, // 61 TARGET_UNIT_TARGET_AREA_RAID_CLASS + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 62 TARGET_UNK_62 + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 63 TARGET_DEST_TARGET_ANY + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 64 TARGET_DEST_TARGET_FRONT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_BACK}, // 65 TARGET_DEST_TARGET_BACK + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_RIGHT}, // 66 TARGET_DEST_TARGET_RIGHT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_LEFT}, // 67 TARGET_DEST_TARGET_LEFT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT_RIGHT}, // 68 TARGET_DEST_TARGET_FRONT_RIGHT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_BACK_RIGHT}, // 69 TARGET_DEST_TARGET_BACK_RIGHT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_BACK_LEFT}, // 70 TARGET_DEST_TARGET_BACK_LEFT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT_LEFT}, // 71 TARGET_DEST_TARGET_FRONT_LEFT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 72 TARGET_DEST_CASTER_RANDOM + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 73 TARGET_DEST_CASTER_RADIUS + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 74 TARGET_DEST_TARGET_RANDOM + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 75 TARGET_DEST_TARGET_RADIUS + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CHANNEL, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 76 TARGET_DEST_CHANNEL_TARGET + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CHANNEL, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 77 TARGET_UNIT_CHANNEL_TARGET + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 78 TARGET_DEST_DEST_FRONT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_BACK}, // 79 TARGET_DEST_DEST_BACK + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_RIGHT}, // 80 TARGET_DEST_DEST_RIGHT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_LEFT}, // 81 TARGET_DEST_DEST_LEFT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT_RIGHT}, // 82 TARGET_DEST_DEST_FRONT_RIGHT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_BACK_RIGHT}, // 83 TARGET_DEST_DEST_BACK_RIGHT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_BACK_LEFT}, // 84 TARGET_DEST_DEST_BACK_LEFT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT_LEFT}, // 85 TARGET_DEST_DEST_FRONT_LEFT + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 86 TARGET_DEST_DEST_RANDOM + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 87 TARGET_DEST_DEST + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 88 TARGET_DEST_DYNOBJ_NONE + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 89 TARGET_DEST_TRAJ + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 90 TARGET_UNIT_TARGET_MINIPET + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 91 TARGET_DEST_DEST_RADIUS + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 92 TARGET_UNIT_SUMMONER + {TARGET_OBJECT_TYPE_CORPSE, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 93 TARGET_CORPSE_SRC_AREA_ENEMY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 94 TARGET_UNIT_VEHICLE + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_PASSENGER, TARGET_DIR_NONE}, // 95 TARGET_UNIT_TARGET_PASSENGER + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 96 TARGET_UNIT_PASSENGER_0 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 97 TARGET_UNIT_PASSENGER_1 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 98 TARGET_UNIT_PASSENGER_2 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 99 TARGET_UNIT_PASSENGER_3 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 100 TARGET_UNIT_PASSENGER_4 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 101 TARGET_UNIT_PASSENGER_5 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 102 TARGET_UNIT_PASSENGER_6 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 103 TARGET_UNIT_PASSENGER_7 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ENEMY, TARGET_DIR_FRONT}, // 104 TARGET_UNIT_CONE_ENEMY_104 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 105 TARGET_UNIT_UNK_105 + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CHANNEL, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 106 TARGET_DEST_CHANNEL_CASTER + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 107 TARGET_UNK_DEST_AREA_UNK_107 + {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 108 TARGET_GAMEOBJECT_CONE + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 109 + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 110 TARGET_DEST_UNK_110 }; SpellEffectInfo::SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex) @@ -481,6 +484,7 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* ItemType = spellEntry->EffectItemType[effIndex]; TriggerSpell = spellEntry->EffectTriggerSpell[effIndex]; SpellClassMask = spellEntry->EffectSpellClassMask[effIndex]; + ImplicitTargetConditions = NULL; } bool SpellEffectInfo::IsEffect() const @@ -938,6 +942,11 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) ChainEntry = NULL; } +SpellInfo::~SpellInfo() +{ + _UnloadImplicitTargetConditionLists(); +} + bool SpellInfo::HasEffect(SpellEffects effect) const { for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -1563,38 +1572,99 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a return SPELL_CAST_OK; } -SpellCastResult SpellInfo::CheckTarget(Unit const* caster, Unit const* target, bool implicit) const +SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* target, bool implicit) const { if (AttributesEx & SPELL_ATTR1_CANT_TARGET_SELF && caster == target) return SPELL_FAILED_BAD_TARGETS; - if (AttributesEx & SPELL_ATTR1_CANT_TARGET_IN_COMBAT && target->isInCombat()) - return SPELL_FAILED_TARGET_AFFECTING_COMBAT; + // check visibility - ignore stealth for implicit (area) targets + if (!(AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE) && !caster->canSeeOrDetect(target, implicit)) + return SPELL_FAILED_BAD_TARGETS; + + Unit const* unitTarget = target->ToUnit(); + + // creature/player specific target checks + if (unitTarget) + { + if (AttributesEx & SPELL_ATTR1_CANT_TARGET_IN_COMBAT && unitTarget->isInCombat()) + return SPELL_FAILED_TARGET_AFFECTING_COMBAT; + + // only spells with SPELL_ATTR3_ONLY_TARGET_GHOSTS can target ghosts + if (((AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_GHOSTS) != 0) != unitTarget->HasAuraType(SPELL_AURA_GHOST)) + { + if (AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_GHOSTS) + return SPELL_FAILED_TARGET_NOT_GHOST; + else + return SPELL_FAILED_BAD_TARGETS; + } + + if (caster != unitTarget) + { + if (caster->GetTypeId() == TYPEID_PLAYER) + { + // Do not allow these spells to target creatures not tapped by us (Banish, Polymorph, many quest spells) + if (AttributesEx2 & SPELL_ATTR2_CANT_TARGET_TAPPED) + if (Creature const* targetCreature = unitTarget->ToCreature()) + if (targetCreature->hasLootRecipient() && !targetCreature->isTappedBy(caster->ToPlayer())) + return SPELL_FAILED_CANT_CAST_ON_TAPPED; + + if (AttributesCu & SPELL_ATTR0_CU_PICKPOCKET) + { + if (unitTarget->GetTypeId() == TYPEID_PLAYER) + return SPELL_FAILED_BAD_TARGETS; + else if ((unitTarget->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) == 0) + return SPELL_FAILED_TARGET_NO_POCKETS; + } + + // Not allow disarm unarmed player + if (Mechanic == MECHANIC_DISARM) + { + if (unitTarget->GetTypeId() == TYPEID_PLAYER) + { + Player const* player = unitTarget->ToPlayer(); + if (!player->GetWeaponForAttack(BASE_ATTACK) || !player->IsUseEquipedWeapon(true)) + return SPELL_FAILED_TARGET_NO_WEAPONS; + } + else if (!unitTarget->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)) + return SPELL_FAILED_TARGET_NO_WEAPONS; + } + } + } + } + // corpse specific target checks + else if (Corpse const* corpseTarget = target->ToCorpse()) + { + // cannot target bare bones + if (corpseTarget->GetType() == CORPSE_BONES) + return SPELL_FAILED_BAD_TARGETS; + // we have to use owner for some checks (aura preventing resurrection for example) + if (Player* owner = ObjectAccessor::FindPlayer(corpseTarget->GetOwnerGUID())) + unitTarget = owner; + // we're not interested in corpses without owner + else + return SPELL_FAILED_BAD_TARGETS; + } + // other types of objects - always valid + else return SPELL_CAST_OK; - if (AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_PLAYERS && !target->ToPlayer()) + // corpseOwner and unit specific target checks + if (AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_PLAYERS && !unitTarget->ToPlayer()) return SPELL_FAILED_TARGET_NOT_PLAYER; - if (!IsAllowingDeadTarget() && !target->isAlive()) + if (!IsAllowingDeadTarget() && !unitTarget->isAlive()) return SPELL_FAILED_TARGETS_DEAD; - if (AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_GHOSTS && !(!target->isAlive() && target->HasAuraType(SPELL_AURA_GHOST))) - return SPELL_FAILED_TARGET_NOT_GHOST; - // check this flag only for implicit targets (chain and area), allow to explicitly target units for spells like Shield of Righteousness - if (implicit && AttributesEx6 & SPELL_ATTR6_CANT_TARGET_CROWD_CONTROLLED && !target->CanFreeMove()) + if (implicit && AttributesEx6 & SPELL_ATTR6_CANT_TARGET_CROWD_CONTROLLED && !unitTarget->CanFreeMove()) return SPELL_FAILED_BAD_TARGETS; - // check visibility - ignore stealth for implicit (area) targets - if (!(AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE) && !caster->canSeeOrDetect(target, implicit)) - return SPELL_FAILED_BAD_TARGETS; - // checked in Unit::IsValidAttack/AssistTarget, shouldn't be checked for ENTRY targets //if (!(AttributesEx6 & SPELL_ATTR6_CAN_TARGET_UNTARGETABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) // return SPELL_FAILED_BAD_TARGETS; //if (!(AttributesEx6 & SPELL_ATTR6_CAN_TARGET_POSSESSED_FRIENDS) - if (!CheckTargetCreatureType(target)) + if (!CheckTargetCreatureType(unitTarget)) { if (target->GetTypeId() == TYPEID_PLAYER) return SPELL_FAILED_TARGET_IS_PLAYER; @@ -1603,65 +1673,32 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, Unit const* target, b } // check GM mode and GM invisibility - only for player casts (npc casts are controlled by AI) and negative spells - if (target != caster && (caster->IsControlledByPlayer() || !IsPositive()) && target->GetTypeId() == TYPEID_PLAYER) + if (unitTarget != caster && (caster->IsControlledByPlayer() || !IsPositive()) && unitTarget->GetTypeId() == TYPEID_PLAYER) { - if (!target->ToPlayer()->IsVisible()) + if (!unitTarget->ToPlayer()->IsVisible()) return SPELL_FAILED_BM_OR_INVISGOD; - if (target->ToPlayer()->isGameMaster()) + if (unitTarget->ToPlayer()->isGameMaster()) return SPELL_FAILED_BM_OR_INVISGOD; } // not allow casting on flying player - if (target->HasUnitState(UNIT_STATE_IN_FLIGHT)) + if (unitTarget->HasUnitState(UNIT_STATE_IN_FLIGHT)) return SPELL_FAILED_BAD_TARGETS; - if (TargetAuraState && !target->HasAuraState(AuraStateType(TargetAuraState), this, caster)) + if (TargetAuraState && !unitTarget->HasAuraState(AuraStateType(TargetAuraState), this, caster)) return SPELL_FAILED_TARGET_AURASTATE; - if (TargetAuraStateNot && target->HasAuraState(AuraStateType(TargetAuraStateNot), this, caster)) + if (TargetAuraStateNot && unitTarget->HasAuraState(AuraStateType(TargetAuraStateNot), this, caster)) return SPELL_FAILED_TARGET_AURASTATE; - if (TargetAuraSpell && !target->HasAura(sSpellMgr->GetSpellIdForDifficulty(TargetAuraSpell, caster))) + if (TargetAuraSpell && !unitTarget->HasAura(sSpellMgr->GetSpellIdForDifficulty(TargetAuraSpell, caster))) return SPELL_FAILED_TARGET_AURASTATE; - if (ExcludeTargetAuraSpell && target->HasAura(sSpellMgr->GetSpellIdForDifficulty(ExcludeTargetAuraSpell, caster))) + if (ExcludeTargetAuraSpell && unitTarget->HasAura(sSpellMgr->GetSpellIdForDifficulty(ExcludeTargetAuraSpell, caster))) return SPELL_FAILED_TARGET_AURASTATE; - if (caster != target) - { - if (caster->GetTypeId() == TYPEID_PLAYER) - { - // Do not allow these spells to target creatures not tapped by us (Banish, Polymorph, many quest spells) - if (AttributesEx2 & SPELL_ATTR2_CANT_TARGET_TAPPED) - if (Creature const* targetCreature = target->ToCreature()) - if (targetCreature->hasLootRecipient() && !targetCreature->isTappedBy(caster->ToPlayer())) - return SPELL_FAILED_CANT_CAST_ON_TAPPED; - - if (AttributesCu & SPELL_ATTR0_CU_PICKPOCKET) - { - if (target->GetTypeId() == TYPEID_PLAYER) - return SPELL_FAILED_BAD_TARGETS; - else if ((target->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) == 0) - return SPELL_FAILED_TARGET_NO_POCKETS; - } - - // Not allow disarm unarmed player - if (Mechanic == MECHANIC_DISARM) - { - if (target->GetTypeId() == TYPEID_PLAYER) - { - Player const* player = target->ToPlayer(); - if (!player->GetWeaponForAttack(BASE_ATTACK) || !player->IsUseEquipedWeapon(true)) - return SPELL_FAILED_TARGET_NO_WEAPONS; - } - else if (!target->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)) - return SPELL_FAILED_TARGET_NO_WEAPONS; - } - } - } - - if (target->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION)) + if (unitTarget->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION)) if (HasEffect(SPELL_EFFECT_SELF_RESURRECT) || HasEffect(SPELL_EFFECT_RESURRECT) || HasEffect(SPELL_EFFECT_RESURRECT_NEW)) return SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED; @@ -2035,13 +2072,19 @@ float SpellInfo::GetMinRange(bool positive) const return RangeEntry->minRangeHostile; } -float SpellInfo::GetMaxRange(bool positive) const +float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const { if (!RangeEntry) return 0.0f; + float range; if (positive) - return RangeEntry->maxRangeFriend; - return RangeEntry->maxRangeHostile; + range = RangeEntry->maxRangeFriend; + else + range = RangeEntry->maxRangeHostile; + if (caster) + if (Player* modOwner = caster->GetSpellModOwner()) + modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell); + return range; } int32 SpellInfo::GetDuration() const @@ -2552,3 +2595,20 @@ bool SpellInfo::_IsPositiveTarget(uint32 targetA, uint32 targetB) return _IsPositiveTarget(targetB, 0); return true; } + +void SpellInfo::_UnloadImplicitTargetConditionLists() +{ + // find the same instances of ConditionList and delete them. + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + ConditionList* cur = Effects[i].ImplicitTargetConditions; + if (!cur) + continue; + for (uint8 j = i; j < MAX_SPELL_EFFECTS; ++j) + { + if (Effects[j].ImplicitTargetConditions == cur) + Effects[j].ImplicitTargetConditions = NULL; + } + delete cur; + } +} diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 65be5981c64..69ea07f7563 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -36,6 +36,7 @@ struct SpellRangeEntry; struct SpellRadiusEntry; struct SpellEntry; struct SpellCastTimesEntry; +struct Condition; enum SpellCastTargetFlags { @@ -105,15 +106,16 @@ enum SpellTargetObjectTypes TARGET_OBJECT_TYPE_CORPSE_ALLY, }; -enum SpellTargetSelectionCheckTypes +enum SpellTargetCheckTypes { - TARGET_SELECT_CHECK_DEFAULT, - TARGET_SELECT_CHECK_ENTRY, - TARGET_SELECT_CHECK_ENEMY, - TARGET_SELECT_CHECK_ALLY, - TARGET_SELECT_CHECK_PARTY, - TARGET_SELECT_CHECK_RAID, - TARGET_SELECT_CHECK_PASSENGER, + TARGET_CHECK_DEFAULT, + TARGET_CHECK_ENTRY, + TARGET_CHECK_ENEMY, + TARGET_CHECK_ALLY, + TARGET_CHECK_PARTY, + TARGET_CHECK_RAID, + TARGET_CHECK_RAID_CLASS, + TARGET_CHECK_PASSENGER, }; enum SpellTargetDirectionTypes @@ -220,7 +222,7 @@ public: SpellTargetSelectionCategories GetSelectionCategory() const; SpellTargetReferenceTypes GetReferenceType() const; SpellTargetObjectTypes GetObjectType() const; - SpellTargetSelectionCheckTypes GetSelectionCheckType() const; + SpellTargetCheckTypes GetCheckType() const; SpellTargetDirectionTypes GetDirectionType() const; float CalcDirectionAngle() const; @@ -240,7 +242,7 @@ private: SpellTargetObjectTypes ObjectType; // type of object returned by target type SpellTargetReferenceTypes ReferenceType; // defines which object is used as a reference when selecting target SpellTargetSelectionCategories SelectionCategory; - SpellTargetSelectionCheckTypes SelectionCheckType; // defines selection criteria + SpellTargetCheckTypes SelectionCheckType; // defines selection criteria SpellTargetDirectionTypes DirectionType; // direction for cone and dest targets }; static StaticData _data[TOTAL_SPELL_TARGETS]; @@ -271,6 +273,7 @@ public: uint32 ItemType; uint32 TriggerSpell; flag96 SpellClassMask; + std::list<Condition*>* ImplicitTargetConditions; SpellEffectInfo() {} SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex); @@ -388,6 +391,7 @@ public: SpellChainNode const* ChainEntry; SpellInfo(SpellEntry const* spellEntry); + ~SpellInfo(); bool HasEffect(SpellEffects effect) const; bool HasAura(AuraType aura) const; @@ -438,7 +442,7 @@ public: SpellCastResult CheckShapeshift(uint32 form) const; SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player = NULL) const; - SpellCastResult CheckTarget(Unit const* caster, Unit const* target, bool implicit = true) const; + SpellCastResult CheckTarget(Unit const* caster, WorldObject const* target, bool implicit = true) const; SpellCastResult CheckExplicitTarget(Unit const* caster, WorldObject const* target, Item const* itemTarget = NULL) const; bool CheckTargetCreatureType(Unit const* target) const; @@ -456,7 +460,7 @@ public: SpellSpecificType GetSpellSpecific() const; float GetMinRange(bool positive = false) const; - float GetMaxRange(bool positive = false) const; + float GetMaxRange(bool positive = false, Unit* caster = NULL, Spell* spell = NULL) const; int32 GetDuration() const; int32 GetMaxDuration() const; @@ -482,6 +486,9 @@ public: bool _IsPositiveEffect(uint8 effIndex, bool deep) const; bool _IsPositiveSpell() const; static bool _IsPositiveTarget(uint32 targetA, uint32 targetB); + + // unloading helpers + void _UnloadImplicitTargetConditionLists(); }; #endif // _SPELLINFO_H diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index ff4eaae42f2..c1b267d9fac 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2644,11 +2644,20 @@ void SpellMgr::UnloadSpellInfoStore() for (uint32 i = 0; i < mSpellInfoMap.size(); ++i) { if (mSpellInfoMap[i]) - delete mSpellInfoMap[i]; + delete mSpellInfoMap[i]; } mSpellInfoMap.clear(); } +void SpellMgr::UnloadSpellInfoImplicitTargetConditionLists() +{ + for (uint32 i = 0; i < mSpellInfoMap.size(); ++i) + { + if (mSpellInfoMap[i]) + mSpellInfoMap[i]->_UnloadImplicitTargetConditionLists(); + } +} + void SpellMgr::LoadSpellCustomAttr() { uint32 oldMSTime = getMSTime(); diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 14137b6a91b..9fffd474651 100755 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -360,17 +360,6 @@ struct SpellThreatEntry typedef std::map<uint32, SpellThreatEntry> SpellThreatMap; -// Spell script target related declarations (accessed using SpellMgr functions) -enum SpellScriptTargetType -{ - SPELL_TARGET_TYPE_GAMEOBJECT = 0, - SPELL_TARGET_TYPE_CREATURE = 1, - SPELL_TARGET_TYPE_DEAD = 2, - SPELL_TARGET_TYPE_CONTROLLED = 3, -}; - -#define MAX_SPELL_TARGET_TYPE 4 - // coordinates for spells (accessed using SpellMgr functions) struct SpellTargetPosition { @@ -726,6 +715,7 @@ class SpellMgr void LoadSpellAreas(); void LoadSpellInfoStore(); void UnloadSpellInfoStore(); + void UnloadSpellInfoImplicitTargetConditionLists(); void LoadSpellCustomAttr(); void LoadDbcDataCorrections(); diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 8a58ce3c52a..03fea614c0d 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -468,6 +468,11 @@ void SpellScript::PreventHitAura() m_spell->m_spellAura->Remove(); } +void SpellScript::GetSummonPosition(uint32 i, Position &pos, float radius = 0.0f, uint32 count = 0) +{ + m_spell->GetSummonPosition(i, pos, radius, count); +} + void SpellScript::PreventHitEffect(SpellEffIndex effIndex) { if (!IsInHitPhase() && !IsInEffectHook()) diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 945a62674d9..1bf8d25adef 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -21,6 +21,7 @@ #include "Util.h" #include "SharedDefines.h" #include "SpellAuraDefines.h" +#include "Spell.h" #include <stack> class Unit; @@ -333,7 +334,8 @@ class SpellScript : public _SpellScript int32 GetHitHeal(); void SetHitHeal(int32 heal); void PreventHitHeal() { SetHitHeal(0); } - + Spell* GetSpell() { return m_spell; } + void GetSummonPosition(uint32 i, Position &pos, float radius, uint32 count); // returns current spell hit target aura Aura* GetHitAura(); // prevents applying aura on current spell hit target diff --git a/src/server/game/Warden/Modules/WardenModuleMac.h b/src/server/game/Warden/Modules/WardenModuleMac.h new file mode 100644 index 00000000000..46011c5bcd9 --- /dev/null +++ b/src/server/game/Warden/Modules/WardenModuleMac.h @@ -0,0 +1,614 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _WARDEN_MODULE_MAC_H +#define _WARDEN_MODULE_MAC_H + +uint8 Module_0DBBF209A27B1E279A9FEC5C168A15F7_Data[9318] = +{ + 0x07, 0x0C, 0x44, 0xCD, 0xC9, 0xFB, 0x99, 0xBC, 0x7C, 0x77, 0xDC, 0xE8, 0x8D, 0x07, 0xBE, 0x55, + 0x37, 0x5C, 0x84, 0x10, 0x23, 0xE1, 0x36, 0x5B, 0xF1, 0xBC, 0x60, 0xF3, 0x68, 0xBA, 0x60, 0x69, + 0xDF, 0x48, 0x54, 0xFF, 0x49, 0x1F, 0xA6, 0x28, 0x08, 0x5A, 0x77, 0xFE, 0x4C, 0x3A, 0x9A, 0x28, + 0xA5, 0x9E, 0x01, 0x93, 0x05, 0xE4, 0xCD, 0x26, 0x41, 0xD7, 0xD6, 0x73, 0x81, 0xFD, 0xF5, 0xDB, + 0xA5, 0xF7, 0xF9, 0x1D, 0xFE, 0xF4, 0x06, 0x7C, 0xD0, 0xF8, 0x5A, 0xE8, 0x11, 0xFF, 0xE5, 0xF9, + 0x54, 0x49, 0xF7, 0xF0, 0xF8, 0x66, 0x22, 0x97, 0xA4, 0xB2, 0x86, 0xFE, 0xA6, 0x3A, 0x7F, 0x3B, + 0xF6, 0x47, 0xB4, 0x14, 0xEB, 0x9E, 0xC9, 0xEA, 0x0B, 0x41, 0xB4, 0x5B, 0xC2, 0xFB, 0x63, 0x1C, + 0x46, 0xC4, 0xAB, 0x3F, 0x30, 0x70, 0x7F, 0x35, 0xA3, 0xD2, 0x1A, 0xDE, 0x36, 0x79, 0x02, 0x05, + 0x0E, 0x47, 0xFF, 0xDF, 0x1F, 0xB7, 0xE0, 0x11, 0x7F, 0xB8, 0x43, 0x8C, 0x46, 0xF0, 0x4D, 0x39, + 0x83, 0x7C, 0x44, 0xE7, 0xD0, 0x02, 0x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 0xDC, 0x18, 0x60, 0x2F, 0x71, 0x2D, 0xEB, 0xF5, 0x1A, 0x4D, 0xFE, 0xB3, 0x49, 0x37, 0xFE, + 0xC5, 0x7F, 0x6C, 0xEE, 0x17, 0x48, 0xF5, 0xED, 0xA7, 0xB9, 0x95, 0x0B, 0x61, 0x2E, 0x2C, 0x87, + 0xA7, 0x5D, 0xA5, 0xAC, 0x89, 0xEC, 0x11, 0x0C, 0xD5, 0xCD, 0xE1, 0xB6, 0x9C, 0x4B, 0x8F, 0xCF, + 0x21, 0x75, 0xA1, 0x1B, 0x35, 0x41, 0x4D, 0x4E, 0x9B, 0xDE, 0xE2, 0xE8, 0x0E, 0x23, 0x9A, 0x9A, + 0x2B, 0xAC, 0x41, 0x6E, 0xEF, 0xD1, 0xAC, 0x7E, 0x74, 0xB7, 0x16, 0x83, 0x10, 0x85, 0x84, 0x60, + 0x28, 0xF0, 0xD1, 0xA0, 0x5E, 0xB7, 0x8E, 0xEF, 0x7B, 0x4C, 0x27, 0xAF, 0x8A, 0x9E, 0x3F, 0x29, + 0x1B, 0x12, 0x01, 0x07, 0xF1, 0xAA, 0xFE, 0x2E, 0xFF, 0x18, 0x9A, 0xCD, 0xF4, 0x0E, 0xC1, 0x74, + 0x6D, 0xD4, 0xCE, 0xF3, 0xF9, 0x3C, 0xE2, 0x12, 0x03, 0x07, 0x1B, 0x9D, 0x3D, 0x6E, 0xD9, 0x79, + 0xB3, 0x56, 0x14, 0xC5, 0xEA, 0x06, 0xD1, 0xAD, 0x2C, 0x07, 0x58, 0x90, 0x0E, 0x80, 0x6B, 0x60, + 0x43, 0x82, 0xAA, 0x0C, 0xEE, 0x1B +}; + +uint8 Module_0DBBF209A27B1E279A9FEC5C168A15F7_Key[16] = +{ + 0x5B, 0x27, 0x27, 0x01, 0x24, 0x56, 0xB4, 0xD4, 0x2D, 0xD0, 0x96, 0x77, 0x49, 0x51, 0xDC, 0x0A +}; + +#endif diff --git a/src/server/game/Warden/Modules/WardenModuleWin.h b/src/server/game/Warden/Modules/WardenModuleWin.h new file mode 100644 index 00000000000..ca61a270a81 --- /dev/null +++ b/src/server/game/Warden/Modules/WardenModuleWin.h @@ -0,0 +1,1204 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _WARDEN_MODULE_WIN_H +#define _WARDEN_MODULE_WIN_H + +uint8 Module_79C0768D657977D697E10BAD956CCED1_Data[18756] = +{ + 0x21, 0x6C, 0xBB, 0x6A, 0xB9, 0xAF, 0xE8, 0xA1, 0x9A, 0x79, 0x18, 0xF1, 0x27, 0x9A, 0x14, 0xF5, + 0x42, 0x5D, 0x00, 0xBA, 0x74, 0x57, 0x0E, 0xAF, 0xD2, 0xAE, 0x8E, 0x51, 0xA5, 0xC1, 0x17, 0x4E, + 0xEC, 0x7F, 0xAC, 0xBC, 0xDD, 0x42, 0x87, 0xA6, 0xF9, 0xC1, 0x4A, 0xCE, 0xB5, 0xDD, 0xB3, 0xF8, + 0x06, 0x52, 0x9D, 0xF2, 0xAE, 0x2A, 0x49, 0x2B, 0x7B, 0x72, 0x5F, 0x40, 0x01, 0x16, 0xDB, 0x98, + 0x77, 0x1F, 0xE3, 0x61, 0x5A, 0x99, 0x39, 0x66, 0x2F, 0x2F, 0x35, 0xBF, 0x00, 0x20, 0xE4, 0xE0, + 0x8F, 0x98, 0xAD, 0xFC, 0xDB, 0x7D, 0xDD, 0xE8, 0x7A, 0xE9, 0x21, 0x6C, 0x86, 0x80, 0x3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DF, 0xC7, 0x26, 0x4D, 0x8E, 0x81, 0x98, 0x19, + 0x15, 0xD0, 0x4C, 0xB8, 0x44, 0xF7, 0x53, 0x1C, 0x0F, 0xAF, 0x78, 0x4C, 0x20, 0xB8, 0xCC, 0xBB, + 0x20, 0x60, 0xEC, 0x55, 0x70, 0xBD, 0xE9, 0x02, 0x63, 0x9F, 0x1F, 0xA7, 0xD5, 0x27, 0x18, 0x33, + 0x29, 0xA8, 0x33, 0x6E, 0xCB, 0x80, 0x40, 0x2D, 0x52, 0xDF, 0x6C, 0x78, 0x8F, 0xA6, 0x1D, 0xCF, + 0xE8, 0xB9, 0x54, 0x6B +}; + +uint8 Module_79C0768D657977D697E10BAD956CCED1_Key[16] = +{ + 0xAE, 0x25, 0xBC, 0x51, 0x06, 0x3B, 0x77, 0xBD, 0x36, 0x3C, 0x3E, 0xFE, 0x0F, 0xC1, 0x73, 0xF9 +}; + +#endif diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp new file mode 100644 index 00000000000..3d625df63d0 --- /dev/null +++ b/src/server/game/Warden/Warden.cpp @@ -0,0 +1,234 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "Common.h" +#include "WorldPacket.h" +#include "WorldSession.h" +#include "Log.h" +#include "Opcodes.h" +#include "ByteBuffer.h" +#include <openssl/md5.h> +#include <openssl/sha.h> +#include "World.h" +#include "Player.h" +#include "Util.h" +#include "Warden.h" +#include "AccountMgr.h" + +Warden::Warden() : _inputCrypto(16), _outputCrypto(16), _checkTimer(10000/*10 sec*/), _clientResponseTimer(0), _dataSent(false), _initialized(false) +{ +} + +Warden::~Warden() +{ + delete[] _module->CompressedData; + delete _module; + _module = NULL; + _initialized = false; +} + +void Warden::SendModuleToClient() +{ + sLog->outDebug(LOG_FILTER_WARDEN, "Send module to client"); + + // Create packet structure + WardenModuleTransfer packet; + + uint32 sizeLeft = _module->CompressedSize; + uint32 pos = 0; + uint16 burstSize; + while (sizeLeft > 0) + { + burstSize = sizeLeft < 500 ? sizeLeft : 500; + packet.Command = WARDEN_SMSG_MODULE_CACHE; + packet.DataSize = burstSize; + memcpy(packet.Data, &_module->CompressedData[pos], burstSize); + sizeLeft -= burstSize; + pos += burstSize; + + EncryptData((uint8*)&packet, burstSize + 3); + WorldPacket pkt1(SMSG_WARDEN_DATA, burstSize + 3); + pkt1.append((uint8*)&packet, burstSize + 3); + _session->SendPacket(&pkt1); + } +} + +void Warden::RequestModule() +{ + sLog->outDebug(LOG_FILTER_WARDEN, "Request module"); + + // Create packet structure + WardenModuleUse request; + request.Command = WARDEN_SMSG_MODULE_USE; + + memcpy(request.ModuleId, _module->Id, 16); + memcpy(request.ModuleKey, _module->Key, 16); + request.Size = _module->CompressedSize; + + // Encrypt with warden RC4 key. + EncryptData((uint8*)&request, sizeof(WardenModuleUse)); + + WorldPacket pkt(SMSG_WARDEN_DATA, sizeof(WardenModuleUse)); + pkt.append((uint8*)&request, sizeof(WardenModuleUse)); + _session->SendPacket(&pkt); +} + +void Warden::Update() +{ + if (_initialized) + { + uint32 currentTimestamp = getMSTime(); + uint32 diff = currentTimestamp - _previousTimestamp; + _previousTimestamp = currentTimestamp; + + if (_dataSent) + { + uint32 maxClientResponseDelay = sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_RESPONSE_DELAY); + + if (maxClientResponseDelay > 0) + { + // Kick player if client response delays more than set in config + if (_clientResponseTimer > maxClientResponseDelay * IN_MILLISECONDS) + { + sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u, latency: %u, IP: %s) exceeded Warden module response delay for more than %s - disconnecting client", + _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), _session->GetLatency(), _session->GetRemoteAddress().c_str(), + secsToTimeString(maxClientResponseDelay, true).c_str()); + _session->KickPlayer(); + } + else + _clientResponseTimer += diff; + } + } + else + { + if (diff >= _checkTimer) + { + RequestData(); + } + else + _checkTimer -= diff; + } + } +} + +void Warden::DecryptData(uint8* buffer, uint32 length) +{ + _inputCrypto.UpdateData(length, buffer); +} + +void Warden::EncryptData(uint8* buffer, uint32 length) +{ + _outputCrypto.UpdateData(length, buffer); +} + +bool Warden::IsValidCheckSum(uint32 checksum, const uint8* data, const uint16 length) +{ + uint32 newChecksum = BuildChecksum(data, length); + + if (checksum != newChecksum) + { + sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM IS NOT VALID"); + return false; + } + else + { + sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM IS VALID"); + return true; + } +} + +uint32 Warden::BuildChecksum(const uint8* data, uint32 length) +{ + uint8 hash[20]; + SHA1(data, length, hash); + uint32 checkSum = 0; + for (uint8 i = 0; i < 5; ++i) + checkSum = checkSum ^ *(uint32*)(&hash[0] + i * 4); + + return checkSum; +} + +std::string Warden::Penalty(WardenCheck* check /*= NULL*/) +{ + WardenActions action; + + if (check) + action = check->Action; + else + action = WardenActions(sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_FAIL_ACTION)); + + switch (action) + { + case WARDEN_ACTION_LOG: + return "None"; + break; + case WARDEN_ACTION_KICK: + _session->KickPlayer(); + return "Kick"; + break; + case WARDEN_ACTION_BAN: + { + std::stringstream duration; + duration << sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_BAN_DURATION) << "s"; + std::string accountName; + AccountMgr::GetName(_session->GetAccountId(), accountName); + sWorld->BanAccount(BAN_ACCOUNT, accountName, duration.str(), "Warden Anticheat violation","Server"); + + return "Ban"; + break; + } + default: + return "Undefined"; + break; + } +} + +void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) +{ + _warden->DecryptData(const_cast<uint8*>(recvData.contents()), recvData.size()); + uint8 opcode; + recvData >> opcode; + sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, recvData.size()); + recvData.hexlike(); + + switch(opcode) + { + case WARDEN_CMSG_MODULE_MISSING: + _warden->SendModuleToClient(); + break; + case WARDEN_CMSG_MODULE_OK: + _warden->RequestHash(); + break; + case WARDEN_CMSG_CHEAT_CHECKS_RESULT: + _warden->HandleData(recvData); + break; + case WARDEN_CMSG_MEM_CHECKS_RESULT: + sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MEM_CHECKS_RESULT received!"); + break; + case WARDEN_CMSG_HASH_RESULT: + _warden->HandleHashResult(recvData); + _warden->InitializeModule(); + break; + case WARDEN_CMSG_MODULE_FAILED: + sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MODULE_FAILED received!"); + break; + default: + sLog->outDebug(LOG_FILTER_WARDEN, "Got unknown warden opcode %02X of size %u.", opcode, recvData.size() - 1); + break; + } +} diff --git a/src/server/game/Warden/Warden.h b/src/server/game/Warden/Warden.h new file mode 100644 index 00000000000..e06ea7dca25 --- /dev/null +++ b/src/server/game/Warden/Warden.h @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _WARDEN_BASE_H +#define _WARDEN_BASE_H + +#include <map> +#include "Cryptography/ARC4.h" +#include "Cryptography/BigNumber.h" +#include "ByteBuffer.h" +#include "WardenCheckMgr.h" + +enum WardenOpcodes +{ + // Client->Server + WARDEN_CMSG_MODULE_MISSING = 0, + WARDEN_CMSG_MODULE_OK = 1, + WARDEN_CMSG_CHEAT_CHECKS_RESULT = 2, + WARDEN_CMSG_MEM_CHECKS_RESULT = 3, // only sent if MEM_CHECK bytes doesn't match + WARDEN_CMSG_HASH_RESULT = 4, + WARDEN_CMSG_MODULE_FAILED = 5, // this is sent when client failed to load uploaded module due to cache fail + + // Server->Client + WARDEN_SMSG_MODULE_USE = 0, + WARDEN_SMSG_MODULE_CACHE = 1, + WARDEN_SMSG_CHEAT_CHECKS_REQUEST = 2, + WARDEN_SMSG_MODULE_INITIALIZE = 3, + WARDEN_SMSG_MEM_CHECKS_REQUEST = 4, // byte len; while(!EOF) { byte unk(1); byte index(++); string module(can be 0); int offset; byte len; byte[] bytes_to_compare[len]; } + WARDEN_SMSG_HASH_REQUEST = 5 +}; + +enum WardenCheckType +{ + MEM_CHECK = 0xF3, // 243: byte moduleNameIndex + uint Offset + byte Len (check to ensure memory isn't modified) + PAGE_CHECK_A = 0xB2, // 178: uint Seed + byte[20] SHA1 + uint Addr + byte Len (scans all pages for specified hash) + PAGE_CHECK_B = 0xBF, // 191: uint Seed + byte[20] SHA1 + uint Addr + byte Len (scans only pages starts with MZ+PE headers for specified hash) + MPQ_CHECK = 0x98, // 152: byte fileNameIndex (check to ensure MPQ file isn't modified) + LUA_STR_CHECK = 0x8B, // 139: byte luaNameIndex (check to ensure LUA string isn't used) + DRIVER_CHECK = 0x71, // 113: uint Seed + byte[20] SHA1 + byte driverNameIndex (check to ensure driver isn't loaded) + TIMING_CHECK = 0x57, // 87: empty (check to ensure GetTickCount() isn't detoured) + PROC_CHECK = 0x7E, // 126: uint Seed + byte[20] SHA1 + byte moluleNameIndex + byte procNameIndex + uint Offset + byte Len (check to ensure proc isn't detoured) + MODULE_CHECK = 0xD9, // 217: uint Seed + byte[20] SHA1 (check to ensure module isn't injected) +}; + +#if defined(__GNUC__) +#pragma pack(1) +#else +#pragma pack(push,1) +#endif + +struct WardenModuleUse +{ + uint8 Command; + uint8 ModuleId[16]; + uint8 ModuleKey[16]; + uint32 Size; +}; + +struct WardenModuleTransfer +{ + uint8 Command; + uint16 DataSize; + uint8 Data[500]; +}; + +struct WardenHashRequest +{ + uint8 Command; + uint8 Seed[16]; +}; + +#if defined(__GNUC__) +#pragma pack() +#else +#pragma pack(pop) +#endif + +struct ClientWardenModule +{ + uint8 Id[16]; + uint8 Key[16]; + uint32 CompressedSize; + uint8* CompressedData; +}; + +class WorldSession; + +class Warden +{ + friend class WardenWin; + friend class WardenMac; + + public: + Warden(); + ~Warden(); + + virtual void Init(WorldSession* session, BigNumber* k) = 0; + virtual ClientWardenModule* GetModuleForClient() = 0; + virtual void InitializeModule() = 0; + virtual void RequestHash() = 0; + virtual void HandleHashResult(ByteBuffer &buff) = 0; + virtual void RequestData() = 0; + virtual void HandleData(ByteBuffer &buff) = 0; + + void SendModuleToClient(); + void RequestModule(); + void Update(); + void DecryptData(uint8* buffer, uint32 length); + void EncryptData(uint8* buffer, uint32 length); + + static bool IsValidCheckSum(uint32 checksum, const uint8 *data, const uint16 length); + static uint32 BuildChecksum(const uint8 *data, uint32 length); + + // If no check is passed, the default action from config is executed + std::string Penalty(WardenCheck* check = NULL); + + private: + WorldSession* _session; + uint8 _inputKey[16]; + uint8 _outputKey[16]; + uint8 _seed[16]; + ARC4 _inputCrypto; + ARC4 _outputCrypto; + uint32 _checkTimer; // Timer for sending check requests + uint32 _clientResponseTimer; // Timer for client response delay + bool _dataSent; + uint32 _previousTimestamp; + ClientWardenModule* _module; + bool _initialized; +}; + +#endif diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp new file mode 100644 index 00000000000..77332bd30a8 --- /dev/null +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -0,0 +1,196 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "Common.h" +#include "WorldPacket.h" +#include "WorldSession.h" +#include "Log.h" +#include "Database/DatabaseEnv.h" +#include "Util.h" +#include "WardenCheckMgr.h" +#include "Warden.h" + + +WardenCheckMgr::WardenCheckMgr() +{ + InternalDataID = 1; +} + +WardenCheckMgr::~WardenCheckMgr() +{ + for (uint16 i = 0; i < CheckStore.size(); ++i) + delete CheckStore[i]; + + for (CheckResultContainer::iterator itr = CheckResultStore.begin(); itr != CheckResultStore.end(); ++itr) + delete itr->second; +} + +void WardenCheckMgr::LoadWardenChecks() +{ + // Check if Warden is enabled by config before loading anything + if (!sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED)) + { + sLog->outString(">> Warden disabled, loading checks skipped."); + sLog->outString(); + return; + } + + // For reload case + for (uint16 i = 0; i < CheckStore.size(); ++i) + delete CheckStore[i]; + + CheckStore.clear(); + + for (CheckResultContainer::iterator itr = CheckResultStore.begin(); itr != CheckResultStore.end(); ++itr) + delete itr->second; + CheckResultStore.clear(); + + + QueryResult result = WorldDatabase.Query("SELECT MAX(id) FROM warden_checks"); + + if (!result) + { + sLog->outString(">> Loaded 0 Warden checks. DB table `warden_checks` is empty!"); + sLog->outString(); + return; + } + + Field* fields = result->Fetch(); + + uint32 maxCheckId = fields[0].GetUInt32(); + + CheckStore.resize(maxCheckId + 1); + + // 0 1 2 3 4 5 6 + result = WorldDatabase.Query("SELECT id, type, data, result, address, length, str FROM warden_checks ORDER BY id ASC"); + + uint32 count = 0; + do + { + Field* fields = result->Fetch(); + + uint16 id = fields[0].GetUInt16(); + uint8 checkType = fields[1].GetUInt8(); + std::string data = fields[2].GetString(); + std::string checkResult = fields[3].GetString(); + uint32 address = fields[4].GetUInt32(); + uint8 length = fields[5].GetUInt8(); + std::string str = fields[6].GetString(); + + WardenCheck* wardenCheck = new WardenCheck(); + wardenCheck->Type = checkType; + + // Initialize action with default action from config + wardenCheck->Action = WardenActions(sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_FAIL_ACTION)); + + if (checkType == PAGE_CHECK_A || checkType == PAGE_CHECK_B || checkType == DRIVER_CHECK) + { + wardenCheck->Data.SetHexStr(data.c_str()); + int len = data.size() / 2; + + if (wardenCheck->Data.GetNumBytes() < len) + { + uint8 temp[24]; + memset(temp, 0, len); + memcpy(temp, wardenCheck->Data.AsByteArray(), wardenCheck->Data.GetNumBytes()); + std::reverse(temp, temp + len); + wardenCheck->Data.SetBinary((uint8*)temp, len); + } + } + + if (checkType == MEM_CHECK || checkType == MODULE_CHECK) + MemChecksIdPool.push_back(id); + else + OtherChecksIdPool.push_back(id); + + if (checkType == MEM_CHECK || checkType == PAGE_CHECK_A || checkType == PAGE_CHECK_B || checkType == PROC_CHECK) + { + wardenCheck->Address = address; + wardenCheck->Length = length; + } + + // PROC_CHECK support missing + if (checkType == MEM_CHECK || checkType == MPQ_CHECK || checkType == LUA_STR_CHECK || checkType == DRIVER_CHECK || checkType == MODULE_CHECK) + wardenCheck->Str = str; + + CheckStore[id] = wardenCheck; + + if (checkType == MPQ_CHECK || checkType == MEM_CHECK) + { + WardenCheckResult *wr = new WardenCheckResult(); + wr->Result.SetHexStr(checkResult.c_str()); + int len = checkResult.size() / 2; + if (wr->Result.GetNumBytes() < len) + { + uint8 *temp = new uint8[len]; + memset(temp, 0, len); + memcpy(temp, wr->Result.AsByteArray(), wr->Result.GetNumBytes()); + std::reverse(temp, temp + len); + wr->Result.SetBinary((uint8*)temp, len); + delete [] temp; + } + CheckResultStore[id] = wr; + } + + ++count; + } + while (result->NextRow()); + + // Fetch overrides from char db and overwrite default action in CheckStore + QueryResult overrideResult = CharacterDatabase.Query("SELECT wardenId, action FROM warden_action"); + + uint32 overrideCount = 0; + + if(overrideResult) + { + do + { + Field * fields = overrideResult->Fetch(); + + uint16 checkId = fields[0].GetUInt16(); + + // Check if override check ID actually exists in current Warden checks + if (checkId > maxCheckId) + sLog->outError("Warden check action override for invalid check (ID: %u, action: %u), skipped", checkId, fields[1].GetUInt8()); + else + CheckStore[fields[0].GetUInt16()]->Action = WardenActions(fields[1].GetUInt8()); + + ++overrideCount; + } + while (overrideResult->NextRow()); + } + + sLog->outString(">> Loaded %u warden checks and %u action overrides.", count, overrideCount); + sLog->outString(); +} + +WardenCheck* WardenCheckMgr::GetWardenDataById(uint16 Id) +{ + if (Id < CheckStore.size()) + return CheckStore[Id]; + + return NULL; +} + +WardenCheckResult* WardenCheckMgr::GetWardenResultById(uint16 Id) +{ + CheckResultContainer::const_iterator itr = CheckResultStore.find(Id); + if (itr != CheckResultStore.end()) + return itr->second; + return NULL; +} diff --git a/src/server/game/Warden/WardenCheckMgr.h b/src/server/game/Warden/WardenCheckMgr.h new file mode 100644 index 00000000000..cbe8460db3b --- /dev/null +++ b/src/server/game/Warden/WardenCheckMgr.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _WARDENCHECKMGR_H +#define _WARDENCHECKMGR_H + +#include <map> +#include "Cryptography/BigNumber.h" + +enum WardenActions +{ + WARDEN_ACTION_LOG, + WARDEN_ACTION_KICK, + WARDEN_ACTION_BAN +}; + +struct WardenCheck +{ + uint8 Type; + BigNumber Data; + uint32 Address; // PROC_CHECK, MEM_CHECK, PAGE_CHECK + uint8 Length; // PROC_CHECK, MEM_CHECK, PAGE_CHECK + std::string Str; // LUA, MPQ, DRIVER + enum WardenActions Action; +}; + +struct WardenCheckResult +{ + BigNumber Result; // MEM_CHECK +}; + +class WardenCheckMgr +{ + friend class ACE_Singleton<WardenCheckMgr, ACE_Null_Mutex>; + WardenCheckMgr(); + ~WardenCheckMgr(); + + public: + // We have a linear key without any gaps, so we use vector for fast access + typedef std::vector<WardenCheck*> CheckContainer; + typedef std::map<uint32, WardenCheckResult*> CheckResultContainer; + + WardenCheck* GetWardenDataById(uint16 Id); + WardenCheckResult* GetWardenResultById(uint16 Id); + + uint32 InternalDataID; + std::vector<uint16> MemChecksIdPool; + std::vector<uint16> OtherChecksIdPool; + + void LoadWardenChecks(); + + private: + CheckContainer CheckStore; + CheckResultContainer CheckResultStore; +}; + +#define sWardenCheckMgr ACE_Singleton<WardenCheckMgr, ACE_Null_Mutex>::instance() + +#endif diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp new file mode 100644 index 00000000000..f62aa11a339 --- /dev/null +++ b/src/server/game/Warden/WardenMac.cpp @@ -0,0 +1,260 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "Cryptography/WardenKeyGeneration.h" +#include "Common.h" +#include "WorldPacket.h" +#include "WorldSession.h" +#include "Log.h" +#include "Opcodes.h" +#include "ByteBuffer.h" +#include <openssl/md5.h> +#include "World.h" +#include "Player.h" +#include "Util.h" +#include "WardenMac.h" +#include "WardenModuleMac.h" + +WardenMac::WardenMac() : Warden() +{ +} + +WardenMac::~WardenMac() +{ +} + +void WardenMac::Init(WorldSession *pClient, BigNumber *K) +{ + _session = pClient; + // Generate Warden Key + SHA1Randx WK(K->AsByteArray(), K->GetNumBytes()); + WK.generate(_inputKey, 16); + WK.generate(_outputKey, 16); + /* + Seed: 4D808D2C77D905C41A6380EC08586AFE (0x05 packet) + Hash: <?> (0x04 packet) + Module MD5: 0DBBF209A27B1E279A9FEC5C168A15F7 + New Client Key: <?> + New Cerver Key: <?> + */ + uint8 mod_seed[16] = { 0x4D, 0x80, 0x8D, 0x2C, 0x77, 0xD9, 0x05, 0xC4, 0x1A, 0x63, 0x80, 0xEC, 0x08, 0x58, 0x6A, 0xFE }; + + memcpy(_seed, mod_seed, 16); + + _inputCrypto.Init(_inputKey); + _outputCrypto.Init(_outputKey); + sLog->outDebug(LOG_FILTER_WARDEN, "Server side warden for client %u initializing...", pClient->GetAccountId()); + sLog->outDebug(LOG_FILTER_WARDEN, "C->S Key: %s", ByteArrayToHexStr(_inputKey, 16).c_str()); + sLog->outDebug(LOG_FILTER_WARDEN, "S->C Key: %s", ByteArrayToHexStr(_outputKey, 16).c_str()); + sLog->outDebug(LOG_FILTER_WARDEN, " Seed: %s", ByteArrayToHexStr(_seed, 16).c_str()); + sLog->outDebug(LOG_FILTER_WARDEN, "Loading Module..."); + + _module = GetModuleForClient(); + + sLog->outDebug(LOG_FILTER_WARDEN, "Module Key: %s", ByteArrayToHexStr(_module->Key, 16).c_str()); + sLog->outDebug(LOG_FILTER_WARDEN, "Module ID: %s", ByteArrayToHexStr(_module->Id, 16).c_str()); + RequestModule(); +} + +ClientWardenModule* WardenMac::GetModuleForClient() +{ + ClientWardenModule *mod = new ClientWardenModule; + + uint32 len = sizeof(Module_0DBBF209A27B1E279A9FEC5C168A15F7_Data); + + // data assign + mod->CompressedSize = len; + mod->CompressedData = new uint8[len]; + memcpy(mod->CompressedData, Module_0DBBF209A27B1E279A9FEC5C168A15F7_Data, len); + memcpy(mod->Key, Module_0DBBF209A27B1E279A9FEC5C168A15F7_Key, 16); + + // md5 hash + MD5_CTX ctx; + MD5_Init(&ctx); + MD5_Update(&ctx, mod->CompressedData, len); + MD5_Final((uint8*)&mod->Id, &ctx); + + return mod; +} + +void WardenMac::InitializeModule() +{ + sLog->outDebug(LOG_FILTER_WARDEN, "Initialize module"); +} + +void WardenMac::RequestHash() +{ + sLog->outDebug(LOG_FILTER_WARDEN, "Request hash"); + + // Create packet structure + WardenHashRequest Request; + Request.Command = WARDEN_SMSG_HASH_REQUEST; + memcpy(Request.Seed, _seed, 16); + + // Encrypt with warden RC4 key. + EncryptData((uint8*)&Request, sizeof(WardenHashRequest)); + + WorldPacket pkt(SMSG_WARDEN_DATA, sizeof(WardenHashRequest)); + pkt.append((uint8*)&Request, sizeof(WardenHashRequest)); + _session->SendPacket(&pkt); +} + +void WardenMac::HandleHashResult(ByteBuffer &buff) +{ + + // test + int keyIn[4]; + + uint8 mod_seed[16] = { 0x4D, 0x80, 0x8D, 0x2C, 0x77, 0xD9, 0x05, 0xC4, 0x1A, 0x63, 0x80, 0xEC, 0x08, 0x58, 0x6A, 0xFE }; + + for(int i = 0; i < 4; ++i) + { + keyIn[i] = *(int*)(&mod_seed[0] + i * 4); + } + + int keyOut[4]; + int keyIn1, keyIn2; + keyOut[0] = keyIn[0]; + keyIn[0] ^= 0xDEADBEEFu; + keyIn1 = keyIn[1]; + keyIn[1] -= 0x35014542u; + keyIn2 = keyIn[2]; + keyIn[2] += 0x5313F22u; + keyIn[3] *= 0x1337F00Du; + keyOut[1] = keyIn1 - 0x6A028A84; + keyOut[2] = keyIn2 + 0xA627E44; + keyOut[3] = 0x1337F00D * keyIn[3]; + // end test + + buff.rpos(buff.wpos()); + + SHA1Hash sha1; + sha1.UpdateData((uint8*)keyIn, 16); + sha1.Finalize(); + + //const uint8 validHash[20] = { 0x56, 0x8C, 0x05, 0x4C, 0x78, 0x1A, 0x97, 0x2A, 0x60, 0x37, 0xA2, 0x29, 0x0C, 0x22, 0xB5, 0x25, 0x71, 0xA0, 0x6F, 0x4E }; + + // Verify key + if (memcmp(buff.contents() + 1, sha1.GetDigest(), 20) != 0) + { + sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); + sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s", + _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str()); + return; + } + + sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: succeed"); + + // client 7F96EEFDA5B63D20A4DF8E00CBF48304 + //const uint8 client_key[16] = { 0x7F, 0x96, 0xEE, 0xFD, 0xA5, 0xB6, 0x3D, 0x20, 0xA4, 0xDF, 0x8E, 0x00, 0xCB, 0xF4, 0x83, 0x04 }; + + // server C2B7ADEDFCCCA9C2BFB3F85602BA809B + //const uint8 server_key[16] = { 0xC2, 0xB7, 0xAD, 0xED, 0xFC, 0xCC, 0xA9, 0xC2, 0xBF, 0xB3, 0xF8, 0x56, 0x02, 0xBA, 0x80, 0x9B }; + + // change keys here + memcpy(_inputKey, keyIn, 16); + memcpy(_outputKey, keyOut, 16); + + _inputCrypto.Init(_inputKey); + _outputCrypto.Init(_outputKey); + + _initialized = true; + + _previousTimestamp = getMSTime(); +} + +void WardenMac::RequestData() +{ + sLog->outDebug(LOG_FILTER_WARDEN, "Request data"); + + ByteBuffer buff; + buff << uint8(WARDEN_SMSG_CHEAT_CHECKS_REQUEST); + + std::string str = "Test string!"; + + buff << uint8(str.size()); + buff.append(str.c_str(), str.size()); + + buff.hexlike(); + + // Encrypt with warden RC4 key. + EncryptData(const_cast<uint8*>(buff.contents()), buff.size()); + + WorldPacket pkt(SMSG_WARDEN_DATA, buff.size()); + pkt.append(buff); + _session->SendPacket(&pkt); + + _dataSent = true; +} + +void WardenMac::HandleData(ByteBuffer &buff) +{ + sLog->outDebug(LOG_FILTER_WARDEN, "Handle data"); + + _dataSent = false; + _clientResponseTimer = 0; + + //uint16 Length; + //buff >> Length; + //uint32 Checksum; + //buff >> Checksum; + + //if (!IsValidCheckSum(Checksum, buff.contents() + buff.rpos(), Length)) + //{ + // buff.rpos(buff.wpos()); + // if (sWorld->getBoolConfig(CONFIG_BOOL_WARDEN_KICK)) + // Client->KickPlayer(); + // return; + //} + + bool found = false; + + std::string str = "Test string!"; + + SHA1Hash sha1; + sha1.UpdateData(str); + uint32 magic = 0xFEEDFACE; // unsure + sha1.UpdateData((uint8*)&magic, 4); + sha1.Finalize(); + + uint8 sha1Hash[20]; + buff.read(sha1Hash, 20); + + if (memcmp(sha1Hash, sha1.GetDigest(), 20)) + { + sLog->outDebug(LOG_FILTER_WARDEN, "Handle data failed: SHA1 hash is wrong!"); + found = true; + } + + MD5_CTX ctx; + MD5_Init(&ctx); + MD5_Update(&ctx, str.c_str(), str.size()); + uint8 ourMD5Hash[16]; + MD5_Final(ourMD5Hash, &ctx); + + uint8 theirsMD5Hash[16]; + buff.read(theirsMD5Hash, 16); + + if (memcmp(ourMD5Hash, theirsMD5Hash, 16)) + { + sLog->outDebug(LOG_FILTER_WARDEN, "Handle data failed: MD5 hash is wrong!"); + found = true; + } + + _session->KickPlayer(); +} diff --git a/src/server/game/Warden/WardenMac.h b/src/server/game/Warden/WardenMac.h new file mode 100644 index 00000000000..b2ecc72367d --- /dev/null +++ b/src/server/game/Warden/WardenMac.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _WARDEN_MAC_H +#define _WARDEN_MAC_H + +#include "Cryptography/ARC4.h" +#include <map> +#include "Cryptography/BigNumber.h" +#include "ByteBuffer.h" +#include "Warden.h" + +class WorldSession; +class Warden; + +class WardenMac : public Warden +{ + public: + WardenMac(); + ~WardenMac(); + + void Init(WorldSession* session, BigNumber* k); + ClientWardenModule* GetModuleForClient(); + void InitializeModule(); + void RequestHash(); + void HandleHashResult(ByteBuffer& buff); + void RequestData(); + void HandleData(ByteBuffer& buff); +}; + +#endif diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp new file mode 100644 index 00000000000..a77c77a3261 --- /dev/null +++ b/src/server/game/Warden/WardenWin.cpp @@ -0,0 +1,523 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "Cryptography/HMACSHA1.h" +#include "Cryptography/WardenKeyGeneration.h" +#include "Common.h" +#include "WorldPacket.h" +#include "WorldSession.h" +#include "Log.h" +#include "Opcodes.h" +#include "ByteBuffer.h" +#include <openssl/md5.h> +#include "Database/DatabaseEnv.h" +#include "World.h" +#include "Player.h" +#include "Util.h" +#include "WardenWin.h" +#include "WardenModuleWin.h" +#include "WardenCheckMgr.h" +#include "AccountMgr.h" + +WardenWin::WardenWin() : Warden() +{ +} + +WardenWin::~WardenWin() +{ +} + +void WardenWin::Init(WorldSession* session, BigNumber *k) +{ + _session = session; + // Generate Warden Key + SHA1Randx WK(k->AsByteArray(), k->GetNumBytes()); + WK.generate(_inputKey, 16); + WK.generate(_outputKey, 16); + /* + Seed: 4D808D2C77D905C41A6380EC08586AFE (0x05 packet) + Hash: 568C054C781A972A6037A2290C22B52571A06F4E (0x04 packet) + Module MD5: 79C0768D657977D697E10BAD956CCED1 + New Client Key: 7F 96 EE FD A5 B6 3D 20 A4 DF 8E 00 CB F4 83 04 + New Cerver Key: C2 B7 AD ED FC CC A9 C2 BF B3 F8 56 02 BA 80 9B + */ + uint8 mod_seed[16] = { 0x4D, 0x80, 0x8D, 0x2C, 0x77, 0xD9, 0x05, 0xC4, 0x1A, 0x63, 0x80, 0xEC, 0x08, 0x58, 0x6A, 0xFE }; + + memcpy(_seed, mod_seed, 16); + + _inputCrypto.Init(_inputKey); + _outputCrypto.Init(_outputKey); + sLog->outDebug(LOG_FILTER_WARDEN, "Server side warden for client %u initializing...", session->GetAccountId()); + sLog->outDebug(LOG_FILTER_WARDEN, "C->S Key: %s", ByteArrayToHexStr(_inputKey, 16).c_str()); + sLog->outDebug(LOG_FILTER_WARDEN, "S->C Key: %s", ByteArrayToHexStr(_outputKey, 16).c_str()); + sLog->outDebug(LOG_FILTER_WARDEN, " Seed: %s", ByteArrayToHexStr(_seed, 16).c_str()); + sLog->outDebug(LOG_FILTER_WARDEN, "Loading Module..."); + + _module = GetModuleForClient(); + + sLog->outDebug(LOG_FILTER_WARDEN, "Module Key: %s", ByteArrayToHexStr(_module->Key, 16).c_str()); + sLog->outDebug(LOG_FILTER_WARDEN, "Module ID: %s", ByteArrayToHexStr(_module->Id, 16).c_str()); + RequestModule(); +} + +ClientWardenModule* WardenWin::GetModuleForClient() +{ + ClientWardenModule *mod = new ClientWardenModule; + + uint32 length = sizeof(Module_79C0768D657977D697E10BAD956CCED1_Data); + + // data assign + mod->CompressedSize = length; + mod->CompressedData = new uint8[length]; + memcpy(mod->CompressedData, Module_79C0768D657977D697E10BAD956CCED1_Data, length); + memcpy(mod->Key, Module_79C0768D657977D697E10BAD956CCED1_Key, 16); + + // md5 hash + MD5_CTX ctx; + MD5_Init(&ctx); + MD5_Update(&ctx, mod->CompressedData, length); + MD5_Final((uint8*)&mod->Id, &ctx); + + return mod; +} + +void WardenWin::InitializeModule() +{ + sLog->outDebug(LOG_FILTER_WARDEN, "Initialize module"); + + // Create packet structure + WardenInitModuleRequest Request; + Request.Command1 = WARDEN_SMSG_MODULE_INITIALIZE; + Request.Size1 = 20; + Request.CheckSumm1 = BuildChecksum(&Request.Unk1, 20); + Request.Unk1 = 1; + Request.Unk2 = 0; + Request.Type = 1; + Request.String_library1 = 0; + Request.Function1[0] = 0x00024F80; // 0x00400000 + 0x00024F80 SFileOpenFile + Request.Function1[1] = 0x000218C0; // 0x00400000 + 0x000218C0 SFileGetFileSize + Request.Function1[2] = 0x00022530; // 0x00400000 + 0x00022530 SFileReadFile + Request.Function1[3] = 0x00022910; // 0x00400000 + 0x00022910 SFileCloseFile + + Request.Command2 = WARDEN_SMSG_MODULE_INITIALIZE; + Request.Size2 = 8; + Request.CheckSumm2 = BuildChecksum(&Request.Unk2, 8); + Request.Unk3 = 4; + Request.Unk4 = 0; + Request.String_library2 = 0; + Request.Function2 = 0x00419D40; // 0x00400000 + 0x00419D40 FrameScript::GetText + Request.Function2_set = 1; + + Request.Command3 = WARDEN_SMSG_MODULE_INITIALIZE; + Request.Size3 = 8; + Request.CheckSumm3 = BuildChecksum(&Request.Unk5, 8); + Request.Unk5 = 1; + Request.Unk6 = 1; + Request.String_library3 = 0; + Request.Function3 = 0x0046AE20; // 0x00400000 + 0x0046AE20 PerformanceCounter + Request.Function3_set = 1; + + // Encrypt with warden RC4 key. + EncryptData((uint8*)&Request, sizeof(WardenInitModuleRequest)); + + WorldPacket pkt(SMSG_WARDEN_DATA, sizeof(WardenInitModuleRequest)); + pkt.append((uint8*)&Request, sizeof(WardenInitModuleRequest)); + _session->SendPacket(&pkt); +} + +void WardenWin::RequestHash() +{ + sLog->outDebug(LOG_FILTER_WARDEN, "Request hash"); + + // Create packet structure + WardenHashRequest Request; + Request.Command = WARDEN_SMSG_HASH_REQUEST; + memcpy(Request.Seed, _seed, 16); + + // Encrypt with warden RC4 key. + EncryptData((uint8*)&Request, sizeof(WardenHashRequest)); + + WorldPacket pkt(SMSG_WARDEN_DATA, sizeof(WardenHashRequest)); + pkt.append((uint8*)&Request, sizeof(WardenHashRequest)); + _session->SendPacket(&pkt); +} + +void WardenWin::HandleHashResult(ByteBuffer &buff) +{ + buff.rpos(buff.wpos()); + + const uint8 validHash[20] = { 0x56, 0x8C, 0x05, 0x4C, 0x78, 0x1A, 0x97, 0x2A, 0x60, 0x37, 0xA2, 0x29, 0x0C, 0x22, 0xB5, 0x25, 0x71, 0xA0, 0x6F, 0x4E }; + + // Verify key + if (memcmp(buff.contents() + 1, validHash, sizeof(validHash)) != 0) + { + sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); + sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s", + _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str()); + return; + } + + sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: succeed"); + + // Client 7F96EEFDA5B63D20A4DF8E00CBF48304 + const uint8 client_key[16] = { 0x7F, 0x96, 0xEE, 0xFD, 0xA5, 0xB6, 0x3D, 0x20, 0xA4, 0xDF, 0x8E, 0x00, 0xCB, 0xF4, 0x83, 0x04 }; + + // Server C2B7ADEDFCCCA9C2BFB3F85602BA809B + const uint8 server_key[16] = { 0xC2, 0xB7, 0xAD, 0xED, 0xFC, 0xCC, 0xA9, 0xC2, 0xBF, 0xB3, 0xF8, 0x56, 0x02, 0xBA, 0x80, 0x9B }; + + // Change keys here + memcpy(_inputKey, client_key, 16); + memcpy(_outputKey, server_key, 16); + + _inputCrypto.Init(_inputKey); + _outputCrypto.Init(_outputKey); + + _initialized = true; + + _previousTimestamp = getMSTime(); +} + +void WardenWin::RequestData() +{ + sLog->outDebug(LOG_FILTER_WARDEN, "Request data"); + + // If all checks were done, fill the todo list again + if (_memChecksTodo.empty()) + _memChecksTodo.assign(sWardenCheckMgr->MemChecksIdPool.begin(), sWardenCheckMgr->MemChecksIdPool.end()); + + if (_otherChecksTodo.empty()) + _otherChecksTodo.assign(sWardenCheckMgr->OtherChecksIdPool.begin(), sWardenCheckMgr->OtherChecksIdPool.end()); + + _serverTicks = getMSTime(); + + uint16 id; + uint8 type; + WardenCheck* wd; + _currentChecks.clear(); + + // Build check request + for (uint32 i = 0; i < sWorld->getIntConfig(CONFIG_WARDEN_NUM_MEM_CHECKS); ++i) + { + // If todo list is done break loop (will be filled on next Update() run) + if (_memChecksTodo.empty()) + break; + + // Get check id from the end and remove it from todo + id = _memChecksTodo.back(); + _memChecksTodo.pop_back(); + + // Add the id to the list sent in this cycle + _currentChecks.push_back(id); + } + + ByteBuffer buff; + buff << uint8(WARDEN_SMSG_CHEAT_CHECKS_REQUEST); + + for (uint32 i = 0; i < sWorld->getIntConfig(CONFIG_WARDEN_NUM_OTHER_CHECKS); ++i) + { + // If todo list is done break loop (will be filled on next Update() run) + if (_otherChecksTodo.empty()) + break; + + // Get check id from the end and remove it from todo + id = _otherChecksTodo.back(); + _otherChecksTodo.pop_back(); + + // Add the id to the list sent in this cycle + _currentChecks.push_back(id); + + wd = sWardenCheckMgr->GetWardenDataById(id); + + switch (wd->Type) + { + case MPQ_CHECK: + case LUA_STR_CHECK: + case DRIVER_CHECK: + buff << uint8(wd->Str.size()); + buff.append(wd->Str.c_str(), wd->Str.size()); + break; + default: + break; + } + } + + uint8 xorByte = _inputKey[0]; + + // Add TIMING_CHECK + buff << uint8(0x00); + buff << uint8(TIMING_CHECK ^ xorByte); + + uint8 index = 1; + + for (std::list<uint16>::iterator itr = _currentChecks.begin(); itr != _currentChecks.end(); ++itr) + { + wd = sWardenCheckMgr->GetWardenDataById(*itr); + + type = wd->Type; + buff << uint8(type ^ xorByte); + switch (type) + { + case MEM_CHECK: + { + buff << uint8(0x00); + buff << uint32(wd->Address); + buff << uint8(wd->Length); + break; + } + case PAGE_CHECK_A: + case PAGE_CHECK_B: + { + buff.append(wd->Data.AsByteArray(0, false), wd->Data.GetNumBytes()); + buff << uint32(wd->Address); + buff << uint8(wd->Length); + break; + } + case MPQ_CHECK: + case LUA_STR_CHECK: + { + buff << uint8(index++); + break; + } + case DRIVER_CHECK: + { + buff.append(wd->Data.AsByteArray(0, false), wd->Data.GetNumBytes()); + buff << uint8(index++); + break; + } + case MODULE_CHECK: + { + uint32 seed = static_cast<uint32>(rand32()); + buff << uint32(seed); + HmacHash hmac(4, (uint8*)&seed); + hmac.UpdateData(wd->Str); + hmac.Finalize(); + buff.append(hmac.GetDigest(), hmac.GetLength()); + break; + } + /*case PROC_CHECK: + { + buff.append(wd->i.AsByteArray(0, false), wd->i.GetNumBytes()); + buff << uint8(index++); + buff << uint8(index++); + buff << uint32(wd->Address); + buff << uint8(wd->Length); + break; + }*/ + default: + break; // Should never happen + } + } + buff << uint8(xorByte); + buff.hexlike(); + + // Encrypt with warden RC4 key + EncryptData(const_cast<uint8*>(buff.contents()), buff.size()); + + WorldPacket pkt(SMSG_WARDEN_DATA, buff.size()); + pkt.append(buff); + _session->SendPacket(&pkt); + + _dataSent = true; + + std::stringstream stream; + stream << "Sent check id's: "; + for (std::list<uint16>::iterator itr = _currentChecks.begin(); itr != _currentChecks.end(); ++itr) + stream << *itr << " "; + + sLog->outWarden("%s", stream.str().c_str()); +} + +void WardenWin::HandleData(ByteBuffer &buff) +{ + sLog->outDebug(LOG_FILTER_WARDEN, "Handle data"); + + _dataSent = false; + _clientResponseTimer = 0; + + uint16 Length; + buff >> Length; + uint32 Checksum; + buff >> Checksum; + + if (!IsValidCheckSum(Checksum, buff.contents() + buff.rpos(), Length)) + { + buff.rpos(buff.wpos()); + sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM FAIL"); + sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed checksum. Action: %s", + _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str()); + return; + } + + // TIMING_CHECK + { + uint8 result; + buff >> result; + // TODO: test it. + if (result == 0x00) + { + sLog->outDebug(LOG_FILTER_WARDEN, "TIMING CHECK FAIL result 0x00"); + sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed timing check. Action: %s", + _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str()); + return; + } + + uint32 newClientTicks; + buff >> newClientTicks; + + uint32 ticksNow = getMSTime(); + uint32 ourTicks = newClientTicks + (ticksNow - _serverTicks); + + sLog->outDebug(LOG_FILTER_WARDEN, "ServerTicks %u", ticksNow); // Now + sLog->outDebug(LOG_FILTER_WARDEN, "RequestTicks %u", _serverTicks); // At request + sLog->outDebug(LOG_FILTER_WARDEN, "Ticks %u", newClientTicks); // At response + sLog->outDebug(LOG_FILTER_WARDEN, "Ticks diff %u", ourTicks - newClientTicks); + } + + WardenCheckResult *rs; + WardenCheck *rd; + uint8 type; + uint16 checkFailed = 0; + + for (std::list<uint16>::iterator itr = _currentChecks.begin(); itr != _currentChecks.end(); ++itr) + { + rd = sWardenCheckMgr->GetWardenDataById(*itr); + rs = sWardenCheckMgr->GetWardenResultById(*itr); + + type = rd->Type; + switch (type) + { + case MEM_CHECK: + { + uint8 Mem_Result; + buff >> Mem_Result; + + if (Mem_Result != 0) + { + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MEM_CHECK not 0x00, CheckId %u account Id %u", *itr, _session->GetAccountId()); + checkFailed = *itr; + continue; + } + + if (memcmp(buff.contents() + buff.rpos(), rs->Result.AsByteArray(0, false), rd->Length) != 0) + { + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MEM_CHECK fail CheckId %u account Id %u", *itr, _session->GetAccountId()); + checkFailed = *itr; + buff.rpos(buff.rpos() + rd->Length); + continue; + } + + buff.rpos(buff.rpos() + rd->Length); + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MEM_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); + break; + } + case PAGE_CHECK_A: + case PAGE_CHECK_B: + case DRIVER_CHECK: + case MODULE_CHECK: + { + const uint8 byte = 0xE9; + if (memcmp(buff.contents() + buff.rpos(), &byte, sizeof(uint8)) != 0) + { + if (type == PAGE_CHECK_A || type == PAGE_CHECK_B) + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT PAGE_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); + if (type == MODULE_CHECK) + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MODULE_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); + if (type == DRIVER_CHECK) + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT DRIVER_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); + checkFailed = *itr; + buff.rpos(buff.rpos() + 1); + continue; + } + + buff.rpos(buff.rpos() + 1); + if (type == PAGE_CHECK_A || type == PAGE_CHECK_B) + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT PAGE_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); + else if (type == MODULE_CHECK) + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MODULE_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); + else if (type == DRIVER_CHECK) + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT DRIVER_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); + break; + } + case LUA_STR_CHECK: + { + uint8 Lua_Result; + buff >> Lua_Result; + + if (Lua_Result != 0) + { + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT LUA_STR_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); + checkFailed = *itr; + continue; + } + + uint8 luaStrLen; + buff >> luaStrLen; + + if (luaStrLen != 0) + { + char *str = new char[luaStrLen + 1]; + memset(str, 0, luaStrLen + 1); + memcpy(str, buff.contents() + buff.rpos(), luaStrLen); + sLog->outDebug(LOG_FILTER_WARDEN, "Lua string: %s", str); + delete[] str; + } + buff.rpos(buff.rpos() + luaStrLen); // Skip string + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT LUA_STR_CHECK passed, CheckId %u account Id %u", *itr, _session->GetAccountId()); + break; + } + case MPQ_CHECK: + { + uint8 Mpq_Result; + buff >> Mpq_Result; + + if (Mpq_Result != 0) + { + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MPQ_CHECK not 0x00 account id %u", _session->GetAccountId()); + checkFailed = *itr; + continue; + } + + if (memcmp(buff.contents() + buff.rpos(), rs->Result.AsByteArray(0, false), 20) != 0) // SHA1 + { + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MPQ_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); + checkFailed = *itr; + buff.rpos(buff.rpos() + 20); // 20 bytes SHA1 + continue; + } + + buff.rpos(buff.rpos() + 20); // 20 bytes SHA1 + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MPQ_CHECK passed, CheckId %u account Id %u", *itr, _session->GetAccountId()); + break; + } + default: // Should never happen + break; + } + } + + if (checkFailed > 0) + { + WardenCheck* check = sWardenCheckMgr->GetWardenDataById(checkFailed); + + sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed Warden check %u. Action: %s", + _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), checkFailed, Penalty(check).c_str()); + } + + // Set hold off timer, minimum timer should at least be 1 second + uint32 holdOff = sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF); + _checkTimer = (holdOff < 1 ? 1 : holdOff) * IN_MILLISECONDS; +} diff --git a/src/server/game/Warden/WardenWin.h b/src/server/game/Warden/WardenWin.h new file mode 100644 index 00000000000..4d859f2b22a --- /dev/null +++ b/src/server/game/Warden/WardenWin.h @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _WARDEN_WIN_H +#define _WARDEN_WIN_H + +#include <map> +#include "Cryptography/ARC4.h" +#include "Cryptography/BigNumber.h" +#include "ByteBuffer.h" +#include "Warden.h" + +#if defined(__GNUC__) +#pragma pack(1) +#else +#pragma pack(push,1) +#endif + +struct WardenInitModuleRequest +{ + uint8 Command1; + uint16 Size1; + uint32 CheckSumm1; + uint8 Unk1; + uint8 Unk2; + uint8 Type; + uint8 String_library1; + uint32 Function1[4]; + + uint8 Command2; + uint16 Size2; + uint32 CheckSumm2; + uint8 Unk3; + uint8 Unk4; + uint8 String_library2; + uint32 Function2; + uint8 Function2_set; + + uint8 Command3; + uint16 Size3; + uint32 CheckSumm3; + uint8 Unk5; + uint8 Unk6; + uint8 String_library3; + uint32 Function3; + uint8 Function3_set; +}; + +#if defined(__GNUC__) +#pragma pack() +#else +#pragma pack(pop) +#endif + +class WorldSession; +class Warden; + +class WardenWin : public Warden +{ + public: + WardenWin(); + ~WardenWin(); + + void Init(WorldSession* session, BigNumber* K); + ClientWardenModule* GetModuleForClient(); + void InitializeModule(); + void RequestHash(); + void HandleHashResult(ByteBuffer &buff); + void RequestData(); + void HandleData(ByteBuffer &buff); + + private: + uint32 _serverTicks; + std::list<uint16> _otherChecksTodo; + std::list<uint16> _memChecksTodo; + std::list<uint16> _currentChecks; +}; + +#endif diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 354b36ba93b..59f5508149d 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -74,6 +74,8 @@ #include "CreatureTextMgr.h" #include "SmartAI.h" #include "Channel.h" +#include "WardenCheckMgr.h" +#include "Warden.h" volatile bool World::m_stopEvent = false; uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE; @@ -1170,6 +1172,15 @@ void World::LoadConfigSettings(bool reload) m_bool_configs[CONFIG_CHATLOG_ADDON] = ConfigMgr::GetBoolDefault("ChatLogs.Addon", false); m_bool_configs[CONFIG_CHATLOG_BGROUND] = ConfigMgr::GetBoolDefault("ChatLogs.Battleground", false); + // Warden + m_bool_configs[CONFIG_WARDEN_ENABLED] = ConfigMgr::GetBoolDefault("Warden.Enabled", false); + m_int_configs[CONFIG_WARDEN_NUM_MEM_CHECKS] = ConfigMgr::GetIntDefault("Warden.NumMemChecks", 3); + m_int_configs[CONFIG_WARDEN_NUM_OTHER_CHECKS] = ConfigMgr::GetIntDefault("Warden.NumOtherChecks", 7); + m_int_configs[CONFIG_WARDEN_CLIENT_BAN_DURATION] = ConfigMgr::GetIntDefault("Warden.BanDuration", 86400); + m_int_configs[CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF] = ConfigMgr::GetIntDefault("Warden.ClientCheckHoldOff", 30); + m_int_configs[CONFIG_WARDEN_CLIENT_FAIL_ACTION] = ConfigMgr::GetIntDefault("Warden.ClientCheckFailAction", 0); + m_int_configs[CONFIG_WARDEN_CLIENT_RESPONSE_DELAY] = ConfigMgr::GetIntDefault("Warden.ClientResponseDelay", 600); + // Dungeon finder m_bool_configs[CONFIG_DUNGEON_FINDER_ENABLE] = ConfigMgr::GetBoolDefault("DungeonFinder.Enable", false); @@ -1276,7 +1287,7 @@ void World::SetInitialWorldSettings() sLog->outString("Loading GameObject models..."); LoadGameObjectModelList(); - + sLog->outString("Loading Script Names..."); sObjectMgr->LoadScriptNames(); @@ -1579,6 +1590,9 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Creature Formations..."); FormationMgr::LoadCreatureFormations(); + sLog->outString("Loading World States..."); // must be loaded before battleground, outdoor PvP and conditions + LoadWorldStates(); + sLog->outString("Loading Conditions..."); sConditionMgr->LoadConditions(); @@ -1706,9 +1720,6 @@ void World::SetInitialWorldSettings() sTicketMgr->Initialize(); - sLog->outString("Loading World States..."); // must be loaded before battleground and outdoor PvP - LoadWorldStates(); - ///- Initialize Battlegrounds sLog->outString("Starting Battleground System"); sBattlegroundMgr->CreateInitialBattlegrounds(); @@ -1724,6 +1735,10 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Transport NPCs..."); sMapMgr->LoadTransportNPCs(); + ///- Initialize Warden + sLog->outString("Loading Warden Checks..." ); + sWardenCheckMgr->LoadWardenChecks(); + sLog->outString("Deleting expired bans..."); LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 18d32002734..be4c41214ec 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -162,6 +162,7 @@ enum WorldBoolConfigs CONFIG_PDUMP_NO_OVERWRITE, CONFIG_QUEST_IGNORE_AUTO_ACCEPT, CONFIG_QUEST_IGNORE_AUTO_COMPLETE, + CONFIG_WARDEN_ENABLED, BOOL_CONFIG_VALUE_COUNT }; @@ -309,6 +310,12 @@ enum WorldIntConfigs CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION, CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS, CONFIG_MAX_INSTANCES_PER_HOUR, + CONFIG_WARDEN_CLIENT_RESPONSE_DELAY, + CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF, + CONFIG_WARDEN_CLIENT_FAIL_ACTION, + CONFIG_WARDEN_CLIENT_BAN_DURATION, + CONFIG_WARDEN_NUM_MEM_CHECKS, + CONFIG_WARDEN_NUM_OTHER_CHECKS, INT_CONFIG_VALUE_COUNT }; diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index 9195a60dd9d..62336e95ff6 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -137,6 +137,8 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Texts ${CMAKE_SOURCE_DIR}/src/server/game/Tickets ${CMAKE_SOURCE_DIR}/src/server/game/Tools + ${CMAKE_SOURCE_DIR}/src/server/game/Warden + ${CMAKE_SOURCE_DIR}/src/server/game/Warden/Modules ${CMAKE_SOURCE_DIR}/src/server/game/Weather ${CMAKE_SOURCE_DIR}/src/server/game/World ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 3de1181f764..8ca40231090 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1041,7 +1041,7 @@ public: handler->GetSession()->GetPlayer()->HandleEmoteCommand(animId); return true; } - + static bool HandleDebugLoSCommand(ChatHandler* handler, char const* /*args*/) { if (Unit* unit = handler->getSelectedUnit()) diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 3de0d89bac5..f7371884da2 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -496,7 +496,7 @@ public: float z; float ort = port ? (float)atof(port) : player->GetOrientation(); uint32 mapId = id ? (uint32)atoi(id) : player->GetMapId(); - + if (goZ) { z = (float)atof(goZ); diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp index 54fcb9d99c2..3960351d395 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp @@ -24,7 +24,7 @@ enum Yells YELL_RESPAWN1 = -1810010, // no creature_text YELL_RESPAWN2 = -1810011, // no creature_text YELL_RANDOM = 2, - YELL_SPELL = 3, + YELL_SPELL = 3, }; enum Spells diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 17cf775603f..7ef11e5256a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -1301,7 +1301,7 @@ void AddSC_blackrock_depths() new npc_kharan_mighthammer(); new npc_lokhtos_darkbargainer(); new npc_rocknot(); - // Fix us + // Fix us /*new npc_dughal_stormwing(); new npc_tobias_seecher(); new npc_marshal_windsor(); diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp index 7bcd2598271..1c6cad7278a 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp @@ -143,125 +143,10 @@ class AreaTrigger_at_map_chamber : public AreaTriggerScript } }; -/*###### -## npc_lore_keeper_of_norgannon -######*/ - -#define GOSSIP_HELLO_KEEPER "Who are the Earthen?" -#define GOSSIP_SELECT_KEEPER1 "What is a \"subterranean being matrix\"?" -#define GOSSIP_SELECT_KEEPER2 "What are the anomalies you speak of?" -#define GOSSIP_SELECT_KEEPER3 "What is a resilient foundation of construction?" -#define GOSSIP_SELECT_KEEPER4 "So... the Earthen were made out of stone?" -#define GOSSIP_SELECT_KEEPER5 "Anything else I should know about the Earthen?" -#define GOSSIP_SELECT_KEEPER6 "I think I understand the Creators' design intent for the Earthen now. What are the Earthen's anomalies that you spoke of earlier?" -#define GOSSIP_SELECT_KEEPER7 "What high-stress environments would cause the Earthen to destabilize?" -#define GOSSIP_SELECT_KEEPER8 "What happens when the Earthen destabilize?" -#define GOSSIP_SELECT_KEEPER9 "Troggs?! Are the troggs you mention the same as the ones in the world today?" -#define GOSSIP_SELECT_KEEPER10 "You mentioned two results when the Earthen destabilize. What is the second?" -#define GOSSIP_SELECT_KEEPER11 "Dwarves!!! Now you're telling me that dwarves originally came from the Earthen?!" -#define GOSSIP_SELECT_KEEPER12 "These dwarves are the same ones today, yes? Do the dwarves maintain any other links to the Earthen?" -#define GOSSIP_SELECT_KEEPER13 "Who are the Creators?" -#define GOSSIP_SELECT_KEEPER14 "This is a lot to think about." -#define GOSSIP_SELECT_KEEPER15 "I will access the discs now." - -class npc_lore_keeper_of_norgannon : public CreatureScript -{ - public: - - npc_lore_keeper_of_norgannon() - : CreatureScript("npc_lore_keeper_of_norgannon") - { - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(2278) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_KEEPER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(1079, creature->GetGUID()); - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) - { - player->PlayerTalkClass->ClearMenus(); - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(1080, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->SEND_GOSSIP_MENU(1081, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(1082, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(1083, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - player->SEND_GOSSIP_MENU(1084, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); - player->SEND_GOSSIP_MENU(1085, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8); - player->SEND_GOSSIP_MENU(1086, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+8: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); - player->SEND_GOSSIP_MENU(1087, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+9: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10); - player->SEND_GOSSIP_MENU(1088, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+10: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+11); - player->SEND_GOSSIP_MENU(1089, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+11: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+12); - player->SEND_GOSSIP_MENU(1090, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+12: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+13); - player->SEND_GOSSIP_MENU(1091, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+13: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+14); - player->SEND_GOSSIP_MENU(1092, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+14: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+15); - player->SEND_GOSSIP_MENU(1093, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+15: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+16); - player->SEND_GOSSIP_MENU(1094, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+16: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(2278); - break; - } - return true; - } -}; - void AddSC_uldaman() { new mob_jadespine_basilisk(); new go_keystone_chamber(); new AreaTrigger_at_map_chamber(); - new npc_lore_keeper_of_norgannon(); } diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index e2a9717882b..82b09b9dc18 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -73,7 +73,7 @@ class npc_professor_phizzlethorpe : public CreatureScript switch (uiPointId) { - case 4:Talk(SAY_PROGRESS_2, player->GetGUID());break; + case 4:Talk(SAY_PROGRESS_2, player->GetGUID());break; case 5:Talk(SAY_PROGRESS_3, player->GetGUID());break; case 8:Talk(EMOTE_PROGRESS_4);break; case 9: diff --git a/src/server/scripts/EasternKingdoms/blasted_lands.cpp b/src/server/scripts/EasternKingdoms/blasted_lands.cpp index 1e34051db28..2ad03f8b504 100644 --- a/src/server/scripts/EasternKingdoms/blasted_lands.cpp +++ b/src/server/scripts/EasternKingdoms/blasted_lands.cpp @@ -19,13 +19,12 @@ /* ScriptData SDName: Blasted_Lands SD%Complete: 90 -SDComment: Quest support: 2784, 2801, 3628. Missing some texts for Fallen Hero. Teleporter to Rise of the Defiler missing group support. +SDComment: Quest support: 3628. Teleporter to Rise of the Defiler missing group support. SDCategory: Blasted Lands EndScriptData */ /* ContentData npc_deathly_usher -npc_fallen_hero_of_horde EndContentData */ #include "ScriptPCH.h" @@ -69,115 +68,7 @@ public: }; -/*###### -## npc_fallen_hero_of_horde -######*/ - -enum HeroesOfOld -{ - QUEST_HEROES_OF_OLD = 2702, - NPC_THUND_SPLITHOOF = 7750, -}; - -#define GOSSIP_H_F1 "Why are you here?" -#define GOSSIP_H_F2 "Continue story..." - -#define GOSSIP_ITEM_FALLEN "Continue..." - -#define GOSSIP_ITEM_FALLEN1 "What could be worse than death?" -#define GOSSIP_ITEM_FALLEN2 "Subordinates?" -#define GOSSIP_ITEM_FALLEN3 "What are the stones of binding?" -#define GOSSIP_ITEM_FALLEN4 "You can count on me, Hero" -#define GOSSIP_ITEM_FALLEN5 "I shall" - -class npc_fallen_hero_of_horde : public CreatureScript -{ -public: - npc_fallen_hero_of_horde() : CreatureScript("npc_fallen_hero_of_horde") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) - { - player->PlayerTalkClass->ClearMenus(); - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - player->SEND_GOSSIP_MENU(1392, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+11: - player->SEND_GOSSIP_MENU(1411, creature->GetGUID()); - if (player->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(2784); - if (player->GetTeam() == ALLIANCE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(1411, creature->GetGUID()); - } - break; - - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); - player->SEND_GOSSIP_MENU(1451, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+21: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); - player->SEND_GOSSIP_MENU(1452, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+22: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23); - player->SEND_GOSSIP_MENU(1453, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+23: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24); - player->SEND_GOSSIP_MENU(1454, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+24: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25); - player->SEND_GOSSIP_MENU(1455, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+25: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 26); - player->SEND_GOSSIP_MENU(1456, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+26: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(2801); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_F1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - if (player->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && player->GetTeam() == HORDE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_F2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - - if (player->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && player->GetTeam() == ALLIANCE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_F1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - - bool OnQuestAccept(Player* /*player*/, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_HEROES_OF_OLD) - creature->SummonCreature(NPC_THUND_SPLITHOOF, -10630.3f, -2987.05f, 28.96f, 4.54f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 9000000); - - return true; - } - -}; - void AddSC_blasted_lands() { new npc_deathly_usher(); - new npc_fallen_hero_of_horde(); } diff --git a/src/server/scripts/EasternKingdoms/searing_gorge.cpp b/src/server/scripts/EasternKingdoms/searing_gorge.cpp index 74172dda743..ebe2aae0d46 100644 --- a/src/server/scripts/EasternKingdoms/searing_gorge.cpp +++ b/src/server/scripts/EasternKingdoms/searing_gorge.cpp @@ -19,14 +19,12 @@ /* ScriptData SDName: Searing_Gorge SD%Complete: 80 -SDComment: Quest support: 3377, 3441 (More accurate info on Kalaran needed). Lothos Riftwaker teleport to Molten Core. +SDComment: Quest support: 3441 (More accurate info on Kalaran needed). SDCategory: Searing Gorge EndScriptData */ /* ContentData npc_kalaran_windblade -npc_lothos_riftwaker -npc_zamael_lunthistle EndContentData */ #include "ScriptPCH.h" @@ -81,99 +79,10 @@ public: }; /*###### -## npc_lothos_riftwaker -######*/ - -#define GOSSIP_HELLO_LR "Teleport me to the Molten Core" - -class npc_lothos_riftwaker : public CreatureScript -{ -public: - npc_lothos_riftwaker() : CreatureScript("npc_lothos_riftwaker") { } - - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) - { - player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(409, 1096, -467, -104.6f, 3.64f); - } - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestRewardStatus(7487) || player->GetQuestRewardStatus(7848)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_LR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_zamael_lunthistle -######*/ - -#define GOSSIP_HELLO_ZL "Tell me your story" -#define GOSSIP_SELECT_ZL1 "Please continue..." -#define GOSSIP_SELECT_ZL2 "Goodbye" - -class npc_zamael_lunthistle : public CreatureScript -{ -public: - npc_zamael_lunthistle() : CreatureScript("npc_zamael_lunthistle") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) - { - player->PlayerTalkClass->ClearMenus(); - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_ZL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(1921, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_ZL2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(1922, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(3377); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(3377) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_ZL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(1920, creature->GetGUID()); - - return true; - } - -}; - -/*###### ## ######*/ void AddSC_searing_gorge() { new npc_kalaran_windblade(); - new npc_lothos_riftwaker(); - new npc_zamael_lunthistle(); -} +}
\ No newline at end of file diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp index b1a8f17d16a..71dbd7f4fb0 100644 --- a/src/server/scripts/Examples/example_spell.cpp +++ b/src/server/scripts/Examples/example_spell.cpp @@ -93,14 +93,14 @@ class spell_ex_5581 : public SpellScriptLoader void HandleAfterCast() { sLog->outString("All immediate actions for the spell are finished now"); - // this is a safe for triggering additional effects for a spell without interfering + // this is a safe for triggering additional effects for a spell without interfering // with visuals or with other effects of the spell //GetCaster()->CastSpell(target, SPELL_TRIGGERED, true); } SpellCastResult CheckRequirement() { - // in this hook you can add additional requirements for spell caster (and throw a client error if reqs're not passed) + // in this hook you can add additional requirements for spell caster (and throw a client error if reqs're not passed) // in this case we're disallowing to select non-player as a target of the spell //if (!GetTargetUnit() || GetTargetUnit()->ToPlayer()) //return SPELL_FAILED_BAD_TARGETS; diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index 878116ad476..3bfaa448b85 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -165,14 +165,14 @@ public: DoCast(target, SPELL_FROST_BOLT_VOLLEY); } frostBoltVolleyTimer = urand(5000, 8000); - } + } else frostBoltVolleyTimer -= diff; - + if (frostNovaTimer <= diff) { DoCastAOE(SPELL_FROST_NOVA, false); frostNovaTimer = urand(25000, 30000); - } + } else frostNovaTimer -= diff; break; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 0caec3c7069..107c9e8f2f9 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -947,7 +947,7 @@ void hyjalAI::HideNearPos(float x, float y) Trinity::AllFriendlyCreaturesInGrid creature_check(me); Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check); - TypeContainerVisitor <Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> creature_visitor(creature_searcher); + TypeContainerVisitor <Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> creature_visitor(creature_searcher); cell.Visit(pair, creature_visitor, *(me->GetMap()), *me, me->GetGridActivationRange()); if (!creatures.empty()) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index b2c4911a20c..aa57b3d9499 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -139,9 +139,9 @@ public: #define SPEED_RUN (1.0f) #define SPEED_MOUNT (1.6f) -#define THRALL_WEAPON_MODEL 22106 +#define THRALL_WEAPON_ITEM 927 #define THRALL_WEAPON_INFO 218169346 -#define THRALL_SHIELD_MODEL 18662 +#define THRALL_SHIELD_ITEM 2129 #define THRALL_SHIELD_INFO 234948100 #define THRALL_MODEL_UNEQUIPPED 17292 #define THRALL_MODEL_EQUIPPED 18165 @@ -309,10 +309,10 @@ public: break; case 9: DoScriptText(SAY_TH_ARMORY, me); - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_ITEM); //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO); //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781); - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_ITEM); //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO); //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038); break; diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp index 74e7a919263..38d9ce31563 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -77,7 +77,7 @@ public: if (target) DoCast(target, SPELL_WRATH); Wrath_Timer = 8000; - } + } else Wrath_Timer -= diff; //EntanglingRoots @@ -85,7 +85,7 @@ public: { DoCast(me->getVictim(), SPELL_ENTANGLINGROOTS); EntanglingRoots_Timer = 20000; - } + } else EntanglingRoots_Timer -= diff; //CorruptForces @@ -94,7 +94,7 @@ public: me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_CORRUPT_FORCES); CorruptForces_Timer = 20000; - } + } else CorruptForces_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp index 418bf3a09ce..ea419793ae8 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp @@ -71,7 +71,7 @@ public: { DoCast(me->getVictim(), SPELL_KNOCKAWAY); KnockAway_Timer = 15000; - } + } else KnockAway_Timer -= diff; //Trample_Timer @@ -79,7 +79,7 @@ public: { DoCast(me, SPELL_TRAMPLE); Trample_Timer = 8000; - } + } else Trample_Timer -= diff; //Landslide @@ -90,7 +90,7 @@ public: me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_LANDSLIDE); Landslide_Timer = 60000; - } + } else Landslide_Timer -= diff; } diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp index 0e3ee5dc52b..18ce7be0f0a 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp @@ -80,7 +80,7 @@ public: me->SetDisplayId(11172); Invisible = false; //me->m_canMove = true; - } + } else if (Invisible) { Invisible_Timer -= diff; @@ -97,7 +97,7 @@ public: { DoCast(me->getVictim(), SPELL_TOXICVOLLEY); ToxicVolley_Timer = 9000; - } + } else ToxicVolley_Timer -= diff; //Uppercut_Timer @@ -105,7 +105,7 @@ public: { DoCast(me->getVictim(), SPELL_UPPERCUT); Uppercut_Timer = 12000; - } + } else Uppercut_Timer -= diff; //Adds_Timer @@ -127,7 +127,7 @@ public: Invisible_Timer = 15000; Adds_Timer = 40000; - } + } else Adds_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp index bade5655f36..039d30071d2 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp @@ -77,7 +77,7 @@ public: { DoCast(me, SPELL_DUSTFIELD); Dustfield_Timer = 14000; - } + } else Dustfield_Timer -= diff; //Boulder_Timer @@ -88,7 +88,7 @@ public: if (target) DoCast(target, SPELL_BOULDER); Boulder_Timer = 10000; - } + } else Boulder_Timer -= diff; //RepulsiveGaze_Timer @@ -96,7 +96,7 @@ public: { DoCast(me->getVictim(), SPELL_REPULSIVEGAZE); RepulsiveGaze_Timer = 20000; - } + } else RepulsiveGaze_Timer -= diff; //Thrash_Timer @@ -104,7 +104,7 @@ public: { DoCast(me, SPELL_THRASH); Thrash_Timer = 18000; - } + } else Thrash_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index dd90eaa0e7f..61fe526407c 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -44,8 +44,8 @@ enum blyAndCrewFactions enum blySays { - SAY_1 = -1209002, - SAY_2 = -1209003 + SAY_1 = 0, + SAY_2 = 1 }; enum blySpells @@ -133,11 +133,11 @@ public: //weegli doesn't fight - he goes & blows up the door if (Creature* pWeegli = instance->instance->GetCreature(instance->GetData64(ENTRY_WEEGLI))) pWeegli->AI()->DoAction(0); - DoScriptText(SAY_1, me); + Talk(SAY_1); Text_Timer = 5000; break; case 2: - DoScriptText(SAY_2, me); + Talk(SAY_2); Text_Timer = 5000; break; case 3: diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp index 421a1d7b38a..49a9be21a98 100644 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ b/src/server/scripts/Kalimdor/desolace.cpp @@ -175,7 +175,7 @@ public: ## Hand of Iruxos ######*/ -enum +enum { QUEST_HAND_IRUXOS = 5381, NPC_DEMON_SPIRIT = 11876, diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index d5695a0f39d..19ed96e8885 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -62,7 +62,7 @@ class OrientationCheck : public std::unary_function<Unit*, bool> explicit OrientationCheck(Unit* _caster) : caster(_caster) { } bool operator() (Unit* unit) { - return !unit->isInFront(caster, 40.0f, 2.5f); + return !unit->isInFront(caster, 2.5f) || !unit->IsWithinDist(caster, 40.0f); } private: diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp index 0f9495d4928..64609efd7ff 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp @@ -27,7 +27,7 @@ enum Yells SAY_PHASE2 = -1658005, SAY_PHASE3 = -1658006, - SAY_TYRANNUS_DEATH = -1659007, + SAY_TYRANNUS_DEATH = -1658007, }; enum Spells diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index b2ee0572247..fbed870eb19 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -501,13 +501,6 @@ class boss_the_lich_king : public CreatureScript DoCastAOE(SPELL_PLAY_MOVIE, false); me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03); - float x, y, z; - me->GetPosition(x, y, z); - // use larger distance for vmap height search than in most other cases - float ground_Z = me->GetMap()->GetHeight(me->GetPhaseMask(), x, y, z, true, MAX_FALL_DISTANCE); - if (fabs(ground_Z - z) < 0.1f) - return; - me->GetMotionMaster()->MoveFall(); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp index 0266db5f26b..af8aba57a6d 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp @@ -84,7 +84,7 @@ class at_frozen_throne_teleport : public AreaTriggerScript Spell::SendCastResult(player, spell, 0, SPELL_FAILED_AFFECTING_COMBAT); return true; } - + if (InstanceScript* instance = player->GetInstanceScript()) if (instance->GetBossState(DATA_PROFESSOR_PUTRICIDE) == DONE && instance->GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == DONE && diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index 7977fa4df8a..e64099da3ac 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -15,7 +15,10 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" + #include "naxxramas.h" //Stalagg @@ -87,7 +90,9 @@ enum ThaddiusSpells SPELL_POSITIVE_CHARGE = 28062, SPELL_POSITIVE_CHARGE_STACK = 29659, SPELL_NEGATIVE_CHARGE = 28085, - SPELL_NEGATIVE_CHARGE_STACK = 29660 + SPELL_NEGATIVE_CHARGE_STACK = 29660, + SPELL_POSITIVE_POLARITY = 28059, + SPELL_NEGATIVE_POLARITY = 28084, }; enum Events @@ -503,6 +508,41 @@ class spell_thaddius_pos_neg_charge : public SpellScriptLoader } }; +class spell_thaddius_polarity_shift : public SpellScriptLoader +{ + public: + spell_thaddius_polarity_shift() : SpellScriptLoader("spell_thaddius_polarity_shift") { } + + class spell_thaddius_polarity_shift_SpellScript : public SpellScript + { + PrepareSpellScript(spell_thaddius_polarity_shift_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_POLARITY) || !sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_POLARITY)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + target->CastSpell(target, roll_chance_i(50) ? SPELL_POSITIVE_POLARITY : SPELL_NEGATIVE_POLARITY, true, NULL, NULL, caster->GetGUID()); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_thaddius_polarity_shift_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_thaddius_polarity_shift_SpellScript(); + } +}; + class achievement_polarity_switch : public AchievementCriteriaScript { public: @@ -520,5 +560,6 @@ void AddSC_boss_thaddius() new mob_stalagg(); new mob_feugen(); new spell_thaddius_pos_neg_charge(); + new spell_thaddius_polarity_shift(); new achievement_polarity_switch(); } diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 6dfa62df2d1..437d9980af3 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -31,7 +31,6 @@ Script Data End */ #include "eye_of_eternity.h" #include "ScriptedEscortAI.h" -// not implemented enum Achievements { ACHIEV_TIMED_START_EVENT = 20387, @@ -242,6 +241,9 @@ public: _cannotMove = true; me->SetFlying(true); + + if (instance) + instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } uint32 GetData(uint32 data) @@ -359,7 +361,10 @@ public: Talk(SAY_AGGRO_P_ONE); - DoCast(SPELL_BERSEKER); + DoCast(SPELL_BERSEKER); // periodic aura, first tick in 10 minutes + + if (instance) + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } void KilledUnit(Unit* who) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index aef959aad70..9671d59bcec 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -289,7 +289,7 @@ public: void JustDied(Unit* /*killer*/) { _JustDied(); - DoCast(me, SPELL_DEATH_SPELL, true); // we cast the spell as triggered or the summon effect does not occur + DoCast(me, SPELL_DEATH_SPELL, true); // we cast the spell as triggered or the summon effect does not occur } void LeaveCombat() diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index c687aad8bd2..11433bfde37 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -201,7 +201,7 @@ public: Talk(SAY_UROM); me->DespawnOrUnsummon(60000); } - } + } }; CreatureAI* GetAI(Creature* creature) const diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 2bc2284a246..c4f973726bc 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -34,6 +34,7 @@ #include "Vehicle.h" #include "VehicleDefines.h" #include "ulduar.h" +#include "Spell.h" enum Spells { @@ -1669,7 +1670,7 @@ class spell_pursue : public SpellScriptLoader if (Creature* caster = GetCaster()->ToCreature()) caster->AI()->EnterEvadeMode(); } - else + else { //! In the end, only one target should be selected _target = SelectRandomContainerElement(targets); @@ -1718,6 +1719,71 @@ class spell_pursue : public SpellScriptLoader } }; +class spell_vehicle_throw_passenger : public SpellScriptLoader +{ + public: + spell_vehicle_throw_passenger() : SpellScriptLoader("spell_vehicle_throw_passenger") {} + + class spell_vehicle_throw_passenger_SpellScript : public SpellScript + { + PrepareSpellScript(spell_vehicle_throw_passenger_SpellScript); + void HandleScript(SpellEffIndex effIndex) + { + Spell* baseSpell = GetSpell(); + SpellCastTargets targets = baseSpell->m_targets; + int32 damage = GetEffectValue(); + if (targets.HasTraj()) + if (Vehicle* vehicle = GetCaster()->GetVehicleKit()) + if (Unit* passenger = vehicle->GetPassenger(damage - 1)) + { + // use 99 because it is 3d search + std::list<WorldObject*> targetList; + Trinity::WorldObjectSpellAreaTargetCheck check(99, GetTargetDest(), GetCaster(), GetCaster(), GetSpellInfo(), TARGET_CHECK_DEFAULT, NULL); + Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellAreaTargetCheck> searcher(GetCaster(), targetList, check); + GetCaster()->GetMap()->VisitAll(GetCaster()->m_positionX, GetCaster()->m_positionY, 99, searcher); + float minDist = 99 * 99; + Unit* target = NULL; + for (std::list<WorldObject*>::iterator itr = targetList.begin(); itr != targetList.end(); ++itr) + { + if (Unit* unit = (*itr)->ToUnit()) + if (unit->GetEntry() == NPC_SEAT) + if (Vehicle* seat = unit->GetVehicleKit()) + if (!seat->GetPassenger(0)) + if (Unit* device = seat->GetPassenger(2)) + if (!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) + { + float dist = unit->GetExactDistSq(targets.GetDst()); + if (dist < minDist) + { + minDist = dist; + target = unit; + } + } + } + if (target && target->IsWithinDist2d(targets.GetDst(), GetSpellInfo()->Effects[effIndex].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct + passenger->EnterVehicle(target, 0); + else + { + passenger->ExitVehicle(); + float x, y, z; + targets.GetDst()->GetPosition(x, y, z); + passenger->GetMotionMaster()->MoveJump(x, y, z, targets.GetSpeedXY(), targets.GetSpeedZ()); + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_vehicle_throw_passenger_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_vehicle_throw_passenger_SpellScript(); + } +}; + void AddSC_boss_flame_leviathan() { new boss_flame_leviathan(); @@ -1752,4 +1818,5 @@ void AddSC_boss_flame_leviathan() new spell_auto_repair(); new spell_systems_shutdown(); new spell_pursue(); + new spell_vehicle_throw_passenger(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 12d953a07b4..159e2a9702b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -593,7 +593,7 @@ class boss_freya : public CreatureScript void JustDied(Unit* /*who*/) { //! Freya's chest is dynamically spawned on death by different spells. - const uint32 summonSpell[2][4] = + const uint32 summonSpell[2][4] = { /* 0Elder, 1Elder, 2Elder, 3Elder */ /* 10N */ {62950, 62953, 62955, 62957}, diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index a156e6ef08b..d5034e4827e 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -485,6 +485,8 @@ class spell_ulduar_squeezed_lifeless : public SpellScriptLoader if (!GetHitPlayer() || !GetHitPlayer()->GetVehicle()) return; + //! Proper exit position does not work currently, + //! See documentation in void Unit::ExitVehicle(Position const* exitPosition) Position pos; pos.m_positionX = 1756.25f + irand(-3, 3); pos.m_positionY = -8.3f + irand(-3, 3); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp index 8a6d7f80818..93cc94923db 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp @@ -18,7 +18,7 @@ /* ScriptData SDName: Boss_Prince_Keleseth SD%Complete: 100 -SDComment: +SDComment: SDCategory: Utgarde Keep EndScriptData */ @@ -158,7 +158,7 @@ public: { if (data == DATA_ON_THE_ROCKS) return onTheRocks; - + return 0; } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 989e1e57453..915ead98bb7 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -34,7 +34,7 @@ enum Spells SPELL_RITUAL_DISARM = 54159, SPELL_RITUAL_STRIKE_EFF_1 = 48277, SPELL_RITUAL_STRIKE_EFF_2 = 59930, - + SPELL_SUMMONED_VIS = 64446, SPELL_RITUAL_CHANNELER_1 = 48271, SPELL_RITUAL_CHANNELER_2 = 48274, @@ -62,7 +62,7 @@ enum Yells SAY_SLAY = 3, SAY_DEATH = 4, SAY_SACRIFICE_PLAYER = 5, - + // Image of Arthas SAY_DIALOG_OF_ARTHAS_1 = 0, SAY_DIALOG_OF_ARTHAS_2 = 1 @@ -101,7 +101,7 @@ enum SvalaPoint #define DATA_INCREDIBLE_HULK 2043 -static const float spectatorWP[2][3] = +static const float spectatorWP[2][3] = { {296.95f,-312.76f,86.36f}, {297.69f,-275.81f,86.36f} @@ -133,7 +133,7 @@ public: InstanceScript* instance; SummonList summons; SvalaPhase Phase; - + Position pos; float x, y, z; @@ -157,7 +157,7 @@ public: summons.DespawnAll(); me->RemoveAllAuras(); - + if (Phase > INTRO) { me->SetFlying(true); @@ -177,7 +177,7 @@ public: instance->SetData64(DATA_SACRIFICED_PLAYER, 0); } } - + void JustReachedHome() { if (Phase > INTRO) @@ -188,23 +188,23 @@ public: me->SendMovementFlagUpdate(); } } - + void EnterCombat(Unit* /*who*/) { Talk(SAY_AGGRO); - + sinsterStrikeTimer = 7 * IN_MILLISECONDS; callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS); if (instance) instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, IN_PROGRESS); } - + void JustSummoned(Creature* summon) { if (summon->GetEntry() == CREATURE_RITUAL_CHANNELER) summon->CastSpell(summon, SPELL_SUMMONED_VIS, true); - + summons.Summon(summon); } @@ -222,7 +222,7 @@ public: { Phase = INTRO; me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - + if (GameObject* mirror = GetClosestGameObjectWithEntry(me, OBJECT_UTGARDE_MIRROR, 100.0f)) mirror->SetGoState(GO_STATE_READY); @@ -233,13 +233,13 @@ public: } } } - + void KilledUnit(Unit* victim) { if (victim != me) Talk(SAY_SLAY); } - + void DamageTaken(Unit* attacker, uint32 &damage) { if (Phase == SVALADEAD) @@ -532,7 +532,7 @@ public: if (IsHeroic()) DoCast(me, SPELL_SHADOWS_IN_THE_DARK); } - + void UpdateAI(const uint32 diff) { if (me->HasUnitState(UNIT_STATE_CASTING)) @@ -648,7 +648,7 @@ class npc_scourge_hulk : public CreatureScript { return type == DATA_INCREDIBLE_HULK ? killedByRitualStrike : 0; } - + void DamageTaken(Unit* attacker, uint32 &damage) { if (damage >= me->GetHealth() && attacker->GetEntry() == CREATURE_SVALA_SORROWGRAVE) diff --git a/src/server/scripts/Northrend/dalaran.cpp b/src/server/scripts/Northrend/dalaran.cpp index cd3cbf29d0d..258d038ee4b 100644 --- a/src/server/scripts/Northrend/dalaran.cpp +++ b/src/server/scripts/Northrend/dalaran.cpp @@ -75,7 +75,7 @@ public: return; Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself(); - + if (!player || player->isGameMaster() || player->IsBeingTeleported() || // If player has Disguise aura for quest A Meeting With The Magister or An Audience With The Arcanist, do not teleport it away but let it pass player->HasAura(SPELL_SUNREAVER_DISGUISE_FEMALE) || player->HasAura(SPELL_SUNREAVER_DISGUISE_MALE) || diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index 79e8da6fd77..36dc6177f64 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -676,7 +676,7 @@ enum MiscLifewarden NPC_SERVANT = 28320, // Servant of Freya WHISPER_ACTIVATE = 0, - + SPELL_FREYA_DUMMY = 51318, SPELL_LIFEFORCE = 51395, SPELL_FREYA_DUMMY_TRIGGER = 51335, diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index 218c5a122f1..05fad24f35e 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -23,7 +23,10 @@ SDComment: SDCategory: Tempest Keep, The Eye EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" + #include "the_eye.h" enum eEnums @@ -40,6 +43,7 @@ enum eEnums SPELL_ARCANE_MISSILES = 33031, SPELL_WRATH_OF_THE_ASTROMANCER = 42783, + SPELL_WRATH_OF_THE_ASTROMANCER_DOT = 42784, SPELL_BLINDING_LIGHT = 33009, SPELL_FEAR = 34322, SPELL_VOID_BOLT = 39329, @@ -491,9 +495,74 @@ class mob_solarium_priest : public CreatureScript return new mob_solarium_priestAI (Creature); } }; + +class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader +{ + public: + spell_astromancer_wrath_of_the_astromancer() : SpellScriptLoader("spell_astromancer_wrath_of_the_astromancer") { } + + class spell_astromancer_wrath_of_the_astromancer_SpellScript : public SpellScript + { + PrepareSpellScript(spell_astromancer_wrath_of_the_astromancer_SpellScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WRATH_OF_THE_ASTROMANCER_DOT)) + return false; + return true; + } + + bool Load() + { + _targetCount = 0; + return true; + } + + void CountTargets(std::list<Unit*>& targetList) + { + _targetCount = targetList.size(); + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + if (Unit* caster = GetOriginalCaster()) + if (Unit* target = GetHitUnit()) + { + if (!target->isAlive() || !_targetCount) + return; + + int32 damage = 10000 / _targetCount; + + SpellNonMeleeDamage damageInfo(caster, target, GetSpellInfo()->Id, GetSpellInfo()->SchoolMask); + damageInfo.damage = damage; + + caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &damageInfo.absorb, &damageInfo.resist, GetSpellInfo()); + caster->DealDamageMods(target, damageInfo.damage, &damageInfo.absorb); + caster->SendSpellNonMeleeDamageLog(&damageInfo); + caster->DealSpellDamage(&damageInfo, false); + } + } + + private: + int32 _targetCount; + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnUnitTargetSelect += SpellUnitTargetFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::CountTargets, EFFECT_0, TARGET_DEST_CASTER_RADIUS); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_astromancer_wrath_of_the_astromancer_SpellScript(); + } +}; + void AddSC_boss_high_astromancer_solarian() { new boss_high_astromancer_solarian(); new mob_solarium_priest(); + new spell_astromancer_wrath_of_the_astromancer(); } diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp index ed818fb13be..3579a7d697b 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp @@ -22,20 +22,22 @@ enum Spells { - SPELL_POSITIVE_CHARGE = 39090, + SPELL_POSITIVE_POLARITY = 39088, SPELL_POSITIVE_CHARGE_STACK = 39089, + SPELL_POSITIVE_CHARGE = 39090, + SPELL_NEGATIVE_POLARITY = 39091, + SPELL_NEGATIVE_CHARGE_STACK = 39092, SPELL_NEGATIVE_CHARGE = 39093, - SPELL_NEGATIVE_CHARGE_STACK = 39092 }; -class spell_capacitus_polarity_shift : public SpellScriptLoader +class spell_capacitus_polarity_charge : public SpellScriptLoader { public: - spell_capacitus_polarity_shift() : SpellScriptLoader("spell_capacitus_polarity_shift") { } + spell_capacitus_polarity_charge() : SpellScriptLoader("spell_capacitus_polarity_charge") { } - class spell_capacitus_polarity_shift_SpellScript : public SpellScript + class spell_capacitus_polarity_charge_SpellScript : public SpellScript { - PrepareSpellScript(spell_capacitus_polarity_shift_SpellScript); + PrepareSpellScript(spell_capacitus_polarity_charge_SpellScript); bool Validate(SpellInfo const* /*spell*/) { @@ -85,8 +87,44 @@ class spell_capacitus_polarity_shift : public SpellScriptLoader void Register() { - OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_shift_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); - OnUnitTargetSelect += SpellUnitTargetFn(spell_capacitus_polarity_shift_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_charge_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + OnUnitTargetSelect += SpellUnitTargetFn(spell_capacitus_polarity_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_capacitus_polarity_charge_SpellScript(); + } +}; + +class spell_capacitus_polarity_shift : public SpellScriptLoader +{ + public: + spell_capacitus_polarity_shift() : SpellScriptLoader("spell_capacitus_polarity_shift") { } + + class spell_capacitus_polarity_shift_SpellScript : public SpellScript + { + PrepareSpellScript(spell_capacitus_polarity_shift_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_POLARITY) || !sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_POLARITY)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* target = GetHitUnit(); + Unit* caster = GetCaster(); + + target->CastSpell(target, roll_chance_i(50) ? SPELL_POSITIVE_POLARITY : SPELL_NEGATIVE_POLARITY, true, NULL, NULL, caster->GetGUID()); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_shift_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -98,5 +136,6 @@ class spell_capacitus_polarity_shift : public SpellScriptLoader void AddSC_boss_mechano_lord_capacitus() { + new spell_capacitus_polarity_charge(); new spell_capacitus_polarity_shift(); } diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index c9fdd0f65ff..f99851f013e 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -977,7 +977,7 @@ class npc_simon_bunny : public CreatureScript uint32 rewSpell = 0; switch (level) { - case 6: + case 6: if (large) GivePunishment(); else diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 5c0f6bcce59..eb42b377128 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -21,8 +21,9 @@ * Scriptnames of files in this file should be prefixed with "spell_dk_". */ -#include "ScriptPCH.h" -#include "Spell.h" +#include "ScriptMgr.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" enum DeathKnightSpells { @@ -103,7 +104,9 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - return sSpellMgr->GetSpellInfo(DK_SPELL_RUNIC_POWER_ENERGIZE); + if (!sSpellMgr->GetSpellInfo(DK_SPELL_RUNIC_POWER_ENERGIZE)) + return false; + return true; } void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) @@ -160,17 +163,16 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - return sSpellMgr->GetSpellInfo(DK_SPELL_ANTI_MAGIC_SHELL_TALENT); + if (!sSpellMgr->GetSpellInfo(DK_SPELL_ANTI_MAGIC_SHELL_TALENT)) + return false; + return true; } void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { SpellInfo const* talentSpell = sSpellMgr->GetSpellInfo(DK_SPELL_ANTI_MAGIC_SHELL_TALENT); amount = talentSpell->Effects[EFFECT_0].CalcValue(GetCaster()); - Unit* caster = GetCaster(); - if (!caster) - return; - if (Player* player = caster->ToPlayer()) + if (Player* player = GetCaster()->ToPlayer()) amount += int32(2 * player->GetTotalAttackPowerValue(BASE_ATTACK)); } @@ -204,9 +206,7 @@ class spell_dk_corpse_explosion : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED)) - return false; - if (!sSpellMgr->GetSpellInfo(DK_SPELL_GHOUL_EXPLODE)) + if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED) || !sSpellMgr->GetSpellInfo(DK_SPELL_GHOUL_EXPLODE)) return false; if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_VISUAL)) return false; @@ -257,6 +257,13 @@ class spell_dk_ghoul_explode : public SpellScriptLoader { PrepareSpellScript(spell_dk_ghoul_explode_SpellScript); + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED)) + return false; + return true; + } + void Suicide(SpellEffIndex /*effIndex*/) { if (Unit* unitTarget = GetHitUnit()) @@ -301,9 +308,8 @@ class spell_dk_death_gate : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - if (!GetHitUnit()) - return; - GetHitUnit()->CastSpell(GetHitUnit(), GetEffectValue(), false); + if (Unit* target = GetHitUnit()) + target->CastSpell(target, GetEffectValue(), false); } void Register() @@ -567,12 +573,11 @@ public: class spell_dk_improved_blood_presence_AuraScript : public AuraScript { - PrepareAuraScript(spell_dk_improved_blood_presence_AuraScript) + PrepareAuraScript(spell_dk_improved_blood_presence_AuraScript); + bool Validate(SpellInfo const* /*entry*/) { - if (!sSpellMgr->GetSpellInfo(DK_SPELL_BLOOD_PRESENCE)) - return false; - if (!sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(DK_SPELL_BLOOD_PRESENCE) || !sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) return false; return true; } @@ -615,12 +620,11 @@ public: class spell_dk_improved_unholy_presence_AuraScript : public AuraScript { - PrepareAuraScript(spell_dk_improved_unholy_presence_AuraScript) + PrepareAuraScript(spell_dk_improved_unholy_presence_AuraScript); + bool Validate(SpellInfo const* /*entry*/) { - if (!sSpellMgr->GetSpellInfo(DK_SPELL_UNHOLY_PRESENCE)) - return false; - if (!sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(DK_SPELL_UNHOLY_PRESENCE) || !sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) return false; return true; } @@ -656,6 +660,141 @@ public: } }; +enum DeathStrike +{ + ICON_ID_IMPROVED_DEATH_STRIKE = 2751, + SPELL_DEATH_STRIKE_HEAL = 45470, +}; + +class spell_dk_death_strike : public SpellScriptLoader +{ + public: + spell_dk_death_strike() : SpellScriptLoader("spell_dk_death_strike") { } + + class spell_dk_death_strike_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dk_death_strike_SpellScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_STRIKE_HEAL)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + { + uint32 count = target->GetDiseasesByCaster(caster->GetGUID()); + int32 bp = int32(count * caster->CountPctFromMaxHealth(int32(GetSpellInfo()->Effects[EFFECT_0].DamageMultiplier))); + // Improved Death Strike + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, ICON_ID_IMPROVED_DEATH_STRIKE, 0)) + AddPctN(bp, caster->CalculateSpellDamage(caster, aurEff->GetSpellInfo(), 2)); + caster->CastCustomSpell(caster, SPELL_DEATH_STRIKE_HEAL, &bp, NULL, NULL, false); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_dk_death_strike_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY); + } + + }; + + SpellScript* GetSpellScript() const + { + return new spell_dk_death_strike_SpellScript(); + } +}; + +enum DeathCoil +{ + SPELL_DEATH_COIL_DAMAGE = 47632, + SPELL_DEATH_COIL_HEAL = 47633, +}; + +class spell_dk_death_coil : public SpellScriptLoader +{ + public: + spell_dk_death_coil() : SpellScriptLoader("spell_dk_death_coil") { } + + class spell_dk_death_coil_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dk_death_coil_SpellScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_DAMAGE) || !sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_HEAL)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + int32 damage = GetEffectValue(); + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + { + if (caster->IsFriendlyTo(target)) + { + int32 bp = int32(damage * 1.5f); + caster->CastCustomSpell(target, SPELL_DEATH_COIL_HEAL, &bp, NULL, NULL, true); + } + else + caster->CastCustomSpell(target, SPELL_DEATH_COIL_DAMAGE, &damage, NULL, NULL, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_dk_death_coil_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + + }; + + SpellScript* GetSpellScript() const + { + return new spell_dk_death_coil_SpellScript(); + } +}; + +class spell_dk_death_grip : public SpellScriptLoader +{ + public: + spell_dk_death_grip() : SpellScriptLoader("spell_dk_death_grip") { } + + class spell_dk_death_grip_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dk_death_grip_SpellScript); + + void HandleDummy(SpellEffIndex effIndex) + { + int32 damage = GetEffectValue(); + Position pos; + if (Unit* target = GetHitUnit()) + { + GetSummonPosition(effIndex, pos, 0.0f, 0); + + if (!target->HasAuraType(SPELL_AURA_DEFLECT_SPELLS)) // Deterrence + target->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), damage, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_dk_death_grip_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + + }; + + SpellScript* GetSpellScript() const + { + return new spell_dk_death_grip_SpellScript(); + } +}; + void AddSC_deathknight_spell_scripts() { new spell_dk_anti_magic_shell_raid(); @@ -671,4 +810,7 @@ void AddSC_deathknight_spell_scripts() new spell_dk_will_of_the_necropolis(); new spell_dk_improved_blood_presence(); new spell_dk_improved_unholy_presence(); + new spell_dk_death_strike(); + new spell_dk_death_coil(); + new spell_dk_death_grip(); } diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 130f61565f7..4c440f18bd9 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -21,7 +21,8 @@ * Scriptnames of files in this file should be prefixed with "spell_dru_". */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "SpellScript.h" #include "SpellAuraEffects.h" enum DruidSpells @@ -42,9 +43,7 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(DRUID_INCREASED_MOONFIRE_DURATION)) - return false; - if (!sSpellMgr->GetSpellInfo(DRUID_NATURES_SPLENDOR)) + if (!sSpellMgr->GetSpellInfo(DRUID_INCREASED_MOONFIRE_DURATION) || !sSpellMgr->GetSpellInfo(DRUID_NATURES_SPLENDOR)) return false; return true; } @@ -305,14 +304,16 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader { PrepareAuraScript(spell_dru_swift_flight_passive_AuraScript); - void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) + bool Load() { - Unit* caster = GetCaster(); - if (!caster || !caster->ToPlayer()) - return; + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - if (caster->ToPlayer()->Has310Flyer(false)) - amount = 310; + void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) + { + if (Player* caster = GetCaster()->ToPlayer()) + if (caster->Has310Flyer(false)) + amount = 310; } void Register() @@ -327,6 +328,45 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader } }; +class spell_dru_starfall_dummy : public SpellScriptLoader +{ + public: + spell_dru_starfall_dummy() : SpellScriptLoader("spell_dru_starfall_dummy") { } + + class spell_dru_starfall_dummy_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dru_starfall_dummy_SpellScript); + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + // Shapeshifting into an animal form or mounting cancels the effect + if (caster->GetCreatureType() == CREATURE_TYPE_BEAST || caster->IsMounted()) + { + if (SpellInfo const* spellInfo = GetTriggeringSpell()) + caster->RemoveAurasDueToSpell(spellInfo->Id); + return; + } + + //Any effect which causes you to lose control of your character will supress the starfall effect. + if (caster->HasUnitState(UNIT_STATE_CONTROLLED)) + return; + + caster->CastSpell(GetHitUnit(), GetEffectValue(), true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_dru_starfall_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_dru_starfall_dummy_SpellScript(); + } +}; + void AddSC_druid_spell_scripts() { new spell_dru_glyph_of_starfire(); @@ -336,4 +376,5 @@ void AddSC_druid_spell_scripts() new spell_dru_t10_restoration_4p_bonus(); new spell_dru_starfall_aoe(); new spell_dru_swift_flight_passive(); + new spell_dru_starfall_dummy(); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 4529e7b049d..886384a1c68 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -22,10 +22,15 @@ * Scriptnames of files in this file should be prefixed with "spell_gen_" */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "SpellScript.h" #include "SpellAuraEffects.h" #include "SkillDiscovery.h" +#include "Cell.h" +#include "CellImpl.h" #include "GridNotifiers.h" +#include "GridNotifiersImpl.h" +#include "InstanceScript.h" #include "Group.h" #include "LFGMgr.h" @@ -191,7 +196,7 @@ class spell_gen_cannibalize : public SpellScriptLoader float max_range = GetSpellInfo()->GetMaxRange(false); WorldObject* result = NULL; // search for nearby enemy corpse in range - Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_SELECT_CHECK_ENEMY); + Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY); Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check); caster->GetMap()->VisitFirstFound(caster->m_positionX, caster->m_positionY, max_range, searcher); if (!result) @@ -236,9 +241,7 @@ class spell_gen_parachute : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF)) + if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) || !sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF)) return false; return true; } @@ -246,13 +249,11 @@ class spell_gen_parachute : public SpellScriptLoader void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) { if (Player* target = GetTarget()->ToPlayer()) - { if (target->IsFalling()) { target->RemoveAurasDueToSpell(SPELL_PARACHUTE); target->CastSpell(target, SPELL_PARACHUTE_BUFF, true); } - } } void Register() @@ -283,13 +284,14 @@ class spell_gen_pet_summoned : public SpellScriptLoader { PrepareSpellScript(spell_gen_pet_summoned_SpellScript); - void HandleScript(SpellEffIndex /*effIndex*/) + bool Load() { - Unit* caster = GetCaster(); - if (caster->GetTypeId() != TYPEID_PLAYER) - return; + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - Player* player = caster->ToPlayer(); + void HandleScript(SpellEffIndex /*effIndex*/) + { + Player* player = GetCaster()->ToPlayer(); if (player->GetLastPetNumber()) { PetType newPetType = (player->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET; @@ -340,10 +342,14 @@ class spell_gen_remove_flight_auras : public SpellScriptLoader class spell_gen_remove_flight_auras_SpellScript : public SpellScript { PrepareSpellScript(spell_gen_remove_flight_auras_SpellScript); + void HandleScript(SpellEffIndex /*effIndex*/) { - GetHitUnit()->RemoveAurasByType(SPELL_AURA_FLY); - GetHitUnit()->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); + if (Unit* target = GetHitUnit()) + { + target->RemoveAurasByType(SPELL_AURA_FLY); + target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); + } } void Register() @@ -376,22 +382,21 @@ class spell_gen_leeching_swarm : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_DMG)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_HEAL)) + if (!sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_DMG) || !sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_HEAL)) return false; return true; } void HandleEffectPeriodic(AuraEffect const* aurEff) { - if (Unit* caster = GetCaster()) + Unit* caster = GetCaster(); + if (Unit* target = GetTarget()) { - int32 lifeLeeched = GetTarget()->CountPctFromCurHealth(aurEff->GetAmount()); + int32 lifeLeeched = target->CountPctFromCurHealth(aurEff->GetAmount()); if (lifeLeeched < 250) lifeLeeched = 250; // Damage - caster->CastCustomSpell(GetTarget(), SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false); + caster->CastCustomSpell(target, SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false); // Heal caster->CastCustomSpell(caster, SPELL_LEECHING_SWARM_HEAL, &lifeLeeched, 0, 0, false); } @@ -500,31 +505,16 @@ class spell_gen_trick : public SpellScriptLoader PrepareSpellScript(spell_gen_trick_SpellScript); bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_FEMALE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_MALE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_FEMALE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SKELETON_COSTUME)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_MALE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_FEMALE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_TRICK_BUFF)) + if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE) + || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_FEMALE) + || !sSpellMgr->GetSpellInfo(SPELL_SKELETON_COSTUME) || !sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_TRICK_BUFF)) return false; return true; } void HandleScript(SpellEffIndex /*effIndex*/) { + Unit* caster = GetCaster(); if (Player* target = GetHitPlayer()) { uint8 gender = target->getGender(); @@ -550,7 +540,7 @@ class spell_gen_trick : public SpellScriptLoader break; } - GetCaster()->CastSpell(target, spellId, true, NULL); + caster->CastSpell(target, spellId, true, NULL); } } @@ -585,21 +575,18 @@ class spell_gen_trick_or_treat : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_TRICK)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_TREAT)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_TRICKED_OR_TREATED)) + if (!sSpellMgr->GetSpellInfo(SPELL_TRICK) || !sSpellMgr->GetSpellInfo(SPELL_TREAT) || !sSpellMgr->GetSpellInfo(SPELL_TRICKED_OR_TREATED)) return false; return true; } void HandleScript(SpellEffIndex /*effIndex*/) { + Unit* caster = GetCaster(); if (Player* target = GetHitPlayer()) { - GetCaster()->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL); - GetCaster()->CastSpell(target, SPELL_TRICKED_OR_TREATED, true, NULL); + caster->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL); + caster->CastSpell(target, SPELL_TRICKED_OR_TREATED, true, NULL); } } @@ -661,11 +648,14 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader { PrepareSpellScript(spell_pvp_trinket_wotf_shared_cd_SpellScript); + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF)) + if (!sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER) || !sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF)) return false; return true; } @@ -673,10 +663,7 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader void HandleScript(SpellEffIndex /*effIndex*/) { Player* caster = GetCaster()->ToPlayer(); - if (!caster) - return; SpellInfo const* spellInfo = GetSpellInfo(); - caster->AddSpellCooldown(spellInfo->Id, 0, time(NULL) + sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)->GetRecoveryTime() / IN_MILLISECONDS); WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4); data << uint64(caster->GetGUID()); @@ -729,8 +716,9 @@ class spell_gen_animal_blood : public SpellScriptLoader void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (GetUnitOwner()->IsInWater()) - GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SPAWN_BLOOD_POOL, true); + if (Unit* owner = GetUnitOwner()) + if (owner->IsInWater()) + owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true); } void Register() @@ -761,6 +749,11 @@ class spell_gen_divine_storm_cd_reset : public SpellScriptLoader { PrepareSpellScript(spell_gen_divine_storm_cd_reset_SpellScript); + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + bool Validate(SpellInfo const* /*spellEntry*/) { if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM)) @@ -770,9 +763,9 @@ class spell_gen_divine_storm_cd_reset : public SpellScriptLoader void HandleScript(SpellEffIndex /*effIndex*/) { - if (Player* caster = GetCaster()->ToPlayer()) - if (caster->HasSpellCooldown(SPELL_DIVINE_STORM)) - caster->RemoveSpellCooldown(SPELL_DIVINE_STORM, true); + Player* caster = GetCaster()->ToPlayer(); + if (caster->HasSpellCooldown(SPELL_DIVINE_STORM)) + caster->RemoveSpellCooldown(SPELL_DIVINE_STORM, true); } void Register() @@ -796,13 +789,15 @@ class spell_gen_gunship_portal : public SpellScriptLoader { PrepareSpellScript(spell_gen_gunship_portal_SpellScript); - void HandleScript(SpellEffIndex /*effIndex*/) + bool Load() { - Unit* caster = GetCaster(); - if (caster->GetTypeId() != TYPEID_PLAYER) - return; + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - if (Battleground* bg = caster->ToPlayer()->GetBattleground()) + void HandleScript(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + if (Battleground* bg = caster->GetBattleground()) if (bg->GetTypeID(true) == BATTLEGROUND_IC) bg->DoAction(1, caster->GetGUID()); } @@ -821,7 +816,7 @@ class spell_gen_gunship_portal : public SpellScriptLoader enum parachuteIC { - SPELL_PARACHUTE_IC = 66657 + SPELL_PARACHUTE_IC = 66657, }; class spell_gen_parachute_ic : public SpellScriptLoader @@ -835,13 +830,9 @@ class spell_gen_parachute_ic : public SpellScriptLoader void HandleTriggerSpell(AuraEffect const* /*aurEff*/) { - Unit* target = GetTarget(); - - if (!target->ToPlayer()) - return; - - if (target->ToPlayer()->m_movementInfo.fallTime > 2000) - target->CastSpell(target, SPELL_PARACHUTE_IC, true); + if (Player* target = GetTarget()->ToPlayer()) + if (target->m_movementInfo.fallTime > 2000) + target->CastSpell(target, SPELL_PARACHUTE_IC, true); } void Register() @@ -868,7 +859,7 @@ class spell_gen_dungeon_credit : public SpellScriptLoader bool Load() { _handled = false; - return true; + return GetCaster()->GetTypeId() == TYPEID_UNIT; } void CreditEncounter() @@ -878,9 +869,9 @@ class spell_gen_dungeon_credit : public SpellScriptLoader return; _handled = true; - if (GetCaster()->GetTypeId() == TYPEID_UNIT) - if (InstanceScript* instance = GetCaster()->GetInstanceScript()) - instance->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, GetSpellInfo()->Id, GetCaster()); + Unit* caster = GetCaster(); + if (InstanceScript* instance = caster->GetInstanceScript()) + instance->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, GetSpellInfo()->Id, caster); } void Register() @@ -906,9 +897,14 @@ class spell_gen_profession_research : public SpellScriptLoader { PrepareSpellScript(spell_gen_profession_research_SpellScript); + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + SpellCastResult CheckRequirement() { - if (GetCaster()->GetTypeId() == TYPEID_PLAYER && HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer())) + if (HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer())) { SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_NOTHING_TO_DISCOVER); return SPELL_FAILED_CUSTOM_ERROR; @@ -978,19 +974,11 @@ class spell_generic_clone_weapon : public SpellScriptLoader class spell_generic_clone_weapon_SpellScript : public SpellScript { PrepareSpellScript(spell_generic_clone_weapon_SpellScript); + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED)) + if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3) || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND) + || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2) || !sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED)) return false; return true; } @@ -999,57 +987,56 @@ class spell_generic_clone_weapon : public SpellScriptLoader { PreventHitDefaultEffect(effIndex); Unit* caster = GetCaster(); - Unit* target = GetHitUnit(); - - if (!target) - return; + if (Unit* target = GetHitUnit()) + { - uint32 spellId = uint32(GetSpellInfo()->Effects[EFFECT_0].CalcValue()); - target->CastSpell(caster, spellId, true); + uint32 spellId = uint32(GetSpellInfo()->Effects[EFFECT_0].CalcValue()); + target->CastSpell(caster, spellId, true); - if (target->GetTypeId() == TYPEID_PLAYER) - return; + if (target->GetTypeId() == TYPEID_PLAYER) + return; - switch (GetSpellInfo()->Id) - { - case SPELL_COPY_WEAPON: - case SPELL_COPY_WEAPON_2: - case SPELL_COPY_WEAPON_3: + switch (GetSpellInfo()->Id) { - if (Player* player = caster->ToPlayer()) + case SPELL_COPY_WEAPON: + case SPELL_COPY_WEAPON_2: + case SPELL_COPY_WEAPON_3: { - if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) - target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry()); + if (Player* player = caster->ToPlayer()) + { + if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) + target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry()); + } + else + target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)); + break; } - else - target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)); - break; - } - case SPELL_COPY_OFFHAND: - case SPELL_COPY_OFFHAND_2: - { - if (Player* player = caster->ToPlayer()) + case SPELL_COPY_OFFHAND: + case SPELL_COPY_OFFHAND_2: { - if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) - target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry()); + if (Player* player = caster->ToPlayer()) + { + if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) + target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry()); + } + else + target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1)); + break; } - else - target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1)); - break; - } - case SPELL_COPY_RANGED: - { - if (Player* player = caster->ToPlayer()) + case SPELL_COPY_RANGED: { - if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED)) - target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry()); + if (Player* player = caster->ToPlayer()) + { + if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED)) + target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry()); + } + else + target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2)); + break; } - else - target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2)); - break; + default: + break; } - default: - break; } } @@ -1095,10 +1082,10 @@ class spell_gen_seaforium_blast : public SpellScriptLoader void AchievementCredit(SpellEffIndex /*effIndex*/) { // but in effect handling OriginalCaster can become NULL - if (!GetOriginalCaster() || !GetHitGObj() || GetHitGObj()->GetGOInfo()->type != GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING) - return; - - GetOriginalCaster()->CastSpell(GetOriginalCaster(), SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT, true); + if (Unit* originalCaster = GetOriginalCaster()) + if (GameObject* go = GetHitGObj()) + if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING) + originalCaster->CastSpell(originalCaster, SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT, true); } void Register() @@ -1131,10 +1118,11 @@ class spell_gen_turkey_marker : public SpellScriptLoader { // store stack apply times, so we can pop them while they expire _applyTimes.push_back(getMSTime()); + Unit* target = GetTarget(); // on stack 15 cast the achievement crediting spell if (GetStackAmount() >= 15) - GetTarget()->CastSpell(GetTarget(), SPELL_TURKEY_VENGEANCE, true, NULL, aurEff, GetCasterGUID()); + target->CastSpell(target, SPELL_TURKEY_VENGEANCE, true, NULL, aurEff, GetCasterGUID()); } void OnPeriodic(AuraEffect const* /*aurEff*/) @@ -1208,29 +1196,28 @@ class spell_gen_magic_rooster : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - Player* target = GetHitPlayer(); - if (!target) - return; + if (Player* target = GetHitPlayer()) + { + // prevent client crashes from stacking mounts + target->RemoveAurasByType(SPELL_AURA_MOUNTED); - // prevent client crashes from stacking mounts - target->RemoveAurasByType(SPELL_AURA_MOUNTED); + uint32 spellId = SPELL_MAGIC_ROOSTER_NORMAL; + switch (target->getRace()) + { + case RACE_DRAENEI: + if (target->getGender() == GENDER_MALE) + spellId = SPELL_MAGIC_ROOSTER_DRAENEI_MALE; + break; + case RACE_TAUREN: + if (target->getGender() == GENDER_MALE) + spellId = SPELL_MAGIC_ROOSTER_TAUREN_MALE; + break; + default: + break; + } - uint32 spellId = SPELL_MAGIC_ROOSTER_NORMAL; - switch (target->getRace()) - { - case RACE_DRAENEI: - if (target->getGender() == GENDER_MALE) - spellId = SPELL_MAGIC_ROOSTER_DRAENEI_MALE; - break; - case RACE_TAUREN: - if (target->getGender() == GENDER_MALE) - spellId = SPELL_MAGIC_ROOSTER_TAUREN_MALE; - break; - default: - break; + target->CastSpell(target, spellId, true); } - - target->CastSpell(target, spellId, true); } void Register() @@ -1258,7 +1245,6 @@ public: { if (!GetCastItem()) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - return SPELL_CAST_OK; } @@ -1335,12 +1321,14 @@ class spell_gen_vehicle_scaling : public SpellScriptLoader { PrepareAuraScript(spell_gen_vehicle_scaling_AuraScript); + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { Unit* caster = GetCaster(); - if (!caster || !caster->ToPlayer()) - return; - float factor; uint16 baseItemLevel; @@ -1379,21 +1367,23 @@ class spell_gen_vehicle_scaling : public SpellScriptLoader }; -class spell_gen_oracle_wolvar_reputation: public SpellScriptLoader +class spell_gen_oracle_wolvar_reputation : public SpellScriptLoader { -public: - spell_gen_oracle_wolvar_reputation() : SpellScriptLoader("spell_gen_oracle_wolvar_reputation") { } - - class spell_gen_oracle_wolvar_reputation_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_oracle_wolvar_reputation_SpellScript) + public: + spell_gen_oracle_wolvar_reputation() : SpellScriptLoader("spell_gen_oracle_wolvar_reputation") { } - void HandleDummy(SpellEffIndex effIndex) + class spell_gen_oracle_wolvar_reputation_SpellScript : public SpellScript { + PrepareSpellScript(spell_gen_oracle_wolvar_reputation_SpellScript); - if (Player* player = GetCaster()->ToPlayer()) + bool Load() { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + void HandleDummy(SpellEffIndex effIndex) + { + Player* player = GetCaster()->ToPlayer(); uint32 factionId = GetSpellInfo()->Effects[effIndex].CalcValue(); int32 repChange = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); @@ -1410,18 +1400,16 @@ public: // EFFECT_INDEX_2 most likely update at war state, we already handle this in SetReputation } - } + void Register() + { + OnEffectHit += SpellEffectFn(spell_gen_oracle_wolvar_reputation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; - void Register() + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_gen_oracle_wolvar_reputation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_gen_oracle_wolvar_reputation_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gen_oracle_wolvar_reputation_SpellScript(); - } }; enum DamageReductionAura @@ -1435,53 +1423,48 @@ enum DamageReductionAura class spell_gen_damage_reduction_aura : public SpellScriptLoader { -public: - spell_gen_damage_reduction_aura() : SpellScriptLoader("spell_gen_damage_reduction_aura") { } - - class spell_gen_damage_reduction_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_damage_reduction_AuraScript); + public: + spell_gen_damage_reduction_aura() : SpellScriptLoader("spell_gen_damage_reduction_aura") { } - bool Validate(SpellInfo const* /*SpellEntry*/) + class spell_gen_damage_reduction_AuraScript : public AuraScript { - if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA)) - return false; - return true; - } + PrepareAuraScript(spell_gen_damage_reduction_AuraScript); - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true); - } + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA)) + return false; + return true; + } - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - if (!target->HasAura(SPELL_DAMAGE_REDUCTION_AURA)) - return; + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true); + } - if (target->HasAura(SPELL_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_RENEWED_HOPE) || - target->HasAura(SPELL_VIGILANCE)) - return; + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (target->HasAura(SPELL_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_BLESSING_OF_SANCTUARY) || + target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) || + target->HasAura(SPELL_RENEWED_HOPE) || + target->HasAura(SPELL_VIGILANCE))) + target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA); + } - target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA); - } + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_gen_damage_reduction_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_damage_reduction_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } - void Register() + }; + + AuraScript* GetAuraScript() const { - OnEffectApply += AuraEffectApplyFn(spell_gen_damage_reduction_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - OnEffectRemove += AuraEffectRemoveFn(spell_gen_damage_reduction_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + return new spell_gen_damage_reduction_AuraScript(); } - - }; - - AuraScript* GetAuraScript() const - { - return new spell_gen_damage_reduction_AuraScript(); - } }; class spell_gen_luck_of_the_draw : public SpellScriptLoader @@ -1493,6 +1476,11 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader { PrepareAuraScript(spell_gen_luck_of_the_draw_AuraScript); + bool Load() + { + return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER; + } + // cheap hax to make it have update calls void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude) { @@ -1502,30 +1490,30 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader void Update(AuraEffect* /*effect*/) { - if (GetUnitOwner()->GetTypeId() != TYPEID_PLAYER) - return; - - const LfgDungeonSet dungeons = sLFGMgr->GetSelectedDungeons(GetUnitOwner()->GetGUID()); - LfgDungeonSet::const_iterator itr = dungeons.begin(); - - if (itr == dungeons.end()) + if (Player* owner = GetUnitOwner()->ToPlayer()) { - Remove(AURA_REMOVE_BY_DEFAULT); - return; - } + const LfgDungeonSet dungeons = sLFGMgr->GetSelectedDungeons(owner->GetGUID()); + LfgDungeonSet::const_iterator itr = dungeons.begin(); + + if (itr == dungeons.end()) + { + Remove(AURA_REMOVE_BY_DEFAULT); + return; + } - LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*itr); - Group* group = GetUnitOwner()->ToPlayer()->GetGroup(); - Map const* map = GetUnitOwner()->GetMap(); - if (group && group->isLFGGroup()) - if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true)) - if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) - if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty()) - if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM) - return; // in correct dungeon + LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*itr); + if (Group* group = owner->GetGroup()) + if (Map const* map = owner->GetMap()) + if (group->isLFGGroup()) + if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true)) + if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) + if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty()) + if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM) + return; // in correct dungeon - Remove(AURA_REMOVE_BY_DEFAULT); + Remove(AURA_REMOVE_BY_DEFAULT); + } } void Register() @@ -1541,6 +1529,178 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader } }; +enum DummyTrigger +{ + SPELL_PERSISTANT_SHIELD_TRIGGERED = 26470, + SPELL_PERSISTANT_SHIELD = 26467, +}; + +class spell_gen_dummy_trigger : public SpellScriptLoader +{ + public: + spell_gen_dummy_trigger() : SpellScriptLoader("spell_gen_dummy_trigger") { } + + class spell_gen_dummy_trigger_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_dummy_trigger_SpellScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + int32 damage = GetEffectValue(); + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + if (SpellInfo const* triggeredByAuraSpell = GetTriggeringSpell()) + if (triggeredByAuraSpell->Id == SPELL_PERSISTANT_SHIELD_TRIGGERED) + caster->CastCustomSpell(target, SPELL_PERSISTANT_SHIELD_TRIGGERED, &damage, NULL, NULL, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_dummy_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_dummy_trigger_SpellScript(); + } + +}; + +class spell_gen_spirit_healer_res : public SpellScriptLoader +{ + public: + spell_gen_spirit_healer_res(): SpellScriptLoader("spell_gen_spirit_healer_res") { } + + class spell_gen_spirit_healer_res_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_spirit_healer_res_SpellScript); + + bool Load() + { + return GetOriginalCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + if (Player* originalCaster = GetOriginalCaster()->ToPlayer()) + { + if (Unit* target = GetHitUnit()) + { + WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8); + data << uint64(target->GetGUID()); + originalCaster->GetSession()->SendPacket(&data); + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_spirit_healer_res_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_spirit_healer_res_SpellScript(); + } +}; + +enum TransporterBackfires +{ + SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH = 23444, + SPELL_TRANSPORTER_EVIL_TWIN = 23445, + SPELL_TRANSPORTER_MALFUNCTION_MISS = 36902, +}; + +class spell_gen_gadgetzan_transporter_backfire : public SpellScriptLoader +{ + public: + spell_gen_gadgetzan_transporter_backfire() : SpellScriptLoader("spell_gen_gadgetzan_transporter_backfire") { } + + class spell_gen_gadgetzan_transporter_backfire_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_gadgetzan_transporter_backfire_SpellScript) + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH) || !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_EVIL_TWIN) + || !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_MISS)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + int32 r = irand(0, 119); + if (r < 20) // Transporter Malfunction - 1/6 polymorph + caster->CastSpell(caster, SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH, true); + else if (r < 100) // Evil Twin - 4/6 evil twin + caster->CastSpell(caster, SPELL_TRANSPORTER_EVIL_TWIN, true); + else // Transporter Malfunction - 1/6 miss the target + caster->CastSpell(caster, SPELL_TRANSPORTER_MALFUNCTION_MISS, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_gadgetzan_transporter_backfire_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_gadgetzan_transporter_backfire_SpellScript(); + } +}; + +enum GnomishTransporter +{ + SPELL_TRANSPORTER_SUCCESS = 23441, + SPELL_TRANSPORTER_FAILURE = 23446, +}; + +class spell_gen_gnomish_transporter : public SpellScriptLoader +{ + public: + spell_gen_gnomish_transporter() : SpellScriptLoader("spell_gen_gnomish_transporter") { } + + class spell_gen_gnomish_transporter_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_gnomish_transporter_SpellScript) + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_SUCCESS) || !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_FAILURE)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + caster->CastSpell(caster, roll_chance_i(50) ? SPELL_TRANSPORTER_SUCCESS : SPELL_TRANSPORTER_FAILURE , true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_gnomish_transporter_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_gnomish_transporter_SpellScript(); + } +}; + enum DalaranDisguiseSpells { SPELL_SUNREAVER_DISGUISE_TRIGGER = 69672, @@ -1565,15 +1725,11 @@ class spell_gen_dalaran_disguise : public SpellScriptLoader switch (spellEntry->Id) { case SPELL_SUNREAVER_DISGUISE_TRIGGER: - if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE)) + if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE)) return false; break; case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER: - if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE)) + if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE)) return false; break; } @@ -1599,7 +1755,6 @@ class spell_gen_dalaran_disguise : public SpellScriptLoader default: break; } - GetCaster()->CastSpell(player, spellId, true); } } @@ -2354,6 +2509,47 @@ class spell_gen_tournament_pennant : public SpellScriptLoader } }; +enum ChaosBlast +{ + SPELL_CHAOS_BLAST = 37675, +}; + +class spell_gen_chaos_blast : public SpellScriptLoader +{ + public: + spell_gen_chaos_blast() : SpellScriptLoader("spell_gen_chaos_blast") { } + + class spell_gen_chaos_blast_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_chaos_blast_SpellScript) + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_CHAOS_BLAST)) + return false; + return true; + } + void HandleDummy(SpellEffIndex /* effIndex */) + { + int32 basepoints0 = 100; + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + caster->CastCustomSpell(target, SPELL_CHAOS_BLAST, &basepoints0, NULL, NULL, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_chaos_blast_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_chaos_blast_SpellScript(); + } + +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -2387,6 +2583,10 @@ void AddSC_generic_spell_scripts() new spell_gen_oracle_wolvar_reputation(); new spell_gen_damage_reduction_aura(); new spell_gen_luck_of_the_draw(); + new spell_gen_dummy_trigger(); + new spell_gen_spirit_healer_res(); + new spell_gen_gadgetzan_transporter_backfire(); + new spell_gen_gnomish_transporter(); new spell_gen_dalaran_disguise("spell_gen_sunreaver_disguise"); new spell_gen_dalaran_disguise("spell_gen_silver_covenant_disguise"); new spell_gen_elune_candle(); @@ -2398,4 +2598,5 @@ void AddSC_generic_spell_scripts() new spell_gen_summon_tournament_mount(); new spell_gen_on_tournament_mount(); new spell_gen_tournament_pennant(); + new spell_gen_chaos_blast(); } diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 8a3424ab1e7..855af75cd83 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -21,9 +21,13 @@ * Scriptnames of files in this file should be prefixed with "spell_hun_". */ -#include "ScriptPCH.h" -#include "SpellAuraEffects.h" +#include "ScriptMgr.h" +#include "Cell.h" +#include "CellImpl.h" #include "GridNotifiers.h" +#include "GridNotifiersImpl.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" enum HunterSpells { @@ -45,219 +49,215 @@ enum HunterSpells // 13161 Aspect of the Beast class spell_hun_aspect_of_the_beast : public SpellScriptLoader { -public: - spell_hun_aspect_of_the_beast() : SpellScriptLoader("spell_hun_aspect_of_the_beast") { } + public: + spell_hun_aspect_of_the_beast() : SpellScriptLoader("spell_hun_aspect_of_the_beast") { } - class spell_hun_aspect_of_the_beast_AuraScript : public AuraScript - { - PrepareAuraScript(spell_hun_aspect_of_the_beast_AuraScript) - bool Validate(SpellInfo const* /*entry*/) + class spell_hun_aspect_of_the_beast_AuraScript : public AuraScript { - if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET)) - return false; - return true; - } + PrepareAuraScript(spell_hun_aspect_of_the_beast_AuraScript); - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (!GetCaster()) - return; + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - Unit* caster = GetCaster(); - if (caster->ToPlayer()) - if (Pet* pet = caster->ToPlayer()->GetPet()) - pet->RemoveAurasDueToSpell(HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET); - } + bool Validate(SpellInfo const* /*entry*/) + { + if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET)) + return false; + return true; + } - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (!GetCaster()) - return; + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Player* caster = GetCaster()->ToPlayer()) + if (Pet* pet = caster->GetPet()) + pet->RemoveAurasDueToSpell(HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET); + } - Unit* caster = GetCaster(); - if (caster->ToPlayer()) - if (caster->ToPlayer()->GetPet()) - caster->CastSpell(caster, HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET, true); - } + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Player* caster = GetCaster()->ToPlayer()) + if (caster->GetPet()) + caster->CastSpell(caster, HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET, true); + } - void Register() + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_hun_aspect_of_the_beast_AuraScript::OnApply, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_hun_aspect_of_the_beast_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const { - AfterEffectApply += AuraEffectApplyFn(spell_hun_aspect_of_the_beast_AuraScript::OnApply, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL); - AfterEffectRemove += AuraEffectRemoveFn(spell_hun_aspect_of_the_beast_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL); + return new spell_hun_aspect_of_the_beast_AuraScript(); } - }; - - AuraScript* GetAuraScript() const - { - return new spell_hun_aspect_of_the_beast_AuraScript(); - } }; // 53209 Chimera Shot class spell_hun_chimera_shot : public SpellScriptLoader { -public: - spell_hun_chimera_shot() : SpellScriptLoader("spell_hun_chimera_shot") { } + public: + spell_hun_chimera_shot() : SpellScriptLoader("spell_hun_chimera_shot") { } - class spell_hun_chimera_shot_SpellScript : public SpellScript - { - PrepareSpellScript(spell_hun_chimera_shot_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_hun_chimera_shot_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_SERPENT)) - return false; - if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_VIPER)) - return false; - if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_SCORPID)) - return false; - return true; - } + PrepareSpellScript(spell_hun_chimera_shot_SpellScript); - void HandleScriptEffect(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - Unit* unitTarget = GetHitUnit(); - if (!unitTarget) - return; - - uint32 spellId = 0; - int32 basePoint = 0; - Unit::AuraApplicationMap& Auras = unitTarget->GetAppliedAuras(); - for (Unit::AuraApplicationMap::iterator i = Auras.begin(); i != Auras.end(); ++i) - { - Aura* aura = i->second->GetBase(); - if (aura->GetCasterGUID() != caster->GetGUID()) - continue; - - // Search only Serpent Sting, Viper Sting, Scorpid Sting auras - flag96 familyFlag = aura->GetSpellInfo()->SpellFamilyFlags; - if (!(familyFlag[1] & 0x00000080 || familyFlag[0] & 0x0000C000)) - continue; - if (AuraEffect const* aurEff = aura->GetEffect(0)) + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_SERPENT) || !sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_VIPER) || !sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_SCORPID)) + return false; + return true; + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* unitTarget = GetHitUnit()) { - // Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting. - if (familyFlag[0] & 0x4000) - { - int32 TickCount = aurEff->GetTotalTicks(); - spellId = HUNTER_SPELL_CHIMERA_SHOT_SERPENT; - basePoint = caster->SpellDamageBonus(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount()); - ApplyPctN(basePoint, TickCount * 40); - } - // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting. - else if (familyFlag[1] & 0x00000080) + uint32 spellId = 0; + int32 basePoint = 0; + Unit::AuraApplicationMap& Auras = unitTarget->GetAppliedAuras(); + for (Unit::AuraApplicationMap::iterator i = Auras.begin(); i != Auras.end(); ++i) { - int32 TickCount = aura->GetEffect(0)->GetTotalTicks(); - spellId = HUNTER_SPELL_CHIMERA_SHOT_VIPER; - - // Amount of one aura tick - basePoint = int32(CalculatePctN(unitTarget->GetMaxPower(POWER_MANA), aurEff->GetAmount())); - int32 casterBasePoint = aurEff->GetAmount() * unitTarget->GetMaxPower(POWER_MANA) / 50; // TODO: WTF? caster uses unitTarget? - if (basePoint > casterBasePoint) - basePoint = casterBasePoint; - ApplyPctN(basePoint, TickCount * 60); + Aura* aura = i->second->GetBase(); + if (aura->GetCasterGUID() != caster->GetGUID()) + continue; + + // Search only Serpent Sting, Viper Sting, Scorpid Sting auras + flag96 familyFlag = aura->GetSpellInfo()->SpellFamilyFlags; + if (!(familyFlag[1] & 0x00000080 || familyFlag[0] & 0x0000C000)) + continue; + if (AuraEffect const* aurEff = aura->GetEffect(0)) + { + // Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting. + if (familyFlag[0] & 0x4000) + { + int32 TickCount = aurEff->GetTotalTicks(); + spellId = HUNTER_SPELL_CHIMERA_SHOT_SERPENT; + basePoint = caster->SpellDamageBonus(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount()); + ApplyPctN(basePoint, TickCount * 40); + } + // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting. + else if (familyFlag[1] & 0x00000080) + { + int32 TickCount = aura->GetEffect(0)->GetTotalTicks(); + spellId = HUNTER_SPELL_CHIMERA_SHOT_VIPER; + + // Amount of one aura tick + basePoint = int32(CalculatePctN(unitTarget->GetMaxPower(POWER_MANA), aurEff->GetAmount())); + int32 casterBasePoint = aurEff->GetAmount() * unitTarget->GetMaxPower(POWER_MANA) / 50; // TODO: WTF? caster uses unitTarget? + if (basePoint > casterBasePoint) + basePoint = casterBasePoint; + ApplyPctN(basePoint, TickCount * 60); + } + // Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute. + else if (familyFlag[0] & 0x00008000) + spellId = HUNTER_SPELL_CHIMERA_SHOT_SCORPID; + // ?? nothing say in spell desc (possibly need addition check) + //if (familyFlag & 0x0000010000000000LL || // dot + // familyFlag & 0x0000100000000000LL) // stun + //{ + // spellId = 53366; // 53366 Chimera Shot - Wyvern + //} + + // Refresh aura duration + aura->RefreshDuration(); + } + break; } - // Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute. - else if (familyFlag[0] & 0x00008000) - spellId = HUNTER_SPELL_CHIMERA_SHOT_SCORPID; - // ?? nothing say in spell desc (possibly need addition check) - //if (familyFlag & 0x0000010000000000LL || // dot - // familyFlag & 0x0000100000000000LL) // stun - //{ - // spellId = 53366; // 53366 Chimera Shot - Wyvern - //} - - // Refresh aura duration - aura->RefreshDuration(); + if (spellId) + caster->CastCustomSpell(unitTarget, spellId, &basePoint, 0, 0, true); + if (spellId == HUNTER_SPELL_CHIMERA_SHOT_SCORPID && caster->ToPlayer()) // Scorpid Sting - Add 1 minute cooldown + caster->ToPlayer()->AddSpellCooldown(spellId, 0, uint32(time(NULL) + 60)); } - break; } - if (spellId) - caster->CastCustomSpell(unitTarget, spellId, &basePoint, 0, 0, true); - if (spellId == HUNTER_SPELL_CHIMERA_SHOT_SCORPID && caster->ToPlayer()) // Scorpid Sting - Add 1 minute cooldown - caster->ToPlayer()->AddSpellCooldown(spellId, 0, uint32(time(NULL) + 60)); - } - void Register() + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_hun_chimera_shot_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_hun_chimera_shot_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + return new spell_hun_chimera_shot_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_hun_chimera_shot_SpellScript(); - } }; // 53412 Invigoration class spell_hun_invigoration : public SpellScriptLoader { -public: - spell_hun_invigoration() : SpellScriptLoader("spell_hun_invigoration") { } + public: + spell_hun_invigoration() : SpellScriptLoader("spell_hun_invigoration") { } - class spell_hun_invigoration_SpellScript : public SpellScript - { - PrepareSpellScript(spell_hun_invigoration_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_hun_invigoration_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_INVIGORATION_TRIGGERED)) - return false; - return true; - } + PrepareSpellScript(spell_hun_invigoration_SpellScript); - void HandleScriptEffect(SpellEffIndex /*effIndex*/) - { - if (Unit* unitTarget = GetHitUnit()) - if (AuraEffect* aurEff = unitTarget->GetDummyAuraEffect(SPELLFAMILY_HUNTER, 3487, 0)) - if (roll_chance_i(aurEff->GetAmount())) - unitTarget->CastSpell(unitTarget, HUNTER_SPELL_INVIGORATION_TRIGGERED, true); - } + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_INVIGORATION_TRIGGERED)) + return false; + return true; + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* unitTarget = GetHitUnit()) + if (AuraEffect* aurEff = unitTarget->GetDummyAuraEffect(SPELLFAMILY_HUNTER, 3487, 0)) + if (roll_chance_i(aurEff->GetAmount())) + unitTarget->CastSpell(unitTarget, HUNTER_SPELL_INVIGORATION_TRIGGERED, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_hun_invigoration_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; - void Register() + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_hun_invigoration_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + return new spell_hun_invigoration_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_hun_invigoration_SpellScript(); - } }; class spell_hun_last_stand_pet : public SpellScriptLoader { -public: - spell_hun_last_stand_pet() : SpellScriptLoader("spell_hun_last_stand_pet") { } + public: + spell_hun_last_stand_pet() : SpellScriptLoader("spell_hun_last_stand_pet") { } - class spell_hun_last_stand_pet_SpellScript : public SpellScript - { - PrepareSpellScript(spell_hun_last_stand_pet_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_hun_last_stand_pet_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(HUNTER_PET_SPELL_LAST_STAND_TRIGGERED)) - return false; - return true; - } + PrepareSpellScript(spell_hun_last_stand_pet_SpellScript); - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30)); - caster->CastCustomSpell(caster, HUNTER_PET_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); - } + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(HUNTER_PET_SPELL_LAST_STAND_TRIGGERED)) + return false; + return true; + } - void Register() + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30)); + caster->CastCustomSpell(caster, HUNTER_PET_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); + } + + void Register() + { + // add dummy effect spell handler to pet's Last Stand + OnEffectHitTarget += SpellEffectFn(spell_hun_last_stand_pet_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - // add dummy effect spell handler to pet's Last Stand - OnEffectHitTarget += SpellEffectFn(spell_hun_last_stand_pet_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_hun_last_stand_pet_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_hun_last_stand_pet_SpellScript(); - } }; class spell_hun_masters_call : public SpellScriptLoader @@ -267,14 +267,11 @@ class spell_hun_masters_call : public SpellScriptLoader class spell_hun_masters_call_SpellScript : public SpellScript { - PrepareSpellScript(spell_hun_masters_call_SpellScript) + PrepareSpellScript(spell_hun_masters_call_SpellScript); + bool Validate(SpellInfo const* spellEntry) { - if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_MASTERS_CALL_TRIGGERED)) - return false; - if (!sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_0].CalcValue())) - return false; - if (!sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_1].CalcValue())) + if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_MASTERS_CALL_TRIGGERED) || !sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_0].CalcValue()) || !sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_1].CalcValue())) return false; return true; } @@ -312,80 +309,86 @@ class spell_hun_masters_call : public SpellScriptLoader class spell_hun_readiness : public SpellScriptLoader { -public: - spell_hun_readiness() : SpellScriptLoader("spell_hun_readiness") { } + public: + spell_hun_readiness() : SpellScriptLoader("spell_hun_readiness") { } - class spell_hun_readiness_SpellScript : public SpellScript - { - PrepareSpellScript(spell_hun_readiness_SpellScript) - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_hun_readiness_SpellScript : public SpellScript { - Unit* caster = GetCaster(); - if (caster->GetTypeId() != TYPEID_PLAYER) - return; - - // immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath - const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap(); - for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); - - ///! If spellId in cooldown map isn't valid, the above will return a null pointer. - if (spellInfo && - spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && - spellInfo->Id != HUNTER_SPELL_READINESS && - spellInfo->Id != HUNTER_SPELL_BESTIAL_WRATH && - spellInfo->GetRecoveryTime() > 0) - caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true); - else - ++itr; + PrepareSpellScript(spell_hun_readiness_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - } - void Register() + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + // immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath + const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap(); + for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); + + ///! If spellId in cooldown map isn't valid, the above will return a null pointer. + if (spellInfo && + spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && + spellInfo->Id != HUNTER_SPELL_READINESS && + spellInfo->Id != HUNTER_SPELL_BESTIAL_WRATH && + spellInfo->GetRecoveryTime() > 0) + caster->RemoveSpellCooldown((itr++)->first, true); + else + ++itr; + } + } + + void Register() + { + // add dummy effect spell handler to Readiness + OnEffectHitTarget += SpellEffectFn(spell_hun_readiness_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - // add dummy effect spell handler to Readiness - OnEffectHitTarget += SpellEffectFn(spell_hun_readiness_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_hun_readiness_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_hun_readiness_SpellScript(); - } }; // 37506 Scatter Shot class spell_hun_scatter_shot : public SpellScriptLoader { -public: - spell_hun_scatter_shot() : SpellScriptLoader("spell_hun_scatter_shot") { } + public: + spell_hun_scatter_shot() : SpellScriptLoader("spell_hun_scatter_shot") { } - class spell_hun_scatter_shot_SpellScript : public SpellScript - { - PrepareSpellScript(spell_hun_scatter_shot_SpellScript) - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_hun_scatter_shot_SpellScript : public SpellScript { - Unit* caster = GetCaster(); - if (caster->GetTypeId() != TYPEID_PLAYER) - return; - - // break Auto Shot and autohit - caster->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); - caster->AttackStop(); - caster->ToPlayer()->SendAttackSwingCancelAttack(); - } + PrepareSpellScript(spell_hun_scatter_shot_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + // break Auto Shot and autohit + caster->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); + caster->AttackStop(); + caster->SendAttackSwingCancelAttack(); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_hun_scatter_shot_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; - void Register() + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_hun_scatter_shot_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_hun_scatter_shot_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_hun_scatter_shot_SpellScript(); - } }; // 53302, 53303, 53304 Sniper Training @@ -397,169 +400,164 @@ enum eSniperTrainingSpells class spell_hun_sniper_training : public SpellScriptLoader { -public: - spell_hun_sniper_training() : SpellScriptLoader("spell_hun_sniper_training") { } - - class spell_hun_sniper_training_AuraScript : public AuraScript - { - PrepareAuraScript(spell_hun_sniper_training_AuraScript) - bool Validate(SpellInfo const* /*entry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_SNIPER_TRAINING_R1)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SNIPER_TRAINING_BUFF_R1)) - return false; - return true; - } + public: + spell_hun_sniper_training() : SpellScriptLoader("spell_hun_sniper_training") { } - void HandlePeriodic(AuraEffect const* aurEff) + class spell_hun_sniper_training_AuraScript : public AuraScript { - PreventDefaultAction(); - if (aurEff->GetAmount() > 0) - return; + PrepareAuraScript(spell_hun_sniper_training_AuraScript); - Unit* caster = GetCaster(); + bool Validate(SpellInfo const* /*entry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SNIPER_TRAINING_R1) || !sSpellMgr->GetSpellInfo(SPELL_SNIPER_TRAINING_BUFF_R1)) + return false; + return true; + } - if (!caster) - return; + void HandlePeriodic(AuraEffect const* aurEff) + { + PreventDefaultAction(); + if (aurEff->GetAmount() <= 0) + { + Unit* caster = GetCaster(); + uint32 spellId = SPELL_SNIPER_TRAINING_BUFF_R1 + GetId() - SPELL_SNIPER_TRAINING_R1; + if (Unit* target = GetTarget()) + if (!target->HasAura(spellId)) + { + SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(spellId); + Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? caster : target; + triggerCaster->CastSpell(target, triggeredSpellInfo, true, 0, aurEff); + } + } + } - uint32 spellId = SPELL_SNIPER_TRAINING_BUFF_R1 + GetId() - SPELL_SNIPER_TRAINING_R1; - Unit* target = GetTarget(); - if (!target->HasAura(spellId)) + void HandleUpdatePeriodic(AuraEffect* aurEff) { - SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(spellId); - Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? caster : target; - triggerCaster->CastSpell(target, triggeredSpellInfo, true, 0, aurEff); + if (Player* playerTarget = GetUnitOwner()->ToPlayer()) + { + int32 baseAmount = aurEff->GetBaseAmount(); + int32 amount = playerTarget->isMoving() ? + playerTarget->CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount) : + aurEff->GetAmount() - 1; + aurEff->SetAmount(amount); + } } - } - void HandleUpdatePeriodic(AuraEffect* aurEff) - { - Unit* target = GetUnitOwner(); - if (Player* playerTarget = target->ToPlayer()) + void Register() { - int32 baseAmount = aurEff->GetBaseAmount(); - int32 amount = playerTarget->isMoving() ? - target->CalculateSpellDamage(target, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount) : - aurEff->GetAmount() - 1; - aurEff->SetAmount(amount); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_sniper_training_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_hun_sniper_training_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); } - } + }; - void Register() + AuraScript* GetAuraScript() const { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_sniper_training_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_hun_sniper_training_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + return new spell_hun_sniper_training_AuraScript(); } - }; - - AuraScript* GetAuraScript() const - { - return new spell_hun_sniper_training_AuraScript(); - } }; class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader { -public: - spell_hun_pet_heart_of_the_phoenix() : SpellScriptLoader("spell_hun_pet_heart_of_the_phoenix") { } + public: + spell_hun_pet_heart_of_the_phoenix() : SpellScriptLoader("spell_hun_pet_heart_of_the_phoenix") { } - class spell_hun_pet_heart_of_the_phoenix_SpellScript : public SpellScript - { - PrepareSpellScript(spell_hun_pet_heart_of_the_phoenix_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_hun_pet_heart_of_the_phoenix_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED)) - return false; - if (!sSpellMgr->GetSpellInfo(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF)) - return false; - return true; - } + PrepareSpellScript(spell_hun_pet_heart_of_the_phoenix_SpellScript); - void HandleScript(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - Unit* owner = caster->GetOwner(); - if (!owner || caster->HasAura(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF)) - return; - owner->CastCustomSpell(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED, SPELLVALUE_BASE_POINT0, 100, caster, true); - caster->CastSpell(caster, HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF, true); - } + bool Load() + { + if (!GetCaster()->isPet()) + return false; + return true; + } - void Register() - { - // add dummy effect spell handler to pet's Last Stand - OnEffectHitTarget += SpellEffectFn(spell_hun_pet_heart_of_the_phoenix_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED) || !sSpellMgr->GetSpellInfo(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* owner = caster->GetOwner()) + if (!caster->HasAura(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF)) + { + owner->CastCustomSpell(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED, SPELLVALUE_BASE_POINT0, 100, caster, true); + caster->CastSpell(caster, HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF, true); + } + } - bool Load() + void Register() + { + // add dummy effect spell handler to pet's Last Stand + OnEffectHitTarget += SpellEffectFn(spell_hun_pet_heart_of_the_phoenix_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const { - if (!GetCaster()->isPet()) - return false; - return true; + return new spell_hun_pet_heart_of_the_phoenix_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_hun_pet_heart_of_the_phoenix_SpellScript(); - } }; class spell_hun_pet_carrion_feeder : public SpellScriptLoader { -public: - spell_hun_pet_carrion_feeder() : SpellScriptLoader("spell_hun_pet_carrion_feeder") { } + public: + spell_hun_pet_carrion_feeder() : SpellScriptLoader("spell_hun_pet_carrion_feeder") { } - class spell_hun_pet_carrion_feeder_SpellScript : public SpellScript - { - PrepareSpellScript(spell_hun_pet_carrion_feeder_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_hun_pet_carrion_feeder_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED)) - return false; - return true; - } + PrepareSpellScript(spell_hun_pet_carrion_feeder_SpellScript); - SpellCastResult CheckIfCorpseNear() - { - Unit* caster = GetCaster(); - float max_range = GetSpellInfo()->GetMaxRange(false); - WorldObject* result = NULL; - // search for nearby enemy corpse in range - Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_SELECT_CHECK_ENEMY); - Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check); - caster->GetMap()->VisitFirstFound(caster->m_positionX, caster->m_positionY, max_range, searcher); - if (!result) - return SPELL_FAILED_NO_EDIBLE_CORPSES; - return SPELL_CAST_OK; - } + bool Load() + { + if (!GetCaster()->isPet()) + return false; + return true; + } - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - caster->CastSpell(caster, HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED, false); - } + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED)) + return false; + return true; + } - void Register() - { - // add dummy effect spell handler to pet's Last Stand - OnEffectHit += SpellEffectFn(spell_hun_pet_carrion_feeder_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - OnCheckCast += SpellCheckCastFn(spell_hun_pet_carrion_feeder_SpellScript::CheckIfCorpseNear); - } + SpellCastResult CheckIfCorpseNear() + { + Unit* caster = GetCaster(); + float max_range = GetSpellInfo()->GetMaxRange(false); + WorldObject* result = NULL; + // search for nearby enemy corpse in range + Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY); + Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check); + caster->GetMap()->VisitFirstFound(caster->m_positionX, caster->m_positionY, max_range, searcher); + if (!result) + return SPELL_FAILED_NO_EDIBLE_CORPSES; + return SPELL_CAST_OK; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + caster->CastSpell(caster, HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED, false); + } - bool Load() + void Register() + { + // add dummy effect spell handler to pet's Last Stand + OnEffectHit += SpellEffectFn(spell_hun_pet_carrion_feeder_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnCheckCast += SpellCheckCastFn(spell_hun_pet_carrion_feeder_SpellScript::CheckIfCorpseNear); + } + }; + + SpellScript* GetSpellScript() const { - if (!GetCaster()->isPet()) - return false; - return true; + return new spell_hun_pet_carrion_feeder_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_hun_pet_carrion_feeder_SpellScript(); - } }; void AddSC_hunter_spell_scripts() diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index b40879d500e..416869d98ce 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -21,55 +21,59 @@ * Scriptnames of files in this file should be prefixed with "spell_item_". */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" #include "SkillDiscovery.h" // Generic script for handling item dummy effects which trigger another spell. class spell_item_trigger_spell : public SpellScriptLoader { -private: - uint32 _triggeredSpellId; - -public: - spell_item_trigger_spell(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { } - - class spell_item_trigger_spell_SpellScript : public SpellScript - { - PrepareSpellScript(spell_item_trigger_spell_SpellScript) private: uint32 _triggeredSpellId; public: - spell_item_trigger_spell_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { } + spell_item_trigger_spell(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { } - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_item_trigger_spell_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(_triggeredSpellId)) - return false; - return true; - } + PrepareSpellScript(spell_item_trigger_spell_SpellScript); + private: + uint32 _triggeredSpellId; - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Item* pItem = GetCastItem()) - GetCaster()->CastSpell(GetCaster(), _triggeredSpellId, true, pItem); - } + public: + spell_item_trigger_spell_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { } - void Register() + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(_triggeredSpellId)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Item* pItem = GetCastItem()) + caster->CastSpell(caster, _triggeredSpellId, true, pItem); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_item_trigger_spell_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_item_trigger_spell_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_item_trigger_spell_SpellScript(_triggeredSpellId); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_item_trigger_spell_SpellScript(_triggeredSpellId); - } }; // http://www.wowhead.com/item=6522 Deviate Fish // 8063 Deviate Fish -enum eDeviateFishSpells +enum DeviateFishSpells { SPELL_SLEEPY = 8064, SPELL_INVIGORATE = 8065, @@ -80,46 +84,48 @@ enum eDeviateFishSpells class spell_item_deviate_fish : public SpellScriptLoader { -public: - spell_item_deviate_fish() : SpellScriptLoader("spell_item_deviate_fish") { } - - class spell_item_deviate_fish_SpellScript : public SpellScript - { - PrepareSpellScript(spell_item_deviate_fish_SpellScript) public: - bool Validate(SpellInfo const* /*spellEntry*/) - { - for (uint32 spellId = SPELL_SLEEPY; spellId <= SPELL_HEALTHY_SPIRIT; ++spellId) - if (!sSpellMgr->GetSpellInfo(spellId)) - return false; - return true; - } + spell_item_deviate_fish() : SpellScriptLoader("spell_item_deviate_fish") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_item_deviate_fish_SpellScript : public SpellScript { - Unit* pCaster = GetCaster(); - if (pCaster->GetTypeId() != TYPEID_PLAYER) - return; + PrepareSpellScript(spell_item_deviate_fish_SpellScript); - uint32 spellId = urand(SPELL_SLEEPY, SPELL_HEALTHY_SPIRIT); - pCaster->CastSpell(pCaster, spellId, true, NULL); - } + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - void Register() + bool Validate(SpellInfo const* /*spellEntry*/) + { + for (uint32 spellId = SPELL_SLEEPY; spellId <= SPELL_HEALTHY_SPIRIT; ++spellId) + if (!sSpellMgr->GetSpellInfo(spellId)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + uint32 spellId = urand(SPELL_SLEEPY, SPELL_HEALTHY_SPIRIT); + caster->CastSpell(caster, spellId, true, NULL); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_item_deviate_fish_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_item_deviate_fish_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_item_deviate_fish_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_item_deviate_fish_SpellScript(); - } }; // http://www.wowhead.com/item=47499 Flask of the North // 67019 Flask of the North -enum eFlaskOfTheNorthSpells +enum FlaskOfTheNorthSpells { SPELL_FLASK_OF_THE_NORTH_SP = 67016, SPELL_FLASK_OF_THE_NORTH_AP = 67017, @@ -128,75 +134,68 @@ enum eFlaskOfTheNorthSpells class spell_item_flask_of_the_north : public SpellScriptLoader { -public: - spell_item_flask_of_the_north() : SpellScriptLoader("spell_item_flask_of_the_north") { } - - class spell_item_flask_of_the_north_SpellScript : public SpellScript - { public: - PrepareSpellScript(spell_item_flask_of_the_north_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_SP)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_AP)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_STR)) - return false; - return true; - } + spell_item_flask_of_the_north() : SpellScriptLoader("spell_item_flask_of_the_north") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_item_flask_of_the_north_SpellScript : public SpellScript { - Unit* pCaster = GetCaster(); - if (pCaster->GetTypeId() != TYPEID_PLAYER) - return; + PrepareSpellScript(spell_item_flask_of_the_north_SpellScript); - std::vector<uint32> possibleSpells; - switch (pCaster->getClass()) + bool Validate(SpellInfo const* /*spellEntry*/) { - case CLASS_WARLOCK: - case CLASS_MAGE: - case CLASS_PRIEST: - possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP); - break; - case CLASS_DEATH_KNIGHT: - case CLASS_WARRIOR: - possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_STR); - break; - case CLASS_ROGUE: - case CLASS_HUNTER: - possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_AP); - break; - case CLASS_DRUID: - case CLASS_PALADIN: - possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP); - possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_STR); - break; - case CLASS_SHAMAN: - possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP); - possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_AP); - break; + if (!sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_SP) || !sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_AP) || !sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_STR)) + return false; + return true; } - pCaster->CastSpell(pCaster, possibleSpells[irand(0, (possibleSpells.size() - 1))], true, NULL); - } + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + std::vector<uint32> possibleSpells; + switch (caster->getClass()) + { + case CLASS_WARLOCK: + case CLASS_MAGE: + case CLASS_PRIEST: + possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP); + break; + case CLASS_DEATH_KNIGHT: + case CLASS_WARRIOR: + possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_STR); + break; + case CLASS_ROGUE: + case CLASS_HUNTER: + possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_AP); + break; + case CLASS_DRUID: + case CLASS_PALADIN: + possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP); + possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_STR); + break; + case CLASS_SHAMAN: + possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP); + possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_AP); + break; + } - void Register() + caster->CastSpell(caster, possibleSpells[irand(0, (possibleSpells.size() - 1))], true, NULL); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_item_flask_of_the_north_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_item_flask_of_the_north_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_item_flask_of_the_north_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_item_flask_of_the_north_SpellScript(); - } }; // http://www.wowhead.com/item=10645 Gnomish Death Ray // 13280 Gnomish Death Ray -enum eGnomishDeathRay +enum GnomishDeathRay { SPELL_GNOMISH_DEATH_RAY_SELF = 13493, SPELL_GNOMISH_DEATH_RAY_TARGET = 13279, @@ -204,49 +203,47 @@ enum eGnomishDeathRay class spell_item_gnomish_death_ray : public SpellScriptLoader { -public: - spell_item_gnomish_death_ray() : SpellScriptLoader("spell_item_gnomish_death_ray") { } - - class spell_item_gnomish_death_ray_SpellScript : public SpellScript - { public: - PrepareSpellScript(spell_item_gnomish_death_ray_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_GNOMISH_DEATH_RAY_SELF)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_GNOMISH_DEATH_RAY_TARGET)) - return false; - return true; - } + spell_item_gnomish_death_ray() : SpellScriptLoader("spell_item_gnomish_death_ray") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_item_gnomish_death_ray_SpellScript : public SpellScript { - if (Unit* target = GetHitUnit()) + PrepareSpellScript(spell_item_gnomish_death_ray_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) { - Unit* pCaster = GetCaster(); - if (urand(0, 99) < 15) - pCaster->CastSpell(pCaster, SPELL_GNOMISH_DEATH_RAY_SELF, true, NULL); // failure - else - pCaster->CastSpell(target, SPELL_GNOMISH_DEATH_RAY_TARGET, true, NULL); + if (!sSpellMgr->GetSpellInfo(SPELL_GNOMISH_DEATH_RAY_SELF) || !sSpellMgr->GetSpellInfo(SPELL_GNOMISH_DEATH_RAY_TARGET)) + return false; + return true; } - } - void Register() + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + { + if (urand(0, 99) < 15) + caster->CastSpell(caster, SPELL_GNOMISH_DEATH_RAY_SELF, true, NULL); // failure + else + caster->CastSpell(target, SPELL_GNOMISH_DEATH_RAY_TARGET, true, NULL); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_gnomish_death_ray_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_item_gnomish_death_ray_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_item_gnomish_death_ray_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_item_gnomish_death_ray_SpellScript(); - } }; // http://www.wowhead.com/item=27388 Mr. Pinchy // 33060 Make a Wish -enum eMakeAWish +enum MakeAWish { SPELL_MR_PINCHYS_BLESSING = 33053, SPELL_SUMMON_MIGHTY_MR_PINCHY = 33057, @@ -257,115 +254,110 @@ enum eMakeAWish class spell_item_make_a_wish : public SpellScriptLoader { -public: - spell_item_make_a_wish() : SpellScriptLoader("spell_item_make_a_wish") { } - - class spell_item_make_a_wish_SpellScript : public SpellScript - { public: - PrepareSpellScript(spell_item_make_a_wish_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MR_PINCHYS_BLESSING)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_MIGHTY_MR_PINCHY)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_FURIOUS_MR_PINCHY)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_TINY_MAGICAL_CRAWDAD)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_MR_PINCHYS_GIFT)) - return false; - return true; - } + spell_item_make_a_wish() : SpellScriptLoader("spell_item_make_a_wish") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_item_make_a_wish_SpellScript : public SpellScript { - Unit* pCaster = GetCaster(); - if (pCaster->GetTypeId() != TYPEID_PLAYER) - return; + PrepareSpellScript(spell_item_make_a_wish_SpellScript); - uint32 spellId = SPELL_MR_PINCHYS_GIFT; - switch (urand(1, 5)) + bool Load() { - case 1: spellId = SPELL_MR_PINCHYS_BLESSING; break; - case 2: spellId = SPELL_SUMMON_MIGHTY_MR_PINCHY; break; - case 3: spellId = SPELL_SUMMON_FURIOUS_MR_PINCHY; break; - case 4: spellId = SPELL_TINY_MAGICAL_CRAWDAD; break; + return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - pCaster->CastSpell(pCaster, spellId, true, NULL); - } - void Register() + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MR_PINCHYS_BLESSING) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_MIGHTY_MR_PINCHY) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_FURIOUS_MR_PINCHY) || !sSpellMgr->GetSpellInfo(SPELL_TINY_MAGICAL_CRAWDAD) || !sSpellMgr->GetSpellInfo(SPELL_MR_PINCHYS_GIFT)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + uint32 spellId = SPELL_MR_PINCHYS_GIFT; + switch (urand(1, 5)) + { + case 1: spellId = SPELL_MR_PINCHYS_BLESSING; break; + case 2: spellId = SPELL_SUMMON_MIGHTY_MR_PINCHY; break; + case 3: spellId = SPELL_SUMMON_FURIOUS_MR_PINCHY; break; + case 4: spellId = SPELL_TINY_MAGICAL_CRAWDAD; break; + } + caster->CastSpell(caster, spellId, true, NULL); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_item_make_a_wish_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_item_make_a_wish_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_item_make_a_wish_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_item_make_a_wish_SpellScript(); - } }; // http://www.wowhead.com/item=32686 Mingo's Fortune Giblets // 40802 Mingo's Fortune Generator class spell_item_mingos_fortune_generator : public SpellScriptLoader { -public: - spell_item_mingos_fortune_generator() : SpellScriptLoader("spell_item_mingos_fortune_generator") { } + public: + spell_item_mingos_fortune_generator() : SpellScriptLoader("spell_item_mingos_fortune_generator") { } - class spell_item_mingos_fortune_generator_SpellScript : public SpellScript - { - PrepareSpellScript(spell_item_mingos_fortune_generator_SpellScript) - void HandleDummy(SpellEffIndex effIndex) - { - // Selecting one from Bloodstained Fortune item - uint32 newitemid; - switch (urand(1, 20)) - { - case 1: newitemid = 32688; break; - case 2: newitemid = 32689; break; - case 3: newitemid = 32690; break; - case 4: newitemid = 32691; break; - case 5: newitemid = 32692; break; - case 6: newitemid = 32693; break; - case 7: newitemid = 32700; break; - case 8: newitemid = 32701; break; - case 9: newitemid = 32702; break; - case 10: newitemid = 32703; break; - case 11: newitemid = 32704; break; - case 12: newitemid = 32705; break; - case 13: newitemid = 32706; break; - case 14: newitemid = 32707; break; - case 15: newitemid = 32708; break; - case 16: newitemid = 32709; break; - case 17: newitemid = 32710; break; - case 18: newitemid = 32711; break; - case 19: newitemid = 32712; break; - case 20: newitemid = 32713; break; - default: - return; + class spell_item_mingos_fortune_generator_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_mingos_fortune_generator_SpellScript); + + void HandleDummy(SpellEffIndex effIndex) + { + // Selecting one from Bloodstained Fortune item + uint32 newitemid; + switch (urand(1, 20)) + { + case 1: newitemid = 32688; break; + case 2: newitemid = 32689; break; + case 3: newitemid = 32690; break; + case 4: newitemid = 32691; break; + case 5: newitemid = 32692; break; + case 6: newitemid = 32693; break; + case 7: newitemid = 32700; break; + case 8: newitemid = 32701; break; + case 9: newitemid = 32702; break; + case 10: newitemid = 32703; break; + case 11: newitemid = 32704; break; + case 12: newitemid = 32705; break; + case 13: newitemid = 32706; break; + case 14: newitemid = 32707; break; + case 15: newitemid = 32708; break; + case 16: newitemid = 32709; break; + case 17: newitemid = 32710; break; + case 18: newitemid = 32711; break; + case 19: newitemid = 32712; break; + case 20: newitemid = 32713; break; + default: + return; + } + + CreateItem(effIndex, newitemid); } - CreateItem(effIndex, newitemid); - } + void Register() + { + OnEffectHit += SpellEffectFn(spell_item_mingos_fortune_generator_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; - void Register() + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_item_mingos_fortune_generator_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_item_mingos_fortune_generator_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_item_mingos_fortune_generator_SpellScript(); - } }; // http://www.wowhead.com/item=10720 Gnomish Net-o-Matic Projector // 13120 Net-o-Matic -enum eNetOMaticSpells +enum NetOMaticSpells { SPELL_NET_O_MATIC_TRIGGERED1 = 16566, SPELL_NET_O_MATIC_TRIGGERED2 = 13119, @@ -374,54 +366,50 @@ enum eNetOMaticSpells class spell_item_net_o_matic : public SpellScriptLoader { -public: - spell_item_net_o_matic() : SpellScriptLoader("spell_item_net_o_matic") { } - - class spell_item_net_o_matic_SpellScript : public SpellScript - { public: - PrepareSpellScript(spell_item_net_o_matic_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED1)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED2)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED3)) - return false; - return true; - } + spell_item_net_o_matic() : SpellScriptLoader("spell_item_net_o_matic") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_item_net_o_matic_SpellScript : public SpellScript { - if (Unit* target = GetHitUnit()) + PrepareSpellScript(spell_item_net_o_matic_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) { - uint32 spellId = SPELL_NET_O_MATIC_TRIGGERED3; - uint32 roll = urand(0, 99); - if (roll < 2) // 2% for 30 sec self root (off-like chance unknown) - spellId = SPELL_NET_O_MATIC_TRIGGERED1; - else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown) - spellId = SPELL_NET_O_MATIC_TRIGGERED2; + if (!sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED1) || !sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED2) || !sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED3)) + return false; + return true; + } - GetCaster()->CastSpell(target, spellId, true, NULL); + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + { + uint32 spellId = SPELL_NET_O_MATIC_TRIGGERED3; + uint32 roll = urand(0, 99); + if (roll < 2) // 2% for 30 sec self root (off-like chance unknown) + spellId = SPELL_NET_O_MATIC_TRIGGERED1; + else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown) + spellId = SPELL_NET_O_MATIC_TRIGGERED2; + + GetCaster()->CastSpell(target, spellId, true, NULL); + } } - } - void Register() + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_net_o_matic_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_item_net_o_matic_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_item_net_o_matic_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_item_net_o_matic_SpellScript(); - } }; // http://www.wowhead.com/item=8529 Noggenfogger Elixir // 16589 Noggenfogger Elixir -enum eNoggenfoggerElixirSpells +enum NoggenfoggerElixirSpells { SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1 = 16595, SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2 = 16593, @@ -430,55 +418,53 @@ enum eNoggenfoggerElixirSpells class spell_item_noggenfogger_elixir : public SpellScriptLoader { -public: - spell_item_noggenfogger_elixir() : SpellScriptLoader("spell_item_noggenfogger_elixir") { } - - class spell_item_noggenfogger_elixir_SpellScript : public SpellScript - { public: - PrepareSpellScript(spell_item_noggenfogger_elixir_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3)) - return false; - return true; - } + spell_item_noggenfogger_elixir() : SpellScriptLoader("spell_item_noggenfogger_elixir") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_item_noggenfogger_elixir_SpellScript : public SpellScript { - Unit* pCaster = GetCaster(); - if (pCaster->GetTypeId() != TYPEID_PLAYER) - return; + PrepareSpellScript(spell_item_noggenfogger_elixir_SpellScript); - uint32 spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3; - switch (urand(1, 3)) + bool Load() { - case 1: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1; break; - case 2: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2; break; + return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - pCaster->CastSpell(pCaster, spellId, true, NULL); - } + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1) || !sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2) || !sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3)) + return false; + return true; + } - void Register() + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + uint32 spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3; + switch (urand(1, 3)) + { + case 1: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1; break; + case 2: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2; break; + } + + caster->CastSpell(caster, spellId, true, NULL); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_item_noggenfogger_elixir_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_item_noggenfogger_elixir_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_item_noggenfogger_elixir_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_item_noggenfogger_elixir_SpellScript(); - } }; // http://www.wowhead.com/item=6657 Savory Deviate Delight // 8213 Savory Deviate Delight -enum eSavoryDeviateDelight +enum SavoryDeviateDelight { SPELL_FLIP_OUT_MALE = 8219, SPELL_FLIP_OUT_FEMALE = 8220, @@ -488,53 +474,55 @@ enum eSavoryDeviateDelight class spell_item_savory_deviate_delight : public SpellScriptLoader { -public: - spell_item_savory_deviate_delight() : SpellScriptLoader("spell_item_savory_deviate_delight") { } - - class spell_item_savory_deviate_delight_SpellScript : public SpellScript - { public: - PrepareSpellScript(spell_item_savory_deviate_delight_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - for (uint32 spellId = SPELL_FLIP_OUT_MALE; spellId <= SPELL_YAAARRRR_FEMALE; ++spellId) - if (!sSpellMgr->GetSpellInfo(spellId)) - return false; - return true; - } + spell_item_savory_deviate_delight() : SpellScriptLoader("spell_item_savory_deviate_delight") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_item_savory_deviate_delight_SpellScript : public SpellScript { - Unit* pCaster = GetCaster(); - if (pCaster->GetTypeId() != TYPEID_PLAYER) - return; + PrepareSpellScript(spell_item_savory_deviate_delight_SpellScript); - uint32 spellId = 0; - switch (urand(1, 2)) + bool Load() { - // Flip Out - ninja - case 1: spellId = (pCaster->getGender() == GENDER_MALE ? SPELL_FLIP_OUT_MALE : SPELL_FLIP_OUT_FEMALE); break; - // Yaaarrrr - pirate - case 2: spellId = (pCaster->getGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break; + return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - pCaster->CastSpell(pCaster, spellId, true, NULL); - } - void Register() + bool Validate(SpellInfo const* /*spellEntry*/) + { + for (uint32 spellId = SPELL_FLIP_OUT_MALE; spellId <= SPELL_YAAARRRR_FEMALE; ++spellId) + if (!sSpellMgr->GetSpellInfo(spellId)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + uint32 spellId = 0; + switch (urand(1, 2)) + { + // Flip Out - ninja + case 1: spellId = (caster->getGender() == GENDER_MALE ? SPELL_FLIP_OUT_MALE : SPELL_FLIP_OUT_FEMALE); break; + // Yaaarrrr - pirate + case 2: spellId = (caster->getGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break; + } + caster->CastSpell(caster, spellId, true, NULL); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_item_savory_deviate_delight_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_item_savory_deviate_delight_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_item_savory_deviate_delight_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_item_savory_deviate_delight_SpellScript(); - } }; // http://www.wowhead.com/item=7734 Six Demon Bag // 14537 Six Demon Bag -enum eSixDemonBagSpells +enum SixDemonBagSpells { SPELL_FROSTBOLT = 11538, SPELL_POLYMORPH = 14621, @@ -546,77 +534,66 @@ enum eSixDemonBagSpells class spell_item_six_demon_bag : public SpellScriptLoader { -public: - spell_item_six_demon_bag() : SpellScriptLoader("spell_item_six_demon_bag") { } - - class spell_item_six_demon_bag_SpellScript : public SpellScript - { public: - PrepareSpellScript(spell_item_six_demon_bag_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_FROSTBOLT)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_POLYMORPH)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_FELHOUND_MINION)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_FIREBALL)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_CHAIN_LIGHTNING)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_ENVELOPING_WINDS)) - return false; - return true; - } + spell_item_six_demon_bag() : SpellScriptLoader("spell_item_six_demon_bag") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_item_six_demon_bag_SpellScript : public SpellScript { - if (Unit* target = GetHitUnit()) + PrepareSpellScript(spell_item_six_demon_bag_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) { - Unit* pCaster = GetCaster(); + if (!sSpellMgr->GetSpellInfo(SPELL_FROSTBOLT) || !sSpellMgr->GetSpellInfo(SPELL_POLYMORPH) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_FELHOUND_MINION) || !sSpellMgr->GetSpellInfo(SPELL_FIREBALL) || !sSpellMgr->GetSpellInfo(SPELL_CHAIN_LIGHTNING) || !sSpellMgr->GetSpellInfo(SPELL_ENVELOPING_WINDS)) + return false; + return true; + } - uint32 spellId = 0; - uint32 rand = urand(0, 99); - if (rand < 25) // Fireball (25% chance) - spellId = SPELL_FIREBALL; - else if (rand < 50) // Frostball (25% chance) - spellId = SPELL_FROSTBOLT; - else if (rand < 70) // Chain Lighting (20% chance) - spellId = SPELL_CHAIN_LIGHTNING; - else if (rand < 80) // Polymorph (10% chance) - { - spellId = SPELL_POLYMORPH; - if (urand(0, 100) <= 30) // 30% chance to self-cast - target = pCaster; - } - else if (rand < 95) // Enveloping Winds (15% chance) - spellId = SPELL_ENVELOPING_WINDS; - else // Summon Felhund minion (5% chance) + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) { - spellId = SPELL_SUMMON_FELHOUND_MINION; - target = pCaster; + uint32 spellId = 0; + uint32 rand = urand(0, 99); + if (rand < 25) // Fireball (25% chance) + spellId = SPELL_FIREBALL; + else if (rand < 50) // Frostball (25% chance) + spellId = SPELL_FROSTBOLT; + else if (rand < 70) // Chain Lighting (20% chance) + spellId = SPELL_CHAIN_LIGHTNING; + else if (rand < 80) // Polymorph (10% chance) + { + spellId = SPELL_POLYMORPH; + if (urand(0, 100) <= 30) // 30% chance to self-cast + target = caster; + } + else if (rand < 95) // Enveloping Winds (15% chance) + spellId = SPELL_ENVELOPING_WINDS; + else // Summon Felhund minion (5% chance) + { + spellId = SPELL_SUMMON_FELHOUND_MINION; + target = caster; + } + + caster->CastSpell(target, spellId, true, GetCastItem()); } + } - pCaster->CastSpell(target, spellId, true, GetCastItem()); + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_six_demon_bag_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } - } + }; - void Register() + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_item_six_demon_bag_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_item_six_demon_bag_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_item_six_demon_bag_SpellScript(); - } }; // http://www.wowhead.com/item=44012 Underbelly Elixir // 59640 Underbelly Elixir -enum eUnderbellyElixirSpells +enum UnderbellyElixirSpells { SPELL_UNDERBELLY_ELIXIR_TRIGGERED1 = 59645, SPELL_UNDERBELLY_ELIXIR_TRIGGERED2 = 59831, @@ -625,49 +602,46 @@ enum eUnderbellyElixirSpells class spell_item_underbelly_elixir : public SpellScriptLoader { -public: - spell_item_underbelly_elixir() : SpellScriptLoader("spell_item_underbelly_elixir") { } - - class spell_item_underbelly_elixir_SpellScript : public SpellScript - { public: - PrepareSpellScript(spell_item_underbelly_elixir_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED1)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED2)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED3)) - return false; - return true; - } + spell_item_underbelly_elixir() : SpellScriptLoader("spell_item_underbelly_elixir") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_item_underbelly_elixir_SpellScript : public SpellScript { - Unit* pCaster = GetCaster(); - if (pCaster->GetTypeId() != TYPEID_PLAYER) - return; + PrepareSpellScript(spell_item_underbelly_elixir_SpellScript); - uint32 spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED3; - switch (urand(1, 3)) + bool Load() { - case 1: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED1; break; - case 2: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED2; break; + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED1) || !sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED2) || !sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED3)) + return false; + return true; } - pCaster->CastSpell(pCaster, spellId, true, NULL); - } - void Register() + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + uint32 spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED3; + switch (urand(1, 3)) + { + case 1: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED1; break; + case 2: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED2; break; + } + caster->CastSpell(caster, spellId, true, NULL); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_item_underbelly_elixir_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_item_underbelly_elixir_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_item_underbelly_elixir_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_item_underbelly_elixir_SpellScript(); - } }; enum eShadowmourneVisuals @@ -684,17 +658,11 @@ public: class spell_item_shadowmourne_AuraScript : public AuraScript { - public: - PrepareAuraScript(spell_item_shadowmourne_AuraScript) - spell_item_shadowmourne_AuraScript() : AuraScript() { } + PrepareAuraScript(spell_item_shadowmourne_AuraScript); bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_LOW)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_HIGH)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_LOW) || !sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_HIGH) || !sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF)) return false; return true; } @@ -702,7 +670,6 @@ public: void OnStackChange(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); - switch (GetStackAmount()) { case 1: @@ -716,6 +683,8 @@ public: target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_HIGH); target->CastSpell(target, SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF, true); break; + default: + break; } } @@ -757,11 +726,7 @@ class spell_item_red_rider_air_rifle : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_HOLD_VISUAL)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_SHOOT)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_SHOOT_SELF)) + if (!sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_HOLD_VISUAL) || !sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_SHOOT) || !sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_SHOOT_SELF)) return false; return true; } @@ -769,17 +734,18 @@ class spell_item_red_rider_air_rifle : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - if (!GetHitUnit()) - return; - - GetCaster()->CastSpell(GetCaster(), SPELL_AIR_RIFLE_HOLD_VISUAL, true); - // needed because this spell shares GCD with its triggered spells (which must not be cast with triggered flag) - if (Player* player = GetCaster()->ToPlayer()) - player->GetGlobalCooldownMgr().CancelGlobalCooldown(GetSpellInfo()); - if (urand(0, 4)) - GetCaster()->CastSpell(GetHitUnit(), SPELL_AIR_RIFLE_SHOOT, false); - else - GetCaster()->CastSpell(GetCaster(), SPELL_AIR_RIFLE_SHOOT_SELF, false); + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + { + caster->CastSpell(caster, SPELL_AIR_RIFLE_HOLD_VISUAL, true); + // needed because this spell shares GCD with its triggered spells (which must not be cast with triggered flag) + if (Player* player = caster->ToPlayer()) + player->GetGlobalCooldownMgr().CancelGlobalCooldown(GetSpellInfo()); + if (urand(0, 4)) + caster->CastSpell(target, SPELL_AIR_RIFLE_SHOOT, false); + else + caster->CastSpell(caster, SPELL_AIR_RIFLE_SHOOT_SELF, false); + } } void Register() @@ -794,7 +760,7 @@ class spell_item_red_rider_air_rifle : public SpellScriptLoader } }; -enum eGenericData +enum GenericData { SPELL_ARCANITE_DRAGONLING = 19804, SPELL_BATTLE_CHICKEN = 13166, @@ -826,14 +792,11 @@ class spell_item_create_heart_candy : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - if (!GetHitUnit() || !GetHitUnit()->ToPlayer()) - return; - - Player* target = GetHitUnit()->ToPlayer(); - - static const uint32 items[] = {ITEM_HEART_CANDY_1, ITEM_HEART_CANDY_2, ITEM_HEART_CANDY_3, ITEM_HEART_CANDY_4, ITEM_HEART_CANDY_5, ITEM_HEART_CANDY_6, ITEM_HEART_CANDY_7, ITEM_HEART_CANDY_8}; - - target->AddItem(items[urand(0, 7)], 1); + if (Player* target = GetHitPlayer()) + { + static const uint32 items[] = {ITEM_HEART_CANDY_1, ITEM_HEART_CANDY_2, ITEM_HEART_CANDY_3, ITEM_HEART_CANDY_4, ITEM_HEART_CANDY_5, ITEM_HEART_CANDY_6, ITEM_HEART_CANDY_7, ITEM_HEART_CANDY_8}; + target->AddItem(items[urand(0, 7)], 1); + } } void Register() @@ -857,9 +820,14 @@ class spell_item_book_of_glyph_mastery : public SpellScriptLoader { PrepareSpellScript(spell_item_book_of_glyph_mastery_SpellScript); + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + SpellCastResult CheckRequirement() { - if (GetCaster()->GetTypeId() == TYPEID_PLAYER && HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer())) + if (HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer())) { SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_LEARNED_EVERYTHING); return SPELL_FAILED_CUSTOM_ERROR; @@ -939,7 +907,7 @@ class spell_item_map_of_the_geyser_fields : public SpellScriptLoader SpellCastResult CheckSinkholes() { Unit* caster = GetCaster(); - if (caster->FindNearestCreature(NPC_SOUTH_SINKHOLE, 30.0f, true) || + if (caster->FindNearestCreature(NPC_SOUTH_SINKHOLE, 30.0f, true) || caster->FindNearestCreature(NPC_NORTHEAST_SINKHOLE, 30.0f, true) || caster->FindNearestCreature(NPC_NORTHWEST_SINKHOLE, 30.0f, true)) return SPELL_CAST_OK; @@ -978,11 +946,7 @@ class spell_item_vanquished_clutches : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_CRUSHER)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_CONSTRICTOR)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_CORRUPTOR)) + if (!sSpellMgr->GetSpellInfo(SPELL_CRUSHER) || !sSpellMgr->GetSpellInfo(SPELL_CONSTRICTOR) || !sSpellMgr->GetSpellInfo(SPELL_CORRUPTOR)) return false; return true; } @@ -990,7 +954,8 @@ class spell_item_vanquished_clutches : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { uint32 spellId = RAND(SPELL_CRUSHER, SPELL_CONSTRICTOR, SPELL_CORRUPTOR); - GetCaster()->CastSpell(GetCaster(), spellId, true); + Unit* caster = GetCaster(); + caster->CastSpell(caster, spellId, true); } void Register() @@ -1019,9 +984,6 @@ enum AshbringerSounds SOUND_ASHBRINGER_10 = 8926, // "Scarlet Crusade is pure no longer" SOUND_ASHBRINGER_11 = 8927, // "Balnazzar's crusade corrupted my son" SOUND_ASHBRINGER_12 = 8928, // "Kill them all!" - - SPELL_ASHBRINGER = 28282, // Ashbringer - Inflicts the will of the Ashbringer upon the wielder - SPELL_ASHBRINGER_TR = 28441 // AB Effect 000 }; class spell_item_ashbringer : public SpellScriptLoader @@ -1031,28 +993,24 @@ class spell_item_ashbringer : public SpellScriptLoader class spell_item_ashbringer_SpellScript : public SpellScript { - PrepareSpellScript(spell_item_ashbringer_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) + PrepareSpellScript(spell_item_ashbringer_SpellScript); + + bool Load() { - if (!sSpellMgr->GetSpellInfo(SPELL_ASHBRINGER)) - return false; - return true; + return GetCaster()->GetTypeId() == TYPEID_PLAYER; } void OnDummyEffect(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - Unit* caster = GetCaster(); - if (Player* player = caster->ToPlayer()) - { - uint32 sound_id = RAND( SOUND_ASHBRINGER_1, SOUND_ASHBRINGER_2, SOUND_ASHBRINGER_3, SOUND_ASHBRINGER_4, SOUND_ASHBRINGER_5, SOUND_ASHBRINGER_6, - SOUND_ASHBRINGER_7, SOUND_ASHBRINGER_8, SOUND_ASHBRINGER_9, SOUND_ASHBRINGER_10, SOUND_ASHBRINGER_11, SOUND_ASHBRINGER_12 ); + Player* player = GetCaster()->ToPlayer(); + uint32 sound_id = RAND( SOUND_ASHBRINGER_1, SOUND_ASHBRINGER_2, SOUND_ASHBRINGER_3, SOUND_ASHBRINGER_4, SOUND_ASHBRINGER_5, SOUND_ASHBRINGER_6, + SOUND_ASHBRINGER_7, SOUND_ASHBRINGER_8, SOUND_ASHBRINGER_9, SOUND_ASHBRINGER_10, SOUND_ASHBRINGER_11, SOUND_ASHBRINGER_12 ); - // Ashbringers effect (spellID 28441) retriggers every 5 seconds, with a chance of making it say one of the above 12 sounds - if (urand(0, 60) < 1) - player->PlayDirectSound(sound_id, player); - } + // Ashbringers effect (spellID 28441) retriggers every 5 seconds, with a chance of making it say one of the above 12 sounds + if (urand(0, 60) < 1) + player->PlayDirectSound(sound_id, player); } void Register() @@ -1080,9 +1038,7 @@ enum MagicEater class spell_magic_eater_food : public SpellScriptLoader { public: - spell_magic_eater_food() : SpellScriptLoader("spell_magic_eater_food") - { - } + spell_magic_eater_food() : SpellScriptLoader("spell_magic_eater_food") {} class spell_magic_eater_food_AuraScript : public AuraScript { @@ -1092,7 +1048,6 @@ class spell_magic_eater_food : public SpellScriptLoader { PreventDefaultAction(); Unit* target = GetTarget(); - switch (urand(0, 5)) { case 0: @@ -1113,7 +1068,7 @@ class spell_magic_eater_food : public SpellScriptLoader case 5: target->CastSpell(target, SPELL_WELL_FED_5, true); break; - } + } } void Register() @@ -1128,6 +1083,872 @@ class spell_magic_eater_food : public SpellScriptLoader } }; +class spell_item_shimmering_vessel : public SpellScriptLoader +{ + public: + spell_item_shimmering_vessel() : SpellScriptLoader("spell_item_shimmering_vessel") { } + + class spell_item_shimmering_vessel_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_shimmering_vessel_SpellScript); + + void HandleDummy(SpellEffIndex /* effIndex */) + { + if (Creature* target = GetHitCreature()) + target->setDeathState(JUST_ALIVED); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_shimmering_vessel_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_shimmering_vessel_SpellScript(); + } +}; + +enum PurifyHelboarMeat +{ + SPELL_SUMMON_PURIFIED_HELBOAR_MEAT = 29277, + SPELL_SUMMON_TOXIC_HELBOAR_MEAT = 29278, +}; + +class spell_item_purify_helboar_meat : public SpellScriptLoader +{ + public: + spell_item_purify_helboar_meat() : SpellScriptLoader("spell_item_purify_helboar_meat") { } + + class spell_item_purify_helboar_meat_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_purify_helboar_meat_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_PURIFIED_HELBOAR_MEAT) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_TOXIC_HELBOAR_MEAT)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + caster->CastSpell(caster, roll_chance_i(50) ? SPELL_SUMMON_PURIFIED_HELBOAR_MEAT : SPELL_SUMMON_TOXIC_HELBOAR_MEAT, true, NULL); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_purify_helboar_meat_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_purify_helboar_meat_SpellScript(); + } +}; + +enum CrystalPrison +{ + OBJECT_IMPRISONED_DOOMGUARD = 179644, +}; + +class spell_item_crystal_prison_dummy_dnd : public SpellScriptLoader +{ + public: + spell_item_crystal_prison_dummy_dnd() : SpellScriptLoader("spell_item_crystal_prison_dummy_dnd") { } + + class spell_item_crystal_prison_dummy_dnd_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_crystal_prison_dummy_dnd_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sObjectMgr->GetGameObjectTemplate(OBJECT_IMPRISONED_DOOMGUARD)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + if (Creature* target = GetHitCreature()) + if (target->isDead() && !target->isPet()) + { + GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0, 0, 0, 0, uint32(target->GetRespawnTime()-time(NULL))); + target->DespawnOrUnsummon(); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_crystal_prison_dummy_dnd_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_crystal_prison_dummy_dnd_SpellScript(); + } +}; + +enum ReindeerTransformation +{ + SPELL_FLYING_REINDEER_310 = 44827, + SPELL_FLYING_REINDEER_280 = 44825, + SPELL_FLYING_REINDEER_60 = 44824, + SPELL_REINDEER_100 = 25859, + SPELL_REINDEER_60 = 25858, +}; + +class spell_item_reindeer_transformation : public SpellScriptLoader +{ + public: + spell_item_reindeer_transformation() : SpellScriptLoader("spell_item_reindeer_transformation") { } + + class spell_item_reindeer_transformation_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_reindeer_transformation_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_FLYING_REINDEER_310) || !sSpellMgr->GetSpellInfo(SPELL_FLYING_REINDEER_280) + || !sSpellMgr->GetSpellInfo(SPELL_FLYING_REINDEER_60) || !sSpellMgr->GetSpellInfo(SPELL_REINDEER_100) + || !sSpellMgr->GetSpellInfo(SPELL_REINDEER_60)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + if (caster->HasAuraType(SPELL_AURA_MOUNTED)) + { + float flyspeed = caster->GetSpeedRate(MOVE_FLIGHT); + float speed = caster->GetSpeedRate(MOVE_RUN); + + caster->RemoveAurasByType(SPELL_AURA_MOUNTED); + //5 different spells used depending on mounted speed and if mount can fly or not + + if (flyspeed >= 4.1f) + // Flying Reindeer + caster->CastSpell(caster, SPELL_FLYING_REINDEER_310, true); //310% flying Reindeer + else if (flyspeed >= 3.8f) + // Flying Reindeer + caster->CastSpell(caster, SPELL_FLYING_REINDEER_280, true); //280% flying Reindeer + else if (flyspeed >= 1.6f) + // Flying Reindeer + caster->CastSpell(caster, SPELL_FLYING_REINDEER_60, true); //60% flying Reindeer + else if (speed >= 2.0f) + // Reindeer + caster->CastSpell(caster, SPELL_REINDEER_100, true); //100% ground Reindeer + else + // Reindeer + caster->CastSpell(caster, SPELL_REINDEER_60, true); //60% ground Reindeer + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_reindeer_transformation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_reindeer_transformation_SpellScript(); + } +}; + +enum NighInvulnerability +{ + SPELL_NIGH_INVULNERABILITY = 30456, + SPELL_COMPLETE_VULNERABILITY = 30457, +}; + +class spell_item_nigh_invulnerability : public SpellScriptLoader +{ + public: + spell_item_nigh_invulnerability() : SpellScriptLoader("spell_item_nigh_invulnerability") { } + + class spell_item_nigh_invulnerability_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_nigh_invulnerability_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_NIGH_INVULNERABILITY) || !sSpellMgr->GetSpellInfo(SPELL_COMPLETE_VULNERABILITY)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + if (Item* castItem = GetCastItem()) + { + if (roll_chance_i(86)) // Nigh-Invulnerability - success + caster->CastSpell(caster, SPELL_NIGH_INVULNERABILITY, true, castItem); + else // Complete Vulnerability - backfire in 14% casts + caster->CastSpell(caster, SPELL_COMPLETE_VULNERABILITY, true, castItem); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_nigh_invulnerability_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_nigh_invulnerability_SpellScript(); + } +}; + +enum Poultryzer +{ + SPELL_POULTRYIZER_SUCCESS = 30501, + SPELL_POULTRYIZER_BACKFIRE = 30504, +}; + +class spell_item_poultryizer : public SpellScriptLoader +{ + public: + spell_item_poultryizer() : SpellScriptLoader("spell_item_poultryizer") { } + + class spell_item_poultryizer_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_poultryizer_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_POULTRYIZER_SUCCESS) || !sSpellMgr->GetSpellInfo(SPELL_POULTRYIZER_BACKFIRE)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + if (GetCastItem() && GetHitUnit()) + GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(80) ? SPELL_POULTRYIZER_SUCCESS : SPELL_POULTRYIZER_BACKFIRE , true, GetCastItem()); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_poultryizer_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_poultryizer_SpellScript(); + } +}; + +enum SocretharsStone +{ + SPELL_SOCRETHAR_TO_SEAT = 35743, + SPELL_SOCRETHAR_FROM_SEAT = 35744, +}; + +class spell_item_socrethars_stone : public SpellScriptLoader +{ + public: + spell_item_socrethars_stone() : SpellScriptLoader("spell_item_socrethars_stone") { } + + class spell_item_socrethars_stone_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_socrethars_stone_SpellScript); + + bool Load() + { + return (GetCaster()->GetAreaId() == 3900 || GetCaster()->GetAreaId() == 3742); + } + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SOCRETHAR_TO_SEAT) || !sSpellMgr->GetSpellInfo(SPELL_SOCRETHAR_FROM_SEAT)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + switch (caster->GetAreaId()) + { + case 3900: + caster->CastSpell(caster, SPELL_SOCRETHAR_TO_SEAT, true); + break; + case 3742: + caster->CastSpell(caster, SPELL_SOCRETHAR_FROM_SEAT, true); + break; + default: + return; + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_socrethars_stone_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_socrethars_stone_SpellScript(); + } +}; + +enum DemonBroiledSurprise +{ + QUEST_SUPER_HOT_STEW = 11379, + SPELL_CREATE_DEMON_BROILED_SURPRISE = 43753, + NPC_ABYSSAL_FLAMEBRINGER = 19973, +}; + +class spell_item_demon_broiled_surprise : public SpellScriptLoader +{ + public: + spell_item_demon_broiled_surprise() : SpellScriptLoader("spell_item_demon_broiled_surprise") { } + + class spell_item_demon_broiled_surprise_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_demon_broiled_surprise_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_DEMON_BROILED_SURPRISE) || !sObjectMgr->GetCreatureTemplate(NPC_ABYSSAL_FLAMEBRINGER) || !sObjectMgr->GetQuestTemplate(QUEST_SUPER_HOT_STEW)) + return false; + return true; + } + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* player = GetCaster(); + player->CastSpell(player, SPELL_CREATE_DEMON_BROILED_SURPRISE, false); + } + + SpellCastResult CheckRequirement() + { + Player* player = GetCaster()->ToPlayer(); + if (player->GetQuestStatus(QUEST_SUPER_HOT_STEW) != QUEST_STATUS_INCOMPLETE) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + + if (Creature* creature = player->FindNearestCreature(NPC_ABYSSAL_FLAMEBRINGER, 10, false)) + if (creature->isDead()) + return SPELL_CAST_OK; + return SPELL_FAILED_NOT_HERE; + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_demon_broiled_surprise_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + OnCheckCast += SpellCheckCastFn(spell_item_demon_broiled_surprise_SpellScript::CheckRequirement); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_demon_broiled_surprise_SpellScript(); + } +}; + +enum CompleteRaptorCapture +{ + SPELL_RAPTOR_CAPTURE_CREDIT = 42337, +}; + +class spell_item_complete_raptor_capture : public SpellScriptLoader +{ + public: + spell_item_complete_raptor_capture() : SpellScriptLoader("spell_item_complete_raptor_capture") { } + + class spell_item_complete_raptor_capture_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_complete_raptor_capture_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_RAPTOR_CAPTURE_CREDIT)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + if (GetHitCreature()) + { + GetHitCreature()->DespawnOrUnsummon(); + + //cast spell Raptor Capture Credit + caster->CastSpell(caster, SPELL_RAPTOR_CAPTURE_CREDIT, true, NULL); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_complete_raptor_capture_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_complete_raptor_capture_SpellScript(); + } +}; + +enum ImpaleLeviroth +{ + NPC_LEVIROTH = 26452, + SPELL_LEVIROTH_SELF_IMPALE = 49882 +}; + +class spell_item_impale_leviroth : public SpellScriptLoader +{ + public: + spell_item_impale_leviroth() : SpellScriptLoader("spell_item_impale_leviroth") { } + + class spell_item_impale_leviroth_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_impale_leviroth_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sObjectMgr->GetCreatureTemplate(NPC_LEVIROTH)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* target = GetHitCreature(); + if (!target || target->GetEntry() != NPC_LEVIROTH || !target->HealthBelowPct(95)) + return; + + target->CastSpell(target, SPELL_LEVIROTH_SELF_IMPALE, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_impale_leviroth_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_impale_leviroth_SpellScript(); + } +}; + +enum BrewfestMountTransformation +{ + SPELL_MOUNT_RAM_100 = 43900, + SPELL_MOUNT_RAM_60 = 43899, + SPELL_MOUNT_KODO_100 = 49379, + SPELL_MOUNT_KODO_60 = 49378, + SPELL_BREWFEST_MOUNT_TRANSFORM = 49357, + SPELL_BREWFEST_MOUNT_TRANSFORM_REVERSE = 52845, +}; + +class spell_item_brewfest_mount_transformation : public SpellScriptLoader +{ + public: + spell_item_brewfest_mount_transformation() : SpellScriptLoader("spell_item_brewfest_mount_transformation") { } + + class spell_item_brewfest_mount_transformation_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_brewfest_mount_transformation_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MOUNT_RAM_100) || !sSpellMgr->GetSpellInfo(SPELL_MOUNT_RAM_60) || !sSpellMgr->GetSpellInfo(SPELL_MOUNT_KODO_100) || !sSpellMgr->GetSpellInfo(SPELL_MOUNT_KODO_60)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Player* caster = GetCaster()->ToPlayer(); + if (caster->HasAuraType(SPELL_AURA_MOUNTED)) + { + caster->RemoveAurasByType(SPELL_AURA_MOUNTED); + uint32 spell_id; + + switch (GetSpellInfo()->Id) + { + case SPELL_BREWFEST_MOUNT_TRANSFORM: + if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f) + spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100 ; + else + spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60 ; + break; + case SPELL_BREWFEST_MOUNT_TRANSFORM_REVERSE: + if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f) + spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100 ; + else + spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60 ; + break; + default: + return; + } + caster->CastSpell(caster, spell_id, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_brewfest_mount_transformation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_brewfest_mount_transformation_SpellScript(); + } +}; + +enum NitroBoots +{ + SPELL_NITRO_BOOTS_SUCCESS = 54861, + SPELL_NITRO_BOOTS_BACKFIRE = 46014, +}; + +class spell_item_nitro_boots : public SpellScriptLoader +{ + public: + spell_item_nitro_boots() : SpellScriptLoader("spell_item_nitro_boots") { } + + class spell_item_nitro_boots_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_nitro_boots_SpellScript); + + bool Load() + { + if (!GetCastItem()) + return false; + return true; + } + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_NITRO_BOOTS_SUCCESS) || !sSpellMgr->GetSpellInfo(SPELL_NITRO_BOOTS_BACKFIRE)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + caster->CastSpell(caster, roll_chance_i(95) ? SPELL_NITRO_BOOTS_SUCCESS : SPELL_NITRO_BOOTS_BACKFIRE, true, GetCastItem()); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_nitro_boots_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_nitro_boots_SpellScript(); + } +}; + +enum TeachLanguage +{ + SPELL_LEARN_GNOMISH_BINARY = 50242, + SPELL_LEARN_GOBLIN_BINARY = 50246, +}; + +class spell_item_teach_language : public SpellScriptLoader +{ + public: + spell_item_teach_language() : SpellScriptLoader("spell_item_teach_language") { } + + class spell_item_teach_language_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_teach_language_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_LEARN_GNOMISH_BINARY) || !sSpellMgr->GetSpellInfo(SPELL_LEARN_GOBLIN_BINARY)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Player* caster = GetCaster()->ToPlayer(); + + if (roll_chance_i(34)) + caster->CastSpell(caster,caster->GetTeam() == ALLIANCE ? SPELL_LEARN_GNOMISH_BINARY : SPELL_LEARN_GOBLIN_BINARY, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_teach_language_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_teach_language_SpellScript(); + } +}; + +enum RocketBoots +{ + SPELL_ROCKET_BOOTS_PROC = 30452, +}; + +class spell_item_rocket_boots : public SpellScriptLoader +{ + public: + spell_item_rocket_boots() : SpellScriptLoader("spell_item_rocket_boots") { } + + class spell_item_rocket_boots_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_rocket_boots_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_ROCKET_BOOTS_PROC)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Player* caster = GetCaster()->ToPlayer(); + if (Battleground* bg = caster->GetBattleground()) + bg->EventPlayerDroppedFlag(caster); + + caster->CastSpell(caster, SPELL_ROCKET_BOOTS_PROC, true, NULL); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_rocket_boots_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_rocket_boots_SpellScript(); + } +}; + +enum PygmyOil +{ + SPELL_PYGMY_OIL_PYGMY_AURA = 53806, + SPELL_PYGMY_OIL_SMALLER_AURA = 53805, +}; + +class spell_item_pygmy_oil : public SpellScriptLoader +{ + public: + spell_item_pygmy_oil() : SpellScriptLoader("spell_item_pygmy_oil") { } + + class spell_item_pygmy_oil_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_pygmy_oil_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PYGMY_OIL_PYGMY_AURA) || !sSpellMgr->GetSpellInfo(SPELL_PYGMY_OIL_SMALLER_AURA)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + if (Aura* aura = caster->GetAura(SPELL_PYGMY_OIL_PYGMY_AURA)) + aura->RefreshDuration(); + else + { + aura = caster->GetAura(SPELL_PYGMY_OIL_SMALLER_AURA); + if (!aura || aura->GetStackAmount() < 5 || !roll_chance_i(50)) + caster->CastSpell(caster, SPELL_PYGMY_OIL_SMALLER_AURA, true); + else + { + aura->Remove(); + caster->CastSpell(caster, SPELL_PYGMY_OIL_PYGMY_AURA, true); + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_pygmy_oil_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_pygmy_oil_SpellScript(); + } +}; + +class spell_item_unusual_compass : public SpellScriptLoader +{ + public: + spell_item_unusual_compass() : SpellScriptLoader("spell_item_unusual_compass") { } + + class spell_item_unusual_compass_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_unusual_compass_SpellScript); + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + caster->SetOrientation(frand(0.0f, 62832.0f) / 10000.0f); + caster->SendMovementFlagUpdate(); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_unusual_compass_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_unusual_compass_SpellScript(); + } +}; + +enum UDED +{ + NPC_IRONWOOL_MAMMOTH = 53806, + SPELL_MAMMOTH_CARCASS = 57444, + SPELL_MAMMOTH_MEAT = 54625, +}; + +class spell_item_uded : public SpellScriptLoader +{ + public: + spell_item_uded() : SpellScriptLoader("spell_item_uded") { } + + class spell_item_uded_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_uded_SpellScript); + + bool Load() + { + if (GetHitCreature() && GetHitCreature()->GetEntry() == NPC_IRONWOOL_MAMMOTH) + return true; + return false; + } + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAMMOTH_CARCASS) || !sSpellMgr->GetSpellInfo(SPELL_MAMMOTH_MEAT)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + Creature* creature = GetHitCreature(); + caster->CastSpell(caster,SPELL_MAMMOTH_CARCASS,true); + + for (uint8 i = 0; i < 4; ++i) + caster->CastSpell(caster,SPELL_MAMMOTH_MEAT,true); + + creature->Kill(creature); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_uded_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_uded_SpellScript(); + } +}; + +enum ChickenCover +{ + SPELL_CHICKEN_NET = 51959, + SPELL_CAPTURE_CHICKEN_ESCAPE = 51037, + QUEST_CHICKEN_PARTY = 12702, + QUEST_FLOWN_THE_COOP = 12532, +}; + +class spell_item_chicken_cover : public SpellScriptLoader +{ + public: + spell_item_chicken_cover() : SpellScriptLoader("spell_item_chicken_cover") { } + + class spell_item_chicken_cover_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_chicken_cover_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_CHICKEN_NET) || !sSpellMgr->GetSpellInfo(SPELL_CAPTURE_CHICKEN_ESCAPE) || !sObjectMgr->GetQuestTemplate(QUEST_CHICKEN_PARTY) || !sObjectMgr->GetQuestTemplate(QUEST_FLOWN_THE_COOP)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Player* caster = GetCaster()->ToPlayer(); + if (Unit* target = GetHitUnit()) + { + if (!target->HasAura(SPELL_CHICKEN_NET) && (caster->GetQuestStatus(QUEST_CHICKEN_PARTY) == QUEST_STATUS_INCOMPLETE || caster->GetQuestStatus(QUEST_FLOWN_THE_COOP) == QUEST_STATUS_INCOMPLETE)) + { + caster->CastSpell(caster, SPELL_CAPTURE_CHICKEN_ESCAPE, true); + target->Kill(target); + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_chicken_cover_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_chicken_cover_SpellScript(); + } +}; + enum Refocus { SPELL_AIMED_SHOT = 19434, @@ -1206,4 +2027,22 @@ void AddSC_item_spell_scripts() new spell_item_ashbringer(); new spell_magic_eater_food(); new spell_item_refocus(); + new spell_item_shimmering_vessel(); + new spell_item_purify_helboar_meat(); + new spell_item_crystal_prison_dummy_dnd(); + new spell_item_reindeer_transformation(); + new spell_item_nigh_invulnerability(); + new spell_item_poultryizer(); + new spell_item_socrethars_stone(); + new spell_item_demon_broiled_surprise(); + new spell_item_complete_raptor_capture(); + new spell_item_impale_leviroth(); + new spell_item_brewfest_mount_transformation(); + new spell_item_nitro_boots(); + new spell_item_teach_language(); + new spell_item_rocket_boots(); + new spell_item_pygmy_oil(); + new spell_item_unusual_compass(); + new spell_item_uded(); + new spell_item_chicken_cover(); } diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index b0b619c8b08..ea1af10816b 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -21,7 +21,10 @@ * Scriptnames of files in this file should be prefixed with "spell_mage_". */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" + enum MageSpells { @@ -45,7 +48,8 @@ class spell_mage_blast_wave : public SpellScriptLoader class spell_mage_blast_wave_SpellScript : public SpellScript { - PrepareSpellScript(spell_mage_blast_wave_SpellScript) + PrepareSpellScript(spell_mage_blast_wave_SpellScript); + bool Validate(SpellInfo const* /*spellEntry*/) { if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_BLAST_WAVE)) @@ -78,16 +82,19 @@ class spell_mage_cold_snap : public SpellScriptLoader class spell_mage_cold_snap_SpellScript : public SpellScript { - PrepareSpellScript(spell_mage_cold_snap_SpellScript) - void HandleDummy(SpellEffIndex /*effIndex*/) + PrepareSpellScript(spell_mage_cold_snap_SpellScript); + + bool Load() { - Unit* caster = GetCaster(); + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - if (caster->GetTypeId() != TYPEID_PLAYER) - return; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); // immediately finishes the cooldown on Frost spells - const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap(); + const SpellCooldowns& cm = caster->GetSpellCooldownMap(); for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); @@ -96,7 +103,7 @@ class spell_mage_cold_snap : public SpellScriptLoader (spellInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) && spellInfo->Id != SPELL_MAGE_COLD_SNAP && spellInfo->GetRecoveryTime() > 0) { - caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true); + caster->RemoveSpellCooldown((itr++)->first, true); } else ++itr; @@ -123,7 +130,8 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript { - PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript) + PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript); + static const uint32 spell_list[6]; bool Validate(SpellInfo const* /*spellEntry*/) @@ -172,14 +180,11 @@ class spell_mage_summon_water_elemental : public SpellScriptLoader class spell_mage_summon_water_elemental_SpellScript : public SpellScript { - PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript) + PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript); + bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT)) + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT)) return false; return true; } @@ -210,78 +215,79 @@ class spell_mage_summon_water_elemental : public SpellScriptLoader // Frost Warding class spell_mage_frost_warding_trigger : public SpellScriptLoader { -public: - spell_mage_frost_warding_trigger() : SpellScriptLoader("spell_mage_frost_warding_trigger") { } - - class spell_mage_frost_warding_trigger_AuraScript : public AuraScript - { - PrepareAuraScript(spell_mage_frost_warding_trigger_AuraScript); + public: + spell_mage_frost_warding_trigger() : SpellScriptLoader("spell_mage_frost_warding_trigger") { } - enum Spells + class spell_mage_frost_warding_trigger_AuraScript : public AuraScript { - SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776, - SPELL_MAGE_FROST_WARDING_R1 = 28332, - }; + PrepareAuraScript(spell_mage_frost_warding_trigger_AuraScript); - bool Validate(SpellInfo const* /*spellEntry*/) - { - return sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED) - && sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1); - } + enum Spells + { + SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776, + SPELL_MAGE_FROST_WARDING_R1 = 28332, + }; - void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) - { - Unit* target = GetTarget(); - if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_FROST_WARDING_R1, EFFECT_0)) + bool Validate(SpellInfo const* /*spellEntry*/) { - int32 chance = talentAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1)) + return false; + return true; + } - if (roll_chance_i(chance)) + void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) + { + Unit* target = GetTarget(); + if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_FROST_WARDING_R1, EFFECT_0)) { - absorbAmount = dmgInfo.GetDamage(); - int32 bp = absorbAmount; - target->CastCustomSpell(target, SPELL_MAGE_FROST_WARDING_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + int32 chance = talentAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + + if (roll_chance_i(chance)) + { + absorbAmount = dmgInfo.GetDamage(); + int32 bp = absorbAmount; + target->CastCustomSpell(target, SPELL_MAGE_FROST_WARDING_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + } } } - } - void Register() + void Register() + { + OnEffectAbsorb += AuraEffectAbsorbFn(spell_mage_frost_warding_trigger_AuraScript::Absorb, EFFECT_0); + } + }; + + AuraScript* GetAuraScript() const { - OnEffectAbsorb += AuraEffectAbsorbFn(spell_mage_frost_warding_trigger_AuraScript::Absorb, EFFECT_0); + return new spell_mage_frost_warding_trigger_AuraScript(); } - }; - - AuraScript* GetAuraScript() const - { - return new spell_mage_frost_warding_trigger_AuraScript(); - } }; class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript { -public: - enum Spells - { - SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413, - SPELL_MAGE_INCANTERS_ABSORBTION_R1 = 44394, - }; - - bool Validate(SpellInfo const* /*spellEntry*/) - { - return sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED) - && sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_R1); - } + public: + enum Spells + { + SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413, + SPELL_MAGE_INCANTERS_ABSORBTION_R1 = 44394, + }; - void Trigger(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) - { - Unit* target = GetTarget(); + bool Validate(SpellInfo const* /*spellEntry*/) + { + return sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED) + && sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_R1); + } - if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_INCANTERS_ABSORBTION_R1, EFFECT_0)) + void Trigger(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) { - int32 bp = CalculatePctN(absorbAmount, talentAurEff->GetAmount()); - target->CastCustomSpell(target, SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + Unit* target = GetTarget(); + + if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_INCANTERS_ABSORBTION_R1, EFFECT_0)) + { + int32 bp = CalculatePctN(absorbAmount, talentAurEff->GetAmount()); + target->CastCustomSpell(target, SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + } } - } }; // Incanter's Absorption diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 39360e04aa1..d823c629d4b 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -21,9 +21,11 @@ * Scriptnames of files in this file should be prefixed with "spell_pal_". */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "SpellScript.h" #include "SpellAuraEffects.h" + enum PaladinSpells { PALADIN_SPELL_DIVINE_PLEA = 54428, @@ -46,323 +48,369 @@ enum PaladinSpells // 31850 - Ardent Defender class spell_pal_ardent_defender : public SpellScriptLoader { -public: - spell_pal_ardent_defender() : SpellScriptLoader("spell_pal_ardent_defender") { } + public: + spell_pal_ardent_defender() : SpellScriptLoader("spell_pal_ardent_defender") { } - class spell_pal_ardent_defender_AuraScript : public AuraScript - { - PrepareAuraScript(spell_pal_ardent_defender_AuraScript); + class spell_pal_ardent_defender_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_ardent_defender_AuraScript); - uint32 absorbPct, healPct; + uint32 absorbPct, healPct; - enum Spell - { - PAL_SPELL_ARDENT_DEFENDER_HEAL = 66235, - }; + enum Spell + { + PAL_SPELL_ARDENT_DEFENDER_HEAL = 66235, + }; - bool Load() - { - healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); - absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); - return GetUnitOwner()->ToPlayer(); - } + bool Load() + { + healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); + return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER; + } - void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) - { - // Set absorbtion amount to unlimited - amount = -1; - } + void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) + { + // Set absorbtion amount to unlimited + amount = -1; + } - void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) - { - Unit* victim = GetTarget(); - int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage(); - uint32 allowedHealth = victim->CountPctFromMaxHealth(35); - // If damage kills us - if (remainingHealth <= 0 && !victim->ToPlayer()->HasSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL)) + void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) { - // Cast healing spell, completely avoid damage - absorbAmount = dmgInfo.GetDamage(); - - uint32 defenseSkillValue = victim->GetDefenseSkillValue(); - // Max heal when defense skill denies critical hits from raid bosses - // Formula: max defense at level + 140 (raiting from gear) - uint32 reqDefForMaxHeal = victim->getLevel() * 5 + 140; - float pctFromDefense = (defenseSkillValue >= reqDefForMaxHeal) - ? 1.0f - : float(defenseSkillValue) / float(reqDefForMaxHeal); - - int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense))); - victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff); - victim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, time(NULL) + 120); + Unit* victim = GetTarget(); + int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage(); + uint32 allowedHealth = victim->CountPctFromMaxHealth(35); + // If damage kills us + if (remainingHealth <= 0 && !victim->ToPlayer()->HasSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL)) + { + // Cast healing spell, completely avoid damage + absorbAmount = dmgInfo.GetDamage(); + + uint32 defenseSkillValue = victim->GetDefenseSkillValue(); + // Max heal when defense skill denies critical hits from raid bosses + // Formula: max defense at level + 140 (raiting from gear) + uint32 reqDefForMaxHeal = victim->getLevel() * 5 + 140; + float pctFromDefense = (defenseSkillValue >= reqDefForMaxHeal) + ? 1.0f + : float(defenseSkillValue) / float(reqDefForMaxHeal); + + int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense))); + victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff); + victim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, time(NULL) + 120); + } + else if (remainingHealth < int32(allowedHealth)) + { + // Reduce damage that brings us under 35% (or full damage if we are already under 35%) by x% + uint32 damageToReduce = (victim->GetHealth() < allowedHealth) + ? dmgInfo.GetDamage() + : allowedHealth - remainingHealth; + absorbAmount = CalculatePctN(damageToReduce, absorbPct); + } } - else if (remainingHealth < int32(allowedHealth)) + + void Register() { - // Reduce damage that brings us under 35% (or full damage if we are already under 35%) by x% - uint32 damageToReduce = (victim->GetHealth() < allowedHealth) - ? dmgInfo.GetDamage() - : allowedHealth - remainingHealth; - absorbAmount = CalculatePctN(damageToReduce, absorbPct); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pal_ardent_defender_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + OnEffectAbsorb += AuraEffectAbsorbFn(spell_pal_ardent_defender_AuraScript::Absorb, EFFECT_0); } - } + }; - void Register() + AuraScript* GetAuraScript() const { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pal_ardent_defender_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); - OnEffectAbsorb += AuraEffectAbsorbFn(spell_pal_ardent_defender_AuraScript::Absorb, EFFECT_0); + return new spell_pal_ardent_defender_AuraScript(); } - }; - - AuraScript* GetAuraScript() const - { - return new spell_pal_ardent_defender_AuraScript(); - } }; class spell_pal_blessing_of_faith : public SpellScriptLoader { -public: - spell_pal_blessing_of_faith() : SpellScriptLoader("spell_pal_blessing_of_faith") { } + public: + spell_pal_blessing_of_faith() : SpellScriptLoader("spell_pal_blessing_of_faith") { } - class spell_pal_blessing_of_faith_SpellScript : public SpellScript - { - PrepareSpellScript(spell_pal_blessing_of_faith_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_pal_blessing_of_faith_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_DRUID)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PALADIN)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PRIEST)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN)) - return false; - return true; - } + PrepareSpellScript(spell_pal_blessing_of_faith_SpellScript); - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Unit* unitTarget = GetHitUnit()) + bool Validate(SpellInfo const* /*spellEntry*/) { - uint32 spell_id = 0; - switch (unitTarget->getClass()) + if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_DRUID) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PALADIN) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PRIEST) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* unitTarget = GetHitUnit()) { - case CLASS_DRUID: spell_id = SPELL_BLESSING_OF_LOWER_CITY_DRUID; break; - case CLASS_PALADIN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PALADIN; break; - case CLASS_PRIEST: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PRIEST; break; - case CLASS_SHAMAN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_SHAMAN; break; - default: return; // ignore for non-healing classes + uint32 spell_id = 0; + switch (unitTarget->getClass()) + { + case CLASS_DRUID: spell_id = SPELL_BLESSING_OF_LOWER_CITY_DRUID; break; + case CLASS_PALADIN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PALADIN; break; + case CLASS_PRIEST: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PRIEST; break; + case CLASS_SHAMAN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_SHAMAN; break; + default: return; // ignore for non-healing classes + } + Unit* caster = GetCaster(); + caster->CastSpell(caster, spell_id, true); } + } - GetCaster()->CastSpell(GetCaster(), spell_id, true); + void Register() + { + // add dummy effect spell handler to Blessing of Faith + OnEffectHitTarget += SpellEffectFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } - } + }; - void Register() + SpellScript* GetSpellScript() const { - // add dummy effect spell handler to Blessing of Faith - OnEffectHitTarget += SpellEffectFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_pal_blessing_of_faith_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_pal_blessing_of_faith_SpellScript(); - } }; // 20911 Blessing of Sanctuary // 25899 Greater Blessing of Sanctuary class spell_pal_blessing_of_sanctuary : public SpellScriptLoader { -public: - spell_pal_blessing_of_sanctuary() : SpellScriptLoader("spell_pal_blessing_of_sanctuary") { } + public: + spell_pal_blessing_of_sanctuary() : SpellScriptLoader("spell_pal_blessing_of_sanctuary") { } - class spell_pal_blessing_of_sanctuary_AuraScript : public AuraScript - { - PrepareAuraScript(spell_pal_blessing_of_sanctuary_AuraScript) - bool Validate(SpellInfo const* /*entry*/) + class spell_pal_blessing_of_sanctuary_AuraScript : public AuraScript { - if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF)) - return false; - return true; - } + PrepareAuraScript(spell_pal_blessing_of_sanctuary_AuraScript); - void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - if (Unit* pCaster = GetCaster()) - pCaster->CastSpell(target, PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, true); - } + bool Validate(SpellInfo const* /*entry*/) + { + if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF)) + return false; + return true; + } - void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - target->RemoveAura(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID()); - } + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (Unit* caster = GetCaster()) + caster->CastSpell(target, PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, true); + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->RemoveAura(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID()); + } - void Register() + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_pal_blessing_of_sanctuary_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + AfterEffectRemove += AuraEffectRemoveFn(spell_pal_blessing_of_sanctuary_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } + }; + + AuraScript* GetAuraScript() const { - AfterEffectApply += AuraEffectApplyFn(spell_pal_blessing_of_sanctuary_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - AfterEffectRemove += AuraEffectRemoveFn(spell_pal_blessing_of_sanctuary_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + return new spell_pal_blessing_of_sanctuary_AuraScript(); } - }; - - AuraScript* GetAuraScript() const - { - return new spell_pal_blessing_of_sanctuary_AuraScript(); - } }; // 63521 Guarded by The Light class spell_pal_guarded_by_the_light : public SpellScriptLoader { -public: - spell_pal_guarded_by_the_light() : SpellScriptLoader("spell_pal_guarded_by_the_light") { } + public: + spell_pal_guarded_by_the_light() : SpellScriptLoader("spell_pal_guarded_by_the_light") { } - class spell_pal_guarded_by_the_light_SpellScript : public SpellScript - { - PrepareSpellScript(spell_pal_guarded_by_the_light_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_pal_guarded_by_the_light_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_DIVINE_PLEA)) - return false; - return true; - } + PrepareSpellScript(spell_pal_guarded_by_the_light_SpellScript); - void HandleScriptEffect(SpellEffIndex /*effIndex*/) - { - // Divine Plea - if (Aura* aura = GetCaster()->GetAura(PALADIN_SPELL_DIVINE_PLEA)) - aura->RefreshDuration(); - } + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_DIVINE_PLEA)) + return false; + return true; + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + // Divine Plea + if (Aura* aura = GetCaster()->GetAura(PALADIN_SPELL_DIVINE_PLEA)) + aura->RefreshDuration(); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; - void Register() + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + return new spell_pal_guarded_by_the_light_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_pal_guarded_by_the_light_SpellScript(); - } }; class spell_pal_holy_shock : public SpellScriptLoader { -public: - spell_pal_holy_shock() : SpellScriptLoader("spell_pal_holy_shock") { } + public: + spell_pal_holy_shock() : SpellScriptLoader("spell_pal_holy_shock") { } - class spell_pal_holy_shock_SpellScript : public SpellScript - { - PrepareSpellScript(spell_pal_holy_shock_SpellScript) - bool Validate(SpellInfo const* spellEntry) + class spell_pal_holy_shock_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_HOLY_SHOCK_R1)) - return false; + PrepareSpellScript(spell_pal_holy_shock_SpellScript) + bool Validate(SpellInfo const* spellEntry) + { + if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_HOLY_SHOCK_R1)) + return false; - // can't use other spell than holy shock due to spell_ranks dependency - if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) - return false; + // can't use other spell than holy shock due to spell_ranks dependency + if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) + return false; - uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id); - if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true)) - return false; - if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true)) - return false; + uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id); + if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true)) + return false; - return true; - } + return true; + } - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Unit* unitTarget = GetHitUnit()) + void HandleDummy(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); + if (Unit* unitTarget = GetHitUnit()) + { + uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + if (caster->IsFriendlyTo(unitTarget)) + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0); + else + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0); + } + } - uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); - - if (caster->IsFriendlyTo(unitTarget)) - caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0); - else - caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0); + void Register() + { + // add dummy effect spell handler to Holy Shock + OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } - } + }; - void Register() + SpellScript* GetSpellScript() const { - // add dummy effect spell handler to Holy Shock - OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_pal_holy_shock_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_pal_holy_shock_SpellScript(); - } }; class spell_pal_judgement_of_command : public SpellScriptLoader { -public: - spell_pal_judgement_of_command() : SpellScriptLoader("spell_pal_judgement_of_command") { } + public: + spell_pal_judgement_of_command() : SpellScriptLoader("spell_pal_judgement_of_command") { } - class spell_pal_judgement_of_command_SpellScript : public SpellScript - { - PrepareSpellScript(spell_pal_judgement_of_command_SpellScript) - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_pal_judgement_of_command_SpellScript : public SpellScript { - if (Unit* unitTarget = GetHitUnit()) - if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue())) - GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL); - } + PrepareSpellScript(spell_pal_judgement_of_command_SpellScript) + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* unitTarget = GetHitUnit()) + if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue())) + GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL); + } + + void Register() + { + // add dummy effect spell handler to Judgement of Command + OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; - void Register() + SpellScript* GetSpellScript() const { - // add dummy effect spell handler to Judgement of Command - OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_pal_judgement_of_command_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_pal_judgement_of_command_SpellScript(); - } }; class spell_pal_divine_storm : public SpellScriptLoader { -public: - spell_pal_divine_storm() : SpellScriptLoader("spell_pal_divine_storm") { } + public: + spell_pal_divine_storm() : SpellScriptLoader("spell_pal_divine_storm") { } + + class spell_pal_divine_storm_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pal_divine_storm_SpellScript); + + uint32 healPct; + + bool Validate(SpellInfo const* /* spell */) + { + if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM_DUMMY)) + return false; + return true; + } - class spell_pal_divine_storm_SpellScript : public SpellScript - { - PrepareSpellScript(spell_pal_divine_storm_SpellScript); + bool Load() + { + healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster()); + return true; + } - uint32 healPct; + void TriggerHeal() + { + Unit* caster = GetCaster(); + caster->CastCustomSpell(SPELL_DIVINE_STORM_DUMMY, SPELLVALUE_BASE_POINT0, (GetHitDamage() * healPct) / 100, caster, true); + } - bool Load() + void Register() + { + AfterHit += SpellHitFn(spell_pal_divine_storm_SpellScript::TriggerHeal); + } + }; + + SpellScript* GetSpellScript() const { - healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster()); - return true; + return new spell_pal_divine_storm_SpellScript(); } +}; - void TriggerHeal() +class spell_pal_divine_storm_dummy : public SpellScriptLoader +{ + public: + spell_pal_divine_storm_dummy() : SpellScriptLoader("spell_pal_divine_storm_dummy") { } + + class spell_pal_divine_storm_dummy_SpellScript : public SpellScript { - GetCaster()->CastCustomSpell(SPELL_DIVINE_STORM_DUMMY, SPELLVALUE_BASE_POINT0, (GetHitDamage() * healPct) / 100, GetCaster(), true); - } + PrepareSpellScript(spell_pal_divine_storm_dummy_SpellScript); - void Register() + bool Validate(SpellInfo const* /* spell */) + { + if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM_HEAL)) + return false; + return true; + } + + void CountTargets(std::list<Unit*>& targetList) + { + _targetCount = targetList.size(); + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + if (!_targetCount || ! GetHitUnit()) + return; + + int32 heal = GetEffectValue() / _targetCount; + GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_DIVINE_STORM_HEAL, &heal, NULL, NULL, true); + } + private: + uint32 _targetCount; + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_pal_divine_storm_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnUnitTargetSelect += SpellUnitTargetFn(spell_pal_divine_storm_dummy_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); + } + }; + + SpellScript* GetSpellScript() const { - AfterHit += SpellHitFn(spell_pal_divine_storm_SpellScript::TriggerHeal); + return new spell_pal_divine_storm_dummy_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_pal_divine_storm_SpellScript(); - } }; void AddSC_paladin_spell_scripts() @@ -374,4 +422,5 @@ void AddSC_paladin_spell_scripts() new spell_pal_holy_shock(); new spell_pal_judgement_of_command(); new spell_pal_divine_storm(); + new spell_pal_divine_storm_dummy(); } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index ee5f6a6d772..b012fe5f183 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -21,7 +21,8 @@ * Scriptnames of files in this file should be prefixed with "spell_pri_". */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "SpellScript.h" #include "SpellAuraEffects.h" #include "GridNotifiers.h" @@ -49,7 +50,9 @@ class spell_pri_guardian_spirit : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - return sSpellMgr->GetSpellInfo(PRIEST_SPELL_GUARDIAN_SPIRIT_HEAL) != NULL; + if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_GUARDIAN_SPIRIT_HEAL)) + return false; + return true; } bool Load() @@ -101,11 +104,8 @@ class spell_pri_mana_burn : public SpellScriptLoader void HandleAfterHit() { - Unit* unitTarget = GetHitUnit(); - if (!unitTarget) - return; - - unitTarget->RemoveAurasWithMechanic((1 << MECHANIC_FEAR) | (1 << MECHANIC_POLYMORPH)); + if (Unit* unitTarget = GetHitUnit()) + unitTarget->RemoveAurasWithMechanic((1 << MECHANIC_FEAR) | (1 << MECHANIC_POLYMORPH)); } void Register() @@ -204,18 +204,19 @@ class spell_pri_penance : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - Unit* unitTarget = GetHitUnit(); - if (!unitTarget || !unitTarget->isAlive()) - return; - Unit* caster = GetCaster(); + if (Unit* unitTarget = GetHitUnit()) + { + if(!unitTarget->isAlive()) + return; - uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); - if (caster->IsFriendlyTo(unitTarget)) - caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_HEAL, rank), false, 0); - else - caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_DAMAGE, rank), false, 0); + if (caster->IsFriendlyTo(unitTarget)) + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_HEAL, rank), false, 0); + else + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_DAMAGE, rank), false, 0); + } } void Register() @@ -243,7 +244,9 @@ class spell_pri_reflective_shield_trigger : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - return sSpellMgr->GetSpellInfo(PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED) && sSpellMgr->GetSpellInfo(PRIEST_SPELL_REFLECTIVE_SHIELD_R1); + if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED) || !sSpellMgr->GetSpellInfo(PRIEST_SPELL_REFLECTIVE_SHIELD_R1)) + return false; + return true; } void Trigger(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) @@ -251,14 +254,13 @@ class spell_pri_reflective_shield_trigger : public SpellScriptLoader Unit* target = GetTarget(); if (dmgInfo.GetAttacker() == target) return; - Unit* caster = GetCaster(); - if (!caster) - return; - if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(PRIEST_SPELL_REFLECTIVE_SHIELD_R1, EFFECT_0)) - { - int32 bp = CalculatePctN(absorbAmount, talentAurEff->GetAmount()); - target->CastCustomSpell(dmgInfo.GetAttacker(), PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); - } + + if (GetCaster()) + if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(PRIEST_SPELL_REFLECTIVE_SHIELD_R1, EFFECT_0)) + { + int32 bp = CalculatePctN(absorbAmount, talentAurEff->GetAmount()); + target->CastCustomSpell(dmgInfo.GetAttacker(), PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + } } void Register() diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 940e494f18f..6de1ffa8376 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -21,48 +21,50 @@ * Scriptnames of files in this file should be prefixed with "spell_q#questID_". */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" #include "Vehicle.h" class spell_generic_quest_update_entry_SpellScript : public SpellScript { - PrepareSpellScript(spell_generic_quest_update_entry_SpellScript) -private: - uint16 _spellEffect; - uint8 _effIndex; - uint32 _originalEntry; - uint32 _newEntry; - bool _shouldAttack; - uint32 _despawnTime; - -public: - spell_generic_quest_update_entry_SpellScript(uint16 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, uint32 despawnTime = 0) : - SpellScript(), _spellEffect(spellEffect), _effIndex(effIndex), _originalEntry(originalEntry), - _newEntry(newEntry), _shouldAttack(shouldAttack), _despawnTime(despawnTime) { } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Creature* creatureTarget = GetHitCreature()) - if (!creatureTarget->isPet() && creatureTarget->GetEntry() == _originalEntry) - { - creatureTarget->UpdateEntry(_newEntry); - if (_shouldAttack && creatureTarget->IsAIEnabled) - creatureTarget->AI()->AttackStart(GetCaster()); + PrepareSpellScript(spell_generic_quest_update_entry_SpellScript); + private: + uint16 _spellEffect; + uint8 _effIndex; + uint32 _originalEntry; + uint32 _newEntry; + bool _shouldAttack; + uint32 _despawnTime; - if (_despawnTime) - creatureTarget->DespawnOrUnsummon(_despawnTime); - } - } + public: + spell_generic_quest_update_entry_SpellScript(uint16 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, uint32 despawnTime = 0) : + SpellScript(), _spellEffect(spellEffect), _effIndex(effIndex), _originalEntry(originalEntry), + _newEntry(newEntry), _shouldAttack(shouldAttack), _despawnTime(despawnTime) { } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Creature* creatureTarget = GetHitCreature()) + if (!creatureTarget->isPet() && creatureTarget->GetEntry() == _originalEntry) + { + creatureTarget->UpdateEntry(_newEntry); + if (_shouldAttack && creatureTarget->IsAIEnabled) + creatureTarget->AI()->AttackStart(GetCaster()); + + if (_despawnTime) + creatureTarget->DespawnOrUnsummon(_despawnTime); + } + } - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_generic_quest_update_entry_SpellScript::HandleDummy, _effIndex, _spellEffect); - } + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_generic_quest_update_entry_SpellScript::HandleDummy, _effIndex, _spellEffect); + } }; // http://www.wowhead.com/quest=55 Morbent Fel // 8913 Sacred Cleansing -enum eQuest55Data +enum Quest55Data { NPC_MORBENT = 1200, NPC_WEAKENED_MORBENT = 24782, @@ -70,18 +72,18 @@ enum eQuest55Data class spell_q55_sacred_cleansing : public SpellScriptLoader { -public: - spell_q55_sacred_cleansing() : SpellScriptLoader("spell_q55_sacred_cleansing") { } + public: + spell_q55_sacred_cleansing() : SpellScriptLoader("spell_q55_sacred_cleansing") { } - SpellScript* GetSpellScript() const - { - return new spell_generic_quest_update_entry_SpellScript(SPELL_EFFECT_DUMMY, EFFECT_1, NPC_MORBENT, NPC_WEAKENED_MORBENT, true); - } + SpellScript* GetSpellScript() const + { + return new spell_generic_quest_update_entry_SpellScript(SPELL_EFFECT_DUMMY, EFFECT_1, NPC_MORBENT, NPC_WEAKENED_MORBENT, true); + } }; // http://www.wowhead.com/quest=5206 Marauders of Darrowshire // 17271 Test Fetid Skull -enum eQuest5206Data +enum Quest5206Data { SPELL_CREATE_RESONATING_SKULL = 17269, SPELL_CREATE_BONE_DUST = 17270 @@ -89,47 +91,48 @@ enum eQuest5206Data class spell_q5206_test_fetid_skull : public SpellScriptLoader { -public: - spell_q5206_test_fetid_skull() : SpellScriptLoader("spell_q5206_test_fetid_skull") { } + public: + spell_q5206_test_fetid_skull() : SpellScriptLoader("spell_q5206_test_fetid_skull") { } - class spell_q5206_test_fetid_skull_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q5206_test_fetid_skull_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_q5206_test_fetid_skull_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_RESONATING_SKULL)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_BONE_DUST)) - return false; - return true; - } + PrepareSpellScript(spell_q5206_test_fetid_skull_SpellScript); - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* pCaster = GetCaster(); - if (pCaster->GetTypeId() == TYPEID_PLAYER) + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_RESONATING_SKULL) || !sSpellMgr->GetSpellInfo(SPELL_CREATE_BONE_DUST)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) { + Unit* caster = GetCaster(); uint32 spellId = roll_chance_i(50) ? SPELL_CREATE_RESONATING_SKULL : SPELL_CREATE_BONE_DUST; - pCaster->CastSpell(pCaster, spellId, true, NULL); + caster->CastSpell(caster, spellId, true, NULL); } - } - void Register() + void Register() + { + OnEffectHit += SpellEffectFn(spell_q5206_test_fetid_skull_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_q5206_test_fetid_skull_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_q5206_test_fetid_skull_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_q5206_test_fetid_skull_SpellScript(); - } }; // http://www.wowhead.com/quest=6124 Curing the Sick (A) // http://www.wowhead.com/quest=6129 Curing the Sick (H) // 19512 Apply Salve -enum eQuests6124_6129Data +enum Quests6124_6129Data { NPC_SICKLY_GAZELLE = 12296, NPC_CURED_GAZELLE = 12297, @@ -140,20 +143,26 @@ enum eQuests6124_6129Data class spell_q6124_6129_apply_salve : public SpellScriptLoader { -public: - spell_q6124_6129_apply_salve() : SpellScriptLoader("spell_q6124_6129_apply_salve") { } + public: + spell_q6124_6129_apply_salve() : SpellScriptLoader("spell_q6124_6129_apply_salve") { } - class spell_q6124_6129_apply_salve_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q6124_6129_apply_salve_SpellScript) - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_q6124_6129_apply_salve_SpellScript : public SpellScript { - if (GetCastItem()) - if (Player* pCaster = GetCaster()->ToPlayer()) + PrepareSpellScript(spell_q6124_6129_apply_salve_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + if (GetCastItem()) if (Creature* creatureTarget = GetHitCreature()) { uint32 uiNewEntry = 0; - switch (pCaster->GetTeam()) + switch (caster->GetTeam()) { case HORDE: if (creatureTarget->GetEntry() == NPC_SICKLY_GAZELLE) @@ -170,23 +179,23 @@ public: creatureTarget->DespawnOrUnsummon(DESPAWN_TIME); } } - } + } - void Register() + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q6124_6129_apply_salve_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_q6124_6129_apply_salve_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_q6124_6129_apply_salve_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_q6124_6129_apply_salve_SpellScript(); - } }; // http://www.wowhead.com/quest=10255 Testing the Antidote // 34665 Administer Antidote -enum eQuest10255Data +enum Quest10255Data { NPC_HELBOAR = 16880, NPC_DREADTUSK = 16992, @@ -194,18 +203,18 @@ enum eQuest10255Data class spell_q10255_administer_antidote : public SpellScriptLoader { -public: - spell_q10255_administer_antidote() : SpellScriptLoader("spell_q10255_administer_antidote") { } + public: + spell_q10255_administer_antidote() : SpellScriptLoader("spell_q10255_administer_antidote") { } - SpellScript* GetSpellScript() const - { - return new spell_generic_quest_update_entry_SpellScript(SPELL_EFFECT_DUMMY, EFFECT_0, NPC_HELBOAR, NPC_DREADTUSK, true); - } + SpellScript* GetSpellScript() const + { + return new spell_generic_quest_update_entry_SpellScript(SPELL_EFFECT_DUMMY, EFFECT_0, NPC_HELBOAR, NPC_DREADTUSK, true); + } }; // http://www.wowhead.com/quest=11396 Bring Down Those Shields (A) // http://www.wowhead.com/quest=11399 Bring Down Those Shields (H) -enum eQuest11396_11399Data +enum Quest11396_11399Data { SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3 = 43874, SPELL_SCOURGING_CRYSTAL_CONTROLLER = 43878 @@ -214,115 +223,116 @@ enum eQuest11396_11399Data // 43874 Scourge Mur'gul Camp: Force Shield Arcane Purple x3 class spell_q11396_11399_force_shield_arcane_purple_x3 : public SpellScriptLoader { -public: - spell_q11396_11399_force_shield_arcane_purple_x3() : SpellScriptLoader("spell_q11396_11399_force_shield_arcane_purple_x3") { } + public: + spell_q11396_11399_force_shield_arcane_purple_x3() : SpellScriptLoader("spell_q11396_11399_force_shield_arcane_purple_x3") { } - class spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript : public AuraScript - { - PrepareAuraScript(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript) - void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + class spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript : public AuraScript { - Unit* target = GetTarget(); + PrepareAuraScript(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript); + + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); target->AddUnitState(UNIT_STATE_ROOT); - } + } - void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - } + } - void Register() - { - OnEffectApply += AuraEffectApplyFn(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - OnEffectRemove += AuraEffectRemoveFn(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } - }; + }; - AuraScript* GetAuraScript() const - { - return new spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript(); - } + AuraScript* GetAuraScript() const + { + return new spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript(); + } }; // 50133 Scourging Crystal Controller class spell_q11396_11399_scourging_crystal_controller : public SpellScriptLoader { -public: - spell_q11396_11399_scourging_crystal_controller() : SpellScriptLoader("spell_q11396_11399_scourging_crystal_controller") { } + public: + spell_q11396_11399_scourging_crystal_controller() : SpellScriptLoader("spell_q11396_11399_scourging_crystal_controller") { } - class spell_q11396_11399_scourging_crystal_controller_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_q11396_11399_scourging_crystal_controller_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SCOURGING_CRYSTAL_CONTROLLER)) - return false; - return true; - } + PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_SpellScript); - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Unit* target = GetTargetUnit()) - if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) - // Make sure nobody else is channeling the same target - if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER)) - GetCaster()->CastSpell(target, SPELL_SCOURGING_CRYSTAL_CONTROLLER, true, GetCastItem()); - } + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3) || !sSpellMgr->GetSpellInfo(SPELL_SCOURGING_CRYSTAL_CONTROLLER)) + return false; + return true; + } - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_q11396_11399_scourging_crystal_controller_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetTargetUnit()) + if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) + // Make sure nobody else is channeling the same target + if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER)) + GetCaster()->CastSpell(target, SPELL_SCOURGING_CRYSTAL_CONTROLLER, true, GetCastItem()); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q11396_11399_scourging_crystal_controller_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; - SpellScript* GetSpellScript() const - { - return new spell_q11396_11399_scourging_crystal_controller_SpellScript(); - }; + SpellScript* GetSpellScript() const + { + return new spell_q11396_11399_scourging_crystal_controller_SpellScript(); + }; }; // 43882 Scourging Crystal Controller Dummy class spell_q11396_11399_scourging_crystal_controller_dummy : public SpellScriptLoader { -public: - spell_q11396_11399_scourging_crystal_controller_dummy() : SpellScriptLoader("spell_q11396_11399_scourging_crystal_controller_dummy") { } + public: + spell_q11396_11399_scourging_crystal_controller_dummy() : SpellScriptLoader("spell_q11396_11399_scourging_crystal_controller_dummy") { } - class spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) - return false; - return true; - } + PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript); - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Unit* target = GetTargetUnit()) - if (target->GetTypeId() == TYPEID_UNIT) - target->RemoveAurasDueToSpell(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3); - } + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) + return false; + return true; + } - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + if (target->GetTypeId() == TYPEID_UNIT) + target->RemoveAurasDueToSpell(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; - SpellScript* GetSpellScript() const - { - return new spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript(); - }; + SpellScript* GetSpellScript() const + { + return new spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript(); + }; }; // http://www.wowhead.com/quest=11515 Blood for Blood // 44936 Quest - Fel Siphon Dummy -enum eQuest11515Data +enum Quest11515Data { NPC_FELBLOOD_INITIATE = 24918, NPC_EMACIATED_FELBLOOD = 24955 @@ -330,18 +340,18 @@ enum eQuest11515Data class spell_q11515_fel_siphon_dummy : public SpellScriptLoader { -public: - spell_q11515_fel_siphon_dummy() : SpellScriptLoader("spell_q11515_fel_siphon_dummy") { } + public: + spell_q11515_fel_siphon_dummy() : SpellScriptLoader("spell_q11515_fel_siphon_dummy") { } - SpellScript* GetSpellScript() const - { - return new spell_generic_quest_update_entry_SpellScript(SPELL_EFFECT_DUMMY, EFFECT_0, NPC_FELBLOOD_INITIATE, NPC_EMACIATED_FELBLOOD, true); - } + SpellScript* GetSpellScript() const + { + return new spell_generic_quest_update_entry_SpellScript(SPELL_EFFECT_DUMMY, EFFECT_0, NPC_FELBLOOD_INITIATE, NPC_EMACIATED_FELBLOOD, true); + } }; // http://www.wowhead.com/quest=11587 Prison Break // 45449 Arcane Prisoner Rescue -enum eQuest11587Data +enum Quest11587Data { SPELL_SUMMON_ARCANE_PRISONER_MALE = 45446, // Summon Arcane Prisoner - Male SPELL_SUMMON_ARCANE_PRISONER_FEMALE = 45448, // Summon Arcane Prisoner - Female @@ -350,51 +360,48 @@ enum eQuest11587Data class spell_q11587_arcane_prisoner_rescue : public SpellScriptLoader { -public: - spell_q11587_arcane_prisoner_rescue() : SpellScriptLoader("spell_q11587_arcane_prisoner_rescue") { } + public: + spell_q11587_arcane_prisoner_rescue() : SpellScriptLoader("spell_q11587_arcane_prisoner_rescue") { } - class spell_q11587_arcane_prisoner_rescue_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q11587_arcane_prisoner_rescue_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_q11587_arcane_prisoner_rescue_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ARCANE_PRISONER_MALE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ARCANE_PRISONER_FEMALE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_ARCANE_PRISONER_KILL_CREDIT)) - return false; - return true; - } + PrepareSpellScript(spell_q11587_arcane_prisoner_rescue_SpellScript); - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - if (Unit* unitTarget = GetHitUnit()) + bool Validate(SpellInfo const* /*spellEntry*/) { - uint32 spellId = SPELL_SUMMON_ARCANE_PRISONER_MALE; - if (rand() % 2) - spellId = SPELL_SUMMON_ARCANE_PRISONER_FEMALE; - caster->CastSpell(caster, spellId, true); - unitTarget->CastSpell(caster, SPELL_ARCANE_PRISONER_KILL_CREDIT, true); + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ARCANE_PRISONER_MALE) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_ARCANE_PRISONER_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_ARCANE_PRISONER_KILL_CREDIT)) + return false; + return true; } - } - void Register() + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* unitTarget = GetHitUnit()) + { + uint32 spellId = SPELL_SUMMON_ARCANE_PRISONER_MALE; + if (rand() % 2) + spellId = SPELL_SUMMON_ARCANE_PRISONER_FEMALE; + caster->CastSpell(caster, spellId, true); + unitTarget->CastSpell(caster, SPELL_ARCANE_PRISONER_KILL_CREDIT, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q11587_arcane_prisoner_rescue_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_q11587_arcane_prisoner_rescue_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_q11587_arcane_prisoner_rescue_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_q11587_arcane_prisoner_rescue_SpellScript(); - } }; // http://www.wowhead.com/quest=11730 Master and Servant // 46023 The Ultrasonic Screwdriver -enum eQuest11730Data +enum Quest11730Data { SPELL_SUMMON_SCAVENGEBOT_004A8 = 46063, SPELL_SUMMON_SENTRYBOT_57K = 46068, @@ -411,74 +418,63 @@ enum eQuest11730Data class spell_q11730_ultrasonic_screwdriver : public SpellScriptLoader { -public: - spell_q11730_ultrasonic_screwdriver() : SpellScriptLoader("spell_q11730_ultrasonic_screwdriver") { } + public: + spell_q11730_ultrasonic_screwdriver() : SpellScriptLoader("spell_q11730_ultrasonic_screwdriver") { } - class spell_q11730_ultrasonic_screwdriver_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q11730_ultrasonic_screwdriver_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) + class spell_q11730_ultrasonic_screwdriver_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SCAVENGEBOT_004A8)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SENTRYBOT_57K)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_DEFENDOTANK_66D)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SCAVENGEBOT_005B6)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_55D_COLLECTATRON)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_ROBOT_KILL_CREDIT)) - return false; - return true; - } + PrepareSpellScript(spell_q11730_ultrasonic_screwdriver_SpellScript); - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Item* castItem = GetCastItem(); - if (!castItem) - return; + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem(); + } - Unit* pCaster = GetCaster(); - if (pCaster->GetTypeId() != TYPEID_PLAYER) - return; + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SCAVENGEBOT_004A8) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_SENTRYBOT_57K) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_DEFENDOTANK_66D) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_SCAVENGEBOT_005B6) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_55D_COLLECTATRON) || !sSpellMgr->GetSpellInfo(SPELL_ROBOT_KILL_CREDIT)) + return false; + return true; + } - Creature* target = GetHitCreature(); - if (!target) - return; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Item* castItem = GetCastItem(); + Unit* caster = GetCaster(); + if (Creature* target = GetHitCreature()) + { + uint32 spellId = 0; + switch (target->GetEntry()) + { + case NPC_SCAVENGEBOT_004A8: spellId = SPELL_SUMMON_SCAVENGEBOT_004A8; break; + case NPC_SENTRYBOT_57K: spellId = SPELL_SUMMON_SENTRYBOT_57K; break; + case NPC_DEFENDOTANK_66D: spellId = SPELL_SUMMON_DEFENDOTANK_66D; break; + case NPC_SCAVENGEBOT_005B6: spellId = SPELL_SUMMON_SCAVENGEBOT_005B6; break; + case NPC_55D_COLLECTATRON: spellId = SPELL_SUMMON_55D_COLLECTATRON; break; + default: + return; + } + caster->CastSpell(caster, spellId, true, castItem); + caster->CastSpell(caster, SPELL_ROBOT_KILL_CREDIT, true); + target->DespawnOrUnsummon(); + } + } - uint32 spellId = 0; - switch (target->GetEntry()) + void Register() { - case NPC_SCAVENGEBOT_004A8: spellId = SPELL_SUMMON_SCAVENGEBOT_004A8; break; - case NPC_SENTRYBOT_57K: spellId = SPELL_SUMMON_SENTRYBOT_57K; break; - case NPC_DEFENDOTANK_66D: spellId = SPELL_SUMMON_DEFENDOTANK_66D; break; - case NPC_SCAVENGEBOT_005B6: spellId = SPELL_SUMMON_SCAVENGEBOT_005B6; break; - case NPC_55D_COLLECTATRON: spellId = SPELL_SUMMON_55D_COLLECTATRON; break; - default: - return; + OnEffectHitTarget += SpellEffectFn(spell_q11730_ultrasonic_screwdriver_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } - pCaster->CastSpell(pCaster, spellId, true, castItem); - pCaster->CastSpell(pCaster, SPELL_ROBOT_KILL_CREDIT, true); - target->DespawnOrUnsummon(); - } + }; - void Register() + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_q11730_ultrasonic_screwdriver_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_q11730_ultrasonic_screwdriver_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_q11730_ultrasonic_screwdriver_SpellScript(); - } }; // http://www.wowhead.com/quest=12459 That Which Creates Can Also Destroy // 49587 Seeds of Nature's Wrath -enum eQuest12459Data +enum Quest12459Data { NPC_REANIMATED_FROSTWYRM = 26841, NPC_WEAK_REANIMATED_FROSTWYRM = 27821, @@ -492,44 +488,44 @@ enum eQuest12459Data class spell_q12459_seeds_of_natures_wrath : public SpellScriptLoader { -public: - spell_q12459_seeds_of_natures_wrath() : SpellScriptLoader("spell_q12459_seeds_of_natures_wrath") { } - - class spell_q12459_seeds_of_natures_wrath_SpellScript : public SpellScript - { public: - PrepareSpellScript(spell_q12459_seeds_of_natures_wrath_SpellScript) - void HandleDummy(SpellEffIndex /*effIndex*/) + spell_q12459_seeds_of_natures_wrath() : SpellScriptLoader("spell_q12459_seeds_of_natures_wrath") { } + + class spell_q12459_seeds_of_natures_wrath_SpellScript : public SpellScript { - if (Creature* creatureTarget = GetHitCreature()) + PrepareSpellScript(spell_q12459_seeds_of_natures_wrath_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) { - uint32 uiNewEntry = 0; - switch (creatureTarget->GetEntry()) + if (Creature* creatureTarget = GetHitCreature()) { - case NPC_REANIMATED_FROSTWYRM: uiNewEntry = NPC_WEAK_REANIMATED_FROSTWYRM; break; - case NPC_TURGID: uiNewEntry = NPC_WEAK_TURGID; break; - case NPC_DEATHGAZE: uiNewEntry = NPC_WEAK_DEATHGAZE; break; + uint32 uiNewEntry = 0; + switch (creatureTarget->GetEntry()) + { + case NPC_REANIMATED_FROSTWYRM: uiNewEntry = NPC_WEAK_REANIMATED_FROSTWYRM; break; + case NPC_TURGID: uiNewEntry = NPC_WEAK_TURGID; break; + case NPC_DEATHGAZE: uiNewEntry = NPC_WEAK_DEATHGAZE; break; + } + if (uiNewEntry) + creatureTarget->UpdateEntry(uiNewEntry); } - if (uiNewEntry) - creatureTarget->UpdateEntry(uiNewEntry); } - } - void Register() + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12459_seeds_of_natures_wrath_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_q12459_seeds_of_natures_wrath_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_q12459_seeds_of_natures_wrath_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_q12459_seeds_of_natures_wrath_SpellScript(); - } }; // http://www.wowhead.com/quest=12634 Some Make Lemonade, Some Make Liquor // 51840 Despawn Fruit Tosser -enum eQuest12634Data +enum Quest12634Data { SPELL_BANANAS_FALL_TO_GROUND = 51836, SPELL_ORANGE_FALLS_TO_GROUND = 51837, @@ -539,90 +535,84 @@ enum eQuest12634Data class spell_q12634_despawn_fruit_tosser : public SpellScriptLoader { -public: - spell_q12634_despawn_fruit_tosser() : SpellScriptLoader("spell_q12634_despawn_fruit_tosser") { } - - class spell_q12634_despawn_fruit_tosser_SpellScript : public SpellScript - { public: - PrepareSpellScript(spell_q12634_despawn_fruit_tosser_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_BANANAS_FALL_TO_GROUND)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_ORANGE_FALLS_TO_GROUND)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_PAPAYA_FALLS_TO_GROUND)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ADVENTUROUS_DWARF)) - return false; - return true; - } + spell_q12634_despawn_fruit_tosser() : SpellScriptLoader("spell_q12634_despawn_fruit_tosser") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_q12634_despawn_fruit_tosser_SpellScript : public SpellScript { - uint32 spellId = SPELL_BANANAS_FALL_TO_GROUND; - switch (urand(0, 3)) + PrepareSpellScript(spell_q12634_despawn_fruit_tosser_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) { - case 1: spellId = SPELL_ORANGE_FALLS_TO_GROUND; break; - case 2: spellId = SPELL_PAPAYA_FALLS_TO_GROUND; break; + if (!sSpellMgr->GetSpellInfo(SPELL_BANANAS_FALL_TO_GROUND) || !sSpellMgr->GetSpellInfo(SPELL_ORANGE_FALLS_TO_GROUND) || !sSpellMgr->GetSpellInfo(SPELL_PAPAYA_FALLS_TO_GROUND) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_ADVENTUROUS_DWARF)) + return false; + return true; } - // sometimes, if you're lucky, you get a dwarf - if (roll_chance_i(5)) - spellId = SPELL_SUMMON_ADVENTUROUS_DWARF; - GetCaster()->CastSpell(GetCaster(), spellId, true, NULL); - } - void Register() + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 spellId = SPELL_BANANAS_FALL_TO_GROUND; + switch (urand(0, 3)) + { + case 1: spellId = SPELL_ORANGE_FALLS_TO_GROUND; break; + case 2: spellId = SPELL_PAPAYA_FALLS_TO_GROUND; break; + } + // sometimes, if you're lucky, you get a dwarf + if (roll_chance_i(5)) + spellId = SPELL_SUMMON_ADVENTUROUS_DWARF; + GetCaster()->CastSpell(GetCaster(), spellId, true, NULL); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_q12634_despawn_fruit_tosser_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_q12634_despawn_fruit_tosser_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_q12634_despawn_fruit_tosser_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_q12634_despawn_fruit_tosser_SpellScript(); - } }; // http://www.wowhead.com/quest=12683 Burning to Help // 52308 Take Sputum Sample class spell_q12683_take_sputum_sample : public SpellScriptLoader { -public: - spell_q12683_take_sputum_sample() : SpellScriptLoader("spell_q12683_take_sputum_sample") { } - - class spell_q12683_take_sputum_sample_SpellScript : public SpellScript - { public: - PrepareSpellScript(spell_q12683_take_sputum_sample_SpellScript) - void HandleDummy(SpellEffIndex /*effIndex*/) + spell_q12683_take_sputum_sample() : SpellScriptLoader("spell_q12683_take_sputum_sample") { } + + class spell_q12683_take_sputum_sample_SpellScript : public SpellScript { - uint32 reqAuraId = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + PrepareSpellScript(spell_q12683_take_sputum_sample_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 reqAuraId = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + + Unit* caster = GetCaster(); + if (caster->HasAuraEffect(reqAuraId, 0)) + { + uint32 spellId = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); + caster->CastSpell(caster, spellId, true, NULL); + } + } - Unit* pCaster = GetCaster(); - if (pCaster->HasAuraEffect(reqAuraId, 0)) + void Register() { - uint32 spellId = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); - pCaster->CastSpell(pCaster, spellId, true, NULL); + OnEffectHit += SpellEffectFn(spell_q12683_take_sputum_sample_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } - } + }; - void Register() + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_q12683_take_sputum_sample_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_q12683_take_sputum_sample_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_q12683_take_sputum_sample_SpellScript(); - } }; // http://www.wowhead.com/quest=12851 Going Bearback // 54798 FLAMING Arrow Triggered Effect -enum eQuest12851Data +enum Quest12851Data { NPC_FROSTGIANT = 29351, NPC_FROSTWORG = 29358, @@ -634,53 +624,53 @@ enum eQuest12851Data class spell_q12851_going_bearback : public SpellScriptLoader { -public: - spell_q12851_going_bearback() : SpellScriptLoader("spell_q12851_going_bearback") { } - - class spell_q12851_going_bearback_AuraScript : public AuraScript - { public: - PrepareAuraScript(spell_q12851_going_bearback_AuraScript) - void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + spell_q12851_going_bearback() : SpellScriptLoader("spell_q12851_going_bearback") { } + + class spell_q12851_going_bearback_AuraScript : public AuraScript { - if (Unit* caster = GetCaster()) + PrepareAuraScript(spell_q12851_going_bearback_AuraScript); + + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Unit* target = GetTarget(); - if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself()) + if (Unit* caster = GetCaster()) { - switch (target->GetEntry()) + Unit* target = GetTarget(); + if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself()) { - case NPC_FROSTWORG: - target->CastSpell(player, SPELL_FROSTWORG_CREDIT, true); - target->CastSpell(target, SPELL_IMMOLATION, true); - target->CastSpell(target, SPELL_ABLAZE, true); - break; - case NPC_FROSTGIANT: - target->CastSpell(player, SPELL_FROSTGIANT_CREDIT, true); - target->CastSpell(target, SPELL_IMMOLATION, true); - target->CastSpell(target, SPELL_ABLAZE, true); - break; + switch (target->GetEntry()) + { + case NPC_FROSTWORG: + target->CastSpell(player, SPELL_FROSTWORG_CREDIT, true); + target->CastSpell(target, SPELL_IMMOLATION, true); + target->CastSpell(target, SPELL_ABLAZE, true); + break; + case NPC_FROSTGIANT: + target->CastSpell(player, SPELL_FROSTGIANT_CREDIT, true); + target->CastSpell(target, SPELL_IMMOLATION, true); + target->CastSpell(target, SPELL_ABLAZE, true); + break; + } } } } - } - void Register() - { - AfterEffectApply += AuraEffectApplyFn(spell_q12851_going_bearback_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - } + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_q12851_going_bearback_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } - }; + }; - AuraScript* GetAuraScript() const - { - return new spell_q12851_going_bearback_AuraScript(); - } + AuraScript* GetAuraScript() const + { + return new spell_q12851_going_bearback_AuraScript(); + } }; // http://www.wowhead.com/quest=12937 Relief for the Fallen // 55804 Healing Finished -enum eQuest12937Data +enum Quest12937Data { SPELL_TRIGGER_AID_OF_THE_EARTHEN = 55809, NPC_FALLEN_EARTHEN_DEFENDER = 30035, @@ -688,50 +678,50 @@ enum eQuest12937Data class spell_q12937_relief_for_the_fallen : public SpellScriptLoader { -public: - spell_q12937_relief_for_the_fallen() : SpellScriptLoader("spell_q12937_relief_for_the_fallen") { } - - class spell_q12937_relief_for_the_fallen_SpellScript : public SpellScript - { public: - PrepareSpellScript(spell_q12937_relief_for_the_fallen_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_TRIGGER_AID_OF_THE_EARTHEN)) - return false; - return true; - } + spell_q12937_relief_for_the_fallen() : SpellScriptLoader("spell_q12937_relief_for_the_fallen") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_q12937_relief_for_the_fallen_SpellScript : public SpellScript { - Unit* pCaster = GetCaster(); - if (Player* player = pCaster->ToPlayer()) + PrepareSpellScript(spell_q12937_relief_for_the_fallen_SpellScript); + + bool Load() { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_TRIGGER_AID_OF_THE_EARTHEN)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); if (Creature* target = GetHitCreature()) { - player->CastSpell(player, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true, NULL); - player->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER, 0); + caster->CastSpell(caster, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true, NULL); + caster->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER, 0); target->DespawnOrUnsummon(); } } - } - void Register() + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12937_relief_for_the_fallen_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_q12937_relief_for_the_fallen_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_q12937_relief_for_the_fallen_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_q12937_relief_for_the_fallen_SpellScript(); - } }; -enum eWhoarethey +enum Whoarethey { - SPELL_QUESTGIVER = 48917, - SPELL_MALE_DISGUISE = 38080, SPELL_FEMALE_DISGUISE = 38081, SPELL_GENERIC_DISGUISE = 32756 @@ -748,7 +738,7 @@ class spell_q10041_q10040_who_are_they : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_QUESTGIVER)) + if (!sSpellMgr->GetSpellInfo(SPELL_MALE_DISGUISE) || !sSpellMgr->GetSpellInfo(SPELL_FEMALE_DISGUISE) || !sSpellMgr->GetSpellInfo(SPELL_GENERIC_DISGUISE)) return false; return true; } @@ -756,11 +746,11 @@ class spell_q10041_q10040_who_are_they : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - if (!GetHitUnit() || !GetHitUnit()->ToPlayer()) - return; - - GetHitUnit()->CastSpell(GetHitUnit(), GetHitUnit()->getGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true); - GetHitUnit()->CastSpell(GetHitUnit(), SPELL_GENERIC_DISGUISE, true); + if (Player* target = GetHitPlayer()) + { + target->CastSpell(target, target->getGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true); + target->CastSpell(target, SPELL_GENERIC_DISGUISE, true); + } } void Register() @@ -783,79 +773,81 @@ enum symboloflife // 8593 Symbol of life dummy class spell_symbol_of_life_dummy : public SpellScriptLoader { -public: - spell_symbol_of_life_dummy() : SpellScriptLoader("spell_symbol_of_life_dummy") { } - - class spell_symbol_of_life_dummy_SpellScript : public SpellScript - { - PrepareSpellScript(spell_symbol_of_life_dummy_SpellScript); + public: + spell_symbol_of_life_dummy() : SpellScriptLoader("spell_symbol_of_life_dummy") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_symbol_of_life_dummy_SpellScript : public SpellScript { - if (Creature* target = GetHitCreature()) + PrepareSpellScript(spell_symbol_of_life_dummy_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) { - if (target->HasAura(SPELL_PERMANENT_FEIGN_DEATH)) + if (Creature* target = GetHitCreature()) { - target->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); - target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); - target->SetUInt32Value(UNIT_FIELD_FLAGS_2, 0); - target->SetHealth(target->GetMaxHealth() / 2); - target->SetPower(POWER_MANA, uint32(target->GetMaxPower(POWER_MANA) * 0.75f)); + if (target->HasAura(SPELL_PERMANENT_FEIGN_DEATH)) + { + target->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); + target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); + target->SetUInt32Value(UNIT_FIELD_FLAGS_2, 0); + target->SetHealth(target->GetMaxHealth() / 2); + target->SetPower(POWER_MANA, uint32(target->GetMaxPower(POWER_MANA) * 0.75f)); + } } } - } - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_symbol_of_life_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_symbol_of_life_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; - SpellScript* GetSpellScript() const - { - return new spell_symbol_of_life_dummy_SpellScript(); - }; + SpellScript* GetSpellScript() const + { + return new spell_symbol_of_life_dummy_SpellScript(); + }; }; // http://www.wowhead.com/quest=12659 Scalps! // 52090 Ahunae's Knife -enum eQuest12659Data +enum Quest12659Data { NPC_SCALPS_KC_BUNNY = 28622, }; class spell_q12659_ahunaes_knife : public SpellScriptLoader { -public: - spell_q12659_ahunaes_knife() : SpellScriptLoader("spell_q12659_ahunaes_knife") { } - - class spell_q12659_ahunaes_knife_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12659_ahunaes_knife_SpellScript); + public: + spell_q12659_ahunaes_knife() : SpellScriptLoader("spell_q12659_ahunaes_knife") { } - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_q12659_ahunaes_knife_SpellScript : public SpellScript { - Player* caster = GetCaster()->ToPlayer(); - if (!caster) - return; + PrepareSpellScript(spell_q12659_ahunaes_knife_SpellScript); - if (Creature* target = GetTargetUnit()->ToCreature()) + bool Load() { - target->ForcedDespawn(); - caster->KilledMonsterCredit(NPC_SCALPS_KC_BUNNY, 0); + return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - } - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_q12659_ahunaes_knife_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + if (Creature* target = GetHitCreature()) + { + target->ForcedDespawn(); + caster->KilledMonsterCredit(NPC_SCALPS_KC_BUNNY, 0); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12659_ahunaes_knife_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; - SpellScript* GetSpellScript() const - { - return new spell_q12659_ahunaes_knife_SpellScript(); - }; + SpellScript* GetSpellScript() const + { + return new spell_q12659_ahunaes_knife_SpellScript(); + }; }; enum StoppingTheSpread @@ -875,16 +867,21 @@ class spell_q9874_liquid_fire : public SpellScriptLoader { PrepareSpellScript(spell_q9874_liquid_fire_SpellScript); + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + void HandleDummy(SpellEffIndex /*effIndex*/) { Player* caster = GetCaster()->ToPlayer(); - Creature* target = GetHitUnit()->ToCreature(); - if (!caster || !target || (target && target->HasAura(SPELL_FLAMES))) - return; - - caster->KilledMonsterCredit(NPC_VILLAGER_KILL_CREDIT, 0); - target->CastSpell(target, SPELL_FLAMES, true); - target->DespawnOrUnsummon(60000); + if (Creature* target = GetHitCreature()) + if (target && target->HasAura(SPELL_FLAMES)) + { + caster->KilledMonsterCredit(NPC_VILLAGER_KILL_CREDIT, 0); + target->CastSpell(target, SPELL_FLAMES, true); + target->DespawnOrUnsummon(60000); + } } void Register() @@ -915,16 +912,20 @@ class spell_q12805_lifeblood_dummy : public SpellScriptLoader { PrepareSpellScript(spell_q12805_lifeblood_dummy_SpellScript); + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + void HandleScript(SpellEffIndex /*effIndex*/) { Player* caster = GetCaster()->ToPlayer(); - Creature* target = GetHitUnit()->ToCreature(); - if (!caster || !target) - return; - - caster->KilledMonsterCredit(NPC_SHARD_KILL_CREDIT, 0); - target->CastSpell(target, uint32(GetEffectValue()), true); - target->DespawnOrUnsummon(2000); + if (Creature* target = GetHitCreature()) + { + caster->KilledMonsterCredit(NPC_SHARD_KILL_CREDIT, 0); + target->CastSpell(target, uint32(GetEffectValue()), true); + target->DespawnOrUnsummon(2000); + } } void Register() @@ -945,37 +946,38 @@ class spell_q12805_lifeblood_dummy : public SpellScriptLoader 59643 Plant Horde Battle Standard 4338 Plant Alliance Battle Standard */ -enum eBattleStandard +enum BattleStandard { NPC_KING_OF_THE_MOUNTAINT_KC = 31766, }; class spell_q13280_13283_plant_battle_standard: public SpellScriptLoader { -public: - spell_q13280_13283_plant_battle_standard() : SpellScriptLoader("spell_q13280_13283_plant_battle_standard") { } + public: + spell_q13280_13283_plant_battle_standard() : SpellScriptLoader("spell_q13280_13283_plant_battle_standard") { } - class spell_q13280_13283_plant_battle_standard_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q13280_13283_plant_battle_standard_SpellScript) - void HandleDummy(SpellEffIndex /*effIndex*/) + class spell_q13280_13283_plant_battle_standard_SpellScript : public SpellScript { - Unit* caster = GetCaster(); - if (caster->IsVehicle()) - if (Unit* player = caster->GetVehicleKit()->GetPassenger(0)) - player->ToPlayer()->KilledMonsterCredit(NPC_KING_OF_THE_MOUNTAINT_KC, 0); - } + PrepareSpellScript(spell_q13280_13283_plant_battle_standard_SpellScript); - void Register() + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (caster->IsVehicle()) + if (Unit* player = caster->GetVehicleKit()->GetPassenger(0)) + player->ToPlayer()->KilledMonsterCredit(NPC_KING_OF_THE_MOUNTAINT_KC, 0); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_q13280_13283_plant_battle_standard_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHit += SpellEffectFn(spell_q13280_13283_plant_battle_standard_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_q13280_13283_plant_battle_standard_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_q13280_13283_plant_battle_standard_SpellScript(); - } }; enum ChumTheWaterSummons @@ -988,42 +990,36 @@ enum ChumTheWaterSummons class spell_q14112_14145_chum_the_water: public SpellScriptLoader { -public: - spell_q14112_14145_chum_the_water() : SpellScriptLoader("spell_q14112_14145_chum_the_water") { } - - class spell_q14112_14145_chum_the_water_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q14112_14145_chum_the_water_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SUMMON_ANGRY_KVALDIR)) - return false; - if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_MAKO)) - return false; - if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_THRESHER)) - return false; - if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_BLUE_SHARK)) - return false; - return true; - } + public: + spell_q14112_14145_chum_the_water() : SpellScriptLoader("spell_q14112_14145_chum_the_water") { } - void HandleScriptEffect(SpellEffIndex /*effIndex*/) + class spell_q14112_14145_chum_the_water_SpellScript : public SpellScript { - Unit* caster = GetCaster(); - caster->CastSpell(caster, RAND(SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK)); - } + PrepareSpellScript(spell_q14112_14145_chum_the_water_SpellScript); - void Register() + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SUMMON_ANGRY_KVALDIR) || !sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_MAKO) || !sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_THRESHER) || !sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_BLUE_SHARK)) + return false; + return true; + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + caster->CastSpell(caster, RAND(SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK)); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q14112_14145_chum_the_water_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_q14112_14145_chum_the_water_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + return new spell_q14112_14145_chum_the_water_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_q14112_14145_chum_the_water_SpellScript(); - } }; // http://old01.wowhead.com/quest=9452 - Red Snapper - Very Tasty! @@ -1041,15 +1037,16 @@ class spell_q9452_cast_net: public SpellScriptLoader class spell_q9452_cast_net_SpellScript : public SpellScript { - PrepareSpellScript(spell_q9452_cast_net_SpellScript) + PrepareSpellScript(spell_q9452_cast_net_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } void HandleDummy(SpellEffIndex /*effIndex*/) { Player* caster = GetCaster()->ToPlayer(); - - if (!caster) - return; - switch (urand(0, 2)) { case 0: case 1: diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index c88d7b891d6..3a4132f62fe 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -21,7 +21,8 @@ * Scriptnames of files in this file should be prefixed with "spell_rog_". */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "SpellScript.h" #include "SpellAuraEffects.h" enum RogueSpells @@ -29,120 +30,114 @@ enum RogueSpells ROGUE_SPELL_SHIV_TRIGGERED = 5940, ROGUE_SPELL_GLYPH_OF_PREPARATION = 56819, ROGUE_SPELL_PREY_ON_THE_WEAK = 58670, + ROGUE_SPELL_CHEAT_DEATH_COOLDOWN = 31231, }; // Cheat Death class spell_rog_cheat_death : public SpellScriptLoader { -public: - spell_rog_cheat_death() : SpellScriptLoader("spell_rog_cheat_death") { } + public: + spell_rog_cheat_death() : SpellScriptLoader("spell_rog_cheat_death") { } - class spell_rog_cheat_death_AuraScript : public AuraScript - { - PrepareAuraScript(spell_rog_cheat_death_AuraScript); + class spell_rog_cheat_death_AuraScript : public AuraScript + { + PrepareAuraScript(spell_rog_cheat_death_AuraScript); - uint32 absorbChance; + uint32 absorbChance; - enum Spell - { - ROG_SPELL_CHEAT_DEATH_COOLDOWN = 31231, - }; + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_CHEAT_DEATH_COOLDOWN)) + return false; + return true; + } - bool Validate(SpellInfo const* /*spellEntry*/) - { - return sSpellMgr->GetSpellInfo(ROG_SPELL_CHEAT_DEATH_COOLDOWN); - } + bool Load() + { + absorbChance = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); + return GetUnitOwner()->ToPlayer(); + } - bool Load() - { - absorbChance = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); - return GetUnitOwner()->ToPlayer(); - } + void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) + { + // Set absorbtion amount to unlimited + amount = -1; + } - void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) - { - // Set absorbtion amount to unlimited - amount = -1; - } + void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) + { + Player* target = GetTarget()->ToPlayer(); + if (dmgInfo.GetDamage() < target->GetHealth() || target->HasSpellCooldown(ROGUE_SPELL_CHEAT_DEATH_COOLDOWN) || !roll_chance_i(absorbChance)) + return; - void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) - { - Unit* target = GetTarget(); - if (dmgInfo.GetDamage() < target->GetHealth()) - return; - if (target->ToPlayer()->HasSpellCooldown(ROG_SPELL_CHEAT_DEATH_COOLDOWN)) - return; - if (!roll_chance_i(absorbChance)) - return; - - target->CastSpell(target, ROG_SPELL_CHEAT_DEATH_COOLDOWN, true); - target->ToPlayer()->AddSpellCooldown(ROG_SPELL_CHEAT_DEATH_COOLDOWN, 0, time(NULL) + 60); - - uint32 health10 = target->CountPctFromMaxHealth(10); - - // hp > 10% - absorb hp till 10% - if (target->GetHealth() > health10) - absorbAmount = dmgInfo.GetDamage() - target->GetHealth() + health10; - // hp lower than 10% - absorb everything - else - absorbAmount = dmgInfo.GetDamage(); - } + target->CastSpell(target, ROGUE_SPELL_CHEAT_DEATH_COOLDOWN, true); + target->AddSpellCooldown(ROGUE_SPELL_CHEAT_DEATH_COOLDOWN, 0, time(NULL) + 60); - void Register() + uint32 health10 = target->CountPctFromMaxHealth(10); + + // hp > 10% - absorb hp till 10% + if (target->GetHealth() > health10) + absorbAmount = dmgInfo.GetDamage() - target->GetHealth() + health10; + // hp lower than 10% - absorb everything + else + absorbAmount = dmgInfo.GetDamage(); + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_cheat_death_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + OnEffectAbsorb += AuraEffectAbsorbFn(spell_rog_cheat_death_AuraScript::Absorb, EFFECT_0); + } + }; + + AuraScript* GetAuraScript() const { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_cheat_death_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); - OnEffectAbsorb += AuraEffectAbsorbFn(spell_rog_cheat_death_AuraScript::Absorb, EFFECT_0); + return new spell_rog_cheat_death_AuraScript(); } - }; - - AuraScript* GetAuraScript() const - { - return new spell_rog_cheat_death_AuraScript(); - } }; // 31130 - Nerves of Steel class spell_rog_nerves_of_steel : public SpellScriptLoader { -public: - spell_rog_nerves_of_steel() : SpellScriptLoader("spell_rog_nerves_of_steel") { } + public: + spell_rog_nerves_of_steel() : SpellScriptLoader("spell_rog_nerves_of_steel") { } - class spell_rog_nerves_of_steel_AuraScript : public AuraScript - { - PrepareAuraScript(spell_rog_nerves_of_steel_AuraScript); + class spell_rog_nerves_of_steel_AuraScript : public AuraScript + { + PrepareAuraScript(spell_rog_nerves_of_steel_AuraScript); - uint32 absorbPct; + uint32 absorbPct; - bool Load() - { - absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); - return true; - } + bool Load() + { + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); + return true; + } - void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) - { - // Set absorbtion amount to unlimited - amount = -1; - } + void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) + { + // Set absorbtion amount to unlimited + amount = -1; + } - void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) - { - // reduces all damage taken while stun or fear - if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN))) - absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct); - } + void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) + { + // reduces all damage taken while stun or fear + if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN))) + absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct); + } - void Register() + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_nerves_of_steel_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + OnEffectAbsorb += AuraEffectAbsorbFn(spell_rog_nerves_of_steel_AuraScript::Absorb, EFFECT_0); + } + }; + + AuraScript* GetAuraScript() const { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_nerves_of_steel_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); - OnEffectAbsorb += AuraEffectAbsorbFn(spell_rog_nerves_of_steel_AuraScript::Absorb, EFFECT_0); + return new spell_rog_nerves_of_steel_AuraScript(); } - }; - - AuraScript* GetAuraScript() const - { - return new spell_rog_nerves_of_steel_AuraScript(); - } }; class spell_rog_preparation : public SpellScriptLoader @@ -152,7 +147,13 @@ class spell_rog_preparation : public SpellScriptLoader class spell_rog_preparation_SpellScript : public SpellScript { - PrepareSpellScript(spell_rog_preparation_SpellScript) + PrepareSpellScript(spell_rog_preparation_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + bool Validate(SpellInfo const* /*spellEntry*/) { if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_GLYPH_OF_PREPARATION)) @@ -162,12 +163,10 @@ class spell_rog_preparation : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - Unit* caster = GetCaster(); - if (caster->GetTypeId() != TYPEID_PLAYER) - return; + Player* caster = GetCaster()->ToPlayer(); //immediately finishes the cooldown on certain Rogue abilities - const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap(); + const SpellCooldowns& cm = caster->GetSpellCooldownMap(); for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); @@ -176,14 +175,14 @@ class spell_rog_preparation : public SpellScriptLoader { if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP || // Cold Blood, Shadowstep spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT) // Vanish, Evasion, Sprint - caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true); + caster->RemoveSpellCooldown((itr++)->first, true); else if (caster->HasAura(ROGUE_SPELL_GLYPH_OF_PREPARATION)) { if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_DISMANTLE || // Dismantle spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_KICK || // Kick (spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_BLADE_FLURRY && // Blade Flurry spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_BLADE_FLURRY)) - caster->ToPlayer()->RemoveSpellCooldown((itr++)->first, true); + caster->RemoveSpellCooldown((itr++)->first, true); else ++itr; } @@ -216,7 +215,8 @@ public: class spell_rog_prey_on_the_weak_AuraScript : public AuraScript { - PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript) + PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript); + bool Validate(SpellInfo const* /*spellEntry*/) { if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_PREY_ON_THE_WEAK)) @@ -259,7 +259,13 @@ class spell_rog_shiv : public SpellScriptLoader class spell_rog_shiv_SpellScript : public SpellScript { - PrepareSpellScript(spell_rog_shiv_SpellScript) + PrepareSpellScript(spell_rog_shiv_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + bool Validate(SpellInfo const* /*spellEntry*/) { if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_SHIV_TRIGGERED)) @@ -270,9 +276,6 @@ class spell_rog_shiv : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); - if (caster->GetTypeId() != TYPEID_PLAYER) - return; - if (Unit* unitTarget = GetHitUnit()) caster->CastSpell(unitTarget, ROGUE_SPELL_SHIV_TRIGGERED, true); } @@ -297,8 +300,7 @@ class spell_rog_deadly_poison : public SpellScriptLoader class spell_rog_deadly_poison_SpellScript : public SpellScript { - PrepareSpellScript(spell_rog_deadly_poison_SpellScript) - + PrepareSpellScript(spell_rog_deadly_poison_SpellScript); bool Load() { @@ -309,13 +311,10 @@ class spell_rog_deadly_poison : public SpellScriptLoader void HandleBeforeHit() { - Unit* target = GetHitUnit(); - if (!target) - return; - - // Deadly Poison - if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0x80000, 0, GetCaster()->GetGUID())) - _stackAmount = aurEff->GetBase()->GetStackAmount(); + if (Unit* target = GetHitUnit()) + // Deadly Poison + if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0x80000, 0, GetCaster()->GetGUID())) + _stackAmount = aurEff->GetBase()->GetStackAmount(); } void HandleAfterHit() @@ -324,49 +323,50 @@ class spell_rog_deadly_poison : public SpellScriptLoader return; Player* player = GetCaster()->ToPlayer(); - Unit* target = GetHitUnit(); - if (!target) - return; - Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND); + if (Unit* target = GetHitUnit()) + { - if (item == GetCastItem()) - item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); + Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND); - if (!item) - return; + if (item == GetCastItem()) + item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); - // item combat enchantments - for (uint8 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot) - { - SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(EnchantmentSlot(slot))); - if (!enchant) - continue; + if (!item) + return; - for (uint8 s = 0; s < 3; ++s) + // item combat enchantments + for (uint8 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot) { - if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) + SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(EnchantmentSlot(slot))); + if (!enchant) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]); - if (!spellInfo) + for (uint8 s = 0; s < 3; ++s) { - sLog->outError("Player::CastItemCombatSpell Enchant %i, player (Name: %s, GUID: %u) cast unknown spell %i", enchant->ID, player->GetName(), player->GetGUIDLow(), enchant->spellid[s]); - continue; + if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) + continue; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]); + if (!spellInfo) + { + sLog->outError("Player::CastItemCombatSpell Enchant %i, player (Name: %s, GUID: %u) cast unknown spell %i", enchant->ID, player->GetName(), player->GetGUIDLow(), enchant->spellid[s]); + continue; + } + + // Proc only rogue poisons + if (spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE || spellInfo->Dispel != DISPEL_POISON) + continue; + + // Do not reproc deadly + if (spellInfo->SpellFamilyFlags.IsEqual(0x10000, 0x80000, 0)) + continue; + + if (spellInfo->IsPositive()) + player->CastSpell(player, enchant->spellid[s], true, item); + else + player->CastSpell(target, enchant->spellid[s], true, item); } - - // Proc only rogue poisons - if (spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE || spellInfo->Dispel != DISPEL_POISON) - continue; - - // Do not reproc deadly - if (spellInfo->SpellFamilyFlags.IsEqual(0x10000, 0x80000, 0)) - continue; - - if (spellInfo->IsPositive()) - player->CastSpell(player, enchant->spellid[s], true, item); - else - player->CastSpell(target, enchant->spellid[s], true, item); } } } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index b0116d6d33d..96ee7a18429 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -21,7 +21,10 @@ * Scriptnames of files in this file should be prefixed with "spell_sha_". */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "GridNotifiers.h" +#include "Unit.h" +#include "SpellScript.h" #include "SpellAuraEffects.h" enum ShamanSpells @@ -94,9 +97,7 @@ class spell_sha_fire_nova : public SpellScriptLoader bool Validate(SpellInfo const* spellEntry) { - if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_FIRE_NOVA_R1)) - return false; - if (sSpellMgr->GetFirstSpellInChain(SHAMAN_SPELL_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) + if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_FIRE_NOVA_R1) || sSpellMgr->GetFirstSpellInChain(SHAMAN_SPELL_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) return false; uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id); @@ -119,13 +120,15 @@ class spell_sha_fire_nova : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - Unit* caster = GetCaster(); - uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); - if (uint32 spellId = sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank)) + if (Unit* caster = GetCaster()) { - Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]); - if (totem && totem->isTotem()) - caster->CastSpell(totem, spellId, true); + uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + if (uint32 spellId = sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank)) + { + Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]); + if (totem && totem->isTotem()) + caster->CastSpell(totem, spellId, true); + } } } @@ -154,30 +157,28 @@ class spell_sha_mana_tide_totem : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE)) - return false; - if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_MANA_TIDE_TOTEM)) + if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE) || !sSpellMgr->GetSpellInfo(SHAMAN_SPELL_MANA_TIDE_TOTEM)) return false; return true; } void HandleDummy(SpellEffIndex /*effIndex*/) { - Unit* caster = GetCaster(); - if (Unit* unitTarget = GetHitUnit()) - { - if (unitTarget->getPowerType() == POWER_MANA) + if (Unit* caster = GetCaster()) + if (Unit* unitTarget = GetHitUnit()) { - int32 effValue = GetEffectValue(); - // Glyph of Mana Tide - if (Unit* owner = caster->GetOwner()) - if (AuraEffect* dummy = owner->GetAuraEffect(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE, 0)) - effValue += dummy->GetAmount(); - // Regenerate 6% of Total Mana Every 3 secs - int32 effBasePoints0 = int32(CalculatePctN(unitTarget->GetMaxPower(POWER_MANA), effValue)); - caster->CastCustomSpell(unitTarget, SHAMAN_SPELL_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID()); + if (unitTarget->getPowerType() == POWER_MANA) + { + int32 effValue = GetEffectValue(); + // Glyph of Mana Tide + if (Unit* owner = caster->GetOwner()) + if (AuraEffect* dummy = owner->GetAuraEffect(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE, 0)) + effValue += dummy->GetAmount(); + // Regenerate 6% of Total Mana Every 3 secs + int32 effBasePoints0 = int32(CalculatePctN(unitTarget->GetMaxPower(POWER_MANA), effValue)); + caster->CastCustomSpell(unitTarget, SHAMAN_SPELL_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID()); + } } - } } void Register() @@ -204,22 +205,20 @@ class spell_sha_earthbind_totem : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM)) - return false; - if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHEN_POWER)) + if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM) || !sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHEN_POWER)) return false; return true; } void HandleEffectPeriodic(AuraEffect const* aurEff) { - Unit* target = GetTarget(); - if (Unit* caster = aurEff->GetBase()->GetCaster()) - if (TempSummon* summon = caster->ToTempSummon()) - if (Unit* owner = summon->GetOwner()) - if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0)) - if (roll_chance_i(aur->GetBaseAmount()) && target->HasAuraWithMechanic(1 << MECHANIC_SNARE)) - caster->CastSpell(caster, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff); + if (Unit* target = GetTarget()) + if (Unit* caster = aurEff->GetBase()->GetCaster()) + if (TempSummon* summon = caster->ToTempSummon()) + if (Unit* owner = summon->GetOwner()) + if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0)) + if (roll_chance_i(aur->GetBaseAmount()) && target->HasAuraWithMechanic(1 << MECHANIC_SNARE)) + caster->CastSpell(caster, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff); } void Register() @@ -257,7 +256,8 @@ class spell_sha_bloodlust : public SpellScriptLoader void ApplyDebuff() { - GetHitUnit()->CastSpell(GetHitUnit(), SHAMAN_SPELL_SATED, true); + if (Unit* target = GetHitUnit()) + target->CastSpell(target, SHAMAN_SPELL_SATED, true); } void Register() @@ -298,7 +298,8 @@ class spell_sha_heroism : public SpellScriptLoader void ApplyDebuff() { - GetHitUnit()->CastSpell(GetHitUnit(), SHAMAN_SPELL_EXHAUSTION, true); + if (Unit* target = GetHitUnit()) + target->CastSpell(target, SHAMAN_SPELL_EXHAUSTION, true); } void Register() @@ -316,6 +317,232 @@ class spell_sha_heroism : public SpellScriptLoader } }; +enum AncestralAwakeningProc +{ + SPELL_ANCESTRAL_AWAKENING_PROC = 52752, +}; + +class spell_sha_ancestral_awakening_proc : public SpellScriptLoader +{ + public: + spell_sha_ancestral_awakening_proc() : SpellScriptLoader("spell_sha_ancestral_awakening_proc") { } + + class spell_sha_ancestral_awakening_proc_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_ancestral_awakening_proc_SpellScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_ANCESTRAL_AWAKENING_PROC)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + int32 damage = GetEffectValue(); + if (GetCaster() && GetHitUnit()) + GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_sha_ancestral_awakening_proc_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_ancestral_awakening_proc_SpellScript(); + } +}; + +enum CleansingTotemPulse +{ + SPELL_CLEANSING_TOTEM_EFFECT = 52025, +}; + +class spell_sha_cleansing_totem_pulse : public SpellScriptLoader +{ + public: + spell_sha_cleansing_totem_pulse() : SpellScriptLoader("spell_sha_cleansing_totem_pulse") { } + + class spell_sha_cleansing_totem_pulse_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_cleansing_totem_pulse_SpellScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_CLEANSING_TOTEM_EFFECT)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + int32 bp = 1; + if (GetCaster() && GetHitUnit() && GetOriginalCaster()) + GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_CLEANSING_TOTEM_EFFECT, NULL, &bp, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID()); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_sha_cleansing_totem_pulse_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_cleansing_totem_pulse_SpellScript(); + } +}; + +enum HealingStreamTotem +{ + SPELL_GLYPH_OF_HEALING_STREAM_TOTEM = 55456, + ICON_ID_RESTORATIVE_TOTEMS = 338, + SPELL_HEALING_STREAM_TOTEM_HEAL = 52042, +}; + +class spell_sha_healing_stream_totem : public SpellScriptLoader +{ + public: + spell_sha_healing_stream_totem() : SpellScriptLoader("spell_sha_healing_stream_totem") { } + + class spell_sha_healing_stream_totem_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_healing_stream_totem_SpellScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM) || !sSpellMgr->GetSpellInfo(SPELL_HEALING_STREAM_TOTEM_HEAL)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + int32 damage = GetEffectValue(); + SpellInfo const* triggeringSpell = GetTriggeringSpell(); + if (Unit* target = GetHitUnit()) + if (Unit* caster = GetCaster()) + { + if (Unit* owner = caster->GetOwner()) + { + if (triggeringSpell) + damage = int32(owner->SpellHealingBonus(target, triggeringSpell, damage, HEAL)); + + // Restorative Totems + if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, ICON_ID_RESTORATIVE_TOTEMS, 1)) + AddPctN(damage, dummy->GetAmount()); + + // Glyph of Healing Stream Totem + if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0)) + AddPctN(damage, aurEff->GetAmount()); + } + caster->CastCustomSpell(target, SPELL_HEALING_STREAM_TOTEM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID()); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_sha_healing_stream_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_healing_stream_totem_SpellScript(); + } +}; + +enum ManaSpringTotem +{ + SPELL_MANA_SPRING_TOTEM_ENERGIZE = 52032, +}; + +class spell_sha_mana_spring_totem : public SpellScriptLoader +{ + public: + spell_sha_mana_spring_totem() : SpellScriptLoader("spell_sha_mana_spring_totem") { } + + class spell_sha_mana_spring_totem_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_mana_spring_totem_SpellScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MANA_SPRING_TOTEM_ENERGIZE)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + int32 damage = GetEffectValue(); + if (Unit* target = GetHitUnit()) + if (Unit* caster = GetCaster()) + if (target->getPowerType() == POWER_MANA) + caster->CastCustomSpell(target, SPELL_MANA_SPRING_TOTEM_ENERGIZE, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID()); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_sha_mana_spring_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_mana_spring_totem_SpellScript(); + } +}; + +class spell_sha_lava_lash : public SpellScriptLoader +{ + public: + spell_sha_lava_lash() : SpellScriptLoader("spell_sha_lava_lash") { } + + class spell_sha_lava_lash_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_lava_lash_SpellScript) + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + if (Player* caster = GetCaster()->ToPlayer()) + { + int32 damage = GetEffectValue(); + int32 hitDamage = GetHitDamage(); + if (caster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) + { + // Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue. + if (caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0)) + AddPctN(hitDamage, damage); + SetHitDamage(hitDamage); + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_sha_lava_lash_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + } + + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_lava_lash_SpellScript(); + } +}; + + void AddSC_shaman_spell_scripts() { new spell_sha_astral_shift(); @@ -324,4 +551,9 @@ void AddSC_shaman_spell_scripts() new spell_sha_earthbind_totem(); new spell_sha_bloodlust(); new spell_sha_heroism(); + new spell_sha_ancestral_awakening_proc(); + new spell_sha_cleansing_totem_pulse(); + new spell_sha_healing_stream_totem(); + new spell_sha_mana_spring_totem(); + new spell_sha_lava_lash(); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 51b2de5d0f3..b1aff706db0 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -21,8 +21,8 @@ * Scriptnames of files in this file should be prefixed with "spell_warl_". */ -#include "ScriptPCH.h" -#include "Spell.h" +#include "ScriptMgr.h" +#include "SpellScript.h" #include "SpellAuraEffects.h" enum WarlockSpells @@ -99,15 +99,7 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS)) - return false; - if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER)) - return false; - if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD)) - return false; - if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER)) - return false; - if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_IMP)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_IMP)) return false; return true; } @@ -172,9 +164,7 @@ class spell_warl_create_healthstone : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R1)) - return false; - if (!sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R2)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R1) || !sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R2)) return false; return true; } @@ -267,7 +257,8 @@ public: void HandleDummy(SpellEffIndex /*effIndex*/) { - GetCaster()->CastSpell(GetCaster(), GetEffectValue(), true); + Unit* caster = GetCaster(); + caster->CastSpell(caster, GetEffectValue(), true); } void Register() @@ -293,7 +284,8 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader void FilterTargets(std::list<Unit*>& unitList) { - unitList.remove(GetTargetUnit()); + if (GetTargetUnit()) + unitList.remove(GetTargetUnit()); } void Register() @@ -308,6 +300,149 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader } }; +enum Soulshatter +{ + SPELL_SOULSHATTER = 32835, +}; + +class spell_warl_soulshatter : public SpellScriptLoader +{ + public: + spell_warl_soulshatter() : SpellScriptLoader("spell_warl_soulshatter") { } + + class spell_warl_soulshatter_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_soulshatter_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SOULSHATTER)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + { + if (target->CanHaveThreatList() && target->getThreatManager().getThreat(caster) > 0.0f) + { + sLog->outString("THREATREDUCTION"); + caster->CastSpell(target, SPELL_SOULSHATTER, true); + } else + sLog->outString("can have threat? %u . threat number? %f ",target->CanHaveThreatList(),target->getThreatManager().getThreat(caster)); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warl_soulshatter_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_soulshatter_SpellScript(); + } +}; + +enum LifeTap +{ + SPELL_LIFE_TAP_RANK_6 = 11689, + SPELL_LIFE_TAP_RANK_7 = 27222, + SPELL_LIFE_TAP_RANK_8 = 57946, + SPELL_LIFE_TAP_ENERGIZE = 31818, + SPELL_LIFE_TAP_ENERGIZE_2 = 32553, + ICON_ID_IMPROVED_LIFE_TAP = 208, + ICON_ID_MANA_FEED = 1982, +}; + +class spell_warl_life_tap : public SpellScriptLoader +{ + public: + spell_warl_life_tap() : SpellScriptLoader("spell_warl_life_tap") { } + + class spell_warl_life_tap_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_life_tap_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_RANK_6) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_RANK_7) + || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_RANK_8) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE) + || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE_2)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + if (Unit* target = GetHitUnit()) + { + SpellInfo const* spellInfo = GetSpellInfo(); + float spFactor = 0.0f; + int32 damage = int32(GetEffectValue() + (6.3875 * spellInfo->BaseLevel)); + switch (spellInfo->Id) + { + case SPELL_LIFE_TAP_RANK_6: spFactor = 0.2f; break; + case SPELL_LIFE_TAP_RANK_7: + case SPELL_LIFE_TAP_RANK_8: spFactor = 0.5f; break; + default: break; + } + + int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * spFactor)); + + // Shouldn't Appear in Combat Log + target->ModifyHealth(-damage); + + // Improved Life Tap mod + if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, ICON_ID_IMPROVED_LIFE_TAP, 0)) + AddPctN(mana, aurEff->GetAmount()); + + caster->CastCustomSpell(target, SPELL_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false); + + // Mana Feed + int32 manaFeedVal = 0; + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, ICON_ID_MANA_FEED, 0)) + manaFeedVal = aurEff->GetAmount(); + + if (manaFeedVal > 0) + { + ApplyPctN(manaFeedVal, mana); + caster->CastCustomSpell(caster, SPELL_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL); + } + } + } + + SpellCastResult CheckCast() + { + if ((int32(GetCaster()->GetHealth()) > int32(GetSpellInfo()->Effects[EFFECT_0].CalcValue() + (6.3875 * GetSpellInfo()->BaseLevel)))) + { + return SPELL_CAST_OK; + } + return SPELL_FAILED_FIZZLE; + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warl_life_tap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnCheckCast += SpellCheckCastFn(spell_warl_life_tap_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_life_tap_SpellScript(); + } +}; + void AddSC_warlock_spell_scripts() { new spell_warl_banish(); @@ -316,4 +451,6 @@ void AddSC_warlock_spell_scripts() new spell_warl_everlasting_affliction(); new spell_warl_ritual_of_doom_effect(); new spell_warl_seed_of_corruption(); + new spell_warl_soulshatter(); + new spell_warl_life_tap(); } diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index f39ad3d1426..1084398c37d 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -21,7 +21,9 @@ * Scriptnames of files in this file should be prefixed with "spell_warr_". */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" enum WarriorSpells { @@ -46,8 +48,11 @@ class spell_warr_last_stand : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - int32 healthModSpellBasePoints0 = int32(GetCaster()->CountPctFromMaxHealth(30)); - GetCaster()->CastCustomSpell(GetCaster(), WARRIOR_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); + if (Unit* caster = GetCaster()) + { + int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30)); + caster->CastCustomSpell(caster, WARRIOR_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); + } } void Register() @@ -74,7 +79,8 @@ class spell_warr_improved_spell_reflection : public SpellScriptLoader void FilterTargets(std::list<Unit*>& unitList) { - unitList.remove(GetCaster()); + if (GetCaster()) + unitList.remove(GetCaster()); } void Register() @@ -115,23 +121,19 @@ public: void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Unit* target = GetTarget(); - target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true); + if (Unit* target = GetTarget()) + target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true); } void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Unit* target = GetTarget(); - - if (!target->HasAura(SPELL_DAMAGE_REDUCTION_AURA)) - return; - - if (target->HasAura(SPELL_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_RENEWED_HOPE)) - return; - - target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA); + if (Unit* target = GetTarget()) + { + if (target->HasAura(SPELL_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_BLESSING_OF_SANCTUARY) || + target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) || + target->HasAura(SPELL_RENEWED_HOPE))) + target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA); + } } void Register() @@ -148,9 +150,278 @@ public: } }; +enum DeepWounds +{ + SPELL_DEEP_WOUNDS_RANK_1 = 12162, + SPELL_DEEP_WOUNDS_RANK_2 = 12850, + SPELL_DEEP_WOUNDS_RANK_3 = 12868, + SPELL_DEEP_WOUNDS_RANK_PERIODIC = 12721, +}; + +class spell_warr_deep_wounds : public SpellScriptLoader +{ + public: + spell_warr_deep_wounds() : SpellScriptLoader("spell_warr_deep_wounds") { } + + class spell_warr_deep_wounds_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_deep_wounds_SpellScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_1) || !sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_2) || !sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_3)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + int32 damage = GetEffectValue(); + if (Unit* target = GetHitUnit()) + if (Unit* caster = GetCaster()) + { + // apply percent damage mods + damage = caster->SpellDamageBonus(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); + + ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id)); + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC); + uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude; + + // Add remaining ticks to damage done + if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID())) + damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber()); + + damage = damage / ticks; + caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_deep_wounds_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_deep_wounds_SpellScript(); + } +}; + +enum Charge +{ + SPELL_JUGGERNAUT_CRIT_BONUS_TALENT = 64976, + SPELL_JUGGERNAUT_CRIT_BONUS_BUFF = 65156, + SPELL_CHARGE = 34846, +}; + +class spell_warr_charge : public SpellScriptLoader +{ + public: + spell_warr_charge() : SpellScriptLoader("spell_warr_charge") { } + + class spell_warr_charge_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_charge_SpellScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_JUGGERNAUT_CRIT_BONUS_TALENT) || !sSpellMgr->GetSpellInfo(SPELL_JUGGERNAUT_CRIT_BONUS_BUFF) || !sSpellMgr->GetSpellInfo(SPELL_CHARGE)) + return false; + return true; + } + void HandleDummy(SpellEffIndex /* effIndex */) + { + int32 chargeBasePoints0 = GetEffectValue(); + Unit* caster = GetCaster(); + caster->CastCustomSpell(caster, SPELL_CHARGE, &chargeBasePoints0, NULL, NULL, true); + + //Juggernaut crit bonus + if (caster->HasAura(SPELL_JUGGERNAUT_CRIT_BONUS_TALENT)) + caster->CastSpell(caster, SPELL_JUGGERNAUT_CRIT_BONUS_BUFF, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_charge_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_charge_SpellScript(); + } +}; + +enum Slam +{ + SPELL_SLAM = 50783, +}; + +class spell_warr_slam : public SpellScriptLoader +{ + public: + spell_warr_slam() : SpellScriptLoader("spell_warr_slam") { } + + class spell_warr_slam_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_slam_SpellScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SLAM)) + return false; + return true; + } + void HandleDummy(SpellEffIndex /* effIndex */) + { + int32 bp0 = GetEffectValue(); + if (GetHitUnit()) + GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_SLAM, &bp0, NULL, NULL, true, 0); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_slam_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_slam_SpellScript(); + } +}; + +enum Execute +{ + SPELL_EXECUTE = 20647, + SPELL_GLYPH_OF_EXECUTION = 58367, + ICON_ID_SUDDEN_DEATH = 1989, +}; + +class spell_warr_execute : public SpellScriptLoader +{ + public: + spell_warr_execute() : SpellScriptLoader("spell_warr_execute") { } + + class spell_warr_execute_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_execute_SpellScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_EXECUTE) || !sSpellMgr->GetSpellInfo(SPELL_GLYPH_OF_EXECUTION)) + return false; + return true; + } + void HandleDummy(SpellEffIndex effIndex) + { + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + { + SpellInfo const* spellInfo = GetSpellInfo(); + int32 rageUsed = std::min<int32>(300 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE)); + int32 newRage = std::max<int32>(0, caster->GetPower(POWER_RAGE) - rageUsed); + + // Sudden Death rage save + if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, ICON_ID_SUDDEN_DEATH, EFFECT_0)) + { + int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 10; + newRage = std::max(newRage, ragesave); + } + + caster->SetPower(POWER_RAGE, uint32(newRage)); + // Glyph of Execution bonus + if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_GLYPH_OF_EXECUTION, EFFECT_0)) + rageUsed += aurEff->GetAmount() * 10; + + + int32 bp = GetEffectValue() + int32(rageUsed * spellInfo->Effects[effIndex].DamageMultiplier + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.2f); + caster->CastCustomSpell(target,SPELL_EXECUTE,&bp,0,0,true,0,0,GetOriginalCaster()->GetGUID()); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_execute_SpellScript(); + } +}; + +class spell_warr_concussion_blow : public SpellScriptLoader +{ + public: + spell_warr_concussion_blow() : SpellScriptLoader("spell_warr_concussion_blow") { } + + class spell_warr_concussion_blow_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_concussion_blow_SpellScript); + + void HandleDummy(SpellEffIndex /* effIndex */) + { + SetHitDamage(GetHitDamage() + CalculatePctF(GetHitDamage(),GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK))); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_concussion_blow_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_concussion_blow_SpellScript(); + } +}; + +enum Bloodthirst +{ + SPELL_BLOODTHIRST = 23885, +}; + +class spell_warr_bloodthirst : public SpellScriptLoader +{ + public: + spell_warr_bloodthirst() : SpellScriptLoader("spell_warr_bloodthirst") { } + + class spell_warr_bloodthirst_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_bloodthirst_SpellScript); + + void HandleDummy(SpellEffIndex /* effIndex */) + { + int32 damage = GetEffectValue(); + if (GetHitUnit()) + GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_bloodthirst_SpellScript(); + } +}; + void AddSC_warrior_spell_scripts() { new spell_warr_last_stand(); new spell_warr_improved_spell_reflection(); new spell_warr_vigilance(); + new spell_warr_deep_wounds(); + new spell_warr_charge(); + new spell_warr_slam(); + new spell_warr_execute(); + new spell_warr_concussion_blow(); + new spell_warr_bloodthirst(); } diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index fff01c83d07..3dfc85d7eb4 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -1312,7 +1312,7 @@ class go_veil_skith_cage : public GameObjectScript (*itr)->AI()->Talk(SAY_FREE_0); (*itr)->GetMotionMaster()->Clear(); } - } + } return false; } }; diff --git a/src/server/shared/Cryptography/WardenKeyGeneration.h b/src/server/shared/Cryptography/WardenKeyGeneration.h new file mode 100644 index 00000000000..9b44ab1832e --- /dev/null +++ b/src/server/shared/Cryptography/WardenKeyGeneration.h @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "SHA1.h" + +#ifndef _WARDEN_KEY_GENERATION_H +#define _WARDEN_KEY_GENERATION_H + +class SHA1Randx { +public: + SHA1Randx(uint8 *buff, uint32 size) { + uint32 taken = size/2; + + sh.Initialize(); + sh.UpdateData(buff,taken); + sh.Finalize(); + + memcpy(o1,sh.GetDigest(),20); + + sh.Initialize(); + sh.UpdateData(buff+taken,size-taken); + sh.Finalize(); + + memcpy(o2,sh.GetDigest(),20); + + memset(o0,0x00,20); + + fillUp(); + } + + void generate(uint8 *buf, uint32 sz) { + for(uint32 i=0;i<sz;i++) { + if(taken == 20) { + fillUp(); + } + + buf[i] = o0[taken]; + taken++; + } + } +private: + void fillUp() { + sh.Initialize(); + sh.UpdateData(o1,20); + sh.UpdateData(o0,20); + sh.UpdateData(o2,20); + sh.Finalize(); + + memcpy(o0,sh.GetDigest(),20); + + taken = 0; + } + SHA1Hash sh; + uint32 taken; + uint8 o0[20],o1[20],o2[20]; +}; + +#endif diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 18b488e055a..ca53712fbaa 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -351,7 +351,7 @@ enum CharacterDatabaseStatements CHAR_DEL_CHARACTER_SOCIAL, CHAR_UPD_CHARACTER_SOCIAL_NOTE, CHAR_UPD_CHARACTER_POSITION, - + CHAR_INS_LFG_DATA, CHAR_DEL_LFG_DATA, diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index 7e497c4437b..8ef8d3b48cf 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -31,7 +31,7 @@ void LoginDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0 WHERE username = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE username = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.sha_pass_hash, a.id, a.locked, a.last_ip, aa.gmlevel, a.v, a.s FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(LOGIN_UPD_FAILEDLOGINS, "UPDATE account SET failed_logins = failed_logins + 1 WHERE username = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_SEL_FAILEDLOGINS, "SELECT id, failed_logins FROM account WHERE username = ?", CONNECTION_SYNCH) diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index abdeace4d97..a9bb282cf86 100755 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -29,7 +29,7 @@ extern LoginDatabaseWorkerPool LoginDatabase; Log::Log() : raLogfile(NULL), logfile(NULL), gmLogfile(NULL), charLogfile(NULL), - dberLogfile(NULL), chatLogfile(NULL), arenaLogFile(NULL), sqlLogFile(NULL), sqlDevLogFile(NULL), + dberLogfile(NULL), chatLogfile(NULL), arenaLogFile(NULL), sqlLogFile(NULL), sqlDevLogFile(NULL), wardenLogFile(NULL), m_gmlog_per_account(false), m_enableLogDBLater(false), m_enableLogDB(false), m_colored(false) { @@ -73,6 +73,10 @@ Log::~Log() if (sqlDevLogFile != NULL) fclose(sqlDevLogFile); sqlDevLogFile = NULL; + + if (wardenLogFile != NULL) + fclose(wardenLogFile); + wardenLogFile = NULL; } void Log::SetLogLevel(char *Level) @@ -166,6 +170,7 @@ void Log::Initialize() arenaLogFile = openLogFile("ArenaLogFile", NULL, "a"); sqlLogFile = openLogFile("SQLDriverLogFile", NULL, "a"); sqlDevLogFile = openLogFile("SQLDeveloperLogFile", NULL, "a"); + wardenLogFile = openLogFile("Warden.LogFile",NULL,"a"); // Main log file settings m_logLevel = ConfigMgr::GetIntDefault("LogLevel", LOGL_NORMAL); @@ -1055,3 +1060,20 @@ void Log::outErrorST(const char * str, ...) ACE_Stack_Trace st; outError("%s [Stacktrace: %s]", nnew_str, st.c_str()); } + +void Log::outWarden(const char * str, ...) +{ + if (!str) + return; + + if (wardenLogFile) + { + outTimestamp(wardenLogFile); + va_list ap; + va_start(ap, str); + vfprintf(wardenLogFile, str, ap); + fprintf(wardenLogFile, "\n" ); + fflush(wardenLogFile); + va_end(ap); + } +} diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index 2381d91d98d..4baa1695a55 100755 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -50,6 +50,7 @@ enum DebugLogFilters LOG_FILTER_LOOT = 0x00100000, // Loot related LOG_FILTER_GUILD = 0x00200000, // Guild related LOG_FILTER_TRANSPORTS = 0x00400000, // Transport related + LOG_FILTER_WARDEN = 0x00800000, // Warden related }; enum LogTypes @@ -136,6 +137,7 @@ class Log void outChat( const char * str, ... ) ATTR_PRINTF(2, 3); void outArena( const char * str, ... ) ATTR_PRINTF(2, 3); void outSQLDriver( const char* str, ... ) ATTR_PRINTF(2, 3); + void outWarden( const char * str, ... ) ATTR_PRINTF(2, 3); void outCharDump( const char * str, uint32 account_id, uint32 guid, const char * name ); static void outTimestamp(FILE* file); @@ -168,6 +170,7 @@ class Log FILE* arenaLogFile; FILE* sqlLogFile; FILE* sqlDevLogFile; + FILE* wardenLogFile; // cache values for after initilization use (like gm log per account case) std::string m_logsDir; diff --git a/src/server/shared/Threading/Callback.h b/src/server/shared/Threading/Callback.h index fd7a1130fb4..3e1e7ac692f 100755 --- a/src/server/shared/Threading/Callback.h +++ b/src/server/shared/Threading/Callback.h @@ -96,7 +96,7 @@ class QueryCallback { return _stage; } - + //! Resets all underlying variables (param, result and stage) void Reset() { diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index 6ae43bc6840..52ce74be8f8 100755 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -16,6 +16,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <iostream> #include "Util.h" #include "utf8.h" #ifdef USE_SFMT_FOR_RNG @@ -529,3 +530,15 @@ void hexEncodeByteArray(uint8* bytes, uint32 arrayLen, std::string& result) result = ss.str(); } +std::string ByteArrayToHexStr(uint8* bytes, uint32 length) +{ + std::ostringstream ss; + for (uint32 i = 0; i < length; ++i) + { + char buffer[4]; + sprintf(buffer, "%02X ", bytes[i]); + ss << buffer; + } + + return ss.str(); +} diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 684b26eea63..4c2c1936993 100755 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -378,6 +378,7 @@ bool IsIPAddress(char const* ipaddress); uint32 CreatePIDFile(const std::string& filename); void hexEncodeByteArray(uint8* bytes, uint32 arrayLen, std::string& result); +std::string ByteArrayToHexStr(uint8* bytes, uint32 length); #endif //handler for operations on large flags diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index b3254fe7a28..b75dfcfc064 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -129,6 +129,8 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Spells ${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras ${CMAKE_SOURCE_DIR}/src/server/game/Tools + ${CMAKE_SOURCE_DIR}/src/server/game/Warden + ${CMAKE_SOURCE_DIR}/src/server/game/Warden/Modules ${CMAKE_SOURCE_DIR}/src/server/game/Weather ${CMAKE_SOURCE_DIR}/src/server/game/World ${CMAKE_SOURCE_DIR}/src/server/authserver/Server diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index df46cccb9cf..3c8a08df3a1 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -11,6 +11,7 @@ # PERFORMANCE SETTINGS # SERVER LOGGING # SERVER SETTINGS +# WARDEN SETTINGS # PLAYER INTERACTION # CREATURE SETTINGS # CHAT SETTINGS @@ -472,6 +473,7 @@ LogFileLevel = 0 # 1048576 - Anything related to loot # 2097152 - Anything related to guilds # 4194304 - Anything related to transports +# 8388608 - Anything related to Warden anti cheat # # Simply add the values together to create a bitmask. # For more info see enum DebugLogFilters in Log.h @@ -1431,6 +1433,82 @@ AccountInstancesPerHour = 5 ################################################################################################### ################################################################################################### +# WARDEN SETTINGS +# +# Warden.Enabled +# Description: Enable Warden anticheat system. +# Default: 0 - (Disabled) +# 1 - (Enabled) + +Warden.Enabled = 0 + +# +# Warden.NumMemChecks +# Description: Number of Warden memory checks that are sent to the client each cycle. +# Default: 3 - (Enabled) +# 0 - (Disabled) + +Warden.NumMemChecks = 3 + +# +# Warden.NumOtherChecks +# Description: Number of Warden checks other than memory checks that are added to request +# each checking cycle. +# Default: 7 - (Enabled) +# 0 - (Disabled) + +Warden.NumOtherChecks = 7 + +# +# Warden.LogFile +# Description: Client check fails will be logged here. +# Default: "" - (Disabled) +# "Warden.log" - (Enabled) +# + +Warden.LogFile = "" + +# +# Warden.ClientResponseDelay +# Description: Time (in seconds) before client is getting disconnecting for not responding. +# Default: 600 - (10 Minutes) +# 0 - (Disabled, client won't be kicked) + +Warden.ClientResponseDelay = 600 + +# +# Warden.ClientCheckHoldOff +# Description: Time (in seconds) to wait before sending the next check request to the client. +# A low number increases traffic and load on client and server side. +# Default: 30 - (30 Seconds) +# 0 - (Send check as soon as possible) + +Warden.ClientCheckHoldOff = 30 + +# +# Warden.ClientCheckFailAction +# Description: Default action being taken if a client check failed. Actions can be +# overwritten for each single check via warden_action table in characters +# database. +# Default: 0 - (Disabled, Logging only) +# 1 - (Kick) +# 2 - (Ban) + +Warden.ClientCheckFailAction = 0 + +# +# Warden.BanDuration +# Description: Time (in seconds) an account will be banned if ClientCheckFailAction is set +# to ban. +# Default: 86400 - (24 hours) +# 0 - (Permanent ban) + +Warden.BanDuration = 86400 + +# +################################################################################################### + +################################################################################################### # PLAYER INTERACTION # # AllowTwoSide.Accounts |