diff options
24 files changed, 130 insertions, 96 deletions
diff --git a/sql/updates/world/2015_12_01_00_world.sql b/sql/updates/world/2015_12_01_00_world.sql index 456a36fe882..1572245a517 100644 --- a/sql/updates/world/2015_12_01_00_world.sql +++ b/sql/updates/world/2015_12_01_00_world.sql @@ -9,4 +9,4 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (24724, 'spell_hallow_end_wand'), -- Skeleton Costume (24733, 'spell_hallow_end_wand'), -- Bat Costume (24737, 'spell_hallow_end_wand'), -- Ghost Costume -(24741, 'spell_hallow_end_wand') -- Wisp Costume; +(24741, 'spell_hallow_end_wand'); -- Wisp Costume diff --git a/sql/updates/world/2015_12_04_00_world.sql b/sql/updates/world/2015_12_04_00_world.sql new file mode 100644 index 00000000000..ee721273bef --- /dev/null +++ b/sql/updates/world/2015_12_04_00_world.sql @@ -0,0 +1,34 @@ +-- +DELETE FROM `gameobject` WHERE `id`=185295; +DELETE FROM `creature_text` WHERE `entry` IN (21514, 10204); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `TextRange`, `comment`, `BroadcastTextId`) VALUES +(10204, 0, 0, "Misha lets OUT a loud roar AS she rakes her claws AGAINST the gronn's altar.", 16, 0, 100, 0, 0, 0, 0, "Misha", 20261), +(21514, 0, 0, "Who dares defile the altar of Gorgrom the Dragon-Eater?", 14, 0, 100, 0, 0, 0, 0, "Gorgrom the Dragon-Eater", 20262), +(21514, 1, 0, "I will crush it and flay it and eat its meat and crack its bones one by one when I am done.", 14, 0, 100, 0, 0, 0, 0, "Gorgrom the Dragon-Eater", 20264); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (21514, 10204); +DELETE FROM `smart_scripts` WHERE source_type = 0 AND entryorguid IN (21514, 10204); +DELETE FROM `smart_scripts` WHERE source_type = 9 AND entryorguid IN (2151400, 1020400); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(21514, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, 2151400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gorgrom the Dragon-Eater - On Just summoned - Action list'), +(2151400, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gorgrom the Dragon-Eater - Action list - Set unit flag'), +(2151400, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gorgrom the Dragon-Eater - Action list - Say text'), +(2151400, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gorgrom the Dragon-Eater - Action list - Say text'), +(2151400, 9, 3, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 3608.135986, 7183.374023, 139.581833, 2.321033, 'Gorgrom the Dragon-Eater - Action list - Move to pos'), +(2151400, 9, 4, 0, 0, 0, 100, 0, 2500, 2500, 0, 0, 11, 35470, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gorgrom the Dragon-Eater - Action list - Cast explosion'), +(2151400, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 50, 185295, 60, 0, 0, 0, 0, 8, 0, 0, 0, 3608.135986, 7183.374023, 139.581833, 2.321033, 'Gorgrom the Dragon-Eater - Action list - Summon Gorgrom corpse spell focus object'), +(2151400, 9, 6, 0, 0, 0, 100, 0, 400, 400, 0, 0, 11, 58951, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gorgrom the Dragon-Eater - Action list - cast Permanent Feign Death'), +(2151400, 9, 7, 0, 0, 0, 100, 0, 40000, 40000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gorgrom the Dragon-Eater - Action list - Despawn'), +(10204, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, 1020400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Misha - On Just summoned - Action list'), +(1020400, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Misha - Action list - Set unit flag'), +(1020400, 9, 1, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Misha - Action list - Say text'), +(1020400, 9, 2, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 3612.911865, 7193.020508, 139.651291, 5.472856, 'Misha - Action list - Move to pos'), +(1020400, 9, 3, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 3612.911865, 7193.020508, 139.651291, 5.472856, 'Misha - Action list - Set Orientation'), +(1020400, 9, 4, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Misha - Action list - Despawn'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (39264, 39220); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 39264, 0, 0, 29, 1, 21514, 30, 0, 1, 0, 0, '', "Sablemane's Trap Require Gorgrom the Dragon-Eater not around"), +(17, 0, 39220, 0, 0, 29, 1, 21514, 30, 0, 1, 0, 0, '', "Sablemane's Trap Require Gorgrom the Dragon-Eater not around"), +(17, 0, 39264, 0, 0, 28, 0, 10802, 0, 0, 1, 0, 0, '', "Sablemane's Trap RequireGorgrom the Dragon-Eater not Completed"), +(17, 0, 39220, 0, 0, 28, 0, 10723, 0, 0, 1, 0, 0, '', "Sablemane's Trap RequireGorgrom the Dragon-Eater not Completed"); diff --git a/sql/updates/world/2015_12_05_00_world.sql b/sql/updates/world/2015_12_05_00_world.sql new file mode 100644 index 00000000000..c2c90164a4f --- /dev/null +++ b/sql/updates/world/2015_12_05_00_world.sql @@ -0,0 +1,8 @@ +-- +SET @TATJANA := 27627; +DELETE FROM `smart_scripts` WHERE `entryorguid`IN (27627) AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@TATJANA,0,0,1,8,0,100,0,49134,0,0,0,11,49135,2,0,0,0,0,1,0,0,0,0,0,0,0,'Tatjana - On spellhit Tranquilizer Dart - Spellcast Tatjana Ping'), +(@TATJANA,0,1,2,61,0,100,0,0,0,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0,'Tatjana - On spellhit Tranquilizer Dart - Set faction'), +(@TATJANA,0,2,0,61,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Tatjana - On Spellhit \'Tranquilizer Dart\' - Stop Attack'), +(@TATJANA,0,3,0,0,0,100,0,2000,6000,9000,12000,11,32009,0,0,0,0,0,2,0,0,0,0,0,0,0,'Tatjana - On update IC - Spellcast Cutdown'); diff --git a/sql/updates/world/2015_12_06_00_world.sql b/sql/updates/world/2015_12_06_00_world.sql new file mode 100644 index 00000000000..b60d4d3e88c --- /dev/null +++ b/sql/updates/world/2015_12_06_00_world.sql @@ -0,0 +1,35 @@ +-- +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=11956; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=11956 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(11956, 0, 0, 0, 62, 0, 100, 0, 3884, 0, 0, 0, 15, 5930, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Great Bear Spirit - On Gossip Select - Quest explored'), +(11956, 0, 1, 0, 62, 0, 100, 0, 3884, 1, 0, 0, 15, 5929, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Great Bear Spirit - On Gossip Select - Quest explored'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=3884; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,3884,0,0,9,5930,0,0,0,0,'','Show the gossip option if the quest 5930 is taken'), +(15,3884,1,0,9,5929,0,0,0,0,'','Show the gossip option if the quest 5929 is taken'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=3882; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`Comment`) VALUES +(14,3882,4719,0,9,5929,0,0,0,"Only show text_id 4719 if the quest 5929 is taken"), +(14,3882,4719,1,9,5930,0,0,0,"Only show text_id 4719 if the quest 5930 is taken"); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=3882; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,3882,0,0,9,5930,0,0,0,0,'','Show the gossip option if the quest 5930 is taken'), +(15,3882,0,1,9,5929,0,0,0,0,'','Show the gossip option if the quest 5929 is taken'); + +DELETE FROM `gossip_menu` WHERE `entry`=3882 AND `text_id`=4719; +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (3882, 4719); + +DELETE FROM `gossip_menu` WHERE `entry`=3882 AND `text_id`=4719; +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (3882, 4719); +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (3881, 3882, 3883, 3884); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES +(3882,0,0,'What do you represent, spirit?',7439,1,1,3881,0,0,0,'',0), +(3881,0,0,'I seek to understand the importance of strength of the body.',7442,1,1,3883,0,0,0,'',0), +(3883,0,0,'I seek to understand the importance of strength of the heart.',7444,1,1,3884,0,0,0,'',0), +(3884,0,0,'I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw.',7446,1,1,3885,0,0,0,'',0), +(3884,1,0,'I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw.',7446,1,1,3885,0,0,0,'',0); diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 7b145268d22..9a6742b5ebc 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -97,7 +97,6 @@ bool SummonList::HasEntry(uint32 entry) const } ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature), - me(creature), IsFleeing(false), _evadeCheckCooldown(2500), _isCombatMovementAllowed(true) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 7d7811d9e75..242acbcd44d 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -184,9 +184,6 @@ struct ScriptedAI : public CreatureAI // Variables // ************* - //Pointer to creature we are manipulating - Creature* me; - //For fleeing bool IsFleeing; diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 8e8c640ccf7..bae400adcc2 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -89,7 +89,7 @@ ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[COND { "PhaseMask", true, false, false }, { "Level", true, true, false }, { "Quest Completed", true, false, false }, - { "Near Creature", true, true, false }, + { "Near Creature", true, true, true }, { "Near GameObject", true, true, false }, { "Object Entry or Guid", true, true, true }, { "Object TypeMask", true, false, false }, @@ -280,7 +280,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const } case CONDITION_NEAR_CREATURE: { - condMeets = GetClosestCreatureWithEntry(object, ConditionValue1, (float)ConditionValue2) ? true : false; + condMeets = GetClosestCreatureWithEntry(object, ConditionValue1, (float)ConditionValue2, bool(!ConditionValue3)) ? true : false; break; } case CONDITION_NEAR_GAMEOBJECT: diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 81fe379f0db..43454aba049 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -59,7 +59,7 @@ enum ConditionTypes CONDITION_PHASEMASK = 26, // phasemask 0 0 true if object is in phasemask CONDITION_LEVEL = 27, // level ComparisonType 0 true if unit's level is equal to param1 (param2 can modify the statement) CONDITION_QUEST_COMPLETE = 28, // quest_id 0 0 true if player has quest_id with all objectives complete, but not yet rewarded - CONDITION_NEAR_CREATURE = 29, // creature entry distance 0 true if there is a creature of entry in range + CONDITION_NEAR_CREATURE = 29, // creature entry distance dead (0/1) true if there is a creature of entry in range CONDITION_NEAR_GAMEOBJECT = 30, // gameobject entry distance 0 true if there is a gameobject of entry in range CONDITION_OBJECT_ENTRY_GUID = 31, // TypeID entry guid true if object is type TypeID and the entry is 0 or matches entry of the object or matches guid of the object CONDITION_TYPE_MASK = 32, // TypeMask 0 0 true if object is type object's TypeMask matches provided TypeMask diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 0121194e327..a399600d2f2 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -52,7 +52,7 @@ Pet::Pet(Player* owner, PetType type) : } m_name = "Pet"; - m_regenTimer = PET_FOCUS_REGEN_INTERVAL; + m_focusRegenTimer = PET_FOCUS_REGEN_INTERVAL; } Pet::~Pet() @@ -589,22 +589,22 @@ void Pet::Update(uint32 diff) } //regenerate focus for hunter pets or energy for deathknight's ghoul - if (m_regenTimer) + if (m_focusRegenTimer) { - if (m_regenTimer > diff) - m_regenTimer -= diff; + if (m_focusRegenTimer > diff) + m_focusRegenTimer -= diff; else { switch (getPowerType()) { case POWER_FOCUS: Regenerate(POWER_FOCUS); - m_regenTimer += PET_FOCUS_REGEN_INTERVAL - diff; - if (!m_regenTimer) ++m_regenTimer; + m_focusRegenTimer += PET_FOCUS_REGEN_INTERVAL - diff; + if (!m_focusRegenTimer) ++m_focusRegenTimer; // Reset if large diff (lag) causes focus to get 'stuck' - if (m_regenTimer > PET_FOCUS_REGEN_INTERVAL) - m_regenTimer = PET_FOCUS_REGEN_INTERVAL; + if (m_focusRegenTimer > PET_FOCUS_REGEN_INTERVAL) + m_focusRegenTimer = PET_FOCUS_REGEN_INTERVAL; break; @@ -615,7 +615,7 @@ void Pet::Update(uint32 diff) // if (!m_regenTimer) ++m_regenTimer; // break; default: - m_regenTimer = 0; + m_focusRegenTimer = 0; break; } } diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h index 85c1f83d4a7..c8e95a06a2c 100644 --- a/src/server/game/Entities/Pet/Pet.h +++ b/src/server/game/Entities/Pet/Pet.h @@ -152,7 +152,7 @@ class Pet : public Guardian int32 m_duration; // time until unsummon (used mostly for summoned guardians and not used for controlled pets) uint64 m_auraRaidUpdateMask; bool m_loading; - uint32 m_regenTimer; + uint32 m_focusRegenTimer; DeclinedName *m_declinedname; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4fedf80e968..277ead92df7 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8291,6 +8291,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg case 15337: // Improved Spirit Tap (Rank 1) case 15338: // Improved Spirit Tap (Rank 2) { + ASSERT(procSpell); if (procSpell->SpellFamilyFlags[0] & 0x800000) if ((procSpell->Id != 58381) || !roll_chance_i(50)) return false; @@ -8552,7 +8553,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg // try detect target manually if not set if (target == NULL) - target = !(procFlags & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && triggerEntry && triggerEntry->IsPositive() ? this : victim; + target = !(procFlags & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && triggerEntry->IsPositive() ? this : victim; if (basepoints0) CastCustomSpell(target, trigger_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); @@ -9648,7 +9649,7 @@ Unit* Unit::GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo) && _IsValidAttackTarget(magnet, spellInfo)) { /// @todo handle this charge drop by proc in cast phase on explicit target - if (victim && spellInfo->Speed > 0.0f) + if (spellInfo->Speed > 0.0f) { // Set up missile speed based delay uint32 delay = uint32(std::floor(std::max<float>(victim->GetDistance(this), 5.0f) / spellInfo->Speed * 1000.0f)); @@ -16041,7 +16042,7 @@ void Unit::RemoveCharmedBy(Unit* charmer) // Vehicle should not attack its passenger after he exists the seat if (type != CHARM_TYPE_VEHICLE) - LastCharmerGUID = charmer->GetGUID(); + LastCharmerGUID = ASSERT_NOTNULL(charmer)->GetGUID(); } // If charmer still exists diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 72f3a6682fa..f8e45c073f2 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -898,6 +898,12 @@ public: uint32 GetHitMask() const { return _hitMask; } SpellInfo const* GetSpellInfo() const { return NULL; } + SpellInfo const* EnsureSpellInfo() const + { + SpellInfo const* spellInfo = GetSpellInfo(); + ASSERT(spellInfo); + return spellInfo; + } SpellSchoolMask GetSchoolMask() const { return SPELL_SCHOOL_MASK_NONE; } DamageInfo* GetDamageInfo() const { return _damageInfo; } diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 5f500156f58..4f8accee69c 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -539,7 +539,7 @@ bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_R } // Reevaluate group enchanter if the leaving player had enchanting skill or the player is offline - if ((player && player->GetSkillValue(SKILL_ENCHANTING)) || !player) + if (!player || player->GetSkillValue(SKILL_ENCHANTING)) ResetMaxEnchantingLevel(); // Remove player from loot rolls diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 30764fea2a3..9f225df8427 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -991,7 +991,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData) data.put<uint64>(maskPos, auraMask); // GROUP_UPDATE_FLAG_AURAS if (updateFlags & GROUP_UPDATE_FLAG_PET_GUID) - data << uint64(pet->GetGUID()); + data << uint64(ASSERT_NOTNULL(pet)->GetGUID()); data << std::string(pet ? pet->GetName() : ""); // GROUP_UPDATE_FLAG_PET_NAME data << uint16(pet ? pet->GetDisplayId() : 0); // GROUP_UPDATE_FLAG_PET_MODEL_ID diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 58bc4915d3f..a3f662f2ade 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -127,6 +127,18 @@ Quest::Quest(Field* questRecord) for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) if (RewardChoiceItemId[i]) ++_rewChoiceItemsCount; + + for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) + DetailsEmote[i] = 0; + + for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) + DetailsEmoteDelay[i] = 0; + + for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) + OfferRewardEmote[i] = 0; + + for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) + OfferRewardEmoteDelay[i] = 0; } void Quest::LoadQuestDetails(Field* fields) diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 1ccd6a4151f..6ae63f2efa3 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -858,9 +858,8 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) // MOVEMENTFLAG_ROOT + MOVEMENTFLAG_PITCH_UP (0x840) // MOVEMENTFLAG_ROOT + MOVEMENTFLAG_PITCH_DOWN (0x880) // If none of these are true, clear the root - if (mi->HasMovementFlag(MOVEMENTFLAG_ROOT) && mi->HasMovementFlag(MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT | MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN)) - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT), - MOVEMENTFLAG_MASK_MOVING); + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT) && mi->HasMovementFlag(MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT | MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN), + MOVEMENTFLAG_MASK_MOVING); } else { diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index b345c5affea..b3ab72dcbff 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5638,7 +5638,7 @@ void Spell::EffectGameObjectDamage(SpellEffIndex /*effIndex*/) FactionTemplateEntry const* casterFaction = caster->GetFactionTemplateEntry(); FactionTemplateEntry const* targetFaction = sFactionTemplateStore.LookupEntry(gameObjTarget->GetUInt32Value(GAMEOBJECT_FACTION)); // Do not allow to damage GO's of friendly factions (ie: Wintergrasp Walls/Ulduar Storm Beacons) - if ((casterFaction && targetFaction && !casterFaction->IsFriendlyTo(*targetFaction)) || !targetFaction) + if (!targetFaction || (casterFaction && targetFaction && !casterFaction->IsFriendlyTo(*targetFaction))) gameObjTarget->ModifyHealth(-damage, caster, GetSpellInfo()->Id); } diff --git a/src/server/game/Spells/SpellHistory.cpp b/src/server/game/Spells/SpellHistory.cpp index ed5c31c25c6..faad54d0af7 100644 --- a/src/server/game/Spells/SpellHistory.cpp +++ b/src/server/game/Spells/SpellHistory.cpp @@ -695,9 +695,7 @@ void SpellHistory::RestoreCooldownStateAfterDuel() // check for spell with onHold active before and during the duel for (auto itr = _spellCooldownsBeforeDuel.begin(); itr != _spellCooldownsBeforeDuel.end(); ++itr) { - if (!itr->second.OnHold && - _spellCooldowns.find(itr->first) != _spellCooldowns.end() && - !_spellCooldowns[itr->first].OnHold) + if (!itr->second.OnHold && !_spellCooldowns[itr->first].OnHold) _spellCooldowns[itr->first] = _spellCooldownsBeforeDuel[itr->first]; } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index ec616c1d4c6..2d990ad3ed2 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -969,10 +969,10 @@ bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcE // check spell family name/flags (if set) for spells if (eventInfo.GetTypeMask() & (PERIODIC_PROC_FLAG_MASK | SPELL_PROC_FLAG_MASK | PROC_FLAG_DONE_TRAP_ACTIVATION)) { - if (procEntry.spellFamilyName && eventInfo.GetSpellInfo() && (procEntry.spellFamilyName != eventInfo.GetSpellInfo()->SpellFamilyName)) + if (procEntry.spellFamilyName && eventInfo.GetSpellInfo() && (procEntry.spellFamilyName != eventInfo.EnsureSpellInfo()->SpellFamilyName)) return false; - if (procEntry.spellFamilyMask && eventInfo.GetSpellInfo() && !(procEntry.spellFamilyMask & eventInfo.GetSpellInfo()->SpellFamilyFlags)) + if (procEntry.spellFamilyMask && eventInfo.GetSpellInfo() && !(procEntry.spellFamilyMask & eventInfo.EnsureSpellInfo()->SpellFamilyFlags)) return false; } diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 9f75d917aea..034fe96306e 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -293,7 +293,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly); } - if (isEqualChanced || (!isEqualChanced && totalChance == 100.0f)) + if (isEqualChanced || totalChance == 100.0f) SetRepeatId(source, textGroup, iter->id); return iter->duration; diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index b35e71dbd50..30ee8254f72 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -374,6 +374,12 @@ public: if (show == "del") { + if (!arg_id) + { + handler->SendSysMessage("|cffff33ffERROR: Waypoint script guid not present.|r"); + return true; + } + id = atoi(arg_id); stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 254e3a41d6b..d0a9b233454 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -235,7 +235,7 @@ public: if (AnetheronGUID) { Creature* boss = ObjectAccessor::GetCreature(*me, AnetheronGUID); - if (!boss || (boss && boss->isDead())) + if (!boss || boss->isDead()) { me->setDeathState(JUST_DIED); me->RemoveCorpse(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 08942e3393f..8bfdee067b2 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -200,7 +200,6 @@ public: CrippleTimer = 50000; WarstompTimer = 10000; CheckTimer = 5000; - instance = creature->GetInstanceScript(); AzgalorGUID = instance->GetGuidData(DATA_AZGALOR); } @@ -208,7 +207,6 @@ public: uint32 WarstompTimer; uint32 CheckTimer; ObjectGuid AzgalorGUID; - InstanceScript* instance; void Reset() override { @@ -248,7 +246,7 @@ public: if (AzgalorGUID) { Creature* boss = ObjectAccessor::GetCreature(*me, AzgalorGUID); - if (!boss || (boss && boss->isDead())) + if (!boss || boss->isDead()) { me->setDeathState(JUST_DIED); me->RemoveCorpse(); diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp index 163620230ef..c7decd3e286 100644 --- a/src/server/scripts/Kalimdor/zone_moonglade.cpp +++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp @@ -108,64 +108,6 @@ public: }; /*###### -## npc_great_bear_spirit -######*/ - -#define GOSSIP_BEAR1 "What do you represent, spirit?" -#define GOSSIP_BEAR2 "I seek to understand the importance of strength of the body." -#define GOSSIP_BEAR3 "I seek to understand the importance of strength of the heart." -#define GOSSIP_BEAR4 "I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw." - -class npc_great_bear_spirit : public CreatureScript -{ -public: - npc_great_bear_spirit() : CreatureScript("npc_great_bear_spirit") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(4721, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(4733, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(4734, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(4735, creature->GetGUID()); - if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(5929); - if (player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(5930); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) override - { - //ally or horde quest - if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - player->SEND_GOSSIP_MENU(4719, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(4718, creature->GetGUID()); - - return true; - } - -}; - -/*###### ## npc_silva_filnaveth ######*/ @@ -712,7 +654,6 @@ public: void AddSC_moonglade() { new npc_bunthen_plainswind(); - new npc_great_bear_spirit(); new npc_silva_filnaveth(); new npc_clintar_spirit(); new npc_omen(); |