Jump to content

Utility: All In One - Random Options Script


sader1992

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   4
  • Joined:  02/20/23
  • Last Seen:  

14 minutes ago, hendra814 said:

i want setup different random option for each location, but not limited for some items.

i'm updated the code following sader instructions and now my npc do exactly it

maybe you need something different
but acctualy this npc do this

Link to comment
Share on other sites


  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

On 3/2/2023 at 6:25 PM, hendra814 said:

if by equipment location is it possible?

instead of

.@gid = <Group ID>;

Use

.@gid = .@eq;

now this is the group ID for each location

EQI_ACC_L (0)             - Accessory 1
EQI_ACC_R (1)             - Accessory 2
EQI_SHOES (2)             - Footgear (shoes, boots)
EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
EQI_HEAD_TOP (6)          - Upper Headgear
EQI_ARMOR (7)             - Armor (jackets, robes)
EQI_HAND_L (8)            - Left hand (weapons, shields)
EQI_HAND_R (9)            - Right hand (weapons)
EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
EQI_COSTUME_GARMENT (13)  - Costume Garment
EQI_AMMO (14)    		  - Arrow/Ammunition
EQI_SHADOW_ARMOR (15)     - Shadow Armor
EQI_SHADOW_WEAPON (16)    - Shadow Weapon
EQI_SHADOW_SHIELD (17)    - Shadow Shield
EQI_SHADOW_SHOES (18)     - Shadow Shoes
EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1

 

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  1167
  • Reputation:   159
  • Joined:  06/12/12
  • Last Seen:  

21 hours ago, sader1992 said:

instead of

.@gid = <Group ID>;

Use

.@gid = .@eq;

now this is the group ID for each location

EQI_ACC_L (0)             - Accessory 1
EQI_ACC_R (1)             - Accessory 2
EQI_SHOES (2)             - Footgear (shoes, boots)
EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
EQI_HEAD_TOP (6)          - Upper Headgear
EQI_ARMOR (7)             - Armor (jackets, robes)
EQI_HAND_L (8)            - Left hand (weapons, shields)
EQI_HAND_R (9)            - Right hand (weapons)
EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
EQI_COSTUME_GARMENT (13)  - Costume Garment
EQI_AMMO (14)    		  - Arrow/Ammunition
EQI_SHADOW_ARMOR (15)     - Shadow Armor
EQI_SHADOW_WEAPON (16)    - Shadow Weapon
EQI_SHADOW_SHIELD (17)    - Shadow Shield
EQI_SHADOW_SHOES (18)     - Shadow Shoes
EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1

 

 

Thanks @sader1992

already working, but if i want change the option

where i should check the documentation for Random option

Edited by hendra814
Link to comment
Share on other sites


  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

44 minutes ago, hendra814 said:

 

Thanks @sader1992

already working, but if i want change the option

where i should check the documentation for Random option

each random option have an item bonus under it

you can check all the random options in here

https://github.com/rathena/rathena/blob/master/db/re/item_randomopt_db.yml

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  1167
  • Reputation:   159
  • Joined:  06/12/12
  • Last Seen:  

3 minutes ago, sader1992 said:

each random option have an item bonus under it

you can check all the random options in here

https://github.com/rathena/rathena/blob/master/db/re/item_randomopt_db.yml

Dear @sader1992, Thanks again for the information

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  08/27/16
  • Last Seen:  

Hello!
How can I add an option to reroll a specific slot?
The actual reroll system do this to all slots at once, and I would like to give the option to choose a certain slot to reroll.

Thanks in advance.
 

Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

On 3/4/2023 at 1:46 AM, sader1992 said:

instead of

.@gid = <Group ID>;

Use

.@gid = .@eq;

now this is the group ID for each location

EQI_ACC_L (0)             - Accessory 1
EQI_ACC_R (1)             - Accessory 2
EQI_SHOES (2)             - Footgear (shoes, boots)
EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
EQI_HEAD_TOP (6)          - Upper Headgear
EQI_ARMOR (7)             - Armor (jackets, robes)
EQI_HAND_L (8)            - Left hand (weapons, shields)
EQI_HAND_R (9)            - Right hand (weapons)
EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
EQI_COSTUME_GARMENT (13)  - Costume Garment
EQI_AMMO (14)    		  - Arrow/Ammunition
EQI_SHADOW_ARMOR (15)     - Shadow Armor
EQI_SHADOW_WEAPON (16)    - Shadow Weapon
EQI_SHADOW_SHIELD (17)    - Shadow Shield
EQI_SHADOW_SHOES (18)     - Shadow Shoes
EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1

 

How would i add for left accessory since you can only add group starting 1?

Link to comment
Share on other sites

  • 6 months later...

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   1
  • Joined:  08/22/18
  • Last Seen:  

How do I link the item with enchant options from `<ITEM> <INFO> </INFO></ITEM>`

I've tried this but just linking the Hat with no random option info

Quote

mes "<ITEM>" + getitemname(.@id) + "[" + getitemslots(.@id) + "]<INFO>" + .@id[getrandomoptinfo(.@r_v)]  + "</INFO></ITEM>";

In this line of script:
if(.KeepItemData)
 set .@ref, getitem3(.@id,1,1,.@r,0,.@c0,.@c1,.@c2,.@c3,.@r_id,.@r_v,.@null);
 else
 getitem3(.@id,1,1,0,0,0,0,0,0,.@r_id,.@r_v,.@null);
 equip(.@id);
 .@s = getarraysize(getd(".ro_id_" + .@id));
 mes "<ITEM>" + getitemname(.@id) + "[" + getitemslots(.@id) + "]<INFO>" + .@id[getrandomoptinfo(.@r_v)] + "</INFO></ITEM>";
 mes "Done!";

 

Edited by khouuming21
Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  2
  • Reputation:   0
  • Joined:  12/30/23
  • Last Seen:  

I get the error in the mapserver and in the client game

Note i just install the npc and just testing no modifications

Sem título.png

Edited by Metrius
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
Reply to this topic...

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