1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Guest ,are you tired of restrictions?You can upgrade your account ,click here for details.
    Dismiss Notice
  3. Dismiss Notice
  4. Dismiss Notice

<Release> [Python/C++] Channel Changer

Discussion in 'Quests /Python' started by VegaS™, Feb 29, 2016.

  1. VegaS™

    VegaS™ Premium User Premium User Ex-Staff Member
    • 243/263

    Joined:
    Nov 17, 2015
    Messages:
    227
    Likes Received:
    4,433
    Gender:
    Male
    [​IMG]



    uBtHf.jpg


    PS:


    I. Client/Root:

    Creeză un fișier nou în root cu numele de channel.py și introdu codul acesta în el:

    Link download:

    Hidden Content:
    **Hidden Content: You must click 'Like' before you can see the hidden data contained here.**
    Hidden Content:
    **Hidden Content: You must click 'Like' before you can see the hidden data contained here.**
    Deschide uisystem.py și adaugă:

    Code (Text):
    import channel
    //Caută:

    Code (Text):
            self.GetChild("system_option_button").SAFE_SetEvent(self.__ClickSystemOptionButton)
    //Adaugă mai jos:
    Code (Text):
            self.GetChild("change_ch_button").SAFE_SetEvent(self.__ClickChangeChannelButton)
    //Caută funcția:
    Code (Text):
        def __ClickGameOptionButton(self):
            self.Close()

            if not self.gameOptionDlg:
                self.gameOptionDlg = uiGameOption.OptionDialog()

            self.gameOptionDlg.Show()
    //Adaugă mai jos:
    Code (Text):
        def __ClickChangeChannelButton(self):
            self.Close()
            import channel
            vegas = channel.Titan2_Channel_Changer()
            vegas.Open()
    Deschide constInfo.py și adaugă:

    Code (Text):
    change_time = 0
    2. Client\locale\ro\ui

    Deschide systemdialog.py.

    //Caută:
    Code (Text):
                    {
                        "name" : "exit_button",
                        "type" : "button",

                        "x" : 10,
                        "y" : 217,

                        "text" : uiScriptLocale.SYSTEM_EXIT,

                        "default_image" : ROOT + "XLarge_Button_01.sub",
                        "over_image" : ROOT + "XLarge_Button_02.sub",
                        "down_image" : ROOT + "XLarge_Button_03.sub",
                    },
    //Adaugă mai jos:
    Code (Text):
                    {
                        "name" : "change_ch_button",
                        "type" : "button",

                        "x" : 10,
                        "y" : 277,

                        "text" : "Change Channel - VegaS",
                        "text_color" : 0xffF8BF24,

                        "default_image" : ROOT + "XLarge_Button_01.sub",
                        "over_image" : ROOT + "XLarge_Button_02.sub",
                        "down_image" : ROOT + "XLarge_Button_03.sub",
                    },

    III . Server/game/src

    Deschide cmd.cpp și caută:

    Code (Text):
    ACMD(do_item);
    //Mai jos adaugă:
    Code (Text):
    ACMD(do_ch);
    //Caută:
    Code (Text):
        { "pvp",        do_pvp,            0,            POS_DEAD,    GM_PLAYER    },
    //Mai jos adaugă:
    Code (Text):
        { "ch",        do_ch,        0,            POS_DEAD,    GM_PLAYER    },    
    Deschide cmd_general.cpp și caută:

    Code (Text):
    ACMD(do_set_walk_mode)
    {
        ch->SetNowWalking(true);
        ch->SetWalking(true);
    }
    //Mai jos adaugă:
    Hidden Content:
    **Hidden Content: You must click 'Like' before you can see the hidden data contained here.**
    Deschide char.h și caută:

    Code (Text):
            void                StartWarpNPCEvent();
    //Mai jos adaugă:
    Hidden Content:
    **Hidden Content: You must click 'Like' before you can see the hidden data contained here.**
    Deschide char.cpp și caută:

    Code (Text):
    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;
    }
    //Mai jos adaugă:

    Hidden Content:
    **Hidden Content: You must click 'Like' before you can see the hidden data contained here.**
    Porturi:

    etc..

    Code (Text):
    for(int i = 0; i < 4; i++){
    4 - Modificați cu cate ch-uri aveți actuale.
     
    • Like Like x 323
    • Agree Agree x 2
    Last edited: Feb 29, 2016
  2. DowNNN

    DowNNN Freak member Member
    • 18/66

    Joined:
    Dec 19, 2015
    Messages:
    67
    Likes Received:
    67
    Gender:
    Male
    Chiar daca nu este ceva foarte nou este foarte folositor . Foarte tare , bravo !
     
    • Like Like x 14
  3. VegaS™

    VegaS™ Premium User Premium User Ex-Staff Member
    • 243/263

    Joined:
    Nov 17, 2015
    Messages:
    227
    Likes Received:
    4,433
    Gender:
    Male
    Am făcut topicul ăsta mai mult pentru script-ul meu python vechi dar după nu știau ce să facă cu el și cum să-l instaleze așa că am făcut pe langa si un mic tutorial total, pe serverul meu l-am revizuit și la cel vechi am zis să îi dau un share, ca de fiecare dată. Mulțam.
     
    • Like Like x 1
  4. DowNNN

    DowNNN Freak member Member
    • 18/66

    Joined:
    Dec 19, 2015
    Messages:
    67
    Likes Received:
    67
    Gender:
    Male
    Inca o idee , poti adauga pe langa si ca atunci cand Ch-ul este offline sa nu poti schimba
     
    • Like Like x 2
  5. VegaS™

    VegaS™ Premium User Premium User Ex-Staff Member
    • 243/263

    Joined:
    Nov 17, 2015
    Messages:
    227
    Likes Received:
    4,433
    Gender:
    Male
    69jqe.jpg

    - Dacă este mort./
    - Dacă ch-ul nu este online./
    - Dacă are negoțul deschis./
    - Dacă are un shop deschis./
    - Dacă are o fereastră de npc deschisă./​

    Deschide cmd_general.cpp și caută:

    Code (Text):
        if( new_ch <1 || new_ch >4)
            return;
    Mai jos adaugă:

    Hidden Content:
    **Hidden Content: You must click 'Like' before you can see the hidden data contained here.**
     
    • Like Like x 121
    Last edited: Nov 25, 2017
  6. Oğuzhan

    Oğuzhan Freak member Member
    • 18/66

    Joined:
    Feb 25, 2016
    Messages:
    39
    Likes Received:
    32
    tnks
     
    • Like Like x 3
  7. VegaS™

    VegaS™ Premium User Premium User Ex-Staff Member
    • 243/263

    Joined:
    Nov 17, 2015
    Messages:
    227
    Likes Received:
    4,433
    Gender:
    Male
    With pleasure
     
  8. Catalin2o14

    Catalin2o14 Freak level 1 Member
    • 18/66

    Joined:
    Jan 13, 2016
    Messages:
    119
    Likes Received:
    17
    Am implementat doar partea de sursă si se pare ca am o problema:
    dupa ce bag comanda si ch-ul unde vreau sa ma duc,ma face invizibil si mă da la login
    cred ca la porturi am gresit
    Ma poti ajuta?
    Eu am porturile asa:
    ch1_1:27301
    ch1_2:27302
    ch2_1:27311
    ch2_2:27312
    iar eu am modificat:
    Code (Text):
    for (BYTE i = 0; i < 2; i++)
            {
                    for (BYTE j = 1; j < 3; j++)
                            ChannelsPorts[273 * 100 + (i * 10) + j] = i + 1;
            }
    Este bine? Unde am gresit?
    intregul meu cod este:
    Code (Text):
    void CHARACTER::ChannelSwitch(int iNewChannel){

            long lAddr, lMapIndex;
            WORD wPort;
           
            long x = GetX();
            long y = GetY();
           
            if (!CMapLocation::Instance().Get(x, y, lMapIndex, lAddr, wPort))
            {
                    sys_err("[SCHIMBA CH]Nu s-a gasit locatia acestei mape: mapindex[%ld] x[%ld] y[%ld] name[%s]", lMapIndex, x, y, GetName());
                    return;
            }
           
            if (lMapIndex >= 10000)
                    return;
           
            std::map<WORD, BYTE> ChannelsPorts;
            for (BYTE i = 0; i < 2; i++)
            {
                    for (BYTE j = 1; j < 3; j++)
                            ChannelsPorts[273 * 100 + (i * 10) + j] = i + 1;
            }
           
            int iChannel = ChannelsPorts.find(wPort) != ChannelsPorts.end() ? ChannelsPorts[wPort] : 0;
           
            if (iChannel == 0)
            {
                    sys_err("[SCHIMBA CH]Acest port nu este valabil (%d)", wPort);
                    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 * (iChannel - 1) + 100 * (iNewChannel - 1));
           
            GetDesc()->Packet(&p, sizeof(TPacketGCWarp));
    }
     
    • Like Like x 3
  9. VegaS™

    VegaS™ Premium User Premium User Ex-Staff Member
    • 243/263

    Joined:
    Nov 17, 2015
    Messages:
    227
    Likes Received:
    4,433
    Gender:
    Male
    4jJvJDr.jpg


    DOWNLOAD:

    Hidden Content:
    **Hidden Content: You must click 'Like' before you can see the hidden data contained here.**
     

    Attached Files:

    • Like Like x 118
    • Dislike Dislike x 4
  10. Nalhorg

    Nalhorg Freak member Member
    • 8/66

    Joined:
    May 3, 2016
    Messages:
    61
    Likes Received:
    8
    Gender:
    Male
    Wow nice I go to check this soon ;)
     
  11. naosou

    naosou Freak member Member
    • 8/66

    Joined:
    Apr 23, 2016
    Messages:
    51
    Likes Received:
    20
    Gender:
    Male
    Pretty nice.
     
  12. theprnce

    theprnce Freak member Member
    • 3/66

    Joined:
    Feb 11, 2016
    Messages:
    27
    Likes Received:
    3
    Gender:
    Male
    thank you
     
  13. LuciMld1

    LuciMld1 Freak level 0 Member
    • 18/66

    Joined:
    Jun 8, 2016
    Messages:
    78
    Likes Received:
    56
    Gender:
    Male
    Merge pe 2089m?
     
    • Old Old x 1
  14. VegaS™

    VegaS™ Premium User Premium User Ex-Staff Member
    • 243/263

    Joined:
    Nov 17, 2015
    Messages:
    227
    Likes Received:
    4,433
    Gender:
    Male
    No
     
  15. ShadowsPR0

    ShadowsPR0 Freak member Member
    • 83/131

    Joined:
    Mar 1, 2016
    Messages:
    57
    Likes Received:
    581
    Cum configurez porturile daca am patternul la porturi diferit de ex 1300 , 1600 si 17000 ?
     
  16. babh222

    babh222 Freak member Member
    • 6/66

    Joined:
    Jun 3, 2016
    Messages:
    41
    Likes Received:
    0
    very nice think u
     
  17. nawciak

    nawciak Freak member Member
    • 3/66

    Joined:
    Jul 27, 2016
    Messages:
    22
    Likes Received:
    2
    nice I go to check this
     
  18. Octavian

    Octavian Freak member Member
    • 8/66

    Joined:
    May 9, 2016
    Messages:
    49
    Likes Received:
    1
    Gender:
    Male
    Daca folosesc comanda /ch

    Numele de sus, ramane cu CH1, chiar daca ma duc pe ch3..
     
  19. [GA]UniX

    [GA]UniX Freak member Member
    • 8/66

    Joined:
    Aug 12, 2016
    Messages:
    42
    Likes Received:
    2
    Gender:
    Male
    Foarte frumos, multumim Vegas:Kiss !!
     
  20. ImBacK

    ImBacK Freak member Member
    • 3/66

    Joined:
    May 2, 2016
    Messages:
    6
    Likes Received:
    1
    Gender:
    Male

Share This Page

Loading...