Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
- index 206518b..10757d6 100644
- --- a/src/server/scripts/World/npcs_special.cpp
- +++ b/src/server/scripts/World/npcs_special.cpp
- @@ -2971,6 +2971,78 @@ public:
- }
- };
- +class npc_bloodworm : public CreatureScript
- +{
- +public:
- + npc_bloodworm() : CreatureScript("npc_bloodworm") { }
- +
- + CreatureAI *GetAI(Creature *creature) const
- + {
- + return new npc_bloodwormAI(creature);
- + }
- +
- + struct npc_bloodwormAI : public ScriptedAI
- + {
- + npc_bloodwormAI(Creature *c) : ScriptedAI(c)
- + {
- + }
- +
- + uint32 uiBurstTimer;
- +
- + void Burst()
- + {
- + if (!me->isInCombat())
- + return;
- +
- + if (Aura* aura = me->GetAura(81277))
- + {
- + uint32 stacks = aura->GetStackAmount();
- + stacks = (stacks <= 10)? stacks: 10;
- + int32 damage = stacks * (me->GetMaxHealth() / 10);
- + me->CastCustomSpell(me, 81280, &damage, NULL, NULL, true);
- + }
- + }
- +
- + void EnterCombat(Unit * /*who*/)
- + {
- + }
- +
- + void JustDied(Unit* killer)
- + {
- + Burst();
- + }
- +
- + void Reset()
- + {
- + if (SpellEntry* spell = GET_SPELL(81280))
- + spell->EffectRadiusIndex[0] = 13;
- +
- + if (me->GetOwner())
- + {
- + me->SetMaxHealth(0.35 * me->GetOwner()->GetHealth());
- + me->SetHealth(0.35 * me->GetOwner()->GetHealth());
- + }
- +
- + DoCast(me, 50453);
- +
- + uiBurstTimer = 19000;
- + }
- +
- + void UpdateAI(const uint32 diff)
- + {
- + if (uiBurstTimer <= diff)
- + Burst();
- + else
- + uiBurstTimer -= diff;
- +
- + if (!UpdateVictim())
- + return;
- +
- + DoMeleeAttackIfReady();
- + }
- + };
- +};
- +
- void AddSC_npcs_special()
- {
- new npc_air_force_bots;
- @@ -3004,6 +3076,6 @@ void AddSC_npcs_special()
- new npc_ring_of_frost;
- new npc_flame_orb;
- new npc_power_word_barrier;
- -
- + new npc_bloodworm();
- }
Advertisement
Add Comment
Please, Sign In to add comment