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;
}