[Req] Weapon Ranges

Discussion about Helbreath Server Files.
LythQ
just visiting
Posts: 9
Joined: Tue Dec 19, 2006 12:36 pm
Location: Portugal
Contact:

Post by LythQ »

I tried to look for it, but since I'm kinda new w/ hb src files I guess, I wasn't able to find it.
The problem is: you have different ranges for hammers & swords, and then there's StormBringer which has a even greater range. Any1 know how I could modify this or add custom ranges to the items?
<span style='color:green'>Gief <span style='color:purple'>epix</span> codes plz.</span>
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

LythQ wrote: I tried to look for it, but since I'm kinda new w/ hb src files I guess, I wasn't able to find it.
The problem is: you have different ranges for hammers & swords, and then there's StormBringer which has a even greater range. Any1 know how I could modify this or add custom ranges to the items?
The server must know the weapon range to allow the damage from further tiles, and the client must know the range to let you be able to attack.

I'm going to stop short of a snippet, but if you're using '3.51'+ sources then searching for the sb (in both files) should give you a clear picture of what is required to customize weapon ranges.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
LythQ
just visiting
Posts: 9
Joined: Tue Dec 19, 2006 12:36 pm
Location: Portugal
Contact:

Post by LythQ »

Thx for the reply, I'm using SlammeR's src's (3.82) btw.

Also, this is something that has to be done in code right? If so what is the property that the hg gets from the itemlist to know it's a hammer, sword, stormbringer?

Sry for the noobish question, but as I said I'm new to the hb src's and therefore it's variables & cfg's.

I've been searching on the server files and found this function:

void CGame::StormBringer

which has:

iV2 = m_pClientList[iClientH]->m_cAttackDiceRange_L;

Which I guess it's the range, I tried to mess around the stuff that could change it, but I'm guessing from ur post I must change the client as well so it allows me to crit/hit from further?

Also I couldn't find what was calling that StormBringer function on the hg project, is it being called from the client ?
<span style='color:green'>Gief <span style='color:purple'>epix</span> codes plz.</span>
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

LythQ wrote: Thx for the reply, I'm using SlammeR's src's (3.82) btw.

Also, this is something that has to be done in code right? If so what is the property that the hg gets from the itemlist to know it's a hammer, sword, stormbringer?
There is a value on each item which will decide which skill is required to crit with it. The skill also decides the range. In the case of sb, seperate checks are made to see if it's equipped, then the files will adjust your range accordingly.
LythQ wrote: I've been searching on the server files and found this function:

void CGame::StormBringer

which has:

iV2 = m_pClientList[iClientH]->m_cAttackDiceRange_L;

Which I guess it's the range, I tried to mess around the stuff that could change it, but I'm guessing from ur post I must change the client as well so it allows me to crit/hit from further?
Correct. What you've done here is allowed the server to register attacks from an increased range, but the client can still only send attacks from the range it knows.

Keep on the SB codes. You will see eventually. Just remember to look at the client too.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
LythQ
just visiting
Posts: 9
Joined: Tue Dec 19, 2006 12:36 pm
Location: Portugal
Contact:

Post by LythQ »

Thanks for pointing me in the right direction, I'll look into the client asap (like 2morrow, time 4 bed atm <.<) and post the results as soon as I'm done w/ it or fail to do so.

Once again, thanks, I'm new to this and am not used to code in different projects at the same time, nor the client/server applications so feedback is greatly appreciated (although I always search for stuff be4 posting).

Just so that it counts, I'm not planning on making a noob max lv 500 and max stat 700 two week server, and don't even know if I'm going to get the server public, just doing it for the fun of coding the game that got me the addiction of coding, going 2 develop it during summer vacations.
<span style='color:green'>Gief <span style='color:purple'>epix</span> codes plz.</span>
LythQ
just visiting
Posts: 9
Joined: Tue Dec 19, 2006 12:36 pm
Location: Portugal
Contact:

Post by LythQ »

Back from school, was able to do it very smoothly (the changes I made on the hg were the ones i needed for it to allow that distance). On the client side I changed:
      }else if ( (absX <= 10) && (absY <= 10) && (m_iSuperAttackLeft > 10) && (m_bSuperAttackMode == TRUE)
        && (_iGetAttackType() == 30))  // Crit with StormBlade (by Snoopy)
      { wType = _iGetAttackType();
        m_cCommand = DEF_OBJECTATTACK;
        m_sCommX = m_sMCX;
        m_sCommY = m_sMCY;
      }else if ( (absX <= 10) && (absY <= 10)
        && (_iGetAttackType() == 5))  // Normal hit with StormBlade (by Snoopy)
      { wType = _iGetAttackType();
        m_cCommand = DEF_OBJECTATTACK;
        m_sCommX = m_sMCX;
        m_sCommY = m_sMCY;
Found a sort of a security exploit that could be used here, the HG doesn't check the distance you can crit, tried changing the crit distance on long swords only on the client and the dmg worked.

<a href='http://img107.imageshack.us/img107/6266 ... 2elzy7.jpg' target='_blank'>Image</a>
<span style='color:green'>Gief <span style='color:purple'>epix</span> codes plz.</span>
Sentinel
Loyal fan
Posts: 462
Joined: Thu Jan 11, 2007 4:16 pm

Post by Sentinel »

LythQ wrote: Back from school, was able to do it very smoothly (the changes I made on the hg were the ones i needed for it to allow that distance). On the client side I changed:
       }else if ( (absX <= 10) && (absY <= 10) && (m_iSuperAttackLeft > 10) && (m_bSuperAttackMode == TRUE)
        && (_iGetAttackType() == 30))  // Crit with StormBlade (by Snoopy)
       { wType = _iGetAttackType();
        m_cCommand = DEF_OBJECTATTACK;
        m_sCommX = m_sMCX;
        m_sCommY = m_sMCY;
       }else if ( (absX <= 10) && (absY <= 10)
        && (_iGetAttackType() == 5))  // Normal hit with StormBlade (by Snoopy)
       { wType = _iGetAttackType();
        m_cCommand = DEF_OBJECTATTACK;
        m_sCommX = m_sMCX;
        m_sCommY = m_sMCY;
Found a sort of a security exploit that could be used here, the HG doesn't check the distance you can crit, tried changing the crit distance on long swords only on the client and the dmg worked.

<a href='http://img107.imageshack.us/img107/6266 ... 2elzy7.jpg' target='_blank'>Image</a>
Then I suggest that you fix this exploit, and thank you for letting it be known to others. I've found a client, which I think was made by Zero back in the day, which allowed you to do /crit [Characters Name] xxx,xxx (coordinates) and you could crit that person (If on the same map)..
<!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->charlie says:<br>i may own outpost but im not a nerd<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br><!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->(locobans @ Mar 12 2007, 10:48 PM) <br>"Remember while peeing, If you shake it more than twice you playing with it..." <br><!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd-->
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

I never made that. The only thing I did like that was a /cast command which let you cast any spell anywhere on the map.
<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.
Sentinel
Loyal fan
Posts: 462
Joined: Thu Jan 11, 2007 4:16 pm

Post by Sentinel »

bone-you wrote: I never made that. The only thing I did like that was a /cast command which let you cast any spell anywhere on the map.
Who did then? o_o
<!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->charlie says:<br>i may own outpost but im not a nerd<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br><!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->(locobans @ Mar 12 2007, 10:48 PM) <br>"Remember while peeing, If you shake it more than twice you playing with it..." <br><!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd-->
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

Sentinel wrote:
bone-you wrote: I never made that. The only thing I did like that was a /cast command which let you cast any spell anywhere on the map.
Who did then? o_o
Your imagination, as usual.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
Sentinel
Loyal fan
Posts: 462
Joined: Thu Jan 11, 2007 4:16 pm

Post by Sentinel »

Dax wrote:
Sentinel wrote:
bone-you wrote: I never made that. The only thing I did like that was a /cast command which let you cast any spell anywhere on the map.
Who did then? o_o
Your imagination, as usual.
Not even...
<!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->charlie says:<br>i may own outpost but im not a nerd<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br><!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->(locobans @ Mar 12 2007, 10:48 PM) <br>"Remember while peeing, If you shake it more than twice you playing with it..." <br><!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd-->
Thefire
noob
Posts: 28
Joined: Thu Apr 26, 2007 1:45 pm

Post by Thefire »

LythQ wrote: Back from school, was able to do it very smoothly (the changes I made on the hg were the ones i needed for it to allow that distance). On the client side I changed:
      }else if ( (absX <= 10) && (absY <= 10) && (m_iSuperAttackLeft > 10) && (m_bSuperAttackMode == TRUE)
        && (_iGetAttackType() == 30))  // Crit with StormBlade (by Snoopy)
      { wType = _iGetAttackType();
        m_cCommand = DEF_OBJECTATTACK;
        m_sCommX = m_sMCX;
        m_sCommY = m_sMCY;
      }else if ( (absX <= 10) && (absY <= 10)
        && (_iGetAttackType() == 5))  // Normal hit with StormBlade (by Snoopy)
      { wType = _iGetAttackType();
        m_cCommand = DEF_OBJECTATTACK;
        m_sCommX = m_sMCX;
        m_sCommY = m_sMCY;
Found a sort of a security exploit that could be used here, the HG doesn't check the distance you can crit, tried changing the crit distance on long swords only on the client and the dmg worked.

<a href='http://img107.imageshack.us/img107/6266 ... 2elzy7.jpg' target='_blank'>Image</a>
Ok, where should I place this code? (file and function)
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

Thefire wrote:
LythQ wrote: Back from school, was able to do it very smoothly (the changes I made on the hg were the ones i needed for it to allow that distance). On the client side I changed:
       }else if ( (absX <= 10) && (absY <= 10) && (m_iSuperAttackLeft > 10) && (m_bSuperAttackMode == TRUE)
        && (_iGetAttackType() == 30))  // Crit with StormBlade (by Snoopy)
       { wType = _iGetAttackType();
        m_cCommand = DEF_OBJECTATTACK;
        m_sCommX = m_sMCX;
        m_sCommY = m_sMCY;
       }else if ( (absX <= 10) && (absY <= 10)
        && (_iGetAttackType() == 5))  // Normal hit with StormBlade (by Snoopy)
       { wType = _iGetAttackType();
        m_cCommand = DEF_OBJECTATTACK;
        m_sCommX = m_sMCX;
        m_sCommY = m_sMCY;
Found a sort of a security exploit that could be used here, the HG doesn't check the distance you can crit, tried changing the crit distance on long swords only on the client and the dmg worked.

<a href='http://img107.imageshack.us/img107/6266 ... 2elzy7.jpg' target='_blank'>Image</a>
Ok, where should I place this code? (file and function)
Do you even know what that part does? This topic isn't a tutorial.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
LythQ
just visiting
Posts: 9
Joined: Tue Dec 19, 2006 12:36 pm
Location: Portugal
Contact:

Post by LythQ »

That code alone doesn't fix anything, was just a test to allow me to hit from further with StormBringer. If you're referring to the code where you can change the critical range it can be found on the Client's game.cpp after this block:

Code: Select all

      }else if ( (absX <= 2) && (absY <= 2) // strike on Big mobs & gate from a range
      	&& ((sObjectType == 66)||(sObjectType == 73)||(sObjectType == 81)||(sObjectType == 91)))
      {	wType = _iGetAttackType();
      	m_cCommand = DEF_OBJECTATTACK;
      	m_sCommX = m_sMCX;
      	m_sCommY = m_sMCY;
      }else //
      {	switch (_iGetWeaponSkillType()) {
You then go to the desired type of weapon that you want to change. The one I changed on mine was the StormBringer's, but you can change any type of weapon, let's say for example, Long Swords, you go to:

Code: Select all

      	case 8: // LS
        if (   (absX <= 3) && (absY <= 3) && (m_iSuperAttackLeft > 0) && (m_bSuperAttackMode == TRUE)
        	&& (_iGetAttackType() != 30)) // crit without StormBlade by Snoopy
        {	wType = _iGetAttackType();
        	m_cCommand = DEF_OBJECTATTACK;
        	m_sCommX = m_sMCX;
        	m_sCommY = m_sMCY;
And where you have:

Code: Select all

(absX <= 3) && (absY <= 3)
Change the values to the critical distance you want. The exploit consists in you changing the distance here and doing nothing on the HG, still it allows you to crit from further.
<span style='color:green'>Gief <span style='color:purple'>epix</span> codes plz.</span>
Thefire
noob
Posts: 28
Joined: Thu Apr 26, 2007 1:45 pm

Post by Thefire »

Ok, thanks ;)
Post Reply