Skip to content
Browse files

Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/game/AI/EventAI/CreatureEventAI.cpp
	src/server/game/AI/EventAI/CreatureEventAI.h
	src/server/game/Achievements/AchievementMgr.cpp
  • Loading branch information...
2 parents f6b6558 + 7dd0cd4 commit d5163d846fcbbd94655f0ba93c81a3e2bd302b3c @Vincent-Michael Vincent-Michael committed
Showing with 603 additions and 93 deletions.
  1. +8 −0 sql/updates/world/2012_01_05_00_world_sai.sql
  2. +2 −2 sql/updates/world/2013_01_03_14_world_spell_area.sql
  3. +8 −0 sql/updates/world/2013_01_03_16_world_various_fixes.sql
  4. +3 −0 sql/updates/world/2013_01_04_00_world_creature_text.sql
  5. +38 −0 sql/updates/world/2013_01_04_01_world_sai.sql
  6. +29 −0 sql/updates/world/2013_01_04_02_world_misc.sql
  7. +1 −1 src/server/collision/BoundingIntervalHierarchy.cpp
  8. +6 −0 src/server/game/AI/CoreAI/PetAI.cpp
  9. +3 −3 src/server/game/Achievements/AchievementMgr.cpp
  10. +1 −2 src/server/game/Addons/AddonMgr.h
  11. +1 −0 src/server/game/Battlefield/Battlefield.cpp
  12. +1 −1 src/server/game/Battlegrounds/ArenaTeam.cpp
  13. +1 −2 src/server/game/Battlegrounds/BattlegroundMgr.cpp
  14. +1 −0 src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
  15. +1 −2 src/server/game/Entities/Pet/Pet.cpp
  16. +10 −1 src/server/game/Entities/Player/Player.cpp
  17. +3 −5 src/server/game/Entities/Unit/StatSystem.cpp
  18. +20 −2 src/server/game/Entities/Unit/Unit.cpp
  19. +36 −20 src/server/game/Entities/Vehicle/Vehicle.cpp
  20. +15 −4 src/server/game/Entities/Vehicle/Vehicle.h
  21. +1 −1 src/server/game/Globals/ObjectMgr.cpp
  22. +1 −2 src/server/game/Handlers/CharacterHandler.cpp
  23. +1 −1 src/server/game/Loot/LootMgr.cpp
  24. +1 −0 src/server/game/Maps/MapManager.cpp
  25. +3 −1 src/server/game/Movement/Spline/MoveSplineInit.cpp
  26. +2 −0 src/server/game/Scripting/ScriptLoader.cpp
  27. +5 −0 src/server/game/Scripting/ScriptMgr.cpp
  28. +4 −0 src/server/game/Scripting/ScriptMgr.h
  29. +1 −1 src/server/game/Server/WorldSocketMgr.cpp
  30. +1 −1 src/server/game/Warden/WardenWin.cpp
  31. +1 −1 src/server/scripts/Commands/cs_lookup.cpp
  32. +1 −0 src/server/scripts/EasternKingdoms/CMakeLists.txt
  33. +331 −0 src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
  34. +24 −19 src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp
  35. +27 −9 src/server/scripts/EasternKingdoms/Scholomance/scholomance.h
  36. +2 −2 src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
  37. +2 −2 src/server/shared/Dynamic/LinkedReference/Reference.h
  38. +4 −3 src/server/shared/Utilities/Util.cpp
  39. +1 −1 src/server/worldserver/RemoteAccess/RARunnable.cpp
  40. +2 −4 src/tools/vmap4_extractor/model.cpp
View
8 sql/updates/world/2012_01_05_00_world_sai.sql
@@ -0,0 +1,8 @@
+-- Fixup some runtime errors, linked events that were not SMART_EVENT_LINK
+UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=38017 AND `id`=1 AND `source_type`=0;
+UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=1443 AND `id`=1 AND `source_type`=0;
+UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=3448 AND `id` IN (1, 2, 3) AND `source_type`=0;
+UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=3616 AND `id` IN (1, 2) AND `source_type`=0;
+UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=4049 AND `id`=1 AND `source_type`=0;
+UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=305400 AND `id` IN (1, 2) AND `source_type`=9;
+UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=83600 AND `id` IN (1, 2, 3) AND `source_type`=9;
View
4 sql/updates/world/2013_01_03_14_world_spell_area.sql
@@ -1,4 +1,4 @@
-- add aura to be able to hand in quests
DELETE FROM `spell_area` WHERE `spell`=52217;
-INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES
-(52217,4306,12574,1,0,0,0,2,1);
+INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`,`quest_start_status`,`quest_end_status`) VALUES
+(52217,4306,12574,0,0,0,2,1,1,64);
View
8 sql/updates/world/2013_01_03_16_world_various_fixes.sql
@@ -0,0 +1,8 @@
+-- NPC talk text convert from creature_ai_text. Moving boss to cpp.
+UPDATE `creature_template` SET `minlevel`=63,`maxlevel`=63,`InhabitType`=5,`AIName`= '', `ScriptName`= 'boss_kirtonos_the_herald' WHERE `entry`=10506;
+UPDATE `gameobject_template` SET `AIName`= '', `ScriptName`= 'go_brazier_of_the_herald' WHERE `entry`=175564;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=10506;
+DELETE FROM `creature_ai_texts` WHERE `entry`=-448;
+DELETE FROM `creature_text` WHERE `entry` IN (10506);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(10506,0,0, '%s lets out a shrill cry.',16,0,100,0,0,0, 'Kirtonos The Herald - Emote');
View
3 sql/updates/world/2013_01_04_00_world_creature_text.sql
@@ -0,0 +1,3 @@
+DELETE FROM `creature_text` WHERE `entry`=4295;
+INSERT INTO `creature_text`(`entry`,`text`,`type`,`language`,`comment`) VALUES
+(4295,"There is no escape for you. The Crusade shall destroy all who carry the scourge's taint.",12,7,"Scarlet Myrmidon - Talk on low HP");
View
38 sql/updates/world/2013_01_04_01_world_sai.sql
@@ -0,0 +1,38 @@
+-- Arcane Wraith SAI
+SET @ENTRY := 15273;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,8,0,100,1,28730,0,0,0,27,15468,28730,0,0,0,0,7,0,0,0,0,0,0,0,"Arcane Wraith - On Spellhit Arcane Torrent - Quest Credit"),
+(@ENTRY,0,1,0,8,0,100,1,25046,0,0,0,27,15468,28730,0,0,0,0,7,0,0,0,0,0,0,0,"Arcane Wraith - On Spellhit Arcane Torrent - Quest Credit"),
+(@ENTRY,0,2,0,0,0,100,0,10100,16500,12700,24800,11,37361,0,0,0,0,0,2,0,0,0,0,0,0,0,"Arcane Wraith - In Combat - Cast Arcane Bolt");
+
+-- Mana Wyrm SAI
+SET @ENTRY := 15274;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,8,0,100,1,28730,0,0,0,27,15468,28730,0,0,0,0,7,0,0,0,0,0,0,0,"Mana Wyrm - On Spellhit Arcane Torrent - Quest Credit"),
+(@ENTRY,0,1,0,8,0,100,1,25046,0,0,0,27,15468,28730,0,0,0,0,7,0,0,0,0,0,0,0,"Mana Wyrm - On Spellhit Arcane Torrent - Quest Credit");
+
+-- Feral Tender SAI
+SET @ENTRY := 15294;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,8,0,100,1,28730,0,0,0,27,15468,28730,0,0,0,0,7,0,0,0,0,0,0,0,"Feral Tender - On Spellhit Arcane Torrent - Quest Credit"),
+(@ENTRY,0,1,0,8,0,100,1,25046,0,0,0,27,15468,28730,0,0,0,0,7,0,0,0,0,0,0,0,"Feral Tender - On Spellhit Arcane Torrent - Quest Credit"),
+(@ENTRY,0,2,0,2,0,100,0,0,50,15300,22900,11,31325,0,0,0,0,0,1,0,0,0,0,0,0,0,"Feral Tender - At 50% HP - Cast Renew");
+
+-- Tainted Arcane Wraith SAI
+SET @ENTRY := 15298;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,8,0,100,1,28730,0,0,0,27,15468,28730,0,0,0,0,7,0,0,0,0,0,0,0,"Tainted Arcane Wraith - On Spellhit Arcane Torrent - Quest Credit"),
+(@ENTRY,0,1,0,8,0,100,1,25046,0,0,0,27,15468,28730,0,0,0,0,7,0,0,0,0,0,0,0,"Tainted Arcane Wraith - On Spellhit Arcane Torrent - Quest Credit"),
+(@ENTRY,0,2,0,0,0,100,0,9000,18800,21100,32200,11,25603,0,0,0,0,0,2,0,0,0,0,0,0,0,"Tainted Arcane Wraith - In Combat - Cast Slow");
View
29 sql/updates/world/2013_01_04_02_world_misc.sql
@@ -0,0 +1,29 @@
+-- Add Gossip for Harrison Jones
+UPDATE `creature_template` SET `gossip_menu_id`=8932 WHERE `entry`=24358;
+DELETE FROM `gossip_menu` WHERE `entry`=8932 AND `text_id`=12135;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8932,12135);
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=8932 AND `id`=0;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`) VALUES
+(8932,0,0, 'Thanks for the concern, but we intend to explore Zul''Aman.',1,1);
+
+-- Pathing for Harrison Jones Entry: 24358
+SET @NPC := 86177;
+SET @PATH := @NPC * 10;
+DELETE FROM `waypoint_data` WHERE `id`IN (@PATH,@PATH+1,@PATH+2);
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,112.1772,1670.18,42.02158,0,0,0,100,0),
+(@PATH,2,82.44975,1655.312,42.02155,0,0,0,100,0),
+(@PATH,3,114.1627,1661.469,42.02158,0,0,0,100,0),
+(@PATH,4,131.8243,1644.853,42.0216,0,0,0,100,0),
+(@PATH+1,1,121.897,1639.106,42.19081,0,0,0,100,0),
+(@PATH+1,2,120.8522,1637.931,42.37172,0,0,0,100,0),
+(@PATH+1,3,120.7898,1609.063,43.49005,0,0,0,100,0),
+(@PATH+2,1,120.6967,1603.713,43.4503,0,0,0,100,0);
+
+-- Text for Harrison Jones from sniff
+DELETE FROM `creature_text` WHERE `entry` IN (24358);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(24358,0,0, 'Suit yourself. At least five of you must assist me if we''re to get inside. Follow me....',14,0,100,1,0,0, 'Harrison Jones - Gong Event Say 0'),
+(24358,1,0, 'According to my calculations, if enough of us bang the gong at once the seal on these doors will break and we can enter.',14,0,100,1,0,0, 'Harrison Jones - Gong Event Say 1'),
+(24358,2,0, 'I''ve researched this site extensively and I won''t allow any dim-witted treasure hunters to swoop in and steal what belongs in a museum. I''ll lead this charge...',14,0,100,0,0,0, 'Harrison Jones - Gong Event Say 2'),
+(24358,3,0, 'In fact, it would be best if you just stay here. You''d only get in my way....',14,0,100,0,0,0, 'Harrison Jones - Gong Event Say 3');
View
2 src/server/collision/BoundingIntervalHierarchy.cpp
@@ -241,7 +241,7 @@ void BIH::subdivide(int left, int right, std::vector<uint32> &tempTree, buildDat
bool BIH::writeToFile(FILE* wf) const
{
uint32 treeSize = tree.size();
- uint32 check=0, count=0;
+ uint32 check=0, count;
check += fwrite(&bounds.low(), sizeof(float), 3, wf);
check += fwrite(&bounds.high(), sizeof(float), 3, wf);
check += fwrite(&treeSize, sizeof(uint32), 1, wf);
View
6 src/server/game/AI/CoreAI/PetAI.cpp
@@ -251,6 +251,12 @@ void PetAI::UpdateAI(const uint32 diff)
for (TargetSpellList::const_iterator itr = targetSpellStore.begin(); itr != targetSpellStore.end(); ++itr)
delete itr->second;
}
+
+ // Update speed as needed to prevent dropping too far behind and despawning
+ me->UpdateSpeed(MOVE_RUN, true);
+ me->UpdateSpeed(MOVE_WALK, true);
+ me->UpdateSpeed(MOVE_FLIGHT, true);
+
}
void PetAI::UpdateAllies()
View
6 src/server/game/Achievements/AchievementMgr.cpp
@@ -1845,9 +1845,6 @@ void AchievementMgr<T>::RemoveTimedAchievement(AchievementCriteriaTimedTypes typ
template<>
void AchievementMgr<Player>::CompletedAchievement(AchievementEntry const* achievement, Player* referencePlayer)
{
- sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::CompletedAchievement(%u). Player: %s (%u)",
- achievement->ID, GetOwner()->GetName().c_str(), GetOwner()->GetGUIDLow());
-
// disable for gamemasters with GM-mode enabled
if (GetOwner()->isGameMaster())
return;
@@ -1862,6 +1859,9 @@ void AchievementMgr<Player>::CompletedAchievement(AchievementEntry const* achiev
if (!GetOwner()->GetSession()->PlayerLoading())
SendAchievementEarned(achievement);
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::CompletedAchievement(%u). Player: %s (%u)",
+ achievement->ID, GetOwner()->GetName().c_str(), GetOwner()->GetGUIDLow());
+
CompletedAchievementData& ca = m_completedAchievements[achievement->ID];
ca.date = time(NULL);
ca.changed = true;
View
3 src/server/game/Addons/AddonMgr.h
@@ -37,9 +37,8 @@ struct AddonInfo
struct SavedAddon
{
- SavedAddon(const std::string& name, uint32 crc)
+ SavedAddon(const std::string& name, uint32 crc) : Name(name)
{
- Name = name;
CRC = crc;
}
View
1 src/server/game/Battlefield/Battlefield.cpp
@@ -42,6 +42,7 @@ Battlefield::Battlefield()
m_TypeId = 0;
m_BattleId = 0;
m_ZoneId = 0;
+ m_Map = NULL;
m_MapId = 0;
m_MaxPlayer = 0;
m_MinPlayer = 0;
View
2 src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -337,7 +337,7 @@ void ArenaTeam::Disband(WorldSession* session)
// Broadcast update
if (session)
{
- BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName().c_str(), GetName(), "");
+ BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), "");
if (Player* player = session->GetPlayer())
sLog->outDebug(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName().c_str(), player->GetGUIDLow(), GetType(), GetId());
View
3 src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -1443,9 +1443,8 @@ BattlegroundTypeId BattlegroundMgr::GetRandomBG(BattlegroundTypeId bgTypeId)
if (weight)
{
- uint32 selectedWeight = 0;
// Select a random value
- selectedWeight = urand(0, weight - 1);
+ uint32 selectedWeight = urand(0, weight - 1);
// Select the correct bg (if we have in DB A(10), B(20), C(10), D(15) --> [0---A---9|10---B---29|30---C---39|40---D---54])
weight = 0;
for (BattlegroundSelectionWeightMap::const_iterator it = selectionWeights.begin(); it != selectionWeights.end(); ++it)
View
1 src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
@@ -30,6 +30,7 @@
BattlegroundAB::BattlegroundAB()
{
+ m_IsInformedNearVictory = false;
m_BuffChange = true;
BgObjects.resize(BG_AB_OBJECT_MAX);
BgCreatures.resize(BG_AB_ALL_NODES_COUNT + 5);//+5 for aura triggers
View
3 src/server/game/Entities/Pet/Pet.cpp
@@ -1733,8 +1733,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
ss << id;
need_comma = true;
- }
- while (resultPets->NextRow());
+ } while (resultPets->NextRow());
ss << ") AND spell IN (";
View
11 src/server/game/Entities/Player/Player.cpp
@@ -1744,7 +1744,8 @@ void Player::Update(uint32 p_time)
{
if (p_time >= m_nextSave)
{
- // m_nextSave reseted in SaveToDB call
+ // m_nextSave reset in SaveToDB call
+ sScriptMgr->OnPlayerSave(this);
SaveToDB();
sLog->outDebug(LOG_FILTER_PLAYER, "Player '%s' (GUID: %u) saved", GetName().c_str(), GetGUIDLow());
}
@@ -16039,6 +16040,8 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count)
void Player::KilledMonster(CreatureTemplate const* cInfo, uint64 guid)
{
+ ASSERT(cInfo);
+
if (cInfo->Entry)
KilledMonsterCredit(cInfo->Entry, guid);
@@ -16191,6 +16194,12 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id)
if (reqTarget != entry) // if entry doesn't match, check for killcredits referenced in template
{
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
+ if (!cinfo)
+ {
+ sLog->outError(LOG_FILTER_PLAYER, "Player::CastedCreatureOrGO: GetCreatureTemplate failed for entry %u. Skipping.", entry);
+ continue;
+ }
+
for (uint8 k = 0; k < MAX_KILL_CREDIT; ++k)
if (cinfo->KillCredit[k] == reqTarget)
entry = cinfo->KillCredit[k];
View
8 src/server/game/Entities/Unit/StatSystem.cpp
@@ -186,10 +186,9 @@ void Player::UpdateResistances(uint32 school)
void Player::UpdateArmor()
{
- float value = 0.0f;
UnitMods unitMod = UNIT_MOD_ARMOR;
- value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items)
+ float value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items)
value *= GetModifierValue(unitMod, BASE_PCT); // armor percent from items
value += GetModifierValue(unitMod, TOTAL_VALUE);
@@ -916,10 +915,9 @@ bool Guardian::UpdateStats(Stats stat)
case STAT_STRENGTH: mod = 0.7f; break; // Default Owner's Strength scale
default: break;
}
- // Ravenous Dead
- AuraEffect const* aurEff = NULL;
+
// Check just if owner has Ravenous Dead since it's effect is not an aura
- aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0);
+ AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0);
if (aurEff)
{
SpellInfo const* spellInfo = aurEff->GetSpellInfo(); // Then get the SpellProto and add the dummy effect value
View
22 src/server/game/Entities/Unit/Unit.cpp
@@ -11455,9 +11455,27 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
case MOVE_SWIM:
case MOVE_FLIGHT:
{
- // Set creature speed rate from CreatureInfo
+ // Set creature speed rate
if (GetTypeId() == TYPEID_UNIT)
- speed *= ToCreature()->GetCreatureTemplate()->speed_run; // at this point, MOVE_WALK is never reached
+ {
+ Unit* pOwner = GetCharmerOrOwner();
+ if (isPet() && !isInCombat() && pOwner) // Must check for owner or crash on "Tame Beast"
+ {
+ // For every yard over 5, increase speed by 0.01
+ // to help prevent pet from lagging behind and despawning
+ float dist = GetDistance(pOwner);
+ float base_rate = 1.00f; // base speed is 100% of owner speed
+
+ if (dist < 5)
+ dist = 5;
+
+ float mult = base_rate + ((dist - 5) * 0.01f);
+
+ speed *= pOwner->GetSpeedRate(mtype) * mult; // pets derive speed from owner when not in combat
+ }
+ else
+ speed *= ToCreature()->GetCreatureTemplate()->speed_run; // at this point, MOVE_WALK is never reached
+ }
// Normalize speed by 191 aura SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED if need
// TODO: possible affect only on MOVE_RUN
View
56 src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -31,7 +31,8 @@
#include "MoveSplineInit.h"
#include "TemporarySummon.h"
-Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) : _me(unit), _vehicleInfo(vehInfo), _usableSeatNum(0), _creatureEntry(creatureEntry)
+Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) :
+_me(unit), _vehicleInfo(vehInfo), _usableSeatNum(0), _creatureEntry(creatureEntry), _status(STATUS_NONE)
{
for (uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i)
{
@@ -49,6 +50,8 @@ Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry)
Vehicle::~Vehicle()
{
+ /// @Uninstall must be called before this.
+ ASSERT(_status == STATUS_UNINSTALLING);
for (SeatMap::const_iterator itr = Seats.begin(); itr != Seats.end(); ++itr)
ASSERT(!itr->second.Passenger);
}
@@ -92,6 +95,7 @@ void Vehicle::Install()
}
}
+ _status = STATUS_INSTALLED;
if (GetBase()->GetTypeId() == TYPEID_UNIT)
sScriptMgr->OnInstall(this);
}
@@ -112,6 +116,14 @@ void Vehicle::InstallAllAccessories(bool evading)
void Vehicle::Uninstall()
{
+ /// @Prevent recursive uninstall call. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.)
+ if (_status == STATUS_UNINSTALLING)
+ {
+ sLog->outError(LOG_FILTER_VEHICLES, "Vehicle GuidLow: %u, Entry: %u attempts to uninstall, but already has STATUS_UNINSTALLING! "
+ "Check Uninstall/PassengerBoarded script hooks for errors.", _me->GetGUIDLow(), _me->GetEntry());
+ return;
+ }
+ _status = STATUS_UNINSTALLING;
sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Uninstall Entry: %u, GuidLow: %u", _creatureEntry, _me->GetGUIDLow());
RemoveAllPassengers();
@@ -250,6 +262,14 @@ int8 Vehicle::GetNextEmptySeat(int8 seatId, bool next) const
void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 type, uint32 summonTime)
{
+ /// @Prevent adding accessories when vehicle is uninstalling. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.)
+ if (_status == STATUS_UNINSTALLING)
+ {
+ sLog->outError(LOG_FILTER_VEHICLES, "Vehicle GuidLow: %u, Entry: %u attempts to install accessory Entry: %u on seat %d with STATUS_UNINSTALLING! "
+ "Check Uninstall/PassengerBoarded script hooks for errors.", _me->GetGUIDLow(), _me->GetEntry(), entry, (int32)seatId);
+ return;
+ }
+
sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle: Installing accessory entry %u on vehicle entry %u (seat:%i)", entry, GetCreatureEntry(), seatId);
if (Unit* passenger = GetPassenger(seatId))
{
@@ -279,14 +299,6 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ
return;
}
- // this cannot be checked instantly like this
- // spellsystem is delaying everything to next update tick
- //if (!accessory->IsOnVehicle(me))
- //{
- // accessory->UnSummon();
- // return; // Something went wrong in the spellsystem
- //}
-
if (GetBase()->GetTypeId() == TYPEID_UNIT)
sScriptMgr->OnInstallAccessory(this, accessory);
}
@@ -294,6 +306,14 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ
bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
{
+ /// @Prevent adding passengers when vehicle is uninstalling. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.)
+ if (_status == STATUS_UNINSTALLING)
+ {
+ sLog->outError(LOG_FILTER_VEHICLES, "Passenger GuidLow: %u, Entry: %u, attempting to board vehicle GuidLow: %u, Entry: %u during uninstall! SeatId: %i",
+ unit->GetGUIDLow(), unit->GetEntry(), _me->GetGUIDLow(), _me->GetEntry(), (int32)seatId);
+ return false;
+ }
+
if (unit->GetVehicle() != this)
return false;
@@ -352,13 +372,9 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
unit->m_movementInfo.t_seat = seat->first;
unit->m_movementInfo.t_guid = _me->GetGUID();
- if (_me->GetTypeId() == TYPEID_UNIT
- && unit->GetTypeId() == TYPEID_PLAYER
- && seat->first == 0 && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
- {
- if (!_me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE))
- ASSERT(false);
- }
+ if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER &&
+ seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
+ ASSERT(_me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE))
if (_me->IsInWorld())
{
@@ -414,7 +430,7 @@ void Vehicle::RemovePassenger(Unit* unit)
unit->ClearUnitState(UNIT_STATE_ONVEHICLE);
- if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
+ if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
_me->RemoveCharmedBy(unit);
if (_me->IsInWorld())
@@ -424,13 +440,13 @@ void Vehicle::RemovePassenger(Unit* unit)
unit->m_movementInfo.t_seat = 0;
}
- if (_me->GetTypeId() == TYPEID_UNIT && _me->ToCreature()->IsAIEnabled)
- _me->ToCreature()->AI()->PassengerBoarded(unit, seat->first, false);
-
// only for flyable vehicles
if (unit->IsFlying())
_me->CastSpell(unit, VEHICLE_SPELL_PARACHUTE, true);
+ if (_me->GetTypeId() == TYPEID_UNIT && _me->ToCreature()->IsAIEnabled)
+ _me->ToCreature()->AI()->PassengerBoarded(unit, seat->first, false);
+
if (GetBase()->GetTypeId() == TYPEID_UNIT)
sScriptMgr->OnRemovePassenger(this, unit);
}
View
19 src/server/game/Entities/Vehicle/Vehicle.h
@@ -22,6 +22,7 @@
#include "ObjectDefines.h"
#include "Object.h"
#include "VehicleDefines.h"
+#include "Unit.h"
struct VehicleEntry;
@@ -32,9 +33,6 @@ typedef std::set<uint64> GuidSet;
class Vehicle : public TransportBase
{
public:
- explicit Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry);
- virtual ~Vehicle();
-
void Install();
void Uninstall();
void Reset(bool evading = false);
@@ -67,7 +65,20 @@ class Vehicle : public TransportBase
VehicleSeatEntry const* GetSeatForPassenger(Unit* passenger);
+ protected:
+ friend bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry);
+ Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry);
+ friend void Unit::RemoveVehicleKit();
+ ~Vehicle();
+
private:
+ enum Status
+ {
+ STATUS_NONE,
+ STATUS_INSTALLED,
+ STATUS_UNINSTALLING,
+ };
+
SeatMap::iterator GetSeatIteratorForPassenger(Unit* passenger);
void InitMovementInfoForBase();
@@ -82,7 +93,7 @@ class Vehicle : public TransportBase
GuidSet vehiclePlayers;
uint32 _usableSeatNum; // Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags
uint32 _creatureEntry; // Can be different than me->GetBase()->GetEntry() in case of players
-
+ Status _status;
Position m_lastShootPos;
};
#endif
View
2 src/server/game/Globals/ObjectMgr.cpp
@@ -117,7 +117,7 @@ std::string GetScriptCommandName(ScriptCommands command)
default:
{
char sz[32];
- sprintf(sz, "Unknown command: %u", command);
+ sprintf(sz, "Unknown command: %d", command);
res = sz;
break;
}
View
3 src/server/game/Handlers/CharacterHandler.cpp
@@ -67,9 +67,8 @@ bool LoginQueryHolder::Initialize()
bool res = true;
uint32 lowGuid = GUID_LOPART(m_guid);
- PreparedStatement* stmt = NULL;
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_FROM, stmt);
View
2 src/server/game/Loot/LootMgr.cpp
@@ -664,7 +664,7 @@ void Loot::DeleteLootItemFromContainerItemDB(uint32 itemID)
CharacterDatabase.Execute(stmt);
// Mark the item looted to prevent resaving
- for (LootItemList::iterator _itr = items.begin(); _itr != items.end(); _itr++)
+ for (LootItemList::iterator _itr = items.begin(); _itr != items.end(); ++_itr)
{
if (_itr->itemid != itemID)
continue;
View
1 src/server/game/Maps/MapManager.cpp
@@ -179,6 +179,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
else // attempt to downscale
mapDiff = GetDownscaledMapDifficultyData(entry->MapID, targetDifficulty);
}
+ // FIXME: mapDiff is never used
//Bypass checks for GMs
if (player->isGameMaster())
View
4 src/server/game/Movement/Spline/MoveSplineInit.cpp
@@ -195,9 +195,11 @@ namespace Movement
{
if (_transformForTransport)
{
- float unused = 0.0f;
if (TransportBase* transport = _owner.GetDirectTransport())
+ {
+ float unused = 0.0f; // need reference
transport->CalculatePassengerOffset(input.x, input.y, input.z, unused);
+ }
}
return input;
View
2 src/server/game/Scripting/ScriptLoader.cpp
@@ -192,6 +192,7 @@ void AddSC_boss_lorekeeperpolkelt();
void AddSC_boss_rasfrost();
void AddSC_boss_theravenian();
void AddSC_boss_vectus();
+void AddSC_boss_kirtonos_the_herald();
void AddSC_instance_scholomance();
void AddSC_shadowfang_keep(); //Shadowfang keep
void AddSC_instance_shadowfang_keep();
@@ -824,6 +825,7 @@ void AddEasternKingdomsScripts()
AddSC_boss_rasfrost();
AddSC_boss_theravenian();
AddSC_boss_vectus();
+ AddSC_boss_kirtonos_the_herald();
AddSC_instance_scholomance();
AddSC_shadowfang_keep(); //Shadowfang keep
AddSC_instance_shadowfang_keep();
View
5 src/server/game/Scripting/ScriptMgr.cpp
@@ -1241,6 +1241,11 @@ void ScriptMgr::OnPlayerDelete(uint64 guid)
FOREACH_SCRIPT(PlayerScript)->OnDelete(guid);
}
+void ScriptMgr::OnPlayerSave(Player* player)
+{
+ FOREACH_SCRIPT(PlayerScript)->OnSave(player);
+}
+
void ScriptMgr::OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent)
{
FOREACH_SCRIPT(PlayerScript)->OnBindToInstance(player, difficulty, mapid, permanent);
View
4 src/server/game/Scripting/ScriptMgr.h
@@ -745,6 +745,9 @@ class PlayerScript : public UnitScript
// Called when a player is deleted.
virtual void OnDelete(uint64 /*guid*/) { }
+ // Called when a player is about to be saved.
+ virtual void OnSave(Player* /*player*/) { }
+
// Called when a player is bound to an instance
virtual void OnBindToInstance(Player* /*player*/, Difficulty /*difficulty*/, uint32 /*mapId*/, bool /*permanent*/) { }
@@ -1021,6 +1024,7 @@ class ScriptMgr
void OnPlayerLogout(Player* player);
void OnPlayerCreate(Player* player);
void OnPlayerDelete(uint64 guid);
+ void OnPlayerSave(Player* player);
void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent);
void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea);
View
2 src/server/game/Server/WorldSocketMgr.cpp
@@ -60,7 +60,7 @@ class ReactorRunnable : protected ACE_Task_Base
m_Connections(0),
m_ThreadId(-1)
{
- ACE_Reactor_Impl* imp = 0;
+ ACE_Reactor_Impl* imp;
#if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL)
View
2 src/server/game/Warden/WardenWin.cpp
@@ -453,8 +453,8 @@ void WardenWin::HandleData(ByteBuffer &buff)
if (luaStrLen != 0)
{
char *str = new char[luaStrLen + 1];
- memset(str, 0, luaStrLen + 1);
memcpy(str, buff.contents() + buff.rpos(), luaStrLen);
+ str[luaStrLen] = '\0'; // null terminator
sLog->outDebug(LOG_FILTER_WARDEN, "Lua string: %s", str);
delete[] str;
}
View
2 src/server/scripts/Commands/cs_lookup.cpp
@@ -940,7 +940,7 @@ class lookup_commandscript : public CommandScript
found = true;
}
}
-
+
if (!found)
handler->SendSysMessage(LANG_COMMAND_NOSPELLFOUND);
View
1 src/server/scripts/EasternKingdoms/CMakeLists.txt
@@ -31,6 +31,7 @@ set(scripts_STAT_SRCS
EasternKingdoms/Scholomance/instance_scholomance.cpp
EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
+ EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
EasternKingdoms/zone_isle_of_queldanas.cpp
EasternKingdoms/ZulGurub/boss_grilek.cpp
EasternKingdoms/ZulGurub/boss_hazzarah.cpp
View
331 src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
@@ -0,0 +1,331 @@
+/*
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ *
+ * 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 "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "scholomance.h"
+#include "MoveSplineInit.h"
+#include "GameObjectAI.h"
+#include "Player.h"
+
+enum Says
+{
+ EMOTE_SUMMONED = 0
+};
+
+enum Spells
+{
+ SPELL_SWOOP = 18144,
+ SPELL_WING_FLAP = 12882,
+ SPELL_PIERCE_ARMOR = 6016,
+ SPELL_DISARM = 8379,
+
+ SPELL_KIRTONOS_TRANSFORM = 16467,
+
+ SPELL_SHADOW_BOLT = 17228,
+ SPELL_CURSE_OF_TONGUES = 12889,
+ SPELL_DONINATE_MIND = 14515
+};
+
+enum Events
+{
+ INTRO_1 = 1,
+ INTRO_2 = 2,
+ INTRO_3 = 3,
+ INTRO_4 = 4,
+ INTRO_5 = 5,
+ INTRO_6 = 6,
+ EVENT_SWOOP = 7,
+ EVENT_WING_FLAP = 8,
+ EVENT_PIERCE_ARMOR = 9,
+ EVENT_DISARM = 10,
+ EVENT_SHADOW_BOLT = 11,
+ EVENT_CURSE_OF_TONGUES = 12,
+ EVENT_DONINATE_MIND = 13,
+ EVENT_KIRTONOS_TRANSFORM = 14
+};
+
+enum Points
+{
+ MAX_KIRTONOS_WAYPOINTS_INTRO = 14,
+ POINT_KIRTONOS_LAND = 14
+};
+
+enum Misc
+{
+ WEAPON_KIRTONOS_STAFF = 11365
+};
+
+Position const kirtonosIntroWaypoint[MAX_KIRTONOS_WAYPOINTS_INTRO] =
+{
+ {316.7087f, 71.26834f, 104.5843f, 0.0f},
+ {321.1605f, 72.80973f, 104.6676f, 0.0f},
+ {332.3713f, 77.98991f, 105.8621f, 0.0f},
+ {333.3254f, 86.60159f, 106.6399f, 0.0f},
+ {334.1263f, 101.6836f, 106.8343f, 0.0f},
+ {331.0458f, 114.5935f, 106.3621f, 0.0f},
+ {329.5439f, 126.7019f, 106.1399f, 0.0f},
+ {335.2471f, 136.5460f, 105.7232f, 0.0f},
+ {343.2100f, 139.9459f, 107.6399f, 0.0f},
+ {364.3288f, 140.9012f, 109.9454f, 0.0f},
+ {362.6760f, 115.6384f, 110.3065f, 0.0f},
+ {341.7896f, 91.94390f, 107.1676f, 0.0f},
+ {313.4945f, 93.45945f, 104.0565f, 0.0f},
+ {306.3839f, 93.61675f, 104.0565f, 0.0f},
+};
+
+class boss_kirtonos_the_herald : public CreatureScript
+{
+ public: boss_kirtonos_the_herald() : CreatureScript("boss_kirtonos_the_herald") { }
+
+ struct boss_kirtonos_the_heraldAI : public BossAI
+ {
+ boss_kirtonos_the_heraldAI(Creature* creature) : BossAI(creature, TYPE_KIRTONOS) { }
+
+ void Reset()
+ {
+ _introEvent = 0;
+ _introTimer = 0;
+ _Reset();
+ }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ _introTimer = 0;
+ _introEvent = 0;
+ events.ScheduleEvent(EVENT_SWOOP, urand(8000, 8000));
+ events.ScheduleEvent(EVENT_WING_FLAP, urand(15000, 15000));
+ events.ScheduleEvent(EVENT_PIERCE_ARMOR, urand(18000, 18000));
+ events.ScheduleEvent(EVENT_DISARM, urand(22000, 22000));
+ events.ScheduleEvent(EVENT_SHADOW_BOLT, urand(42000, 42000));
+ events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, urand(53000, 53000));
+ events.ScheduleEvent(EVENT_DONINATE_MIND, urand(34000, 48000));
+ events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, urand(20000, 20000));
+ _EnterCombat();
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS)))
+ gate->SetGoState(GO_STATE_ACTIVE);
+ if (GameObject* brazier = me->GetMap()->GetGameObject(instance->GetData64(GO_BRAZIER_OF_THE_HERALD)))
+ {
+ brazier->ResetDoorOrButton();
+ brazier->SetGoState(GO_STATE_READY);
+ }
+ _JustDied();
+ }
+
+ void EnterEvadeMode()
+ {
+ if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS)))
+ gate->SetGoState(GO_STATE_ACTIVE);
+ if (GameObject* brazier = me->GetMap()->GetGameObject(instance->GetData64(GO_BRAZIER_OF_THE_HERALD)))
+ {
+ brazier->ResetDoorOrButton();
+ brazier->SetGoState(GO_STATE_READY);
+ }
+ me->DespawnOrUnsummon(5000);
+ }
+
+ void DamageTaken(Unit* /*killer*/, uint32 &damage)
+ {
+
+ }
+
+ void IsSummonedBy(Unit* summoner)
+ {
+ me->SetDisableGravity(true);
+ me->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
+ _introEvent = INTRO_1;
+ _introTimer = 1;
+ _currentPoint = 0;
+ Talk(EMOTE_SUMMONED);
+ }
+
+ void JustSummoned(Creature* summon)
+ {
+ BossAI::JustSummoned(summon);
+ }
+
+ void MovementInform(uint32 movementType, uint32 pointId)
+ {
+ if (movementType != POINT_MOTION_TYPE)
+ return;
+
+ _currentPoint = pointId + 1;
+ }
+
+ void UpdateAI(uint32 const diff)
+ {
+ if (_introEvent)
+ {
+ if (_introTimer <= diff)
+ {
+ switch (_introEvent)
+ {
+ case INTRO_1:
+ if (_currentPoint < POINT_KIRTONOS_LAND)
+ me->GetMotionMaster()->MovePoint(_currentPoint, kirtonosIntroWaypoint[_currentPoint]);
+ else
+ {
+ _introTimer = 1000;
+ _introEvent = INTRO_2;
+ }
+ break;
+ case INTRO_2:
+ me->SetWalk(true);
+ me->GetMotionMaster()->MovePoint(0, 299.4884f, 92.76137f, 105.6335f);
+ _introTimer = 1000;
+ _introEvent = INTRO_3;
+ break;
+ case INTRO_3:
+ if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS)))
+ gate->SetGoState(GO_STATE_READY);
+ me->SetFacingTo(0.01745329f);
+ _introTimer = 3000;
+ _introEvent = INTRO_4;
+ break;
+ case INTRO_4:
+ if (GameObject* brazier = me->GetMap()->GetGameObject(instance->GetData64(GO_BRAZIER_OF_THE_HERALD)))
+ brazier->SetGoState(GO_STATE_READY);
+ me->SetDisableGravity(false);
+ DoCast(me, SPELL_KIRTONOS_TRANSFORM);
+ _introTimer = 1000;
+ _introEvent = INTRO_5;
+ break;
+ case INTRO_5:
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF));
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
+ me->SetReactState(REACT_AGGRESSIVE);
+ _introTimer = 5000;
+ _introEvent = INTRO_6;
+ case INTRO_6:
+ me->GetMotionMaster()->MovePoint(0, 314.8673f, 90.3021f, 101.6459f);
+ _introTimer = 0;
+ _introEvent = 0;
+ break;
+ }
+ }
+ else
+ _introTimer -= diff;
+ }
+
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_SWOOP:
+ DoCast(me, SPELL_SWOOP);
+ events.ScheduleEvent(EVENT_SWOOP, urand(15000, 15000));
+ break;
+ case EVENT_WING_FLAP:
+ DoCast(me, SPELL_WING_FLAP);
+ events.ScheduleEvent(EVENT_WING_FLAP, urand(13000, 13000));
+ break;
+ case EVENT_PIERCE_ARMOR:
+ DoCastVictim(SPELL_PIERCE_ARMOR, true);
+ events.ScheduleEvent(EVENT_PIERCE_ARMOR, urand(12000, 12000));
+ break;
+ case EVENT_DISARM:
+ DoCastVictim(SPELL_DISARM, true);
+ events.ScheduleEvent(EVENT_DISARM, urand(11000, 11000));
+ break;
+ case EVENT_SHADOW_BOLT:
+ DoCastVictim(SPELL_SHADOW_BOLT, true);
+ events.ScheduleEvent(EVENT_SHADOW_BOLT, urand(42000, 42000));
+ break;
+ case EVENT_CURSE_OF_TONGUES:
+ DoCastVictim(SPELL_CURSE_OF_TONGUES, true);
+ events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, urand(35000, 35000));
+ break;
+ case EVENT_DONINATE_MIND:
+ DoCastVictim(SPELL_DONINATE_MIND, true);
+ events.ScheduleEvent(EVENT_DONINATE_MIND, urand(44000, 48000));
+ break;
+ case EVENT_KIRTONOS_TRANSFORM:
+ if (me->HasAura(SPELL_KIRTONOS_TRANSFORM))
+ {
+ me->RemoveAura(SPELL_KIRTONOS_TRANSFORM);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0));
+ }
+ else
+ {
+ DoCast(me, SPELL_KIRTONOS_TRANSFORM);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF));
+ }
+ events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, urand(16000, 18000));
+ break;
+ default:
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ uint8 _introEvent;
+ uint32 _introTimer;
+ uint32 _currentPoint;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new boss_kirtonos_the_heraldAI(creature);
+ }
+};
+
+/*######
+## go_brazier_of_the_herald
+######*/
+
+enum Brazier_Of_The_Herald
+{
+ NPC_KIRTONOS = 10506,
+ SOUND_SCREECH = 557
+};
+
+class go_brazier_of_the_herald : public GameObjectScript
+{
+public:
+ go_brazier_of_the_herald() : GameObjectScript("go_brazier_of_the_herald") { }
+
+ bool OnGossipHello(Player* player, GameObject* go)
+ {
+ go->UseDoorOrButton();
+ go->PlayDirectSound(SOUND_SCREECH,0);
+ player->SummonCreature(NPC_KIRTONOS, 315.028f, 70.53845f, 102.1496f, 0.3859715f, TEMPSUMMON_DEAD_DESPAWN, 900000);
+ return true;
+ }
+};
+
+void AddSC_boss_kirtonos_the_herald()
+{
+ new boss_kirtonos_the_herald();
+ new go_brazier_of_the_herald;
+}
View
43 src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp
@@ -27,17 +27,6 @@ EndScriptData */
#include "InstanceScript.h"
#include "scholomance.h"
-#define GO_GATE_KIRTONOS 175570
-#define GO_GATE_GANDLING 177374
-#define GO_GATE_MALICIA 177375
-#define GO_GATE_THEOLEN 177377
-#define GO_GATE_POLKELT 177376
-#define GO_GATE_RAVENIAN 177372
-#define GO_GATE_BAROV 177373
-#define GO_GATE_ILLUCIA 177371
-
-#define MAX_ENCOUNTER 2
-
class instance_scholomance : public InstanceMapScript
{
public:
@@ -64,6 +53,7 @@ class instance_scholomance : public InstanceMapScript
uint64 GateRavenianGUID;
uint64 GateBarovGUID;
uint64 GateIlluciaGUID;
+ uint64 BrazierOfTheHeraldGUID;
void Initialize()
{
@@ -77,6 +67,7 @@ class instance_scholomance : public InstanceMapScript
GateRavenianGUID = 0;
GateBarovGUID = 0;
GateIlluciaGUID = 0;
+ BrazierOfTheHeraldGUID = 0;
for (uint8 i = 0; i < 6; ++i)
IsBossDied[i] = false;
@@ -86,14 +77,15 @@ class instance_scholomance : public InstanceMapScript
{
switch (go->GetEntry())
{
- case GO_GATE_KIRTONOS: GateKirtonosGUID = go->GetGUID(); break;
- case GO_GATE_GANDLING: GateGandlingGUID = go->GetGUID(); break;
- case GO_GATE_MALICIA: GateMiliciaGUID = go->GetGUID(); break;
- case GO_GATE_THEOLEN: GateTheolenGUID = go->GetGUID(); break;
- case GO_GATE_POLKELT: GatePolkeltGUID = go->GetGUID(); break;
- case GO_GATE_RAVENIAN: GateRavenianGUID = go->GetGUID(); break;
- case GO_GATE_BAROV: GateBarovGUID = go->GetGUID(); break;
- case GO_GATE_ILLUCIA: GateIlluciaGUID = go->GetGUID(); break;
+ case GO_GATE_KIRTONOS: GateKirtonosGUID = go->GetGUID(); break;
+ case GO_GATE_GANDLING: GateGandlingGUID = go->GetGUID(); break;
+ case GO_GATE_MALICIA: GateMiliciaGUID = go->GetGUID(); break;
+ case GO_GATE_THEOLEN: GateTheolenGUID = go->GetGUID(); break;
+ case GO_GATE_POLKELT: GatePolkeltGUID = go->GetGUID(); break;
+ case GO_GATE_RAVENIAN: GateRavenianGUID = go->GetGUID(); break;
+ case GO_GATE_BAROV: GateBarovGUID = go->GetGUID(); break;
+ case GO_GATE_ILLUCIA: GateIlluciaGUID = go->GetGUID(); break;
+ case GO_BRAZIER_OF_THE_HERALD: BrazierOfTheHeraldGUID = go->GetGUID(); break;
}
}
@@ -135,6 +127,19 @@ class instance_scholomance : public InstanceMapScript
IsBossDied[3] && IsBossDied[4] && IsBossDied[5])
? IN_PROGRESS : 0;
}
+
+ uint64 GetData64(uint32 type) const
+ {
+ switch (type)
+ {
+ case GO_GATE_KIRTONOS:
+ return GateKirtonosGUID;
+ case GO_BRAZIER_OF_THE_HERALD:
+ return BrazierOfTheHeraldGUID;
+ }
+
+ return 0;
+ }
};
};
View
36 src/server/scripts/EasternKingdoms/Scholomance/scholomance.h
@@ -19,13 +19,31 @@
#ifndef DEF_SCHOLOMANCE_H
#define DEF_SCHOLOMANCE_H
-#define TYPE_GANDLING 1
-#define DATA_DOCTORTHEOLENKRASTINOV_DEATH 2
-#define DATA_INSTRUCTORMALICIA_DEATH 3
-#define DATA_LADYILLUCIABAROV_DEATH 4
-#define DATA_LORDALEXEIBAROV_DEATH 5
-#define DATA_LOREKEEPERPOLKELT_DEATH 6
-#define DATA_THERAVENIAN_DEATH 7
-#define TYPE_KIRTONOS 8
-#endif
+uint32 const MAX_ENCOUNTER = 2;
+
+enum DataTypes
+{
+ TYPE_GANDLING = 1,
+ DATA_DOCTORTHEOLENKRASTINOV_DEATH = 2,
+ DATA_INSTRUCTORMALICIA_DEATH = 3,
+ DATA_LADYILLUCIABAROV_DEATH = 4,
+ DATA_LORDALEXEIBAROV_DEATH = 5,
+ DATA_LOREKEEPERPOLKELT_DEATH = 6,
+ DATA_THERAVENIAN_DEATH = 7,
+ TYPE_KIRTONOS = 8
+};
+enum GameobjectIds
+{
+ GO_GATE_KIRTONOS = 175570,
+ GO_GATE_GANDLING = 177374,
+ GO_GATE_MALICIA = 177375,
+ GO_GATE_THEOLEN = 177377,
+ GO_GATE_POLKELT = 177376,
+ GO_GATE_RAVENIAN = 177372,
+ GO_GATE_BAROV = 177373,
+ GO_GATE_ILLUCIA = 177371,
+ GO_BRAZIER_OF_THE_HERALD = 175564
+};
+
+#endif
View
4 src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
@@ -153,13 +153,13 @@ enum Texts
SAY_KILLED_PLAYER_P_THREE = 12,
SAY_SPELL_CASTING_P_THREE = 13,
SAY_DEATH,
-
+
// Alexstrasza
SAY_ONE = 0,
SAY_TWO = 1,
SAY_THREE = 2,
SAY_FOUR = 3,
-
+
// Power Sparks
EMOTE_POWER_SPARK_SUMMONED = 0
};
View
4 src/server/shared/Dynamic/LinkedReference/Reference.h
@@ -20,7 +20,7 @@
#define _REFERENCE_H
#include "Dynamic/LinkedList.h"
-#include <assert.h>
+#include "Errors.h" // for ASSERT
//=====================================================
@@ -45,7 +45,7 @@ template <class TO, class FROM> class Reference : public LinkedListElement
// Create new link
void link(TO* toObj, FROM* fromObj)
{
- assert(fromObj); // fromObj MUST not be NULL
+ ASSERT(fromObj); // fromObj MUST not be NULL
if (isValid())
unlink();
if (toObj != NULL)
View
7 src/server/shared/Utilities/Util.cpp
@@ -20,6 +20,7 @@
#include "Common.h"
#include "utf8.h"
#include "SFMT.h"
+#include "Errors.h" // for ASSERT
#include <ace/TSS_T.h>
#include <ace/INET_Addr.h>
@@ -28,19 +29,19 @@ static SFMTRandTSS sfmtRand;
int32 irand(int32 min, int32 max)
{
- assert(max >= min);
+ ASSERT(max >= min);
return int32(sfmtRand->IRandom(min, max));
}
uint32 urand(uint32 min, uint32 max)
{
- assert(max >= min);
+ ASSERT(max >= min);
return sfmtRand->URandom(min, max);
}
float frand(float min, float max)
{
- assert(max >= min);
+ ASSERT(max >= min);
return float(sfmtRand->Random() * (max - min) + min);
}
View
2 src/server/worldserver/RemoteAccess/RARunnable.cpp
@@ -35,7 +35,7 @@
RARunnable::RARunnable()
{
- ACE_Reactor_Impl* imp = NULL;
+ ACE_Reactor_Impl* imp;
#if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL)
imp = new ACE_Dev_Poll_Reactor();
View
6 src/tools/vmap4_extractor/model.cpp
@@ -79,8 +79,7 @@ bool Model::ConvertToVMAPModel(const char * outfilename)
return false;
}
fwrite(szRawVMAPMagic, 8, 1, output);
- uint32 nVertices = 0;
- nVertices = header.nBoundingVertices;
+ uint32 nVertices = header.nBoundingVertices;
fwrite(&nVertices, sizeof(int), 1, output);
uint32 nofgroups = 1;
fwrite(&nofgroups,sizeof(uint32), 1, output);
@@ -93,8 +92,7 @@ bool Model::ConvertToVMAPModel(const char * outfilename)
wsize = sizeof(branches) + sizeof(uint32) * branches;
fwrite(&wsize, sizeof(int), 1, output);
fwrite(&branches,sizeof(branches), 1, output);
- uint32 nIndexes = 0;
- nIndexes = header.nBoundingTriangles;
+ uint32 nIndexes = header.nBoundingTriangles;
fwrite(&nIndexes,sizeof(uint32), 1, output);
fwrite("INDX",4, 1, output);
wsize = sizeof(uint32) + sizeof(unsigned short) * nIndexes;

0 comments on commit d5163d8

Please sign in to comment.
Something went wrong with that request. Please try again.