Event/Midsummer: improve pole ribbon functionality (#17464)

Event/Midsummer: improve pole ribbon functionality:

- Bunny creature should hover, which puts it in the intended position.
- Use correct visual and internal spells to handle cosmetics and timers.
This commit is contained in:
SnapperRy
2016-07-05 15:19:30 +02:00
committed by Aokromes
parent 726eb7bdef
commit 55fc90fbc3
5 changed files with 166 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (29531, 45390, 29726);
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
(29726, 45406, 1, "Holiday - Midsummer, Ribbon Pole Periodic Visual");
DELETE FROM `spell_script_names` WHERE `spell_id` IN (45390, 45406);
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(45406, "spell_gen_ribbon_pole_dancer_check");
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=29726;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 1, 29726, 0, 0, 31, 0, 3, 17066, 0, 0, 0, 0, "", "Spell 'Test Ribbon Pole Channel' targets creature 'Ribbon Pole Debug Target'");
UPDATE `gameobject_template` SET `ScriptName`="go_midsummer_ribbon_pole" WHERE `entry`=181605;
DELETE FROM `disables` WHERE `sourceType`=0 AND `entry` IN (46836, 46842);
INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES
(0, 46836, 64, 0, "", "Spell Flame Patch - Ignore LOS"),
(0, 46842, 64, 0, "", "Spell Flame Ring - Ignore LOS");
UPDATE `creature_template_addon` SET `bytes1`=33554688 WHERE `entry`=17066;
DELETE FROM `creature_addon` WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id`=17066);
UPDATE `creature` SET `MovementType`=0, `spawndist`=0 WHERE `id`=17066;
UPDATE `creature_template` SET `ScriptName`="npc_midsummer_bunny_pole" WHERE `entry`=17066;

View File

@@ -3364,6 +3364,13 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS);
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
break;
case 46842: // Flame Ring
case 46836: // Flame Patch
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo();
break;
case 29726: // Test Ribbon Pole Channel
spellInfo->InterruptFlags &= ~AURA_INTERRUPT_FLAG_CAST;
break;
// VIOLET HOLD SPELLS
//
case 54258: // Water Globule (Ichoron)

View File

@@ -1187,6 +1187,7 @@ enum RibbonPoleData
{
SPELL_HAS_FULL_MIDSUMMER_SET = 58933,
SPELL_BURNING_HOT_POLE_DANCE = 58934,
SPELL_RIBBON_DANCE_COSMETIC = 29726,
SPELL_RIBBON_DANCE = 29175,
GO_RIBBON_POLE = 181605,
};
@@ -1214,10 +1215,11 @@ class spell_gen_ribbon_pole_dancer_check : public SpellScriptLoader
Unit* target = GetTarget();
// check if aura needs to be removed
if (!target->FindNearestGameObject(GO_RIBBON_POLE, 20.0f) || !target->HasUnitState(UNIT_STATE_CASTING))
if (!target->FindNearestGameObject(GO_RIBBON_POLE, 8.0f) || !target->HasUnitState(UNIT_STATE_CASTING))
{
target->InterruptNonMeleeSpells(false);
target->RemoveAurasDueToSpell(GetId());
target->RemoveAura(SPELL_RIBBON_DANCE_COSMETIC);
return;
}

View File

@@ -1126,6 +1126,29 @@ public:
}
};
enum MidsummerPoleRibbon
{
SPELL_POLE_DANCE = 29726,
SPELL_BLUE_FIRE_RING = 46842,
NPC_POLE_RIBBON_BUNNY = 17066,
ACTION_COSMETIC_FIRES = 0
};
class go_midsummer_ribbon_pole : public GameObjectScript
{
public:
go_midsummer_ribbon_pole() : GameObjectScript("go_midsummer_ribbon_pole") { }
bool OnGossipHello(Player* player, GameObject* go) override
{
if (Creature* creature = go->FindNearestCreature(NPC_POLE_RIBBON_BUNNY, 10.0f))
{
creature->GetAI()->DoAction(ACTION_COSMETIC_FIRES);
player->CastSpell(creature, SPELL_POLE_DANCE, true);
}
return true;
}
};
enum ToyTrainSpells
{
@@ -1203,5 +1226,6 @@ void AddSC_go_scripts()
new go_veil_skith_cage();
new go_frostblade_shrine();
new go_midsummer_bonfire();
new go_midsummer_ribbon_pole();
new go_toy_train_set();
}

View File

@@ -573,6 +573,115 @@ public:
}
};
/*######
## npc_midsummer_bunny_pole
######*/
enum RibbonPoleData
{
GO_RIBBON_POLE = 181605,
SPELL_RIBBON_DANCE_COSMETIC = 29726,
SPELL_RED_FIRE_RING = 46836,
SPELL_BLUE_FIRE_RING = 46842,
EVENT_CAST_RED_FIRE_RING = 1,
EVENT_CAST_BLUE_FIRE_RING = 2
};
class npc_midsummer_bunny_pole : public CreatureScript
{
public:
npc_midsummer_bunny_pole() : CreatureScript("npc_midsummer_bunny_pole") { }
struct npc_midsummer_bunny_poleAI : public ScriptedAI
{
npc_midsummer_bunny_poleAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
events.Reset();
running = false;
}
void Reset() override
{
Initialize();
}
void DoAction(int32 /*action*/) override
{
// Don't start event if it's already running.
if (running)
return;
running = true;
events.ScheduleEvent(EVENT_CAST_RED_FIRE_RING, 1);
}
bool checkNearbyPlayers()
{
// Returns true if no nearby player has aura "Test Ribbon Pole Channel".
std::list<Player*> players;
Trinity::UnitAuraCheck check(true, SPELL_RIBBON_DANCE_COSMETIC);
Trinity::PlayerListSearcher<Trinity::UnitAuraCheck> searcher(me, players, check);
me->VisitNearbyWorldObject(10.0f, searcher);
return players.empty();
}
void UpdateAI(uint32 diff) override
{
if (!running)
return;
events.Update(diff);
switch (events.ExecuteEvent())
{
case EVENT_CAST_RED_FIRE_RING:
{
if (checkNearbyPlayers())
{
Reset();
return;
}
if (GameObject* go = me->FindNearestGameObject(GO_RIBBON_POLE, 10.0f))
me->CastSpell(go, SPELL_RED_FIRE_RING, true);
events.ScheduleEvent(EVENT_CAST_BLUE_FIRE_RING, Seconds(5));
}
break;
case EVENT_CAST_BLUE_FIRE_RING:
{
if (checkNearbyPlayers())
{
Reset();
return;
}
if (GameObject* go = me->FindNearestGameObject(GO_RIBBON_POLE, 10.0f))
me->CastSpell(go, SPELL_BLUE_FIRE_RING, true);
events.ScheduleEvent(EVENT_CAST_RED_FIRE_RING, Seconds(5));
}
break;
}
}
private:
EventMap events;
bool running;
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_midsummer_bunny_poleAI(creature);
}
};
/*######
## Triage quest
######*/
@@ -2428,6 +2537,7 @@ void AddSC_npcs_special()
new npc_chicken_cluck();
new npc_dancing_flames();
new npc_torch_tossing_target_bunny_controller();
new npc_midsummer_bunny_pole();
new npc_doctor();
new npc_injured_patient();
new npc_garments_of_quests();