CalculateEnduranceDecrement

All Helbreath Server Source Discussion here.
Post Reply
choymin
noob
Posts: 23
Joined: Tue Apr 06, 2004 2:34 am

Post by choymin »

my souce code is

Code: Select all

BOOL CGame::bCalculateEnduranceDecrement(short sTargetH, short sAttackerH, char cTargetType, int iArmorType)
{
 int iDownValue, iHammerChance, iItemIndex;

	iHammerChance = 100;
	iDownValue = 1;
	if (m_pClientList[sTargetH] == NULL) return FALSE;
	if ((cTargetType == DEF_OWNERTYPE_PLAYER) && (m_pClientList[sAttackerH] == NULL)) return FALSE;
	if ((cTargetType == DEF_OWNERTYPE_PLAYER) && (m_pClientList[sTargetH]->m_cSide != m_pClientList[sAttackerH]->m_cSide)) {
  switch (m_pClientList[sAttackerH]->m_sUsingWeaponSkill) {
  case 14: 
  	if ((((m_pClientList[sAttackerH]->m_sAppr2 & 0x0FF0) >> 4) == 31) || 
    (((m_pClientList[sAttackerH]->m_sAppr2 & 0x0FF0) >> 4) == 32)) {
    iItemIndex = m_pClientList[sAttackerH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_TWOHAND];
    if ((iItemIndex != -1) && (m_pClientList[sAttackerH]->m_pItemList[iItemIndex] != NULL)) {
    	if (m_pClientList[sAttackerH]->m_pItemList[iItemIndex]->m_sIDnum == 761) { // BattleHammer 
      iDownValue = 30;
    	}
    	else if (m_pClientList[sAttackerH]->m_pItemList[iItemIndex]->m_sIDnum == 762) { // GiantBattleHammer
      iDownValue = 35;
    	}
    	else if (m_pClientList[sAttackerH]->m_pItemList[iItemIndex]->m_sIDnum == 843) { // BarbarianHammer
      iDownValue = 30;
    	}
    	break;
    }
  	}
  	iDownValue = 20;
  	break;
  case 10: 
  	iDownValue = 3;
  	break;
  default: 
  	iDownValue = 1; 
  }
	}
	if (m_pClientList[sTargetH]->m_bIsSpecialAbilityEnabled == TRUE) {
  switch (m_pClientList[sTargetH]->m_iSpecialAbilityType)
  case 52: iDownValue = 0; iHammerChance = 0;
	}
	if ((m_pClientList[sTargetH]->m_cSide != 0) && (m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wCurLifeSpan > 0)) {
  m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wCurLifeSpan -= iDownValue;
	}
	if (m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wCurLifeSpan <= 0) {
  m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wCurLifeSpan = 0;
  SendNotifyMsg(NULL, sTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_cEquipPos, iArmorType, NULL, NULL);
  ReleaseItemHandler(sTargetH, iArmorType, TRUE);
  return TRUE;
	}
	if ((cTargetType == DEF_OWNERTYPE_PLAYER) && (m_pClientList[sAttackerH]->m_sUsingWeaponSkill == 14) && (iHammerChance == 100)) {
  if (m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wMaxLifeSpan < 2000) {
  	iHammerChance = iDice(6, (m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wMaxLifeSpan - m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wCurLifeSpan));
  }
  else {
  	iHammerChance = iDice(4, (m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wMaxLifeSpan - m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wCurLifeSpan));
  }
  if ((((m_pClientList[sAttackerH]->m_sAppr2 & 0x0FF0) >> 4) == 31) || 
  	(((m_pClientList[sAttackerH]->m_sAppr2 & 0x0FF0) >> 4) == 32)) {
  	iItemIndex = m_pClientList[sAttackerH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_TWOHAND];
  	if ((iItemIndex != -1) && (m_pClientList[sAttackerH]->m_pItemList[iItemIndex] != NULL)) {
    if (m_pClientList[sAttackerH]->m_pItemList[iItemIndex]->m_sIDnum == 761) { // BattleHammer 
    	iHammerChance = iHammerChance / 2; 
    }
    if (m_pClientList[sAttackerH]->m_pItemList[iItemIndex]->m_sIDnum == 762) { // GiantBattleHammer
    	iHammerChance -= (5 * iHammerChance) / 8;
    }
    if (m_pClientList[sAttackerH]->m_pItemList[iItemIndex]->m_sIDnum == 843) { // BarbarianHammer
    	iHammerChance = iHammerChance / 2;
    }
  	}
  	else {
    iHammerChance = iHammerChance / 4;
  	}
  	switch (m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_sIDnum) {
  	case 621:
  	case 622:
    iHammerChance = 0;
  	}
  	if (m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wCurLifeSpan > iHammerChance) {
    ReleaseItemHandler(sTargetH, iArmorType, TRUE);
    SendNotifyMsg(NULL, sTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_cEquipPos, iArmorType, NULL, NULL);
  	}
  }
	}
	return TRUE;
}
but it souce is wrong code

i need real hammer strip code

help me plz...

edit next time put it in code
tester
Outpost bitch
Posts: 544
Joined: Wed Jan 07, 2004 8:58 pm

Post by tester »

I got a question about this as well, endurance does drop every hit but it doesnt always get shown, for example it says ur flam got 200+ endu left and then one hit after it breaks, same for armor

how can i fix it that it will count down the proper way?
And u see the real amount of endu left?


Cheers tester
I support a woman's right to choose<br><br>- In the Mouth?<br>- In the Ass ?<br>- In the Vagina?<br>- Between the Tits?
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

tester wrote: I got a question about this as well, endurance does drop every hit but it doesnt always get shown, for example it says ur flam got 200+ endu left and then one hit after it breaks, same for armor

how can i fix it that it will count down the proper way?
And u see the real amount of endu left?


Cheers tester
Best way it to code weapons client side. Every attack -1 endurance. That's something that was just never coded and still hasn't been coded. As for armors, the server never updates the clients on their armor until they request full info on it (pick up/trade)
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
tester
Outpost bitch
Posts: 544
Joined: Wed Jan 07, 2004 8:58 pm

Post by tester »

bone-you wrote:
tester wrote: I got a question about this as well, endurance does drop every hit but it doesnt always get shown, for example it says ur flam got 200+ endu left and then one hit after it breaks, same for armor

how can i fix it that it will count down the proper way?
And u see the real amount of endu left?


Cheers tester
Best way it to code weapons client side. Every attack -1 endurance. That's something that was just never coded and still hasn't been coded. As for armors, the server never updates the clients on their armor until they request full info on it (pick up/trade)
After a dc from client the right weapon endu is shown right?

Cheers tester
I support a woman's right to choose<br><br>- In the Mouth?<br>- In the Ass ?<br>- In the Vagina?<br>- Between the Tits?
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

tester wrote:
bone-you wrote:
tester wrote: I got a question about this as well, endurance does drop every hit but it doesnt always get shown, for example it says ur flam got 200+ endu left and then one hit after it breaks, same for armor

how can i fix it that it will count down the proper way?
And u see the real amount of endu left?


Cheers tester
Best way it to code weapons client side. Every attack -1 endurance. That's something that was just never coded and still hasn't been coded. As for armors, the server never updates the clients on their armor until they request full info on it (pick up/trade)
After a dc from client the right weapon endu is shown right?

Cheers tester
Yea because the client gets full data on everything. On map switches it should too.
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
choymin
noob
Posts: 23
Joined: Tue Apr 06, 2004 2:34 am

Post by choymin »

now is strip 1 attack 1strip
strip is 99% hight

i want 20% strip code

help me plz
Post Reply