Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcc3ef7e

Browse files
authored
Scripts/Naxxramas: Update Grobbulus to new model (#26382)
Co-authored-by: offl <offl@users.noreply.github.com>
1 parent9c72ca2 commitcc3ef7e

File tree

1 file changed

+112
-156
lines changed

1 file changed

+112
-156
lines changed

‎src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp‎

Lines changed: 112 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -46,186 +46,142 @@ enum CreatureId
4646
NPC_FALLOUT_SLIME =16290
4747
};
4848

49-
classboss_grobbulus :publicCreatureScript
49+
structboss_grobbulus :publicBossAI
5050
{
51-
public:
52-
boss_grobbulus() : CreatureScript("boss_grobbulus") { }
53-
54-
structboss_grobbulusAI :publicBossAI
51+
boss_grobbulus(Creature* creature) : BossAI(creature, BOSS_GROBBULUS) { }
52+
53+
voidJustEngagedWith(Unit* who)override
54+
{
55+
BossAI::JustEngagedWith(who);
56+
events.ScheduleEvent(EVENT_CLOUD, 15s);
57+
events.ScheduleEvent(EVENT_INJECT, 20s);
58+
events.ScheduleEvent(EVENT_SPRAY,randtime(Seconds(15),Seconds(30)));// not sure
59+
events.ScheduleEvent(EVENT_BERSERK, 12min);
60+
}
61+
62+
voidSpellHitTarget(WorldObject* target, SpellInfoconst* spellInfo)override
63+
{
64+
if (spellInfo->Id == SPELL_SLIME_SPRAY)
65+
me->SummonCreature(NPC_FALLOUT_SLIME, *target, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT);
66+
}
67+
68+
voidUpdateAI(uint32 diff)override
69+
{
70+
if (!UpdateVictim())
71+
return;
72+
73+
events.Update(diff);
74+
75+
while (uint32 eventId = events.ExecuteEvent())
5576
{
56-
boss_grobbulusAI(Creature* creature) : BossAI(creature, BOSS_GROBBULUS) { }
57-
58-
voidJustEngagedWith(Unit* who)override
59-
{
60-
BossAI::JustEngagedWith(who);
61-
events.ScheduleEvent(EVENT_CLOUD, 15s);
62-
events.ScheduleEvent(EVENT_INJECT, 20s);
63-
events.ScheduleEvent(EVENT_SPRAY,randtime(Seconds(15),Seconds(30)));// not sure
64-
events.ScheduleEvent(EVENT_BERSERK, 12min);
65-
}
66-
67-
voidSpellHitTarget(WorldObject* target, SpellInfoconst* spellInfo)override
68-
{
69-
if (spellInfo->Id == SPELL_SLIME_SPRAY)
70-
me->SummonCreature(NPC_FALLOUT_SLIME, *target, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT);
71-
}
72-
73-
voidUpdateAI(uint32 diff)override
77+
switch (eventId)
7478
{
75-
if (!UpdateVictim())
79+
case EVENT_CLOUD:
80+
DoCastAOE(SPELL_POISON_CLOUD);
81+
events.Repeat(Seconds(15));
7682
return;
77-
78-
events.Update(diff);
79-
80-
while (uint32 eventId = events.ExecuteEvent())
81-
{
82-
switch (eventId)
83-
{
84-
case EVENT_CLOUD:
85-
DoCastAOE(SPELL_POISON_CLOUD);
86-
events.Repeat(Seconds(15));
87-
return;
88-
case EVENT_BERSERK:
89-
DoCastAOE(SPELL_BERSERK,true);
90-
return;
91-
case EVENT_SPRAY:
92-
DoCastAOE(SPELL_SLIME_SPRAY);
93-
events.Repeat(randtime(Seconds(15),Seconds(30)));
94-
return;
95-
case EVENT_INJECT:
96-
if (Unit* target =SelectTarget(SelectTargetMethod::Random,1,0.0f,true,true, -SPELL_MUTATING_INJECTION))
97-
DoCast(target, SPELL_MUTATING_INJECTION);
98-
events.Repeat(Seconds(8) +Milliseconds(uint32(std::round(120 * me->GetHealthPct()))));
99-
return;
100-
default:
101-
break;
102-
}
103-
}
104-
105-
DoMeleeAttackIfReady();
83+
case EVENT_BERSERK:
84+
DoCastAOE(SPELL_BERSERK,true);
85+
return;
86+
case EVENT_SPRAY:
87+
DoCastAOE(SPELL_SLIME_SPRAY);
88+
events.Repeat(randtime(Seconds(15),Seconds(30)));
89+
return;
90+
case EVENT_INJECT:
91+
if (Unit* target =SelectTarget(SelectTargetMethod::Random,1,0.0f,true,true, -SPELL_MUTATING_INJECTION))
92+
DoCast(target, SPELL_MUTATING_INJECTION);
93+
events.Repeat(Seconds(8) +Milliseconds(uint32(std::round(120 * me->GetHealthPct()))));
94+
return;
95+
default:
96+
break;
10697
}
107-
};
108-
109-
CreatureAI*GetAI(Creature* creature)constoverride
110-
{
111-
return GetNaxxramasAI<boss_grobbulusAI>(creature);
11298
}
99+
100+
DoMeleeAttackIfReady();
101+
}
113102
};
114103

115-
classnpc_grobbulus_poison_cloud :publicCreatureScript
104+
structnpc_grobbulus_poison_cloud :publicScriptedAI
116105
{
117-
public:
118-
npc_grobbulus_poison_cloud() : CreatureScript("npc_grobbulus_poison_cloud") { }
119-
120-
structnpc_grobbulus_poison_cloudAI :publicScriptedAI
121-
{
122-
npc_grobbulus_poison_cloudAI(Creature* creature) : ScriptedAI(creature)
123-
{
124-
SetCombatMovement(false);
125-
creature->SetReactState(REACT_PASSIVE);
126-
}
127-
128-
voidIsSummonedBy(WorldObject*/*summoner*/)override
129-
{
130-
// no visual when casting in ctor or Reset()
131-
DoCast(me, SPELL_POISON_CLOUD_PASSIVE,true);
132-
DoCast(me, SPELL_PACIFY_SELF,true);
133-
}
134-
135-
voidUpdateAI(uint32/*diff*/)override { }
136-
};
137-
138-
CreatureAI*GetAI(Creature* creature)constoverride
139-
{
140-
return GetNaxxramasAI<npc_grobbulus_poison_cloudAI>(creature);
141-
}
106+
npc_grobbulus_poison_cloud(Creature* creature) : ScriptedAI(creature)
107+
{
108+
SetCombatMovement(false);
109+
creature->SetReactState(REACT_PASSIVE);
110+
}
111+
112+
voidIsSummonedBy(WorldObject*/*summoner*/)override
113+
{
114+
// no visual when casting in ctor or Reset()
115+
DoCast(me, SPELL_POISON_CLOUD_PASSIVE,true);
116+
DoCast(me, SPELL_PACIFY_SELF,true);
117+
}
118+
119+
voidUpdateAI(uint32/*diff*/)override { }
142120
};
143121

144122
// 28169 - Mutating Injection
145-
classspell_grobbulus_mutating_injection :publicSpellScriptLoader
123+
classspell_grobbulus_mutating_injection :publicAuraScript
146124
{
147-
public:
148-
spell_grobbulus_mutating_injection() : SpellScriptLoader("spell_grobbulus_mutating_injection") { }
125+
PrepareAuraScript(spell_grobbulus_mutating_injection);
149126

150-
classspell_grobbulus_mutating_injection_AuraScript :publicAuraScript
151-
{
152-
PrepareAuraScript(spell_grobbulus_mutating_injection_AuraScript);
127+
boolValidate(SpellInfoconst*/*spellInfo*/)override
128+
{
129+
returnValidateSpellInfo({ SPELL_MUTATING_EXPLOSION, SPELL_POISON_CLOUD });
130+
}
153131

154-
boolValidate(SpellInfoconst*/*spellInfo*/)override
155-
{
156-
returnValidateSpellInfo({ SPELL_MUTATING_EXPLOSION, SPELL_POISON_CLOUD });
157-
}
158-
159-
voidHandleRemove(AuraEffectconst* aurEff, AuraEffectHandleModes/*mode*/)
160-
{
161-
AuraRemoveMode removeMode =GetTargetApplication()->GetRemoveMode();
162-
if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE)
163-
return;
164-
165-
if (Unit* caster =GetCaster())
166-
{
167-
caster->CastSpell(GetTarget(), SPELL_MUTATING_EXPLOSION,true);
168-
GetTarget()->CastSpell(GetTarget(), SPELL_POISON_CLOUD, { aurEff,GetCasterGUID() });
169-
}
170-
}
171-
172-
voidRegister()override
173-
{
174-
AfterEffectRemove +=AuraEffectRemoveFn(spell_grobbulus_mutating_injection_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
175-
}
176-
};
132+
voidHandleRemove(AuraEffectconst* aurEff, AuraEffectHandleModes/*mode*/)
133+
{
134+
AuraRemoveMode removeMode =GetTargetApplication()->GetRemoveMode();
135+
if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE)
136+
return;
177137

178-
AuraScript*GetAuraScript()constoverride
138+
if (Unit* caster =GetCaster())
179139
{
180-
returnnewspell_grobbulus_mutating_injection_AuraScript();
140+
caster->CastSpell(GetTarget(), SPELL_MUTATING_EXPLOSION,true);
141+
GetTarget()->CastSpell(GetTarget(), SPELL_POISON_CLOUD, { aurEff,GetCasterGUID() });
181142
}
143+
}
144+
145+
voidRegister()override
146+
{
147+
AfterEffectRemove +=AuraEffectRemoveFn(spell_grobbulus_mutating_injection::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
148+
}
182149
};
183150

184151
// 28158, 54362 - Poison (Grobbulus)
185-
classspell_grobbulus_poison_cloud :publicSpellScriptLoader
152+
classspell_grobbulus_poison_cloud :publicAuraScript
186153
{
187-
public:
188-
spell_grobbulus_poison_cloud() : SpellScriptLoader("spell_grobbulus_poison_cloud") { }
189-
190-
classspell_grobbulus_poison_cloud_AuraScript :publicAuraScript
191-
{
192-
PrepareAuraScript(spell_grobbulus_poison_cloud_AuraScript);
193-
194-
boolValidate(SpellInfoconst* spellInfo)override
195-
{
196-
returnValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell });
197-
}
198-
199-
voidPeriodicTick(AuraEffectconst* aurEff)
200-
{
201-
PreventDefaultAction();
202-
if (!aurEff->GetTotalTicks())
203-
return;
204-
205-
uint32 triggerSpell =GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
206-
int32 mod =int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) *0.9f +0.1f) *10000 *2 /3);
207-
208-
CastSpellExtraArgsargs(aurEff);
209-
args.AddSpellMod(SPELLVALUE_RADIUS_MOD, mod);
210-
GetTarget()->CastSpell(nullptr, triggerSpell, args);
211-
}
212-
213-
voidRegister()override
214-
{
215-
OnEffectPeriodic +=AuraEffectPeriodicFn(spell_grobbulus_poison_cloud_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
216-
}
217-
};
218-
219-
AuraScript*GetAuraScript()constoverride
220-
{
221-
returnnewspell_grobbulus_poison_cloud_AuraScript();
222-
}
154+
PrepareAuraScript(spell_grobbulus_poison_cloud);
155+
156+
boolValidate(SpellInfoconst* spellInfo)override
157+
{
158+
returnValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell });
159+
}
160+
161+
voidPeriodicTick(AuraEffectconst* aurEff)
162+
{
163+
PreventDefaultAction();
164+
if (!aurEff->GetTotalTicks())
165+
return;
166+
167+
uint32 triggerSpell =GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
168+
int32 mod =int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) *0.9f +0.1f) *10000 *2 /3);
169+
170+
CastSpellExtraArgsargs(aurEff);
171+
args.AddSpellMod(SPELLVALUE_RADIUS_MOD, mod);
172+
GetTarget()->CastSpell(nullptr, triggerSpell, args);
173+
}
174+
175+
voidRegister()override
176+
{
177+
OnEffectPeriodic +=AuraEffectPeriodicFn(spell_grobbulus_poison_cloud::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
178+
}
223179
};
224180

225181
voidAddSC_boss_grobbulus()
226182
{
227-
newboss_grobbulus();
228-
newnpc_grobbulus_poison_cloud();
229-
newspell_grobbulus_mutating_injection();
230-
newspell_grobbulus_poison_cloud();
183+
RegisterNaxxramasCreatureAI(boss_grobbulus);
184+
RegisterNaxxramasCreatureAI(npc_grobbulus_poison_cloud);
185+
RegisterSpellScript(spell_grobbulus_mutating_injection);
186+
RegisterSpellScript(spell_grobbulus_poison_cloud);
231187
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp