[Src] /showdef

Codes already submitted by people of the forums.
Acidx
Member
Posts: 198
Joined: Tue Mar 23, 2004 4:27 am

Post by Acidx »

here is my /showdef code that shows the player his total Defense including DR and his base Defense discluding DR...

ok in chatmsghandler();
add this

Code: Select all

if (memcmp(cp, "/showdef", 8) == 0) {
PlayerOrder_ShowDefense(iClientH);
return;
Now in GAME.CPP add this new function

Code: Select all

void CGame::PlayerOrder_ShowDefense(int iClientH)
{
	int iDef;
	char cDefenseMod[256];
	iDef = m_pClientList[iClientH]->m_iCustomItemValue_Defense + m_pClientList[iClientH]->m_iCustomItemValue_Defense;
  
    wsprintf(cDefenseMod ,"Common Defense: %d ", m_pClientList[iClientH]->m_iDefenseRatio);
  ShowClientMsg( iClientH , cDefenseMod);
  wsprintf(cDefenseMod ,"Total Defense: %d ", iDef);
  ShowClientMsg( iClientH , cDefenseMod );
}
Now in Game.H add this

Code: Select all

void PlayerOrder_ShowDefense(int iClientH);
Viola Thats all there is too it such a simple command took me 1 min to write.. Enjoy
<b>-<span style='color:green'>ACiD-x </span><span style='color:red'> Owning PCs Since 1987</span><br><img src='http://img204.imageshack.us/img204/2245/hackertf5.gif' border='0' alt='user posted image' /><br><img src='http://img509.imageshack.us/img509/6697 ... 4sc4ed.png' border='0' alt='user posted image' /><br><span style='color:orange'>i am Pwn NetGAYLORDS !</span></b><br><span style='color:blue'><br>I Pwn HBUSA =)</span>
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

sux

Code: Select all

  if( memcmp( cp, "/checkdefence", 9 ) == 0 )
	{
  int dr = m_pClientList[ iClientH ]->m_iDefenseRatio + m_pClientList[ iClientH ]->m_iAddDR;
  int pahead = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_HEAD ];
  int pabody = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_BODY ];
  int papants = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_PANTS ];
  int paarms = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_ARMS ];
  int mr = m_pClientList[ iClientH ]->m_iAddResistMagic+ m_pClientList[ iClientH ]->m_cSkillMastery[ 3 ];
  int ma = m_pClientList[ iClientH ]->m_iAddAbsMD;

  wsprintf( G_cTxt, "DR=%d, PA[HEAD]=%d, PA[BODY]=%d, PA[PANTS]=%d, PA[ARMS]=%d, MR=%d, MA=%d", dr, pahead, pabody, papants, paarms, mr, ma );
  SendNotifyMsg( NULL, iClientH, DEF_NOTIFY_NOTICEMSG, 0, 0, 0, G_cTxt );
  return;
	}
<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)
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Drajwer wrote: sux

Code: Select all

  if( memcmp( cp, "/checkdefence", 9 ) == 0 )
	{
  int dr = m_pClientList[ iClientH ]->m_iDefenseRatio + m_pClientList[ iClientH ]->m_iAddDR;
  int pahead = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_HEAD ];
  int pabody = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_BODY ];
  int papants = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_PANTS ];
  int paarms = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_ARMS ];
  int mr = m_pClientList[ iClientH ]->m_iAddResistMagic+ m_pClientList[ iClientH ]->m_cSkillMastery[ 3 ];
  int ma = m_pClientList[ iClientH ]->m_iAddAbsMD;

  wsprintf( G_cTxt, "DR=%d, PA[HEAD]=%d, PA[BODY]=%d, PA[PANTS]=%d, PA[ARMS]=%d, MR=%d, MA=%d", dr, pahead, pabody, papants, paarms, mr, ma );
  SendNotifyMsg( NULL, iClientH, DEF_NOTIFY_NOTICEMSG, 0, 0, 0, G_cTxt );
  return;
	}

Code: Select all

  if( memcmp( cp, "/checkdef", 9 ) == 0 )
	{
  int dr = m_pClientList[ iClientH ]->m_iDefenseRatio + m_pClientList[ iClientH ]->m_iAddDR;
  int pahead = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_HEAD ];
  int pabody = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_BODY ];
  int papants = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_PANTS ];
  int paarms = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_ARMS ];
  int mr = m_pClientList[ iClientH ]->m_iAddResistMagic+ m_pClientList[ iClientH ]->m_cSkillMastery[ 3 ];
  int ma = m_pClientList[ iClientH ]->m_iAddAbsMD;

  wsprintf( G_cTxt, "DR=%d, PA[HEAD]=%d, PA[BODY]=%d, PA[PANTS]=%d, PA[ARMS]=%d, MR=%d, MA=%d", dr, pahead, pabody, papants, paarms, mr, ma );
  SendNotifyMsg( NULL, iClientH, DEF_NOTIFY_NOTICEMSG, 0, 0, 0, G_cTxt );
  return;
	}
Gotta remember the people who are retarded and can't type... Its basically the same source as yours Drajwer, but I changed the command name.. To, /checkdef
Acidx
Member
Posts: 198
Joined: Tue Mar 23, 2004 4:27 am

Post by Acidx »

Drajwer wrote: sux

Code: Select all

  if( memcmp( cp, "/checkdefence", 9 ) == 0 )
	{
  int dr = m_pClientList[ iClientH ]->m_iDefenseRatio + m_pClientList[ iClientH ]->m_iAddDR;
  int pahead = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_HEAD ];
  int pabody = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_BODY ];
  int papants = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_PANTS ];
  int paarms = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_ARMS ];
  int mr = m_pClientList[ iClientH ]->m_iAddResistMagic+ m_pClientList[ iClientH ]->m_cSkillMastery[ 3 ];
  int ma = m_pClientList[ iClientH ]->m_iAddAbsMD;

  wsprintf( G_cTxt, "DR=%d, PA[HEAD]=%d, PA[BODY]=%d, PA[PANTS]=%d, PA[ARMS]=%d, MR=%d, MA=%d", dr, pahead, pabody, papants, paarms, mr, ma );
  SendNotifyMsg( NULL, iClientH, DEF_NOTIFY_NOTICEMSG, 0, 0, 0, G_cTxt );
  return;
	}
first off yours doesnt even show the actuall Defense... try again sweety pie <3
<b>-<span style='color:green'>ACiD-x </span><span style='color:red'> Owning PCs Since 1987</span><br><img src='http://img204.imageshack.us/img204/2245/hackertf5.gif' border='0' alt='user posted image' /><br><img src='http://img509.imageshack.us/img509/6697 ... 4sc4ed.png' border='0' alt='user posted image' /><br><span style='color:orange'>i am Pwn NetGAYLORDS !</span></b><br><span style='color:blue'><br>I Pwn HBUSA =)</span>
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

I am now going to Impersonate Acid's mom.

"Acid, You be nice to little kids, or your going to get a pattle! I mean it young man..."

:P

Owned :D Kinda odd Trying to act like Acid's mom...
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

ADDKiD wrote: I am now going to Impersonate Acid's mom.

"Acid, You be nice to little kids, or your going to get a pattle! I mean it young man..."

:P

Owned :D Kinda odd Trying to act like Acid's mom...
This joke was kinda lame.
<img src='http://www.hot.ee/carvanho/taavi.png' border='0' alt='user posted image' /><br><br><img src='http://www.hot.ee/carvanho/Elvine.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/LieroX.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/Football.png' border='0' alt='user posted image' />
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

Acidx wrote:
Drajwer wrote: sux

Code: Select all

  if( memcmp( cp, "/checkdefence", 9 ) == 0 )
	{
  int dr = m_pClientList[ iClientH ]->m_iDefenseRatio + m_pClientList[ iClientH ]->m_iAddDR;
  int pahead = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_HEAD ];
  int pabody = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_BODY ];
  int papants = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_PANTS ];
  int paarms = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_ARMS ];
  int mr = m_pClientList[ iClientH ]->m_iAddResistMagic+ m_pClientList[ iClientH ]->m_cSkillMastery[ 3 ];
  int ma = m_pClientList[ iClientH ]->m_iAddAbsMD;

  wsprintf( G_cTxt, "DR=%d, PA[HEAD]=%d, PA[BODY]=%d, PA[PANTS]=%d, PA[ARMS]=%d, MR=%d, MA=%d", dr, pahead, pabody, papants, paarms, mr, ma );
  SendNotifyMsg( NULL, iClientH, DEF_NOTIFY_NOTICEMSG, 0, 0, 0, G_cTxt );
  return;
	}
first off yours doesnt even show the actuall Defense... try again sweety pie <3
no?...

whats DR for ?
<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)
Crossfade
Loyal fan
Posts: 354
Joined: Sun Mar 20, 2005 5:55 pm

Post by Crossfade »

Drajwer wrote:
Acidx wrote:
Drajwer wrote: sux

Code: Select all

  if( memcmp( cp, "/checkdefence", 9 ) == 0 )
	{
  int dr = m_pClientList[ iClientH ]->m_iDefenseRatio + m_pClientList[ iClientH ]->m_iAddDR;
  int pahead = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_HEAD ];
  int pabody = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_BODY ];
  int papants = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_PANTS ];
  int paarms = m_pClientList[ iClientH ]->m_iDamageAbsorption_Armor[ DEF_EQUIPPOS_ARMS ];
  int mr = m_pClientList[ iClientH ]->m_iAddResistMagic+ m_pClientList[ iClientH ]->m_cSkillMastery[ 3 ];
  int ma = m_pClientList[ iClientH ]->m_iAddAbsMD;

  wsprintf( G_cTxt, "DR=%d, PA[HEAD]=%d, PA[BODY]=%d, PA[PANTS]=%d, PA[ARMS]=%d, MR=%d, MA=%d", dr, pahead, pabody, papants, paarms, mr, ma );
  SendNotifyMsg( NULL, iClientH, DEF_NOTIFY_NOTICEMSG, 0, 0, 0, G_cTxt );
  return;
	}
first off yours doesnt even show the actuall Defense... try again sweety pie <3
no?...

whats DR for ?
he's just trying to say his stupid def code is better
Promote
Regular
Posts: 43
Joined: Thu Jul 07, 2005 7:17 pm

Post by Promote »

Rofl DR =/ Defense. They are totally different forumulas and stats. Defense is DR+PA. Thats why a plate with more defense takes less damage than a chain mail, not is just harder to hit. From what i understand/heard. Is that DR = 1/2Dex. So if you have a dr200 set, its the equivilent of having an extra 100 dex. Which if you test in game, makes sense. Also ive noticed on Dax's calculator that 10 dex = 20 DR. If this is the same DR, then a dr400 set = 200 dex like i thought ^_^. So DR IS NOT defense. Not even close.
Acidx
Member
Posts: 198
Joined: Tue Mar 23, 2004 4:27 am

Post by Acidx »

Crossfade wrote:
Drajwer wrote:
Acidx wrote: first off yours doesnt even show the actuall Defense... try again sweety pie <3
no?...

whats DR for ?
he's just trying to say his stupid def code is better
No Defense Ratio is the Ratio you have to be missed of being hit smart one... i never said my code is better it just shows the actuall defense.. your code Shows PA DR and other bullshit not really needed..
DR != DEFENSE lol DR Goes up by Dex not Armor.. My code is to show the actuall DEFENSE OF THE PLAYER still with me?
here ill sound it out D E F E N S E not D E F E N S E R A T I O
ok?
and when you add them up like that its just showing the case values..
Because it all works in % so your just popping up bullshit numbers that dont mean anything
<b>-<span style='color:green'>ACiD-x </span><span style='color:red'> Owning PCs Since 1987</span><br><img src='http://img204.imageshack.us/img204/2245/hackertf5.gif' border='0' alt='user posted image' /><br><img src='http://img509.imageshack.us/img509/6697 ... 4sc4ed.png' border='0' alt='user posted image' /><br><span style='color:orange'>i am Pwn NetGAYLORDS !</span></b><br><span style='color:blue'><br>I Pwn HBUSA =)</span>
Crossfade
Loyal fan
Posts: 354
Joined: Sun Mar 20, 2005 5:55 pm

Post by Crossfade »

Acidx wrote:
Crossfade wrote:
Drajwer wrote: no?...

whats DR for ?
he's just trying to say his stupid def code is better
No Defense Ratio is the Ratio you have to be missed of being hit smart one... i never said my code is better it just shows the actuall defense.. your code Shows PA DR and other bullshit not really needed..
DR != DEFENSE lol DR Goes up by Dex not Armor.. My code is to show the actuall DEFENSE OF THE PLAYER still with me?
here ill sound it out D E F E N S E not D E F E N S E R A T I O
ok?
and when you add them up like that its just showing the case values..
Because it all works in % so your just popping up bullshit numbers that dont mean anything
its not my code... so why say my code?
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Oh just trying to fix Drajwer...

You forgot to add client's MR from sttated armors wich is stored at m_pClientList[ iClientH ]->m_iAddMR

So MR line should be...
int mr = m_pClientList[ iClientH ]->m_iAddResistMagic + m_pClientList[ iClientH ]->m_cSkillMastery[3] + m_pClientList[ iClientH ]->m_iAddMR;
C ya ^_^

P.S: Useful code B)
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
sokol
Loyal fan
Posts: 228
Joined: Mon May 02, 2005 7:28 pm
Location: P(r)oland

Post by sokol »

WTF?
why u post my code noob? ... i post this code not finished with few errors and u fix and U CALL ITS URS WTF?! go burn in hell ...
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

Nice Sokol, the code it's good <3
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
Acidx
Member
Posts: 198
Joined: Tue Mar 23, 2004 4:27 am

Post by Acidx »

sokol wrote: WTF?
why u post my code noob? ... i post this code not finished with few errors and u fix and U CALL ITS URS WTF?! go burn in hell ...
ummm if your talking to me your totally fuckin mistaken..
i made this code way before you ever existed...
this code was for a server .. i dont steal code.. nor do i copy it..
Btw in my days of research DR = Dodge Ratio not defense my bad..
and sokol learn to code buddy dont be a dumbass
<b>-<span style='color:green'>ACiD-x </span><span style='color:red'> Owning PCs Since 1987</span><br><img src='http://img204.imageshack.us/img204/2245/hackertf5.gif' border='0' alt='user posted image' /><br><img src='http://img509.imageshack.us/img509/6697 ... 4sc4ed.png' border='0' alt='user posted image' /><br><span style='color:orange'>i am Pwn NetGAYLORDS !</span></b><br><span style='color:blue'><br>I Pwn HBUSA =)</span>
Post Reply