[src] Critical Candy / Potion

Codes already submitted by people of the forums.
Post Reply
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

Here is a lil code for critical candys, critical potions. Eating one critical Pot/candy will increase your critical attacks # by 1 until you reach your maximum crits.

<span style='color:red'>OPEN ITEM.H</span>

FIND

Code: Select all

#define DEF_ITEMEFFECTTYPE_ARMORDYE  	32
AFTER, ADD

Code: Select all

#define DEF_ITEMEFFECTTYPE_CRIT  	33

<span style='color:red'>OPEN GAME.CPP</span>

FIND

Code: Select all

case DEF_ITEMEFFECTTYPE_SP:
  	iMax = (2*m_pClientList[iClientH]->m_iStr) + (2*m_pClientList[iClientH]->m_iLevel);
  
  	if (m_pClientList[iClientH]->m_iSP < iMax) {
    
    if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemSpecEffectValue1 == 0) {
    	iV1 = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue1;
    	iV2 = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue2;
    	iV3 = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue3;
    }
    else {
    	iV1 = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemSpecEffectValue1;
    	iV2 = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemSpecEffectValue2;
    	iV3 = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemSpecEffectValue3;
    }

    m_pClientList[iClientH]->m_iSP += (iDice(iV1, iV2) + iV3); 
    if (m_pClientList[iClientH]->m_iSP > iMax) 
    	m_pClientList[iClientH]->m_iSP = iMax;

    iEffectResult = 3;
  	}
AFTER, ADD

Code: Select all

case DEF_ITEMEFFECTTYPE_CRIT:
  	iMax = m_pClientList[iClientH]->m_iLevel / 10;
  	if (m_pClientList[iClientH]->m_iSuperAttackLeft < iMax) m_pClientList[iClientH]->m_iSuperAttackLeft += 1;
  	iEffectResult = 7;
  	break;
FIND

Code: Select all

switch (iEffectResult) {
  case 1:
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_HP, NULL, NULL, NULL, NULL);
  	break;
  case 2:
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_MP, NULL, NULL, NULL, NULL);
  	break;
  case 3:
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SP, NULL, NULL, NULL, NULL);
  	break;
  case 4: // Invincible
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SLATE_INVINCIBLE, NULL, NULL, NULL, NULL);
  	break;
  case 5: // Mana
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SLATE_MANA, NULL, NULL, NULL, NULL);
  	break;
  case 6: // EXP
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SLATE_EXP, NULL, NULL, NULL, NULL);
  	break;
  default:
  	break;
  }
REPLACE WITH

Code: Select all

switch (iEffectResult) {
  case 1:
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_HP, NULL, NULL, NULL, NULL);
  	break;
  case 2:
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_MP, NULL, NULL, NULL, NULL);
  	break;
  case 3:
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SP, NULL, NULL, NULL, NULL);
  	break;
  case 4: // Invincible
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SLATE_INVINCIBLE, NULL, NULL, NULL, NULL);
  	break;
  case 5: // Mana
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SLATE_MANA, NULL, NULL, NULL, NULL);
  	break;
  case 6: // EXP
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SLATE_EXP, NULL, NULL, NULL, NULL);
  	break;
  case 7:
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SUPERATTACKLEFT, NULL, NULL, NULL, NULL);
  	break;
  default:
  	break;
  }

<span style='color:red'>Now create the new item in item.cfg</span>

If you want the item to be a potion (red)

Code: Select all

Item = xxx CritPotion 7 0 33 0 0 0 0 0 0 1 0 6 1 -12000 30 -1 0 0 0 0 0 -1 21 0
If you want the item to be a potion (bigred)

Code: Select all

Item = xxx CritPotion 7 0 33 0 0 0 0 0 0 1 0 6 2 -12000 30 -1 0 0 0 0 0 -1 21 0
If you want the item to be a potion (blue)

Code: Select all

Item = xxx CritPotion 7 0 33 0 0 0 0 0 0 1 0 6 3 -12000 30 -1 0 0 0 0 0 -1 21 0
If you want the item to be a potion (bigblue)

Code: Select all

Item = xxx CritPotion 7 0 33 0 0 0 0 0 0 1 0 6 4 -12000 30 -1 0 0 0 0 0 -1 21 0
If you want the item to be a potion (green)

Code: Select all

Item = xxx CritPotion 7 0 33 0 0 0 0 0 0 1 0 6 5 -12000 30 -1 0 0 0 0 0 -1 21 0
If you want the item to be a potion (biggreen)

Code: Select all

Item = xxx CritPotion 7 0 33 0 0 0 0 0 0 1 0 6 6 -12000 30 -1 0 0 0 0 0 -1 21 0
If you want the item to be a candy (red)

Code: Select all

Item = xxx CritCandy 7 0 33 0 0 0 0 0 0 1 0 6 131 -12000 30 -1 0 0 0 0 0 -1 21 0
If you want the item to be a candy (blue)

Code: Select all

Item = xxx CritCandy 7 0 33 0 0 0 0 0 0 1 0 6 132 -12000 30 -1 0 0 0 0 0 -1 21 0
If you want the item to be a candy (green)

Code: Select all

Item = xxx CritCandy 7 0 33 0 0 0 0 0 0 1 0 6 133 -12000 30 -1 0 0 0 0 0 -1 21 0


I hope this can be usefull to anyone :)
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

Nicely done.
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>
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Nice work ^_^
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>
RageIlluminati
Outpost bitch
Posts: 559
Joined: Wed Mar 30, 2005 6:45 am

Post by RageIlluminati »

idea was mine:-D

but nice work:-D
<img src='http://helbreath.pri.ee/userbars/hbest-gamemaster2.jpg' border='0' alt='user posted image' /> <img src='http://helbreath.pri.ee/userbars/hbsoccer-owner.jpg' border='0' alt='user posted image' /> <img src='http://helbreath.pri.ee/userbars/scorpa-rider.jpg' border='0' alt='user posted image' /> <img src='http://helbreath.pri.ee/userbars/logout-master.jpg' border='0' alt='user posted image' /> <br>.<br>................................Ego sum Rage, flagellum Dei!<br><br>The problem with America is stupidity. I'm not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? (bash.org)
jonisan
Member
Posts: 164
Joined: Sat Jan 07, 2006 1:14 pm
Location: Fin

Post by jonisan »

+++ very good!
<img src='http://i72.imagethrust.com/i/160466/newww.png' border='0' alt='user posted image' /><br><br><img src='http://img154.imageshack.us/img154/9360/tagi7wk.png' border='0' alt='user posted image' /><br><br><img src='http://img446.imageshack.us/img446/6094/uusi0xr.png' border='0' alt='user posted image' /><br><br><img src='http://img73.imageshack.us/img73/9738/xpuser3xy.png' border='0' alt='user posted image' /><br><br><b><u><span style='color:red'>Noobie List:</span></u></b><br><span style='color:blue'><i>BlueChristmas</i></span>
-Jim-
noob
Posts: 13
Joined: Sat Jan 28, 2006 9:41 pm

Post by -Jim- »

very nice
<img src='http://img132.imageshack.us/img132/8138/goods7mr.gif' border='0' alt='user posted image' />
Simpa
Regular
Posts: 40
Joined: Sun Dec 18, 2005 7:34 pm

Post by Simpa »

Neat and tidy..
''If you can't beat them, join them.
xmukox
Member
Posts: 175
Joined: Sun Sep 11, 2005 9:53 am

Post by xmukox »

hmm what im wrong add if i drink normal sp potion i have +1 criticals oO and if i drink ''Critical Candy'' i have +1 critical oO
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Rofl... This is all in the HGServer right?
PiotrekK
noob
Posts: 29
Joined: Fri Jan 13, 2006 2:39 am
Location: Poland/Warsaw
Contact:

Post by PiotrekK »

xmukox wrote: hmm what im wrong add if i drink normal sp potion i have +1 criticals oO and if i drink ''Critical Candy'' i have +1 critical oO
If you want in order to it let sweep up in code more this oO

ok ok i will help goods to you

Find:

Code: Select all

case DEF_ITEMEFFECTTYPE_SP:
  iMax = (2*m_pClientList[iClientH]->m_iStr) + (2*m_pClientList[iClientH]->m_iLevel);
 
  if (m_pClientList[iClientH]->m_iSP < iMax) {
   
   if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemSpecEffectValue1 == 0) {
    iV1 = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue1;
    iV2 = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue2;
    iV3 = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue3;
   }
   else {
    iV1 = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemSpecEffectValue1;
    iV2 = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemSpecEffectValue2;
    iV3 = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemSpecEffectValue3;
   }

   m_pClientList[iClientH]->m_iSP += (iDice(iV1, iV2) + iV3);
   if (m_pClientList[iClientH]->m_iSP > iMax)
    m_pClientList[iClientH]->m_iSP = iMax;

   iEffectResult = 3;
  }
After Add:

Code: Select all

case DEF_ITEMEFFECTTYPE_CRIT:
  iMax = m_pClientList[iClientH]->m_iLevel / 10;
  if (m_pClientList[iClientH]->m_iSuperAttackLeft < iMax) m_pClientList[iClientH]->m_iSuperAttackLeft += CRITICALS (Default 1);
  iEffectResult = 7;
  break;
Post Reply