So far i figured out it's sending packet 0CB when you chose the option to open mog house, But that packet is not defined anywhere.
How can we define this and link it to the mog house NPC.
This is all the mogHouse related code i found It seems to possibly register a moghouseID for your specific mog house...
how can we get that packet it pushes when you click to open mog to register, so when you talk to npc outside it registers an open moghouse and displays the option to visit.
or would it be simpler to find a way to @bring people or @goto people inside their moghouse.
Code: Select all
uint16 GetMogHouseID(CCharEntity * PChar)
{
if ( (PChar->loc.prevzone >= 48) && (PChar->loc.prevzone <= 50) )
{
return 0x00D6;
}
if ( (PChar->loc.prevzone >= 230) && (PChar->loc.prevzone <= 232) )
{
return (PChar->profile.nation == 0 ? 0x0121 : 0x0101);
}
if ( (PChar->loc.prevzone >= 234) && (PChar->loc.prevzone <= 236) )
{
return (PChar->profile.nation == 1 ? 0x0122 : 0x0102);
}
if ( (PChar->loc.prevzone >= 238) && (PChar->loc.prevzone <= 241) )
{
return (PChar->profile.nation == 2 ? 0x0123 : 0x0120);
}
if ( (PChar->loc.prevzone >= 243) && (PChar->loc.prevzone <= 246) )
{
return 0x0100;
}
return 0x0100;
}
Code: Select all
uint8 GetMosHouseFlag(CCharEntity* PChar)
{
if ((PChar->loc.prevzone >= 48) && (PChar->loc.prevzone <= 50))
{
if (PChar->profile.mhflag & 0x10) return 5;
}
if ((PChar->loc.prevzone >= 230) && (PChar->loc.prevzone <= 232))
{
if (PChar->profile.mhflag & 0x01) return 1;
}
if ((PChar->loc.prevzone >= 234) && (PChar->loc.prevzone <= 236))
{
if (PChar->profile.mhflag & 0x02) return 2;
}
if ((PChar->loc.prevzone >= 238) && (PChar->loc.prevzone <= 241))
{
if (PChar->profile.mhflag & 0x04) return 3;
}
if ((PChar->loc.prevzone >= 243) && (PChar->loc.prevzone <= 246))
{
if (PChar->profile.mhflag & 0x08) return 4;
}
return 0;
}
Code: Select all
if(csid != -1)
{
//WBUFB(data,(0x1F)-4) = 4; // предположительно animation
//WBUFB(data,(0x20)-4) = 2;
WBUFW(data,(0x40)-4) = PChar->getZone();
WBUFW(data,(0x62)-4) = PChar->getZone();
WBUFW(data,(0x64)-4) = csid;
}
if (PChar->getZone() == 0)
{
WBUFB(data,(0x80)-4) = 1;
WBUFW(data,(0x30)-4) = PChar->loc.prevzone; // form zone
WBUFW(data,(0x42)-4) = PChar->loc.prevzone; // from zone
WBUFW(data,(0xAA)-4) = GetMogHouseID(PChar); // Mog House id
WBUFB(data,(0xAE)-4) = GetMosHouseFlag(PChar); // Mog House leaving flag
} else {
WBUFB(data,(0x80)-4) = 2;
WBUFW(data,(0x30)-4) = PChar->getZone(); // to zone
WBUFW(data,(0x42)-4) = PChar->getZone(); // to zone
WBUFW(data,(0xAA)-4) = 0x01FF;
WBUFB(data,(0xAC)-4) = csid > 0 ? 0x01 : 0x00; //if 0x01 then pause between zone
WBUFB(data,(0xAF)-4) = PChar->loc.zone->CanUseMisc(MISC_MOGMENU); // флаг, позволяет использовать mog menu за пределами mog house
}