Dont tell people to contribute. It just looks like u see sth is not working and didnt try to deal with it or read why stuff is not working. Also this tool is a Dev-HELPER -- which means it helps u developing bots not developing the 'API' to bot. :)Quote:
instead of bitching around you could explain and contribute
You are basically right.Quote:
Dont tell people to contribute. It just looks like u see sth is not working and didnt try to deal with it or read why stuff is not working. Also this tool is a Dev-HELPER -- which means it helps u developing bots not developing the 'API' to bot. :)
It is because you need some structs and pointers to them to allow the salvage function to work, otherwise the client gets unknown packets back from the game server. You need to update the following, this isn't fixed but what areas need to be updated of gwa2.Quote:
Hello guys,
First of all, thanks a lot to DerMoench14 for this tools it helps me a lot while playing with GWCA and GWTB.
I managed to create the premises of a salvaging module but I encounter an issue...
Everytime I (re)load a zone, I need to first salvage one item manually in order to use my salvage GWCA function next. If I skip this manual first salvage, GW crashes.
When I use the CtoGS logger, I can't find anything special on first salvage call...
Any idea ?
Thx for your help.
AddPattern('5F5E5B741A6860EA0000')
_('ScanSalvageFunction:')
AddPattern('8BFA8BD9897DF0895DF4')
_('ScanSalvageGlobal:')
;then the following asm needs to be updated as well
;~ _('CommandSalvage:')
;~ _('mov ebx,SalvageGlobal')
;~ _('mov ecx,dword[eax+4]')
;~ _('mov dword[ebx],ecx')
;~ _('push ecx')
;~ _('mov ecx,dword[eax+8]')
;~ _('add ebx,4')
;~ _('mov dword[ebx],ecx')
;~ _('mov edx,dword[eax+c]')
;~ _('mov dword[ebx],ecx')
;~ _('call SalvageFunction')
;~ _('ljmp CommandReturn')
Thanks but I am not actually using GWA2 but GWCA.Quote:
It is because you need some structs and pointers to them to allow the salvage function to work, otherwise the client gets unknown packets back from the game server. You need to update the following, this isn't fixed but what areas need to be updated of gwa2.
As you will notice the public gwa2 has the salvage asm commented out as well that needs to be updated. This update would only work for non weapons as well I believe as weapons with mods require dealing with GStoC packets.Code:AddPattern('5F5E5B741A6860EA0000') _('ScanSalvageFunction:') AddPattern('8BFA8BD9897DF0895DF4') _('ScanSalvageGlobal:') ;then the following asm needs to be updated as well ;~ _('CommandSalvage:') ;~ _('mov ebx,SalvageGlobal') ;~ _('mov ecx,dword[eax+4]') ;~ _('mov dword[ebx],ecx') ;~ _('push ecx') ;~ _('mov ecx,dword[eax+8]') ;~ _('add ebx,4') ;~ _('mov dword[ebx],ecx') ;~ _('mov edx,dword[eax+c]') ;~ _('mov dword[ebx],ecx') ;~ _('call SalvageFunction') ;~ _('ljmp CommandReturn')
void Items::SalvageMaterials(uint32_t itemId) {
Item* salvageKit = FindSalvageKit();
if (salvageKit) {
uint16_t salvageSessionId16bit = GameContext::instance()->world->salvage_session_id;
GW::CtoS::SendPacket(0x10, GAME_CMSG_ITEM_SALVAGE_SESSION_OPEN
, salvageSessionId16bit
, salvageKit->item_id
, itemId
);
}
}
I can't call a Server to Client packet. I however can place an hook on it, which I did.Quote:
try to call (0x0167) then a delay then try your salvage function
GW::HookEntry SalvageSessionStart_Entry;
GW::StoC::RegisterPacketCallback<GW::Packet::StoC::SalvageSessionStart>(&SalvageSessionStart_Entry,
[this](GW::HookStatus*, GW::Packet::StoC::SalvageSessionStart* packet) -> void {
GW::Chat::WriteChat(GW::Chat::CHANNEL_MODERATOR, "SalvageSessionStart Hooked !");
});
you crash because there is an global array of size 2x 4Bytes which need to be prepared before calling salvage. GW needs the globals in order to react on a successful salvage. His BotDev tool wont help you with it. you will need to dig into xdbg or IDA in order to understand what is happening.Quote:
I can't call a Server to Client packet. I however can place an hook on it, which I did.
When I do the first manual salvage within the game , chat is displaying "SalvageSessionStart Hooked !". This tells me that the hook is working fine.Code:GW::HookEntry SalvageSessionStart_Entry; GW::StoC::RegisterPacketCallback<GW::Packet::StoC::SalvageSessionStart>(&SalvageSessionStart_Entry, [this](GW::HookStatus*, GW::Packet::StoC::SalvageSessionStart* packet) -> void { GW::Chat::WriteChat(GW::Chat::CHANNEL_MODERATOR, "SalvageSessionStart Hooked !"); });
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
But when my first salvage come from a GWCA call, I still crash...
GW::GameThread::Enqueue([item, kit]() {
SalvageUIMessage s = { item->item_id, kit->item_id };
GW::UI::SendUIMessage(0x10000000 | 0x100, &s);
GW::CtoS::SendPacket(0x10, GAME_CMSG_ITEM_SALVAGE_SESSION_OPEN, GW::GameContext::instance()->world->salvage_session_id, s.kit_id, s.item_id);
});
Many thanks 3vangelist.Quote:
Code:GW::GameThread::Enqueue([item, kit]() { SalvageUIMessage s = { item->item_id, kit->item_id }; GW::UI::SendUIMessage(0x10000000 | 0x100, &s); GW::CtoS::SendPacket(0x10, GAME_CMSG_ITEM_SALVAGE_SESSION_OPEN, GW::GameContext::instance()->world->salvage_session_id, s.kit_id, s.item_id); });