@@ -246,6 +246,33 @@ SpellScript* GetScript_ClearAllCooldowns(SpellEntry const*)
246246 return new ClearAllCooldownsScript ();
247247}
248248
249+ // 21651 - Opening
250+ struct OpeningBattlegroundBannerScript : public SpellScript
251+ {
252+ void OnSuccessfulStart (Spell* spell) const final
253+ {
254+ if (!spell->m_casterUnit )
255+ return ;
256+
257+ if (GameObject* go = spell->m_targets .getGOTarget ())
258+ {
259+ // Make sure the player is sending a valid GO target and lock ID.
260+ // SPELL_EFFECT_OPEN_LOCK can succeed with a lockId of 0.
261+ LockEntry const * lockInfo = sLockStore .LookupEntry (go->GetGOInfo ()->GetLockId ());
262+ if (lockInfo && lockInfo->Index [1 ] == LOCKTYPE_SLOW_OPEN )
263+ {
264+ Spell* visual = new Spell (spell->m_casterUnit , sSpellMgr .GetSpellEntry (24390 ), true );
265+ visual->prepare ();
266+ }
267+ }
268+ }
269+ };
270+
271+ SpellScript* GetScript_OpeningBattlegroundBanner (SpellEntry const *)
272+ {
273+ return new OpeningBattlegroundBannerScript ();
274+ }
275+
249276void AddSC_special_spell_scripts ()
250277{
251278 Script* newscript;
@@ -309,4 +336,9 @@ void AddSC_special_spell_scripts()
309336 newscript->Name = " spell_clear_all_cooldowns" ;
310337 newscript->GetSpellScript = &GetScript_ClearAllCooldowns;
311338 newscript->RegisterSelf ();
339+
340+ newscript = new Script;
341+ newscript->Name = " spell_opening_battleground_banner" ;
342+ newscript->GetSpellScript = &GetScript_OpeningBattlegroundBanner;
343+ newscript->RegisterSelf ();
312344}
0 commit comments