Jump to content

Item shop New in game


Recommended Posts

Trago um novo item shop in game que saiu.  ele é pago e eu vou compartilha com você mais tem um porem kkk eu não consegui fazer ele abrir quem souber peço que coloque a solução aqui vlws.

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

Download:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

 

 

Edited by Darkness
  • Like 3
  • Thanks 1
Link to post
Share on other sites
  • 3 weeks later...
17 horas atrás, LuizFernando disse:

Funciona 100%?

amigo coloquei no meu mais não consegui abrir o shop e como falei se alguém souber configurar o botão deixe a solução aqui

código do botão pelo que vi na .py é : self.wndItemShop

Link to post
Share on other sites
  • 2 months later...

EDIT:   # PROBLEM SOLVED !

 

 

 

Any one can help me out with this ??  

 

Adding this to my game: 

Quote

# sob def __ServerCommand_Build(self): Adicionar

        self.serverCommander.SAFE_RegisterCallBack("ClearItemShop", self.__ClearItemShop)
        self.serverCommander.SAFE_RegisterCallBack("RecvItemShop", self.__RecvItemShop)
        self.serverCommander.SAFE_RegisterCallBack("RefreshItemShop", self.__RefreshItemShop)
        self.serverCommander.SAFE_RegisterCallBack("UpdateItemShopMoney", self.__UpdateItemShopMoney)
        self.serverCommander.SAFE_RegisterCallBack("FortuneWheelItem", self.__FortuneWheelItem)
        self.serverCommander.SAFE_RegisterCallBack("FortuneWheelConfig", self.__FortuneWheelConfig)

# Adicione abaixo
    def __FortuneWheelConfig(self, arg1, arg2):
        if (self.interface):
            self.interface.FortuneWheel("config", (int(arg1), int(arg2)))
        
    def __FortuneWheelItem(self, arg1, arg2, arg3):
        if (self.interface):
            self.interface.FortuneWheel("item", (int(arg1), int(arg2), int(arg3)))

    def __UpdateItemShopMoney(self, type, money):
        if (self.interface):
            self.interface.UpdateItemShopMoney(type, int(money))
        
    def __ClearItemShop(self):
        if (self.interface):
            self.interface.ClearItemShop()

    def __RecvItemShop(self, category, number, itemVnum, count, price, currency):
        if (self.interface):
            self.interface.RecvItemShop(int(category), int(number), int(itemVnum), int(count), int(price), int(currency))
            
    def __RefreshItemShop(self):
        if (self.interface):
            self.interface.RefreshItemShop()

But my sysser is not great and my client going down :

Quote

0325 15:55:14554 :: Traceback (most recent call last):

0325 15:55:14554 ::   File "networkModule.py", line 247, in SetGamePhase

0325 15:55:14554 ::   File "game.py", line 127, in __init__

0325 15:55:14554 ::   File "game.py", line 1903, in __ServerCommand_Build

0325 15:55:14554 :: AttributeError
0325 15:55:14555 :: : 
0325 15:55:14555 :: 'GameWindow' object has no attribute 'serverCommander'
0325 15:55:14555 :: 

 

MY GAME.PY

 

Quote

    def __ServerCommand_Build(self):
        
        self.serverCommander.SAFE_RegisterCallBack("ClearItemShop", self.__ClearItemShop)
        self.serverCommander.SAFE_RegisterCallBack("RecvItemShop", self.__RecvItemShop)
        self.serverCommander.SAFE_RegisterCallBack("RefreshItemShop", self.__RefreshItemShop)
        self.serverCommander.SAFE_RegisterCallBack("UpdateItemShopMoney", self.__UpdateItemShopMoney)
        self.serverCommander.SAFE_RegisterCallBack("FortuneWheelItem", self.__FortuneWheelItem)
        self.serverCommander.SAFE_RegisterCallBack("FortuneWheelConfig", self.__FortuneWheelConfig)
        
        serverCommandList={
            "ConsoleEnable"            : self.__Console_Enable,
            "DayMode"                : self.__DayMode_Update, 
            "PRESERVE_DayMode"        : self.__PRESERVE_DayMode_Update, 
            "CloseRestartWindow"    : self.__RestartDialog_Close,
            "OpenPrivateShop"        : self.__PrivateShop_Open,
            "PartyHealReady"        : self.PartyHealReady,
            "ShowMeSafeboxPassword"    : self.AskSafeboxPassword,
            "CloseSafebox"            : self.CommandCloseSafebox,

            # ITEM_MALL
            "CloseMall"                : self.CommandCloseMall,
            "ShowMeMallPassword"    : self.AskMallPassword,
            "item_mall"                : self.__ItemMall_Open,
            # END_OF_ITEM_MALL

            "RefineSuceeded"        : self.RefineSuceededMessage,
            "RefineFailed"            : self.RefineFailedMessage,
            "xmas_snow"                : self.__XMasSnow_Enable,
            "xmas_boom"                : self.__XMasBoom_Enable,
            "xmas_song"                : self.__XMasSong_Enable,
            "xmas_tree"                : self.__XMasTree_Enable,
            "newyear_boom"            : self.__XMasBoom_Enable,
            "PartyRequest"            : self.__PartyRequestQuestion,
            "PartyRequestDenied"    : self.__PartyRequestDenied,
            "horse_state"            : self.__Horse_UpdateState,
            "hide_horse_state"        : self.__Horse_HideState,
            "WarUC"                    : self.__GuildWar_UpdateMemberCount,
            "test_server"            : self.__EnableTestServerFlag,
            "mall"            : self.__InGameShop_Show,

            # WEDDING
            "lover_login"            : self.__LoginLover,
            "lover_logout"            : self.__LogoutLover,
            "lover_near"            : self.__LoverNear,
            "lover_far"                : self.__LoverFar,
            "lover_divorce"            : self.__LoverDivorce,
            "PlayMusic"                : self.__PlayMusic,
            # END_OF_WEDDING

            # PRIVATE_SHOP_PRICE_LIST
            "MyShopPriceList"        : self.__PrivateShop_PriceList,
            # END_OF_PRIVATE_SHOP_PRICE_LIST
        }
        
        self.serverCommander=stringCommander.Analyzer()
        for serverCommandItem in serverCommandList.items():
            self.serverCommander.SAFE_RegisterCallBack(
                serverCommandItem[0], serverCommandItem[1]
            )

    def BINARY_ServerCommand_Run(self, line):
        #dbg.TraceError(line)
        try:
            #print " BINARY_ServerCommand_Run", line
            return self.serverCommander.Run(line)
        except RuntimeError, msg:
            dbg.TraceError(msg)
            return 0

    def __ProcessPreservedServerCommand(self):
        try:
            command = net.GetPreservedServerCommand()
            while command:
                print " __ProcessPreservedServerCommand", command
                self.serverCommander.Run(command)
                command = net.GetPreservedServerCommand()
        except RuntimeError, msg:
            dbg.TraceError(msg)
            return 0

    def PartyHealReady(self):
        self.interface.PartyHealReady()

    def AskSafeboxPassword(self):
        self.interface.AskSafeboxPassword()

    # ITEM_MALL
    def AskMallPassword(self):
        self.interface.AskMallPassword()

    def __ItemMall_Open(self):
        self.interface.OpenItemMall();

    def CommandCloseMall(self):
        self.interface.CommandCloseMall()
    # END_OF_ITEM_MALL

    def RefineSuceededMessage(self):
        snd.PlaySound("sound/ui/make_soket.wav")
        self.PopupMessage(localeInfo.REFINE_SUCCESS)

    def RefineFailedMessage(self):
        snd.PlaySound("sound/ui/jaeryun_fail.wav")
        self.PopupMessage(localeInfo.REFINE_FAILURE)

    def CommandCloseSafebox(self):
        self.interface.CommandCloseSafebox()

    # PRIVATE_SHOP_PRICE_LIST
    def __PrivateShop_PriceList(self, itemVNum, itemPrice):
        uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice)    
    # END_OF_PRIVATE_SHOP_PRICE_LIST

    def __Horse_HideState(self):
        self.affectShower.SetHorseState(0, 0, 0)

    def __Horse_UpdateState(self, level, health, battery):
        self.affectShower.SetHorseState(int(level), int(health), int(battery))

    def __IsXMasMap(self):
        mapDict = ( "metin2_map_n_flame_01",
                    "metin2_map_n_desert_01",
                    "metin2_map_spiderdungeon",
                    "metin2_map_deviltower1", )

        if background.GetCurrentMapName() in mapDict:
            return False

        return True

    def __XMasSnow_Enable(self, mode):

        self.__XMasSong_Enable(mode)

        if "1"==mode:

            if not self.__IsXMasMap():
                return

            print "XMAS_SNOW ON"
            background.EnableSnow(1)

        else:
            print "XMAS_SNOW OFF"
            background.EnableSnow(0)

    def __XMasBoom_Enable(self, mode):
        if "1"==mode:

            if not self.__IsXMasMap():
                return

            print "XMAS_BOOM ON"
            self.__DayMode_Update("dark")
            self.enableXMasBoom = True
            self.startTimeXMasBoom = app.GetTime()
        else:
            print "XMAS_BOOM OFF"
            self.__DayMode_Update("light")
            self.enableXMasBoom = False

    def __XMasTree_Enable(self, grade):

        print "XMAS_TREE ", grade
        background.SetXMasTree(int(grade))

    def __XMasSong_Enable(self, mode):
        if "1"==mode:
            print "XMAS_SONG ON"

            XMAS_BGM = "xmas.mp3"

            if app.IsExistFile("BGM/" + XMAS_BGM)==1:
                if musicInfo.fieldMusic != "":
                    snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)

                musicInfo.fieldMusic=XMAS_BGM
                snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)

        else:
            print "XMAS_SONG OFF"

            if musicInfo.fieldMusic != "":
                snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)

            musicInfo.fieldMusic=musicInfo.METIN2THEMA
            snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)

    def __RestartDialog_Close(self):
        self.interface.CloseRestartDialog()

    def __Console_Enable(self):
        constInfo.CONSOLE_ENABLE = True
        self.consoleEnable = True
        app.EnableSpecialCameraMode()
        ui.EnablePaste(True)

    ## PrivateShop
    def __PrivateShop_Open(self):
        self.interface.OpenPrivateShopInputNameDialog()

    def BINARY_PrivateShop_Appear(self, vid, text):
        self.interface.AppearPrivateShop(vid, text)

    def BINARY_PrivateShop_Disappear(self, vid):
        self.interface.DisappearPrivateShop(vid)

    ## DayMode
    def __PRESERVE_DayMode_Update(self, mode):
        if "light"==mode:
            background.SetEnvironmentData(0)
        elif "dark"==mode:

            if not self.__IsXMasMap():
                return

            background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
            background.SetEnvironmentData(1)

    def __DayMode_Update(self, mode):
        if "light"==mode:
            self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToLight)
        elif "dark"==mode:

            if not self.__IsXMasMap():
                return

            self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToDark)

    def __DayMode_OnCompleteChangeToLight(self):
        background.SetEnvironmentData(0)
        self.curtain.FadeIn()

    def __DayMode_OnCompleteChangeToDark(self):
        background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
        background.SetEnvironmentData(1)
        self.curtain.FadeIn()

    ## XMasBoom
    def __XMasBoom_Update(self):

        self.BOOM_DATA_LIST = ( (2, 5), (5, 2), (7, 3), (10, 3), (20, 5) )
        if self.indexXMasBoom >= len(self.BOOM_DATA_LIST):
            return

        boomTime = self.BOOM_DATA_LIST[self.indexXMasBoom][0]
        boomCount = self.BOOM_DATA_LIST[self.indexXMasBoom][1]

        if app.GetTime() - self.startTimeXMasBoom > boomTime:

            self.indexXMasBoom += 1

            for i in xrange(boomCount):
                self.__XMasBoom_Boom()

    def __XMasBoom_Boom(self):
        x, y, z = player.GetMainCharacterPosition()
        randX = app.GetRandom(-150, 150)
        randY = app.GetRandom(-150, 150)

        snd.PlaySound3D(x+randX, -y+randY, z, "sound/common/etc/salute.mp3")

    def __PartyRequestQuestion(self, vid):
        vid = int(vid)
        partyRequestQuestionDialog = uiCommon.QuestionDialog()
        partyRequestQuestionDialog.SetText(chr.GetNameByVID(vid) + localeInfo.PARTY_DO_YOU_ACCEPT)
        partyRequestQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT)
        partyRequestQuestionDialog.SetCancelText(localeInfo.UI_DENY)
        partyRequestQuestionDialog.SetAcceptEvent(lambda arg=True: self.__AnswerPartyRequest(arg))
        partyRequestQuestionDialog.SetCancelEvent(lambda arg=False: self.__AnswerPartyRequest(arg))
        partyRequestQuestionDialog.Open()
        partyRequestQuestionDialog.vid = vid
        self.partyRequestQuestionDialog = partyRequestQuestionDialog

    def __AnswerPartyRequest(self, answer):
        if not self.partyRequestQuestionDialog:
            return

        vid = self.partyRequestQuestionDialog.vid

        if answer:
            net.SendChatPacket("/party_request_accept " + str(vid))
        else:
            net.SendChatPacket("/party_request_deny " + str(vid))

        self.partyRequestQuestionDialog.Close()
        self.partyRequestQuestionDialog = None

    def __PartyRequestDenied(self):
        self.PopupMessage(localeInfo.PARTY_REQUEST_DENIED)

    def __EnableTestServerFlag(self):
        app.EnableTestServerFlag()

    def __InGameShop_Show(self, url):
        if constInfo.IN_GAME_SHOP_ENABLE:
            self.interface.OpenWebWindow(url)

    # WEDDING
    def __LoginLover(self):
        if self.interface.wndMessenger:
            self.interface.wndMessenger.OnLoginLover()

    def __LogoutLover(self):
        if self.interface.wndMessenger:
            self.interface.wndMessenger.OnLogoutLover()
        if self.affectShower:
            self.affectShower.HideLoverState()

    def __LoverNear(self):
        if self.affectShower:
            self.affectShower.ShowLoverState()

    def __LoverFar(self):
        if self.affectShower:
            self.affectShower.HideLoverState()

    def __LoverDivorce(self):
        if self.interface.wndMessenger:
            self.interface.wndMessenger.ClearLoverInfo()
        if self.affectShower:
            self.affectShower.ClearLoverState()

    def __PlayMusic(self, flag, filename):
        flag = int(flag)
        if flag:
            snd.FadeOutAllMusic()
            musicInfo.SaveLastPlayFieldMusic()
            snd.FadeInMusic("BGM/" + filename)
        else:
            snd.FadeOutAllMusic()
            musicInfo.LoadLastPlayFieldMusic()
            snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)

    # END_OF_WEDDING
    
    def __FortuneWheelConfig(self, arg1, arg2):
        if (self.interface):
            self.interface.FortuneWheel("config", (int(arg1), int(arg2)))
        
    def __FortuneWheelItem(self, arg1, arg2, arg3):
        if (self.interface):
            self.interface.FortuneWheel("item", (int(arg1), int(arg2), int(arg3)))

    def __UpdateItemShopMoney(self, type, money):
        if (self.interface):
            self.interface.UpdateItemShopMoney(type, int(money))
        
    def __ClearItemShop(self):
        if (self.interface):
            self.interface.ClearItemShop()

    def __RecvItemShop(self, category, number, itemVnum, count, price, currency):
        if (self.interface):
            self.interface.RecvItemShop(int(category), int(number), int(itemVnum), int(count), int(price), int(currency))
            
    def __RefreshItemShop(self):
        if (self.interface):
            self.interface.RefreshItemShop()    

 

Much appreciate for your help guys 

Edited by frogen1145
Link to post
Share on other sites
  • 1 year later...

game.py

procurar:

serverCommandList["BINARY_OpenAnnouncementWindow"] = self.BINARY_OpenAnnouncementWindow

Verificar se esta igual ou parecido:

        self.serverCommander=stringCommander.Analyzer()
        for serverCommandItem in serverCommandList.items():
            self.serverCommander.SAFE_RegisterCallBack(
                serverCommandItem[0], serverCommandItem[1]
            )

    def BINARY_ServerCommand_Run(self, line):
        #dbg.TraceError(line)
        try:
            #print " BINARY_ServerCommand_Run", line
            return self.serverCommander.Run(line)
        except RuntimeError, msg:
            dbg.TraceError(msg)
            return 0

    def __ProcessPreservedServerCommand(self):
        try:
            command = net.GetPreservedServerCommand()
            while command:
                print " __ProcessPreservedServerCommand", command
                self.serverCommander.Run(command)
                command = net.GetPreservedServerCommand()
        except RuntimeError, msg:
            dbg.TraceError(msg)
            return 0

 

servercommandparser.py

procurar:

def __PreserveCommand(self, line):

verificar acima :

 

        self.serverCommander=stringCommander.Analyzer()
        for serverCommandItem in serverCommandList.items():
            self.serverCommander.SAFE_RegisterCallBack(
                serverCommandItem[0], serverCommandItem[1]
            )

    def BINARY_ServerCommand_Run(self, line):
        try:
            print " BINARY_ServerCommand_Reserve", line
            return self.serverCommander.Run(line)
        except RuntimeError, msg:
            import dbg
            dbg.TraceError(msg)
            return 0

Edited by Metin2
Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...