From 05e72b4906a90ff347ee56e9f2ad6d7f56eb2d3a Mon Sep 17 00:00:00 2001 From: joschiwald Date: Wed, 18 Sep 2013 22:24:05 +0200 Subject: Core/Achievements: Implemented ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE --- src/server/scripts/World/achievement_scripts.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/server/scripts') diff --git a/src/server/scripts/World/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp index 94e448bd9bc..6cd5e962c02 100644 --- a/src/server/scripts/World/achievement_scripts.cpp +++ b/src/server/scripts/World/achievement_scripts.cpp @@ -279,6 +279,17 @@ class achievement_flirt_with_disaster_perf_check : public AchievementCriteriaScr } }; +class achievement_killed_exp_or_honor_target : public AchievementCriteriaScript +{ + public: + achievement_killed_exp_or_honor_target() : AchievementCriteriaScript("achievement_killed_exp_or_honor_target") { } + + bool OnCheck(Player* player, Unit* target) OVERRIDE + { + return target && player->isHonorOrXPTarget(target); + } +}; + void AddSC_achievement_scripts() { new achievement_resilient_victory(); @@ -298,4 +309,5 @@ void AddSC_achievement_scripts() new achievement_tilted(); new achievement_not_even_a_scratch(); new achievement_flirt_with_disaster_perf_check(); + new achievement_killed_exp_or_honor_target(); } -- cgit v1.2.3 From 9579d0a3e717b918192a5dfab520ec1033dfe64c Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sat, 21 Sep 2013 22:36:23 +0200 Subject: Scripts/ScarletEnclave: Fix uninitialized values in Highlord Darion Mograine Reset() has if checks on values that are initialized after them so it's required to initialize these fields in the constructor. Valgrind log: Conditional jump or move depends on uninitialised value(s) by 0x11CF472: HashMapHolder::Find(unsigned long) (ObjectAccessor.h:67) by 0x11CE36F: Creature* ObjectAccessor::GetObjectInWorld(unsigned long, Creature*) (ObjectAccessor.h:114) by 0x1257C13: Creature* ObjectAccessor::GetObjectInMap(unsigned long, Map*, Creature*) (ObjectAccessor.h:135) by 0x12E64F1: Map::GetCreature(unsigned long) (Map.cpp:2767) by 0x10AF4DE: Unit::GetCreature(WorldObject&, unsigned long) (Unit.cpp:13021) by 0x16F8F81: npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::Reset() (chapter5.cpp:386) by 0x16F8D36: npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::npc_highlord_darion_mograineAI(Creature*) (chapter5.cpp:314) by 0x16F8CD6: npc_highlord_darion_mograine::GetAI(Creature*) const (chapter5.cpp:307) by 0x132AF6C: ScriptMgr::GetCreatureAI(Creature*) (ScriptMgr.cpp:796) by 0x1441D45: FactorySelector::selectAI(Creature*) (CreatureAISelector.cpp:41) --- .../scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/server/scripts') diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 382a0002065..ab1367ed684 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -311,6 +311,23 @@ public: { npc_highlord_darion_mograineAI(Creature* creature) : npc_escortAI(creature) { + uiTirionGUID = 0; + uiKorfaxGUID = 0; + uiMaxwellGUID = 0; + uiEligorGUID = 0; + uiRayneGUID = 0; + uiKoltiraGUID = 0; + uiOrbazGUID = 0; + uiThassarianGUID = 0; + uiLichKingGUID = 0; + + memset(uiDefenderGUID, 0, sizeof(uiDefenderGUID)); + memset(uiEarthshatterGUID, 0, sizeof(uiEarthshatterGUID)); + memset(uiAbominationGUID, 0, sizeof(uiAbominationGUID)); + memset(uiBehemothGUID, 0, sizeof(uiBehemothGUID)); + memset(uiGhoulGUID, 0, sizeof(uiGhoulGUID)); + memset(uiWarriorGUID, 0, sizeof(uiWarriorGUID)); + Reset(); } -- cgit v1.2.3