NPC: Dalaran Visitor's at Krasus Landing #12581

Open
Kittnz opened this Issue Jul 20, 2014 · 12 comments

Comments

Projects
None yet
7 participants
Member

Kittnz commented Jul 20, 2014

Bug: They just fly in the air on a mount. They are supposed to fly into Krasus Landing and land and say something and run into the door and disapear.

http://www.wowwiki.com/Dalaran_Visitor
http://wowpedia.org/Dalaran_Visitor

It's still the same on live, so it's sniffable
27c561c

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Contributor

malcrom commented Jul 20, 2014

Yes it's sniff-able. just not high priority with amount of available devs

Contributor

malcrom commented Jul 26, 2014

This would work if distance wasn't an issue in TC.

/*######
## npc_aludane_whitecloud
######*/

static uint32 VisitorSpawn[6] =
{
    { 32596 }, // Aliance
    { 32597 }, // Aliance
    { 32598 }, // Aliance
    { 32600 }, // Horde
    { 32601 }, // Horde
    { 32602 }  // Horde
};

static uint32 VisitorPath[3] =
{
    { 962781 },
    { 962782 },
    { 962783 }
};

Position const VisitorSpawnLocation[3] =
{
    { 5641.674f, 350.8333f, 735.2545f, 1.25311f },
    { 5876.768f, 321.7426f, 701.4127f, 1.25311f },
    { 5783.653f, 305.1915f, 681.962f,  1.25311f }
};

enum AludaneWhitecloud
{
    EVENT_SPAWN_VISITOR = 5,
};

enum DalaranVisitorWaypoints
{
    DALARAN_VISITOR_DISMOUNT_WAYPOINT   = 5,
    DALARAN_VISITOR_LAST_WAYPOINT       = 15
};

class npc_aludane_whitecloud : public CreatureScript
{
public:
    npc_aludane_whitecloud() : CreatureScript("npc_aludane_whitecloud") { }

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

        void Reset() override
        {
            events.ScheduleEvent(EVENT_SPAWN_VISITOR, urand(0, 4000));
        }

        void UpdateAI(uint32 diff) override
        {
            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_SPAWN_VISITOR:
                    {
                        uint32 spawnLocation = urand(0, 2);
                        if (Creature* visitor = me->SummonCreature(VisitorSpawn[urand(0, 5)], VisitorSpawnLocation[spawnLocation], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000))
                            visitor->GetMotionMaster()->MovePath(VisitorPath[spawnLocation], false);
                        events.ScheduleEvent(EVENT_SPAWN_VISITOR, urand(30000, 38000));
                        break;
                    }
                    default:
                        break;
                }
            }
        }

    private:
        EventMap events;
    };

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

/*######
## npc_dalaran_visitor
######*/

class npc_dalaran_visitor : public CreatureScript
{
public:
    npc_dalaran_visitor() : CreatureScript("npc_dalaran_visitor") { }

    struct npc_dalaran_visitorAI : public ScriptedAI
    {
        npc_dalaran_visitorAI(Creature* creature) : ScriptedAI(creature)
        {
            creature->setActive(true);
        }

        void MovementInform(uint32 type, uint32 id) override
        {
            if (type == WAYPOINT_MOTION_TYPE && id == DALARAN_VISITOR_DISMOUNT_WAYPOINT)
                me->Dismount();

            if (type == WAYPOINT_MOTION_TYPE && id == DALARAN_VISITOR_LAST_WAYPOINT)
                me->DespawnOrUnsummon();
        }
    };

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

void AddSC_dalaran()
{
    new npc_mageguard_dalaran();
    new npc_hira_snowdawn();
    new npc_minigob_manabonk();
    new npc_aludane_whitecloud();
    new npc_dalaran_visitor();
}
-- SQL
UPDATE `creature_template` SET `ScriptName`= 'npc_aludane_whitecloud' WHERE `entry`=28674;
UPDATE `creature_template` SET `InhabitType`=5, `ScriptName`= 'npc_dalaran_visitor' WHERE `entry` IN (32596,32597,32598,32600,32601,32602);

SET @PATH := 962781;
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH,1,5620.844, 304.7027, 727.6812,0,0,1,0,100,0),
(@PATH,2,5753.956, 325.8568, 705.126,0,0,1,0,100,0),
(@PATH,3,5798.88,  377.892,  678.5151,0,0,1,0,100,0),
(@PATH,4,5797.217, 412.948,  668.5225,0,0,1,0,100,0),
(@PATH,5,5804.147, 450.2107, 661.0242,0,2500,2,0,100,0),
(@PATH,6,5804.147, 450.2107, 658.784,0,1000,1,0,100,0),
(@PATH,7,5827.361, 473.3406, 658.784,0,0,1,0,100,0),
(@PATH,8,5828.554, 475.0378, 658.232,0,0,1,0,100,0),
(@PATH,9,5831.051, 483.7378, 658.1597,0,0,1,0,100,0),
(@PATH,10,5831.475, 490.1848, 658.0024,0,0,1,0,100,0),
(@PATH,11,5831.407, 498.2103, 657.3868,0,0,1,0,100,0),
(@PATH,12,5832.053, 506.7918, 657.5515,0,0,1,0,100,0),
(@PATH,13,5829.303, 513.5418, 657.7477,0,0,1,0,100,0),
(@PATH,14,5825.803, 514.7918, 657.7477,0,0,1,0,100,0),
(@PATH,15,5813.958, 521.3729, 657.7477,0,0,1,0,100,0),
(@PATH,16,5813.958, 521.3729, 657.7477,0,0,1,0,100,0);

SET @PATH := 962782;
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH,1,5876.208, 336.9427, 683.1423,0,0,1,0,100,0),
(@PATH,2,5828.663, 361.8749, 678.5822,0,0,1,0,100,0),
(@PATH,3,5811.333, 403.5245, 672.1656,0,0,1,0,100,0),
(@PATH,4,5823.03,  433.851,  661.5024,0,0,1,0,100,0),
(@PATH,5,5826.175, 452.957,  660.6693,0,2500,2,0,100,0),
(@PATH,6,5826.175, 452.957,  658.784,0,1000,1,0,100,0),
(@PATH,7,5827.361, 473.3406, 658.784,0,0,1,0,100,0),
(@PATH,8,5828.554, 475.0378, 658.232,0,0,1,0,100,0),
(@PATH,9,5831.051, 483.7378, 658.1597,0,0,1,0,100,0),
(@PATH,10,5831.475, 490.1848, 658.0024,0,0,1,0,100,0),
(@PATH,11,5831.407, 498.2103, 657.3868,0,0,1,0,100,0),
(@PATH,12,5832.053, 506.7918, 657.5515,0,0,1,0,100,0),
(@PATH,13,5831.741, 515.0019, 657.7477,0,0,1,0,100,0),
(@PATH,14,5836.491, 525.2519, 657.7477,0,0,1,0,100,0),
(@PATH,15,5840.741, 534.0019, 657.7477,0,0,1,0,100,0),
(@PATH,16,5838.307, 539.0468, 657.7477,0,0,1,0,100,0);

SET @PATH := 962783;
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH,1,5783.653, 305.1915, 681.962 ,0,0,1,0,100,0),
(@PATH,2,5795.319, 359.7676, 674.9742,0,0,1,0,100,0),
(@PATH,3,5800.514, 408.1917, 665.7884,0,0,1,0,100,0), 
(@PATH,4,5807.573, 425.8665, 660.4162,0,0,1,0,100,0),
(@PATH,5,5815.397, 438.9033, 659.222,0,2500,2,0,100,0),
(@PATH,6,5815.397, 438.9033, 658.784,0,1000,1,0,100,0),
(@PATH,7,5827.361, 473.3406, 658.784,0,0,1,0,100,0),
(@PATH,8,5828.554, 475.0378, 658.232,0,0,1,0,100,0),
(@PATH,9,5831.051, 483.7378, 658.1597,0,0,1,0,100,0),
(@PATH,10,5831.475, 490.1848, 658.0024,0,0,1,0,100,0),
(@PATH,11,5831.407, 498.2103, 657.3868,0,0,1,0,100,0),
(@PATH,12,5832.053, 506.7918, 657.5515,0,0,1,0,100,0),
(@PATH,13,5831.649, 514.8726, 657.7477,0,0,1,0,100,0),
(@PATH,14,5840.401, 533.3419, 657.7477,0,0,1,0,100,0),
(@PATH,15,5840.401, 533.3419, 657.7477,0,0,1,0,100,0),
(@PATH,16,5840.401, 533.3419, 657.7477,0,0,1,0,100,0);
Contributor

malcrom commented Jul 26, 2014

Actually this will work with creature->setActive(true);

But because it requires that to work it will not be allowed to go into TC offi.

Member

Kittnz commented Jul 28, 2014

@malcrom Because it's a hack then? Seems you made this pretty fast, isn't there another way to make this active?

Contributor

malcrom commented Aug 13, 2014

Not that I know of.

Contributor

Pitcrawler commented Aug 14, 2014

On retail at least any npc that has waypoint movement is always active no matter if there is any player nearby or not. Maybe this is even valid for all npcs on retail...
On TC npcs are only active when there is a player within range that activates the grid the npc is on.
I suppose this was made to reduce load?
The best solution would be to get this behavior retail-like...

Owner

Aokromes commented Aug 14, 2014

I have my doubs about that pitcrawler, sometimes when i have loged in into retail, i have seen mobs with waypoints running to the next waypoint.

Member

Kittnz commented Aug 14, 2014

Well i guess it depence on area. City area's are prolly never empty so they make it active instantly on retail. So i don't see why we can't make city grids active by standard.

@Aokromes Aokromes added this to the 3.3.5a cosmetic milestone Aug 28, 2014

Member

Kittnz commented Sep 2, 2014

@malcrom after testing this out i'll add the little issues.

  • Sometimes they do not do the right path, they go on the edge and fly on it, dismount and disapear.
  • When they dispawn on the platform they start to swim in the air, seems like the waypoints are too high?

Love what you did btw, just few minior issues.

Contributor

malcrom commented Sep 2, 2014

Core issues.

Contributor

dr-j commented Jan 2, 2015

well about grid believe was suggested on another issue that grid should become active if theres a temp spawn spawned, also believe a not of issues would be solved if even if there was no player in a grid if the grid stayed active for a couple of minutes after last player left grid to give those scripts which have a chance of bugging out to complete ie scripts which change npc flags, unit flags or even faction to complete,

@DDuarte DDuarte modified the milestone: Cosmetic Mar 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment