From 130cc423d28000ff60b253851864f6da8d5fb33e Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 13 Sep 2012 23:58:45 +0200 Subject: Scripts/Commands: Fixed crashes in unstuck command Closes #7754 --- src/server/scripts/Commands/cs_misc.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index aaa4d1c3f68..2c9623b23a6 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()) -- cgit v1.2.3 From 90cb5f29eed22520b15837d33ad3420d6d05287c Mon Sep 17 00:00:00 2001 From: Faq Date: Fri, 14 Sep 2012 09:43:26 +0300 Subject: Core/misc: forgotten Unk0. thnx Elron103 for noticing --- src/server/game/Globals/ObjectMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 20044004b48..7d94e0ad209 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2173,7 +2173,7 @@ void ObjectMgr::LoadItemTemplates() if (itemTemplate.SoundOverrideSubclass != dbcitem->SoundOverrideSubclass) { - sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct Unk0 (%i), must be %i .", entry, itemTemplate.SoundOverrideSubclass, dbcitem->SoundOverrideSubclass); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct SoundOverrideSubclass (%i), must be %i .", entry, itemTemplate.SoundOverrideSubclass, dbcitem->SoundOverrideSubclass); if (enforceDBCAttributes) itemTemplate.SoundOverrideSubclass = dbcitem->SoundOverrideSubclass; } -- cgit v1.2.3 From 5d4cc81e166fbecd72d10e9e1718f7f989b216a4 Mon Sep 17 00:00:00 2001 From: MacWarrior Date: Fri, 14 Sep 2012 20:50:52 +0300 Subject: Core/misc: Correct fields ID description Core/misc: Correct fields ID description in GameEventMgr.cpp --- src/server/game/Events/GameEventMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 704bdde740e..2116738fac3 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"); -- cgit v1.2.3 From 548a4877215c71b201229a5718577706f7eb7e4d Mon Sep 17 00:00:00 2001 From: thesensei Date: Sat, 15 Sep 2012 17:31:57 +0300 Subject: Scripts/Oculus: Support for achievements Ruby, Emerald and Amber Void * Add instance achievement criteria scripts and remove from disables. Based on retail data. * A lot more compact style and specify only for heroic, thanks to Vincent-Michael. Tested. This involves everything needed by the achievement, however the dungeon still needs majour fixes/rewrite. --- .../2012_09_15_00_achievement_criteria_data.sql | 6 ++ sql/updates/world/2012_09_15_00_disables.sql | 4 ++ .../scripts/Northrend/Nexus/Oculus/boss_eregos.cpp | 73 +++++++++++++++++++--- 3 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 sql/updates/world/2012_09_15_00_achievement_criteria_data.sql create mode 100644 sql/updates/world/2012_09_15_00_disables.sql (limited to 'src') diff --git a/sql/updates/world/2012_09_15_00_achievement_criteria_data.sql b/sql/updates/world/2012_09_15_00_achievement_criteria_data.sql new file mode 100644 index 00000000000..a30eff7024e --- /dev/null +++ b/sql/updates/world/2012_09_15_00_achievement_criteria_data.sql @@ -0,0 +1,6 @@ +-- Insert achievement instance criteria data scripts +DELETE FROM `achievement_criteria_data` WHERE `type`=11 and `criteria_id` IN (7323,7324,7325); +INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES +(7323,11,0,0,'achievement_ruby_void'), +(7324,11,0,0,'achievement_emerald_void'), +(7325,11,0,0,'achievement_amber_void'); diff --git a/sql/updates/world/2012_09_15_00_disables.sql b/sql/updates/world/2012_09_15_00_disables.sql new file mode 100644 index 00000000000..371315b5be7 --- /dev/null +++ b/sql/updates/world/2012_09_15_00_disables.sql @@ -0,0 +1,4 @@ +-- Remove achievements from disables +DELETE FROM `disables` WHERE `sourceType`=4 AND `entry`=7323; -- Ruby Void +DELETE FROM `disables` WHERE `sourceType`=4 AND `entry`=7324; -- Emerald Void +DELETE FROM `disables` WHERE `sourceType`=4 AND `entry`=7325; -- Amber Void 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); + } -- cgit v1.2.3 From 530562621488533de18d168d16517a0bb99daf3f Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 15 Sep 2012 20:27:01 +0200 Subject: Core/Conditions: Implemented CONDITION_MAP_DIFFICULTY --- src/server/game/Conditions/ConditionMgr.cpp | 27 ++++++++++++++++++++++++--- src/server/game/Conditions/ConditionMgr.h | 2 +- 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index e24547f1a31..7628906f0fc 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 -- cgit v1.2.3