RachadoPT Posted June 23, 2015 at 09:27 AM Share Posted June 23, 2015 at 09:27 AM Boas, hoje venho ensinar-vos a criar um channel switcher igual ao do WoM2 através da source. Para isto funcionar, o servidor tem que ter as seguintes portas: ch1: 13002 - 13008 ch2: 13102 - 13108 ch3: 13202 - 13208 ch4: 13302 - 13308 Source (Serverside) 1º - No cmd.cpp Procuram por ACMD(do_warp); e por baixo adicionam ACMD(do_channel_switch); Procuram também por { "mall_close", do_mall_close, 0, POS_DEAD, GM_PLAYER }, e por baixo adicionam { "channel", do_channel_switch, 0, POS_DEAD, GM_PLAYER }, 2º - Depois abrem o cmd_general.cpp Procuram por ACMD(do_set_run_mode) { ch->SetNowWalking(false); ch->SetWalking(false); } e por baixo adicionam ACMD(do_channel_switch) { char arg1[256]; one_argument(argument, arg1, sizeof(arg1)); if (!*arg1) return; int new_ch; str_to_number(new_ch, arg1); if( new_ch <1 || new_ch >4) // REPLACE 2 WITH YOUR MAX_CHANNEL return; if (!ch->IsPC()) return; ch->ChannelSwitch(new_ch); } 3º - Abrem o char.h Procuram por void StartWarpNPCEvent(); e por baixo adicionam void ChannelSwitch(int new_ch); 4º - Abrem char.cpp Procuram por EVENTFUNC(warp_npc_event) { char_event_info* info = dynamic_cast<char_event_info*>( event->info ); if ( info == NULL ) { sys_err( "warp_npc_event> <Factor> Null pointer" ); return 0; } LPCHARACTER ch = info->ch; if (ch == NULL) { // <Factor> return 0; } if (!ch->GetSectree()) { ch->m_pkWarpNPCEvent = NULL; return 0; } FuncCheckWarp f(ch); if (f.Valid()) ch->GetSectree()->ForEachAround(f); return passes_per_sec / 2; } e por baixo adicionam void CHARACTER::ChannelSwitch(int new_ch){ long lAddr; long lMapIndex; WORD wPort; long x = this->GetX(); long y = this->GetY(); if (!CMapLocation::instance().Get(x, y, lMapIndex, lAddr, wPort)) { sys_err("cannot find map location index %d x %d y %d name %s", lMapIndex, x, y, GetName()); return; } if(lMapIndex >= 10000){ return; } std::map<WORD, int>micha; for(int i = 0; i < 4; i++){ //replace with maximum channels -1 actual 1300x - 1330x for(int i2 = 2; i2 < 9; i2++){ //replace with your core values actual 13x02 - 13x08 micha[13*1000 + i*100 + i2] = i+1; } } //micha[13002] = 1; int chan; if(micha.find(wPort) != micha.end()){ chan = micha[wPort]; }else{return;} Stop(); Save(); if(GetSectree()){ GetSectree()->RemoveEntity(this); ViewCleanup(); EncodeRemovePacket(this); } TPacketGCWarp p; p.bHeader = HEADER_GC_WARP; p.lX = x; p.lY = y; p.lAddr = lAddr; p.wPort = (wPort - 100*(chan-1) + 100*(new_ch-1)); GetDesc()->Packet(&p, sizeof(TPacketGCWarp)); } Python (Clientside) 1º - Extraem o vosso root 2º - Abrem o game.py e no final do ficheiro adicionam isto def __switch_channel(self): import uiChannel a = uiChannel.ChannelChanger() a.Show() PS: NÃO SE ESQUEÇAM DOS TABS 3º - Procuram por onPressKeyDict[app.DIK_F4] = lambda : self.__PressQuickSlot(7) e por baixo adicionam onPressKeyDict[app.DIK_F7] = lambda : self.__switch_channel() PS: NÃO SE ESQUEÇAM DOS TABS 4º - Adicionem o ficheiro uiChannel.py (está no download) dentro do vosso root 5º - Compactem o root de novo E é isso... Se fizeram todos os passos bem deverão ter o vosso channel switcher a funcionar bem... PS: para abrirem o channel switcher carreguem no F7, não está nas opções! Download: https://mega.co.nz/#!gRF1kSxA!TdFJOwDGB9D4VnhGTZ3WTLO3AYX5_3qDNueHbvQsawc Scan MD5: 28854c32941507e2dcf8e2ee863405ee SHA1: 75d9fe9fd2159f596f654993d8239d97d75a9dfe SHA256: bc6f785eee2cdc136576e776108cc22382704390d7034095da8e768430290c69 Mais Informações Fonte: Metin2Dev Créditos: Eu - pelo tópico Micha aka xCPx - pelo sistema + tutorial Link to comment Share on other sites More sharing options...
xXBoyDarkXx Posted June 23, 2015 at 05:19 PM Share Posted June 23, 2015 at 05:19 PM Como se muda as portas do switcher? Link to comment Share on other sites More sharing options...
Guest Rαgnorαk Posted June 23, 2015 at 08:00 PM Share Posted June 23, 2015 at 08:00 PM for(int i = 0; i < 4; i++){ //replace with maximum channels -1 actual 1300x - 1330x for(int i2 = 2; i2 < 9; i2++){ //replace with your core values actual 13x02 - 13x08 micha[13*1000 + i*100 + i2] = i+1; } } Link to comment Share on other sites More sharing options...
Marco Posted May 28, 2017 at 01:15 AM Share Posted May 28, 2017 at 01:15 AM alguém já testou? eu add a parte do cliente e ao clicar no F7 não abre, penso que não seja preciso ter a parte da source add para abrir no cliente Link to comment Share on other sites More sharing options...
xabugas123 Posted June 20, 2017 at 08:10 AM Share Posted June 20, 2017 at 08:10 AM irei testar Link to comment Share on other sites More sharing options...
xabugas123 Posted June 20, 2017 at 08:11 AM Share Posted June 20, 2017 at 08:11 AM Download: Your post count must be 1 in order to see this link. You currently have 0 post(s) porque n consigo ver o link? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now