Compare commits

...

8 Commits

Author SHA1 Message Date
MokonaNico
9820b15b07
Merge bef7204bb6af70802430f5385a626c779247e8a1 into d4cd580ddcf382acbca3bd104f09ca4c39ad811a 2025-11-09 05:50:53 -03:00
github-actions[bot]
d4cd580ddc chore(DB): import pending files
Referenced commit(s): 37833c66e69733c68c4244c2a2070b5c2421f0a8
2025-11-09 08:50:22 +00:00
Andrew
37833c66e6
fix(DB/Creature): Remove xp from Reclamation mobs (#23579) 2025-11-09 05:49:21 -03:00
github-actions[bot]
ec274182a2 chore(DB): import pending files
Referenced commit(s): d9b2e775e3266f4b592ca09eefd99b6f212d1861
2025-11-09 07:58:11 +00:00
Andrew
d9b2e775e3
fix(DB/Creature): Fix Sorlof visibility distance (#23573) 2025-11-09 04:57:04 -03:00
MokonaNico
bef7204bb6 Move sql changes to pending 2025-11-03 17:54:37 +01:00
MokonaNico
7a3e4066a3 Style : fix c++ codestyle 2025-11-03 17:44:06 +01:00
MokonaNico
75d64cc8f6 fix(Script): Implement correct behaviour for Prismatic Exiles summoned by Myzrael 2025-11-02 17:54:08 +01:00
4 changed files with 109 additions and 0 deletions

View File

@ -0,0 +1,3 @@
-- DB update 2025_11_08_02 -> 2025_11_09_00
--
UPDATE `creature_addon` SET `visibilityDistanceType` = 3 WHERE `guid` = 103278;

View File

@ -0,0 +1,3 @@
-- DB update 2025_11_09_00 -> 2025_11_09_01
--
UPDATE `creature_template` SET `flags_extra` = `flags_extra`|64 WHERE `entry` IN (28220, 28218, 28242, 28103, 28212, 28207, 28170);

View File

@ -0,0 +1,5 @@
-- Remove SmartAI and add script name
UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'npc_prismatic_exile' WHERE `entry` = 2887;
-- delete old smartscript
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2887) AND (`source_type` = 0);

View File

@ -124,7 +124,105 @@ public:
}
};
enum Spells
{
SPELL_FIREBALL = 34083,
SPELL_FROSTNOVA = 38033,
SPELL_LIGHTNING_SHIELD = 12550,
SPELL_VISUAL_TRANSFORMATION = 24085
};
// Fire, Air, Water, earth model displayId (same as the elemental in the zone)
uint32_t elements_display[] = {2172, 5490, 5561, 9587};
class npc_prismatic_exile : public CreatureScript
{
public:
npc_prismatic_exile() : CreatureScript("npc_prismatic_exile") {}
struct npc_prismatic_exileAI : public ScriptedAI
{
uint32 changeElementTimer;
uint32 currentElement;
uint32 frostNovaTimer;
bool hasLightningShield;
npc_prismatic_exileAI(Creature* creature) : ScriptedAI(creature) {
currentElement = 3;
hasLightningShield = false;
frostNovaTimer = urand(1400, 7300); // Got those values from smart_script of 2761
changeElementTimer = urand(6 * IN_MILLISECONDS, 10 * IN_MILLISECONDS);
}
void InitializeAI() override
{
ScriptedAI::InitializeAI();
// Get the target from Myzrael
Unit* owner = me->GetOwner();
if (!owner)
return;
Unit* target = owner->GetVictim();
if (target)
SetGazeOn(target);
}
void UpdateAI(uint32 diff) override
{
// Change Element
if (changeElementTimer <= diff)
{
uint32 _rand = urand(1, 3);
me->CastStop();
me->CastSpell(me, SPELL_VISUAL_TRANSFORMATION, true);
currentElement = (currentElement + _rand) % 4; // Change to a new element different from actual one
me->SetDisplayId(elements_display[currentElement]);
changeElementTimer = urand(6 * IN_MILLISECONDS, 10 * IN_MILLISECONDS);
}
else changeElementTimer -= diff;
if (!me->HasUnitState(UNIT_STATE_CASTING))
{
// Cast spell depending on the current element
switch (currentElement) {
case 0: // FIRE
// Always cast fire ball
me->CastSpell(me->GetVictim(), SPELL_FIREBALL, false);
return;
case 1: // AIR
// Can only cast lightning shield once
if (!hasLightningShield)
{
me->CastSpell(me, SPELL_LIGHTNING_SHIELD, false);
hasLightningShield = true;
}
break;
case 2: // WATER
// Can only case frostnova if is in range and timer is done
Unit * target = me->GetVictim();
if (target && me->IsInRange(target, 0.0f, 10.0f) && frostNovaTimer <= diff)
{
me->CastSpell((Unit*)nullptr, SPELL_FROSTNOVA, false);
frostNovaTimer = urand(1400, 7300);
}
else frostNovaTimer -= diff;
break;
}
// By default, melee attack
DoMeleeAttackIfReady();
}
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_prismatic_exileAI(creature);
}
};
void AddSC_arathi_highlands()
{
new npc_prismatic_exile();
new npc_professor_phizzlethorpe();
}