TGamesZeus 1
TGamesZeus
Best Studio 1
Best Studio
berkmenoo 1
berkmenoo
InfernoShade 1
InfernoShade
noisiv 1
noisiv
Manwe Work 1
Manwe Work
Agora Metin2 1
Agora Metin2
Bvural41 1
Bvural41
onur akbaş 1
onur akbaş
IronTalonX 1
IronTalonX
D 1
delimuratt
berzahx 1
berzahx
Hikaye Ekle

40K Envanter Görüntüleme Sistemi(Kostüm,Kemer Dahil)[C++,PYTHON]

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

HERAKLES Otomatik Avlı kalıcı sunucu. 19 Haziran'da açılıyor. Atius & Wizard güvencesiyle hemen kayıt ol, ön kayıt ödülleri aktif. HEMEN TIKLA!

Paylaşım icin teşekkürler
 
LİNK KIRILMIŞ ELİNDE OLAN VARMI HALA ?
 
I have had this system for many years, it even had a function that asked if you wanted to show the other player the team, if they rejected it, it would not show the rival team and vice versa, over time I adapted it. at 40k, although I could not do the request function, I still leave you here a functional guide, I also leave everything for the request to have if someone finishes it and makes it functional, otherwise it is great (this version only shows equipment not outfit , since if you want to hide the outfit you have the hidden costume).

1- Open Char.cpp (Source game) and search:
m_pkPartyRequestEvent = NULL;
add now:
// VIEW_EQUIP
m_pkViewEquipRequestEvent = NULL;
// END_OF_VIEW_EQUIP
Search now:
event_cancel(&m_pkFireEvent);
event_cancel(&m_pkPartyRequestEvent);
//DELAYED_WARP
event_cancel(&m_pkWarpEvent);
event_cancel(&m_pkCheckSpeedHackEvent);
//END_DELAYED_WARP
add:
// VIEW_EQUIP
event_cancel(&m_pkViewEquipRequestEvent);
// END_OF_VIEW_EQUIP
Search now:
void CHARACTER::DetermineDropMetinStone()
and after of function add:
// VIEW_EQUIP_FUNC
EVENTINFO(TViewEquipEventInfo)
{
DWORD dwGuestPID;
DWORD dwTargetPID;

TViewEquipEventInfo() : dwGuestPID( 0 ), dwTargetPID( 0 ) { }
} ;

EVENTFUNC(view_equip_request_event)
{
TViewEquipEventInfo * info = dynamic_cast<TViewEquipEventInfo *>( event->info );

if ( info == NULL )
{
sys_err( "view_equip_request_event> <Factor> Null pointer" );
return 0;
}

LPCHARACTER ch = CHARACTER_MANAGER::instance().FindByPID(info->dwGuestPID);

if (ch)
{
sys_log(0, "ViewEquipRequestEvent %s", ch->GetName());
ch->ChatPacket(CHAT_TYPE_COMMAND, "ViewEquipRequestDenied");
ch->SetViewEquipRequestEvent(NULL);
}

return 0;
}

bool CHARACTER::RequestToViewEquip(LPCHARACTER pTarget)
{
if (!pTarget)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't make a request because target player is not online."));
return false;
}

if (m_pkViewEquipRequestEvent)
return false;

if (!IsPC() || !pTarget->IsPC())
return false;

if (pTarget->IsBlockMode(BLOCK_EQUIPMENT_REQUEST))
return false;

TViewEquipEventInfo* info = AllocEventInfo<TViewEquipEventInfo>();

info->dwGuestPID = GetPlayerID();
info->dwTargetPID = pTarget->GetPlayerID();

SetViewEquipRequestEvent(event_create(view_equip_request_event, info, PASSES_PER_SEC(10)));

pTarget->ChatPacket(CHAT_TYPE_COMMAND, "ViewEquipRequest %u", (DWORD) GetVID());
return true;
}

void CHARACTER::DenyToViewEquip(LPCHARACTER guest)
{
sys_log(1, "DenyToViewEquip %s guest %s %p", GetName(), guest->GetName(), get_pointer(guest->m_pkViewEquipRequestEvent));

if (!guest->m_pkViewEquipRequestEvent)
return;

TViewEquipEventInfo * info = dynamic_cast<TViewEquipEventInfo *>(guest->m_pkViewEquipRequestEvent->info);

if (!info)
{
sys_err( "CHARACTER::DenyToViewEquip> <Factor> Null pointer" );
return;
}

if (info->dwGuestPID != guest->GetPlayerID())
return;

if (info->dwTargetPID != GetPlayerID())
return;

event_cancel(&guest->m_pkViewEquipRequestEvent);
guest->ChatPacket(CHAT_TYPE_COMMAND, "ViewEquipRequestDenied");
}

void CHARACTER::AcceptToViewEquip(LPCHARACTER guest)
{
sys_log(1, "AcceptToViewEquip %s guest %s %p", GetName(), guest->GetName(), get_pointer(guest->m_pkViewEquipRequestEvent));

if (!guest->m_pkViewEquipRequestEvent)
return;

TViewEquipEventInfo * info = dynamic_cast<TViewEquipEventInfo *>(guest->m_pkViewEquipRequestEvent->info);

if (!info)
{
sys_err( "CHARACTER::AcceptToViewEquip> <Factor> Null pointer" );
return;
}

if (info->dwGuestPID != guest->GetPlayerID())
return;

if (info->dwTargetPID != GetPlayerID())
return;

event_cancel(&guest->m_pkViewEquipRequestEvent);

SendEquipment(guest);
return;
}
search :
void CHARACTER::SendEquipment(LPCHARACTER ch)
and replace with:
void CHARACTER::SendEquipment(LPCHARACTER ch)
{
TPacketViewEquip p;
p.header = HEADER_GC_VIEW_EQUIP;
p.vid = GetVID();
int pos[19] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 20, 21, 22, 23, 24, 25, 26 };
for (int i = 0; i < 19; i++)
{
LPITEM item = GetWear(pos);
if (item)
{
p.equips.vnum = item->GetVnum();
p.equips.count = item->GetCount();

thecore_memcpy(p.equips.alSockets, item->GetSockets(), sizeof(p.equips.alSockets));
thecore_memcpy(p.equips.aAttr, item->GetAttributes(), sizeof(p.equips.aAttr));
}
else
{
p.equips.vnum = 0;
}
}
ch->GetDesc()->Packet(&p, sizeof(p));
}

Now save and go to char.h and search:
void SetPartyRequestEvent(LPEVENT pkEvent) { m_pkPartyRequestEvent = pkEvent; }
add:
// VIEW_EQUIP_FUNC
public:
bool RequestToViewEquip(LPCHARACTER pTarget);
void DenyToViewEquip(LPCHARACTER guest);
void AcceptToViewEquip(LPCHARACTER guest);
void SetViewEquipRequestEvent(LPEVENT pkEvent) { m_pkViewEquipRequestEvent = pkEvent; }

protected:
LPEVENT m_pkViewEquipRequestEvent;
// END_OF_VIEW_EQUIP_FUNC
save now and go to cmd_general and search;
after the function if you have ACMD(do_view_equip) replace or add
ACMD(do_view_equip)
{
if (ch->GetLevel() <= 14)
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Esta funcion se desbloquea a nivel 15."));
return;
}

char arg1[256];
one_argument(argument, arg1, sizeof(arg1));

if (*arg1)
{
DWORD vid = 0;
str_to_number(vid, arg1);
LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(vid);

if (!tch)
return;

if (!tch->IsPC())
return;

if ((tch->IsGM()) || (!test_server && tch->IsGM()))
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("El jugador %s tiene esta funcion bloqueada!"), tch->GetName());
return;
}

tch->SendEquipment(ch);
}
}

// VIEW_EQUIP_FUNC
ACMD(do_view_equip_request)
{
char arg1[256];
one_argument(argument, arg1, sizeof(arg1));

if (!*arg1)
return;

DWORD vid = 0;
str_to_number(vid, arg1);
LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(vid);

if (tch)
if (!ch->RequestToViewEquip(tch))
ch->ChatPacket(CHAT_TYPE_COMMAND, "ViewEquipRequestDenied");
}

ACMD(do_view_equip_request_accept)
{
char arg1[256];
one_argument(argument, arg1, sizeof(arg1));

if (!*arg1)
return;

DWORD vid = 0;
str_to_number(vid, arg1);
LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(vid);

if (tch)
ch->AcceptToViewEquip(tch);
}

ACMD(do_view_equip_request_deny)
{
char arg1[256];
one_argument(argument, arg1, sizeof(arg1));

if (!*arg1)
return;

DWORD vid = 0;
str_to_number(vid, arg1);
LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(vid);

if (tch)
ch->DenyToViewEquip(tch);
}
// END_OF_VIEW_EQUIP_FUNC
now save and go to packet.h and search:
HEADER_GC_REFINE_INFORMATION_OLD = 95,
add:
HEADER_GC_VIEW_EQUIP = 99,
now search:
typedef struct SEquipmentItemSet
{
DWORD vnum;
BYTE count;
long alSockets[ITEM_SOCKET_MAX_NUM];
TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_MAX_NUM];
} TEquipmentItemSet;
add:
typedef struct pakcet_view_equip
{
BYTE header;
DWORD vid;
struct
{
DWORD vnum;
BYTE count;
long alSockets[ITEM_SOCKET_MAX_NUM];
TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_MAX_NUM];
} equips[19];
} TPacketViewEquip;
Now save and go to cmd.cpp and search:
ACMD(do_stat_reset);
add if you don't have o replace:
ACMD(do_view_equip);
// VIEW_EQUIP_FUNC
ACMD(do_view_equip_request);
ACMD(do_view_equip_request_accept);
ACMD(do_view_equip_request_deny);
// END_OF_VIEW_EQUIP_FUNC
search :
{ "xmas_santa", do_xmas, SCMD_XMAS_SANTA, POS_DEAD, GM_HIGH_WIZARD },
add:
// VIEW_EQUIP_FUNC
{ "view_equip", do_view_equip_request, 0, POS_DEAD, GM_PLAYER },
{ "view_equip_accept", do_view_equip_request_accept, 0, POS_DEAD, GM_PLAYER },
{ "view_equip_deny", do_view_equip_request_deny, 0, POS_DEAD, GM_PLAYER },
// END_OF_VIEW_EQUIP_FUNC
Save and compile new Game

Now Src client search NetStream.cpp on EterLib and search:

stringList[98] = "HEADER_GC_OBSERVER_MOVE";
add o check if have the same value:
stringList[99] = "HEADER_GC_VIEW_EQUIP";
now go to packet in UserInterface and search:
HEADER_GC_OBSERVER_MOVE = 98,
check or add:
HEADER_GC_VIEW_EQUIP = 99,
search:
typedef struct SEquipmentItemSet
{
DWORD vnum;
BYTE count;
long alSockets[ITEM_SOCKET_SLOT_MAX_NUM];
TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_SLOT_MAX_NUM];
} TEquipmentItemSet;
add o replace:
typedef struct pakcet_view_equip
{
BYTE header;
DWORD dwVID;
TEquipmentItemSet equips[19];
} TPacketGCViewEquip;
Now go to PythonNetworkStream.cpp and search:
Set(HEADER_GC_CHANNEL, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCChannel), STATIC_SIZE_PACKET));
add
Set(HEADER_GC_VIEW_EQUIP, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCViewEquip), STATIC_SIZE_PACKET));
Now go to PythonNetworkSteamPhaseGame.cpp and search:
case HEADER_GC_CHANNEL:
ret = RecvChannelPacket();
break;
add
case HEADER_GC_VIEW_EQUIP:
ret = RecvViewEquipPacket();
break;
Search and replace:
bool CPythonNetworkStream::RecvViewEquipPacket()
{
TPacketGCViewEquip kViewEquipPacket;
if (!Recv(sizeof(kViewEquipPacket), &kViewEquipPacket))
return false;

PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OpenEquipmentDialog", Py_BuildValue("(i)", kViewEquipPacket.dwVID));
for (int i = 0; i < 19; ++i)
{
TEquipmentItemSet & rItemSet = kViewEquipPacket.equips;
PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetEquipmentDialogItem", Py_BuildValue("(iiii)", kViewEquipPacket.dwVID, i, rItemSet.vnum, rItemSet.count));

for (int j = 0; j < ITEM_SOCKET_SLOT_MAX_NUM; ++j)
PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetEquipmentDialogSocket", Py_BuildValue("(iiii)", kViewEquipPacket.dwVID, i, j, rItemSet.alSockets[j]));

for (int k = 0; k < ITEM_ATTRIBUTE_SLOT_MAX_NUM; ++k)
PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetEquipmentDialogAttr", Py_BuildValue("(iiiii)", kViewEquipPacket.dwVID, i, k, rItemSet.aAttr[k].bType, rItemSet.aAttr[k].sValue));
}

return true;
}

Now go to PythonNetworkStream.h and look if you have this:
bool RecvViewEquipPacket();
Compile .exe now.
Now go to client root and edit game.py and search:

# PRIVATE_SHOP_PRICE_LIST
"MyShopPriceList" : self.__PrivateShop_PriceList,
# END_OF_PRIVATE_SHOP_PRICE_LIST
add
# VIEW_EQUIP_FUNC
"ViewEquipRequest" : self.__ViewEquipRequest,
"ViewEquipRequestDenied" : self.__ViewEquipRequestDenied,
# END_OF_VIEW_EQUIP_FUNC
search:
def __PartyRequestDenied(self):
self.PopupMessage(localeInfo.PARTY_REQUEST_DENIED)
add:
# VIEW_EQUIPMENT_FUNC
def __ViewEquipRequest(self, vid):
vid = int(vid)
partyRequestQuestionDialog = uiCommon.QuestionDialog()
partyRequestQuestionDialog.SetText("Permites a " + chr.GetNameByVID(vid) + " ver tu equipo?")
partyRequestQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT)
partyRequestQuestionDialog.SetCancelText(localeInfo.UI_DENY)
partyRequestQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.__AnswerViewEquipRequest(arg))
partyRequestQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.__AnswerViewEquipRequest(arg))
partyRequestQuestionDialog.Open()
partyRequestQuestionDialog.vid = vid
self.partyRequestQuestionDialog = partyRequestQuestionDialog

def __AnswerViewEquipRequest(self, answer):
if not self.partyRequestQuestionDialog:
return

vid = self.partyRequestQuestionDialog.vid

if answer:
net.SendChatPacket("/view_equip_accept " + str(vid))
else:
net.SendChatPacket("/view_equip_deny " + str(vid))

self.partyRequestQuestionDialog.Close()
self.partyRequestQuestionDialog = None

def __ViewEquipRequestDenied(self):
self.PopupMessage("Peticion denegada.")
# END_OF_VIEW_EQUIPMENT_FUNC
Now go to uitarget.py and search;
self.buttonDict[localeInfo.TARGET_BUTTON_EXIT_OBSERVER].SAFE_SetEvent(self.__OnExitObserver)
add
self.buttonDict[localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT].SAFE_SetEvent(self.__OnViewEquipment)
now search:
def __OnExitObserver(self):
net.SendChatPacket("/observer_exit")
add:
def __OnViewEquipment(self):
net.SendChatPacket("/view_equip " + str(self.vid))
and now you have the system :)
 
Paylaşım için teşekkürler.
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst