How to make Random drop ?

Results 1 to 10 of 10
  1. #1
    Valued Member Versgar is offline
    MemberRank
    Dec 2015 Join Date
    116Posts

    How to make Random drop ?

    How to make Random drop ?

    PHP Code:
    if (gObj->Class == 6
        {
         
    ItemSerialCreateSend (gObj->m_Index,gObj->MapNumber,gObj->X-1,gObj->Y,JewelofLuck,0,0,0,0,0,MaxHitUser,0,0);

     
    ItemSerialCreateSend (gObj->m_Index,gObj->MapNumber,gObj->X-1,gObj->Y,JewelofExellent,0,0,0,0,0,MaxHitUser,0,0);

     
    ItemSerialCreateSend (gObj->m_Index,gObj->MapNumber,gObj->X-1,gObj->Y,JewelofMystical,0,0,0,0,0,MaxHitUser,0,0);

     
    ItemSerialCreateSend (gObj->m_Index,gObj->MapNumber,gObj->X-1,gObj->Y,JewelofBless,0,0,0,0,0,MaxHitUser,0,0);

     
    ItemSerialCreateSend (gObj->m_Index,gObj->MapNumber,gObj->X-1,gObj->Y,JewelofSoul,0,0,0,0,0,MaxHitUser,0,0);

       } 


  2. #2
    Don't be afraid to ask! RevolGaming is offline
    MemberRank
    Jun 2012 Join Date
    1,458Posts

    Re: How to make Random drop ?

    What you mean under random drop?
    You want to random drop this jwls on the maps?

    Create a switch case and a simple

    int randomnumber = rand()%6;

    switch(randomnumber){
    case 1 itemdrop1
    case 2 itemdrop2
    case 3
    }

    check the GS source than copy any switch case and modify.

  3. #3
    Valued Member Versgar is offline
    MemberRank
    Dec 2015 Join Date
    116Posts

    Re: How to make Random drop ?

    Quote Originally Posted by RevolGaming View Post
    What you mean under random drop?
    You want to random drop this jwls on the maps?

    Create a switch case and a simple

    int randomnumber = rand()%6;

    switch(randomnumber){
    case 1 itemdrop1
    case 2 itemdrop2
    case 3
    }

    check the GS source than copy any switch case and modify.
    need a random 100% drop 1 of the 5 stones

  4. #4
    Don't be afraid to ask! RevolGaming is offline
    MemberRank
    Jun 2012 Join Date
    1,458Posts

    Re: How to make Random drop ?

    What 100%...?

    Can you write in english? I dont understand what you want.

    I wrote a code which 100% working, if you add an ItemCreate in each "Case" than it will be 100% drop.

    %6 mean case 0,1,2,3,4,5,6 so its 7 itemcreate

    if you want only 6 itemcreate than use %5 and 0,1,2,3,4,5 case's

  5. #5
    (づ。◕‿‿◕。) Natzugen is offline
    MemberRank
    Jun 2014 Join Date
    ElbelandLocation
    1,858Posts

  6. #6
    Valued Member Versgar is offline
    MemberRank
    Dec 2015 Join Date
    116Posts

    Re: How to make Random drop ?

    Quote Originally Posted by RevolGaming View Post
    What 100%...?

    Can you write in english? I dont understand what you want.

    I wrote a code which 100% working, if you add an ItemCreate in each "Case" than it will be 100% drop.

    %6 mean case 0,1,2,3,4,5,6 so its 7 itemcreate

    if you want only 6 itemcreate than use %5 and 0,1,2,3,4,5 case's
    Sorry for my English,I translate through Google translate. I have to do current so by killing the specified monster fell 1 from 5 stones randomly,with a 100% drop.

    - - - Updated - - -

    Thanks,but for these lessons I do not understand.

  7. #7
    Don't be afraid to ask! RevolGaming is offline
    MemberRank
    Jun 2012 Join Date
    1,458Posts

    Re: How to make Random drop ?

    Okey I understand your language problem, but than whats your problem with my code?!

    You want a working totally maded code, what you just copy paste and working? Lol... What kind of programmer are you if you cannot make the thing what I wrote at the top.

    but okey...

    Here is it...
    Code:
    if (gObj->Class == 6) 
        {
    int randomitempls=rand()%4;
    int ItemType ;
         switch(randomitempls)
    	{
    		case 0:
    			ItemType = ITEMGET(JewelofLuckItemCode);
    			break;
    			// --
    		case 1:
    			ItemType = ITEMGET(JewelofExellentItemCode);
    			break;
    case 2:
    			ItemType = ITEMGET(JewelofMysticalItemCode);
    			break;
    case 3:
    			ItemType = ITEMGET(12, 30); //JewelofBless pack example
    			break;
    case 4:
    			ItemType = ITEMGET(12, 31); //JewelofSoul pack example
    			break;
    }
    
     ItemSerialCreateSend (gObj->m_Index,gObj->MapNumber,gObj->X-1,gObj->Y,ItemType,0,0,0,0,0,MaxHitUser,0,0);
    
       }

  8. #8
    Valued Member Versgar is offline
    MemberRank
    Dec 2015 Join Date
    116Posts

    Re: How to make Random drop ?

    Quote Originally Posted by RevolGaming View Post
    Okey I understand your language problem, but than whats your problem with my code?!

    You want a working totally maded code, what you just copy paste and working? Lol... What kind of programmer are you if you cannot make the thing what I wrote at the top.

    but okey...

    Here is it...
    Code:
    if (gObj->Class == 6) 
        {
    int randomitempls=rand()%4;
    int ItemType ;
         switch(randomitempls)
        {
            case 0:
                ItemType = ITEMGET(JewelofLuckItemCode);
                break;
                // --
            case 1:
                ItemType = ITEMGET(JewelofExellentItemCode);
                break;
    case 2:
                ItemType = ITEMGET(JewelofMysticalItemCode);
                break;
    case 3:
                ItemType = ITEMGET(12, 30); //JewelofBless pack example
                break;
    case 4:
                ItemType = ITEMGET(12, 31); //JewelofSoul pack example
                break;
    }
    
     ItemSerialCreateSend (gObj->m_Index,gObj->MapNumber,gObj->X-1,gObj->Y,ItemType,0,0,0,0,0,MaxHitUser,0,0);
    
       }
    Thank you very much. I just learn Visual Studio.

  9. #9
    Don't be afraid to ask! RevolGaming is offline
    MemberRank
    Jun 2012 Join Date
    1,458Posts

    Re: How to make Random drop ?

    yeah you learn visual studio . dont forget to press the like button.

    And I hope its working good.

  10. #10
    Valued Member Versgar is offline
    MemberRank
    Dec 2015 Join Date
    116Posts

    Re: How to make Random drop ?

    Quote Originally Posted by RevolGaming View Post
    yeah you learn visual studio . dont forget to press the like button.

    And I hope its working good.
    Everything works perfectly as I wanted. Thank you ! )



Advertisement