SOL
SAĞ
[C++] Metin2 pvp Uzaktan Ticaret
SİDEBAR REKLAMI

game/exchange.cpp
 

Kod:

if (iDist >= EXCHANGE_MAX_DISTANCE)
    return false;

Kod:

//if (iDist >= EXCHANGE_MAX_DISTANCE)
   // return false;



Şeklinde Ayarla.

game.py aç

 

Kod:

def __ServerCommand_Build(self):
        serverCommandList={



Altına ekle
 

Kod:

"sistem_negot_map"    : self.__sistem_negot_map,
"sistem_negot_verificare_nume"        : self.__Sistem_negot_verificare_nume,
"sistem_negot_deschidere_fereastra"    : self.__sistem_negot_deschidere_fereastra,



Herhangi bir yere ekleyin.
 

Kod:

def __Sistem_negot_verificare_nume(self):

Kod:

        net.SendQuestInputStringPacket(str(constInfo.Negot  FereastraNume))


    def __sistem_negot_map(self, questindex):
        constInfo.sistem_negot_map = questindex


    def __sistem_negot_deschidere_fereastra(self, vid):
        player_vid = int(vid)
        net.SendExchangeStartPacket(player_vid)


    def __DeschidereFereastra(self):
        self.Fereastra_Negot_Map_Fereastra2 = ui.BoardWithTitleBar()
        self.Fereastra_Negot_Map_Fereastra2.SetSize(210, 115)
        self.Fereastra_Negot_Map_Fereastra2.SetCenterPosit  ion()
        self.Fereastra_Negot_Map_Fereastra2.AddFlag('float  ')
        self.Fereastra_Negot_Map_Fereastra2.AddFlag('movab  le')
        self.Fereastra_Negot_Map_Fereastra2.SetTitleName("Comertul cu un player")#titlu fereastra
        self.Fereastra_Negot_Map_Fereastra2.Show()


        self.Fereastra_Negot_Map_Text = ui.TextLine()
        self.Fereastra_Negot_Map_Text.SetParent(self.Ferea  stra_Negot_Map_Fereastra2)
        self.Fereastra_Negot_Map_Text.SetText("        Introdu numele jucatorului")
        self.Fereastra_Negot_Map_Text.SetPosition(7,27)
        self.Fereastra_Negot_Map_Text.SetFontColor(1.0, 1.0, 1.0)#modificare culoare text
        self.Fereastra_Negot_Map_Text.Show()


        self.Fereastra_Negot_Map_Value1 = ui.SlotBar()
        self.Fereastra_Negot_Map_Value1.SetParent(self.Fer  eastra_Negot_Map_Fereastra2)
        self.Fereastra_Negot_Map_Value1.SetSize(120, 18)
        self.Fereastra_Negot_Map_Value1.SetPosition(50, 50)
        self.Fereastra_Negot_Map_Value1.Show()


        self.Fereastra_Negot_Map_Value = ui.EditLine()
        self.Fereastra_Negot_Map_Value.SetParent(self.Fere  astra_Negot_Map_Value1)
        self.Fereastra_Negot_Map_Value.SetSize(120, 18)
        self.Fereastra_Negot_Map_Value.SetPosition(4, 1)
        self.Fereastra_Negot_Map_Value.SetMultiLine()
        self.Fereastra_Negot_Map_Value.SetMax(12)
        self.Fereastra_Negot_Map_Value.SetText("")
        self.Fereastra_Negot_Map_Value.SetFocus()
        self.Fereastra_Negot_Map_Value.Show()


        self.Fereastra_Negot_Map_Test1 = ui.Button()
        self.Fereastra_Negot_Map_Test1.SetEvent(self.__Ope  nFereastra_Negot_Map_Fereastra2)
        self.Fereastra_Negot_Map_Test1.SetParent(self.Fere  astra_Negot_Map_Fereastra2)
        self.Fereastra_Negot_Map_Test1.SetPosition(10, 75)
        self.Fereastra_Negot_Map_Test1.SetUpVisual("d:/ymir work/ui/public/XLarge_Button_01.sub")
        self.Fereastra_Negot_Map_Test1.SetOverVisual("d:/ymir work/ui/public/XLarge_button_02.sub")
        self.Fereastra_Negot_Map_Test1.SetDownVisual("d:/ymir work/ui/public/XLarge_button_03.sub")
        self.Fereastra_Negot_Map_Test1.SetText("Initiealizeaza Comertul")
        self.Fereastra_Negot_Map_Test1.Show()


Yukarıdakinin altına ekleyin
 

Kod:

 def __OpenFereastra_Negot_Map_Fereastra2(self):        import event
        ExName = self.Fereastra_Negot_Map_Value.GetText()
        if self.__ProtectieNegot():
            chat.AppendChat(1, "[SERVER] Bu haritada yapamazsın!") 
            return    
        if len(ExName) >= 4:
            self.Fereastra_Negot_Map_Fereastra2.Hide()
            constInfo.NegotFereastraNume = ExName
            event.QuestButtonClick(int(constInfo.sistem_negot_  map))
        else: #inchidere fereastra in caz ca protectia a fost activata - fereastra activa
            self.Fereastra_Negot_Map_Text.SetText("En az 4 karakter girmelisim!")
            self.Fereastra_Negot_Map_Text.SetFontColor(1.0, 0.0, 0.0) 
  
    def __ProtectieNegot(self):
        protectie_mape = [
            "season1/metin2_map_oxevent",
            "mape_dungeon/metin2_map_skipia_dungeon_boss",
            "mape_dungeon/metin2_map_skipia_dungeon_boss2",
            "mape_dungeon/metin2_map_devilsCatacomb",
            "mape_dungeon/metin2_map_deviltower1",
            "mape_vegas/metin2_map_wedding_01",
            "mape_dungeon/metin2_map_spiderdungeon_02",
            "mape_beta/Metin2_map_CapeDragonHead",
            "mape_beta/metin2_map_Mt_Thunder",
            "mape_beta/metin2_map_dawnmistwood",
            "mape_beta/metin2_map_BayBlackSand",
            "mape_noi/farmmap1",
            "mape_dungeon/metin2_map_spiderdungeon_03",  
            "mape_vegas/metin2_map_duel",
            "mape_dungeon/metin2_map_n_flame_dungeon_01",
            "mape_dungeon/metin2_map_n_snow_dungeon_01"
        ]
        if str(background.GetCurrentMapName()) in protectie_mape: 
            return TRUE

        return FALSE



uiexchange.py açılır
 

Kod:

 def OpenDialog(self):



Altına eklenir
 

Kod:

def OpenDialog(self):        self.TitleName.SetText(localeInfo.EXCHANGE_TITLE % (exchange.GetNameFromTarget()))
        if exchange.GetNameFromTarget() == "":
            import constInfo
            self.TitleName.SetText(localeInfo.EXCHANGE_TITLE % (str(constInfo.NegotFereastraNume)))
        self.AcceptButton.Enable()
        self.AcceptButton.SetUp()
        self.Show()



        (self.xStart, self.yStart, z) = player.GetMainCharacterPosition()



costinfo.py açılır herhangi bir yere ekle
 

Kod:

NegotFereastraVid = 0NegotFereastraNume = "Kimle Ticaret Yapacaksın?"
sistem_negot_map = 0



Game.py açılır

Arat

Kod:

def __ServerCommand_Build(self):
        serverCommandList={



Altına ekle
 

Kod:


 

Kod:

"getinputbegin"            : self.__Input_Get_Vegas_1,"getinputend"            : self.__Input_Get_Vegas_2,
"getinput"            : self.__Input_Get_Vegas_3,



En Alta ekleyin.
 

Kod:

def __Input_Get_Vegas_1(self):        constInfo.INPUT_IGNORE = 1


    def __Input_Get_Vegas_2(self):
        constInfo.INPUT_IGNORE = 0


    def __Input_Get_Vegas_3(self):

        net.SendQuestInputStringPacket("1")




Game.py açılır
 

Kod:

def OpenQuestWindow(self, skin, idx):



yukarıdaki kod bloğu ile değiştir,
 

Kod:

def OpenQuestWindow(self, skin, idx):        if constInfo.INPUT_IGNORE == 1:
            return
        else:

            self.interface.OpenQuestWindow(skin, idx)

constinfo.py aç
 

Kod:

INPUT_IGNORE = 0

Ekle ( Ekli değilse ekleyin )

game.py Arat

 

Kod:

def __BuildKeyDict(self):
        onPressKeyDict = {}



Altına ekle

Kod:

onPressKeyDict[app.DIK_F6]    = lambda : self.__DeschidereFereastra()





Son olarak uzaktantic.quest oluşturun ve okutun..
 

Kod:

quest sistem_negot begin
    state start begin
        function GetName()
            cmdchat("getinputbegin")
            name = input(cmdchat("sistem_negot_verificare_nume"))
            cmdchat("getinputend")
            return name
        end
       
        function GetVid(n)
            local name = n
            local vid = find_pc_by_name(name)
            if name == "" then return end
            if name == pc.get_name() then return end
            if vid == 0 then return end
            local myvid = pc.select(vid)
            local vicvid = pc.get_vid()
            pc.select(myvid)
            return tonumber(vicvid)
        end
       
        when login begin
            cmdchat("sistem_negot_map "..q.getcurrentquestindex())
        end
       
        when button or info begin
            local name = sistem_negot.GetName()
            local vid = sistem_negot.GetVid(name)
            cmdchat("sistem_negot_deschidere_fereastra "..vid.."")
        end
    end
end
YAZAR HAKKINDA;
arcface
Admin

Web Developer

KONU YORUMLARI
YORUM YAP
Image

C++ / C# / Python

[C++] Metin2 pvp Uzaktan Ticaret

[C++] Metin2 pvp Uzaktan Ticaret [C++] Metin2 pvp Uzaktan Ticaret [C++] Metin2 pvp Uzaktan Ticaret [C++] Metin2 pvp Uzaktan Ticaret [C++] Metin2 pvp Uzaktan Ticaret [C++] Metin2 pvp Uzaktan Ticaret

EN ÇOK OKUNAN 5 MAKALELER
arcface
Admin Yazdı;

3 ay önce

Yarı insan denilince ne anlıyoruz önce ona bir bakalım. Yarı insan; bi..

arcface
Admin Yazdı;

2 ay önce

Rubinum2 Web Panel Rubinum2 Web Panel Rubinum2 Web PanelRubinum2 Web..

arcface
Admin Yazdı;

2 ay önce

Afro2 Web Panel Kodlaması Afro2 Web Panel Kodlaması Afro2 Web Pane..

arcface
Admin Yazdı;

2 ay önce

Aegea2 Site Teması İndir Aegea2 Site Teması İndir Aegea2 Site Teması..

arcface
Admin Yazdı;

2 ay önce

Discord Widget Discord Widget Discord Widget Discord Widget Di..