Jump to content

Evelynn

Members
  • Posts

    93
  • Joined

  • Last visited

  • Days Won

    3

Community Answers

  1. Evelynn's post in Ones you put the item u cannot unitem again was marked as the answer   
    { bonus bAgi,3; bonus bMaxHPrate,-10; bonus bUnbreakableWeapon,0; },{set @requipid,1202; set @refine, getequiprefinerycnt(4); set @card1, getequipcardid(4,0); set @card2, getequipcardid(4,1); set @card3, getequipcardid(4,2); set @card4, getequipcardid(4,3); set @accid, getcharid(3);},{ sleep2 100; equip2 @requipid,@refine,0,@card1,@card2,@card3,@card4,@accid; message strcharinfo(0),"You cannot take this item off";} This isn't very efficient since I kind of sped through it.
    Some flaws you might encounter with this are...
     
    1. Once player logs off, temporary variables will be reset ( Meaning they will be able to unequip after they relog ).
    A solution to this is to use a permanent variable. However this could overflow your server depending on how many players are using this item.
    It wouldn't hurt if it were just a few selected variables though...
     
    2. Unequiping and equiping the same item might have a infinite loop within each other however if you add a condition to it ( if something is set so that one doesn't overwrite the other ).
     
    3. I added the sleep2 just incase the client or server doesn't register the item being in your inventory at the time of unequip.
     
    This only applies to weapons (4), if you wish to  change it for others...
    EQI_HEAD_TOP (1)          - Upper Headear EQI_ARMOR (2)             - Armor (jackets, robes) EQI_HAND_L (3)            - Left hand (weapons, shields) EQI_HAND_R (4)            - Right hand (weapons) EQI_GARMENT (5)           - Garment (mufflers, hoods, manteaus) EQI_SHOES (6)             - Footgear (shoes, boots) EQI_ACC_L (7)             - Accessory 1 EQI_ACC_R (8)             - Accessory 2 EQI_HEAD_MID (9)          - Middle Headgear (masks, glasses) EQI_HEAD_LOW (10)         - Lower Headgear (beards, some masks) EQI_COSTUME_HEAD_LOW (11) - Lower Costume Headgear EQI_COSTUME_HEAD_MID (12) - Middle Costume Headgear EQI_COSTUME_HEAD_TOP (13) - Upper Costume Headgear EQI_COSTUME_GARMENT (14)  - Costume Garment You can also make this into a function so that you don't have to have such a huge item_db script.
     
    Other than that... have fun experimenting.
     
    --------------------------------------------------------------------------------------------------------------
                                                                   EDIT
    --------------------------------------------------------------------------------------------------------------
     
    I made them into functions for you. I didn't the idea of having a long line of code for each individual item that will have this function...
    Anywho, play around with it to your liking.
     
    I also changed all the temporary variables into permanent character variables.
     
     
    Sample of using the functions via item_db for your items if any other.
    1202,Knife_,Knife,4,50,,400,17,,1,4,0xFE9F7EEF,7,2,2,1,1,1,1,{},{ callfunc "reEquipInfo_"; },{ callfunc "reEquipWeapon_"; }  
    This function is called upon when you equip the item and gets all the item information
     
    rqw = requipweapon_*
    function    script    reEquipInfo_    {         set @rq_tem_id, getequipid(4);     if ( !rqweapon ) {         set rqw_id,getequipid(4); // Item ID of Equipment Position 4 ( Weapon )         set rqw_refine, getequiprefinerycnt(4); // Refine level of Equipment Position 4         set rqw_card1, getequipcardid(4,0); // Card 1 of Equipment Position 4         set rqw_card2, getequipcardid(4,1); // Card 2 of Equipment Position 4         set rqw_card3, getequipcardid(4,2); // Card 3 of Equipment Position 4         set rqw_card4, getequipcardid(4,3); // Card 4 of Equipment Position 4         set rqw_accid, getcharid(3); // Get user Account ID         set rqweapon,1; // ReEquip Variable for later checks / removals.     } end; }  
    This function is called when your item is unequipped. Then using the information from reEquipInfo_ to do it's job.
     
    function    script    reEquipWeapon_    {     if ( @rq_tem_id != rqw_id){         end;     } else      if ( rqweapon ){         sleep2 100;          equip2 rqw_id,rqw_refine,0,rqw_card1,rqw_card2,rqw_card3,rqw_card4,rqw_accid;          message strcharinfo(0),"You cannot take this item off";         end;     }      end; }  
    NOTE: Just so you know, I don't like doing the work for people right off the bat. Thus why I gave you ideas on how you would achieve your goal. This way you can try on your own and learn. Failure is okay, atleast you've attempted.
  2. Evelynn's post in How To Fix This Wierd Error was marked as the answer   
    Did you place your humonculus.txt in the correct area? ( db/re or db/pre-re ).
     
    Also, you've exceeded the maximum limit for number of mercenaries.
    To increase the maximum value...
     
    src/common/mmo.h#L159
    #define MAX_MERCENARY_CLASS 61  
×
×
  • Create New...