[src] Lucky Effect

Codes already submitted by people of the forums.
Post Reply
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Well, I was just trying to figure out...what the heck was this m_bIsLuckyEffect variable...so Just do my own testing and research on the sources brought to us by certain developers.

Anyways, here's the deal...let me first show you what it does...


Under iCalculateAttackEffect
    if ((m_pClientList[sTargetH]->m_bIsLuckyEffect == TRUE) &&
    (iDice(1,10) == 5) && (m_pClientList[sTargetH]->m_iHP <= iAP_SM)) {
    // Çà¿îÈ¿°ú·Î Á×À½À» ¸ð¸éÇÑ´Ù.
    iAP_SM = m_pClientList[sTargetH]->m_iHP - 1;
    }
Explanation: If the person beeing attacked has the effect ON it throws a dice of 10 faces, it the result is face 5 and target's hp is less or equal than the damage that will be inflicted, then just do -1 dmg on target.

Under _PenaltyDrop
  else if ((m_pClientList[iClientH]->m_bIsLuckyEffect == TRUE) && (iDice(1,10) == 5)) {
  // ij¸¯ÅÍ¿¡°Ô Çà¿îÈ¿°ú°¡ ÀÖÀ¸¸é 10% È®·ü·Î ¾ÆÀÌÅÛÀÌ ¶³¾îÁöÁö ¾Ê´Â´Ù.
  }
Explanation: At this function, it just throws the same dice, and if face is number 5 then player won't drop nothing when die.

Under Effect_Damage_Spot
Under Effect_Damage_Spot_DamageMove
Under Effect_Damage_Spot_Type2
  if ((m_pClientList[sTargetH]->m_bIsLuckyEffect == TRUE) &&
  (iDice(1,10) == 5) && (m_pClientList[sTargetH]->m_iHP <= iDamage)) {
  // Çà¿îÈ¿°ú·Î Á×À½À» ¸ð¸éÇÑ´Ù.
  iDamage = m_pClientList[sTargetH]->m_iHP - 1;
  }
Explanation: Again, same dice and if result is 5 and target's hp is less or equal than the damage that will be inflicted, then just do -1 dmg on target.

Under CalcTotalItemEffect
  case DEF_ITEMEFFECTTYPE_ADDEFFECT:
  switch (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue1) {

  case 5:
    if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue2 != 0)
      m_pClientList[iClientH]->m_bIsLuckyEffect = TRUE;
    else m_pClientList[iClientH]->m_bIsLuckyEffect = FALSE;
    break;
Explanation: Now here is the lil "bug" that when it's calculating the effects, it says if ET Value1 is number 5 and the ET Value2 is any number different than 0, then TURN ON LUCKY EFFECT.

I said "bug" cause...most of our config files...even "originals" comes with the LuckyGoldRing...as...
Item  = 334 LuckyGoldRing        1    10    14    5 0 0  0 0 0  300      0      16    13  -2750  200  -1    0      0      0  0 -10    -1  46  0
Having the ET Value1 at 5, BUT NOT HAVING the ET Value2 with a number different than 0.

Just thought might be useful ^_^

Won't be a bad idea, to set the dice to something like...

int lucky = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue2;
(iDice(1,lucky) == 1))

Having then the combination...
Item  = 334 LuckyGoldRing        1    10    14    5 1 0  0 0 0  300      0      16    13  -2750  200  -1    0      0      0  0 -10    -1  46  0
Beeing the 100% lucky effect ^_^ and beeing able to add certain % to other items.

C yas! ^_^
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>
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

nice
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Crossfade
Loyal fan
Posts: 354
Joined: Sun Mar 20, 2005 5:55 pm

Post by Crossfade »

interesting
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Yeah...it is ^_^ you can adjust it to the way you want and PARAMMMM! you have UNIQUE LUCKY EFFECT IN YOUR SERVER.

You can also from here, edit it your own and create other kind of effect I guess will require more work but not for lazy people ^_^
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>
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Loco, since your posting here again. I have some things I'd like to work with you on for Celestial. We'll talk more indepth later..
Kenshi
Loyal fan
Posts: 208
Joined: Thu Nov 20, 2003 8:27 am

Post by Kenshi »

ADDKiD you fat piece of shit - shut up :)
get rooted.
KLKS
Loyal fan
Posts: 218
Joined: Sun Feb 22, 2004 2:32 pm

Post by KLKS »

PWNED!!!!!!!
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Kenshi, where the hell did you come from, I haven't seen you in ages. KLKS your still a nerd... :P
KLKS
Loyal fan
Posts: 218
Joined: Sun Feb 22, 2004 2:32 pm

Post by KLKS »

lolz and your still a turd :)
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

I </3 KLKS! Lol...
Post Reply