EOSERV Forum > EOSERV > Question on quest boxes
Page: << 1 >>
Question on quest boxes
Author Message
Post #201683 Question on quest boxes

When displaying a quest/dialog box by code is it possible to change the name listed in my screenshot below? I want to make it so I can change it to something else without using an NPC.


---
stay tuned.
7 years, 21 weeks ago
Post #201684 Re: Question on quest boxes

This is honestly just a guess but I think it grabs the npc id and uses that to find the npc name for the quest, have you tried using a id for a npc without a name or ID 0

7 years, 21 weeks ago
Post #201685 Re: Question on quest boxes
callum posted: (7th Dec 2016, 08:46 pm)

This is honestly just a guess but I think it grabs the npc id and uses that to find the npc name for the quest, have you tried using a id for a npc without a name or ID 0


Still nothing :/ thanks for the suggestion though. The value i replace in the packet is the short for vendor_id, but I can't seem to find anything for npc id.
---
stay tuned.
7 years, 21 weeks ago
Post #201686 Re: Question on quest boxes
andrewbob1 posted: (7th Dec 2016, 09:06 pm)

callum posted: (7th Dec 2016, 08:46 pm)

This is honestly just a guess but I think it grabs the npc id and uses that to find the npc name for the quest, have you tried using a id for a npc without a name or ID 0


Still nothing :/ thanks for the suggestion though. The value i replace in the packet is the short for vendor_id, but I can't seem to find anything for npc id.

I know this isn't what you're after, but the code below god rid of the NPC name and just had  "- Test Title" instead:

Are you clicking the wise man to open the dialog? that could be it ;o

void TestCommand(const std::vector<std::string>& arguments, Character* from)

{

void arguments();

    from->ServerMsg("This is a test command.");

std::string title = "Test Title";

std::string content = "Test Content";

PacketBuilder reply(PACKET_QUEST, PACKET_DIALOG, title.size()+ content.size());

    reply.AddChar(1); // quest count

    reply.AddShort(0); // ?

    reply.AddShort(0);

    reply.AddShort(0); // session

    reply.AddShort(0); // dialog id

    reply.AddByte(255);

    reply.AddShort(0);

    reply.AddString(title);

    reply.AddByte(255);

    reply.AddShort(1);

    reply.AddString(content);

    reply.AddByte(255);

from->Send(reply);

}

7 years, 21 weeks ago
Post #201687 Re: Question on quest boxes

This appears to be a completely clientside feature. The last NPC the character clicked is always what will display - for some reason the client tracks this and displays it in the eo protocol. As far as I'm aware, there is no way to change this behavior.

---
Want to learn to pixel?
Pixelsource.org
7 years, 21 weeks ago
Post #201688 Re: Question on quest boxes

There's a little trick you can do where you send a character a welcome reply packet to update them, I've done it before as a work around for the type glitch when learning spells,you can just add fake news telling players they've been updated. It might be more work than it's worth for what you want but it might reset that npc being stored by the client.

7 years, 21 weeks ago
Post #201699 Re: Question on quest boxes
callum posted: (8th Dec 2016, 12:52 am)

There's a little trick you can do where you send a character a welcome reply packet to update them, I've done it before as a work around for the type glitch when learning spells,you can just add fake news telling players they've been updated. It might be more work than it's worth for what you want but it might reset that npc being stored by the client.


Nice, didn't know there was a way around that glitch outside of either restarting or opening a text input box and closing it.
7 years, 20 weeks ago
Post #201702 Re: Question on quest boxes
callum posted: (8th Dec 2016, 12:52 am)

There's a little trick you can do where you send a character a welcome reply packet to update them, I've done it before as a work around for the type glitch when learning spells,you can just add fake news telling players they've been updated. It might be more work than it's worth for what you want but it might reset that npc being stored by the client.


Thanks! I'll give it a try and see if it works. I'll update in like 10 mins
---
stay tuned.
7 years, 20 weeks ago
Post #201703 Re: Question on quest boxes

I've been testing a new feature useing this code snippet in welcome.cpp

bool create_companion(Character *character)
{
    if(!character->player->characters.empty())
    {

         //enum or bool to track a tempquest state

         character->tempquest = TempQuest::SideKickMenu;

        PacketBuilder r(PACKET_QUEST, PACKET_DIALOG);
        r.AddChar(1);//quest count
        r.AddShort(0);//vender id
        r.AddShort(1000); //Quest_ID
        r.AddInt(0); // Session token
        r.AddByte(255);
        r.AddShort(0);
        r.AddBreakString("Side Kick Select");

        r.AddShort(1);//1
        r.AddBreakString("If you wish to use a side kick in this session please select one now!If your unfamiliar with this feature please contact an admin!");

        int i = 0;
        UTIL_FOREACH(character->side_kicks,side_kick)
        {
            if(side_kick == character) continue;

            r.AddShort(2);
            r.AddShort(++i);
            r.AddBreakString(side_kick->real_name);
        }
        character->Send(r);
    }
}

and it displays the quest dialog box like this



??

Just remember when you use the enum tempquest TempQuest::SideKickMenu; you have to intercept it in the Quest.cpp handler before other stuff gets handled
in
// Response to an NPC dialog
void Quest_Accept(Character *character, PacketReader &reader)
{
    /*short session = */reader.GetShort();
    /*short dialog_id = */reader.GetShort();
    short quest_id = reader.GetShort();
    /*short npc_index = */reader.GetShort();
    DialogReply type = DialogReply(reader.GetChar());

    char action = 0;

    if (type == DIALOG_REPLY_LINK)
        action = reader.GetChar();

 
    if(character->tempquest == TempQuest::SideKickMenu)
    {

    }
    else if(character->tempquest == TempQuest::OtherShit)
    {

    }
   
   if(character->tempquest != TempQuest::None)
   {
        character->tempquest= TempQuest::None;
        return;
   }
7 years, 20 weeks ago
Post #201742 Re: Question on quest boxes
insomniac posted: (8th Dec 2016, 08:30 pm)

I've been testing a new feature useing this code snippet in welcome.cpp

bool create_companion(Character *character)
{
    if(!character->player->characters.empty())
    {

         //enum or bool to track a tempquest state

         character->tempquest = TempQuest::SideKickMenu;

        PacketBuilder r(PACKET_QUEST, PACKET_DIALOG);
        r.AddChar(1);//quest count
        r.AddShort(0);//vender id
        r.AddShort(1000); //Quest_ID
        r.AddInt(0); // Session token
        r.AddByte(255);
        r.AddShort(0);
        r.AddBreakString("Side Kick Select");

        r.AddShort(1);//1
        r.AddBreakString("If you wish to use a side kick in this session please select one now!If your unfamiliar with this feature please contact an admin!");

        int i = 0;
        UTIL_FOREACH(character->side_kicks,side_kick)
        {
            if(side_kick == character) continue;

            r.AddShort(2);
            r.AddShort(++i);
            r.AddBreakString(side_kick->real_name);
        }
        character->Send(r);
    }
}

and it displays the quest dialog box like this



??

Just remember when you use the enum tempquest TempQuest::SideKickMenu; you have to intercept it in the Quest.cpp handler before other stuff gets handled
in
// Response to an NPC dialog
void Quest_Accept(Character *character, PacketReader &reader)
{
    /*short session = */reader.GetShort();
    /*short dialog_id = */reader.GetShort();
    short quest_id = reader.GetShort();
    /*short npc_index = */reader.GetShort();
    DialogReply type = DialogReply(reader.GetChar());

    char action = 0;

    if (type == DIALOG_REPLY_LINK)
        action = reader.GetChar();

 
    if(character->tempquest == TempQuest::SideKickMenu)
    {

    }
    else if(character->tempquest == TempQuest::OtherShit)
    {

    }
   
   if(character->tempquest != TempQuest::None)
   {
        character->tempquest= TempQuest::None;
        return;
   }

Haha I'm actually doing something similar to this. I was using that code for inputs, and I made a voting system that is connected to a database, and a guild management scroll/faction management. I'm thinking of posting the codes since I don't actually host a server haha, I just like coding
---
stay tuned.
7 years, 20 weeks ago
Post #201757 Re: Question on quest boxes
andrewbob1 posted: (11th Dec 2016, 01:10 am)

insomniac posted: (8th Dec 2016, 08:30 pm)

I've been testing a new feature useing this code snippet in welcome.cpp

bool create_companion(Character *character)
{
    if(!character->player->characters.empty())
    {

         //enum or bool to track a tempquest state

         character->tempquest = TempQuest::SideKickMenu;

        PacketBuilder r(PACKET_QUEST, PACKET_DIALOG);
        r.AddChar(1);//quest count
        r.AddShort(0);//vender id
        r.AddShort(1000); //Quest_ID
        r.AddInt(0); // Session token
        r.AddByte(255);
        r.AddShort(0);
        r.AddBreakString("Side Kick Select");

        r.AddShort(1);//1
        r.AddBreakString("If you wish to use a side kick in this session please select one now!If your unfamiliar with this feature please contact an admin!");

        int i = 0;
        UTIL_FOREACH(character->side_kicks,side_kick)
        {
            if(side_kick == character) continue;

            r.AddShort(2);
            r.AddShort(++i);
            r.AddBreakString(side_kick->real_name);
        }
        character->Send(r);
    }
}

and it displays the quest dialog box like this



??

Just remember when you use the enum tempquest TempQuest::SideKickMenu; you have to intercept it in the Quest.cpp handler before other stuff gets handled
in
// Response to an NPC dialog
void Quest_Accept(Character *character, PacketReader &reader)
{
    /*short session = */reader.GetShort();
    /*short dialog_id = */reader.GetShort();
    short quest_id = reader.GetShort();
    /*short npc_index = */reader.GetShort();
    DialogReply type = DialogReply(reader.GetChar());

    char action = 0;

    if (type == DIALOG_REPLY_LINK)
        action = reader.GetChar();

 
    if(character->tempquest == TempQuest::SideKickMenu)
    {

    }
    else if(character->tempquest == TempQuest::OtherShit)
    {

    }
   
   if(character->tempquest != TempQuest::None)
   {
        character->tempquest= TempQuest::None;
        return;
   }

Haha I'm actually doing something similar to this. I was using that code for inputs, and I made a voting system that is connected to a database, and a guild management scroll/faction management. I'm thinking of posting the codes since I don't actually host a server haha, I just like coding

A voteing system could come in handy.
7 years, 20 weeks ago
Page: << 1 >>

EOSERV Forum > EOSERV > Question on quest boxes