Welcome to AC Web.
Results 1 to 9 of 9
  1. #1

    Open gossip on first player login


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Hello, I'm playing around a bit and I'm trying to make something which doesn't really seems to work for me.
    Basically I want to send a gossip when a player logs in for the first time, my main issue is that I can't really figure where to put the code I need.

    There is the OnLogin hook, but as far as it looks like so far, the cinematic intro that plays when you create a character seems to cancel the gossip menu, so I thought of maybe just putting the code in the EndCinematic function, but I really don't know for sure that everyone will have their cinematic playing. Maybe someone figured how to completely cancel that, and then the code won't run obviously.

    I can also maybe just send that in both scenarios, but I think gossip cancels itself, meaning that if I have a gossip and then I send another gossip, it will "override" the current gossip.

    Ideas will be appreciated, thanks

    BTW, trinitycore 3.3.5, latest revision.
    Last edited by msacco; 10-28-2019 at 10:26 PM.

  2. #2
    Disable cinematics from worldserver.conf

  3. #3
    K A P P A L O U N G E

    Join Date
    Sep 2011
    Location
    Germany
    Posts
    2,454
    Quote Originally Posted by msacco View Post
    Hello, I'm playing around a bit and I'm trying to make something which doesn't really seems to work for me.
    Basically I want to send a gossip when a player logs in for the first time, my main issue is that I can't really figure where to put the code I need.

    There is the OnLogin hook, but as far as it looks like so far, the cinematic intro that plays when you create a character seems to cancel the gossip menu, so I thought of maybe just putting the code in the EndCinematic function, but I really don't know for sure that everyone will have their cinematic playing. Maybe someone figured how to completely cancel that, and then the code won't run obviously.

    I can also maybe just send that in both scenarios, but I think gossip cancels itself, meaning that if I have a gossip and then I send another gossip, it will "override" the current gossip.

    Ideas will be appreciated, thanks

    BTW, trinitycore 3.3.5, latest revision.
    You add Timed events, Watch all Cinemas if u really need them active and write down the exact time in Seconds+Milliseconds of each Intro of each Race, with these Numbers then do a Racial Check and each Timer for each Intro to be passed and after that your gossip opens... ez

  4. #4
    Quote Originally Posted by Alistar View Post
    Disable cinematics from worldserver.conf
    I love it, you make me feel so dumb, it's awesome. Thanks!!

    Quote Originally Posted by Psykko View Post
    You add Timed events, Watch all Cinemas if u really need them active and write down the exact time in Seconds+Milliseconds of each Intro of each Race, with these Numbers then do a Racial Check and each Timer for each Intro to be passed and after that your gossip opens... ez
    Well, that might be easy, but I don't really feel like it's worth the hassle. I could take the longest cinematic and then just do it, but it will probably end up so bad. People could skip the intro, and then they'd simply have to wait...ZzzzZzZ....
    Nah I don't think it's a good solution.

    Maybe I could simply put the script in both the EndCinematic function and in the OnLogin hook, so that way it *should* always appear. If there will be no logo, the gossip will appear, if there is a logo, it will still appear(of course only if it's the first login).

    Any edge cases coming up to your mind?

    Thanks.

  5. #5
    Quote Originally Posted by msacco View Post
    I love it, you make me feel so dumb, it's awesome. Thanks!!
    Instead of being sarcastic you should have specified that you wanted to keep the cinematics.

    There's no point of using the OnLogin hook instead use the HandleCompleteCinematic function.
    Code:
    void WorldSession::HandleCompleteCinematic(WorldPacket & /*recv_data*/)
    And then just check if it's the first time the player is logging in.
    Code:
    if (GetPlayer()->HasAtLoginFlag(AT_LOGIN_FIRST))

  6. #6


    Join Date
    Jun 2012
    Location
    http://undamed-wow.com/
    Posts
    521
    Why wouldn't you just make a playerscript that triggers OnLogin?

    Code:
    class custom_player_script : public PlayerScript
    {
    public:
        custom_player_script() : PlayerScript("custom_player_script") { }
    
        void OnLogin(Player* player, bool firstLogin)
        {
            if (firstLogin)
            {
                ClearGossipMenuFor(player);
                AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Do Something!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
                SendGossipMenuFor(player, DEFAULT_GOSSIP_MESSAGE, player->GetGUID());
            }
        }
    };

  7. #7
    Quote Originally Posted by Alistar View Post
    Instead of being sarcastic you should have specified that you wanted to keep the cinematics.

    There's no point of using the OnLogin hook instead use the HandleCompleteCinematic function.
    Code:
    void WorldSession::HandleCompleteCinematic(WorldPacket & /*recv_data*/)
    And then just check if it's the first time the player is logging in.
    Code:
    if (GetPlayer()->HasAtLoginFlag(AT_LOGIN_FIRST))
    Dude, I wasn't sarcastic at all. I'm sorry that you thought of it that way, it really truly was as written. I loved it.
    I do think that if I can find a solution that doesn't touches the cinematic, it would've probably been better, but if there's no other way that is still a solution. Sorry about the misunderstanding, and thanks!

    As for the HandleCompleteCinematic solution, as I wrote in my post I could use the EngCinematic function(guess it's pretty similar to the HandleCompleteCinematic one), but I don't know if the cinematic will be guaranteed to play. I don't know of a scenario where it doesn't happen, but it would make sense to me that it could somehow be possible to delete the cinematics etc.
    That might not affect the cinematics packets though, so that could possibly still work.

    Quote Originally Posted by xXBentRealityXx View Post
    Why wouldn't you just make a playerscript that triggers OnLogin?

    Code:
    class custom_player_script : public PlayerScript
    {
    public:
        custom_player_script() : PlayerScript("custom_player_script") { }
    
        void OnLogin(Player* player, bool firstLogin)
        {
            if (firstLogin)
            {
                ClearGossipMenuFor(player);
                AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Do Something!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
                SendGossipMenuFor(player, DEFAULT_GOSSIP_MESSAGE, player->GetGUID());
            }
        }
    };
    Because as I said in the post, the intro cinematics closes the gossip menu.

  8. #8


    Join Date
    Jun 2012
    Location
    http://undamed-wow.com/
    Posts
    521
    Quote Originally Posted by msacco View Post
    Dude, I wasn't sarcastic at all. I'm sorry that you thought of it that way, it really truly was as written. I loved it.
    I do think that if I can find a solution that doesn't touches the cinematic, it would've probably been better, but if there's no other way that is still a solution. Sorry about the misunderstanding, and thanks!

    As for the HandleCompleteCinematic solution, as I wrote in my post I could use the EngCinematic function(guess it's pretty similar to the HandleCompleteCinematic one), but I don't know if the cinematic will be guaranteed to play. I don't know of a scenario where it doesn't happen, but it would make sense to me that it could somehow be possible to delete the cinematics etc.
    That might not affect the cinematics packets though, so that could possibly still work.



    Because as I said in the post, the intro cinematics closes the gossip menu.
    My bad man, was in a hurry so only read the title

  9. #9

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by xXBentRealityXx View Post
    My bad man, was in a hurry so only read the title
    Sure thanks anyway

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •