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;