Jump to content

Xaleas

Inactive Member
  • Posts

    24
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Xaleas

  1. Hello,

     

    I want the group leaders to be able to give themselves a group buff.

     

    What i try:

     

    (ENABLE_PARTY_BUFF_LEADER)

     

    party.cpp

    bool CParty::SetRole(DWORD dwPID, BYTE bRole, bool bSet)

    Spoiler
    
    bool CParty::SetRole(DWORD dwPID, BYTE bRole, bool bSet)
    {
    	TMemberMap::iterator it = m_memberMap.find(dwPID);
    
    	if (it == m_memberMap.end())
    	{
    		return false;
    	}
    
    	LPCHARACTER ch = it->second.pCharacter;
    
    	if (bSet)
    	{
    		if (m_anRoleCount[bRole] >= m_anMaxRole[bRole])
    			return false;
    #if not defined(ENABLE_PARTY_BUFF_LEADER)
    		if (it->second.bRole != PARTY_ROLE_NORMAL)
    			return false;
    #endif
    		it->second.bRole = bRole;
    
    		if (ch && GetLeader())
    			ComputeRolePoint(ch, bRole, true);
    
    		if (bRole < PARTY_ROLE_MAX_NUM)
    		{
    			++m_anRoleCount[bRole];
    		}
    		else
    		{
    			sys_err("ROLE_COUNT_INC_ERROR: INDEX(%d) > MAX(%d)", bRole, PARTY_ROLE_MAX_NUM);
    		}
    	}
    	else
    	{
    		if (it->second.bRole == PARTY_ROLE_LEADER)
    			return false;
    
    		if (it->second.bRole == PARTY_ROLE_NORMAL)
    			return false;
    
    		it->second.bRole = PARTY_ROLE_NORMAL;
    
    		if (ch && GetLeader())
    			ComputeRolePoint(ch, PARTY_ROLE_NORMAL, false);
    
    		if (bRole < PARTY_ROLE_MAX_NUM)
    		{
    			--m_anRoleCount[bRole];
    		}
    		else
    		{
    			sys_err("ROLE_COUNT_DEC_ERROR: INDEX(%d) > MAX(%d)", bRole, PARTY_ROLE_MAX_NUM);
    		}
    	}
    
    	SendPartyInfoOneToAll(dwPID);
    	return true;
    }

     

     

     

    And remove at uiparty.py in (def OnMouseLeftButtonDown(self):) :

    Spoiler
    
    		if player.IsPartyLeader(player.GetMainCharacterIndex()):
    			if player.PARTY_STATE_LEADER != self.state:
    
                  if self.isShowStateButton:
                      self.__HideStateButton()
    
                  else:
                      self.__ShowStateButton()
    
    to:
      
      		if player.IsPartyLeader(player.GetMainCharacterIndex()):
    			# if player.PARTY_STATE_LEADER != self.state:
    
    			if self.isShowStateButton:
    				self.__HideStateButton()
    
    			else:
    				self.__ShowStateButton()

     

     

    I can now give myself a buff but lose the leader rank in the group and thats a big problem.

     

    Someone have maybe a idea?

     

    Thanks for any help!

     

     

     

     

  2. I inserted everything like in your updated post and the calculation is way too high, realy strange.

     

    070a6c3e6e32b255684609f1b6d249d6.png

     

    battle.cpp:

    Spoiler
    
    
    
    #ifdef __SASH_SYSTEM__ //replace it with your define for sash
    static void ApplySashAttackValue(LPITEM pkItem, int* pdamMin, int* pdamMax) 
    {
    	LPCHARACTER ch = pkItem ? pkItem->GetOwner() : NULL;
    	if (!ch)
    		return;
    
    	LPITEM sashItem = ch->GetWear(WEAR_COSTUME_SASH);
    	if (!sashItem)
    		return;
    
    	TItemTable* pkItemAbsorbed = ITEM_MANAGER::instance().GetTable(sashItem->GetSocket(SASH_ABSORBED_SOCKET));
    	if (!pkItemAbsorbed)
    		return;
    
    	if (pkItemAbsorbed->bType != ITEM_WEAPON)
    		return;
    
    	double AttBonusMax = static_cast<double>(pkItemAbsorbed->alValues[4] + pkItemAbsorbed->alValues[5]);
    	AttBonusMax *= sashItem->GetSocket(SASH_ABSORBED_SOCKET);
    	AttBonusMax /= 100;
    	AttBonusMax += 0.5;
    
    	double AttBonusMin = static_cast<double>(pkItemAbsorbed->alValues[3] + pkItemAbsorbed->alValues[5]);
    	AttBonusMin *= sashItem->GetSocket(SASH_ABSORBED_SOCKET);
    	AttBonusMin /= 100;
    	AttBonusMin += 0.5;
    
    	//todebug
        if(ch->GetDesc()->IsPhase(PHASE_GAME))
        	ch->ChatPacket(CHAT_TYPE_INFO, "Going to add to your attack : min(%0.2f) max(%0.2f) ", AttBonusMin, AttBonusMax);
          
    	*pdamMax += static_cast<int>(AttBonusMax);
    	*pdamMin += static_cast<int>(AttBonusMin);
    }
    #endif
    
    
    void Item_GetDamage(LPITEM pkItem, int* pdamMin, int* pdamMax)
    {
    	*pdamMin = 0;
    	*pdamMax = 1;
    
    	if (!pkItem)
    		return;
    
    	switch (pkItem->GetType())
    	{
    		case ITEM_ROD:
    		case ITEM_PICK:
    			return;
    	}
    
    	if (pkItem->GetType() != ITEM_WEAPON)
    		sys_err("Item_GetDamage - !ITEM_WEAPON vnum=%d, type=%d", pkItem->GetOriginalVnum(), pkItem->GetType());
    
    	*pdamMin = pkItem->GetValue(3);
    	*pdamMax = pkItem->GetValue(4);
    
    #ifdef __SASH_SYSTEM__ //replace it with your define for sash
    	ApplySashAttackValue(pkItem, pdamMin, pdamMax);
    #endif
    }

     

     

    Output from __UpdateBattleStatus():

     

    1112 09:50:16783 :: Going to add to your points : wep(min 92.000000  max 104.000000)  mag(min 100.250000  max115.750000)
    1112 09:53:16584 :: Going to add to your points : wep(min 92.000000  max 104.000000)  mag(min 100.250000  max115.750000)

     

    Old calculation from item.cpp:

    Spoiler
    
    
    else if (pkItemAbsorbed->bType == ITEM_WEAPON)
    			{
    				long lAttGrade = pkItemAbsorbed->alValues[4] + long(pkItemAbsorbed->alValues[5] * 2);
    				if (pkItemAbsorbed->alValues[3] > pkItemAbsorbed->alValues[4])
    					lAttGrade = pkItemAbsorbed->alValues[3] + long(pkItemAbsorbed->alValues[5] * 2);
    				
    				double dValue = lAttGrade * GetSocket(SASH_ABSORPTION_SOCKET);
    				dValue = (double)dValue / 100;
    				dValue = (double)dValue + .5;
    				lAttGrade = (long) dValue;
    				if (((pkItemAbsorbed->alValues[3] > 0) && (lAttGrade < 1)) || ((pkItemAbsorbed->alValues[4] > 0) && (lAttGrade < 1)))
    					lAttGrade += 1;
    				else if ((pkItemAbsorbed->alValues[3] > 0) || (pkItemAbsorbed->alValues[4] > 0))
    					lAttGrade += 1;
    				
    				m_pOwner->ApplyPoint(APPLY_ATT_GRADE_BONUS, bAdd ? lAttGrade : -lAttGrade);
    				
    				long lAttMagicGrade = pkItemAbsorbed->alValues[2] + long(pkItemAbsorbed->alValues[5] * 2);
    				if (pkItemAbsorbed->alValues[1] > pkItemAbsorbed->alValues[2])
    					lAttMagicGrade = pkItemAbsorbed->alValues[1] + long(pkItemAbsorbed->alValues[5] * 2);
    				
    				dValue = lAttMagicGrade * GetSocket(SASH_ABSORPTION_SOCKET);
    				dValue = (double)dValue / 100;
    				dValue = (double)dValue + .5;
    				lAttMagicGrade = (long) dValue;
    				if (((pkItemAbsorbed->alValues[1] > 0) && (lAttMagicGrade < 1)) || ((pkItemAbsorbed->alValues[2] > 0) && (lAttMagicGrade < 1)))
    					lAttMagicGrade += 1;
    				else if ((pkItemAbsorbed->alValues[1] > 0) || (pkItemAbsorbed->alValues[2] > 0))
    					lAttMagicGrade += 1;
    				
    				m_pOwner->ApplyPoint(APPLY_MAGIC_ATT_GRADE, bAdd ? lAttMagicGrade : -lAttMagicGrade);
    			}

     

     

  3. Hello,

    I want add my Rings in Costume Window and have a Problem with the tooltip.

    https://metin2.download/picture/bBipB4iQfNzXt4I34u9XMo5zor60b5hS/.gif

     

    Wen i go with the mouse over the item they dont show anything, but in normal invnetory it show all.

    Also i can not use right click on the ring or belt.

     

    i add under uiinventory.py -> def RefreshCostumeSlot(self):

    for i in xrange(player.NEW_EQUIPMENT_SLOT_COUNT):
                slotNumber = player.NEW_EQUIPMENT_SLOT_START + i
                self.wndEquip.SetItemSlot(slotNumber, getItemVNum(slotNumber), 0)

     

    But it only help to show the icon.

     

    I hope someone cvan help me, many thanks!

     

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