Schimbare CH

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
Dragos9091
Nivel 3

Nivel 3
Mesaje: 303
Membru din: 02 Dec 2013, 19:03
Regat: Chunjo
Aprecieri: 6  
Mulţumiri: 7  
 Contact:
Medalii

salutare ,

am facut acest sistem http://just4metin.ro/altele/schimba-far ... 37220.html

dar problemele sunt 2 ..

1- nu ma teleporteaza pe celalalt ch
2- nu mai dispare ala de schimbare chiar daca dau X

Ma poate ajuta cineva ?
No stress , No problem
RESPECTA SI VEI FI RESPECTAT!
Afișează semnătura
Avatar utilizator
Pongo A.K.A Titan
Utilizator interzis !

Utilizator interzis !
Mesaje: 2028
Membru din: 01 Sep 2016, 16:08
Regat: Jinno
Aprecieri: 35  
Mulţumiri: 261  
 Contact:
Medalii

baga in root
https://mega.nz/#!bEYknICa!buI8MmRZwT8A ... i4yaRzCrgw
Deschide uisystem.py și adaugă:
import channel
cauta
self.GetChild("system_option_button").SAFE_SetEvent(self.__ClickSystemOptionButton)
adauga m-ai jos
self.GetChild("change_ch_button").SAFE_SetEvent(self.__ClickChangeChannelButton)
cauta functia
def __ClickGameOptionButton(self):
        self.Close()

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

        self.gameOptionDlg.Show()
adauga m-ai jos
def __ClickChangeChannelButton(self):
        self.Close()
        import channel
        vegas = channel.Titan2_Channel_Changer()
        vegas.Open()
Deschide constInfo.py și adaugă:
change_time = 0
acuma deschide systemdialog.py. din locale
cauta
{
                    "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",
                },
adauga m-ai jos
{
                    "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",
                },
gata cu partea python acuma avem parte c++
Deschide cmd.cpp și caută:

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

Code:
ACMD(do_set_walk_mode)
{
    ch->SetNowWalking(true);
    ch->SetWalking(true);
}
//Mai jos adaugă:
UnHidden Content:
Code:
ACMD(do_ch)
{
    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)
        return;

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

    ch->ChannelSwitch(new_ch);
}
Deschide char.h și caută:

Code:
        void                StartWarpNPCEvent();
//Mai jos adaugă:
UnHidden Content:
Code:
        void                ChannelSwitch(int new_ch);    
Deschide char.cpp și caută:

Code:
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ă:

UnHidden Content:
HTML:
void CHARACTER::ChannelSwitch(int iNewChannel){

    long lAddr;
    long lMapIndex;
    WORD wPort;
    long x = this->GetX();
    long y = this->GetY();

    if (!CMapLocation::instance().Get(x, y, lMapIndex, lAddr, wPort))
    {
        return;
    }

    if(lMapIndex >= 10000){
        return;
    }

    std::map<WORD, int>ch;

    for(int i = 0; i < 4; i++){
        for(int i2 = 1; i2 < 9; i2++){
            ch[29*1000 + i*100 + i2] = i+1;
        }
    }
    int chan;
    if(ch.find(wPort) != ch.end()){
        chan = ch[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*(iNewChannel-1));

    GetDesc()->Packet(&p, sizeof(TPacketGCWarp));
}
Porturi:

CH1:
Core1: 29001
Core2: 29002
Core3: 29003
Core4: 29004

CH2:
Core1: 29101
Core2: 29102
Core3: 29103
Core4: 29104

CH3:
Core1: 29201
Core2: 29202
Core3: 29203
Core4: 29204
Click to expand...
etc..

Code:
for(int i = 0; i < 4; i++){
 ! Mesaj de la: Pongo A.K.A Titan
Cand credeati ca am sa mor
M-am ridicat ca un invingator
Afișează semnătura
Avatar utilizator
Dragos9091
Nivel 3

Nivel 3
Mesaje: 303
Membru din: 02 Dec 2013, 19:03
Regat: Chunjo
Aprecieri: 6  
Mulţumiri: 7  
 Contact:
Medalii

Pongo scrie:baga in root
https://mega.nz/#!bEYknICa!buI8MmRZwT8A ... i4yaRzCrgw
Deschide uisystem.py și adaugă:
import channel
cauta
self.GetChild("system_option_button").SAFE_SetEvent(self.__ClickSystemOptionButton)
adauga m-ai jos
self.GetChild("change_ch_button").SAFE_SetEvent(self.__ClickChangeChannelButton)
cauta functia
def __ClickGameOptionButton(self):
        self.Close()

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

        self.gameOptionDlg.Show()
adauga m-ai jos
def __ClickChangeChannelButton(self):
        self.Close()
        import channel
        vegas = channel.Titan2_Channel_Changer()
        vegas.Open()
Deschide constInfo.py și adaugă:
change_time = 0
acuma deschide systemdialog.py. din locale
cauta
{
                    "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",
                },
adauga m-ai jos
{
                    "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",
                },
gata cu partea python acuma avem parte c++
Deschide cmd.cpp și caută:

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

Code:
ACMD(do_set_walk_mode)
{
    ch->SetNowWalking(true);
    ch->SetWalking(true);
}
//Mai jos adaugă:
UnHidden Content:
Code:
ACMD(do_ch)
{
    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)
        return;

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

    ch->ChannelSwitch(new_ch);
}
Deschide char.h și caută:

Code:
        void                StartWarpNPCEvent();
//Mai jos adaugă:
UnHidden Content:
Code:
        void                ChannelSwitch(int new_ch);    
Deschide char.cpp și caută:

Code:
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ă:

UnHidden Content:
HTML:
void CHARACTER::ChannelSwitch(int iNewChannel){

    long lAddr;
    long lMapIndex;
    WORD wPort;
    long x = this->GetX();
    long y = this->GetY();

    if (!CMapLocation::instance().Get(x, y, lMapIndex, lAddr, wPort))
    {
        return;
    }

    if(lMapIndex >= 10000){
        return;
    }

    std::map<WORD, int>ch;

    for(int i = 0; i < 4; i++){
        for(int i2 = 1; i2 < 9; i2++){
            ch[29*1000 + i*100 + i2] = i+1;
        }
    }
    int chan;
    if(ch.find(wPort) != ch.end()){
        chan = ch[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*(iNewChannel-1));

    GetDesc()->Packet(&p, sizeof(TPacketGCWarp));
}
Porturi:

CH1:
Core1: 29001
Core2: 29002
Core3: 29003
Core4: 29004

CH2:
Core1: 29101
Core2: 29102
Core3: 29103
Core4: 29104

CH3:
Core1: 29201
Core2: 29202
Core3: 29203
Core4: 29204
Click to expand...
etc..

Code:
for(int i = 0; i < 4; i++){

Ultima parte in char.cpp nu cred ca e completa
No stress , No problem
RESPECTA SI VEI FI RESPECTAT!
Afișează semnătura
Avatar utilizator
Dragos9091
Nivel 3

Nivel 3
Mesaje: 303
Membru din: 02 Dec 2013, 19:03
Regat: Chunjo
Aprecieri: 6  
Mulţumiri: 7  
 Contact:
Medalii

UP cineva ?
No stress , No problem
RESPECTA SI VEI FI RESPECTAT!
Afișează semnătura
Avatar utilizator
Pongo A.K.A Titan
Utilizator interzis !

Utilizator interzis !
Mesaje: 2028
Membru din: 01 Sep 2016, 16:08
Regat: Jinno
Aprecieri: 35  
Mulţumiri: 261  
 Contact:
Medalii

Subiect inactiv arhivat !
 ! Mesaj de la: Pongo A.K.A Titan
Cand credeati ca am sa mor
M-am ridicat ca un invingator
Afișează semnătura
Închis

Înapoi la “Arhivă Probleme şi Întrebări”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Google [Bot] și 86 vizitatori