[src] Pandora's Box

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

Post by diuuude »

Edit as you want ;-)

Code: Select all

case DEF_ITEMEFFECTTYPE_PANDORA:
  	int iProb, iResult, iPandoraItem, iEraseReq;
  	class CItem * pItem;
  	if (m_pClientList[iClientH]->m_iRating < -50) iProb = 500;
  	if ((m_pClientList[iClientH]->m_iRating >= -50) && (m_pClientList[iClientH]->m_iRating < 0)) iProb = 400;
  	if (m_pClientList[iClientH]->m_iRating == 0) iProb = 350;
  	if ((m_pClientList[iClientH]->m_iRating > 0) && (m_pClientList[iClientH]->m_iRating <= 50)) iProb = 300;
  	if ((m_pClientList[iClientH]->m_iRating > 50) && (m_pClientList[iClientH]->m_iRating <= 100)) iProb = 250;
  	if ((m_pClientList[iClientH]->m_iRating > 100) && (m_pClientList[iClientH]->m_iRating <= 200)) iProb = 200;
  	if (m_pClientList[iClientH]->m_iRating > 200) iProb = 150;
  	iResult = iDice(1,iProb);
<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 !
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Pandora's Box just wouldnt be Pandora's Box if there wasnt a chance of something bad happening
Ya, would be just a lucky box.
Quoted for truth

Suggestions
lose a lvl
lose rep
get jailed
get send to IB for 10 mins
get killed (by what dunno)
lose majestic points
:ph34r:

Code: Select all

  if (iPandoraItem = 0){
switch (1,5)
case 1:
         player loses rep
    break;
case 2:
         player loses a level
    break;
case 3:
         get send to IB for 10 mins
    break;
case 4:
         get killed (by what dunno)
    break;
case 5:
         another crappy idea
    break;
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>
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

locobans wrote:
Pandora's Box just wouldnt be Pandora's Box if there wasnt a chance of something bad happening
Ya, would be just a lucky box.
Quoted for truth

Suggestions
lose a lvl
lose rep
get jailed
get send to IB for 10 mins
get killed (by what dunno)
lose majestic points
:ph34r:

Code: Select all

  if (iPandoraItem = 0){
switch (1,5)
case 1:
         player loses rep
    break;
case 2:
         player loses a level
    break;
case 3:
         get send to IB for 10 mins
    break;
case 4:
         get killed (by what dunno)
    break;
case 5:
         another crappy idea
    break;
That's True !!

Working on a new version with some new effects, reds are already working. I'll edit this post when i'll add new ones, here are the currently working effects :
- <span style='color:red'>Restart level's Exp</span>
- <span style='color:red'>Get an Item</span>
- <span style='color:red'>Loose Rep (random amount)</span>
- <span style='color:red'>Go to jail (random time from 1 to 5 mins)</span>
- <span style='color:red'>Loose HP (depending on rep)</span>
- Loose MP (depending on rep)
- Loose SP (depending on rep)
- Loose MJ Points (random amount from 1 to 3)
- Wipe of an item (not hero / dk / master / manu / unique)
- Add Gold
- Add a Spell (depending on level)

Code: Select all

// Pandora's Box By Diuuude
  case DEF_ITEMEFFECTTYPE_PANDORA:
    	int iProb, iResult1, iResult2, iPandoraItem, iEraseReq, iDamage, iDecRep, iLockTime;
    	class CItem * pItem;
    	/* First off all, we have to select a random event for opening box
     Effects can be :	
        - OK : Restart level's Exp
        - OK : Get an Item
        - OK : Loose Rep (5 -> 50)
        - OK : Go to jail (1 to 5 mins)
        - OK : Loose HP
        - Loose MP
        - Loose SP
        - Loose MJ Points
        - Wipe of an item

    	*/
    	iResult1 = iDice(1,5);
    	switch (iResult1){
    case 1: // All the exp you gained this level is reseted
        char * PandoraExpText;
        m_pClientList[iClientH]->m_iExp = iGetLevelExp(m_pClientList[iClientH]->m_iLevel);
        wsprintf(PandoraExpText, "Doh, Pandora's Box decreased your Exp... Exp set to %d", m_pClientList[iClientH]->m_iExp);
        SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, PandoraExpText);
        SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_EXP, NULL, NULL, NULL, NULL);
        break;
    case 2: // You get a random item depending on your rep
        // Check user's Rep to set a prob depending on his reps
        if (m_pClientList[iClientH]->m_iRating < -50) iProb = 500;
        if ((m_pClientList[iClientH]->m_iRating >= -50) && (m_pClientList[iClientH]->m_iRating < 0)) iProb = 400;
        if (m_pClientList[iClientH]->m_iRating == 0) iProb = 350;
        if ((m_pClientList[iClientH]->m_iRating > 0) && (m_pClientList[iClientH]->m_iRating <= 50)) iProb = 300;
        if ((m_pClientList[iClientH]->m_iRating > 50) && (m_pClientList[iClientH]->m_iRating <= 100)) iProb = 250;
        if ((m_pClientList[iClientH]->m_iRating > 100) && (m_pClientList[iClientH]->m_iRating <= 200)) iProb = 200;
        if (m_pClientList[iClientH]->m_iRating > 200){
      iProb = 150 - (m_pClientList[iClientH]->m_iRating / 10);
    	}
        iResult2 = iDice(1,iProb);
        switch (iResult2){
       // Good Items
       case 1:
          	iPandoraItem = 308; // Magic Necklace (MS10)
          	break;
       case 2:
          	iPandoraItem = 300; // Magic Necklace (RM10)
          	break;
       case 3:
          	iPandoraItem = 275; // Ogre Summon Potion
          	break;
       case 4:
          	iPandoraItem = 311; // Magic Necklace (DF+10)
          	break;
       case 5:
          	iPandoraItem = 338; // Memorial Ring
          	break;
       case 6:
          	iPandoraItem = 380; // Ice Storm Manual
          	break;
       case 7:
          	iPandoraItem = 381; // Mass Fire Strike Manual
          	break;
       case 8:
          	iPandoraItem = 490; // Blood Sword
          	break;
       case 9:
          	iPandoraItem = 618; // Dark-Elf Bow
          	break;
       case 10:
          	iPandoraItem = 620; // MerienShield
          	break;
       case 11:
          	iPandoraItem = 636; // Ring Of Grand Mage
          	break;
       case 12:
          	iPandoraItem = 641; // Necklace Of Medusa
          	break;
       case 13:
          	iPandoraItem = 648; // Necklace Of Liche
          	break;
       case 14:
          	iPandoraItem = 765; // Third Memorial Ring
          	break;
       case 15:
          	iPandoraItem = 849; // Kloness Blade
          	break;
       case 16:
          	iPandoraItem = 862; // Berserk Wand (MS.10)
          	break;
       case 17:
          	iPandoraItem = 864; // Kloness Wand (MS.10)
          	break;
       case 18:
          	iPandoraItem = 866; // Resur Wand (MS.10)
          	break;
       /* Weak Items:	if you add items, be sure that the weak items cases # are greater
        than the good item cases #. It will allow players with high rating
        to get better items.*/
       case 59:
          	iPandoraItem = 4; // Dagger+1
          	break;
       case 60:
          	iPandoraItem = 46; // Claymore
          	break;
       case 61:
          	iPandoraItem = 75; // Short Bow
          	break;
       case 62:
          	iPandoraItem = 91; // Red Potion
          	break;
       case 63:
          	iPandoraItem = 93; // Blue Potion
          	break;
       case 64:
          	iPandoraItem = 95; // Green Potion
          	break;
       case 65:
          	iPandoraItem = 100; // Fish
          	break;
       case 66:
          	iPandoraItem = 402; // Cape
          	break;
       case 67:
          	iPandoraItem = 522; // Flower Pot
          	break;
       case 68:
          	iPandoraItem = 824; // Carrot
          	break;
       case 69:
          	iPandoraItem = 883; // ArmorDye(Gold)
          	break;
       default:
          	iPandoraItem = 0; // Nothing
          	break;
        }
        if (iPandoraItem != 0){
      pItem = new class CItem;
      _bInitItemAttr(pItem, iPandoraItem);
      _bAddClientItemList(iClientH, pItem, &iEraseReq);
      SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "Yeah, Pandora's box had an item inside !!");
      SendItemNotifyMsg(iClientH, DEF_NOTIFY_ITEMOBTAINED, pItem, NULL);
        }
        else{
      SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "Doh, Pandora's box was empty !!");
        }

        break;
    case 3: // Pandora's Box Explodes. You loose HP depending on reps
        iResult2 = iDice(2,3);
        iDamage = (iResult2 * 100) - m_pClientList[iClientH]->m_iRating;
        m_pClientList[iClientH]->m_iLastDamage = iDamage;
        SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_HP, NULL, NULL, NULL, NULL);
        SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "Doh, Pandora's box exploded !!");
        SendEventToNearClient_TypeA(iClientH, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTDAMAGE, iDamage, NULL, NULL);
        break;
    case 4: // Pandora's Box decreases your Reps
        iResult2 = iDice(1,10);
        iDecRep = (iResult2 * 5);
        m_pClientList[iClientH]->m_iRating -= iDecRep;
        SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "Doh, Pandora's box decreased your reps !!");
        break;
    case 5: // Pandora's Box send you in jail
        iResult2 = iDice(1,5);
        iLockTime = (iResult2 * 60);
    	switch(m_pClientList[iClientH]->m_cSide){
      case 1:
      	ZeroMemory(m_pClientList[iClientH]->m_cLockedMapName, sizeof(m_pClientList[iClientH]->m_cLockedMapName));
      	strcpy(m_pClientList[iClientH]->m_cLockedMapName, "arejail");
      	RequestTeleportHandler(iClientH, "2   ", "arejail", -1, -1);
      	break;
      case 2: 
      	ZeroMemory(m_pClientList[iClientH]->m_cLockedMapName, sizeof(m_pClientList[iClientH]->m_cLockedMapName));
      	strcpy(m_pClientList[iClientH]->m_cLockedMapName, "elvjail");;
      	RequestTeleportHandler(iClientH, "2   ", "elvjail", -1, -1);
      	break;
    	}
    	m_pClientList[iClientH]->m_iLockedMapTime = iLockTime;
    	m_pClientList[iClientH]->m_iTimeLeft_ForceRecall = iLockTime;
        SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "You were busted for using illegal Pandora's Box");
        break;
      }
    	break;
<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 !
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Perfect hahaha you own. I'll wait for entire code :P

Though will delete the wipe an item maybe...anyways Good Job!
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>
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

locobans wrote: Perfect hahaha you own. I'll wait for entire code :P

Though will delete the wipe an item maybe...anyways Good Job!
submit all ideas you have and i'll ad only what you want... i was just an idea i had but mine cannot be always good ;)
<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 !
€M4NU€L
Outpost bitch
Posts: 517
Joined: Sat Nov 19, 2005 9:07 pm
Location: I watch gay porn
Contact:

Post by €M4NU€L »

I dont like that Pandora Box i think is not usefull at all.
<span style='color:blue'>Helbreath Thermal</span> <span style='color:green'>BETA</span> <span style='color:red'>Soon</span>:<br><br>www.youporngay.com<br><br><img src='http://img264.imageshack.us/img264/1041 ... piopk7.jpg' border='0' alt='user posted image' /><br><img src='http://img257.imageshack.us/img257/3762 ... eakxj1.jpg' border='0' alt='user posted image' /><br><img src='http://arthur.crepin.free.fr/images/use ... mpsons.png' border='0' alt='user posted image' /><br><img src='http://img329.imageshack.us/img329/5797/pesgamerrr3.gif' border='0' alt='user posted image' /><br><br><u><b>BLACK GAY LIST:</b></u><br><br><span style='color:red'>€M4NU€L</span>:<br>I look like a girl and he's always complaining someone.
molo
Member
Posts: 140
Joined: Mon Jan 17, 2005 1:19 am

Post by molo »

umm every time i use Pandora's Box.. i get nuthing i have used Pandora's Box 100 times every time it say box is EMPTY :S :(
is there anyway fix it or its has to be same #280 in Item.cfg... or its a bug?..
can some one explain me here pelase. thx :)
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

€M4NU€L wrote: I dont like that Pandora Box i think is not usefull at all.
its very usefull expecaly if u have eegs u just change teh code aroudn to work with eggs and bam its golden
umm every time i use Pandora's Box.. i get nuthing i have used Pandora's Box 100 times every time it say box is EMPTY :S 
is there anyway fix it or its has to be same #280 in Item.cfg... or its a bug?..
can some one explain me here pelase. thx 
works fidn for me i get something ever 10 time at lest 1 with ten
<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>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

€M4NU€L wrote: I dont like that Pandora Box i think is not usefull at all.
Too bad...most of people think the opposite :D
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>
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

€M4NU€L wrote: I dont like that Pandora Box i think is not usefull at all.
so... why did you came and post another dickhead's comment ? Try to code anything if you even know any language more evoluted than html and come again, else you can go to hell and die. I'm not advertising for my codes to be used, i just release it, if you like you can use it, if not, just go around.


TO MOLO :

You have 1/29 chance on 300 to have an item... so add some items or reduce the iDice Range to have more chance havin' an item ;)
<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 !
€M4NU€L
Outpost bitch
Posts: 517
Joined: Sat Nov 19, 2005 9:07 pm
Location: I watch gay porn
Contact:

Post by €M4NU€L »

I didn't say i dont like i say i think is not usefull and ... i didnt want to hurt your feelings :P
<span style='color:blue'>Helbreath Thermal</span> <span style='color:green'>BETA</span> <span style='color:red'>Soon</span>:<br><br>www.youporngay.com<br><br><img src='http://img264.imageshack.us/img264/1041 ... piopk7.jpg' border='0' alt='user posted image' /><br><img src='http://img257.imageshack.us/img257/3762 ... eakxj1.jpg' border='0' alt='user posted image' /><br><img src='http://arthur.crepin.free.fr/images/use ... mpsons.png' border='0' alt='user posted image' /><br><img src='http://img329.imageshack.us/img329/5797/pesgamerrr3.gif' border='0' alt='user posted image' /><br><br><u><b>BLACK GAY LIST:</b></u><br><br><span style='color:red'>€M4NU€L</span>:<br>I look like a girl and he's always complaining someone.
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

*** Updated ***

Added some new effects and some items. See the first post for complete post.
<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 !
€M4NU€L
Outpost bitch
Posts: 517
Joined: Sat Nov 19, 2005 9:07 pm
Location: I watch gay porn
Contact:

Post by €M4NU€L »

Can't download Sprites :angry: :o :huh: :unsure: :blink: <_<
<span style='color:blue'>Helbreath Thermal</span> <span style='color:green'>BETA</span> <span style='color:red'>Soon</span>:<br><br>www.youporngay.com<br><br><img src='http://img264.imageshack.us/img264/1041 ... piopk7.jpg' border='0' alt='user posted image' /><br><img src='http://img257.imageshack.us/img257/3762 ... eakxj1.jpg' border='0' alt='user posted image' /><br><img src='http://arthur.crepin.free.fr/images/use ... mpsons.png' border='0' alt='user posted image' /><br><img src='http://img329.imageshack.us/img329/5797/pesgamerrr3.gif' border='0' alt='user posted image' /><br><br><u><b>BLACK GAY LIST:</b></u><br><br><span style='color:red'>€M4NU€L</span>:<br>I look like a girl and he's always complaining someone.
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

€M4NU€L wrote: Can't download Sprites :angry: :o :huh: :unsure: :blink: <_<
This code is useless, don't use it... :P
<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 !
€M4NU€L
Outpost bitch
Posts: 517
Joined: Sat Nov 19, 2005 9:07 pm
Location: I watch gay porn
Contact:

Post by €M4NU€L »

Lol funny :lol: fixed it :lol: :D :P B) :rolleyes: <_<
<span style='color:blue'>Helbreath Thermal</span> <span style='color:green'>BETA</span> <span style='color:red'>Soon</span>:<br><br>www.youporngay.com<br><br><img src='http://img264.imageshack.us/img264/1041 ... piopk7.jpg' border='0' alt='user posted image' /><br><img src='http://img257.imageshack.us/img257/3762 ... eakxj1.jpg' border='0' alt='user posted image' /><br><img src='http://arthur.crepin.free.fr/images/use ... mpsons.png' border='0' alt='user posted image' /><br><img src='http://img329.imageshack.us/img329/5797/pesgamerrr3.gif' border='0' alt='user posted image' /><br><br><u><b>BLACK GAY LIST:</b></u><br><br><span style='color:red'>€M4NU€L</span>:<br>I look like a girl and he's always complaining someone.
Post Reply