fix(Scripts/Karazhan): Chess Event. (#14736)

This commit is contained in:
UltraNix
2023-03-15 04:07:49 +01:00
committed by GitHub
parent 6cf0f57616
commit b21f98d639
11 changed files with 2570 additions and 57 deletions

View File

@@ -0,0 +1,238 @@
--
UPDATE `creature_template` SET `ScriptName` = "npc_chesspiece", `flags_extra`=`flags_extra`|0x01000000 WHERE `entry` IN (17469,17211,21748,21664,21750,21683,21747,21682,21726,21160,21752,21684);
UPDATE `creature_template` SET `ScriptName` = "npc_echo_of_medivh" WHERE `entry`=16816;
UPDATE `creature_template` SET `ScriptName` = "npc_chess_move_trigger", `flags_extra`=130 WHERE `entry`=22519;
DELETE FROM `creature` WHERE `id1`=22519;
DELETE FROM `creature_template_addon` WHERE `entry`=22521;
INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES
(22521,1,'39383');
UPDATE `creature_template` SET `flags_extra` = 130 WHERE `entry` = 22521;
DELETE FROM `creature_template_spell` WHERE `CreatureID` IN (21684,21683,21682,21664,21160,17211,21752,21750,21747,21748,21726,17469);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES
(21684, 0, 37146, 12340), -- King Llane
(21684, 1, 30284, 12340),
(21684, 2, 37471, 12340),
(21684, 3, 37474, 12340),
(21683, 0, 37148, 12340), -- Human Conjurer
(21683, 1, 30284, 12340),
(21683, 2, 37462, 12340),
(21683, 3, 37465, 12340),
(21682, 0, 37146, 12340), -- Human Cleric
(21682, 1, 30284, 12340),
(21682, 2, 37455, 12340),
(21682, 3, 37459, 12340),
(21664, 0, 37144, 12340), -- Human Charger
(21664, 1, 30284, 12340),
(21664, 2, 37453, 12340),
(21664, 3, 37498, 12340),
(21160, 0, 37146, 12340), -- Conjured Water Elemental
(21160, 1, 30284, 12340),
(21160, 2, 37427, 12340),
(21160, 3, 37432, 12340),
(17211, 0, 37146, 12340), -- Human Footman
(17211, 1, 30284, 12340),
(17211, 2, 37406, 12340),
(17211, 3, 37414, 12340),
(21752, 0, 37146, 12340), -- Warchief Blackhand
(21752, 1, 30284, 12340),
(21752, 2, 37472, 12340),
(21752, 3, 37476, 12340),
(21750, 0, 37148, 12340), -- Orc Warlock
(21750, 1, 30284, 12340),
(21750, 2, 37463, 12340),
(21750, 3, 37461, 12340),
(21747, 0, 37146, 12340), -- Orc Necrolyte
(21747, 1, 30284, 12340),
(21747, 2, 37456, 12340),
(21747, 3, 37461, 12340),
(21748, 0, 37144, 12340), -- Orc Wolf
(21748, 1, 30284, 12340),
(21748, 2, 37454, 12340),
(21748, 3, 37502, 12340),
(21726, 0, 37146, 12340), -- Summoned Daemon
(21726, 1, 30284, 12340),
(21726, 2, 37428, 12340),
(21726, 3, 37434, 12340),
(17469, 0, 37146, 12340), -- Orc Grunt
(17469, 1, 30284, 12340),
(17469, 2, 37413, 12340),
(17469, 3, 37416, 12340);
UPDATE `creature_template` SET `RegenHealth`=0, `BaseAttackTime`=3000 WHERE `entry` IN (21726,21748,21747,21750,21752,17469,21160,21664,21682,21684,21683,17211);
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceEntry` IN (37465,37476,30012,37144,37148,37151,37152,37153,37472,37461,37454,37502,37428,37413,37471,37474,37459,37453,37498,37427,37406,39384,37462,37455,37463,37456,37144,37146,37148,30284,37469);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ScriptName`,`Comment`) VALUES
(13,1,37146,0,31,3,22519,0,'',"Move - Target Chess Piece: Karazhan Invisible Stalker"),
(13,1,30012,0,31,3,22519,0,'',"Move - Target Chess Piece: Karazhan Invisible Stalker"),
(13,1,37144,0,31,3,22519,0,'',"Move - Target Chess Piece: Karazhan Invisible Stalker"),
(13,1,37148,0,31,3,22519,0,'',"Move - Target Chess Piece: Karazhan Invisible Stalker"),
(13,1,37151,0,31,3,22519,0,'',"Move - Target Chess Piece: Karazhan Invisible Stalker"),
(13,1,37152,0,31,3,22519,0,'',"Move - Target Chess Piece: Karazhan Invisible Stalker"),
(13,1,37153,0,31,3,22519,0,'',"Move - Target Chess Piece: Karazhan Invisible Stalker"),
(13,3,30284,0,31,3,22519,0,'',"Change Facing - Target Chess Piece: Karazhan Invisible Stalker"),
(13,1,39384,0,31,3,21752,0,'',"Alliance and Horde Chess Spell - Burning Flames - Target Alliance and Horde Pieces"),
(13,1,39384,1,31,3,21750,0,'',"Alliance and Horde Chess Spell - Burning Flames - Target Alliance and Horde Pieces"),
(13,1,39384,2,31,3,21747,0,'',"Alliance and Horde Chess Spell - Burning Flames - Target Alliance and Horde Pieces"),
(13,1,39384,3,31,3,21748,0,'',"Alliance and Horde Chess Spell - Burning Flames - Target Alliance and Horde Pieces"),
(13,1,39384,4,31,3,21726,0,'',"Alliance and Horde Chess Spell - Burning Flames - Target Alliance and Horde Pieces"),
(13,1,39384,5,31,3,17469,0,'',"Alliance and Horde Chess Spell - Burning Flames - Target Alliance and Horde Pieces"),
(13,2,39384,0,31,3,21683,0,'',"Alliance and Horde Chess Spell - Burning Flames - Target Alliance and Horde Pieces"),
(13,2,39384,1,31,3,21684,0,'',"Alliance and Horde Chess Spell - Burning Flames - Target Alliance and Horde Pieces"),
(13,2,39384,2,31,3,21682,0,'',"Alliance and Horde Chess Spell - Burning Flames - Target Alliance and Horde Pieces"),
(13,2,39384,3,31,3,21664,0,'',"Alliance and Horde Chess Spell - Burning Flames - Target Alliance and Horde Pieces"),
(13,2,39384,4,31,3,21160,0,'',"Alliance and Horde Chess Spell - Burning Flames - Target Alliance and Horde Pieces"),
(13,2,39384,5,31,3,17211,0,'',"Alliance and Horde Chess Spell - Burning Flames - Target Alliance and Horde Pieces"),
(13,1,37471,0,31,3,21683,0,'',"Alliance Chess Spell - Heroism - Target Alliance Pieces"),
(13,1,37471,1,31,3,21684,0,'',"Alliance Chess Spell - Heroism - Target Alliance Pieces"),
(13,1,37471,2,31,3,21682,0,'',"Alliance Chess Spell - Heroism - Target Alliance Pieces"),
(13,1,37471,3,31,3,21664,0,'',"Alliance Chess Spell - Heroism - Target Alliance Pieces"),
(13,1,37471,4,31,3,21160,0,'',"Alliance Chess Spell - Heroism - Target Alliance Pieces"),
(13,1,37471,5,31,3,17211,0,'',"Alliance Chess Spell - Heroism - Target Alliance Pieces"),
(13,1,37459,0,31,3,21752,0,'',"Alliance Chess Spell - Holy Lance - Target Horde Pieces"),
(13,1,37459,1,31,3,21750,0,'',"Alliance Chess Spell - Holy Lance - Target Horde Pieces"),
(13,1,37459,2,31,3,21747,0,'',"Alliance Chess Spell - Holy Lance - Target Horde Pieces"),
(13,1,37459,3,31,3,21748,0,'',"Alliance Chess Spell - Holy Lance - Target Horde Pieces"),
(13,1,37459,4,31,3,21726,0,'',"Alliance Chess Spell - Holy Lance - Target Horde Pieces"),
(13,1,37459,5,31,3,17469,0,'',"Alliance Chess Spell - Holy Lance - Target Horde Pieces"),
(13,1,37453,0,31,3,21752,0,'',"Alliance Chess Spell - Smash - Target Horde Pieces"),
(13,1,37453,1,31,3,21750,0,'',"Alliance Chess Spell - Smash - Target Horde Pieces"),
(13,1,37453,2,31,3,21747,0,'',"Alliance Chess Spell - Smash - Target Horde Pieces"),
(13,1,37453,3,31,3,21748,0,'',"Alliance Chess Spell - Smash - Target Horde Pieces"),
(13,1,37453,4,31,3,21726,0,'',"Alliance Chess Spell - Smash - Target Horde Pieces"),
(13,1,37453,5,31,3,17469,0,'',"Alliance Chess Spell - Smash - Target Horde Pieces"),
(13,1,37427,0,31,3,21752,0,'',"Alliance Chess Spell - Geyser - Target Horde Pieces"),
(13,1,37427,1,31,3,21750,0,'',"Alliance Chess Spell - Geyser - Target Horde Pieces"),
(13,1,37427,2,31,3,21747,0,'',"Alliance Chess Spell - Geyser - Target Horde Pieces"),
(13,1,37427,3,31,3,21748,0,'',"Alliance Chess Spell - Geyser - Target Horde Pieces"),
(13,1,37427,4,31,3,21726,0,'',"Alliance Chess Spell - Geyser - Target Horde Pieces"),
(13,1,37427,5,31,3,17469,0,'',"Alliance Chess Spell - Geyser - Target Horde Pieces"),
(13,1,37474,0,31,3,21752,0,'',"Alliance Chess Spell - Sweep - Target Horde Pieces"),
(13,1,37474,1,31,3,21750,0,'',"Alliance Chess Spell - Sweep - Target Horde Pieces"),
(13,1,37474,2,31,3,21747,0,'',"Alliance Chess Spell - Sweep - Target Horde Pieces"),
(13,1,37474,3,31,3,21748,0,'',"Alliance Chess Spell - Sweep - Target Horde Pieces"),
(13,1,37474,4,31,3,21726,0,'',"Alliance Chess Spell - Sweep - Target Horde Pieces"),
(13,1,37474,5,31,3,17469,0,'',"Alliance Chess Spell - Sweep - Target Horde Pieces"),
(13,1,37465,0,31,3,21752,0,'',"Alliance Chess Spell - Rain of Fire - Target Horde Pieces"),
(13,1,37465,1,31,3,21750,0,'',"Alliance Chess Spell - Rain of Fire - Target Horde Pieces"),
(13,1,37465,2,31,3,21747,0,'',"Alliance Chess Spell - Rain of Fire - Target Horde Pieces"),
(13,1,37465,3,31,3,21748,0,'',"Alliance Chess Spell - Rain of Fire - Target Horde Pieces"),
(13,1,37465,4,31,3,21726,0,'',"Alliance Chess Spell - Rain of Fire - Target Horde Pieces"),
(13,1,37465,5,31,3,17469,0,'',"Alliance Chess Spell - Rain of Fire - Target Horde Pieces"),
(13,1,37498,0,31,3,21752,0,'',"Alliance Chess Spell - Stomp - Target Horde Pieces"),
(13,1,37498,1,31,3,21750,0,'',"Alliance Chess Spell - Stomp - Target Horde Pieces"),
(13,1,37498,2,31,3,21747,0,'',"Alliance Chess Spell - Stomp - Target Horde Pieces"),
(13,1,37498,3,31,3,21748,0,'',"Alliance Chess Spell - Stomp - Target Horde Pieces"),
(13,1,37498,4,31,3,21726,0,'',"Alliance Chess Spell - Stomp - Target Horde Pieces"),
(13,1,37498,5,31,3,17469,0,'',"Alliance Chess Spell - Stomp - Target Horde Pieces"),
(13,1,37406,0,31,3,21752,0,'',"Alliance Chess Spell - Heroic Blow - Target Horde Pieces"),
(13,1,37406,1,31,3,21750,0,'',"Alliance Chess Spell - Heroic Blow - Target Horde Pieces"),
(13,1,37406,2,31,3,21747,0,'',"Alliance Chess Spell - Heroic Blow - Target Horde Pieces"),
(13,1,37406,3,31,3,21748,0,'',"Alliance Chess Spell - Heroic Blow - Target Horde Pieces"),
(13,1,37406,4,31,3,21726,0,'',"Alliance Chess Spell - Heroic Blow - Target Horde Pieces"),
(13,1,37406,5,31,3,17469,0,'',"Alliance Chess Spell - Heroic Blow - Target Horde Pieces"),
(13,1,37472,0,31,3,21752,0,'',"Horde Chess Spell - Bloodlust - Target Horde Pieces"),
(13,1,37472,1,31,3,21750,0,'',"Horde Chess Spell - Bloodlust - Target Horde Pieces"),
(13,1,37472,2,31,3,21747,0,'',"Horde Chess Spell - Bloodlust - Target Horde Pieces"),
(13,1,37472,3,31,3,21748,0,'',"Horde Chess Spell - Bloodlust - Target Horde Pieces"),
(13,1,37472,4,31,3,21726,0,'',"Horde Chess Spell - Bloodlust - Target Horde Pieces"),
(13,1,37472,5,31,3,17469,0,'',"Horde Chess Spell - Bloodlust - Target Horde Pieces"),
(13,1,37461,0,31,3,21683,0,'',"Horde Chess Spell - Shadow Spear - Target Alliance Pieces"),
(13,1,37461,1,31,3,21684,0,'',"Horde Chess Spell - Shadow Spear - Target Alliance Pieces"),
(13,1,37461,2,31,3,21682,0,'',"Horde Chess Spell - Shadow Spear - Target Alliance Pieces"),
(13,1,37461,3,31,3,21664,0,'',"Horde Chess Spell - Shadow Spear - Target Alliance Pieces"),
(13,1,37461,4,31,3,21160,0,'',"Horde Chess Spell - Shadow Spear - Target Alliance Pieces"),
(13,1,37461,5,31,3,17211,0,'',"Horde Chess Spell - Shadow Spear - Target Alliance Pieces"),
(13,1,37502,0,31,3,21683,0,'',"Horde Chess Spell - Howl - Target Alliance Pieces"),
(13,1,37502,1,31,3,21684,0,'',"Horde Chess Spell - Howl - Target Alliance Pieces"),
(13,1,37502,2,31,3,21682,0,'',"Horde Chess Spell - Howl - Target Alliance Pieces"),
(13,1,37502,3,31,3,21664,0,'',"Horde Chess Spell - Howl - Target Alliance Pieces"),
(13,1,37502,4,31,3,21160,0,'',"Horde Chess Spell - Howl - Target Alliance Pieces"),
(13,1,37502,5,31,3,17211,0,'',"Horde Chess Spell - Howl - Target Alliance Pieces"),
(13,1,37428,0,31,3,21683,0,'',"Horde Chess Spell - Hellfire - Target Alliance Pieces"),
(13,1,37428,1,31,3,21684,0,'',"Horde Chess Spell - Hellfire - Target Alliance Pieces"),
(13,1,37428,2,31,3,21682,0,'',"Horde Chess Spell - Hellfire - Target Alliance Pieces"),
(13,1,37428,3,31,3,21664,0,'',"Horde Chess Spell - Hellfire - Target Alliance Pieces"),
(13,1,37428,4,31,3,21160,0,'',"Horde Chess Spell - Hellfire - Target Alliance Pieces"),
(13,1,37428,5,31,3,17211,0,'',"Horde Chess Spell - Hellfire - Target Alliance Pieces"),
(13,1,37476,0,31,3,21683,0,'',"Horde Chess Spell - Cleave - Target Alliance Pieces"),
(13,1,37476,1,31,3,21684,0,'',"Horde Chess Spell - Cleave - Target Alliance Pieces"),
(13,1,37476,2,31,3,21682,0,'',"Horde Chess Spell - Cleave - Target Alliance Pieces"),
(13,1,37476,3,31,3,21664,0,'',"Horde Chess Spell - Cleave - Target Alliance Pieces"),
(13,1,37476,4,31,3,21160,0,'',"Horde Chess Spell - Cleave - Target Alliance Pieces"),
(13,1,37476,5,31,3,17211,0,'',"Horde Chess Spell - Cleave - Target Alliance Pieces"),
(13,1,37469,0,31,3,21683,0,'',"Horde Chess Spell - Poison Cloud - Target Alliance Pieces"),
(13,1,37469,1,31,3,21684,0,'',"Horde Chess Spell - Poison Cloud - Target Alliance Pieces"),
(13,1,37469,2,31,3,21682,0,'',"Horde Chess Spell - Poison Cloud - Target Alliance Pieces"),
(13,1,37469,3,31,3,21664,0,'',"Horde Chess Spell - Poison Cloud - Target Alliance Pieces"),
(13,1,37469,4,31,3,21160,0,'',"Horde Chess Spell - Poison Cloud - Target Alliance Pieces"),
(13,1,37469,5,31,3,17211,0,'',"Horde Chess Spell - Poison Cloud - Target Alliance Pieces"),
(13,1,37454,0,31,3,21683,0,'',"Horde Chess Spell - Bite - Target Alliance Pieces"),
(13,1,37454,1,31,3,21684,0,'',"Horde Chess Spell - Bite - Target Alliance Pieces"),
(13,1,37454,2,31,3,21682,0,'',"Horde Chess Spell - Bite - Target Alliance Pieces"),
(13,1,37454,3,31,3,21664,0,'',"Horde Chess Spell - Bite - Target Alliance Pieces"),
(13,1,37454,4,31,3,21160,0,'',"Horde Chess Spell - Bite - Target Alliance Pieces"),
(13,1,37454,5,31,3,17211,0,'',"Horde Chess Spell - Bite - Target Alliance Pieces"),
(13,1,37413,0,31,3,21683,0,'',"Horde Chess Spell - Vicious Strike - Target Alliance Pieces"),
(13,1,37413,1,31,3,21684,0,'',"Horde Chess Spell - Vicious Strike - Target Alliance Pieces"),
(13,1,37413,2,31,3,21682,0,'',"Horde Chess Spell - Vicious Strike - Target Alliance Pieces"),
(13,1,37413,3,31,3,21664,0,'',"Horde Chess Spell - Vicious Strike - Target Alliance Pieces"),
(13,1,37413,4,31,3,21160,0,'',"Horde Chess Spell - Vicious Strike - Target Alliance Pieces"),
(13,1,37413,5,31,3,17211,0,'',"Horde Chess Spell - Vicious Strike - Target Alliance Pieces");
DELETE FROM `creature_text` WHERE `CreatureID`=16816;
INSERT INTO `creature_text` VALUES
(16816,0,0,'Very well. Let the game begin.',14,0,100,0,0,10338,0,0,'Echo of Medivh - EventBegin'),
(16816,1,0,'Perhaps a change is in order.',14,0,100,0,0,10357,0,0,'Echo of Medivh - Cheat 1'),
(16816,1,1,'Time for an alternative scenario.',14,0,100,0,0,10358,0,0,'Echo of Medivh - Cheat 2'),
(16816,1,2,'One must not become too complacent.',14,0,100,0,0,10359,0,0,'Echo of Medivh - Cheat 3'),
(16816,2,0,'%s cheats',16,0,100,0,0,0,21910,0,'Echo of Medivh - CheatEmote'),
(16816,3,0,'Let us see.',14,0,100,0,0,10340,0,0,'Echo of Medivh - Player Loose Pawn 1'),
(16816,3,1,'A transparent stratagem.',14,0,100,0,0,10339,0,0,'Echo of Medivh - Player Loose Pawn 2'),
(16816,3,2,'Ah, the wheels have begun to turn.',14,0,100,0,0,10341,0,0,'Echo of Medivh - Player Loose Pawn 3'),
(16816,4,0,'Foolish! Very foolish!',14,0,100,0,0,10345,0,0,'Echo of Medivh - Player Loose Rook'),
(16816,5,0,'Yes... all according to plan.',14,0,100,0,0,10349,0,0,'Echo of Medivh - Player Loose Knight'),
(16816,6,0,'The slightest loss of concentration is all it takes.',14,0,100,0,0,10347,0,0,'Echo of Medivh - Player Loose Bishop'),
(16816,7,0,'Now it gets interesting.',14,0,100,0,0,10351,0,0,'Echo of Medivh - Player Loose Queen'),
(16816,8,0,'As it should be.',14,0,100,0,0,10354,0,0,'Echo of Medivh - Player Loose King'),
(16816,9,0,'Hmm.',14,0,100,0,0,10342,0,0,'Echo of Medivh - Medivh Loose Pawn 1'),
(16816,9,1,'No matter.',14,0,100,0,0,10344,0,0,'Echo of Medivh - Medivh Loose Pawn 2'),
(16816,9,2,'Interesting.',14,0,100,0,0,10343,0,0,'Echo of Medivh - Medivh Loose Pawn 3'),
(16816,10,0,'A minor concern.',14,0,100,0,0,10346,0,0,'Echo of Medivh - Medivh Loose Rook'),
(16816,11,0,'Yes...of course.',14,0,100,0,0,10350,0,0,'Echo of Medivh - Medivh Loose Knight'),
(16816,12,0,'A necessary sacrifice.',14,0,100,0,0,10348,0,0,'Echo of Medivh - Medivh Loose Bishop'),
(16816,13,0,'Ahh, I should have known.',14,0,100,0,0,10352,0,0,'Echo of Medivh - Medivh Loose Queen'),
(16816,14,0,'And so, the end draws near',14,0,100,0,0,10353,0,0,'Echo of Medivh - Medivh Loose King'),
(16816,15,0,'Nothing less than perfection will do.',14,0,100,0,0,10356,0,0,'Echo of Medivh - Checkmate 1'),
(16816,15,1,'And so it ends.',14,0,100,0,0,10355,0,0,'Echo of Medivh - Checkmate 2'),
(16816,16,0,'The halls of Karazhan shake, as the curse binding the doors of the Gamesman\'s Hall is lifted.',16,0,100,0,0,0,20430,0,'Echo of Medivh - Event Ended');
DELETE FROM `gossip_menu_option` WHERE `menuid` IN (8404,7413,8354,8345,8346,8347,8348,8349,8355,8362,8366,8367,8368);
UPDATE `creature_template` SET `npcflag`=0 WHERE `entry` IN (17469,17211,21748,21664,21750,21683,21747,21682,21726,21160,21752,21684);
UPDATE `creature_template` SET `flags_extra`=130 WHERE `entry` IN (17208,17305,17317,17316);
DELETE FROM `spell_script_names` WHERE `spell_id`=30019;
INSERT INTO `spell_script_names` VALUES
(30019,'spell_control_piece');

View File

@@ -9183,32 +9183,47 @@ Pet* Player::CreatePet(uint32 creatureEntry, uint32 spellID /*= 0*/)
return pet;
}
void Player::StopCastingCharm()
void Player::StopCastingCharm(Aura* except /*= nullptr*/)
{
Unit* charm = GetCharm();
if (!charm)
{
return;
}
if (charm->GetTypeId() == TYPEID_UNIT)
{
if (charm->ToCreature()->HasUnitTypeMask(UNIT_MASK_PUPPET))
{
((Puppet*)charm)->UnSummon();
}
else if (charm->IsVehicle())
{
ExitVehicle();
}
}
if (GetCharmGUID())
charm->RemoveCharmAuras();
{
charm->RemoveAurasByType(SPELL_AURA_MOD_CHARM, ObjectGuid::Empty, except);
charm->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET, ObjectGuid::Empty, except);
charm->RemoveAurasByType(SPELL_AURA_MOD_POSSESS, ObjectGuid::Empty, except);
charm->RemoveAurasByType(SPELL_AURA_AOE_CHARM, ObjectGuid::Empty, except);
}
if (GetCharmGUID())
{
LOG_FATAL("entities.player", "Player {} ({} is not able to uncharm unit ({})", GetName(), GetGUID().ToString(), GetCharmGUID().ToString());
if (charm->GetCharmerGUID())
{
LOG_FATAL("entities.player", "Charmed unit has charmer {}", charm->GetCharmerGUID().ToString());
ABORT();
}
else
{
SetCharm(charm, false);
}
}
}
@@ -13031,15 +13046,15 @@ bool ItemPosCount::isContainedIn(ItemPosCountVec const& vec) const
return false;
}
void Player::StopCastingBindSight()
void Player::StopCastingBindSight(Aura* except /*= nullptr*/)
{
if (WorldObject* target = GetViewpoint())
{
if (target->isType(TYPEMASK_UNIT))
{
((Unit*)target)->RemoveAurasByType(SPELL_AURA_BIND_SIGHT, GetGUID());
((Unit*)target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS, GetGUID());
((Unit*)target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET, GetGUID());
((Unit*)target)->RemoveAurasByType(SPELL_AURA_BIND_SIGHT, GetGUID(), except);
((Unit*)target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS, GetGUID(), except);
((Unit*)target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET, GetGUID(), except);
}
}
}

View File

@@ -2298,8 +2298,8 @@ public:
void SetSeer(WorldObject* target) { m_seer = target; }
void SetViewpoint(WorldObject* target, bool apply);
[[nodiscard]] WorldObject* GetViewpoint() const;
void StopCastingCharm();
void StopCastingBindSight();
void StopCastingCharm(Aura* except = nullptr);
void StopCastingBindSight(Aura* except = nullptr);
[[nodiscard]] uint32 GetSaveTimer() const { return m_nextSave; }
void SetSaveTimer(uint32 timer) { m_nextSave = timer; }

View File

@@ -18575,15 +18575,15 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
// Charmer stop charming
if (playerCharmer)
{
playerCharmer->StopCastingCharm();
playerCharmer->StopCastingBindSight();
playerCharmer->StopCastingCharm(aurApp ? aurApp->GetBase() : nullptr);
playerCharmer->StopCastingBindSight(aurApp ? aurApp->GetBase() : nullptr);
}
// Charmed stop charming
if (GetTypeId() == TYPEID_PLAYER)
{
ToPlayer()->StopCastingCharm();
ToPlayer()->StopCastingBindSight();
ToPlayer()->StopCastingCharm(aurApp ? aurApp->GetBase() : nullptr);
ToPlayer()->StopCastingBindSight(aurApp ? aurApp->GetBase() : nullptr);
}
// StopCastingCharm may remove a possessed pet?
@@ -18695,8 +18695,11 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(GameTime::GetGameTime().count())); // cast can't be helped
}
}
GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, GetFollowAngle());
playerCharmer->CharmSpellInitialize();
if (playerCharmer->m_seer != this)
{
GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, GetFollowAngle());
playerCharmer->CharmSpellInitialize();
}
break;
default:
break;

View File

@@ -2461,6 +2461,8 @@ public:
std::string GetDebugInfo() const override;
[[nodiscard]] uint32 GetOldFactionId() const { return _oldFactionId; }
protected:
explicit Unit (bool isWorldObject);

View File

@@ -289,10 +289,6 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
if (unit->GetNpcFlags() == UNIT_NPC_FLAG_NONE)
return;
// xinef: do not allow to open gossip when npc is in combat
if (unit->GetNpcFlags() == UNIT_NPC_FLAG_GOSSIP && unit->IsInCombat()) // should work on all flags?
return;
// set faction visible if needed
if (FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->GetFaction()))
_player->GetReputationMgr().SetVisible(factionTemplateEntry);

View File

@@ -4470,7 +4470,13 @@ void SpellMgr::LoadSpellInfoCorrections()
{
spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
});
// Game In Session
ApplySpellFix({ 39331 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA;
spellInfo->Attributes |= SPELL_ATTR0_NO_AURA_CANCEL;
spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
});
// Death Ray Warning Visual, Death Ray Damage Visual
ApplySpellFix({ 63882, 63886 }, [](SpellInfo* spellInfo)
{

File diff suppressed because it is too large Load Diff

View File

@@ -60,6 +60,10 @@ public:
OperaEvent = urand(EVENT_OZ, EVENT_RAJ);
OzDeathCount = 0;
OptionalBossCount = 0;
_chessTeam = TEAM_NEUTRAL;
_chessGamePhase = CHESS_PHASE_NOT_STARTED;
_chessEvent = NOT_STARTED;
}
void OnCreatureCreate(Creature* creature) override
@@ -88,6 +92,27 @@ public:
creature->Respawn(true);
}
break;
case NPC_PAWN_H:
case NPC_KNIGHT_H:
case NPC_QUEEN_H:
case NPC_BISHOP_H:
case NPC_ROOK_H:
case NPC_KING_H:
case NPC_PAWN_A:
case NPC_KNIGHT_A:
case NPC_QUEEN_A:
case NPC_BISHOP_A:
case NPC_ROOK_A:
case NPC_KING_A:
_chessPiecesGUID.insert(creature->GetGUID());
creature->SetHealth(creature->GetMaxHealth());
break;
case NPC_CHESS_EVENT_MEDIVH_CHEAT_FIRES:
_medivhCheatFiresGUID.insert(creature->GetGUID());
break;
case NPC_ECHO_OF_MEDIVH:
_echoOfMedivhGUID = creature->GetGUID();
break;
default:
break;
}
@@ -160,6 +185,82 @@ public:
break;
}
case DATA_CHESS_EVENT:
{
_chessEvent = data;
switch (data)
{
case IN_PROGRESS:
case SPECIAL:
{
DoCastSpellOnPlayers(SPELL_GAME_IN_SESSION);
for (ObjectGuid const& chessPieceGUID : _chessPiecesGUID)
{
if (Creature* piece = instance->GetCreature(chessPieceGUID))
{
if (_chessTeam == TEAM_ALLIANCE)
{
if (piece->GetFaction() == CHESS_FACTION_ALLIANCE)
{
piece->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
}
else if (_chessTeam == TEAM_HORDE)
{
if (piece->GetFaction() == CHESS_FACTION_HORDE)
{
piece->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
}
else
{
piece->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
}
}
break;
}
default:
DoRemoveAurasDueToSpellOnPlayers(SPELL_GAME_IN_SESSION);
break;
}
break;
}
case CHESS_EVENT_TEAM:
_chessTeam = data;
break;
case DATA_CHESS_REINIT_PIECES:
for (ObjectGuid const& chessPieceGUID : _chessPiecesGUID)
{
if (Creature* piece = instance->GetCreature(chessPieceGUID))
{
piece->RemoveAllAuras();
piece->setDeathState(JUST_RESPAWNED);
piece->SetHealth(piece->GetMaxHealth());
float x, y, z, o;
piece->GetHomePosition(x, y, z, o);
piece->NearTeleportTo(x, y, z, o);
piece->AI()->DoAction(ACTION_CHESS_PIECE_RESET_ORIENTATION);
piece->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
piece->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
piece->AI()->Reset();
}
}
for (ObjectGuid const& medivhCheatFireGUID : _medivhCheatFiresGUID)
{
if (Creature* fire = instance->GetCreature(medivhCheatFireGUID))
{
fire->DespawnOrUnsummon();
}
}
_medivhCheatFiresGUID.clear();
break;
case DATA_CHESS_GAME_PHASE:
_chessGamePhase = data;
break;
default:
break;
}
@@ -189,10 +290,6 @@ public:
DoRespawnCreature(_barnesGUID, true);
}
break;
case DATA_CHESS:
if (state == DONE)
DoRespawnGameObject(DustCoveredChest, DAY);
break;
default:
break;
}
@@ -291,6 +388,12 @@ public:
return OperaEvent;
case DATA_OPERA_OZ_DEATHCOUNT:
return OzDeathCount;
case CHESS_EVENT_TEAM:
return _chessTeam;
case DATA_CHESS_GAME_PHASE:
return _chessGamePhase;
case DATA_CHESS_EVENT:
return _chessEvent;
}
return 0;
@@ -332,6 +435,10 @@ public:
return ImageGUID;
case DATA_NIGHTBANE:
return m_uiNightBaneGUID;
case DATA_ECHO_OF_MEDIVH:
return _echoOfMedivhGUID;
case DATA_DUST_COVERED_CHEST:
return DustCoveredChest;
}
return ObjectGuid::Empty;
@@ -341,8 +448,10 @@ public:
uint32 OperaEvent;
uint32 OzDeathCount;
uint32 OptionalBossCount;
//uint32 m_auiEncounter[MAX_ENCOUNTERS];
//uint32 m_uiTeam;
uint32 _chessTeam;
uint32 _chessGamePhase;
uint32 _chessEvent;
ObjectGuid m_uiCurtainGUID;
ObjectGuid m_uiStageDoorLeftGUID;
ObjectGuid m_uiStageDoorRightGUID;
@@ -350,20 +459,22 @@ public:
ObjectGuid m_uiTerestianGUID;
ObjectGuid m_uiMoroesGUID;
ObjectGuid m_uiNightBaneGUID;
//ObjectGuid EchoOfMedivhGUID;
ObjectGuid m_uiLibraryDoor; // Door at Shade of Aran
ObjectGuid m_uiMassiveDoor; // Door at Netherspite
ObjectGuid m_uiSideEntranceDoor; // Side Entrance
ObjectGuid m_uiGamesmansDoor; // Door before Chess
ObjectGuid m_uiGamesmansExitDoor; // Door after Chess
ObjectGuid m_uiNetherspaceDoor; // Door at Malchezaar
//ObjectGuid m_uiServantsAccessDoor; // Door to Brocken Stair
ObjectGuid MastersTerraceDoor[2];
ObjectGuid ImageGUID;
ObjectGuid DustCoveredChest;
ObjectGuid m_uiRelayGUID;
ObjectGuid _barnesGUID;
ObjectGuid _echoOfMedivhGUID;
GuidVector _operaDecorations[EVENT_RAJ];
GuidSet _chessPiecesGUID;
GuidSet _medivhCheatFiresGUID;
};
};

View File

@@ -36,7 +36,7 @@ enum KZDataTypes
DATA_ARAN = 6,
DATA_TERESTIAN = 7,
DATA_NETHERSPITE = 8,
DATA_CHESS = 9,
DATA_CHESS_EVENT = 9,
DATA_MALCHEZZAR = 10,
DATA_NIGHTBANE = 11,
DATA_SERVANT_QUARTERS = 12,
@@ -60,40 +60,63 @@ enum KZDataTypes
DATA_GO_SIDE_ENTRANCE_DOOR = 29,
DATA_PRINCE = 30,
DATA_SPAWN_OPERA_DECORATIONS = 31,
DATA_MIDNIGHT = 32
DATA_MIDNIGHT = 32,
// Chess Event
CHESS_EVENT_TEAM = 33,
DATA_CHESS_REINIT_PIECES = 34,
DATA_CHESS_GAME_PHASE = 35,
DATA_ECHO_OF_MEDIVH = 36,
DATA_DUST_COVERED_CHEST = 37
};
enum KZOperaEvents
{
EVENT_OZ = 1,
EVENT_HOOD = 2,
EVENT_RAJ = 3
EVENT_OZ = 1,
EVENT_HOOD = 2,
EVENT_RAJ = 3
};
enum KZMiscCreatures
enum KZCreatures
{
NPC_HYAKISS_THE_LURKER = 16179,
NPC_ROKAD_THE_RAVAGER = 16181,
NPC_SHADIKITH_THE_GLIDER = 16180,
NPC_TERESTIAN_ILLHOOF = 15688,
NPC_MOROES = 15687,
NPC_ATTUMEN_THE_HUNTSMAN = 15550,
NPC_ATTUMEN_THE_HUNTSMAN_MOUNTED = 16152,
NPC_MIDNIGHT = 16151,
NPC_NIGHTBANE = 17225,
NPC_HYAKISS_THE_LURKER = 16179,
NPC_ROKAD_THE_RAVAGER = 16181,
NPC_SHADIKITH_THE_GLIDER = 16180,
NPC_TERESTIAN_ILLHOOF = 15688,
NPC_MOROES = 15687,
NPC_ATTUMEN_THE_HUNTSMAN = 15550,
NPC_ATTUMEN_THE_HUNTSMAN_MOUNTED = 16152,
NPC_MIDNIGHT = 16151,
NPC_NIGHTBANE = 17225,
// Trash
NPC_COLDMIST_WIDOW = 16171,
NPC_COLDMIST_STALKER = 16170,
NPC_SHADOWBAT = 16173,
NPC_VAMPIRIC_SHADOWBAT = 16175,
NPC_GREATER_SHADOWBAT = 16174,
NPC_PHASE_HOUND = 16178,
NPC_DREADBEAST = 16177,
NPC_SHADOWBEAST = 16176,
NPC_KILREK = 17229,
NPC_RELAY = 17645,
NPC_BARNES = 16812
NPC_COLDMIST_WIDOW = 16171,
NPC_COLDMIST_STALKER = 16170,
NPC_SHADOWBAT = 16173,
NPC_VAMPIRIC_SHADOWBAT = 16175,
NPC_GREATER_SHADOWBAT = 16174,
NPC_PHASE_HOUND = 16178,
NPC_DREADBEAST = 16177,
NPC_SHADOWBEAST = 16176,
NPC_KILREK = 17229,
NPC_RELAY = 17645,
NPC_BARNES = 16812,
// Chess Event
NPC_ECHO_OF_MEDIVH = 16816,
NPC_PAWN_H = 17469,
NPC_PAWN_A = 17211,
NPC_KNIGHT_H = 21748,
NPC_KNIGHT_A = 21664,
NPC_QUEEN_H = 21750,
NPC_QUEEN_A = 21683,
NPC_BISHOP_H = 21747,
NPC_BISHOP_A = 21682,
NPC_ROOK_H = 21726,
NPC_ROOK_A = 21160,
NPC_KING_H = 21752,
NPC_KING_A = 21684,
NPC_CHESS_EVENT_MEDIVH_CHEAT_FIRES = 22521
};
enum KZGameObjectIds
@@ -124,14 +147,39 @@ enum KZGameObjectIds
enum KZMisc
{
OPTIONAL_BOSS_REQUIRED_DEATH_COUNT = 50
OPTIONAL_BOSS_REQUIRED_DEATH_COUNT = 50,
ACTION_CHESS_PIECE_RESET_ORIENTATION = 1
};
enum KarazhanSpells
{
SPELL_RATTLED = 32437,
SPELL_OVERLOAD = 29766,
SPELL_BLINK = 29884
SPELL_RATTLED = 32437,
SPELL_OVERLOAD = 29766,
SPELL_BLINK = 29884,
// Chess Event
SPELL_GAME_IN_SESSION = 39331,
SPELL_HAND_OF_MEDIVH = 39339, // 1st cheat: AOE spell burn cell under enemy chesspieces.
SPELL_FURY_OF_MEDIVH = 39383 // 2nd cheat: Berserk own chesspieces.
};
enum KarazhanChessGamePhase
{
CHESS_PHASE_NOT_STARTED = 0,
CHESS_PHASE_PVE_WARMUP = 1, // Medivh has been spoken too but king isn't controlled yet
CHESS_PHASE_INPROGRESS_PVE = 2,
CHESS_PHASE_FAILED = 3,
CHESS_PHASE_PVE_FINISHED = 4,
CHESS_PHASE_PVP_WARMUP = 5,
CHESS_PHASE_INPROGRESS_PVP = 6 // Get back to PVE_FINISHED after that
};
enum KarazhanChessGameFactions
{
CHESS_FACTION_HORDE = 1689,
CHESS_FACTION_ALLIANCE = 1690,
CHESS_FACTION_BOTH = 536
};
template <class AI, class T>

View File

@@ -68,6 +68,7 @@ void AddSC_instance_karazhan(); //Karazhan
void AddSC_boss_servant_quarters();
void AddSC_boss_attumen();
void AddSC_boss_curator();
void AddSC_boss_chess_event();
void AddSC_boss_maiden_of_virtue();
void AddSC_boss_shade_of_aran();
void AddSC_boss_malchezaar();
@@ -220,6 +221,7 @@ void AddEasternKingdomsScripts()
AddSC_boss_servant_quarters();
AddSC_boss_attumen();
AddSC_boss_curator();
AddSC_boss_chess_event();
AddSC_boss_maiden_of_virtue();
AddSC_boss_shade_of_aran();
AddSC_boss_malchezaar();