aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.cpp27
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.h2
-rwxr-xr-xsrc/server/game/Events/GameEventMgr.cpp4
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp9
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp73
5 files changed, 95 insertions, 20 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index d1db3d9577c..6f9f3106484 100755
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -279,6 +279,18 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
condMeets = player->HasTitle(ConditionValue1);
break;
}
+ case CONDITION_MAP_DIFFICULTY:
+ {
+ if (Unit* unit = object->ToUnit())
+ {
+ if (unit->GetMap()->IsRaid())
+ if (unit->GetMap()->Is25ManRaid() != ((ConditionValue1 & RAID_DIFFICULTY_MASK_25MAN) != 0))
+ return false;
+
+ condMeets = unit->GetMap()->GetSpawnMode() >= ConditionValue1;
+ }
+ break;
+ }
default:
condMeets = false;
break;
@@ -430,6 +442,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition()
case CONDITION_TITLE:
mask |= GRID_MAP_TYPE_MASK_PLAYER;
break;
+ case CONDITION_MAP_DIFFICULTY:
+ mask |= GRID_MAP_TYPE_MASK_ALL;
+ break;
default:
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
break;
@@ -1842,9 +1857,15 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
}
break;
}
- case CONDITION_UNUSED_19:
- sLog->outError(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring");
- return false;
+ case CONDITION_MAP_DIFFICULTY:
+ {
+ if (cond->ConditionValue1 >= MAX_DIFFICULTY)
+ {
+ sLog->outError(LOG_FILTER_SQL, "Map Difficulty condition has non existing map difficulty in value1 (%u), skipped", cond->ConditionValue1);
+ return false;
+ }
+ break;
+ }
case CONDITION_UNUSED_20:
sLog->outError(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_20 in `conditions` table - ignoring");
return false;
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index fcd0c788d9f..3b0e6cc69f3 100755
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -49,7 +49,7 @@ enum ConditionTypes
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_TITLE = 18, // title id 0 0 true if player has title
- CONDITION_UNUSED_19 = 19, //
+ CONDITION_MAP_DIFFICULTY = 19, // difficulty 0 0
CONDITION_UNUSED_20 = 20, //
CONDITION_UNUSED_21 = 21, //
CONDITION_MAPID = 22, // map_id 0 0 true if in map_id
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp
index 053b78b8a1d..a8f401dfb32 100755
--- a/src/server/game/Events/GameEventMgr.cpp
+++ b/src/server/game/Events/GameEventMgr.cpp
@@ -205,7 +205,7 @@ void GameEventMgr::LoadFromDB()
{
{
uint32 oldMSTime = getMSTime();
- // 1 2 3 4 5 6 7 8
+ // 0 1 2 3 4 5 6 7
QueryResult result = WorldDatabase.Query("SELECT eventEntry, UNIX_TIMESTAMP(start_time), UNIX_TIMESTAMP(end_time), occurence, length, holiday, description, world_event FROM game_event");
if (!result)
{
@@ -366,7 +366,7 @@ void GameEventMgr::LoadFromDB()
{
uint32 oldMSTime = getMSTime();
- // 1 2
+ // 0 1
QueryResult result = WorldDatabase.Query("SELECT creature.guid, game_event_creature.eventEntry FROM creature"
" JOIN game_event_creature ON creature.guid = game_event_creature.guid");
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 90b87796fff..dd40a590647 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -953,13 +953,12 @@ public:
if (!player_str)
return false;
- std::string location_str = strtok(NULL, "");
- if (location_str.empty())
- location_str = "inn";
+ std::string location_str = "inn";
+ if (char const* loc = strtok(NULL, " "))
+ location_str = loc;
Player* player = NULL;
- std::string playerName;
- if (!handler->extractPlayerTarget((char*)player_str, &player, NULL, &playerName))
+ if (!handler->extractPlayerTarget(player_str, &player))
return false;
if (player->isInFlight() || player->isInCombat())
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp
index 708ed600933..e68e28be99b 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp
@@ -113,6 +113,13 @@ enum EmeraldDrake
SPELL_EMERALD_DREAM_FUNNEL = 50344 //(60 yds) - Channeled - Transfers 5% of the caster's max health to a friendly drake every second for 10 seconds as long as the caster channels.
};
+enum EregosData
+{
+ DATA_RUBY_VOID = 0, // http://www.wowhead.com/achievement=2044
+ DATA_EMERALD_VOID = 1, // http://www.wowhead.com/achievement=2045
+ DATA_AMBER_VOID = 2 // http://www.wowhead.com/achievement=2046
+};
+
class boss_eregos : public CreatureScript
{
public:
@@ -126,12 +133,15 @@ public:
struct boss_eregosAI : public BossAI
{
boss_eregosAI(Creature* creature) : BossAI(creature, DATA_EREGOS_EVENT) { }
-
+
void Reset()
{
_Reset();
+ _phase = PHASE_NORMAL;
- phase = PHASE_NORMAL;
+ _rubyVoid = true;
+ _emeraldVoid = true;
+ _amberVoid = true;
DoAction(ACTION_SET_NORMAL_EVENTS);
}
@@ -141,6 +151,31 @@ public:
_EnterCombat();
Talk(SAY_AGGRO);
+ /* Checks for present drakes vehicles from each type and deactivate achievement that corresponds to each found
+ The checks are so big in case some party try weird things like pulling boss down or hiding out of check range, the only thing player need is to get the boss kill credit after the check /even if he or his drake die/
+ Drakes mechanic would despawn all after unmount and also drakes should be auto mounted after item use, item use after Eregos is engaged leads to his despawn - based on retail data. */
+ if (me->FindNearestCreature(NPC_RUBY_DRAKE_VEHICLE, 500.0f, true))
+ _rubyVoid = false;
+ if (me->FindNearestCreature(NPC_EMERALD_DRAKE_VEHICLE, 500.0f, true))
+ _emeraldVoid = false;
+ if (me->FindNearestCreature(NPC_AMBER_DRAKE_VEHICLE, 500.0f, true))
+ _amberVoid = false;
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch (type)
+ {
+ case DATA_RUBY_VOID:
+ return _rubyVoid;
+ case DATA_EMERALD_VOID:
+ return _emeraldVoid;
+ case DATA_AMBER_VOID:
+ return _amberVoid;
+ default:
+ break;
+ }
+ return 0;
}
void DoAction(const int32 action)
@@ -180,11 +215,11 @@ public:
if (!me->GetMap()->IsHeroic())
return;
- if ( (me->GetHealthPct() < 60.0f && me->GetHealthPct() > 20.0f && phase < PHASE_FIRST_PLANAR)
- || (me->GetHealthPct() < 20.0f && phase < PHASE_SECOND_PLANAR) )
+ if ( (me->GetHealthPct() < 60.0f && me->GetHealthPct() > 20.0f && _phase < PHASE_FIRST_PLANAR)
+ || (me->GetHealthPct() < 20.0f && _phase < PHASE_SECOND_PLANAR) )
{
events.Reset();
- phase = (me->GetHealthPct() < 60.0f && me->GetHealthPct() > 20.0f) ? PHASE_FIRST_PLANAR : PHASE_SECOND_PLANAR;
+ _phase = (me->GetHealthPct() < 60.0f && me->GetHealthPct() > 20.0f) ? PHASE_FIRST_PLANAR : PHASE_SECOND_PLANAR;
DoCast(SPELL_PLANAR_SHIFT);
@@ -241,8 +276,11 @@ public:
_JustDied();
}
- private:
- uint8 phase;
+ private:
+ uint8 _phase;
+ bool _rubyVoid;
+ bool _emeraldVoid;
+ bool _amberVoid;
};
};
@@ -274,8 +312,25 @@ class spell_eregos_planar_shift : public SpellScriptLoader
}
};
-void AddSC_boss_eregos()
+class achievement_gen_eregos_void : public AchievementCriteriaScript
{
+ public:
+ achievement_gen_eregos_void(char const* name, uint32 data) : AchievementCriteriaScript(name), _data(data) { }
+
+ bool OnCheck(Player* /*player*/, Unit* target)
+ {
+ return target && target->GetAI()->GetData(_data);
+ }
+
+ private:
+ uint32 _data;
+};
+
+ void AddSC_boss_eregos()
+ {
new boss_eregos();
new spell_eregos_planar_shift();
-}
+ new achievement_gen_eregos_void("achievement_ruby_void", DATA_RUBY_VOID);
+ new achievement_gen_eregos_void("achievement_emerald_void", DATA_EMERALD_VOID);
+ new achievement_gen_eregos_void("achievement_amber_void", DATA_AMBER_VOID);
+ }