Scripts/Ebon Hold: Improve cosmetics for q. The Gift That Keeps On Giving (#24223)

* Scripts/Ebon Hold: Improve cosmetics for q. The Gift That Keeps On Giving

* Improve cosmetics for q. The Gift That Keeps On Giving

* Fixes

* Fix

* Rename 9999_99_99_99_world.sql to 2020_03_07_03_world.sql

Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
This commit is contained in:
Sorikoff
2020-03-07 17:17:00 +02:00
committed by GitHub
parent 9e87c60a39
commit 41d80f2d43
2 changed files with 80 additions and 60 deletions

View File

@@ -0,0 +1,23 @@
-- Scarlet Ghoul
DELETE FROM `creature_text` WHERE `CreatureID`=28845;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(28845,0,0,'So hungry...',12,0,100,0,0,0,28955,0,'Scarlet Ghoul'),
(28845,0,1,'Must feed...',12,0,100,0,0,0,28956,0,'Scarlet Ghoul'),
(28845,0,2,'GIVE ME BRAINS!',12,0,100,0,0,0,28957,0,'Scarlet Ghoul'),
(28845,0,3,'Smell flesh... close...',12,0,100,0,0,0,28958,0,'Scarlet Ghoul'),
(28845,0,4,'Mommy?',12,0,100,0,0,0,28959,0,'Scarlet Ghoul'),
(28845,0,5,'$g Poppy:Mama;!',12,0,100,0,0,0,28960,0,'Scarlet Ghoul');
-- Scarlet Ghost
DELETE FROM `creature_text` WHERE `CreatureID`=28846;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(28846,0,0,'Vengeance is mine!',12,0,100,0,0,0,28969,0,'Scarlet Ghost'),
(28846,0,1,'I\'ll take you with me!',12,0,100,0,0,0,28964,0,'Scarlet Ghost'),
(28846,0,2,'The grave calls to us all!',12,0,100,0,0,0,28966,0,'Scarlet Ghost'),
(28846,0,3,'Die, Scourge filth!',12,0,100,0,0,0,28968,0,'Scarlet Ghost'),
(28846,0,4,'YOU KILLED ME!',12,0,100,0,0,0,28967,0,'Scarlet Ghost');
UPDATE `creature_template` SET `ScriptName`='',`AIName`='SmartAI' WHERE `entry`=28846;
DELETE FROM `smart_scripts` WHERE `entryorguid`=28846 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`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28846,0,0,0,54,0,50,0,0,0,0,0,0,1,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Scarlet Ghost - On Just Appeared -Say Line 0");

View File

@@ -947,11 +947,14 @@ public:
};
// correct way: 52312 52314 52555 ...
enum Creatures_SG
enum TheGiftThatKeepsOnGiving
{
NPC_GHOULS = 28845,
NPC_GHOSTS = 28846,
SAY_LINE_0 = 0,
NPC_GHOULS = 28845,
NPC_GHOSTS = 28846,
};
class npc_dkc1_gothik : public CreatureScript
{
public:
@@ -996,83 +999,77 @@ public:
};
class npc_scarlet_ghoul : public CreatureScript
struct npc_scarlet_ghoul : public ScriptedAI
{
public:
npc_scarlet_ghoul() : CreatureScript("npc_scarlet_ghoul") { }
CreatureAI* GetAI(Creature* creature) const override
npc_scarlet_ghoul(Creature* creature) : ScriptedAI(creature)
{
return new npc_scarlet_ghoulAI(creature);
me->SetReactState(REACT_DEFENSIVE);
}
struct npc_scarlet_ghoulAI : public ScriptedAI
void JustAppeared() override
{
npc_scarlet_ghoulAI(Creature* creature) : ScriptedAI(creature)
{
// Ghouls should display their Birth Animation
// Crawling out of the ground
//DoCast(me, 35177, true);
//me->MonsterSay("Mommy?", LANG_UNIVERSAL, 0);
me->SetReactState(REACT_DEFENSIVE);
}
CreatureAI::JustAppeared();
void FindMinions(Unit* owner)
{
std::list<Creature*> MinionList;
owner->GetAllMinionsByEntry(MinionList, NPC_GHOULS);
if (urand(0, 1))
if (Unit* owner = me->GetOwner())
Talk(SAY_LINE_0, owner);
}
if (!MinionList.empty())
void FindMinions(Unit* owner)
{
std::list<Creature*> MinionList;
owner->GetAllMinionsByEntry(MinionList, NPC_GHOULS);
if (!MinionList.empty())
{
for (Creature* creature : MinionList)
{
for (std::list<Creature*>::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr)
if (creature->GetOwner()->GetGUID() == me->GetOwner()->GetGUID())
{
if ((*itr)->GetOwner()->GetGUID() == me->GetOwner()->GetGUID())
if (creature->IsInCombat() && creature->getAttackerForHelper())
{
if ((*itr)->IsInCombat() && (*itr)->getAttackerForHelper())
{
AttackStart((*itr)->getAttackerForHelper());
}
AttackStart(creature->getAttackerForHelper());
}
}
}
}
}
void UpdateAI(uint32 /*diff*/) override
void UpdateAI(uint32 /*diff*/) override
{
if (!me->IsInCombat())
{
if (!me->IsInCombat())
if (Unit* owner = me->GetOwner())
{
if (Unit* owner = me->GetOwner())
Player* plrOwner = owner->ToPlayer();
if (plrOwner && plrOwner->IsInCombat())
{
Player* plrOwner = owner->ToPlayer();
if (plrOwner && plrOwner->IsInCombat())
{
if (plrOwner->getAttackerForHelper() && plrOwner->getAttackerForHelper()->GetEntry() == NPC_GHOSTS)
AttackStart(plrOwner->getAttackerForHelper());
else
FindMinions(owner);
}
}
}
if (!UpdateVictim() || !me->GetVictim())
return;
//ScriptedAI::UpdateAI(diff);
//Check if we have a current target
if (me->EnsureVictim()->GetEntry() == NPC_GHOSTS)
{
if (me->isAttackReady())
{
//If we are within range melee the target
if (me->IsWithinMeleeRange(me->GetVictim()))
{
me->AttackerStateUpdate(me->GetVictim());
me->resetAttackTimer();
}
if (plrOwner->getAttackerForHelper() && plrOwner->getAttackerForHelper()->GetEntry() == NPC_GHOSTS)
AttackStart(plrOwner->getAttackerForHelper());
else
FindMinions(owner);
}
}
}
};
if (!UpdateVictim() || !me->GetVictim())
return;
//ScriptedAI::UpdateAI(diff);
//Check if we have a current target
if (me->EnsureVictim()->GetEntry() == NPC_GHOSTS)
{
if (me->isAttackReady())
{
//If we are within range melee the target
if (me->IsWithinMeleeRange(me->GetVictim()))
{
me->AttackerStateUpdate(me->GetVictim());
me->resetAttackTimer();
}
}
}
}
};
enum GiftOfTheHarvester
@@ -1123,6 +1120,6 @@ void AddSC_the_scarlet_enclave_c1()
RegisterSpellScript(spell_deliver_stolen_horse);
new npc_ros_dark_rider();
new npc_dkc1_gothik();
new npc_scarlet_ghoul();
RegisterCreatureAI(npc_scarlet_ghoul);
RegisterSpellScript(spell_gift_of_the_harvester);
}