Jump to content

Chriss

Banned
  • Posts

    39
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by Chriss

  1. update:

    https://metin2.download/video/m7bTPN633aOw7g3x3m6qG13qk0UjiA52/.mp4

     

    This is the hidden content, please

     

    EDIT if you don't have update for class ImageBox

    class ImageBox(Window):
        def __init__(self, layer = "UI"):
            Window.__init__(self, layer)
            self.eventDict={}
            self.eventFunc = {
                "MOUSE_LEFT_BUTTON_UP" : None, 
                "MOUSE_LEFT_BUTTON_DOWN" : None, 
                "MOUSE_RIGHT_BUTTON_UP" : None, 
                "MOUSE_RIGHT_BUTTON_DOWN" : None, 
                "MOUSE_OVER_IN" : None, 
                "MOUSE_OVER_OUT" : None
            }
            self.eventArgs = {
                "MOUSE_LEFT_BUTTON_UP" : None, 
                "MOUSE_LEFT_BUTTON_DOWN" : None, 
                "MOUSE_RIGHT_BUTTON_UP" : None, 
                "MOUSE_RIGHT_BUTTON_DOWN" : None, 
                "MOUSE_OVER_IN" : None, 
                "MOUSE_OVER_OUT" : None
            }
        def __del__(self):
            Window.__del__(self)
            self.eventFunc = None
            self.eventArgs = None
        def RegisterWindow(self, layer):
            self.hWnd = wndMgr.RegisterImageBox(self, layer)
        def LoadImage(self, imageName):
            self.name=imageName
            wndMgr.LoadImage(self.hWnd, imageName)
            if len(self.eventDict)!=0:
                print "LOAD IMAGE", self, self.eventDict
        def SetAlpha(self, alpha):
            wndMgr.SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha)
            
        def SetColor(self, r, g, b, a):
            wndMgr.SetDiffuseColor(self.hWnd, r, g, b, a)    
        def GetWidth(self):
            return wndMgr.GetWidth(self.hWnd)
        def GetHeight(self):
            return wndMgr.GetHeight(self.hWnd)
            
        def SetEvent(self, func, *args) :
            result = self.eventFunc.has_key(args[0])        
            if result :
                self.eventFunc[args[0]] = func
                self.eventArgs[args[0]] = args
            else :
                print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0]
                
        def SAFE_SetEvent(self, func, *args):
            result = self.eventFunc.has_key(args[0])        
            if result :
                self.eventFunc[args[0]] = __mem_func__(func)
                self.eventArgs[args[0]] = args
            else :
                print "[ERROR] ui.py SAFE_SetEvent, Can`t Find has_key : %s" % args[0]
            
        def OnMouseLeftButtonUp(self):
            if self.eventFunc["MOUSE_LEFT_BUTTON_UP"] :
                apply(self.eventFunc["MOUSE_LEFT_BUTTON_UP"], self.eventArgs["MOUSE_LEFT_BUTTON_UP"])
                
        def OnMouseLeftButtonDown(self):
            if self.eventFunc["MOUSE_LEFT_BUTTON_DOWN"] :
                apply(self.eventFunc["MOUSE_LEFT_BUTTON_DOWN"], self.eventArgs["MOUSE_LEFT_BUTTON_DOWN"])
        def OnMouseRightButtonUp(self):
            if self.eventFunc["MOUSE_RIGHT_BUTTON_UP"] :
                apply(self.eventFunc["MOUSE_RIGHT_BUTTON_UP"], self.eventArgs["MOUSE_RIGHT_BUTTON_UP"])
                
        def OnMouseRightButtonDown(self):
            if self.eventFunc["MOUSE_RIGHT_BUTTON_DOWN"] :
                apply(self.eventFunc["MOUSE_RIGHT_BUTTON_DOWN"], self.eventArgs["MOUSE_RIGHT_BUTTON_DOWN"])
                
        def OnMouseOverIn(self) :
            if self.eventFunc["MOUSE_OVER_IN"] :
                apply(self.eventFunc["MOUSE_OVER_IN"], self.eventArgs["MOUSE_OVER_IN"])
        def OnMouseOverOut(self) :
            if self.eventFunc["MOUSE_OVER_OUT"] :
                apply(self.eventFunc["MOUSE_OVER_OUT"], self.eventArgs["MOUSE_OVER_OUT"])
                
        def SAFE_SetStringEvent(self, event, func,isa=FALSE):
            if not isa:
                self.eventDict[event]=__mem_func__(func)
            else:
                self.eventDict[event]=func
        
        def SetOnMouseLeftButtonUpEvent(self, event, *args):
            self.eventFunc["MOUSE_LEFT_BUTTON_UP"] = event
            self.eventArgs["MOUSE_LEFT_BUTTON_UP"] = args

     

    • Metin2 Dev 54
    • Dislove 1
    • Sad 2
    • Lmao 1
    • Good 15
    • Love 30
  2. Spoiler

    204014280efe73cd8ce1b2e253e352b1e56c40.p

     

    ClientManagerBoot.cpp

     

    //search

        static const char * s_szQuery =
            "SELECT "
            "shop.vnum, "
            "shop.npc_vnum, "
            "shop_item.item_vnum, "
            "shop_item.count "
            "FROM shop LEFT JOIN shop_item "
            "ON shop.vnum = shop_item.shop_vnum ORDER BY shop.vnum, shop_item.item_vnum";

     

    //replace or adapt:

        static const char * s_szQuery =
            "SELECT "
            "shop.vnum, "
            "shop.npc_vnum, "
            "shop_item.item_vnum, "
            "shop_item.count "
            "FROM shop LEFT JOIN shop_item "
            "ON shop.vnum = shop_item.shop_vnum ORDER BY shop.vnum, shop_item.id";    // shop_item.item_vnum - shop_item.id

     

    shop_item.sql

     

    SET NAMES utf8mb4;
    SET FOREIGN_KEY_CHECKS = 0;
    -- ----------------------------
    -- Table structure for shop_item
    -- ----------------------------
    DROP TABLE IF EXISTS `shop_item`;
    CREATE TABLE `shop_item` (
      `id` int(10) UNSIGNED NOT NULL DEFAULT 1,
      `shop_vnum` int(11) NOT NULL DEFAULT 0,
      `item_vnum` int(11) NOT NULL DEFAULT 0,
      `count` tinyint(4) unsigned NOT NULL DEFAULT 1
    ) ENGINE = MyISAM CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Fixed;
    
    -- ----------------------------
    -- Records of shop_item
    -- ----------------------------
    INSERT INTO `shop_item` VALUES (1, 1, 1009, 1);
    INSERT INTO `shop_item` VALUES (2, 1, 297, 1);
    INSERT INTO `shop_item` VALUES (3, 1, 4049, 1);
    SET FOREIGN_KEY_CHECKS=1;

     

    • Love 6
  3. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Hello , tonight i feel good and i will share this system for free.
    Is one of my first systems made for my server , i know that isn't made by a pro (coding stuff i mean) but it works w/o problems.
    I don't force anyone to use it, if you don't like the way it is made, make yourself the one you want.
    You need to have Emoji Texline stuff implemented:

     

    Spoiler

    .jpg
    .gif

     

     

    This is the hidden content, please


     

    edit:
    change PythonTextTail.cpp:
    TTextTail * pTextTail = RegisterTextTail(VirtualID,
    											 c_szChat,
    											 pCharacterInstance->GetGraphicThingInstancePtr(),
    											 pCharacterInstance->GetGraphicThingInstanceRef().GetHeight() + 10.0f,
    											 c_TextTail_Chat_Color);
    
    to:
    TTextTail * pTextTail = RegisterTextTail(VirtualID,
    											 strContent.c_str(),
    											 pCharacterInstance->GetGraphicThingInstancePtr(),
    											 pCharacterInstance->GetGraphicThingInstanceRef().GetHeight() + 10.0f,
    											 c_TextTail_Chat_Color);
    • Metin2 Dev 95
    • kekw 2
    • Eyes 1
    • Dislove 3
    • Angry 3
    • Not Good 3
    • Sad 2
    • Cry 1
    • Think 2
    • Confused 2
    • Lmao 3
    • Good 27
    • Love 7
    • Love 75
  4. 35 minutes ago, Ikarus_ said:

    i don't have any of these bugs (i m using martysama v4.9-extended).

    if you can post this method : void CInstanceBase::__SetAffect(UINT eAffect, bool isVisible)

    i will help you to fix your problems

    I fixed the problems, it was about 1 fix i had in my source .
    https://metin2.download/picture/SXBHowMoPIMiDjBHBAvekaAyBgaC9MNK/.png

    • Metin2 Dev 1
    • Dislove 1
    • Good 2
    • Love 2
  5. M2 Download Center

    This is the hidden content, please
    ( Internal )

    This is the hidden content, please
    ( GitHub )

    Spoiler

    07213498aac84ffd461949600298cd358165a5.p

     

    Hello , this is one of my first systems that i made for my pvp server 1-2 years ago and since then i was using it and it has no problems.

    I'm not a system's developer i only made things for my servers and this one i want to share with you.

     

     

    • Metin2 Dev 29
    • Cry 1
    • Confused 1
    • Good 10
    • Love 1
    • Love 26
  6. Hi , soon i will open an international pvm [Astro2.net] that i have been working for a long time. The server has reached the testing stage and I need people to help me ( the testers will receive at server opening md's depending on the time spent on the server and the bugs they found and also they can apply for helper/gm authority if they have serious intentions.

     

    I'm also looking for investitors with serious intentions.

     

    If you're interested and want to be part of our team , let me a private message.

    Thanks for your time .

  7. void CHARACTER::Destroy()
    {
        CloseMyShop();
    
        if (m_pkRegen)
        {
            if (m_pkDungeon) {
                if (m_pkDungeon->IsValidRegen(m_pkRegen, regen_id_)) {
                    --m_pkRegen->count;
                }
            } else {
                if (is_valid_regen(m_pkRegen))
                    --m_pkRegen->count;
            }
            m_pkRegen = NULL;
        }
    
        if (m_pkDungeon)
        {
            SetDungeon(NULL);
        }
    
    #ifdef __PET_SYSTEM__
        if (m_petSystem)
        {
            m_petSystem->Destroy();
            delete m_petSystem;
    
            m_petSystem = 0;
        }
    #endif
    
    #ifdef ENABLE_MOUNT_COSTUME_SYSTEM
        if (m_mountSystem)
        {
            m_mountSystem->Destroy();
            delete m_mountSystem;
            m_mountSystem = 0;
        }
        
        if(GetMountVnum())
        {
            RemoveAffect(AFFECT_MOUNT);
            RemoveAffect(AFFECT_MOUNT_BONUS);
        }
    #endif
    
        HorseSummon(false);
    
        if (GetRider())
            GetRider()->ClearHorseInfo();
    
        if (GetDesc())
            GetDesc()->BindCharacter(NULL);
    
        if (m_pkExchange)
            m_pkExchange->Cancel();
    
        SetVictim(NULL);
    
        if (GetShop())
        {
            GetShop()->RemoveGuest(this);
            SetShop(NULL);
        }
    
        ClearStone();
        ClearSync();
        ClearTarget();
    
        if (NULL == m_pkMobData)
        {
            DragonSoul_CleanUp();
            ClearItem();
        }
    
        LPPARTY party = m_pkParty;
        if (party)
        {
            if (party->GetLeaderPID() == GetVID() && !IsPC())
            {
                M2_DELETE(party);
            }
            else
            {
                party->Unlink(this);
    
                if (!IsPC())
                    party->Quit(GetVID());
            }
    
            SetParty(NULL);
        }
    
        if (m_pkMobInst)
        {
            M2_DELETE(m_pkMobInst);
            m_pkMobInst = NULL;
        }
    
        m_pkMobData = NULL;
    
        if (m_pkSafebox)
        {
            M2_DELETE(m_pkSafebox);
            m_pkSafebox = NULL;
        }
    
        if (m_pkMall)
        {
            M2_DELETE(m_pkMall);
            m_pkMall = NULL;
        }
    
        m_set_pkChrSpawnedBy.clear();
        StopMuyeongEvent();
        event_cancel(&m_pkWarpNPCEvent);
        event_cancel(&m_pkRecoveryEvent);
        event_cancel(&m_pkDeadEvent);
        event_cancel(&m_pkSaveEvent);
        event_cancel(&m_pkTimedEvent);
        event_cancel(&m_pkStunEvent);
        event_cancel(&m_pkFishingEvent);
        event_cancel(&m_pkPoisonEvent);
        event_cancel(&m_pkFireEvent);
        event_cancel(&m_pkPartyRequestEvent);
        event_cancel(&m_pkWarpEvent);
        event_cancel(&m_pkCheckSpeedHackEvent);
        event_cancel(&m_pkMiningEvent);
    
        for (itertype(m_mapMobSkillEvent) it = m_mapMobSkillEvent.begin(); it != m_mapMobSkillEvent.end(); ++it)
        {
            LPEVENT pkEvent = it->second;
            event_cancel(&pkEvent);
        }
        
        m_mapMobSkillEvent.clear();
        ClearAffect();
    
        for (TMapBuffOnAttrs::iterator it = m_map_buff_on_attrs.begin();  it != m_map_buff_on_attrs.end(); it++)
        {
            if (NULL != it->second)
            {
                M2_DELETE(it->second);
            }
        }
        m_map_buff_on_attrs.clear();
    
        event_cancel(&m_pkDestroyWhenIdleEvent);
    
        if (m_pSkillLevels)
        {
            M2_DELETE_ARRAY(m_pSkillLevels);
            m_pSkillLevels = NULL;
        }
    
        CEntity::Destroy();
    
        if (GetSectree())
            GetSectree()->RemoveEntity(this);
        
    #ifdef ENABLE_SYNC_HACK_FIX
        sync_hack = 0;
        sync_count = 0;
        sync_time = 0;
    #endif
    }

     

  8. Hello m2dev , i am working on my server and i solved a lot in it but with this problem i need some help .

    I don't know how to make this crashcore or when it happens and i don't have any idea of what is wrong.

     

    Here are the crashcore details:

    https://metin2.download/picture/43H0LcvF2D8Tgl9LQ27fSukhSD0a0n0N/.png

     

    clearitem function:

     

    void CHARACTER::ClearItem()
    {
    	int		i;
    	LPITEM	item;
    	
    	for (i = 0; i < INVENTORY_AND_EQUIP_SLOT_MAX; ++i)
    	{
    		if ((item = GetInventoryItem(i)))
    		{
    			item->SetSkipSave(true);
    			ITEM_MANAGER::instance().FlushDelayedSave(item);
    
    			item->RemoveFromCharacter();
    			M2_DESTROY_ITEM(item);
    
    			SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 255);
    		}
    	}
    	for (i = 0; i < DRAGON_SOUL_INVENTORY_MAX_NUM; ++i)
    	{
    		if ((item = GetItem(TItemPos(DRAGON_SOUL_INVENTORY, i))))
    		{
    			item->SetSkipSave(true);
    			ITEM_MANAGER::instance().FlushDelayedSave(item);
    
    			item->RemoveFromCharacter();
    			M2_DESTROY_ITEM(item);
    		}
    	}
    }

     

    and destroy function:

    void ITEM_MANAGER::DestroyItem(LPITEM item)
    {
    	if (item->GetSectree())
    		item->RemoveFromGround();
    
    	if (item->GetOwner())
    	{
    		if (CHARACTER_MANAGER::instance().Find(item->GetOwner()->GetPlayerID()) != NULL)
    		{
    			sys_err("DestroyItem: GetOwner %s %s!!", item->GetName(), item->GetOwner()->GetName());
    			item->RemoveFromCharacter();
    		}
    		else
    		{
    			sys_err ("WTH! Invalid item owner. owner pointer : %p", item->GetOwner());
    		}
    	}
    
    	TR1_NS::unordered_set<LPITEM>::iterator it = m_set_pkItemForDelayedSave.find(item);
    
    	if (it != m_set_pkItemForDelayedSave.end())
    		m_set_pkItemForDelayedSave.erase(it);
    
    	DWORD dwID = item->GetID();
    	sys_log(2, "ITEM_DESTROY %s:%u", item->GetName(), dwID);
    
    	if (!item->GetSkipSave() && dwID)
    	{
    		DWORD dwOwnerID = item->GetLastOwnerPID();
    
    		db_clientdesc->DBPacketHeader(HEADER_GD_ITEM_DESTROY, 0, sizeof(DWORD) + sizeof(DWORD));
    		db_clientdesc->Packet(&dwID, sizeof(DWORD));
    		db_clientdesc->Packet(&dwOwnerID, sizeof(DWORD));
    	}
    	else
    	{
    		sys_log(2, "ITEM_DESTROY_SKIP %s:%u (skip=%d)", item->GetName(), dwID, item->GetSkipSave());
    	}
    
    	if (dwID)
    		m_map_pkItemByID.erase(dwID);
    
    	m_VIDMap.erase(item->GetVID());
    	M2_DELETE(item);
    }
     
    any idea is welcome , thank you for your time.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.