Aller au contenu
Top-Metin2.org - Vous êtes à la recherche d'un serveur Metin 2 ? ×
×
×
  • Créer...

Alan

Membre
  • Compteur de contenus

    31
  • Inscription

  • Dernière visite

Messages posté(e)s par Alan

  1. Update : L'ensemble des problèmes côté serveur semble réglé. 

    J'ai par contre un bug côté client. Je parviens à me connecter mais lorsque je click sur l'inventaire le client crash. Voici ce que j'ai dans le syserr....

    Citation

    0731 13:51:19770 :: Traceback (most recent call last):

    0731 13:51:19770 ::   File "game.py", line 2106, in BINARY_OfflineShop_UpdateOnlinePlayerCount

    0731 13:51:19770 ::   File "uiMiniMap.py", line 496, in UpdateOnlinePlayerCount

    0731 13:51:19771 :: AttributeError
    0731 13:51:19771 :: : 
    0731 13:51:19771 :: 'module' object has no attribute 'PrettyNumber'
    0731 13:51:19771 :: 

    0731 13:51:19771 :: Traceback (most recent call last):

    0731 13:51:19771 ::   File "game.py", line 2110, in BINARY_OfflineShop_UpdateOnlineShopCount

    0731 13:51:19771 ::   File "uiMiniMap.py", line 499, in UpdateOnlineShopCount

    0731 13:51:19771 :: AttributeError
    0731 13:51:19771 :: : 
    0731 13:51:19771 :: 'module' object has no attribute 'PrettyNumber'
    0731 13:51:19771 :: 

    J'ai recherché l'erreur mais je ne parviens pas à la trouver, le problème semble venir de uiminimap.py :

    Citation

    import ui
    import uiScriptLocale
    import wndMgr
    import player
    import miniMap
    import localeInfo
    import net
    import app
    import colorInfo
    import constInfo
    import background

    class MapTextToolTip(ui.Window):
        def __init__(self):            
            ui.Window.__init__(self)

            textLine = ui.TextLine()
            textLine.SetParent(self)
            textLine.SetHorizontalAlignCenter()
            textLine.SetOutline()
            textLine.SetHorizontalAlignRight()
            textLine.Show()
            self.textLine = textLine

        def __del__(self):            
            ui.Window.__del__(self)

        def SetText(self, text):
            self.textLine.SetText(text)

        def SetTooltipPosition(self, PosX, PosY):
            if localeInfo.IsARABIC():
                w, h = self.textLine.GetTextSize()
                self.textLine.SetPosition(PosX - w - 5, PosY)
            else:
                self.textLine.SetPosition(PosX - 5, PosY)

        def SetTextColor(self, TextColor):
            self.textLine.SetPackedFontColor(TextColor)

        def GetTextSize(self):
            return self.textLine.GetTextSize()

    class AtlasWindow(ui.ScriptWindow):

        class AtlasRenderer(ui.Window):
            def __init__(self):
                ui.Window.__init__(self)
                self.AddFlag("not_pick")

            def OnUpdate(self):
                miniMap.UpdateAtlas()

            def OnRender(self):
                (x, y) = self.GetGlobalPosition()
                fx = float(x)
                fy = float(y)
                miniMap.RenderAtlas(fx, fy)

            def HideAtlas(self):
                miniMap.HideAtlas()

            def ShowAtlas(self):
                miniMap.ShowAtlas()

        def __init__(self):
            self.tooltipInfo = MapTextToolTip()
            self.tooltipInfo.Hide()
            self.infoGuildMark = ui.MarkBox()
            self.infoGuildMark.Hide()
            self.AtlasMainWindow = None
            self.mapName = ""
            self.board = 0

            ui.ScriptWindow.__init__(self)

        def __del__(self):
            ui.ScriptWindow.__del__(self)

        def SetMapName(self, mapName):
            if 949==app.GetDefaultCodePage():
                try:
                    self.board.SetTitleName(localeInfo.MINIMAP_ZONE_NAME_DICT[mapName])
                except:
                    pass

        def LoadWindow(self):
            try:
                pyScrLoader = ui.PythonScriptLoader()
                pyScrLoader.LoadScriptFile(self, "UIScript/AtlasWindow.py")
            except:
                import exception
                exception.Abort("AtlasWindow.LoadWindow.LoadScript")

            try:
                self.board = self.GetChild("board")

            except:
                import exception
                exception.Abort("AtlasWindow.LoadWindow.BindObject")

            self.AtlasMainWindow = self.AtlasRenderer()
            self.board.SetCloseEvent(self.Hide)
            self.AtlasMainWindow.SetParent(self.board)
            self.AtlasMainWindow.SetPosition(7, 30)
            self.tooltipInfo.SetParent(self.board)
            self.infoGuildMark.SetParent(self.board)
            self.SetPosition(wndMgr.GetScreenWidth() - 136 - 256 - 10, 0)
            self.Hide()

            miniMap.RegisterAtlasWindow(self)

        def Destroy(self):
            miniMap.UnregisterAtlasWindow()
            self.ClearDictionary()
            self.AtlasMainWindow = None
            self.tooltipAtlasClose = 0
            self.tooltipInfo = None
            self.infoGuildMark = None
            self.board = None

        def OnUpdate(self):

            if not self.tooltipInfo:
                return

            if not self.infoGuildMark:
                return

            self.infoGuildMark.Hide()
            self.tooltipInfo.Hide()

            if False == self.board.IsIn():
                return

            (mouseX, mouseY) = wndMgr.GetMousePosition()
            (bFind, sName, iPosX, iPosY, dwTextColor, dwGuildID) = miniMap.GetAtlasInfo(mouseX, mouseY)

            if False == bFind:
                return

            if "empty_guild_area" == sName:
                sName = localeInfo.GUILD_EMPTY_AREA

            if localeInfo.IsARABIC() and sName[-1].isalnum():
                self.tooltipInfo.SetText("(%s)%d, %d" % (sName, iPosX, iPosY))                        
            else:
                self.tooltipInfo.SetText("%s(%d, %d)" % (sName, iPosX, iPosY))
                
            (x, y) = self.GetGlobalPosition()
            self.tooltipInfo.SetTooltipPosition(mouseX - x, mouseY - y)
            self.tooltipInfo.SetTextColor(dwTextColor)
            self.tooltipInfo.Show()
            self.tooltipInfo.SetTop()

            if 0 != dwGuildID:
                textWidth, textHeight = self.tooltipInfo.GetTextSize()
                self.infoGuildMark.SetIndex(dwGuildID)
                self.infoGuildMark.SetPosition(mouseX - x - textWidth - 18 - 5, mouseY - y)
                self.infoGuildMark.Show()

        def Hide(self):
            if self.AtlasMainWindow:
                self.AtlasMainWindow.HideAtlas()
                self.AtlasMainWindow.Hide()
            ui.ScriptWindow.Hide(self)

        def Show(self):
            if self.AtlasMainWindow:
                (bGet, iSizeX, iSizeY) = miniMap.GetAtlasSize()
                if bGet:
                    self.SetSize(iSizeX + 15, iSizeY + 38)

                    if localeInfo.IsARABIC():
                        self.board.SetPosition(iSizeX+15, 0)

                    self.board.SetSize(iSizeX + 15, iSizeY + 38)
                    #self.AtlasMainWindow.SetSize(iSizeX, iSizeY)
                    self.AtlasMainWindow.ShowAtlas()
                    self.AtlasMainWindow.Show()
            ui.ScriptWindow.Show(self)

        def SetCenterPositionAdjust(self, x, y):
            self.SetPosition((wndMgr.GetScreenWidth() - self.GetWidth()) / 2 + x, (wndMgr.GetScreenHeight() - self.GetHeight()) / 2 + y)

        def OnPressEscapeKey(self):
            self.Hide()
            return True

    def __RegisterMiniMapColor(type, rgb):
        miniMap.RegisterColor(type, rgb[0], rgb[1], rgb[2])

    class MiniMap(ui.ScriptWindow):

        CANNOT_SEE_INFO_MAP_DICT = {
            "metin2_map_monkeydungeon" : False,
            "metin2_map_monkeydungeon_02" : False,
            "metin2_map_monkeydungeon_03" : False,
            "metin2_map_devilsCatacomb" : False,
        }

        def __init__(self):
            ui.ScriptWindow.__init__(self)

            self.__Initialize()

            miniMap.Create()
            miniMap.SetScale(2.0)

            self.AtlasWindow = AtlasWindow()
            self.AtlasWindow.LoadWindow()
            self.AtlasWindow.Hide()

            self.tooltipMiniMapOpen = MapTextToolTip()
            self.tooltipMiniMapOpen.SetText(localeInfo.MINIMAP)
            self.tooltipMiniMapOpen.Show()
            self.tooltipMiniMapClose = MapTextToolTip()
            self.tooltipMiniMapClose.SetText(localeInfo.UI_CLOSE)
            self.tooltipMiniMapClose.Show()
            self.tooltipScaleUp = MapTextToolTip()
            self.tooltipScaleUp.SetText(localeInfo.MINIMAP_INC_SCALE)
            self.tooltipScaleUp.Show()
            self.tooltipScaleDown = MapTextToolTip()
            self.tooltipScaleDown.SetText(localeInfo.MINIMAP_DEC_SCALE)
            self.tooltipScaleDown.Show()
            self.tooltipAtlasOpen = MapTextToolTip()
            self.tooltipAtlasOpen.SetText(localeInfo.MINIMAP_SHOW_AREAMAP)
            self.tooltipAtlasOpen.Show()
            self.tooltipInfo = MapTextToolTip()
            self.tooltipInfo.Show()

            if miniMap.IsAtlas():
                self.tooltipAtlasOpen.SetText(localeInfo.MINIMAP_SHOW_AREAMAP)
            else:
                self.tooltipAtlasOpen.SetText(localeInfo.MINIMAP_CAN_NOT_SHOW_AREAMAP)

            self.tooltipInfo = MapTextToolTip()
            self.tooltipInfo.Show()

            self.mapName = ""

            self.isLoaded = 0
            self.canSeeInfo = True
            
            # AUTOBAN
            self.imprisonmentDuration = 0
            self.imprisonmentEndTime = 0
            self.imprisonmentEndTimeText = ""
            # END_OF_AUTOBAN

        def __del__(self):
            miniMap.Destroy()
            ui.ScriptWindow.__del__(self)

        def __Initialize(self):
            self.positionInfo = 0
            self.observerCount = 0

            self.OpenWindow = 0
            self.CloseWindow = 0
            self.ScaleUpButton = 0
            self.ScaleDownButton = 0
            self.MiniMapHideButton = 0
            self.MiniMapShowButton = 0
            self.AtlasShowButton = 0
            self.playerCount = 0
            self.shopCount = 0

            self.tooltipMiniMapOpen = 0
            self.tooltipMiniMapClose = 0
            self.tooltipScaleUp = 0
            self.tooltipScaleDown = 0
            self.tooltipAtlasOpen = 0
            self.tooltipInfo = None
            self.serverInfo = None

        def SetMapName(self, mapName):
            self.mapName=mapName
            self.AtlasWindow.SetMapName(mapName)

            if self.CANNOT_SEE_INFO_MAP_DICT.has_key(mapName):
                self.canSeeInfo = False
                self.HideMiniMap()
                self.tooltipMiniMapOpen.SetText(localeInfo.MINIMAP_CANNOT_SEE)
            else:
                self.canSeeInfo = True
                self.ShowMiniMap()
                self.tooltipMiniMapOpen.SetText(localeInfo.MINIMAP)
                
        # AUTOBAN
        def SetImprisonmentDuration(self, duration):
            self.imprisonmentDuration = duration
            self.imprisonmentEndTime = app.GetGlobalTimeStamp() + duration                
            
            self.__UpdateImprisonmentDurationText()
            
        def __UpdateImprisonmentDurationText(self):
            restTime = max(self.imprisonmentEndTime - app.GetGlobalTimeStamp(), 0)
            
            imprisonmentEndTimeText = localeInfo.SecondToDHM(restTime)
            if imprisonmentEndTimeText != self.imprisonmentEndTimeText:
                self.imprisonmentEndTimeText = imprisonmentEndTimeText
                self.serverInfo.SetText("%s: %s" % (uiScriptLocale.AUTOBAN_QUIZ_REST_TIME, self.imprisonmentEndTimeText))
        # END_OF_AUTOBAN    

        def Show(self):
            self.__LoadWindow()

            ui.ScriptWindow.Show(self)

        def __LoadWindow(self):
            if self.isLoaded == 1:
                return

            self.isLoaded = 1

            try:
                pyScrLoader = ui.PythonScriptLoader()
                if localeInfo.IsARABIC():
                    pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "Minimap.py")
                else:
                    pyScrLoader.LoadScriptFile(self, "UIScript/MiniMap.py")
            except:
                import exception
                exception.Abort("MiniMap.LoadWindow.LoadScript")

            try:
                self.OpenWindow = self.GetChild("OpenWindow")
                self.MiniMapWindow = self.GetChild("MiniMapWindow")
                self.ScaleUpButton = self.GetChild("ScaleUpButton")
                self.ScaleDownButton = self.GetChild("ScaleDownButton")
                self.MiniMapHideButton = self.GetChild("MiniMapHideButton")
                self.AtlasShowButton = self.GetChild("AtlasShowButton")
                self.CloseWindow = self.GetChild("CloseWindow")
                self.MiniMapShowButton = self.GetChild("MiniMapShowButton")
                self.positionInfo = self.GetChild("PositionInfo")
                self.observerCount = self.GetChild("ObserverCount")
                self.serverInfo = self.GetChild("ServerInfo")
                self.playerCount = self.GetChild("PlayerCount")
                self.shopCount = self.GetChild("ShopCount")
            except:
                import exception
                exception.Abort("MiniMap.LoadWindow.Bind")

            if constInfo.MINIMAP_POSITIONINFO_ENABLE==0:
                self.positionInfo.Hide()

            self.serverInfo.SetText(net.GetServerInfo())
            self.ScaleUpButton.SetEvent(ui.__mem_func__(self.ScaleUp))
            self.ScaleDownButton.SetEvent(ui.__mem_func__(self.ScaleDown))
            self.MiniMapHideButton.SetEvent(ui.__mem_func__(self.HideMiniMap))
            self.MiniMapShowButton.SetEvent(ui.__mem_func__(self.ShowMiniMap))

            if miniMap.IsAtlas():
                self.AtlasShowButton.SetEvent(ui.__mem_func__(self.ShowAtlas))

            (ButtonPosX, ButtonPosY) = self.MiniMapShowButton.GetGlobalPosition()
            self.tooltipMiniMapOpen.SetTooltipPosition(ButtonPosX, ButtonPosY)

            (ButtonPosX, ButtonPosY) = self.MiniMapHideButton.GetGlobalPosition()
            self.tooltipMiniMapClose.SetTooltipPosition(ButtonPosX, ButtonPosY)

            (ButtonPosX, ButtonPosY) = self.ScaleUpButton.GetGlobalPosition()
            self.tooltipScaleUp.SetTooltipPosition(ButtonPosX, ButtonPosY)

            (ButtonPosX, ButtonPosY) = self.ScaleDownButton.GetGlobalPosition()
            self.tooltipScaleDown.SetTooltipPosition(ButtonPosX, ButtonPosY)

            (ButtonPosX, ButtonPosY) = self.AtlasShowButton.GetGlobalPosition()
            self.tooltipAtlasOpen.SetTooltipPosition(ButtonPosX, ButtonPosY)

            self.ShowMiniMap()

        def Destroy(self):
            self.HideMiniMap()

            self.AtlasWindow.Destroy()
            self.AtlasWindow = None

            self.ClearDictionary()

            self.__Initialize()

        def UpdateObserverCount(self, observerCount):
            if observerCount>0:
                self.observerCount.Show()
            elif observerCount<=0:
                self.observerCount.Hide()

            self.observerCount.SetText(localeInfo.MINIMAP_OBSERVER_COUNT % observerCount)
            
        def OnUpdate(self):
            (x, y, z) = player.GetMainCharacterPosition()
            miniMap.Update(x, y)

            self.positionInfo.SetText("(%.0f, %.0f)" % (x/100, y/100))

            if self.tooltipInfo:
                if True == self.MiniMapWindow.IsIn():
                    (mouseX, mouseY) = wndMgr.GetMousePosition()
                    (bFind, sName, iPosX, iPosY, dwTextColor) = miniMap.GetInfo(mouseX, mouseY)
                    if bFind == 0:
                        self.tooltipInfo.Hide()
                    elif not self.canSeeInfo:
                        self.tooltipInfo.SetText("%s(%s)" % (sName, localeInfo.UI_POS_UNKNOWN))
                        self.tooltipInfo.SetTooltipPosition(mouseX - 5, mouseY)
                        self.tooltipInfo.SetTextColor(dwTextColor)
                        self.tooltipInfo.Show()
                    else:
                        if localeInfo.IsARABIC() and sName[-1].isalnum():
                            self.tooltipInfo.SetText("(%s)%d, %d" % (sName, iPosX, iPosY))
                        else:
                            self.tooltipInfo.SetText("%s(%d, %d)" % (sName, iPosX, iPosY))
                        self.tooltipInfo.SetTooltipPosition(mouseX - 5, mouseY)
                        self.tooltipInfo.SetTextColor(dwTextColor)
                        self.tooltipInfo.Show()
                else:
                    self.tooltipInfo.Hide()
                
                # AUTOBAN
                if self.imprisonmentDuration:
                    self.__UpdateImprisonmentDurationText()                
                # END_OF_AUTOBAN

            if True == self.MiniMapShowButton.IsIn():
                self.tooltipMiniMapOpen.Show()
            else:
                self.tooltipMiniMapOpen.Hide()

            if True == self.MiniMapHideButton.IsIn():
                self.tooltipMiniMapClose.Show()
            else:
                self.tooltipMiniMapClose.Hide()

            if True == self.ScaleUpButton.IsIn():
                self.tooltipScaleUp.Show()
            else:
                self.tooltipScaleUp.Hide()

            if True == self.ScaleDownButton.IsIn():
                self.tooltipScaleDown.Show()
            else:
                self.tooltipScaleDown.Hide()

            if True == self.AtlasShowButton.IsIn():
                self.tooltipAtlasOpen.Show()
            else:
                self.tooltipAtlasOpen.Hide()

        def OnRender(self):
            (x, y) = self.GetGlobalPosition()
            fx = float(x)
            fy = float(y)
            miniMap.Render(fx + 4.0, fy + 5.0)

        def Close(self):
            self.HideMiniMap()

        def HideMiniMap(self):
            miniMap.Hide()
            self.OpenWindow.Hide()
            self.CloseWindow.Show()

        def ShowMiniMap(self):
            if not self.canSeeInfo:
                return

            miniMap.Show()
            self.OpenWindow.Show()
            self.CloseWindow.Hide()

        def isShowMiniMap(self):
            return miniMap.isShow()

        def ScaleUp(self):
            miniMap.ScaleUp()

        def ScaleDown(self):
            miniMap.ScaleDown()

        def ShowAtlas(self):
            if not miniMap.IsAtlas():
                return
            if not self.AtlasWindow.IsShow():
                self.AtlasWindow.Show()

        def ToggleAtlasWindow(self):
            if not miniMap.IsAtlas():
                return
            if self.AtlasWindow.IsShow():
                self.AtlasWindow.Hide()
            else:
                self.AtlasWindow.Show()

        def UpdateOnlinePlayerCount(self, playerCount):
            self.playerCount.SetText(localeInfo.PrettyNumber(playerCount) + " Online Oyuncu")

        def UpdateOnlineShopCount(self, shopCount):
            self.shopCount.SetText(localeInfo.PrettyNumber(shopCount) + " Online Tezgh")

     

  2. Bonjour à tous, 

    J'ai suivi ce tuto afin d'implanter les magasins hors-ligne

     

    1 - Je rencontre ce soucis côté serveur (files 2014 -42050)

    erreur-db.png

    J'ai du mal à comprendre car c'est un fichier auquel je n'ai pas touché et je ne sais pas comment le modifier. Voici le fichier en question

    Citation

    #include "stdafx.h"
    #include "../../libgame/include/grid.h"
    #include "constants.h"
    #include "utils.h"
    #include "config.h"
    #include "desc.h"
    #include "desc_manager.h"
    #include "char.h"
    #include "char_manager.h"
    #include "item.h"
    #include "item_manager.h"
    #include "buffer_manager.h"
    #include "packet.h"
    #include "log.h"
    #include "db.h"
    #include "questmanager.h"
    #include "monarch.h"
    #include "mob_manager.h"
    #include "locale_service.h"
    #include "offlineshop.h"
    #include "p2p.h"

    COfflineShop::COfflineShop() : m_pkOfflineShopNPC(NULL)
    {
        m_pGrid = M2_NEW CGrid(8, 8);
    }

    COfflineShop::~COfflineShop()
    {
        TPacketGCShop pack;
        pack.header = HEADER_GC_OFFLINE_SHOP;
        pack.subheader = SHOP_SUBHEADER_GC_END;
        pack.size = sizeof(TPacketGCShop);

        Broadcast(&pack, sizeof(pack));

        for (GuestMapType::iterator it = m_map_guest.begin(); it != m_map_guest.end(); ++it)
        {
            LPCHARACTER ch = it->first;
            ch->SetOfflineShop(NULL);
        }

        M2_DELETE(m_pGrid);
    }

    void COfflineShop::SetOfflineShopNPC(LPCHARACTER npc)
    {
        m_pkOfflineShopNPC = npc;
    }

    void COfflineShop::SetShopItems(TShopItemTable * pTable, BYTE bItemCount, LPCHARACTER ch)
    {
        if (!ch)
            return;

        m_pGrid->Clear();

        m_offlineShopItemVector.resize(OFFLINE_SHOP_HOST_ITEM_MAX_NUM);
        memset(&m_offlineShopItemVector[0], 0, sizeof(OFFLINE_SHOP_ITEM) * m_offlineShopItemVector.size());

        for (int i = 0; i < bItemCount; ++i)
        {
            int iPos;
            LPITEM pkItem = ch->GetItem(pTable->pos);

            if (!pkItem)
            {
                sys_err("COfflineShop::SetShopItems: cannot find item on pos (%d, %d) (name: %s)", pTable->pos.window_type, pTable->pos.cell, ch->GetName());
                continue;
            }

            if(pkItem->IsEquipped() == true || pkItem->isLocked() == true || pkItem->IsExchanging())
                continue;

            const TItemTable * item_table = pkItem->GetProto();

            if (!item_table)
            {
                sys_err("COfflineShop::SetShopItems: no item table by item vnum #%d", pTable->vnum);
                continue;
            }

            if (IS_SET(item_table->dwAntiFlags, ITEM_ANTIFLAG_GIVE | ITEM_ANTIFLAG_MYSHOP))
                continue;

            iPos = pTable->display_pos;

            if (iPos < 0)
            {
                sys_err("COfflineShop::SetShopItems: not enough shop window!");
                continue;
            }

            //sys_log(0, "COfflineShop::SetShopItems: use position %d", iPos);

            if (!m_pGrid->IsEmpty(iPos, 1, pkItem->GetSize()))
            {
                sys_err("COfflineShop::SetShopItems: not empty position offline shop %s[%d]", ch->GetName(), ch->GetPlayerID());
                continue;
            }

            m_pGrid->Put(iPos, 1, pkItem->GetSize());

            /* memory part begin */
            OFFLINE_SHOP_ITEM & offShopItem = m_offlineShopItemVector[iPos];

            //////////
            // bIsSold already declared as = false in offlineshop.h
            offShopItem.owner_id = ch->GetPlayerID();
            offShopItem.pos = iPos;
            offShopItem.count = pkItem->GetCount();
            offShopItem.price = pTable->price;
            offShopItem.vnum = pkItem->GetVnum();

            for (int x = 0; x < ITEM_SOCKET_MAX_NUM; x++)
                offShopItem.alSockets[x] = pkItem->GetSocket(x);

            for (int x = 0; x < ITEM_ATTRIBUTE_MAX_NUM; x++)
            {
                offShopItem.aAttr[x].bType = pkItem->GetAttributeType(x);
                offShopItem.aAttr[x].sValue = pkItem->GetAttributeValue(x);
            }
            /* memory part end */

            /* query part begin */
            char szColumns[QUERY_MAX_LEN], szValues[QUERY_MAX_LEN];

            snprintf(szColumns, sizeof(szColumns),
            "owner_id, pos, count, price, vnum,"
            "socket0, socket1, socket2,"
            "attrtype0, attrvalue0, attrtype1, attrvalue1,"
            "attrtype2, attrvalue2, attrtype3, attrvalue3,"
            "attrtype4, attrvalue4, attrtype5, attrvalue5,"
            "attrtype6, attrvalue6");
            
            snprintf(szValues, sizeof(szValues), "%u, %d, %u, %u, %u, %ld, %ld, %ld, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", 
                ch->GetPlayerID(), iPos, pkItem->GetCount(), pTable->price, pkItem->GetVnum(),
                pkItem->GetSocket(0), pkItem->GetSocket(1),
                pkItem->GetSocket(2),
                pkItem->GetAttributeType(0), pkItem->GetAttributeValue(0), pkItem->GetAttributeType(1), pkItem->GetAttributeValue(1),
                pkItem->GetAttributeType(2), pkItem->GetAttributeValue(2), pkItem->GetAttributeType(3), pkItem->GetAttributeValue(3),
                pkItem->GetAttributeType(4), pkItem->GetAttributeValue(4), pkItem->GetAttributeType(5), pkItem->GetAttributeValue(5),
                pkItem->GetAttributeType(6), pkItem->GetAttributeValue(6));

            char szInsertQuery[QUERY_MAX_LEN];
            snprintf(szInsertQuery, sizeof(szInsertQuery), "INSERT INTO %soffline_shop_item (%s) VALUES (%s)", get_table_postfix(), szColumns, szValues);
            std::unique_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(szInsertQuery));
            /* query part end */

            /* log for web */
            LogManager::instance().OfflineShopLog(ch->GetDesc()->GetAccountTable().id, pkItem->GetName(), "PUT");
            /* end log for web */

            ITEM_MANAGER::instance().RemoveItem(pkItem);

            ++pTable;
        }
    }

    void COfflineShop::PutItem(LPCHARACTER ch, TItemPos item_pos, int iPrice)
    {
        if (!ch || !ch->CanHandleItem())
            return;

        LPITEM pkItem = ch->GetItem(item_pos);

        if (!pkItem)
            return;

        if (pkItem->IsEquipped() == true || pkItem->isLocked() == true || pkItem->IsExchanging())
            return;

        const TItemTable * item_table = pkItem->GetProto();

        if (!item_table)
            return;

        if (IS_SET(item_table->dwAntiFlags, ITEM_ANTIFLAG_GIVE | ITEM_ANTIFLAG_MYSHOP))
            return;

        int iPos = m_pGrid->FindBlank(1, item_table->bSize);

        if (iPos < 0)
        {
            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You don't have enough space to put your item!"));
            return;
        }

        if (!m_pGrid->IsEmpty(iPos, 1, item_table->bSize))
        {
            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You don't have enough space to put your item!"));
            return;
        }

        m_pGrid->Put(iPos, 1, item_table->bSize);

        /* memory part begin */
        OFFLINE_SHOP_ITEM & offShopItem = m_offlineShopItemVector[iPos];

        //////////
        // bIsSold already declared as = false in offlineshop.h
        offShopItem.owner_id = ch->GetPlayerID();
        offShopItem.pos = iPos;
        offShopItem.count = pkItem->GetCount();
        offShopItem.price = iPrice;
        offShopItem.vnum = pkItem->GetVnum();

        for (int x = 0; x < ITEM_SOCKET_MAX_NUM; x++)
            offShopItem.alSockets[x] = pkItem->GetSocket(x);

        for (int x = 0; x < ITEM_ATTRIBUTE_MAX_NUM; x++)
        {
            offShopItem.aAttr[x].bType = pkItem->GetAttributeType(x);
            offShopItem.aAttr[x].sValue = pkItem->GetAttributeValue(x);
        }
        /* memory part end */
        
        /* query part begin */
        char szColumns[QUERY_MAX_LEN], szValues[QUERY_MAX_LEN];

        snprintf(szColumns, sizeof(szColumns),
            "owner_id, pos, count, price, vnum,"
            "socket0, socket1, socket2,"
            "attrtype0, attrvalue0, attrtype1, attrvalue1,"
            "attrtype2, attrvalue2, attrtype3, attrvalue3,"
            "attrtype4, attrvalue4, attrtype5, attrvalue5,"
            "attrtype6, attrvalue6");

        snprintf(szValues, sizeof(szValues), "%u, %d, %u, %u, %u, %ld, %ld, %ld, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",
            ch->GetPlayerID(), iPos, pkItem->GetCount(), iPrice, pkItem->GetVnum(),
            pkItem->GetSocket(0), pkItem->GetSocket(1),
            pkItem->GetSocket(2),
            pkItem->GetAttributeType(0), pkItem->GetAttributeValue(0), pkItem->GetAttributeType(1), pkItem->GetAttributeValue(1),
            pkItem->GetAttributeType(2), pkItem->GetAttributeValue(2), pkItem->GetAttributeType(3), pkItem->GetAttributeValue(3),
            pkItem->GetAttributeType(4), pkItem->GetAttributeValue(4), pkItem->GetAttributeType(5), pkItem->GetAttributeValue(5),
            pkItem->GetAttributeType(6), pkItem->GetAttributeValue(6));

        char szInsertQuery[QUERY_MAX_LEN];
        snprintf(szInsertQuery, sizeof(szInsertQuery), "INSERT INTO %soffline_shop_item (%s) VALUES (%s)", get_table_postfix(), szColumns, szValues);
        std::unique_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(szInsertQuery));
        /* query part end */

        /* log for web */
        LogManager::instance().OfflineShopLog(ch->GetDesc()->GetAccountTable().id, pkItem->GetName(), "PUT_REMOTE");
        /* end log for web */

        BroadcastUpdateItem(iPos);

        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Item %s has been successfully added to your offline shop, price: %d."), pkItem->GetName(), iPrice);
        
        ITEM_MANAGER::instance().RemoveItem(pkItem);
    }

    bool COfflineShop::AddGuest(LPCHARACTER ch, LPCHARACTER npc)
    {
        if (!ch || ch->GetExchange() || ch->GetShop() || ch->GetMyShop() || ch->GetOfflineShop())
            return false;

        ch->SetOfflineShop(this);
        m_map_guest.insert(GuestMapType::value_type(ch, false));

        TPacketGCShop pack;
        pack.header = HEADER_GC_OFFLINE_SHOP;
        pack.subheader = SHOP_SUBHEADER_GC_START;

        TPacketGCOfflineShopStart pack2;
        memset(&pack2, 0, sizeof(pack2));
        pack2.owner_vid = npc->GetVID();

        for (DWORD i = 0; i < m_offlineShopItemVector.size() && i < OFFLINE_SHOP_HOST_ITEM_MAX_NUM; ++i)
        {
            const OFFLINE_SHOP_ITEM & offShopItem = m_offlineShopItemVector[i];

            pack2.items[i].count = offShopItem.count;
            pack2.items[i].price = offShopItem.price;
            pack2.items[i].vnum = offShopItem.vnum;
            pack2.items[i].bIsSold = offShopItem.bIsSold;
            strncpy(pack2.items[i].buyerName, offShopItem.buyerName, CHARACTER_NAME_MAX_LEN);

            for (int x = 0; x < ITEM_SOCKET_MAX_NUM; x++)
                pack2.items[i].alSockets[x] = offShopItem.alSockets[x];
        
            for (int x = 0; x < ITEM_ATTRIBUTE_MAX_NUM; x++)
            {
                const TPlayerItemAttribute & c_rItemAttr = offShopItem.aAttr[x];
                
                pack2.items[i].aAttr[x].bType = c_rItemAttr.bType;
                pack2.items[i].aAttr[x].sValue = c_rItemAttr.sValue;
            }
        }

        pack.size = sizeof(pack)+sizeof(pack2);
        ch->GetDesc()->BufferedPacket(&pack, sizeof(TPacketGCShop));
        ch->GetDesc()->Packet(&pack2, sizeof(TPacketGCOfflineShopStart));
        return true;
    }

    void COfflineShop::RemoveGuest(LPCHARACTER ch)
    {
        if (ch->GetOfflineShop() != this)
            return;

        m_map_guest.erase(ch);
        ch->SetOfflineShop(NULL);

        TPacketGCShop pack;
        pack.header = HEADER_GC_OFFLINE_SHOP;
        pack.subheader = SHOP_SUBHEADER_GC_END;
        pack.size = sizeof(TPacketGCShop);

        ch->GetDesc()->Packet(&pack, sizeof(pack));
    }

    void COfflineShop::RemoveAllGuest()
    {
        TPacketGCShop pack;
        pack.header = HEADER_GC_OFFLINE_SHOP;
        pack.subheader = SHOP_SUBHEADER_GC_END;
        pack.size = sizeof(TPacketGCShop);

        Broadcast(&pack, sizeof(pack));

        for (GuestMapType::iterator it = m_map_guest.begin(); it != m_map_guest.end(); ++it)
        {
            LPCHARACTER ch = it->first;
            ch->SetOfflineShop(NULL);
        }
    }

    void COfflineShop::Destroy(LPCHARACTER npc)
    {
        RemoveAllGuest();
        M2_DESTROY_CHARACTER(npc);
    }

    void COfflineShop::GiveBackMyItems(LPCHARACTER ch)
    {
        if (!ch)
            return;

        RemoveAllGuest();

        /* cleanup begin */
        DBManager::instance().DirectQuery("DELETE FROM %soffline_shop_item WHERE owner_id = %u", get_table_postfix(), ch->GetPlayerID());
        /* cleanup end */

        for (DWORD i = 0; i < m_offlineShopItemVector.size() && i < OFFLINE_SHOP_HOST_ITEM_MAX_NUM; ++i)
        {
            const OFFLINE_SHOP_ITEM & r_item = m_offlineShopItemVector[i];

            if (r_item.bIsSold || !r_item.vnum)
                continue;

            LPITEM pItem = ITEM_MANAGER::instance().CreateItem(r_item.vnum, r_item.count);
            
            if (pItem)
            {
                pItem->SetSockets(r_item.alSockets);
                pItem->SetAttributes(r_item.aAttr);

                int cell;
                cell = ch->GetEmptyInventory(pItem->GetSize());

                if (cell != -1)
                {
                    pItem->AddToCharacter(ch, TItemPos(INVENTORY, cell));
                }
                else
                {
                    pItem->AddToGround(ch->GetMapIndex(), ch->GetXYZ());
                    pItem->StartDestroyEvent();
                    pItem->SetOwnership(ch, 60);
                }

                /* log for web */
                LogManager::instance().OfflineShopLog(ch->GetDesc()->GetAccountTable().id, pItem->GetName(), "GIVE_BACK");
                /* end log for web */
            }
        }
    }

    int COfflineShop::Buy(LPCHARACTER ch, BYTE bPos)
    {
        //if (!ch)
        //    return SHOP_SUBHEADER_GC_END;
        
        if (ch->GetOfflineShopOwner()->GetOfflineShopRealOwner() == ch->GetPlayerID())
        {
            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't buy anything from your offline shop."));
            return SHOP_SUBHEADER_GC_OK;
        }

        if (bPos >= m_offlineShopItemVector.size())
        {
            sys_log(0, "COfflineShop::Buy: invalid position %d : %s", bPos, ch->GetName());
            return SHOP_SUBHEADER_GC_INVALID_POS;
        }

        //sys_log(0, "COfflineShop::Buy: name: %s, pos: %d", ch->GetName(), bPos);

        GuestMapType::iterator it = m_map_guest.find(ch);
        if (it == m_map_guest.end())
            return SHOP_SUBHEADER_GC_END;

        OFFLINE_SHOP_ITEM & r_item = m_offlineShopItemVector[bPos];

        if (r_item.bIsSold)
            return SHOP_SUBHEADER_GC_SOLD_OUT;

        DWORD dwPrice = r_item.price;

        if (r_item.price < 0)
            return SHOP_SUBHEADER_GC_NOT_ENOUGH_MONEY;

        if (ch->GetGold() < static_cast<int>(dwPrice))
            return SHOP_SUBHEADER_GC_NOT_ENOUGH_MONEY;

        LPITEM item = ITEM_MANAGER::instance().CreateItem(r_item.vnum, r_item.count);

        if (!item)
            return SHOP_SUBHEADER_GC_END;

        int iEmptyPos = ch->GetEmptyInventory(item->GetSize());

        if (iEmptyPos < 0)
        {
            M2_DESTROY_ITEM(item);
            return SHOP_SUBHEADER_GC_INVENTORY_FULL;
        }

        ch->PointChange(POINT_GOLD, -dwPrice, false);
        r_item.bIsSold = true;
        strncpy(r_item.buyerName, ch->GetName(), CHARACTER_NAME_MAX_LEN);

        item->SetSockets(r_item.alSockets);
        item->SetAttributes(r_item.aAttr);

        item->AddToCharacter(ch, TItemPos(INVENTORY, iEmptyPos));

        DBManager::instance().DirectQuery("UPDATE player.player SET gold_offlineshop = gold_offlineshop + %u WHERE id = %u", dwPrice, ch->GetOfflineShopOwner()->GetOfflineShopRealOwner());
        DBManager::instance().DirectQuery("DELETE FROM %soffline_shop_item WHERE owner_id = %u AND pos = %d AND vnum = %d LIMIT 1", get_table_postfix(), r_item.owner_id, bPos, r_item.vnum);

        LogManager::instance().OfflineShopLog(ch->GetOfflineShopOwner()->GetOfflineShopRealOwnerAccountID(), item->GetName(), "SELL");

        BroadcastUpdateItem(bPos);

        ch->SetMyOfflineShopTime();
        ch->Save();

        LPCHARACTER tch = CHARACTER_MANAGER::instance().FindByPID(ch->GetOfflineShopOwner()->GetOfflineShopRealOwner());

        if (tch)
        {
            char msg[CHAT_MAX_LEN + 1];
            snprintf(msg, sizeof(msg), LC_TEXT("Your item %s sold, buyer is: %s."), item->GetName(), ch->GetName());

            LPDESC pkVictimDesc = tch->GetDesc();

            if (pkVictimDesc)
            {
                TPacketGCWhisper pack;

                int len = MIN(CHAT_MAX_LEN, strlen(msg) + 1);

                pack.bHeader = HEADER_GC_WHISPER;
                pack.wSize = sizeof(TPacketGCWhisper) + len;
                pack.bType = WHISPER_TYPE_SYSTEM;
                strlcpy(pack.szNameFrom, "[Market Tezgahý]", sizeof(pack.szNameFrom));

                TEMP_BUFFER buf;

                buf.write(&pack, sizeof(TPacketGCWhisper));
                buf.write(msg, len);

                pkVictimDesc->Packet(buf.read_peek(), buf.size());
            }

            //tch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Market Tezgâhýndan nesne satýldý: %s."), item->GetName());
        }
        else
        {
            // P2P_FIND

            TPacketGGOfflineShopMessage p;
            p.bHeader = HEADER_GG_OFFLINE_SHOP_SEND_MESSAGE;
            p.dwTargetPID = ch->GetOfflineShopOwner()->GetOfflineShopRealOwner();
            strlcpy(p.szItemName, item->GetName(), sizeof(p.szItemName));
            strlcpy(p.szName, ch->GetName(), sizeof(p.szName));
            P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGOfflineShopMessage));
        }

        return (SHOP_SUBHEADER_GC_OK);
    }

    void COfflineShop::BroadcastUpdateItem(BYTE bPos)
    {
        TPacketGCShop pack;
        TPacketGCShopUpdateOfflineItem pack2;

        TEMP_BUFFER buf;

        pack.header = HEADER_GC_OFFLINE_SHOP;
        pack.subheader = SHOP_SUBHEADER_GC_UPDATE_ITEM;
        pack.size = sizeof(pack) + sizeof(pack2);

        OFFLINE_SHOP_ITEM & r_item = m_offlineShopItemVector[bPos];

        pack2.item.count = r_item.count;
        pack2.item.price = r_item.price;
        pack2.item.vnum = r_item.vnum;
        pack2.item.bIsSold = r_item.bIsSold;
        pack2.pos = r_item.pos;
        strncpy(pack2.item.buyerName, r_item.buyerName, CHARACTER_NAME_MAX_LEN);

        for (int x = 0; x < ITEM_SOCKET_MAX_NUM; x++)
            pack2.item.alSockets[x] = r_item.alSockets[x];

        for (int x = 0; x < ITEM_ATTRIBUTE_MAX_NUM; x++)
        {
            const TPlayerItemAttribute & c_rItemAttr = r_item.aAttr[x];

            pack2.item.aAttr[x].bType = c_rItemAttr.bType;
            pack2.item.aAttr[x].sValue = c_rItemAttr.sValue;
        }

        buf.write(&pack, sizeof(pack));
        buf.write(&pack2, sizeof(pack2));
        Broadcast(buf.read_peek(), buf.size());
    }

    void COfflineShop::Broadcast(const void * data, int bytes)
    {
        for (GuestMapType::iterator it = m_map_guest.begin(); it != m_map_guest.end(); ++it)
        {
            LPCHARACTER ch = it->first;
            if (ch->GetDesc())
                ch->GetDesc()->Packet(data, bytes);
        }
    }
     

    2 - A la fin je dois créer une table dans la base de donnée "player". Cependant je ne sais pas comment la configurer comme l'indique le tuto. Je vous partage les instructions

    Citation

    Créez "gold_offlineshop" dans la table des joueurs. bigint - 25 - non nul - "0" par défaut

    Quelqu'un aurait-il la gentillesse de m'éclairer ? :) 

    Merci d'avance, 

     

    Alan

     

     

     

     

     

  3. Bonjour à tous,

    Files : 2014 40250 

    Niveau : Débutant

    Sur les files 2014 les costumes avec bonus sont implantés mais je ne crois pas qu'il y ai la partie programmation permettant de les switchs et je n'ai pas les compétences pour coder...

    J'ai donc 2 questions

    1 - Quelqu'un a-t-il ou pourrait partager cette partie de système des costumes ? 

    2 - Où peut-on modifier les bonus des costumes ? (je n'ai pas trouver de table sur Navicat qui correspond)

    Merci d'avance pour vos réponses 🙂

  4. Yalabi

    J'ai suivi le tuto dont tu trouveras le lien ci-dessous. Je trouve que les modifications du côté serveur sont assez flou (même lorsque je me dirige vers le tuto d'édition des rates. J'ai simplement modifié l'item_proto.txt et l'item_name.txt. En fouillant un peu j'ai trouvé dans usr/metin2/share/data le dossier "monster", j'ai pris exemple sur le contenu des fichiers afin d'y mettre celui de mon mob avec les fichiers d'animations (.msa), le motlist.txt et le fichier .msm. 

     

    Je me doute qu'il y a surement d'autres choses à faire mais je ne parviens pas à trouver d'infos à ce sujet. 

    PS : Ce qui m'interroge aussi c'est que lorsque je delete la ligne ajouté dans le mob_proto et le mob_names l'erreur est toujours là, je suis donc obligé de remettre le fichier d'origine pourtant identique lorsque je les compares. 

     

    Edit : Lorsque je réalise l'ouverture du fichier d'origine via excel (texte séparateur tabulation) et que j'enregistre le fichier sans le modifier, celui-ci n'est plus fonctionnel. Je précise que j'ai réalisé exactement les mêmes manipulations avec l'item_proto.txt et je n'ai pas ce soucis. Lorsque je modifie le fichier avec sublimetext cela fonctionne mais impossible de travailler comme ça...

     

  5. Bonjour à tous, 

    Sources : FE 2016  by @ Saw

    J'ai un soucis lorsque j'essaye d'implanter un boss sur mon serveur (Connected refused).

    Syserr :

    Citation

    SYSERR: Jul 25 16:19:57 :: pid_init: 
    Start of pid: 1236

    SYSERR: Jul 25 16:19:57 :: socket_connect: HOST 127.0.0.1:15000, could not connect.

    Après plusieurs manip' je ne parviens pas à trouver le problème... Je vous partage le mob_ proto.txt. VNUM 2598 : Azrael déjà implanté / VNUM 2599 : le mob que j'essaye d'implanter (j'ai simplement recopié la ligne d'Azra en modifiant le VNUM, le level et le folder pour l'instant. Je précise que lorsque je remets le mob_proto d'origine, le serveur démarre, le problème vient donc bien de ma modification. Je vous remercie d'avance pour votre aide !


    Hidden Content

      Give reaction to this post to see the hidden content.

     

  6. Bonjour, 

    Lorsque j'implante une map j'obtiens le syserr suivant côté client (le crash intervient lors du chargement de TP vers la map implantée 

    Citation

    0721 10:01:15605 :: CMapBase::LoadProperty(FileName=metin2_laurin_map\MapProperty.txt) - LoadMultipleTextData ERROR ÆÄÀÏÀÌ ¾øÀ» °¡´É¼ºÀÌ ¸¹½À´Ï´Ù.
    0721 10:01:15606 :: CMapManager::LoadMap() Invalid Map Type

     

    Voici ce que j'ai réalisé dans le client : 

    1 - repack le dossier metin2_laurin_map + ajout dans le fichier index.txt

    2 - Ajout des infos dans le fichier atlasinfo dans root ET locale_fr + repack et remplacé

    3 - Relance du .exe

     

    Je précise que j'ai également réalisé la partie serveur et je n'ai pas de syserr de ce côté là. 

     

    J'ai vu beaucoup de sujet avec le même syserr mais les personnes ayant résolu le problème n'ont pas communiqué la cause et les changements à effectuer. Je vous remercie d'avance pour votre aide :) 

     

    Voici quelques screens

    atlasinfo

    spacer.png

     

    Contenu du dossier metin2_laurin_map

    spacer.png

    Index.txt

    spacer.png

    mapproperty

    spacer.png

    Setting

    setting.png

  7. Merci de votre aide ! La solution de Asikoo a permis de me connecter. Cependant, j'ai un problème lors de la création de personnage. Dès la sélection du royaume, le client crash. J'ai reboot et refais la manip' de compilation mais le même problème survient...

    Voici les logs :

    Citation

    204 21:37:15257 :: R :: CPythonSkill::RegisterSkillDesc(dwSkillIndex=170, strType=wolfman).STRANGE_SKILL_TYPE
    0204 21:37:15257 :: R :: CPythonSkill::RegisterSkillDesc(dwSkillIndex=171, strType=wolfman).STRANGE_SKILL_TYPE
    0204 21:37:15257 :: R :: CPythonSkill::RegisterSkillDesc(dwSkillIndex=172, strType=wolfman).STRANGE_SKILL_TYPE
    0204 21:37:15257 :: R :: CPythonSkill::RegisterSkillDesc(dwSkillIndex=173, strType=wolfman).STRANGE_SKILL_TYPE
    0204 21:37:15257 :: R :: CPythonSkill::RegisterSkillDesc(dwSkillIndex=174, strType=wolfman).STRANGE_SKILL_TYPE
    0204 21:37:15257 :: R :: CPythonSkill::RegisterSkillDesc(dwSkillIndex=175, strType=wolfman).STRANGE_SKILL_TYPE
    0204 21:37:19386 :: R :: Hair number 11 is not exist.
    0204 21:37:19386 :: R :: Hair number 11 is not exist.
    0204 21:37:19386 :: R :: Traceback (most recent call last):

    0204 21:37:19386 :: R ::   File "introSelect.py", line 331, in Refresh

    0204 21:37:19387 :: R ::   File "introSelect.py", line 939, in SelectSlot

    0204 21:37:19387 :: R :: AttributeError
    0204 21:37:19387 :: R :: : 
    0204 21:37:19387 :: R :: 'NoneType' object has no attribute 'Show'
    0204 21:37:19387 :: R :: 

    0204 21:37:19387 :: R :: Unknown packet header: 64, last: 253 32
     

    PS : J'hésitais à créer un sujet pour ne pas encombrer ce tuto mais cela aidera sans doute d'autres personnes qui souhaiteraient exploiter ses files. 

  8. Bonjour, 

    Merci beaucoup pour ce tuto. J'ai suivi toutes les étapes mais je ne parviens pas à me connecter IG. J'ai vérifié plusieurs fois l'adresse IP et le lancement du serveur via putty. J'ai déjà réalisé un serveur M2project mais je ne me souviens pas d'avoir utilisé putty. Le lancement du serveur via la virtualbox est-il nécessaire ?

     

    Ps : je précise que j'ai bien repack.

     

    Voici les screens :

    Hidden Content

      Give reaction to this post to see the hidden content.

    Hidden Content

      Give reaction to this post to see the hidden content.

    Hidden Content

      Give reaction to this post to see the hidden content.

     

    Merci d'avance pour votre aide ! 

    • Love 1
  9. il y a 1 minute, ASIKOO a dit :

     

    C'est étrange, dans la mise à jour 1.0.1 de mes files, le 70058 a été configuré sans problème et c'est un anneau qui aura X utilisations et le 40008 sera lui illimité...

    Oui je trouve ça étrange également. J'ai donc prit l'item 40002 (anneau de levi) et ça fonctionne parfaitement :) 

  10. J'ai complété la base que tu m'as apporté. Tout semble ok quand je fais 203 PRE QC (ci-joint la capture d'écran). Mais IG rien ne se passe... :/ 

     

    Capture d'écran de la VM : 

    https://goopics.net/i/0YgXw

    La quête : (c'est mieux ranger dans SublimeText) 

    Citation

    quest AnneauTP begin
        state start begin
            when 70058.use begin
                local choix_des_maps = select("Map 1 Bleu", "Map 2 Bleu", "Map 1 Rouge", "Map 2 Rouge", "Map 1 Jaune", "Map 2 Jaune", "Map Orc", "Desert", "Terre de feu", "Tour du demon", "Cave 1", "Cave 2", "Grotte de l'Exil 1", "Grotte de l'Exil 2", "Foret", "Bois Rouge", "Geant", "Beran-Seatou", "Catacombes", "Observatoire de Nemere", "Meley", "Fermer")

                if choix_des_maps == 22 then
                    return
                end

                if choix_des_maps == 1 then
                    pc.warp(959900, 269200)
                end

                if choix_des_maps == 2 then
                    pc.warp(863900, 246000)
                end

                if choix_des_maps == 3 then
                    pc.warp(474300, 954800)
                end

                if choix_des_maps == 4 then
                    pc.warp(353100, 882900)
                end

                if choix_des_maps == 5 then
                    pc.warp(63800, 166400)
                end

                if choix_des_maps == 6 then
                    pc.warp(145500, 240000)
                end

                if choix_des_maps == 7 then
                    pc.warp(333000, 746600)
                end

                if choix_des_maps == 8 then
                    pc.warp(217800, 627200)
                end

                if choix_des_maps == 9 then
                    pc.warp(599400, 756300)
                end

                if choix_des_maps == 10 then
                    pc.warp(590500, 110500)
                end

                if choix_des_maps == 11 then
                    pc.warp(60000 , 496000)
                end

                if choix_des_maps == 12 then
                    pc.warp(704100 , 464200)
                end

                if choix_des_maps == 13 then
                    pc.warp(10000, 1207800)
                end

                if choix_des_maps == 14 then
                    pc.warp(241800, 1275000)
                end

                if choix_des_maps == 15 then
                    pc.warp(288700, 5700)
                end

                if choix_des_maps == 16 then
                    pc.warp(1119500, 701)
                end

                if choix_des_maps == 17 then
                    pc.warp(828300, 763500)
                end

                if choix_des_maps == 18 then
                    pc.warp(181600, 1220700)
                end

                if choix_des_maps == 19 then
                    pc.warp(591600 , 99900)
                end

                if choix_des_maps == 20 then
                    pc.warp(432000 , 164800)
                end
                
                if choix_des_maps == 21 then
                    pc.warp(614000 , 707100)
                end
            end
        end
    end

     

    L'item_proto de l'item

    Citation

    70058    XXX    ITEM_QUEST    0    1    NONE    NONE    NONE    NONE    0    0    0    0    0    LIMIT_NONE    0    LIMIT_NONE    0    APPLY_NONE    0    APPLY_NONE    0    APPLY_NONE    0    0    0    0    0    0    0    0    0    0    12    7

  11. Version des Files M2 Project

    Hello à tous,

     

    Je souhaite personnaliser une quête au niveau de l'anneau de TP à partir de mes faibles connaissances actuelles sur le codage (Avoir accès pour tous aux maps 1 et 2 de tous les royaumes, ajout des instances dans le TP...). Seulement, je ne maîtrise pas le langage LUA (pour le moment) et j'ai donc souhaité réalisé une nouvelle quête au format .quest sur un autre item disponible. Seulement, elle n’apparaît pas du tout IG sur l'objet cible comme si ce dernier ne servait à rien. Si quelqu'un voit quelque chose qui bloque. :) 

     

    Ce que j'ai fait

    1. Créer une quête au format .quest 
    2. Ajouter ma quête à partir de WinSCP en suivant le chemin suivant : /usr/m2_project/1.0.0/resources/locale/france/quest
    3. Éditer le fichier new_local_list.txt en laissant une ligne supplémentaire à la fin.
    4. Vérifier dans l'item_proto que le Vnum choisi est bien configuré comme ITEM_QUEST 
    5. Fait un update de toutes les quêtes à partir de la VM
    6. Reboot le serveur 

     

    Voici la quète que j'essaye d'implanter : 

    Citation

    quest AnneauTP begin
        state start begin
            when 70058.use."Map 1 Rouge" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(474300, 954800)
                else
                    return
                end
            end
            when 70058.use."Map 2 Rouge" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(353100, 882900)
                else
                    return
                end         
            end
            when 70058.use."Map 1 Jaune" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(63800, 166400)
                else
                    return
                end         
            end
            when 70058.use."Map 2 Jaune" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(145500, 240000)
                else
                    return
                end         
            end
             when 70058.use."Map 1 Bleu" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(959900, 269200)
                else
                    return
                end         
            end
             when 70058.use."Map 2 Bleu" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(863900, 246000)
                else
                    return
                end         
            end
             when 70058.use."Map Orc" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(333000, 746600)
                else
                    return
                end         
            end
             when 70058.use."Map Desert" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(217800, 627200)
                else
                    return
                end         
            end
             when 70058.use."Mont Sohan" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(434200, 290600)
                else
                    return
                end         
            end
             when 70058.use."Terre de feu" begin
                say_reward("Voulez-vous être téléporté ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(599400, 756300)
                else
                    return
                end         
            end
             when 70058.use."Tour du démon" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(590500, 110500)
                else
                    return
                end         
            end
             when 70058.use."Foret" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(288700, 5700)
                else
                    return
                end         
            end
             when 70058.use."Bois Rouge" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(1119500, 701)
                else
                    return
                end         
            end
             when 70058.use."Cave 1" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(60000 , 496000)
                else
                    return
                end         
            end
             when 70058.use."Cave 2" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(704100 , 464200)
                else
                    return
                end         
            end
             when 70058.use."Grotte de l'Exil 1" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(10000, 1207800)
                else
                    return
                end         
            end
             when 70058.use."Grotte de l'Exil 2" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(241800, 1275000)
                else
                    return
                end         
            end
             when 70058.use."Geant" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(828300, 763500)
                else
                    return
                end         
            end
             when 70058.use."Catacombes" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(591600 , 99900)
                else
                    return
                end         
            end
             when 70058.use."Beran-Seatou" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(181600, 1220700)
                else
                    return
                end         
            end
             when 70058.use."Observatoire de Nemere" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(432000 , 164800)
                else
                    return
                end         
            end
             when 70058.use."Meley" begin
                say_reward("Voulez-vous y aller ?")
             
                local s1=select("Oui","Non")
                if s1 == 1 then
                    pc.warp(614000 , 707100)
                else
                    return
                end         
            end
        end
    end

     

     

     

    Merci à tous pour votre aide. 

    Cordialement,

     

    Alan 

     

  12. Citation

    71051    Úò°§√ÄÁ∞°¬∫Òº™â    ITEM_USE    USE_SPECIAL    1    ANTI_DROP | ANTI_SELL | ANTI_STACK    LOG | STACKABLE    NONE    NONE    0    0    0    0    0    LIMIT_NONE    0    LIMIT_NONE    0    APPLY_NONE    0    APPLY_NONE    0    APPLY_NONE    0    0    0    0    0    0    0    0    0    0        
    71052    Úò°§√ÄÁ∞¶¬∫Òº™â    ITEM_USE    USE_SPECIAL    1    ANTI_DROP | ANTI_SELL | ANTI_STACK    LOG | STACKABLE    NONE    NONE    0    0    0    0    0    LIMIT_NONE    0    LIMIT_NONE    0    APPLY_NONE    0    APPLY_NONE    0    APPLY_NONE    0    0    0    0    0    0    0    0    0    0      

     

    71051    Úò°§√ÄÁ∞°¬∫Òº™â    ITEM_USE    USE_SPECIAL    1    ANTI_DROP | ANTI_SELL | ANTI_STACK    LOG | ITEM_STACKABLE   NONE    NONE    100000    0    0    0    0    LIMIT_NONE    0    LIMIT_NONE    0    APPLY_NONE    0    APPLY_NONE    0    APPLY_NONE    0    0    0    0    0    0    0    0    0    0        
    71052    Úò°§√ÄÁ∞¶¬∫Òº™â    ITEM_USE    USE_SPECIAL    1    ANTI_DROP | ANTI_SELL | ANTI_STACK  LOG | ITEM_STACKABLE    NONE    NONE    50000    0    0    0    0    LIMIT_NONE    0    LIMIT_NONE    0    APPLY_NONE    0    APPLY_NONE    0    APPLY_NONE    0    0    0    0    0    0    0    0    0    0    

     

    Dans le premier cas les items ne sont pas empilables et fonctionnent. Dans le second cas, les items sont empilables mais ne fonctionnent pas... 

Information importante

Conditions d’utilisation / Politique de confidentialité / Règles / Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.