Jump to content

Shang

Member
  • Posts

    276
  • Joined

  • Last visited

  • Days Won

    7
  • Feedback

    0%

Posts posted by Shang

  1. hace 20 minutos, Johnny69 dijo:

    Very good code. Thanks.

      Hide contents
    
    
    ### root/ui.py
    ### Search:
    	def SetSlotCoolTimeColor(self, slotIndex, r, g, b, a):
    		wndMgr.SetSlotCoolTimeColor(self.hWnd, slotIndex, r, g, b, a)
    ### Add after:		
    	def StoreSlotCoolTime(self, key, slotIndex, coolTime, elapsedTime = 0.0):
    		wndMgr.StoreSlotCoolTime(self.hWnd, key, slotIndex, coolTime, elapsedTime)
    	
    	def RestoreSlotCoolTime(self, key):
    		wndMgr.RestoreSlotCoolTime(self.hWnd, key)

     

     

    Yeah, I forgot it xD.

  2. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Hi devs, today I will release the fix I made for the skill cooldown, already fixed on official servers, this is the bug it self:

    13c5fd983b.gif

    And this is the fix:

    b1c09dd1bd.gif

    Regards!

    This is the hidden content, please

    ### root/ui.py
    ### Search:
    	def SetSlotCoolTimeColor(self, slotIndex, r, g, b, a):
    		wndMgr.SetSlotCoolTimeColor(self.hWnd, slotIndex, r, g, b, a)
    ### Add after:		
    	def StoreSlotCoolTime(self, key, slotIndex, coolTime, elapsedTime = 0.0):
    		wndMgr.StoreSlotCoolTime(self.hWnd, key, slotIndex, coolTime, elapsedTime)
    	
    	def RestoreSlotCoolTime(self, key):
    		wndMgr.RestoreSlotCoolTime(self.hWnd, key)

     

    On 12/24/2017 at 9:19 AM, Horinna said:

    HI,

    thank you. :) Everything work.

    But what is with THIS "classic" bug? @Shang
    459c2a4ac0cc3f0dd1875106ed009c6b.gif

    Thanks to @Horinna for report that bug.

    Here's the fix:

    """ Find this:
    
    					elif (not self.__CanUseSkillNow()) or (skillGrade != j):
    						skillPage.SetSlotCount(realSlotIndex, 0)
    						skillPage.DisableCoverButton(realSlotIndex)
    
    Add this under:"""
    
    						skillPage.DeactivateSlot(realSlotIndex)
    						
    # After the else, paste this:
    
    					if player.IsSkillActive(slotIndex) and (skillGrade == j): # fix001
    						skillPage.ActivateSlot(realSlotIndex)
    
    # The if should look like this:
    
    					if (skillGrade == skill.SKILL_GRADE_COUNT) and j == (skill.SKILL_GRADE_COUNT-1):
    						skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel)
    					elif (not self.__CanUseSkillNow()) or (skillGrade != j):
    						skillPage.SetSlotCount(realSlotIndex, 0)
    						skillPage.DisableCoverButton(realSlotIndex)
    						skillPage.DeactivateSlot(realSlotIndex) # fix
    					else:
    						skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel)
    						
    					if player.IsSkillActive(slotIndex) and (skillGrade == j): # fix
    						skillPage.ActivateSlot(realSlotIndex)

     

    • Metin2 Dev 80
    • kekw 1
    • Eyes 1
    • Not Good 1
    • Confused 1
    • Good 15
    • Love 2
    • Love 58
  3. hace 34 minutos, ragem0re dijo:

    published long time ago:

     

    or is there any improvement?

     

    What Ken published is nothing.

     

    hace 50 minutos, Exygo dijo:

    What does this do?

    This is what it does: 

    tKhTZiIwTom5_remGkyx2w.png

    This is only a rendering of an image, published by Mijago with FineListBox for his last switchbot.

    Spoiler

    This is what I mean with Mijago's FineListBox:

    2e9071062b684c898ed968880d96c8eb.gif

    This is what it does:

    Spoiler

    pomZ7_LWTOiiYypGKneM0w.gif

    Otherwise thanks for the release.

  4. hace 4 horas, masodikbela dijo:

    Does the window have "float" flag anywhere? Because it looks like the same when you add "float" to a window. Also as far as I remember it should work with scaled windows...

    It doesn't but think it was my fault, because I added the alpha sensitive directly to the board object.

  5. En 28/6/2017 a las 8:52, txtxtx dijo:

    Why all this fuss only Search
    1-char_battle.cpp

    this

    
    void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
    {
    	if (IsDead())
    		return;
    
    	{
    		if (IsHorseRiding())
    		{
    			StopRiding();
    		}
    		else if (GetMountVnum())
    		{
    			RemoveAffect(AFFECT_MOUNT_BONUS);
    			m_dwMountVnum = 0;
    			UnEquipSpecialRideUniqueItem();
    
    			UpdatePacket();
    		}
    	}

    Edit to

    
    void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
    {
    	if (IsDead())
    		return;
    
    	{
    /*		if (IsHorseRiding())
    		{
    			StopRiding();
    		}
    		else if (GetMountVnum())
    		{
    			RemoveAffect(AFFECT_MOUNT_BONUS);
    			m_dwMountVnum = 0;
    			UnEquipSpecialRideUniqueItem();
    
    			UpdatePacket();
    		}*/
    	}

    All right

    Did you test what you wrote?

    If i'm not wrong, if u die and not unmount the horse, the player won't do the die animation, it will die but you will see it ridding the horse.

  6. En 10/7/2017 a las 1:54, Mali61 dijo:

     

     

      Hide contents

     

    Userinterface/PythonBackground.cpp:

    Find:

    
    
    case SHADOW_ALL_HIGH:
                rkMap.SetDrawShadow(true);    
                rkMap.SetDrawCharacterShadow(true);
                rkMap.SetShadowTextureSize(1024);
                break;

    Change:

    
    
    case SHADOW_ALL_HIGH:
                rkMap.SetDrawShadow(true);    
                rkMap.SetDrawCharacterShadow(true);
                rkMap.SetShadowTextureSize(1024*2);
                break;

     

     

    It is not necessary to change anything in the PythonBackground.cpp because there is already another level of shadow that makes what you want to do.

    Changing the shadow level to 5 is enough. The level 5 is the highest level.

    yK7_fNvYRDS4OAFYRP-Ndw.png

    • Love 1
  7. 	int pc_get_rank(lua_State* L)
    	{
    		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    		if (!ch)
    		{
    			lua_pushnumber(L, 0);
    			return 1;
    		}
    	
    		char szQuery[512];
    		snprintf(szQuery, sizeof(szQuery), "SELECT rank FROM player.player WHERE name='%s'", ch->GetName());
    		std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(szQuery));
    		
    		if (pMsg->Get()->uiNumRows > 0)
    		{
    			MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
    
    			int iRank = 0;
    			str_to_number(iRank, row[0]);
    			lua_pushnumber(L, iRank);
    			return 1;
    		}
    		
    		lua_pushnumber(L, 0);
    		return 1;
    	}

    You are not pushing the query return value, you're pushing 0 all the time.

    Not tested. Oh, and it is better to declare first the LPCHARACTER to avoid core crashes if it doesn't exists.

    PS: Where did you get the Dev member? In a bet?

    • Love 3
  8. hace 58 minutos, Tasho dijo:

    I speaking about python not lua oh my god and what error say.

    
    0617 03:07:26595 :: IndexError
    0617 03:07:26595 :: : 
    0617 03:07:26595 :: list index out of range
    0617 03:07:26595 :: 

    Already i give him a option to check it list by catID if exist, you give him "has_key" what is totally wrong.

    
    if int(catId) in self.items:

    I was speaking about your "has_key" on list python, how you can explain that if you say "you not was blind".

    You should learn bit python (because as i see you didn't know syntax of lua and python), maybe that say you something.

    
    if self.items.has_key(int(catId)):
    
    python 'list' object has no attribute 'has_key'

     

    I'm not trying to offense you, but as i say there was a list not a dictionary, because if  was dictionary was get KeyError not list index out of range, or maybe i'm wrong?

    @NeXoN

    That should solved your problem.

    
    def SelectCategory(self, catId):
    	categoryID = int(catId)
    
    	if self.selectedCategory == categoryID or categoryID not in self.items:
    		return
    
    	self.selectedCategory = categoryID
    	self.categoryList.SetButtonDown(categoryID)
    	self.itemList.ClearItems()
    
    	for item in self.items[categoryID]:
    		self.itemList.InsertItem(item[0], item[1], item[2], item[3], item[4], item[5], item[6])

     

    PS: @Shang

    
    itemsList = []
    print (itemsList[999])
    
    #Traceback (most recent call last):
    #File "python", line 2, in <module>
    #IndexError: list index out of range
    
    
    itemsDict = {}
    print (itemsDict[999])
    
    #Traceback (most recent call last):
    #File "python", line 2, in <module>
    #KeyError: 999

     

    PS: Now i hope you understand what is list and what is dictionary, have a nice day.

    I didn't read it was a lua list, i thought it was a python dictionary, sorry sir.

  9. hace 15 horas, NeXoN dijo:

     

    
    items = {
    				[1] = {
    						[1] = {299, 1, 30, 1, "x"},

     

     

    hace 1 hora, Tasho dijo:

    Array Is a list theoretical , not a dictionary :D, 'list' no have attribute 'has_key', so that doesn't work.

    The check of list value should look like that, a simple version:

    
    if int(catId) in self.items:
    	# do something

    I thought I was blind, but not, I see a dictionary here not a "theorical list".

    PS: Try to help not to correct others word.

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