Jump to content
  • Rexxar not walking


    antz
    • Status: Completed
      Main Category: Database
      Sub-Category: Unknown
      Version: 2.0.10 Milestone: 20 Priority: unknown
      Implemented Version: 2.0.11

    Rexxar not walking

    By Fatcap:

    Rexxar should be walking acress desolace. Anyone got information about the waypoints?


    User Feedback

    Recommended Comments

    By Uccello:

    "the warrior wandered a path from the Charred Vale in Stonetalon Mountains along the main road through Desolace and continued to the Twin Colossals in northern Feralas." Source : [URL="http://www.wowwiki.com/Rexxar"]http://www.wowwiki.com/Rexxar[/URL]

    also near the top mentions this same path and a screenshot of him moving : [URL="http://wow.joystiq.com/2012/07/20/wow-archivist-the-most-painful-attunement-of-all/"]http://wow.joystiq.com/2012/07/20/wow-archivist-the-most-painful-attunement-of-all/ [/URL]

    not his full path but a video of him pathing not hanging out as he is now : [URL="https://www.youtube.com/watch?v=4pvkLsZa4uQ"]https://www.youtube.com/watch?v=4pvkLsZa4uQ[/URL]

    Hope this is a bit of help ( hoping to find something pinged on a map if i do I'll post with any updated info )

    Link to comment
    Share on other sites

    Using the tool MadMax recommended: Cartographe, I have plotted out Rexxar's path and generated the SQL script that will add a path for him to follow in the creature_movement table (TESTED, see link below for images of the path taken).
    Rexxar will need a script, as he is supposed to despawn at the end of the path, then respawn back at the start, at some point.
    Also, his pet, Misha (GUID 590005, ENTRY 10204), will need to be scripted to follow Rexxar (despawn, respawn too).

    THIS CANNOT BE USED UNTIL AT LEAST REXXAR IS SCRIPTED! (OR could add the scripts reversed to the end of these, appropriately numbered (point) then he'll just turn around and walk back, as a temporary solution?)

    [B][SIZE=3]SQL Script for Rexxar's path[/SIZE][/B]

    [B]Virus Total check on the file of scripts[/B]


    [B]Link to images showing the path Rexxar takes:[/B]
    [url]https://www.getmangos.eu/community-projects/10107-waypoint-mapper-coordinates-sql-script-converter-lua-wpf.html[/url]

    [B][SIZE=4]EDIT:[/SIZE][/B][B][COLOR="#0000CD"] [SIZE=4]The state of play[/SIZE] -[/COLOR][/B] what needs to be implemented and where we are with each part
    [B][SIZE=3]1)[/SIZE][/B] [B][COLOR="#008000"]REXXAR's ROUTE[/COLOR][/B]
    Done - the above SQL script

    [B][SIZE=3]2)[/SIZE][/B] [B][COLOR="#0000FF"]REXXAR DESPAWNING AT END OF ROUTE[/COLOR][/B]
    Partly done
    By using the [B]creature_ai_script[/B] table, with the action: [B]ACTION_T_FORCE_DESPAWN[/B], we can despawn Rexxar.
    But we need an event that fired when Rexxar reaches his final destination, waypoint:
    e.g. [B]EVENT_T_REACHED_DESTINATION[/B] parameters: X, Y, Z

    [B][SIZE=3]3)[/SIZE][/B] [COLOR="#008000"][B]REXXAR RESPAWNING BACK AT START OF ROUTE[/B][/COLOR]
    Done
    The [B]creature_template[/B] table has a field called [B]spawntimesecs[/B]
    This field just needs to have the amount of time entered (seconds, not milliseconds!) that represents the time between despawning (in this case) and respawning.

    [B][SIZE=3]4)[/SIZE][/B] [COLOR="#FF0000"][B]REXXAR'S PET (Misha the bear) FOLLOWING HIM[/B][/COLOR]
    Not looked at yet .

    Link to comment
    Share on other sites

    UPDATE ON PART 2, [B][COLOR="#0000FF"]REXXAR DESPAWNING AT END OF ROUTE[/COLOR][/B]

    This is how I have put the despawning of Rexxar together, so far:

    New event: [B]EVENT_T_REACHED_WAYPOINT[/B] (possibly better than EVENT_T_REACHED_DESTINATION, as EVENT_T_REACHED_WAYPOINT makes more sense for any waypoint during a creature's travels)
    This event is defined in the [B]CreatureEventAI.h[/B] file, thus:

    enum EventAI_Type
    {


    EVENT_T_REACHED_WAYPOINT = 31, // positionX, positionY, positionZ, unused

    }


    Yes, integers :-( That's the format/type of the fields in the database. So it will have to be a check on the distance from the waypoints, e.g. within 3 of the destination coordinates.

    Then in the same file we define the parameters the event uses, thus:

    struct CreatureEventAI_Event
    {

    union
    {
    // EVENT_T_REACHED_WAYPOINT = 31
    struct
    {
    int32 positionX;
    int32 positionY;
    int32 positionZ;
    } reached_waypoint;

    }
    }


    Next we have to get the system to use/check this event, this takes us to the [B]CreatureEventAI.cpp[/B] file:

    bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pActionInvoker, Creature* pAIEventSender /*=NULL*/)
    {

    // Check event conditions based on the event type, also reset events
    switch (event.event_type)
    {
    case EVENT_T_REACHED_WAYPOINT:
    if (!m_creature->reachedWaypoint()) // not coded yet - this function does not exist, as yet
    {
    return false;
    }

    LOG_PROCESS_EVENT;
    break;

    ...
    ...
    ...
    }

    }


    Yes, it is supposed to return false there. It returns true at the end of the function.

    And finally, for now, and in the same file, we get the system to check on the event on a set regular basis (actually every half a second - defined in CreatureEventAI.h - [B]#define EVENT_UPDATE_TIME 500[/B] )

    void CreatureEventAI::UpdateAI(const uint32 diff)
    }

    // Events that are updated every EVENT_UPDATE_TIME
    switch ((*i).Event.event_type)
    {
    case EVENT_T_REACHED_WAYPOINT:
    ...
    ...
    ...
    ProcessEvent(*i);
    break;
    }

    }


    Therefore, to do next, is to code the[B] reachedWaypoint()[/B] function, or similar. That will give us a fully functional Rexxar :) Then it's Misha time!!!!

    Link to comment
    Share on other sites

    Good News :-)

    I now have the EVENT_T_REACHED_WAYPOINT event working, so in my build of the zero server I have the Defias Messenger despawning at the end of the route, then respawning x number of seconds later back at the start of the route.

    This means we can now have Rexxar, the Defias Messenger and who/what ever else doing as they should in game.

    I'll tidy up the code, plus update this post with a better write-up of what I have done to resolve this final part. Then submit all to be added to the core and database.

    I'll work on Misha next, Rexxar's pet. Need to get her to follow, but we can implement the rest, so that we have at least Rexxar on his patrol :D

    Link to comment
    Share on other sites

    Just because we CAN do it in Lua, doesn't mean we should. Waypoints and basic creature AI should be done via DB, other wise doing WPs and basic AI every single time for every minor NPC or quest is quite redundant.

    Link to comment
    Share on other sites

    PR put in for the new event on all cores (Zero, One, Two, Three, and Four)

    As soon as I know the code has been added to the core, I'll post a PR for the database with Rexxar's pathing details plus other required database entries (creature_ai_scripts, etc)

    [B]Still to do:[/B] Misha (bear) following Rexxar

    [quote=cabfever]Why not doing the scripting of rexxar in LUA since we got the Eluna engine? As I guess, the cpp scripting would be replaced by lua scripts anyway at some time.
    Anyway, good work! :)[/quote]

    For me, it's a matter of knowledge of the system, I just happened to work out how the events worked before understanding how the LUA engine worked, and saw that a new event would work well for this and be usable for similar situations :D

    As soon as I learn how to use the LUA engine, I'm sure I'll make good use of it :)

    Link to comment
    Share on other sites

    Not forgotten about this :) re Misha the pet bear.

    I have figured out how to give Rexxar a companion/pet, but the result is that pet walking way way way behind him, so not ideal.

    Currently checking out the spells, to see if that will set off a light bulb moment.

    Link to comment
    Share on other sites

    [B][COLOR="#0000CD"]Rainer Schmelzeisen[/COLOR][/B] has come up with the answer:

    [B]creature_linking table[/B]

    You enter the main NPC's guid and that of its buddy, then they will stick together.

    I'll test this out now, as I need to figure out the correct flag to use in that table.

    Link to comment
    Share on other sites

    PR has now been submitted that allows Misha to join Rexxar on his travels.
    It includes the following SQL scripts to get Misha going:

    [B]creature[/B] table:
    UPDATE `creature` SET `position_x`='447.226471', `position_y`='1766.857422', `position_z`='22.992067', `orientation`='3.143952', `MovementType`='2' WHERE `guid`='590005';

    [B]creature_linking[/B] table:
    INSERT INTO `creature_linking` (`guid`, `master_guid`, `flag`) VALUES ('590005', '29113', '8835');


    All done now, as far as Rexxar and Misha are concerned :D

    [B][SIZE=3][COLOR="#800080"]This Thread Can Now Be Closed[/COLOR][/SIZE][/B]

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use