Jump to content

Frozen

Inactive Member
  • Posts

    199
  • Joined

  • Last visited

  • Days Won

    7
  • Feedback

    0%

Posts posted by Frozen

  1. 1 hour ago, WhoIsNice said:

    I discovered another strange error, apparently when I have 1 and 2 full inventory and some items in other inventories, when I log out and log in again, the symbol appears in items, and it seems more strange is that appears on items in all inventories less than second, I don't know if I'm the only one ...

    Before logging out, had tested in put the second full inventory as well, the difference is that I removed the symbols of the items in the first inventory and left on the symbol in the second inventory, when I log in, the second inventory didn't show the symbols in the items but the first appeared

    P.s: I don't want you to take this the wrong way, I'm just testing various forms of case any errors

    Regards!

     

    EDIT: And tested now also left 2 items in the first inventory and I did log out with the second inventory, when I log in, the items in the first inventory appear again with the symbol

    Didn't understand, can you show a video or a gif?

  2. #EDIT

    Bug in second inventory solution:

    Search for:

     

    def OverInItem(self, overSlotPos):
    
     

    add under:

     

    slotPos = overSlotPos
    
     

    replace with this in the end of the function:

     

    if overSlotPos in constInfo.NEWITEMS:
    	            self.wndItem.EnableCoverButton(slotPos)    
    	            constInfo.NEWITEMS.remove(overSlotPos)
    
     
    • Love 1
  3. 8 minutes ago, miguelmig said:

    Well, it's quite common for python systems to use constinfo.py to store data, but that usually causes to things to stop working when a player has multiple clients open, since it appears that the constinfo data is shared between clients, or so it was in the old clients, but I'm pretty sure that it will still happen, give it a try

    Thats incorrect, every time you open client, it gets the constInfo varables and they are set in the client you are in. So you can open as many clients as you want it will have the default constInfo variables and not the ones in the other client open. Every time you set a variable in constInfo is like you are defining in your code, so the storage work like a variable not has a file.

    I dont know if you understand, sorry for my bad english,

     

  4. 54 minutes ago, WhoIsNice said:

    Great job! Thank you for sharing


    I tested and i found a weird bug, when you have more than 2 inventory's, it seems a little bug, because when you move to another slot appear the icon saying "new" again and when you put the mouse under the item the "new" dont disappear, you need to open another inventory and open again the inventory were you have the item and then disappear "new" ...
    Sorry for my bad english!
     
    You have my like for sharing :lol:

    Oh i didnt notice that! Thanks for detecting that bug i will see what i can do.

    Kind Regards 

    7 minutes ago, miguelmig said:

    This will work terribly if a player decides to open 2 clients on the same machine at the same time

    What?? Why you say that?

  5. M2 Download Center

    This is the hidden content, please
    ( Internal )

     

    Hello, im here today releasing my version of slot effect system. Is not the same as the official looks like but in the future i will update this to look the same.

    Screenshot to see how it looks like.

    Spoiler

    ZgBtvp7.png

    Everything in this system was made by me.

    Tutorial:

    Go to UserInterface > PythonPlayer.cpp

    Search for :

     

    void CPythonPlayer::SetItemData(TItemPos Cell, const TItemData & c_rkItemInst)
    
     

    Add in  the end of the funcion:

     

    PyCallClassMemberFunc(m_ppyGameWindow, "OnNewItem", Py_BuildValue("(i)", Cell.cell));
    
     

    Compile It.

    Go to root > constInfo.py

    Add this somewhere:

     

    NEWITEMS = []
    
     

    Save it.

    Go to root > game.py

    Add this function:

     

    def OnNewItem(self, cell):
    	if not cell in constInfo.NEWITEMS:
    		constInfo.NEWITEMS.append(cell)
    
     

    Save It.

    Go to root > uiinventory.py

    Search for :

     

    def RefreshBagSlotWindow(self):
    
     

    Add this before this: (if 0 == itemCount:) :

     

    if itemCount == 0 and slotNumber in constInfo.NEWITEMS:
    	constInfo.NEWITEMS.remove(slotNumber)
     
    

    Add this under this: (setItemVNum(i, itemVnum, itemCount)) :

     

    self.wndItem.EnableCoverButton(i)        
     if slotNumber in constInfo.NEWITEMS:
    	self.wndItem.SetCoverButton(i, "d:/ymir work/ui/game/quest/slot_button_00.sub",\
    																		 "d:/ymir work/ui/game/quest/slot_button_00.sub",\
    																		"d:/ymir work/ui/game/quest/slot_button_00.sub",\
    																		"d:/ymir work/ui/new_icon.tga", FALSE, FALSE)
    	 self.wndItem.DisableCoverButton(i)
    
     

    Search for:

     

    def OverInItem(self, overSlotPos):
    
     Add under:

     

    slotPos = overSlotPos
    
     

    Add in the end:

     

    if overSlotPos in constInfo.NEWITEMS:
    	self.wndItem.EnableCoverButton(slotPos)    
    	constInfo.NEWITEMS.remove(overSlotPos)
    
     

    Save It.

    Finally go to ymirwork/ui and add this file:

    This is the hidden content, please

    Pack root and etc.

    Have fun :)

     

    This may not be the most optimized way to do this system, but at least you have a way. In the future i will post more updates such as a more optimized versions and with official effects.

    If you find any bugs please post it.

    #UPDATE

    Spoiler

     

    I found a little bug that is if you move the item too quickly the item will count as new. Thats because normally if you do at normal speed you should be with your mouse over in item when it is attach to inventory so the code will remove it. But when you are at a faster sometimes you wont call mouse over in function.

    Solution:

    Goto uiinventory.py

    Search for:

    
    
    self.wndCostume = None
    
    
    Add under:
    
    
    
    self.movedSlot = -1
    
    
    search for:
    
    
    
    itemCount = getItemCount(slotNumber)
    
    
     add under:
    
    
    
    if self.movedSlot in constInfo.NEWITEMS:
    	 constInfo.NEWITEMS.remove(self.movedSlot)
    
    
     search for:
    
    def __SendMoveItemPacket(self, srcSlotPos, dstSlotPos, srcItemCount):
    
    
     

    add under:

    
    
    self.movedSlot = dstSlotPos
    
    
     

     

     

     

    Kind Regards,

    Frozen

     

    • Metin2 Dev 31
    • Not Good 1
    • Good 10
    • Love 2
    • Love 37
  6. 25 minutes ago, BackPlayer said:

    You forgot this part:

     

    Spoiler

     

    Server-Source, char.cpp

    Search for:

    
    if (IsPC() == true && (LC_IsEurope() == true || LC_IsCanada() == true || LC_IsSingapore() == true))

    Replace the complete if-statement with: 

    
    		if ((IsPC() || IsMonster() || IsPet()) == true)
    		{
    			addPacket.dwLevel = GetLevel();
    		}
    		else
    		{
    			addPacket.dwLevel = 0;
    		}


     

     

  7. 20 minutes ago, BackPlayer said:

    you can say after teleport mount again the previoulsy mount, just i don't know the fuction and syntax of lua and if you can prefer C++ fix.

    Thanks you for the reply!

    You just need to put the mob item vnum(item) and the mount vnum (vnum). 

     

    quest mount_bug begin
    	state start begin
    		when item.use begin
    			local mountNum = {
    			[item] = vnum
    			}
    			if pc.is_mount() then pc.setqf("mount", 0)
    			else pc.setqf("mount", mountNum[item.get_vnum()]) end
    		end
    		when login with pc.getqf("mount") > 0 begin
    			pc.mount(pc.getqf("mount"), 60*60*24*60) --time set for 60 days
    		end
    	end
    end
    
     
  8. For the second problem try using one of this quests:

     

    quest mount_bug begin
    	state start begin
    		when login with pc.is_mount() begin
    			pc.unmount()
    			pc.mount(vnum)
    		end
    	end
    end
    quest mount_bug begin
    	state start begin
    		when item.use begin
    			if pc.is_mount() then pc.setqf("is_mount", 0)
    			else pc.setqf("is_mount", 1) end
    		end
    		when login with pc.getqf("is_mount") == 1 begin
    			pc.unmount()
    			pc.mount(vnum)
    		end
    	end
    end
    
    
     

    Im not sure if the first quest will work , because i dont know if when the player teleports he still has the is_mount() information so try both quests.

    Dont forget to change the item and the vnum in the quest.

×
×
  • 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.