Hammer Strip

All Helbreath Server Source Discussion here.
omar_omiez
Loyal fan
Posts: 235
Joined: Mon Jul 12, 2004 9:36 am

Post by omar_omiez »

anyone code it right yet? all i can do now is to reduce the endurance taken off by the hammer on the armor. and when finally endu 0 then it is unequipped.
- Tbone<br><a href="http://cyborg.namedecoder.com"><br><img src="http://cyborg.namedecoder.com/webimages ... ng"<br></a>
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

i think you must rewrite

Code: Select all

void CGame::CalculateEnduranceDecrement(short sTargetH, short sAttackerH, char cTargetType, int iArmorType)
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
omar_omiez
Loyal fan
Posts: 235
Joined: Mon Jul 12, 2004 9:36 am

Post by omar_omiez »

does the hammer strip in 2.24b sources work? thx again.
void CGame::CalculateEnduranceDecrement(short sTargetH, short sAttackerH, char cTargetType, int iArmorType)
{
short sItemIndex;
int iDownValue = 1, iHammerChance = 100;
if (m_pClientList[sTargetH] == NULL) return;
if ((cTargetType == DEF_OWNERTYPE_PLAYER) && (m_pClientList[sAttackerH] != NULL)) {
if ((cTargetType == DEF_OWNERTYPE_PLAYER) && (m_pClientList[sTargetH]->m_cSide != m_pClientList[sAttackerH]->m_cSide)) {
switch (m_pClientList[sAttackerH]->m_sUsingWeaponSkill) {
case 14:
          if ((31 == ((m_pClientList[sAttackerH]->m_sAppr2  & 0x0FF0) >> 4)) || (32 == ((m_pClientList[sAttackerH]->m_sAppr2  & 0x0FF0) >> 4))) {
sItemIndex = m_pClientList[sAttackerH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_TWOHAND];
      if ((sItemIndex != -1) && (m_pClientList[sAttackerH]->m_pItemList[sItemIndex] != NULL)) {
      if (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 761) { // BattleHammer
iDownValue = 30;
break;
      }
      if (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 762) { // GiantBattleHammer
iDownValue = 35;
break;
      }
      if (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 843) { // BarbarianHammer
iDownValue = 30;
break;
      }
}
}
else {
iDownValue = 20; break;
}
case 10: iDownValue = 3; break;
default: iDownValue = 1; break;
}

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;
  }

  <span style='color:red'>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;</span>
or i write it like this?
if (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 843) { // BarbarianHammer

iDownValue = 30;
<span style='color:red'>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;</span>
break;

thx.

- Tbone<br><a href="http://cyborg.namedecoder.com"><br><img src="http://cyborg.namedecoder.com/webimages ... ng"<br></a>
Ice-T
Loyal fan
Posts: 262
Joined: Sat Oct 18, 2003 8:51 am
Location: nowere

Post by Ice-T »

ull find that once the armor endurance reaches below 0 it will jump to 65500 ~~
<img src='http://www.prism.gatech.edu/~gtg818f/basesig.gif' border='0' alt='user posted image' /><br><img src='http://img228.imageshack.us/img228/439/steam1tf.gif' border='0' alt='user posted image' />
omar_omiez
Loyal fan
Posts: 235
Joined: Mon Jul 12, 2004 9:36 am

Post by omar_omiez »

erm t, mopre clues pls. so i assume the second code is the correct one?
if (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 843) { // BarbarianHammer

iDownValue = 30;
if (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;
break;
without teh
m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wCurLifeSpan = 0;
since u said that if endu 0 it jumps to 65500, then remove it will do? or not?


thx guys for helping me learn to code.
- Tbone<br><a href="http://cyborg.namedecoder.com"><br><img src="http://cyborg.namedecoder.com/webimages ... ng"<br></a>
Jaap
Loyal fan
Posts: 390
Joined: Thu Apr 22, 2004 8:21 am

Post by Jaap »

Ice-T wrote: ull find that once the armor endurance reaches below 0 it will jump to 65500 ~~
wow you finally figured out it's an unsigned short?
Slipknight
Loyal fan
Posts: 423
Joined: Thu Apr 07, 2005 7:53 pm

Post by Slipknight »

wtf im usuing popics code on my sources and for some reason its not working, and I think its because it will only unequip there item once its at 0 endu but thats kinda gay and the original strip dun do that so wtf goin on? No one nail it right yet?
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>
CDWriter
Member
Posts: 123
Joined: Sun Feb 22, 2004 12:08 am

Post by CDWriter »

I guess ....This will help

Code: Select all

void CGame::CalculateEnduranceDecrement(short sTargetH, short sAttackerH, char cTargetType, int iArmorType)
{
 short sItemIndex;
 int iDownValue = 1, iHammerChance = 100;

	if (m_pClientList[sTargetH] == NULL) return;

	if ((cTargetType == DEF_OWNERTYPE_PLAYER) && (m_pClientList[sAttackerH] != NULL )) {
  if ((cTargetType == DEF_OWNERTYPE_PLAYER) && (m_pClientList[sTargetH]->m_cSide != m_pClientList[sAttackerH]->m_cSide)) {
  	switch (m_pClientList[sAttackerH]->m_sUsingWeaponSkill) {
    case 14: 
    	if ((31 == ((m_pClientList[sAttackerH]->m_sAppr2  & 0x0FF0) >> 4)) || (32 == ((m_pClientList[sAttackerH]->m_sAppr2  & 0x0FF0) >> 4))) {
      sItemIndex = m_pClientList[sAttackerH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_TWOHAND];
      if ((sItemIndex != -1) && (m_pClientList[sAttackerH]->m_pItemList[sItemIndex] != NULL)) {
      	if (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 1761) { // BattleHammer 
        iDownValue = 30;
        break;
      	}
      	if (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 762) { // GiantBattleHammer
        iDownValue = 35;
        break;
      	}
      	if (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 843) { // BarbarianHammer
        iDownValue = 30;
        break;
      	}
      }
    	}
    	else { 
      iDownValue = 20; break;
    	}
    case 10: iDownValue = 3; break;
    default: iDownValue = 1; break;
    }

    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 > 64000)) {
  	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;
  }

	try
	{
  if (m_pClientList[sAttackerH] != NULL) {
  	if (cTargetType == DEF_OWNERTYPE_PLAYER) {
    sItemIndex = m_pClientList[sAttackerH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_TWOHAND];
    if ((sItemIndex != -1) && (m_pClientList[sAttackerH]->m_pItemList[sItemIndex] != NULL)) {
    	if ((m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 617) || (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 618) || (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 619) || (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 873) || (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 874) || (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 75) || (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 76)) { 
      m_pClientList[sAttackerH]->m_sUsingWeaponSkill = 6;
      return;
    	}
    }
  	}
  }

  if (m_pClientList[sAttackerH] != NULL) {
  if (cTargetType == DEF_OWNERTYPE_PLAYER) {
  if ((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 ((31 == ((m_pClientList[sAttackerH]->m_sAppr2  & 0x0FF0) >> 4)) || (32 == ((m_pClientList[sAttackerH]->m_sAppr2  & 0x0FF0) >> 4))) {
    sItemIndex = m_pClientList[sAttackerH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_TWOHAND];
    if ((sItemIndex != -1) && (m_pClientList[sAttackerH]->m_pItemList[sItemIndex] != NULL)) {
    	if (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 1761) { // BattleHammer 
      iHammerChance = iHammerChance/2; 
    	}
    	if (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 762) { // GiantBattleHammer
      iHammerChance = ((iHammerChance*10)/9);
    	}
    	if (m_pClientList[sAttackerH]->m_pItemList[sItemIndex]->m_sIDnum == 843) { // GiantBattleHammer
      iHammerChance = ((iHammerChance*10)/9);
    	}
    }
  	}
  	if ((m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_sIDnum == 622) || (m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_sIDnum == 621)) {
    iHammerChance = 0;
  	}
  	if (m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wCurLifeSpan < iHammerChance) {
    wsprintf(G_cTxt, "(iHammerChance (%d), target armor endurance (%d)!", iHammerChance, m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_wCurLifeSpan);
    PutLogList(G_cTxt);
    ReleaseItemHandler(sTargetH, iArmorType, TRUE);
    SendNotifyMsg(NULL, sTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[sTargetH]->m_pItemList[iArmorType]->m_cEquipPos, iArmorType, NULL, NULL);
    return;
  	}
  }
  }
  }
	}
	catch(...)
	{
	
	}	
}
Works good for me...
Slipknight
Loyal fan
Posts: 423
Joined: Thu Apr 07, 2005 7:53 pm

Post by Slipknight »

Myne looks almost identical too that one and mynes not working for me :/ I'll try that one out.
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>
CDWriter
Member
Posts: 123
Joined: Sun Feb 22, 2004 12:08 am

Post by CDWriter »

ok but remmeber i changed all the Item Ids to match some other Item.cfg....so iam sure there not the same for u ? <_<
Slipknight
Loyal fan
Posts: 423
Joined: Thu Apr 07, 2005 7:53 pm

Post by Slipknight »

yeah I changed the ID's too fit my item cfgs but still no success.

EDIT: I will try your code soon.
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>
CDWriter
Member
Posts: 123
Joined: Sun Feb 22, 2004 12:08 am

Post by CDWriter »

Worked Yes ? .....well i know it does so :)
Slipknight
Loyal fan
Posts: 423
Joined: Thu Apr 07, 2005 7:53 pm

Post by Slipknight »

CDWriter wrote: Worked Yes ? .....well i know it does so :)
Yeah it worked, dont really need it anymore though lol HB is dead and im starting a Lineage 2 server in a month or so. My host has 2 Uber server boxes packing Dual Xeon 4.0 chips and 3GB ram each and his Internet Speed is OC192 (9.6GigaBytes per second)
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>
tyteman
Spamtastic
Posts: 1149
Joined: Wed Nov 12, 2003 2:00 pm
Location: CA, USA

Post by tyteman »

Slipknight wrote:
CDWriter wrote: Worked Yes ? .....well i know it does so :)
Yeah it worked, dont really need it anymore though lol HB is dead and im starting a Lineage 2 server in a month or so. My host has 2 Uber server boxes packing Dual Xeon 4.0 chips and 3GB ram each and his Internet Speed is OC192 (9.6GigaBytes per second)
so thats how arcanian disappeared :P anyways... good luck with l2 there aren't many good servers out there.. hopefully your hosting won't go to waste .. l2 is a great game but its meant for hundreds of players and not just 10 -30
"<i>One night I was talking to God, but I realized I was talking to <u>myself</u></i>"<br><br><img src='http://img61.imageshack.us/img61/2678/untitled13bf.gif' border='0' alt='user posted image' /><br><br><b><u>Links</u></b><br>
marleythe9
Loyal fan
Posts: 391
Joined: Sat Mar 26, 2005 12:41 am

Post by marleythe9 »

ok well any way whats up with the
catch(...)
{

}
}
part am i supos to add that too?????

well seams to work with that part :) but ...

just a question is the BattleHammer the only Item ID that is diffrent???

oh i found something u kinda made mistake on lol :)

you put IDnum == 843 ) { //GiantBattleHammer

when it s a //BarHammer but it dont matter :).. just so new people dont get confused :) i guess they did that to in the original 2.24 source
<img src='http://freewebs.com/trickro/70s.png' border='0' alt='user posted image' /><img src='http://freewebs.com/trickro/70s2.jpg' border='0' alt='user posted image' />
Post Reply