show dmg code

Codes already submitted by people of the forums.
Post Reply
EvilHit
Loyal fan
Posts: 356
Joined: Sun Jan 16, 2005 3:20 am

Post by EvilHit »

ok here is the show dmg code dont ask me for fixes as im not goin to release the comelete code im goin to only release 98% of it u can work out the rest


Code: Select all


game.ccp

if (memcmp(cp, "/showdmg", 8) == 0) {
  	PlayerOrder_ShowDamage(iClientH);
  	return;
  }


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

void CGame::PlayerOrder_ShowDamage(int iClientH)
{/*ShowDamage - Coded by EvilHit*/
	
	char cDamageMod[256];
	if (m_pClientList[iClientH]->iDmgShowon == 1){
  m_pClientList[iClientH]->iDmgShowon = 0;
  ZeroMemory(cDamageMod, sizeof(cDamageMod));
  wsprintf(cDamageMod ,"Show Damage is now disabled");
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cDamageMod);

  
    }else
	{
  m_pClientList[iClientH]->iDmgShowon = 1;
  ZeroMemory(cDamageMod, sizeof(cDamageMod));
  wsprintf(cDamageMod ,"Show Damage is now enabled");
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cDamageMod);
    
	}
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~Effect_Damage_Spot
add 
char cDamageMod[256];

then found 
m_pClientList[sTargetH]->m_iHP -= iDamage;

replace with
m_pClientList[sTargetH]->m_iHP -= iDamage;

  if (m_pClientList[sAttackerH] != NULL){
  if (m_pClientList[sAttackerH]->iDmgShowon == 1){
  	ZeroMemory(cDamageMod, sizeof(cDamageMod));
  	wsprintf(cDamageMod ,"You did %d Damage to %s", iDamage,m_pClientList[sTargetH]->m_cCharName);
  	SendNotifyMsg(NULL, sAttackerH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cDamageMod);
  	}
  }
  if (m_pClientList[sTargetH]->m_iHP <= 0) {
  	ClientKilledHandler(sTargetH, sAttackerH, cAttackerType, iDamage);	
  }

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~Effect_Damage_Spot
found
m_pNpcList[sTargetH]->m_iHP -= iDamage;

replace with
m_pNpcList[sTargetH]->m_iHP -= iDamage;
  if (m_pClientList[sAttackerH] != NULL){
  if (m_pClientList[sAttackerH]->iDmgShowon == 1){
  	ZeroMemory(cDamageMod, sizeof(cDamageMod));
  	wsprintf(cDamageMod ,"You did %d Damage to %s", iDamage,m_pNpcList[sTargetH]->m_cNpcName);
  	SendNotifyMsg(NULL, sAttackerH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cDamageMod);
  	}
  }
  if (m_pNpcList[sTargetH]->m_iHP <= 0) {
  	NpcKilledHandler(sAttackerH, cAttackerType, sTargetH, iDamage);
  }

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~Effect_Damage_Spot_Type2
add 
char cDamageMod[256];

then found
m_pClientList[sTargetH]->m_iHP -= iDamage;

replace with
m_pClientList[sTargetH]->m_iHP -= iDamage;
  if (m_pClientList[sAttackerH] != NULL){
  if (m_pClientList[sAttackerH]->iDmgShowon == 1){
  	ZeroMemory(cDamageMod, sizeof(cDamageMod));
  	wsprintf(cDamageMod ,"You did %d Damage to %s", iDamage,m_pClientList[sTargetH]->m_cCharName);
  	SendNotifyMsg(NULL, sAttackerH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cDamageMod);
  	}
  }
  if (m_pClientList[sTargetH]->m_iHP <= 0) {
  	ClientKilledHandler(sTargetH, sAttackerH, cAttackerType, iDamage);	
  }


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~Effect_Damage_Spot_Type2
found
m_pNpcList[sTargetH]->m_iHP -= iDamage;

replace with
m_pNpcList[sTargetH]->m_iHP -= iDamage;
  if (m_pClientList[sAttackerH] != NULL){
  if (m_pClientList[sAttackerH]->iDmgShowon == 1){
  	ZeroMemory(cDamageMod, sizeof(cDamageMod));
  	wsprintf(cDamageMod ,"You did %d Damage to %s", iDamage,m_pNpcList[sTargetH]->m_cNpcName);
  	SendNotifyMsg(NULL, sAttackerH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cDamageMod);
  	}
  }
  if (m_pNpcList[sTargetH]->m_iHP < 0) {
  	NpcKilledHandler(sAttackerH, cAttackerType, sTargetH, iDamage);
  }

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~Effect_Damage_Spot_DamageMove
add 
char cDamageMod[256];

found
m_pClientList[sTargetH]->m_iHP -= iDamage;

replace with
m_pClientList[sTargetH]->m_iHP -= iDamage;
  if (m_pClientList[sAttackerH] != NULL){
  if (m_pClientList[sAttackerH]->iDmgShowon == 1){
  	ZeroMemory(cDamageMod, sizeof(cDamageMod));
  	wsprintf(cDamageMod ,"You did %d Damage to %s", iDamage,m_pClientList[sTargetH]->m_cCharName);
  	SendNotifyMsg(NULL, sAttackerH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cDamageMod);
  	}
  }
  if (m_pClientList[sTargetH]->m_iHP <= 0) {
  	// Ç÷¹À̾ »ç¸ÁÇß´Ù.
  	ClientKilledHandler(sTargetH, sAttackerH, cAttackerType, iDamage);	
  }

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~Effect_Damage_Spot_DamageMove
found
m_pNpcList[sTargetH]->m_iHP -= iDamage;

replace with
m_pNpcList[sTargetH]->m_iHP -= iDamage;
  if (m_pClientList[sAttackerH] != NULL){
  if (m_pClientList[sAttackerH]->iDmgShowon == 1){
  	ZeroMemory(cDamageMod, sizeof(cDamageMod));
  	wsprintf(cDamageMod ,"You did %d Damage to %s", iDamage,m_pNpcList[sTargetH]->m_cNpcName);
  	SendNotifyMsg(NULL, sAttackerH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cDamageMod);
  	}
  }
  if (m_pNpcList[sTargetH]->m_iHP < 0) {
  	// NPC°¡ »ç¸ÁÇß´Ù.
  	NpcKilledHandler(sAttackerH, cAttackerType, sTargetH, iDamage);
  }

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~iCalculateAttackEffect
add
char cDamageMod[256];
found 
m_pClientList[sTargetH]->m_iHP -= iAP_SM;

replace with
	m_pClientList[sTargetH]->m_iHP -= iAP_SM;
if (m_pClientList[sAttackerH] != NULL){
	//EvilHit pwns
  if (m_pClientList[sAttackerH]->iDmgShowon == 1){
  	ZeroMemory(cDamageMod, sizeof(cDamageMod));
  	wsprintf(cDamageMod ,"You did %d Damage to %s", iAP_SM,m_pClientList[sTargetH]->m_cCharName);
  	SendNotifyMsg(NULL, sAttackerH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cDamageMod);
  	}
  }

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~iCalculateAttackEffect
found 

m_pNpcList[sTargetH]->m_iHP -= iDamage;

replace with
m_pNpcList[sTargetH]->m_iHP -= iDamage;
    if (m_pClientList[sAttackerH] != NULL){
    if (m_pClientList[sAttackerH]->iDmgShowon == 1){
    	ZeroMemory(cDamageMod, sizeof(cDamageMod));
    wsprintf(cDamageMod ,"You did %d Damage to %s", iDamage,m_pNpcList[sTargetH]->m_cNpcName);
    SendNotifyMsg(NULL, sAttackerH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cDamageMod);
    }
  	}
    break;
  	}

  	if (m_pNpcList[sTargetH]->m_iHP <= 0) {
    NpcKilledHandler(sAttackerH, cAttackerType, sTargetH, iDamage);
    bKilled = TRUE;
    iKilledDice = m_pNpcList[sTargetH]->m_iHitDice;
  	}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~ game.h

add void PlayerOrder_ShowDamage(int iClientH);

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~client.H

int iDmgShowon;

 :o 
Charles
Loyal fan
Posts: 418
Joined: Wed Nov 26, 2003 8:20 pm

Post by Charles »

Code: Select all

//acidx pwns
lolol i see you replaced his name..... ;)
<i>"Always write good code. Feel bad to write bad code."</i>
-Blurr-
noob
Posts: 27
Joined: Mon Aug 30, 2004 11:30 pm

Post by -Blurr- »

I added this code perfectly, no errors at all.

But when I got into the cityhall, players constantly crashed because the NPC's inside it were getting "FAILED!" over their head just like when you receive damage.


Any idea whats up?
Charles
Loyal fan
Posts: 418
Joined: Wed Nov 26, 2003 8:20 pm

Post by Charles »

if you can't cut n paste...... uhm well you know the rest
<i>"Always write good code. Feel bad to write bad code."</i>
-Blurr-
noob
Posts: 27
Joined: Mon Aug 30, 2004 11:30 pm

Post by -Blurr- »

I said I added it perfectly, In game it works too...

Just that when someone gets hit or exits the Cityhall, the NPC's go gay and it keeps saying FAILED! over their heads like when you receive damage.
Charles
Loyal fan
Posts: 418
Joined: Wed Nov 26, 2003 8:20 pm

Post by Charles »

if you added it perfectly, you wouldn't have trouble......
<i>"Always write good code. Feel bad to write bad code."</i>
-Blurr-
noob
Posts: 27
Joined: Mon Aug 30, 2004 11:30 pm

Post by -Blurr- »

You never know, it could be the code it self.
Charles
Loyal fan
Posts: 418
Joined: Wed Nov 26, 2003 8:20 pm

Post by Charles »

look who it comes from.... it MOST likely is that.
<i>"Always write good code. Feel bad to write bad code."</i>
Acidx
Member
Posts: 198
Joined: Tue Mar 23, 2004 4:27 am

Post by Acidx »

wow hey evilhit steal more code from me there pal
CDamageMod wow thats surely mine
Wow your commenting is just like mine!
OMGOSH! loooky
//Acidx pwns
Wonder why?
Oh you have changed it already havn't you...
yeaaaaaa...
Funny you got the buggy version thats why people laugh at you
See every code,snippet, or anything for that fact
EvilHit contribs to people or forums/communitys
is infact not his at all but some other person who can actually code
You my friend have lost all Respect for me now
and probably alot of others as well...
i never come to unadvised but someone told me you posted this
and stole my credits...
Posting is okay but dont take my name off my work
By the way people get -1 dmg in there /showdmg text
its easy to fix.....
You will never know though...
Fix it for them mr EvilHit Godly programmer!
After all Its your code right??
i mean hell Everyone uses DEF_NOTIFY_NOTICEMSG
instead of KLKS's SendText command right?!
yea right thats my coding style pal look at all my snippets..
You couldnt tell anyone here what the code even does
Well... In the mean time
Next time u steal code and take credit...
Please change everything even though you are weak minded
and completely fucking noob.. At least try..
Btw thats the code i made for Jehova's Server
Everyone knows i coded it, theres no way ppl wouldnt notice lmao
Peace loser learn to code copy+paste whore
<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>
EvilHit
Loyal fan
Posts: 356
Joined: Sun Jan 16, 2005 3:20 am

Post by EvilHit »

hey casey how could i steal ur codes when i dont even talk to u or even get anythin from u
Acidx
Member
Posts: 198
Joined: Tue Mar 23, 2004 4:27 am

Post by Acidx »

its obvious retard you got them from jehovah...
When you post my code atleast give me props asshole
you didnt write any of that code
<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