[Wip] Quest: Bombing Run / Bomb Them Again!

Here is what I have done so far.

[CODE]
– Quest support for [Bombing Run] and [Bomb Them Again!]
– Note: Since I have no sniff for that, i excluded the use of NPC #23119 (Bombing Run Explosion Dummy) for the sake of simplicity
– Sources are various videos and quest done myself.
– Mainly (link removed, stupid BBCode parser interpretes it in a SQL block. (HD 720pp)
– Missing:
– _ Timed AchievementCriteria support
– _ Spawns (NPCs and GOBs)
– _ Winter Veil support
SET @SKYGUARD_BOMB := 32456;
SET @RUN_TARGET_DUMMY := 23118;
SET @RUN_MARK := 40196;
SET @THROW_BOMB := 40160;
SET @EXPLOSION_VISUAL := 40162;
SET @CANNONBALL_STACK := 185861;

DELETE FROM conditions WHERE SourceTypeOrReferenceId=18 AND SourceEntry=@SKYGUARD_BOMB;
INSERT INTO conditions (SourceTypeOrReferenceId,SourceGroup,SourceEntry,ElseGroup,ConditionTypeOrReference,ConditionValue1,ConditionValue2,ConditionValue3,ErrorTextId,ScriptName,Comment) VALUES
(18,0,@SKYGUARD_BOMB,0,24,1,@RUN_TARGET_DUMMY,0,0, ‘’, ‘Item Skyguard Bomb only target Bombing Run Target Bunny’);

UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@RUN_TARGET_DUMMY;

DELETE FROM creature_ai_scripts WHERE creature_id=@RUN_TARGET_DUMMY;
DELETE FROM smart_scripts WHERE source_type=0 AND entryorguid=@RUN_TARGET_DUMMY;
INSERT INTO smart_scripts (entryorguid,source_type,id,link,event_type,event_phase_mask,event_chance,event_flags,event_param1,event_param2,event_param3,event_param4,action_type,action_param1,action_param2,action_param3,action_param4,action_param5,action_param6,target_type,target_param1,target_param2,target_param3,target_x,target_y,target_z,target_o,comment) VALUES
(@RUN_TARGET_DUMMY,0,0,0,23,0,100,0,@RUN_MARK,0,2000,2000,11,@RUN_MARK,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Bombing Run Target Dummy - Bombing Run: Hunter’‘s Mark not present - Apply it’),
(@RUN_TARGET_DUMMY,0,1,2,8,0,100,0,@THROW_BOMB,0,1000,1000,33,@RUN_TARGET_DUMMY,0,0,0,0,0,7,0,0,0,0,0,0,0, ‘Bombing Run Target Dummy - On spell Throw Bomb hit - Give kill credit’),
(@RUN_TARGET_DUMMY,0,2,3,61,0,100,0,0,0,0,0,11,@EXPLOSION_VISUAL,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Bombing Run Target Dummy - On spell Throw Bomb hit - Cast Bombing Run: Explosion Visual on self’),
(@RUN_TARGET_DUMMY,0,3,4,61,0,100,0,0,0,0,0,41,500,0,0,0,0,0,20,@CANNONBALL_STACK,3,0,0,0,0,0, ‘Bombing Run Target Dummy - On spell Throw Bomb hit - Despawn nearest Fel Cannonball Stack’),
(@RUN_TARGET_DUMMY,0,4,0,61,0,100,0,0,0,0,0,41,500,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Bombing Run Target Dummy - On spell Throw Bomb hit - Despawn self’);

DELETE FROM spell_linked_spell WHERE spell_trigger=@THROW_BOMB;
INSERT INTO spell_linked_spell (spell_trigger, spell_effect, type, comment) VALUES
(@THROW_BOMB, -@RUN_MARK, 0, ‘Throw Bomb removes Hunter’‘s Mark for quest Bombing Run’);
[/sql]

Not tested, I would like to have feedback. Also, I would like to know if SAI supports timed achievements, and how to implement one. Last but not least, I’d need to know what exactly the Bombing Run Explosion Trigger is supposed to do. From my brainstorming I guess it’s standing in place until the gameobject respawns.

Could be nice if someone could sniff the spawns. The NPC should be located right at the same place where the gameobject is.

Source video:

[media]

[/media][/CODE]

Column count doesn’t match value count at row 2 why ?

@ Above.

read the topic, not tested yet.

Because i do the SQLs by hand.

Try this:

(@RUN_TARGET_DUMMY,0,0,0,23,0,100,0,@RUN_MARK ,0,2000,2000,11,@RUN_MARK ,0,0,0,0,0, 1,0 ,0,0,0,0,0,0, 'Bombing Run Target Dummy - Bombing Run: Hunter''s Mark not present - Apply it'), (@RUN_TARGET_DUMMY,0,1,2, 8,0,100,0,@THROW_BOMB,0,1000,1000,33,@RUN_TARGET_DUMMY,0,0,0,0,0, 7,0 ,0,0,0,0,0,0, 'Bombing Run Target Dummy - On spell Throw Bomb hit - Give kill credit'), (@RUN_TARGET_DUMMY,0,2,3,61,0,100,0,0 ,0,0 ,0 ,11,@EXPLOSION_VISUAL,0,0,0,0,0, 1,0 ,0,0,0,0,0,0, 'Bombing Run Target Dummy - On spell Throw Bomb hit - Cast Bombing Run: Explosion Visual on self'), (@RUN_TARGET_DUMMY,0,3,4,61,0,100,0,0 ,0,0 ,0 ,41,500 ,0,0,0,0,0,20,@CANNONBALL_STACK,3,0,0,0,0,0, 'Bombing Run Target Dummy - On spell Throw Bomb hit - Despawn nearest Fel Cannonball Stack'), (@RUN_TARGET_DUMMY,0,4,0,61,0,100,0,0 ,0,0 ,0 ,41,500 ,0,0,0,0,0, 1,0 ,0,0,0,0,0,0, 'Bombing Run Target Dummy - On spell Throw Bomb hit - Despawn self');[/sql]

Are you planning to test and complete this anytime soon?

After the year’s eve, yes.

Since it seems like you’re never completing this, I started looking into it together with Souler and we decided to script it completely blizzlike. And so we did!

As you might have heard, me and Souler are working on Ogri’la together to make it work as blizzlike as possible. We though this was one of the nice details we should include when scripting it, so here’s a small sneak peak of what’s coming. (3k lines of cpp, 1.5k liens of SQL)

SQL

[SPOILER]UPDATE creature_template SET ScriptName=‘npc_flak_cannon_dummy’,flags_extra=flags_extra|128,InhabitType=7,unit_flags=0 WHERE entry=23077;
UPDATE creature_template SET ScriptName=‘npc_bombing_run_target_bunny’,flags_extra=flags_extra|128 WHERE entry=23118;

DELETE FROM conditions WHERE SourceTypeOrReferenceId=17 AND SourceEntry=40160;
INSERT INTO conditions (SourceTypeOrReferenceId,SourceGroup,SourceEntry,ElseGroup,ConditionTypeOrReference,ConditionValue1,ConditionValue2,ConditionValue3,ErrorTextId,Comment) VALUES
(17,0,40160,0,29,23118,35,0,0,“Throw Bomb requires Bombing Run Target Dummy within 35y”);

– Addon template inserts
DELETE FROM creature_template_addon WHERE entry IN (23061,23282,23281,23261,23118);
INSERT INTO creature_template_addon (entry,mount,bytes1,bytes2,emote,auras) VALUES
(23118,0,0,0,0,‘40196’); – Bombing Run Target Dummy

UPDATE `creature_template` SET `ScriptName`='npc_legion_flak_cannon',`unit_flags`=`unit_flags`|390 WHERE `entry`=23076;

[/SPOILER]

C++

[SPOILER]{
QUEST_BOMBING_RUN_NORMAL = 11010,
QUEST_BOMBING_RUN_DRUID = 11102,
QUEST_BOMB_THEM_AGAIN = 11023,

SPELL_THROW_BOMB            = 40160,
SPELL_FEL_CANNON_BOLT       = 40109,
SPELL_FEL_FLAK_FIRE_DEBUFF  = 40075,
SPELL_FEL_FLAK_FIRE         = 41603,

NPC_FEL_CANNON_DUMMY        = 23077,

GAMEOBJECT_CANNONBALL_STACK = 185861,

};

class npc_bombing_run_target_bunny : public CreatureScript
{
public:
npc_bombing_run_target_bunny() : CreatureScript(“npc_bombing_run_target_bunny”) { }

    struct npc_bombing_run_target_bunnyAI : public ScriptedAI
    {
        npc_bombing_run_target_bunnyAI(Creature* creature) : ScriptedAI(creature) { }

        void SpellHit(Unit* caster, const SpellInfo* spell)
        {
            // Only return if quest is in questlog and marked as complete
            if (caster->ToPlayer()->GetQuestStatus((QUEST_BOMBING_RUN_NORMAL || QUEST_BOMBING_RUN_DRUID || QUEST_BOMB_THEM_AGAIN)) == QUEST_STATUS_COMPLETE)
                return;

            if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_THROW_BOMB)
            {
                if (GameObject* cannonballs = me->FindNearestGameObject(GAMEOBJECT_CANNONBALL_STACK, 5.0f))
                    cannonballs->RemoveFromWorld();

                caster->ToPlayer()->KilledMonsterCredit(me->GetEntry(), 0);
                me->ForcedDespawn();
            }
        }
    };

    CreatureAI* GetAI(Creature* creature) const
    {
        return new npc_bombing_run_target_bunnyAI(creature);
    }

};

class npc_flak_cannon_dummy : public CreatureScript
{
public:
npc_flak_cannon_dummy() : CreatureScript(“npc_flak_cannon_dummy”) { }

    struct npc_flak_cannon_dummyAI : public Scripted_NoMovementAI
    {
        npc_flak_cannon_dummyAI(Creature* creature) : Scripted_NoMovementAI(creature)
        {
            active = false;
            searchTimer = 500;
        }

        bool active;

        uint32 searchTimer;

        void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
        {
            if (spell->Id == SPELL_FEL_CANNON_BOLT)
            {
                active = true;
                me->ForcedDespawn(10000);
                DoCast(me, SPELL_FEL_FLAK_FIRE);

                if (Player* player = me->SelectNearestPlayer(7.0f))
                    DoCast(player, SPELL_FEL_FLAK_FIRE_DEBUFF);
            }
        }

        void DoCast(Unit* target, uint32 spellId)
        {
            if (me->ToTempSummon() && me->ToTempSummon()->GetSummoner())
                me->CastSpell(target, spellId, true, 0, 0, me->ToTempSummon()->GetSummoner()->GetGUIDLow());
            else
                Scripted_NoMovementAI::DoCast(target, spellId, true);

}

        void UpdateAI(const uint32 diff)
        {
            if (active)
            {
                if (searchTimer <= diff)
                {
                    if (Player* player = me->SelectNearestPlayer(7.0f))
                        if (!player->HasAura(SPELL_FEL_FLAK_FIRE_DEBUFF))
                            DoCast(player, SPELL_FEL_FLAK_FIRE_DEBUFF);

                    searchTimer = 500;
                }
                else
                    searchTimer -= diff;
            }
        }
    };

    CreatureAI* GetAI(Creature* creature) const
    {
        return new npc_flak_cannon_dummyAI(creature);
    }

};

class npc_legion_flak_cannon : public CreatureScript
{
public:
npc_legion_flak_cannon() : CreatureScript(“npc_legion_flak_cannon”) { }

    struct npc_legion_flak_cannonAI : public Scripted_NoMovementAI
    {
        npc_legion_flak_cannonAI(Creature* creature) : Scripted_NoMovementAI(creature) { }

        bool canShoot;

        uint32 shootTimer;

        void Reset()
        {
            canShoot = true;                
        }

        void MoveInLineOfSight(Unit* who)
        {
            if (!canShoot)
                return;

            if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDist(who, 40.0f))
            {
                // Should not only attack when player is in air, but also on ground with a flying mount
                if (who->HasAuraType(SPELL_AURA_FLY) || who->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
                {
                    me->SetFacingToObject(who);

                    if (Creature* bunny = me->SummonCreature(NPC_FEL_CANNON_DUMMY, who->GetPositionX(), who->GetPositionY(), who->GetPositionZ()))
                        DoCast(bunny, SPELL_FEL_CANNON_BOLT);

                    shootTimer = 3500;
                    canShoot = false;
                }
            }
        }

        void UpdateAI(const uint32 diff)
        {
            if (!canShoot)
            {
                if (shootTimer <= diff)
                    canShoot = true;
                else
                    shootTimer -= diff;
            }
        }
    };

    CreatureAI* GetAI(Creature* creature) const
    {
        return new npc_legion_flak_cannonAI(creature);
    }

};

enum BombingRun

[/SPOILER]

I’m just starting to have a little more free time right now. So yeah, you’re on this, that’s just great, then go on, as I will soon have no more time to spend on TrinityCore due to real life issues. Sorry about not having finished it, and any other stuff ive got as a wip /emoticons/default_sleep.png

It’s completely fine mate, I know exactly how it feels to not be able working for TrinityCore due to real life as well. Had to feel it myself. :confused:

Just tested your fix Discover, didnt work for me. Any reason why?

This topic is getting dead a bit, is this dropped? What are current problems? I think I have an idea how to make the bombs part work correctly, if that is the problem. Also the timed achievement-quest part is already in the core. I see @Warpten, doesn’t have time to finish it, but is anyone on it I mean.