Move hardcoded aiscripts to database for map 534

Related to #1113
This commit is contained in:
Zyres
2023-07-09 11:48:57 +02:00
parent a671a0eb9d
commit af2017742e
4 changed files with 55 additions and 158 deletions

View File

@@ -0,0 +1,53 @@
-- Mount Hyjal (534)
REPLACE INTO `npc_script_text` VALUES (10768, 'Hit he, no time for a slow death', 17808, 11, 14, 0, 100, 0, 0, 11039, 0);
REPLACE INTO `npc_script_text` VALUES (10769, 'hahahahaa aahaah', 17888, 6, 14, 0, 100, 0, 0, 11018, 0);
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17767', '4', '0', '5', '1', '0', '8', '31249', '0', '0', '6', '10000', '10000', '0', '100', '0', '0', 'Rage Winterchill - Icebolt');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17767', '4', '0', '5', '1', '0', '3', '31258', '0', '0', '6', '30000', '30000', '0', '100', '0', '0', 'Rage Winterchill - Death & Decay');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17767', '4', '0', '5', '1', '0', '5', '31250', '0', '0', '6', '15000', '15000', '0', '100', '0', '0', 'Rage Winterchill - Frost Nova');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17767', '4', '0', '5', '1', '0', '5', '31256', '0', '0', '0', '10000', '10000', '0', '100', '0', '0', 'Rage Winterchill - Frost Armor');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17808', '4', '0', '5', '1', '0', '8', '38196', '0', '0', '0', '8000', '8000', '0', '100', '0', '0', 'Anetheron - Vampiric Aura');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17808', '4', '0', '5', '1', '0', '6', '31299', '0', '0', '7', '30000', '30000', '0', '100', '10768', '0', 'Anetheron - Inferno');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17808', '4', '0', '5', '1', '0', '5', '31298', '0', '0', '6', '7000', '7000', '0', '100', '0', '0', 'Anetheron - Sleep');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17808', '4', '0', '5', '1', '0', '5', '26662', '0', '0', '0', '600000', '600000', '0', '100', '0', '0', 'Anetheron - Berserk');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17842', '4', '0', '5', '1', '0', '8', '31345', '0', '0', '2', '10000', '10000', '0', '100', '0', '0', 'Azgalor - Cleave');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17842', '4', '0', '5', '1', '0', '7', '31340', '0', '0', '7', '15000', '15000', '0', '100', '0', '0', 'Azgalor - Rain of Fire');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17842', '4', '0', '5', '1', '0', '5', '31344', '0', '0', '1', '15000', '15000', '0', '100', '0', '0', 'Azgalor - Howl of Azgalor');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17842', '4', '0', '5', '1', '0', '15', '31347', '0', '0', '6', '45000', '45000', '0', '100', '0', '0', 'Azgalor - Doom');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17888', '4', '0', '5', '1', '0', '8', '31345', '0', '0', '2', '10000', '10000', '0', '100', '0', '0', 'Kazrogal - Cleave');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17888', '4', '0', '5', '1', '0', '6', '31480', '0', '0', '1', '15000', '15000', '0', '100', '0', '0', 'Kazrogal - War Stomp');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17888', '4', '0', '5', '1', '0', '4', '31447', '0', '0', '1', '25000', '25000', '0', '100', '0', '0', 'Kazrogal - Mark of Kazrogal');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17888', '4', '0', '5', '1', '0', '4', '31463', '0', '0', '1', '25000', '25000', '0', '100', '0', '0', 'Kazrogal - Mark of Kazrogal');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17968', '4', '0', '5', '1', '0', '5', '32014', '0', '0', '2', '25000', '25000', '0', '100', '0', '0', 'Archimonde - Air Burst');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17968', '4', '0', '5', '1', '0', '5', '31972', '0', '0', '6', '25000', '25000', '0', '100', '0', '0', 'Archimonde - Grip of the Legion');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17968', '4', '0', '5', '1', '0', '7', '31903', '0', '0', '1', '25000', '25000', '0', '100', '0', '0', 'Archimonde - Doomfire Strike');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17968', '4', '0', '5', '1', '0', '2', '33547', '0', '0', '1', '40000', '40000', '0', '100', '0', '0', 'Archimonde - Fear');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17968', '4', '0', '2', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1591', '0', 'Archimonde - Say Your resistance is insignificant');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17968', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1597', '0', 'Archimonde - Say Your soul will languish for eternity');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17968', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1596', '0', 'Archimonde - Say All creation will be devoured');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17968', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1598', '0', 'Archimonde - Say I am the coming of the end');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17968', '4', '0', '3', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1600', '0', 'Archimonde - Say No, it cannot be! Nooo');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17767', '4', '0', '1', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1590', '0', 'Rage Winterchill - Say The Legions final conquest');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17767', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1586', '0', 'Rage Winterchill - Say Crumble');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17767', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1587', '0', 'Rage Winterchill - Say Ashes to ashes');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17767', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1584', '0', 'Rage Winterchill - Say All life must perish');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17767', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1585', '0', 'Rage Winterchill - Say Victory to the Legion');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17767', '4', '0', '3', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1583', '0', 'Rage Winterchill - Say You have won this battle');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17842', '4', '0', '1', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1576', '0', 'Azgalor - Say Abandon all hope');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17842', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1571', '0', 'Azgalor - Say Reesh');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17842', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1573', '0', 'Azgalor - Say No one is going');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17842', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1572', '0', 'Azgalor - Say Dont fight it');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17842', '4', '0', '3', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1570', '0', 'Azgalor - Say Your time is almost');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17808', '4', '0', '1', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1569', '0', 'Anetheron - Say You are defenders');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17808', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1560', '0', 'Anetheron - Say Your hopes');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17808', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1561', '0', 'Anetheron - Say Scream for me');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17808', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1565', '0', 'Anetheron - Say You look tired');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17808', '4', '0', '3', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1559', '0', 'Anetheron - Say The clock');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17888', '4', '0', '1', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1582', '0', 'Kazrogal - Say Cry for mercy');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17888', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1580', '0', 'Kazrogal - Say Your death will');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17888', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1581', '0', 'Kazrogal - Say You are marked');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17888', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1578', '0', 'Kazrogal - Say You are nothing');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17888', '4', '0', '4', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '1579', '0', 'Kazrogal - Say Miserable nuisance');
INSERT INTO `creature_ai_scripts` VALUES ('8606', '12340', '17888', '4', '0', '3', '2', '0', '100', '0', '0', '0', '0', '0', '0', '0', '100', '10769', '0', 'Kazrogal - Say hahahaha aahaah');
INSERT INTO `world_db_version` VALUES ('131', '20230709-02_hardcoded_ai_scripts');

View File

@@ -139,127 +139,6 @@ public:
}
};
class RageWinterchillAI : public CreatureAIScript
{
public:
static CreatureAIScript* Create(Creature* c) { return new RageWinterchillAI(c); }
explicit RageWinterchillAI(Creature* pCreature) : CreatureAIScript(pCreature)
{
auto frostbold = addAISpell(FROSTBOLT, 8.0f, TARGET_RANDOM_SINGLE, 0, 10, false, true);
frostbold->setAttackStopTimer(1000);
frostbold->setMinMaxDistance(0.0f, 80.0f);
auto deathAndDecay = addAISpell(DEATCH_AND_DECAY, 3.0f, TARGET_RANDOM_SINGLE, 0, 30);
deathAndDecay->setAttackStopTimer(1000);
deathAndDecay->setMinMaxDistance(0.0f, 30.0f);
auto frostNova = addAISpell(FROST_NOVA, 5.0f, TARGET_RANDOM_SINGLE, 0, 15, false, true);
frostNova->setAttackStopTimer(1000);
frostNova->setMinMaxDistance(0.0f, 45.0f);
auto frostArmor = addAISpell(FROST_ARMOR, 5.0f, TARGET_SELF, 0, 10, false, true);
frostArmor->setAttackStopTimer(1000);
frostArmor->setMinMaxDistance(0.0f, 45.0f);
addEmoteForEvent(Event_OnCombatStart, 1590); // The Legion's final conquest has begun! Once again the subjugation of this world is within our grasp. Let
addEmoteForEvent(Event_OnTargetDied, 1586); // Crumble and rot!
addEmoteForEvent(Event_OnTargetDied, 1587); // Ashes to ashes, dust to dust
addEmoteForEvent(Event_OnTargetDied, 1584); // All life must perish!
addEmoteForEvent(Event_OnTargetDied, 1585); // Victory to the Legion!
addEmoteForEvent(Event_OnDied, 1583); // You have won this battle, but not... the...war
}
};
class AnetheronAI : public CreatureAIScript
{
public:
static CreatureAIScript* Create(Creature* c) { return new AnetheronAI(c); }
explicit AnetheronAI(Creature* pCreature) : CreatureAIScript(pCreature)
{
auto vampiricAura = addAISpell(VAMPIRIC_AURA, 8.0f, TARGET_SELF, 0, 8, false, true);
vampiricAura->setAttackStopTimer(1000);
auto inferno = addAISpell(INFERNO, 6.0f, TARGET_RANDOM_DESTINATION, 0, 30);
inferno->setAttackStopTimer(1000);
inferno->setMinMaxDistance(0.0f, 60.0f);
inferno->addEmote("Hit he, no time for a slow death", CHAT_MSG_MONSTER_YELL, 11039);
auto sleep = addAISpell(SLEEP, 5.0f, TARGET_RANDOM_SINGLE, 0, 7, false, true);
sleep->setAttackStopTimer(3000);
sleep->setMinMaxDistance(0.0f, 30.0f);
auto berserk = addAISpell(BERSERK, 5.0f, TARGET_SELF, 0, 600, false, true);
berserk->setAttackStopTimer(3000);
berserk->setMinMaxDistance(0.0f, 30.0f);
addEmoteForEvent(Event_OnCombatStart, 1569); // You are defenders of a doomed world. Flee here and perhaps you will prolong your pathetic lives!
addEmoteForEvent(Event_OnTargetDied, 1560); // Your hopes are lost.
addEmoteForEvent(Event_OnTargetDied, 1561); // Scream for me.
addEmoteForEvent(Event_OnTargetDied, 1565); // You look tired
addEmoteForEvent(Event_OnDied, 1559); // The clock... is still...ticking.
}
};
class KazrogalAI : public CreatureAIScript
{
public:
static CreatureAIScript* Create(Creature* c) { return new KazrogalAI(c); }
explicit KazrogalAI(Creature* pCreature) : CreatureAIScript(pCreature)
{
auto cleave = addAISpell(K_CLEAVE, 8.0f, TARGET_ATTACKING, 0, 10, false, true);
cleave->setAttackStopTimer(1000);
auto warStomp = addAISpell(WAR_STOMP, 6.0f, TARGET_VARIOUS, 0, 15, false, true);
warStomp->setAttackStopTimer(1000);
auto markOfKazrogal = addAISpell(MARK_OF_KAZROGAL, 4.0f, TARGET_VARIOUS, 0, 25, false, true);
markOfKazrogal->setAttackStopTimer(2000);
auto markOfKazrogal2 = addAISpell(MARK_OF_KAZROGAL2, 4.0f, TARGET_VARIOUS, 0, 25, false, true);
markOfKazrogal2->setAttackStopTimer(2000);
addEmoteForEvent(Event_OnCombatStart, 1582); // Cry for mercy! Your meaningless lives will soon be forfeit.
addEmoteForEvent(Event_OnTargetDied, 1580); // Your death will be a painful one.
addEmoteForEvent(Event_OnTargetDied, 1581); // You... are marked
addEmoteForEvent(Event_OnTargetDied, 1578); // You... are nothing!
addEmoteForEvent(Event_OnTargetDied, 1579); // Miserable nuisance!
}
void OnDied(Unit* /*mKiller*/) override
{
//\todo move this to db
getCreature()->sendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "hahahahaa aahaah");
getCreature()->PlaySoundToSet(11018);
}
};
class AzgalorAI : public CreatureAIScript
{
public:
static CreatureAIScript* Create(Creature* c) { return new AzgalorAI(c); }
explicit AzgalorAI(Creature* pCreature) : CreatureAIScript(pCreature)
{
auto cleave = addAISpell(CLEAVE, 8.0f, TARGET_ATTACKING, 0, 10, false, true);
cleave->setAttackStopTimer(3000);
auto rainOfFire = addAISpell(RAIN_OF_FIRE, 7.0f, TARGET_RANDOM_DESTINATION, 0, 15, false, true);
rainOfFire->setAttackStopTimer(1000);
rainOfFire->setMinMaxDistance(0.0f, 40.0f);
auto howlOfAzgalor = addAISpell(HOWL_OF_AZGALOR, 5.0f, TARGET_VARIOUS, 0, 15, false, true);
howlOfAzgalor->setAttackStopTimer(2000);
auto doom = addAISpell(DOOM, 15.0f, TARGET_RANDOM_SINGLE, 0, 45, false, true);
doom->setAttackStopTimer(1000);
doom->setMinMaxDistance(0.0f, 50.0f);
addEmoteForEvent(Event_OnCombatStart, 1576); // Abandon all hope! The legion has returned to finish what was begun so many years ago. This time there will be no escape!
addEmoteForEvent(Event_OnTargetDied, 1571); // Reesh, hokta!
addEmoteForEvent(Event_OnTargetDied, 1573); // No one is going to save you!
addEmoteForEvent(Event_OnTargetDied, 1572); // Don't fight it
addEmoteForEvent(Event_OnDied, 1570); // Your time is almost... up!
}
};
class ArchimondeTriggerAI : public CreatureAIScript
{
@@ -400,36 +279,6 @@ protected:
uint32_t DirChange;
};
/* * Doomfire - Leaves a trail of fire on the ground, which does 2400 fire
damage per second (occasionally feared people run into these and die) */
class ArchimondeAI : public CreatureAIScript
{
public:
static CreatureAIScript* Create(Creature* c) { return new ArchimondeAI(c); }
explicit ArchimondeAI(Creature* pCreature) : CreatureAIScript(pCreature)
{
auto airBurst = addAISpell(AIR_BURST, 5.0f, TARGET_ATTACKING, 0, 25, false, true);
airBurst->setAttackStopTimer(1000);
auto gripOfTheLegion = addAISpell(GRIP_OF_THE_LEGION, 5.0f, TARGET_RANDOM_SINGLE, 0, 25, false, true);
gripOfTheLegion->setAttackStopTimer(1000);
gripOfTheLegion->setMinMaxDistance(0.0f, 60.0f);
auto doomfireStrike = addAISpell(DOOMFIRE_STRIKE, 7.0f, TARGET_VARIOUS, 0, 25, false, true);
doomfireStrike->setAttackStopTimer(2000);
auto fear = addAISpell(FEAR, 2.0f, TARGET_VARIOUS, 0, 40, false, true);
fear->setAttackStopTimer(2000);
addEmoteForEvent(Event_OnCombatStart, 1591); // Your resistance is insignificant.
addEmoteForEvent(Event_OnTargetDied, 1597); // Your soul will languish for eternity.
addEmoteForEvent(Event_OnTargetDied, 1596); // All creation will be devoured!
addEmoteForEvent(Event_OnTargetDied, 1598); // I am the coming of the end!
addEmoteForEvent(Event_OnDied, 1600); // No, it cannot be! Nooo!
}
};
void SetupBattleOfMountHyjal(ScriptMgr* mgr)
{
mgr->register_instance_script(MAP_HYJALPAST, &MountHyjalScript::Create);
@@ -440,11 +289,6 @@ void SetupBattleOfMountHyjal(ScriptMgr* mgr)
mgr->register_creature_gossip(CN_THRALL, new ThrallGS());
mgr->register_creature_script(CN_THRALL, &ThrallAI::Create);
mgr->register_creature_script(CN_RAGE_WINTERCHILL, &RageWinterchillAI::Create);
mgr->register_creature_script(CN_ANETHERON, &AnetheronAI::Create);
mgr->register_creature_script(CN_KAZROGAL, &KazrogalAI::Create);
mgr->register_creature_script(CN_AZGALOR, &AzgalorAI::Create);
mgr->register_creature_script(CN_ARCHIMONDE_CHANNEL_TRIGGER, &ArchimondeTriggerAI::Create);
mgr->register_creature_script(CN_DOOMFIRE, &DoomfireAI::Create);
mgr->register_creature_script(CN_ARCHIMONDE, &ArchimondeAI::Create);
}

View File

@@ -44,7 +44,7 @@ bool ChatHandler::HandleMoveHardcodedScriptsToDBCommand(const char* args, WorldS
//prepare new table for dump
char my_table[1400];
sprintf(my_table, "CREATE TABLE `creature_ai_scripts_%s` (`min_build` int NOT NULL DEFAULT '12340',`max_build` int NOT NULL DEFAULT '12340',`entry` int unsigned NOT NULL,\
sprintf(my_table, "CREATE TABLE `creature_ai_scripts_%s` (`min_build` int NOT NULL DEFAULT '8606',`max_build` int NOT NULL DEFAULT '12340',`entry` int unsigned NOT NULL,\
`difficulty` tinyint unsigned NOT NULL DEFAULT '0',`phase` tinyint unsigned NOT NULL DEFAULT '0',`event` tinyint unsigned NOT NULL DEFAULT '0',`action` tinyint unsigned NOT NULL DEFAULT '0',\
`maxCount` tinyint unsigned NOT NULL DEFAULT '0',`chance` float unsigned NOT NULL DEFAULT '1',`spell` int unsigned NOT NULL DEFAULT '0',`spell_type` int NOT NULL DEFAULT '0',`triggered` tinyint(1) NOT NULL DEFAULT '0',\
`target` tinyint NOT NULL DEFAULT '0',`cooldownMin` int NOT NULL DEFAULT '0',`cooldownMax` int unsigned NOT NULL DEFAULT '0',`minHealth` float NOT NULL DEFAULT '0',\

View File

@@ -42,7 +42,7 @@
// DB version
static const char* REQUIRED_CHAR_DB_VERSION = "20220415-00_account_instance_times";
static const char* REQUIRED_WORLD_DB_VERSION = "20230709-01_hardcoded_ai_scripts";
static const char* REQUIRED_WORLD_DB_VERSION = "20230709-02_hardcoded_ai_scripts";
volatile bool Master::m_stopEvent = false;