Jump to content
  • 0

Ones you put the item u cannot unitem again


dize11

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

i want to know if its possible to do that script. once you put the headgear u cannot quit it again

Link to comment
Share on other sites

12 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

{ 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.

Edited by Evelynn
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

If you mean not being able to take off the item at all anymore then, you can do on Unequip to equip the specific item again using the script command equip2. This should be an option inside the item db. Similar to some items / cards, when you take an equipment off you lose # of HP.

Edited by Evelynn
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

If you mean not being able to take off the item at all anymore then, you can do on Unequip to equip the specific item again using the script command equip2. This should be an option inside the item db. Similar to some items / cards, when you take an equipment off you lose # of HP.

How can i do that !?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

1101,Sword,Sword,4,100,,500,25,,1,3,0x000654E3,7,2,2,1,2,1,2,{Script},{OnEquip},{OnUnequip}

 

OnEquip area, you'd want to store the equipment's information such as

the ID, REFINE, CARD 1, CARD 2, ... etc

 

I don't know if rAthena normally has equip2, but im sure there's a .diff/.patch for it.

 

in OnUnEquip, you use the equip2 script function with all the information you gathered so it knows exactly what item you are talking about

to re-equip it.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

1101,Sword,Sword,4,100,,500,25,,1,3,0x000654E3,7,2,2,1,2,1,2,{Script},{OnEquip},{OnUnequip}

 

OnEquip area, you'd want to store the equipment's information such as

the ID, REFINE, CARD 1, CARD 2, ... etc

 

I don't know if rAthena normally has equip2, but im sure there's a .diff/.patch for it.

 

in OnUnEquip, you use the equip2 script function with all the information you gathered so it knows exactly what item you are talking about

to re-equip it.

 

example: i have this weapon once i put in my equip when i click it again this can't be taken off in the equip.
but i dont know what to put in that onequip
1196,Chrome_Metal_Two-Hand_Sword,Chrome Metal Two-Hand Sword,4,20,10,400,280,,1,0,0x00044502,8,2,34,3,110,1,3,{ bonus bAgi,3; bonus bMaxHPrate,-10; bonus bUnbreakableWeapon,0; },{},{}

1101,Sword,Sword,4,100,,500,25,,1,3,0x000654E3,7,2,2,1,2,1,2,{Script},{OnEquip},{OnUnequip}

 

OnEquip area, you'd want to store the equipment's information such as

the ID, REFINE, CARD 1, CARD 2, ... etc

 

I don't know if rAthena normally has equip2, but im sure there's a .diff/.patch for it.

 

in OnUnEquip, you use the equip2 script function with all the information you gathered so it knows exactly what item you are talking about

to re-equip it.

 

example: i have this weapon once i put in my equip when i click it again this can't be taken off in the equip.
but i dont know what to put in that onequip
1196,Chrome_Metal_Two-Hand_Sword,Chrome Metal Two-Hand Sword,4,20,10,400,280,,1,0,0x00044502,8,2,34,3,110,1,3,{ bonus bAgi,3; bonus bMaxHPrate,-10; bonus bUnbreakableWeapon,0; },{},{}

i dont know if its same of this my prob

http://rathena.org/board/topic/84606-item-unequip-after-some-time/
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

What you want to do OnEquip is the following.

 

Create a variable that stores the current weapon's refine level.

Create another variable that stores the weapon's card IDs. Do this for all 4 slots.

 

I just searched up Xantara's equip2 script function. Click Here

equip2 <item id>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};

Create variables for each detail stated above.

 

Then when using equip2, you would insert the variables you created into the areas accordingly.

 

--------------------------------------------------------------

 

It is similar if you want to unequip, but right now you are wanting to re-equip the item, so it's quite different.

When re-equipping, you want to make sure that you have enough information to tell the server which item you are talking about exactly.

If it doesn't have enough information, and you have like say 2-3 of the same items in your inventory, it doesn't know which one you are talking about.

Edited by Evelynn
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

What you want to do OnEquip is the following.

 

Create a variable that stores the current weapon's refine level.

Create another variable that stores the weapon's card IDs. Do this for all 4 slots.

 

I just searched up Xantara's equip2 script function. Click Here

equip2 <item id>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};

Create variables for each detail stated above.

 

Then when using equip2, you would insert the variables you created into the areas accordingly.

 

--------------------------------------------------------------

 

It is similar if you want to unequip, but right now you are wanting to re-equip the item, so it's quite different.

When re-equipping, you want to make sure that you have enough information to tell the server which item you are talking about exactly.

If it doesn't have enough information, and you have like say 2-3 of the same items in your inventory, it doesn't know which one you are talking about.

Example again: its like a card when u put the card in the item u cannot take it off.. until u go in the decard npc to quit it.. this fuction i want to use but in items once u put ur headgear u cannot able to click it again to take it off

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

I do not think there is such function implemented in rA.

 

Thus the reason why I gave you an alternative option to go for by using equip2.

If the user tries to take it off, it'll just re-equip itself again.

 

You can also create a NPC using the method I stated as well.

Edited by Evelynn
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

I do not think there is such function implemented in rA.

 

Thus the reason why I gave you an alternative option to go for by using equip2.

If the user tries to take it off, it'll just re-equip itself again.

 

You can also create a NPC using the method I stated as well.

I will try it and i give you the answer thanks anyways for ur patient

I started to install the src but i dont know this how works i need to put ( equip2 <item id>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};) in the itemdb2? or a .txt ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

I started to install the src but i dont know this how works i need to put ( equip2 <item id>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>} ;) in the itemdb2? or a .txt ?

 

That is just a guideline. ( How to use equip2 ). You do not need to put it anywhere. 

It is to help you determine what goes where within the equip2 script function. Parameters in other words.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

I started to install the src but i dont know this how works i need to put ( equip2 <item id>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>} ;) in the itemdb2? or a .txt ?

 

That is just a guideline. ( How to use equip2 ). You do not need to put it anywhere. 

It is to help you determine what goes where within the equip2 script function. Parameters in other words.

I dont get how this works..

can u teach me step by step!?

i have already installed the src.. so now which is the next step to work the item

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

{ 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.

Thank you very very very much i apreciate your help!!! :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...