1 //===== rAthena Script =======================================
2 //= Sample Random Option Script
3 //===== Description: =========================================
4 //= Enchant a weapon with a random element option
5 //= to a weapon with no random option.
6 //===== Changelogs: ==========================================
7 //= 1.0 First version. [Secretdataz]
8 //============================================================
10 prontera,162,195,4 script Elemental Master 1_M_WIZARD,{
12 mes "[Elemental Master]";
13 mes "I could enchant your weapon with an element.";
14 mes "Are you interested?";
16 if(select("Yes, I'm interested in that.") == 1){
17 .@id = getequipid(EQI_HAND_R);
18 for(.@i = 0; .@i < .sz; ++.@i){
19 if(.@id == .alloweditems[.@i])
22 mes "[Elemental Master]";
24 mes "You are not holding anything in your hand.";
26 } else if(!.@allowed){
27 mes "Your item can't be enchanted.";
29 } else if(getequiprandomoption(EQI_HAND_R,0,ROA_ID)){
30 mes "Your weapon has already been enchanted.";
33 mes "Do you want to enchant your " + getitemname(.@id) + " with a random element?";
35 if(select("Yes, proceed.") == 1){
36 mes "[Elemental Master]";
37 mes "*mumble mumble*";
38 progressbar "#00FF00",2;
40 setrandomoption(EQI_HAND_R,0,RDMOPT_WEAPON_ATTR_NOTHING + rand(10),0,0);
41 mes "[Elemental Master]";
42 mes "Here's your weapon";
52 setarray .alloweditems[0],1201,1202; // Add more item ids here
53 .sz = getarraysize(.alloweditems);