Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
//===== rAthena Script =======================================
//= Mystic Enchanter
//===== By ===================================================
//= llchrisll
//===== Version ==============================================
//= 1.0 - Initial Version
// - Added an check to prevent enchanting,
// if every available Enchantment Type is already in usage
// - Changed the Slot selection to be fixed slot
//= 1.1 - Added Random Option Enchanting
// - Added support to reset selected enchantments as well
// - Changed the Price Code into a function
// - Fixed a bug regarding Special Random Options
// - Added a limitation for Special Random Options
//===== Tested With ==========================================
//= rAthena 05/13/2020 Revision
//= GIT Hash: 5154e078999ea8b0ae8680126933fe11a2506dd9
//===== Description ==========================================
//= All-in-one Enchanter
//= Price for Enchanting and Resetting seperatly configurable
//= Every Equipment Slot has it's own settings
//= Restricted Equipment = Define which Items are enchantable
//= Equipment Limitations = Limited Slots Limit per Item configurable
//= Enchantments can be individual enabled or disabled
//===== Comments =============================================
//= This is merge of my Costume and Armor Enchanter with additonal features.
//= The idea about the shop display is inspired by sader's enchanter.
//= There is also a version without Random Options Support available > mystic_enchanter_no_ropt.txt
//============================================================
prontera,147,174,4 script Mystic Enchanter 4_M_MOCASS1,{
function ME_Price;
disable_items;
mes .n$;
mes "Welcome, "+strcharinfo(0)+"!";
mes "I can enchant, based on my powers, various Equipments with my Enchantments, as well as upgrade and clear Enchantments,but only those I enchanted myself.";
mes " ";
mes "How can I help you?";
if(.enchant_restrict)
mes "Currently you can only enchant restricted Equipment!!!";
next;
switch(select("- Select Equipment:- Information:"+ ( (.enchant_restrict)?"- Restricted Equipment":"")+":- Nevermind")) {
case 1:
mes .n$;
mes "Please select the equipment you want to enchant/upgrade the enchantments or reset the enchantments:";
mes "^FF0000Note: If you can't see an equipment, you can't either enchant it or you don't have anything equipped on it.^000000";
next;
for ( set .@l,0; .@l < getarraysize(.slot); set .@l,.@l + 24)
set .@i_menu$,.@i_menu$+ ( (.slot[.@l+1] == 1 && getequipid(.slot[.@l]) != -1)?"["+getequipname(.slot[.@l])+"]":"") + ( ((.@l+24) < (getarraysize(.slot)-1))?":":"");
set .@e,select(.@i_menu$)*24-24;
if(.enchant_restrict) {
for ( set .@c,0; .@c < getarraysize(getd("."+.restrict_v$[.@e/24])); set .@c,.@c + 1)
if(getequipid(.slot[.@e]) == getd("."+.restrict_v$[.@e/24]+"["+.@c+"]")) {
set .@f,0;
break;
} else
set .@f,1;
if(.@f) {
mes .n$;
mes "I'm sorry, but you can't enchant this item.";
mes "Please take a look at the shop for the enchantable items.";
close;
}
}
// Specific Equipment Enchantable Restriction (.<Type>_enc)
for ( set .@c,0; .@c < getarraysize(getd("."+.limit_v$[.@e/24])); set .@c,.@c + 2)
if(getequipid(.slot[.@e]) == getd("."+.limit_v$[.@e/24]+"["+.@c+"]"))
if(getd("."+.limit_v$[.@e/24]+"["+(.@c+1)+"]") == 0) {
set .@f,1;
break;
} else if(getd("."+.limit_v$[.@e/24]+"["+(.@c+1)+"]") > 0)
set .@e_max,getd("."+.limit_v$[.@e/24]+"["+(.@c+1)+"]");
// Item found in Equipment Slot Limitation Arrays and 0 enchantable slots
if(.@f) {
mes .n$;
mes "I'm sorry, but you can't enchant this item.";
mes "Please take a look at the Equipment Limitations in \"Information\" for details.";
close;
}
set .@part,.slot[.@e];
set .@id,getequipid(.@part);
set .@ref,getequiprefinerycnt(.@part);
set .@c_slot,getitemslots(.@id);
set .@c1,getequipcardid(.@part,0);
set .@c2,getequipcardid(.@part,1);
set .@c3,getequipcardid(.@part,2);
set .@c4,getequipcardid(.@part,3);
// Count how many slots are used by enchants
if(.@c2 && compare(getitemname(.@c2),"Card") != 1) set .@e_cnt,.@e_cnt + 1;
if(.@c3 && compare(getitemname(.@c3),"Card") != 1) set .@e_cnt,.@e_cnt + 1;
if(.@c4 && compare(getitemname(.@c4),"Card") != 1) set .@e_cnt,.@e_cnt + 1;
mes .n$;
mes "Please select what you want to do now:";
mes "Price for Enchanting & Upgrading:";
switch(.slot[.@e+10]) {
case 0: mes "None"; break;
case 1: mes .slot[.@e+11]+" Zeny"; break;
case 2: mes .slot[.@e+11]+" Cash Points"; break;
default: mes .slot[.@e+11]+"x "+getitemname(.slot[.@e+10]); break;
}
if(.slot[.@e+12]) {
mes "Price for Reseting:";
switch(.slot[.@e+13]) {
case 0: mes "None"; break;
case 1: mes .slot[.@e+14]+" Zeny"; break;
case 2: mes .slot[.@e+14]+" Cash Points"; break;
default: mes .slot[.@e+14]+"x "+getitemname(.slot[.@e+13]); break;
}
}
next;
switch(select("- Enchant:- Upgrade Enchant:"+ ( (.slot[.@e+12])?"- Reset Enchants":"")+":"+( (.slot[.@e+16])?"- Random Option Enchantment":""))) {
case 1:
ME_Price .slot[.@e+10],.slot[.@e+11],1;
if(!.@e_max) {
// Define the max enchantable slots based on the available card slots
if(.@c_slot <= 1) set .@e_max,3;
else if(.@c_slot == 2) set .@e_max,2;
else if(.@c_slot == 3) set .@e_max,1;
}
// Define the max available enchantment types based on the settings
if(.slot[.@e+2]) set .@enc_max,.@enc_max + 1;
if(.slot[.@e+5]) set .@enc_max,.@enc_max + 1;
if(.slot[.@e+8]) set .@enc_max,.@enc_max + 1;
if(.@e_cnt >= .@e_max || .@e_cnt >= .@enc_max) {
mes .n$;
mes "I'm sorry, but this item has already reached the maximum amount of enchants.";
close;
}
// Defining what enchants are selectable, if the are limited slots
if(.@e_max < 3) {
mes .n$;
mes "Please choose the enchantments you want to use for the "+.@e_max+" slots you have available.";
mes "^FF0000Note: The order is not important, like if you select Special first, it will be placed last no matter what.^000000";
next;
while(.@e_ct < .@e_max) {
setd(".@e_c"+select( ((.slot[.@e+2] && !.@e_c1)?"- Attribute":"")+":"+( (.slot[.@e+5] && !.@e_c2)?"- Status":"")+":" + ((.slot[.@e+8] && !.@e_c3)?"- Special":""))),1;
set .@e_ct,.@e_ct + 1;
}
} else {
if(.slot[.@e+2]) set .@e_c1,1;
if(.slot[.@e+5]) set .@e_c2,1;
if(.slot[.@e+8]) set .@e_c3,1;
}
mes .n$;
// Attribute Enchants:
if(.@e_c1 && !.@c4) {
if(.slot[.@e+3] == 0) { // Random Attribute Enchantment
if(!.enchant_rand) // Simple Randomizer
set .@a,rand(getarraysize(.attr_v$));
else { // Advanced Randomizer
set .@enc_c,rand(850); // Total of 6 Attributes
if(.@enc_c < 100) set .@a,1;
else if(.@enc_c < 250) set .@a,2;
else if(.@enc_c < 400) set .@a,3;
else if(.@enc_c < 550) set .@a,4;
else if(.@enc_c < 700) set .@a,5;
else if(.@enc_c < 850) set .@a,6;
}
} else if(.slot[.@e+3] == 1) {
mes "Please select which Attribute Enchantment you want:";
set .@a,select(.attr_m$) - 1;
next;
mes .n$;
}
if(.slot[.@e+4] == 0) // Attribute Enchant Upgrade: Disabled = Random selected Level
set .@r,rand(getarraysize(getd("."+.attr_v$[.@a])));
set .@e_id4,getd("."+.attr_v$[.@a]+"["+.@r+"]"); // Saving Enchant ID for the actual process
set .@e_c1,0;
}
// Status Enchants:
if(.@e_c2 && !.@c3) {
if(.slot[.@e+6] == 0) { // Random Status Enchantment
if(!.enchant_rand) // Simple Randomizer
set .@a,rand(getarraysize(.stats_v$));
else { // Advanced Randomizer
set .@enc_c,rand(1600); // Total of 11 Status
if(.@enc_c < 100) set .@a,0;
else if(.@enc_c < 250) set .@a,1;
else if(.@enc_c < 400) set .@a,2;
else if(.@enc_c < 550) set .@a,3;
else if(.@enc_c < 700) set .@a,4;
else if(.@enc_c < 850) set .@a,5;
else if(.@enc_c < 1000) set .@a,6;
else if(.@enc_c < 1150) set .@a,7;
else if(.@enc_c < 1300) set .@a,8;
else if(.@enc_c < 1450) set .@a,9;
else if(.@enc_c < 1600) set .@a,10;
}
} else if(.slot[.@e+6] == 1) {
mes "Please select which Status Enchantment you want:";
set .@a,select(.stats_m$) - 1;
next;
mes .n$;
}
if(.slot[.@e+7] == 0) // Status Enchant Upgrade: Disabled = Random selected Level
set .@r,rand(getarraysize(getd("."+.stats_v$[.@a])));
set .@e_id3,getd("."+.stats_v$[.@a]+"["+.@r+"]"); // Saving Enchant ID for the actual process
set .@e_c2,0;
}
// Special Enchants:
if(.@e_c3 && !.@c2) {
if(.slot[.@e+9] == 0) { // Random Special Enchantment
if(!.enchant_rand) // Simple Randomizer
set .@a,rand(getarraysize(.special_v$));
else { // Advanced Randomizer
set .@enc_c,rand(2400); // Total of 14 Special Enchants
if(.@enc_c < 100) set .@a,0;
else if(.@enc_c < 250) set .@a,1;
else if(.@enc_c < 400) set .@a,2;
else if(.@enc_c < 550) set .@a,3;
else if(.@enc_c < 700) set .@a,4;
else if(.@enc_c < 850) set .@a,5;
else if(.@enc_c < 1000) set .@a,6;
else if(.@enc_c < 1150) set .@a,7;
else if(.@enc_c < 1300) set .@a,8;
else if(.@enc_c < 1450) set .@a,9;
else if(.@enc_c < 1600) set .@a,10;
else if(.@enc_c < 1750) set .@a,11;
else if(.@enc_c < 1900) set .@a,12;
else if(.@enc_c < 2050) set .@a,13;
}
} else if(.slot[.@e+9] == 1) {
mes "Please select which Special Enchantment you want:";
set .@a,select(.special_m$) - 1;
next;
mes .n$;
}
// Randomized Special Enchant Level
set .@r,rand(getarraysize(getd("."+.special_v$[.@a])));
set .@e_id2,getd("."+.special_v$[.@a]+"["+.@r+"]"); // Saving Enchant ID for the actual process
set .@e_c3,0;
}
// Saving Random Options
if(getequiprandomoption(.@part,0,ROA_ID) != 0) {
setarray .@OptID[0],getequiprandomoption(.@part,0,ROA_ID),getequiprandomoption(.@part,1,ROA_ID),getequiprandomoption(.@part,2,ROA_ID),getequiprandomoption(.@part,3,ROA_ID),getequiprandomoption(.@part,4,ROA_ID);
setarray .@OptVal[0],getequiprandomoption(.@part,0,ROA_VALUE),getequiprandomoption(.@part,1,ROA_VALUE),getequiprandomoption(.@part,2,ROA_VALUE),getequiprandomoption(.@part,3,ROA_VALUE),getequiprandomoption(.@part,4,ROA_VALUE);
setarray .@OptParam[0],getequiprandomoption(.@part,0,ROA_PARAM),getequiprandomoption(.@part,1,ROA_PARAM),getequiprandomoption(.@part,2,ROA_PARAM),getequiprandomoption(.@part,3,ROA_PARAM),getequiprandomoption(.@part,4,ROA_PARAM);
}
delequip .@part;
if(getarraysize(.@OptID) > 0)
getitem3 .@id,1,1,.@ref,0,.@c1,( (.@c2)?.@c2:.@e_id2),( (.@c3)?.@c3:.@e_id3),( (.@c4)?.@c4:.@e_id4),.@OptID,.@OptVal,.@OptParam;
else
getitem2 .@id,1,1,.@ref,0,.@c1,( (.@c2)?.@c2:.@e_id2),( (.@c3)?.@c3:.@e_id3),( (.@c4)?.@c4:.@e_id4);
ME_Price .slot[.@e+10],.slot[.@e+11],2;
mes "The Enchantment was successfull.";
break;
// Upgrade Enchantments
case 2:
mes .n$;
if(!.@e_cnt) { // No Enchantments
mes "It seems like there are no enchantments on this item to upgrade.";
close;
}
if(!.slot[.@e+4] && !.slot[.@e+7]) {
mes "I can't upgrade the enchantments on this item.";
close;
}
// Price Check
ME_Price .slot[.@e+10],.slot[.@e+11],1;
mes "Please choose which Enchant Slot you want to Upgrade:";
mes "^FF0000Note: Special Enchants can't be upgraded.^000000";
next;
set .@s,5 - (select( ((.@c4 && compare(getitemname(.@c4),"Card") != 1)?"Enchant Slot 1":"")+":"+ ( (.@c3 && compare(getitemname(.@c3),"Card") != 1)?"Enchant Slot 2":"")));
mes .n$;
mes "Please select what kind of enchantment is in there:";
mes "^FF0000Note: STR,... are Attribute, ATK,... are Status and anything else is Special.^000000";
next;
switch(select( ((.slot[.@e+4])?"- Attribute":"")+":"+ ((.slot[.@e+7])?"- Status":""))) {
case 1: set .@type$,"attr"; set .@t,select(.attr_m$) - 1; break;
case 2: set .@type$,"stats"; set .@t,select(.stats_m$) - 1; break;
}
mes .n$;
for ( set .@r,0; .@r < getarraysize(getd("."+getd("."+.@type$+"_v$["+.@t+"]"))); set .@r,.@r + 1)
if(getd("."+getd("."+.@type$+"_v$["+.@t+"]")+"["+.@r+"]") == getd(".@c"+.@s))
if(getd("."+getd("."+.@type$+"_v$["+.@t+"]")+"["+(.@r+1)+"]") != 0) { // Check if there is upgrade available
set .@u_go,1;
break;
} else if(getd("."+getd("."+.@type$+"_v$["+.@t+"]")+"["+(.@r+1)+"]") == 0) { // No upgrade available anymore
set .@u_fail,1;
break;
}
if(.@u_go) {
if( (.@type$ == "attr" && .slot[.@e+4] == 2) || (.@type$ == "stats" && .slot[.@e+7] == 2))
if(.@ref < (.@r+1)) {
mes "To upgrade your enchantment further you need to increase the refine on your equipment as well.";
close;
}
set .@upg_c,rand(1,100);
if(.@upg_c <= getd("."+.@type$+"_p["+(.@r+1)+"]")) {
set .@upg_id,getd("."+getd("."+.@type$+"_v$["+.@t+"]")+"["+(.@r+1)+"]");
// Saving Random Options
if(getequiprandomoption(.@part,0,ROA_ID) != 0) {
setarray .@OptID[0],getequiprandomoption(.@part,0,ROA_ID),getequiprandomoption(.@part,1,ROA_ID),getequiprandomoption(.@part,2,ROA_ID),getequiprandomoption(.@part,3,ROA_ID),getequiprandomoption(.@part,4,ROA_ID);
setarray .@OptVal[0],getequiprandomoption(.@part,0,ROA_VALUE),getequiprandomoption(.@part,1,ROA_VALUE),getequiprandomoption(.@part,2,ROA_VALUE),getequiprandomoption(.@part,3,ROA_VALUE),getequiprandomoption(.@part,4,ROA_VALUE);
setarray .@OptParam[0],getequiprandomoption(.@part,0,ROA_PARAM),getequiprandomoption(.@part,1,ROA_PARAM),getequiprandomoption(.@part,2,ROA_PARAM),getequiprandomoption(.@part,3,ROA_PARAM),getequiprandomoption(.@part,4,ROA_PARAM);
}
delequip .@part;
if(getarraysize(.@OptID) > 0)
switch(.@s) {
case 4: getitem3 .@id,1,1,.@ref,0,.@c1,.@c2,.@c3,.@upg_id,.@OptID,.@OptVal,.@OptParam; break;
case 3: getitem3 .@id,1,1,.@ref,0,.@c1,.@c2,.@upg_id,.@c4,.@OptID,.@OptVal,.@OptParam; break;
}
else
switch(.@s) {
case 4: getitem2 .@id,1,1,.@ref,0,.@c1,.@c2,.@c3,.@upg_id; break;
case 3: getitem2 .@id,1,1,.@ref,0,.@c1,.@c2,.@upg_id,.@c4; break;
}
ME_Price .slot[.@e+10],.slot[.@e+11],2;
mes "The Upgrade was successfully.";
} else
mes "The Upgrade has failed.";
} else if(.@u_fail)
mes "I'm sorry, but there is no upgrade available anymore for this Enchantment.";
else if(!.@u_go)
mes "I'm sorry, but I can't find your Enchantment in my list or it's an Special Enchantment which I can't upgrade.";
break;
// Reset Enchantments
case 3:
mes .n$;
// Price Check
ME_Price .slot[.@e+13],.slot[.@e+14],1;
if(!.@e_cnt) { // No Enchantments
mes "It seems like there are no enchantments on this item to reset.";
close;
}
// Enchant Reset Type
if(.slot[.@e+15] == 1) {
mes "How do you want to reset your enchantments?";
next;
if(select("- All at once:- Select one") == 2) {
mes .n$;
mes "Please choose which Enchant Slot you want to reset:";
next;
set .@s,5 - (select( ((.@c4 && compare(getitemname(.@c4),"Card") != 1)?"Enchant Slot 1":"")+":"+ ( (.@c3 && compare(getitemname(.@c3),"Card") != 1)?"Enchant Slot 2":"")+":"+ ( (.@c2 && compare(getitemname(.@c2),"Card") != 1)?"Enchant Slot 3":"")));
}
mes .n$;
mes "Do you really want to reset the enchantments on this item?";
if(select("- Yes:- No") - 1) close;
setd(".@c"+.@s),0;
next;
mes .n$;
}
// Saving Random Options
if(getequiprandomoption(.@part,0,ROA_ID) != 0) {
setarray .@OptID[0],getequiprandomoption(.@part,0,ROA_ID),getequiprandomoption(.@part,1,ROA_ID),getequiprandomoption(.@part,2,ROA_ID),getequiprandomoption(.@part,3,ROA_ID),getequiprandomoption(.@part,4,ROA_ID);
setarray .@OptVal[0],getequiprandomoption(.@part,0,ROA_VALUE),getequiprandomoption(.@part,1,ROA_VALUE),getequiprandomoption(.@part,2,ROA_VALUE),getequiprandomoption(.@part,3,ROA_VALUE),getequiprandomoption(.@part,4,ROA_VALUE);
setarray .@OptParam[0],getequiprandomoption(.@part,0,ROA_PARAM),getequiprandomoption(.@part,1,ROA_PARAM),getequiprandomoption(.@part,2,ROA_PARAM),getequiprandomoption(.@part,3,ROA_PARAM),getequiprandomoption(.@part,4,ROA_PARAM);
}
delequip .@part;
// Reset Enchantment Slot Selection
if(!.@s) { // All Enchantments at once
if(getarraysize(.@OptID) > 0)
getitem3 .@id,1,1,.@ref,0,.@c1,( (.@c2 && compare(getitemname(.@c2),"Card") == 1)?.@c2:0),( (.@c3 && compare(getitemname(.@c3),"Card") == 1)?.@c3:0),0,.@OptID,.@OptVal,.@OptParam;
else
getitem2 .@id,1,1,.@ref,0,.@c1,( (.@c2 && compare(getitemname(.@c2),"Card") == 1)?.@c2:0),( (.@c3 && compare(getitemname(.@c3),"Card") == 1)?.@c3:0),0;
} else { // Only reset a selected enchantment
if(getarraysize(.@OptID) > 0)
getitem3 .@id,1,1,.@ref,0,.@c1,.@c2,.@c3,.@c4,.@OptID,.@OptVal,.@OptParam;
else
getitem2 .@id,1,1,.@ref,0,.@c1,.@c2,.@c3,.@c4;
}
ME_Price .slot[.@e+13],.slot[.@e+14],2;
mes "You're Enchantments has been reset.";
break;
// Random Option Enchantment
case 4:
mes .n$;
mes "Please select what you want to do:";
mes "Price for Random Option Enchanting:";
switch(.slot[.@e+20]) {
case 0: mes "None"; break;
case 1: mes .slot[.@e+21]+" Zeny"; break;
case 2: mes .slot[.@e+21]+" Cash Points"; break;
default: mes .slot[.@e+21]+"x "+getitemname(.slot[.@e+20]); break;
}
mes "Price for Random Option Reset:";
switch(.slot[.@e+22]) {
case 0: mes "None"; break;
case 1: mes .slot[.@e+23]+" Zeny"; break;
case 2: mes .slot[.@e+23]+" Cash Points"; break;
default: mes .slot[.@e+23]+"x "+getitemname(.slot[.@e+22]); break;
}
next;
if(select("- Enchant Random Options:- Reset Random Options") == 1) {
mes .n$;
// Price Check
ME_Price .slot[.@e+20],.slot[.@e+21],1;
// Define how many Random Options Slots are free and also pre-define the first free slot
for ( set .@o,0; .@o < 5; set .@o,.@o + 1)
if(getequiprandomoption(.@part,.@o,ROA_ID) != 0) {
setarray .@OptID[.@o],getequiprandomoption(.@part,.@o,ROA_ID);
setarray .@OptVal[.@o],getequiprandomoption(.@part,.@o,ROA_VALUE);
set .@ropt_slot,.@ropt_slot + 1;
}
if(.slot[.@e+17] > 0 && .@ropt_slot >= .slot[.@e+17] || !.@ropt_slot && .@ropt_slot == 5) {
mes "I'm sorry, but every Random Option Slot is used.";
close;
}
mes "Please select what kind of Random Option you want to enchant:";
set .@ropt_ct,( (.slot[.@e+17] == 0)?5:( (.slot[.@e+17] >= 5)?5:.slot[.@e+17]));
mes "^FF0000You can apply "+(.@ropt_ct - .@ropt_slot)+" Random Options.^000000";
// Checking if the equipment is a weapon and already has an element
if(getiteminfo(.@id,2) == 5)
set .@ropt_weap,1;
if( (getequiprandomoption(.@part,0,ROA_ID) > RDMOPT_WEAPON_ATTR_NOTHING && getequiprandomoption(.@part,0,ROA_ID) <= RDMOPT_WEAPON_ATTR_UNDEAD) ||
(getequiprandomoption(.@part,1,ROA_ID) > RDMOPT_WEAPON_ATTR_NOTHING && getequiprandomoption(.@part,1,ROA_ID) <= RDMOPT_WEAPON_ATTR_UNDEAD) ||
(getequiprandomoption(.@part,2,ROA_ID) > RDMOPT_WEAPON_ATTR_NOTHING && getequiprandomoption(.@part,2,ROA_ID) <= RDMOPT_WEAPON_ATTR_UNDEAD) ||
(getequiprandomoption(.@part,3,ROA_ID) > RDMOPT_WEAPON_ATTR_NOTHING && getequiprandomoption(.@part,3,ROA_ID) <= RDMOPT_WEAPON_ATTR_UNDEAD) ||
(getequiprandomoption(.@part,4,ROA_ID) > RDMOPT_WEAPON_ATTR_NOTHING && getequiprandomoption(.@part,4,ROA_ID) <= RDMOPT_WEAPON_ATTR_UNDEAD))
set .@ropt_wele,1;
// Checking if the equipment is a armor and already has an element
if(getiteminfo(.@id,2) == 4) {
set .@ropt_arm,1;
if(getiteminfo(.@id,5) != 16) set .@ropt_aele,1; // Define for other armor types (Garment, etc) that it can't have an element
if( (getequiprandomoption(.@part,0,ROA_ID) > RDMOPT_BODY_ATTR_NOTHING && getequiprandomoption(.@part,0,ROA_ID) <= RDMOPT_BODY_ATTR_UNDEAD) ||
(getequiprandomoption(.@part,1,ROA_ID) > RDMOPT_BODY_ATTR_NOTHING && getequiprandomoption(.@part,1,ROA_ID) <= RDMOPT_BODY_ATTR_UNDEAD) ||
(getequiprandomoption(.@part,2,ROA_ID) > RDMOPT_BODY_ATTR_NOTHING && getequiprandomoption(.@part,2,ROA_ID) <= RDMOPT_BODY_ATTR_UNDEAD) ||
(getequiprandomoption(.@part,3,ROA_ID) > RDMOPT_BODY_ATTR_NOTHING && getequiprandomoption(.@part,3,ROA_ID) <= RDMOPT_BODY_ATTR_UNDEAD) ||
(getequiprandomoption(.@part,4,ROA_ID) > RDMOPT_BODY_ATTR_NOTHING && getequiprandomoption(.@part,4,ROA_ID) <= RDMOPT_BODY_ATTR_UNDEAD))
set .@ropt_aele,1;
}
while(.@ropt < .@ropt_ct) {
if(getequiprandomoption(.@part,.@ropt,ROA_ID) != 0) {
set .@ropt,.@ropt + 1;
continue;
}
next;
switch(select( ( (.@ropt_weap && !.@ropt_wele)?"Weapon Element":"")+":"+ ( (.@ropt_arm && !.@ropt_aele)?"Armor Element":"")+":Attribute:"+( (.@ropt_weap)?"Increase Damage":"")+":"+( (.@ropt_arm)?"Defensive":"")+":Special")) {
// Weapon Element
case 1:
mes .n$;
if(getiteminfo(.@id,9) >= 5) { // Checking for ranged Weapons
mes "I'm sorry, but you can't enchant ranged weapons with an Weapon Element.";
continue;
}
if(.slot[.@e+19] == 1) { // Selectable Enchantment
mes "Please select the Weapon Element you want to use:";
next;
for ( set .@l,0; .@l < getarraysize(.RandOpt_Ele_M$); set .@l,.@l + 1)
set .@ropt_m$,.@ropt_m$ + "- "+.RandOpt_Ele_M$[.@l] + ( (.RandOpt_Ele_M$[.@l+1] != "")?":":"");
set .@i,select(.@ropt_m$)-1;
mes .n$;
} else // Random Selection
set .@i,rand(getarraysize(.RandOpt_Ele_M$));
mes "Weapon Element: "+.RandOpt_Ele_M$[.@i];
set .@ropt_id,.RandOpt_WEle[.@i];
set .@ropt_wele,1; // Define that an element was selected already
break;
// Armor Element
case 2:
mes .n$;
if(.slot[.@e+19] == 1) { // Selectable Enchantment
mes "Please select the Armor Element you want to use:";
next;
for ( set .@l,0; .@l < getarraysize(.RandOpt_Ele_M$); set .@l,.@l + 1)
set .@ropt_m$,.@ropt_m$ + "- "+.RandOpt_Ele_M$[.@l] + ( (.RandOpt_Ele_M$[.@l+1] != "")?":":"");
set .@i,select(.@ropt_m$) - 1;
mes .n$;
} else // Random Selection
set .@i,rand(getarraysize(.RandOpt_Ele_M$));
mes "Armor Element: "+.RandOpt_Ele_M$[.@i];
set .@ropt_id,.RandOpt_AEle[.@i];
set .@ropt_aele,1; // Define that an element was selected already
break;
// Attributes
case 3:
mes .n$;
if(.slot[.@e+19] == 1) { // Selectable Enchantment
mes "Please select the Attribute you want to use:";
next;
for ( set .@l,0; .@l < getarraysize(.RandOpt_ATT_M$); set .@l,.@l + 1)
set .@ropt_m$,.@ropt_m$ + "- "+.RandOpt_ATT_M$[.@l] + ( (.RandOpt_ATT_M$[.@l+1] != "")?":":"");
set .@t,select(.@ropt_m$);
mes .n$;
} else // Random Selection
set .@t,rand(1,getarraysize(.RandOpt_ATT_M$));
set .@i,.@t*3-3;
mes "Attribute: "+.RandOpt_ATT_M$[.@t-1];
set .@ropt_id,.RandOpt_ATT[.@i];
set .@ropt_val,rand(.RandOpt_ATT[.@i+1],.RandOpt_ATT[.@i+2]);
break;
// Increase Damage
case 4:
mes .n$;
if(.slot[.@e+18] == 1) { // Selectable Damage Type (Physical/Magical)
mes "Please select the damage type for your Random Option:";
next;
set .@dmg_t$,( (select("- Physical:- Magical") == 1)?"PDMG":"MDMG");
mes .n$;
} else
set .@dmg_t$,(rand(100) <= 50)?"PDMG":"MDMG";
mes "Please select the damage category for your Random Option:";
next;
// Damage Category
switch(select("- Damage vs Element:- Damage vs Race:- Damage vs Size/Class")) {
case 1: set .@cat_t$,"Ele"; break;
case 2: set .@cat_t$,"RC"; break;
case 3: set .@cat_t$,"SC"; break;
}
mes .n$;
if(.slot[.@e+19] == 1) { // Selectable Enchantment
mes "Please select the Enchantment you want to use:";
next;
for ( set .@l,0; .@l < getarraysize(getd(".RandOpt_"+.@dmg_t$+"_"+.@cat_t$+"_M$")); set .@l,.@l + 1)
set .@ropt_m$,.@ropt_m$ + "- "+getd(".RandOpt_"+.@dmg_t$+"_"+.@cat_t$+"_M$["+.@l+"]") + ( (getd(".RandOpt_"+.@dmg_t$+"_"+.@cat_t$+"_M$["+(.@l+1)+"]") != "")?":":"");
set .@t,select(.@ropt_m$);
mes .n$;
} else // Random Selection
set .@t,rand(1,getarraysize(getd(".RandOpt_"+.@dmg_t$+"_"+.@cat_t$+"_M$")));
set .@i,.@t*3-3;
mes "Damage Option: "+getd(".RandOpt_"+.@dmg_t$+"_"+.@cat_t$+"_M$["+(.@t-1)+"]");
set .@ropt_id,getd(".RandOpt_"+.@dmg_t$+"_"+.@cat_t$+"["+.@i+"]");
set .@ropt_val,rand(getd(".RandOpt_"+.@dmg_t$+"_"+.@cat_t$+"["+(.@i+1)+"]"),getd(".RandOpt_"+.@dmg_t$+"_"+.@cat_t$+"["+(.@i+2)+"]"));
break;
// Defensive
case 5:
mes .n$;
if(.slot[.@e+18] == 1) { // Selectable Defensive Type (Physical/Magical)
mes "Please select the defensive type for your Random Option:";
next;
switch(select("- Physical:- Magical:- Race/Size/Class")) {
case 1: set .@def_t$,"RES_P"; break;
case 2: set .@def_t$,"RES_M"; break;
case 3: set .@def_t$,"RES_ETC"; break;
}
mes .n$;
} else {
set .@ropt_r,rand(100);
if(.@ropt_r <= 33) set .@def_t$,"RES_P";
else if(.@ropt_r <= 66) set .@def_t$,"RES_M";
else if(.@ropt_r <= 99) set .@def_t$,"RES_ETC";
}
if(.slot[.@e+19] == 1) { // Selectable Enchantment
mes "Please select the Enchantment you want to use:";
next;
for ( set .@l,0; .@l < getarraysize(getd(".RandOpt_"+.@def_t$+"_M$")); set .@l,.@l + 1)
set .@ropt_m$,.@ropt_m$ + "- "+getd(".RandOpt_"+.@def_t$+"_M$["+.@l+"]") + ( (getd(".RandOpt_"+.@def_t$+"_M$["+(.@l+1)+"]") != "")?":":"");
set .@t,select(.@ropt_m$);
mes .n$;
} else // Random Selection
set .@t,rand(1,getarraysize(getd(".RandOpt_"+.@def_t$+"_M$")));
set .@i,.@t*3-3;
mes "Defensive Option: "+getd(".RandOpt_"+.@def_t$+"_M$["+(.@t-1)+"]");
set .@ropt_id,getd(".RandOpt_"+.@def_t$+"["+.@i+"]");
set .@ropt_val,rand(getd(".RandOpt_"+.@def_t$+"["+(.@i+1)+"]"),getd(".RandOpt_"+.@def_t$+"["+(.@i+2)+"]"));
break;
// Special
case 6:
mes .n$;
if(.slot[.@e+19] == 1) { // Selectable Enchantment
mes "Please select the Enchantment you want to use:";
next;
for ( set .@l,0; .@l < getarraysize(.RandOpt_Spec_M$); set .@l,.@l + 1)
set .@ropt_m$,.@ropt_m$ + ( ((.RandOpt_Spec[(.@l+1)*3-3] == RDMOPT_BODY_INDESTRUCTIBLE && getiteminfo(.@id,2) != 4) || (.RandOpt_Spec[(.@l+1)*3-3] == RDMOPT_WEAPON_INDESTRUCTIBLE && getiteminfo(.@id,2) != 5) || (.RandOpt_Spec[(.@l+1)*3-3] == RDMOPT_DAMAGE_SIZE_PERFECT && getiteminfo(.@id,2) != 5) )?"":"- "+.RandOpt_Spec_M$[.@l]) + ( (.RandOpt_Spec_M$[.@l+1] != "")?":":"");
set .@t,select(.@ropt_m$);
mes .n$;
if(.RandOpt_Spec_Limit && .@ropt_spec_l[.@t-1] == 1) {
mes "I'm sorry, but you already chose this Random Option. Please select a different one.";
continue;
}
} else { // Random Selection
while(1) {
set .@t,rand(1,getarraysize(.RandOpt_Spec_M$));
// Checking if certain Enchantments are suited for the Item Type and if they are in use already or not:
// "Armor - Instructible in Battle" and can only be used on Armors, so no Shoes, Garments, Headgears and Shields
if(.RandOpt_Spec[.@t*3-3] == RDMOPT_BODY_INDESTRUCTIBLE && (getiteminfo(.@id,2) != 4 || getiteminfo(.@id,5) != 16) ) continue;
// Weapon - "Instructible in Battle"
if(.RandOpt_Spec[.@t*3-3] == RDMOPT_WEAPON_INDESTRUCTIBLE && getiteminfo(.@id,2) != 5 ) continue;
if(.RandOpt_Spec[.@t*3-3] == RDMOPT_DAMAGE_SIZE_PERFECT && getiteminfo(.@id,2) != 5) continue;
// Check if they are already used
if(.@ropt_spec_l[.@t-1] == 1) continue;
break;
}
}
// Save current Random Option for it's usage, if the Limitation is enabled
if(.RandOpt_Spec_Limit)
setarray .@ropt_spec_l[.@t-1],1;
set .@i,.@t*3-3;
mes "Defensive Option: "+.RandOpt_Spec_M$[.@t-1];
set .@ropt_id,.RandOpt_Spec[.@i];
set .@ropt_val,rand(.RandOpt_Spec[.@i+1],.RandOpt_Spec[.@i+2]);
break;
}
// Creating values for the respective random option ID
setarray .@OptID[.@ropt],.@ropt_id;
setarray .@OptVal[.@ropt],.@ropt_val;
set .@ropt,.@ropt + 1; // Increase the Random Option Slot
// Resetting Values just in case
set .@ropt_id,0;
set .@ropt_val,0;
set .@i,0;
set .@t,0;
}
next;
ME_Price .slot[.@e+20],.slot[.@e+21],2;
delequip .@part;
getitem3 .@id,1,1,.@ref,0,.@c1,.@c2,.@c3,.@c4,.@OptID,.@OptVal,.@OptParam;
mes .n$;
mes "Your Random Options has been applied.";
break;
// Reset Random Options
} else {
for ( set .@o,0; .@o < 5; set .@o,.@o + 1)
if(getequiprandomoption(.@part,.@o,ROA_ID) != 0)
set .@ropt_ct,.@ropt_ct + 1;
mes .n$;
if(.@ropt_ct) {
// Price Check
ME_Price .slot[.@e+22],.slot[.@e+23],1;
delequip .@part;
ME_Price .slot[.@e+22],.slot[.@e+23],2;
getitem2 .@id,1,1,.@ref,0,.@c1,.@c2,.@c3,.@c4;
mes "You're Random Options has been reset.";
} else
mes "I'm sorry, but there is nothing to reset.";
}
break;
}
enable_items;
break;
case 2:
mes .n$;
mes "Please select about what you want to know more:";
next;
switch(select("- Equipment:- Enchantment List:- Random Options List:- Nevermind")) {
case 1: // Equipment
mes .n$;
mes "Each Equipment Slot has different settings.";
mes "Please select an Equipment Slot for further options:";
next;
set .@c,select(.eq_menu$);
set .@e,.@c*24-24;
mes .n$;
mes "Do you want to see the equipment settings or if there are limitations?";
next;
switch(select("- Equipment Settings:- Equipment Limitations:- Nevermind")) {
case 1:
mes "["+.EQ_Name$[.@c-1]+"]";
mes "Enchantable: "+( (.slot[.@e+1] == 0)?"Disabled":"Enabled");
mes "Attribute Enchants: "+( (.slot[.@e+2] == 0)?"Disabled":"Enabled");
mes "Attribute Enchant Option: "+( (.slot[.@e+3] == 0)?"Random":"Selectable");
mes "Attribute Enchant Upgrade: "+( (.slot[.@e+4] == 0)?"Disabled":( (.slot[.@e+4] == 1)?"Enabled":"Refine Based Upgrade"));
mes "Status Enchants: "+( (.slot[.@e+5] == 0)?"Disabled":"Enabled");
mes "Status Enchant Option: "+( (.slot[.@e+6] == 0)?"Random":"Selectable");
mes "Status Enchant Upgrade: "+( (.slot[.@e+7] == 0)?"Disabled":"Enabled");
mes "Special Enchants: "+( (.slot[.@e+8] == 0)?"Disabled":"Enabled");
mes "Special Enchant Option: "+( (.slot[.@e+9] == 0)?"Random":"Selectable");
mes "Price for Enchanting: "+ ( (.slot[.@e+10] == 0)?"None":( (.slot[.@e+10] == 1)?.slot[.@e+11]+"x Zeny":( (.slot[.@e+10] == 2)?.slot[.@e+11]+"x Cash Points":"Item:")));
if(.slot[.@e+10] >= 501 && getitemname(.slot[.@e+10]) != "null") // To prevent an warning in getitemname with invalid ID
mes " > "+.slot[.@e+11]+"x "+getitemname(.slot[.@e+10]);
mes "Enchant Reset: "+( (.slot[.@e+12] == 0)?"Disabled":"Enabled");
mes "Price for Resetting: "+ ( (.slot[.@e+13] == 0)?"None":( (.slot[.@e+13] == 1)?.slot[.@e+14]+"x Zeny":( (.slot[.@e+13] == 2)?.slot[.@e+14]+"x Cash Points":"Item:")));
if(.slot[.@e+13] >= 501 && getitemname(.slot[.@e+13]) != "null") // To prevent an warning in getitemname with invalid ID
mes " > "+.slot[.@e+14]+"x "+getitemname(.slot[.@e+13]);
mes "Enchant Reset Type: "+( (.slot[.@e+15] == 0)?"All at once":"Selectable");
mes "Random Option Enchantment: "+( (.slot[.@e+16] == 0)?"Disabled":"Enabled");
mes "Random Option Slots: "+( (.slot[.@e+17] == 0)?"Use every Slot":.slot[.@e+17]+"x Slots available");
mes "Random Option Type Options: "+( (.slot[.@e+18] == 0)?"Random":"Selectable");
mes "Random Option Type Enchantments: "+( (.slot[.@e+19] == 0)?"Random":"Selectable");
mes "Random Option Enchant Price: "+ ( (.slot[.@e+20] == 0)?"None":( (.slot[.@e+20] == 1)?.slot[.@e+21]+"x Zeny":( (.slot[.@e+20] == 2)?.slot[.@e+21]+"x Cash Points":"Item:")));
if(.slot[.@e+20] >= 501 && getitemname(.slot[.@e+20]) != "null") // To prevent an warning in getitemname with invalid ID
mes " > "+.slot[.@e+21]+"x "+getitemname(.slot[.@e+20]);
mes "Random Option Reset Price: "+ ( (.slot[.@e+22] == 0)?"None":( (.slot[.@e+22] == 1)?.slot[.@e+23]+"x Zeny":( (.slot[.@e+22] == 2)?.slot[.@e+23]+"x Cash Points":"Item:")));
if(.slot[.@e+22] >= 501 && getitemname(.slot[.@e+22]) != "null") // To prevent an warning in getitemname with invalid ID
mes " > "+.slot[.@e+23]+"x "+getitemname(.slot[.@e+22]);
break;
case 2: // Equipment Limitation
mes "["+.EQ_Name$[.@c-1]+"]";
if(getarraysize(getd("."+.limit_v$[.@c-1])) > 0) {
for ( set .@a,0; .@a < getarraysize(getd("."+.limit_v$[.@c-1])); set .@a,.@a + 2) {
mes "^0000FF"+getitemname(getd("."+.limit_v$[.@c-1]+"["+.@a+"]"))+"["+getitemslots(getd("."+.limit_v$[.@c-1]+"["+.@a+"]"))+"]:^000000";
mes "^FF0000"+( (getd("."+.limit_v$[.@c-1]+"["+(.@a+1)+"]") == 0)?"Not-Enchantable":getd("."+.limit_v$[.@c-1]+"["+(.@a+1)+"]")+" Slots")+"^000000";
}
} else
mes "None";
break;
case 3: // Nevermind
break;
}
break;
case 2: // Enchantment List
mes .n$;
mes "Each Enchantment type has their own chances of success for Upgrade and Random Enchantment.";
mes " ";
mes "[Enchantment List]";
mes " > Attribute Enchants:";
for ( set .@l,0; .@l < getarraysize(.attr_n$); set .@l,.@l + 1)
if(.attr_e[.@l]) mes " - "+.attr_n$[.@l];
mes " ";
mes " > Status Enchants:";
for ( set .@l,0; .@l < getarraysize(.stats_n$); set .@l,.@l + 1)
if(.stats_e[.@l]) mes " - "+.stats_n$[.@l];
mes " ";
mes " > Special Enchants:";
mes "^FF0000Note: Can't be Upgraded!^000000";
for ( set .@l,0; .@l < getarraysize(.special_n$); set .@l,.@l + 1)
if(.special_e[.@l]) mes " - "+.special_n$[.@l];
break;
// Random Options List
case 3:
mes .n$;
mes "Please select the Random Options you want the list of:";
next;
switch(select("- Damage:- Defensive:- Attributes + Special")) {
case 1:
mes "[- Weapon Elements]:";
for ( set .@l,0; .@l < getarraysize(.RandOpt_Ele_M$); set .@l,.@l + 1)
mes "> "+.RandOpt_Ele_M$[.@l];
mes " ";
mes "[- Physical/Magical Damage vs Element]:";
for ( set .@l,0; .@l < getarraysize(.RandOpt_PDMG_Ele_M$); set .@l,.@l + 1)
mes "> "+.RandOpt_PDMG_Ele_M$[.@l];
next;
mes "[- Physical Race]:";
for ( set .@l,0; .@l < getarraysize(.RandOpt_PDMG_RC_M$); set .@l,.@l + 1)
mes "> "+.RandOpt_PDMG_RC_M$[.@l];
mes " ";
mes "[- Magical Race]:";
for ( set .@l,0; .@l < getarraysize(.RandOpt_MDMG_RC_M$); set .@l,.@l + 1)
mes "> "+.RandOpt_MDMG_RC_M$[.@l];
next;
mes "[- Physical Size/Class]:";
for ( set .@l,0; .@l < getarraysize(.RandOpt_PDMG_SC_M$); set .@l,.@l + 1)
mes "> "+.RandOpt_PDMG_SC_M$[.@l];
mes " ";
mes "[- Magical Size/Class]:";
for ( set .@l,0; .@l < getarraysize(.RandOpt_MDMG_SC_M$); set .@l,.@l + 1)
mes "> "+.RandOpt_MDMG_SC_M$[.@l];
break;
case 2:
mes "[Physical Defensive]:";
for ( set .@l,0; .@l < getarraysize(.RandOpt_RES_P_M$); set .@l,.@l + 1)
mes "- "+.RandOpt_RES_P_M$[.@l];
mes " ";
mes "[Magical Defensive]:";
for ( set .@l,0; .@l < getarraysize(.RandOpt_RES_M_M$); set .@l,.@l + 1)
mes "- "+.RandOpt_RES_M_M$[.@l];
mes " ";
mes "[Race/Size/Class Defensive]:";
for ( set .@l,0; .@l < getarraysize(.RandOpt_RES_ETC_M$); set .@l,.@l + 1)
mes "- "+.RandOpt_RES_ETC_M$[.@l];
break;
case 3:
mes "[Attributes]:";
for ( set .@l,0; .@l < getarraysize(.RandOpt_ATT_M$); set .@l,.@l + 1)
mes "- "+.RandOpt_ATT_M$[.@l];
mes " ";
mes "[Special]:";
for ( set .@l,0; .@l < getarraysize(.RandOpt_Spec_M$); set .@l,.@l + 1)
mes "- "+.RandOpt_Spec_M$[.@l];
break;
}
case 4: // Nevermind
break;
}
break;
case 3: // Restricted Equipment via Shop
mes .n$;
mes "Please choose the Equipment Type you want to see the restricted equipments:";
next;
set .@o,select(.shop_m$) - 1;
mes .n$;
mes "I will now open the respective Shop.";
mes "^FF0000Note: You won't be able to buy anything from there. It's just for display.^000000";
close2;
callshop ""+.shop_name$[.@o],1;
end;
case 4: // Nevermind
break;
}
end;
function ME_Price {
// getarg(0) > Identifier
// getarg(1) > Amount
// getarg(2) > 1 = Check, 2 = Pay
if(getarg(2) == 1) {
switch(getarg(0)) {
case 0: break;
case 1:
if(Zeny < getarg(1)) {
mes "You don't have enough Zeny for the Random Option Enchantment! You need "+getarg(1)+" Zeny.";
close;
}
break;
case 2:
if(#CASHPOINTS < getarg(1)) {
mes "You don't have enough Cash Points for the Random Option Enchantment! You need "+getarg(1)+" Cash Points.";
close;
}
break;
default:
if(countitem(getarg(0)) < getarg(1)) {
mes "You don't have enough "+getitemname(getarg(0))+" for the Random Option Enchantment! You need "+getarg(1)+" "+getitemname(getarg(0))+".";
close;
}
break;
}
} else if(getarg(2) == 2) {
switch(getarg(0)) {
case 0: break;
case 1: set Zeny,Zeny - getarg(1); break;
case 2: set #CASHPOINTS,#CASHPOINTS - getarg(1); break;
default: delitem getarg(0),getarg(1); break;
}
}
return;
}
OnInit:
set .n$,"["+strnpcinfo(0)+"]";
// ======= Settings =======
// ==== Equip Slots ====
// [0] = Equipment Slot
// [1] = Enchantable? 0 = Disabled, 1 = Enabled
// [2] = Attribute Enchants? 0 = Disabled, 1 = Enabled
// [3] = Attribute Enchant Option: 0 = Random, 1 = Selectable
// [4] = Attribute Enchant Upgrade: 0 = Disabled, 1 = Enabled, 2 = Refine Based Upgrade
// [5] = Status Enchants? 0 = Disabled, 1 = Enabled
// [6] = Status Enchant Option: 0 = Random, 1 = Selectable
// [7] = Status Enchant Upgrade: 0 = Disabled, 1 = Enabled, 2 = Refine Based Upgrade
// [8] = Special Enchants? 0 = Disabled, 1 = Enabled
// [9] = Special Enchant Option: 0 = Random, 1 = Selectable
// [10] = Price for Enchanting: 0 = None, 1 = Zeny, 2 = Cash Points, 501+ = Item ID
// [11] = Amount of Price
// [12] = Enchants Reset: 0 = Disabled, 1 = Enabled
// [13] = Price for Resetting: 0 = None, 1 = Zeny, 2 = Cash Points, 501+ = Item ID
// [14] = Amount of Price
// [15] = Enchant Reset Type: 0 = All at once, 1 = Selectable
// [16] = Random Option Enchantment? 0 = Disable, 1 = Enable
// [17] = Random Option Slots: 0 = Use every slot, 1+ = Limited Slot Usage
// [18] = Random Option Type Options: 0 = Random, 1 = Selectable (Physical and Magical)
// [19] = Random Option Type Enchantments: 0 = Random, 1 = Selectable (Damage against x target as example)
// [20] = Random Option Enchant Price: 0 = None, 1 = Zeny, 2 = Cash Points, 501+ = Item ID
// [21] = Amount of Price
// [22] = Random Option Reset Price: 0 = None, 1 = Zeny, 2 = Cash Points, 501+ = Item ID
// [23] = Amount of Price
setarray .slot[0],
// Index: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
EQI_HEAD_TOP, 1, 1,0,2, 1,0,2, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Top Headgear
EQI_HEAD_MID, 1, 1,0,2, 1,0,2, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Middle Headgear
EQI_HEAD_LOW, 1, 1,0,2, 1,0,2, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Lower Headgear
EQI_ARMOR, 1, 1,0,2, 1,0,2, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Armor
EQI_HAND_R, 1, 1,0,2, 1,0,2, 1,0, 1, 50000, 1, 0, 0, 1, 1, 0, 1, 0, 1, 10000, 1, 50000, // Weapon
EQI_HAND_L, 1, 1,0,2, 1,0,2, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Shield
EQI_GARMENT, 1, 1,0,2, 1,0,2, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Garment
EQI_SHOES, 1, 1,0,2, 1,0,2, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Shoes
EQI_ACC_R, 1, 1,0,2, 1,0,2, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Accessory Right
EQI_ACC_L, 1, 1,0,2, 1,0,2, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Accessory Left
EQI_COSTUME_HEAD_TOP, 1, 1,0,1, 1,0,1, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Costume Top Headgear
EQI_COSTUME_HEAD_MID, 1, 1,0,1, 1,0,1, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Costume Middle Headgear
EQI_COSTUME_HEAD_LOW, 1, 1,0,1, 1,0,1, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Costume Lower Headgear
EQI_COSTUME_GARMENT, 1, 1,0,1, 1,0,1, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Costume Garment
EQI_SHADOW_ARMOR, 1, 1,0,1, 1,0,1, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Shadow Armor
EQI_SHADOW_WEAPON, 1, 1,0,1, 1,0,1, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Shadow Weapon
EQI_SHADOW_SHIELD, 1, 1,0,1, 1,0,1, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Shadow Shield
EQI_SHADOW_SHOES, 1, 1,0,1, 1,0,1, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Shadow Shoes
EQI_SHADOW_ACC_R, 1, 1,0,1, 1,0,1, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000, // Shadow Accessory Right
EQI_SHADOW_ACC_L, 1, 1,0,1, 1,0,1, 1,0, 1, 50000, 1, 0, 0, 0, 1, 0, 1, 0, 1, 10000, 1, 50000; // Shadow Accessory Left
// If you put [2], [5], [8] and [16] on '0', it gets disabled automatically:
for ( set .@e,0; .@e < getarraysize(.slot); set .@e,.@e + 24)
if(!.slot[.@e+2] && !.slot[.@e+5] && !.slot[.@e+8] && !.slot[.@e+16])
setarray .slot[.@e+1],0;
// ==== Enchant Randomizer ====
// * Defines how the Enchantments will be randomized
// 0 = Simple Randomizer = "set .@a,rand();"
// 1 = Advanced Randomizer = "set .@enc_c,rand(<Value>); > if(.@enc_c < <Value>)"
// Note: For the Advanced Randomizer you can change the values as you like to increase the difficulty.
// Just head up to the respective Enchantment.
set .enchant_rand,0;
// ==== Equipment Restriction ====
// * Define here the Item ID's which can be enchanted
// 0 = You can enchant anything you want
// 1 = Only selected items are enchantable
set .enchant_restrict,0;
if(.enchant_restrict) {
setarray .headgear_rct[0],2201;
setarray .armor_rct[0],2308;
setarray .weapon_rct[0],1516;
setarray .shield_rct[0],2103;
setarray .garment_rct[0],2505;
setarray .shoes_rct[0],2404;
setarray .acc_rct[0],2615;
setarray .costume_headgear_rct[0],18742;
setarray .shadow_armor_rct[0],24000;
setarray .shadow_weapon_rct[0],24001;
setarray .shadow_shield_rct[0],24002;
setarray .costume_garment_rct[0],20500;
setarray .shadow_shoes_rct[0],24003;
setarray .shadow_acc_rct[0],24005;
// Deleting default item from the Shops
npcshopdelitem "EShop_Headgear",512;
npcshopdelitem "EShop_Armor",512;
npcshopdelitem "EShop_Weapon",512;
npcshopdelitem "EShop_Shield",512;
npcshopdelitem "EShop_Garment",512;
npcshopdelitem "EShop_Shoes",512;
npcshopdelitem "EShop_Acc",512;
npcshopdelitem "EShop_Costume_Headgear",512;
npcshopdelitem "EShop_Shadow_Armor",512;
npcshopdelitem "EShop_Shadow_Weapon",512;
npcshopdelitem "EShop_Shadow_Shield",512;
npcshopdelitem "EShop_Costume_Garment",512;
npcshopdelitem "EShop_Shadow_Shoes",512;
npcshopdelitem "EShop_Shadow_Acc",512;
// Auto Adding to the Shop:
// - Headgears
if(getarraysize(.headgear_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.headgear_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Headgear",.headgear_rct[.@r],1;
// - Armor
if(getarraysize(.armor_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.armor_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Armor",.armor_rct[.@r],1;
// - Weapon
if(getarraysize(.weapon_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.weapon_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Weapon",.weapon_rct[.@r],1;
// - Shield
if(getarraysize(.shield_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.shield_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Shield",.shield_rct[.@r],1;
// - Garment
if(getarraysize(.garment_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.garment_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Garment",.garment_rct[.@r],1;
// - Shoes
if(getarraysize(.shoes_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.shoes_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Shoes",.shoes_rct[.@r],1;
// - Accessory
if(getarraysize(.acc_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.acc_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Acc",.acc_rct[.@r],1;
// - Costume Headgear
if(getarraysize(.costume_headgear_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.costume_headgear_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Costume_Headgear",.costume_headgear_rct[.@r],1;
// - Shadow Armor
if(getarraysize(.shadow_armor_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.shadow_armor_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Shadow_Armor",.shadow_armor_rct[.@r],1;
// - Shadow Weapon
if(getarraysize(.shadow_weapon_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.shadow_weapon_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Shadow_Weapon",.shadow_weapon_rct[.@r],1;
// - Shadow Shield
if(getarraysize(.shadow_shield_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.shadow_shield_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Shadow_Shield",.shadow_shield_rct[.@r],1;
// - Shadow Garment
if(getarraysize(.costume_garment_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.costume_garment_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Costume_Garment",.costume_garment_rct[.@r],1;
// - Shadow Shoes
if(getarraysize(.shadow_shoes_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.shadow_shoes_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Shadow_Shoes",.shadow_shoes_rct[.@r],1;
// - Shadow Accessory
if(getarraysize(.shadow_acc_rct) > 0)
for ( set .@r,0; .@r < getarraysize(.shadow_acc_rct); set .@r,.@r + 1)
npcshopadditem "EShop_Shadow_Acc",.shadow_acc_rct[.@r],1;
}
// ==== Equipment Limitation ====
// * Define here the Item ID's which have limited slots or are not enchantable
// [0] = Item ID
// [1] = Value: 0 = Not Enchantable/Upgradeable/Resetable, 1-2 = Limited Slots
// Note: If you want to use all 3 slots, don't insert the item id here!
// Also be aware that the item ID here will be using every slot which has been set!
// It will not check the real slots available.
// Like the item has 1 enchant slot as value, but none available(4 Cards as example).
// It will overwrite the last card slot in that case!
setarray .headgear_enc[0],0,0;
setarray .armor_enc[0],0,0;
setarray .weapon_enc[0],0,0;
setarray .shield_enc[0],0,0;
setarray .garment_enc[0],20717,0,20718,0;
setarray .shoes_enc[0],22000,0,22001,0,22002,0,22003,0,22004,0,22005,0,22006,0,22007,0,22008,0,22009,0,22010,0,22011,0;
setarray .acc_enc[0],0,0;
setarray .costume_headgear_enc[0],0,0;
setarray .shadow_armor_enc[0],0,0;
setarray .shadow_weapon_enc[0],0,0;
setarray .shadow_shield_enc[0],0,0;
setarray .costume_garment_enc[0],0,0;
setarray .shadow_shoes_enc[0],0,0;
setarray .shadow_acc_enc[0],0,0;
// ===== Enchantment Data =====
// * Attribute Enchants (STR/AGI/VIT/INT/DEX/LUK - 1~10)
// > STR: 4700,4701,4702,4703,4704,4705,4706,4707,4708,4709
// > AGI: 4730,4731,4732,4733,4734,4735,4736,4737,4738,4739
// > VIT: 4740,4741,4742,4743,4744,4745,4746,4747,4748,4749
// > INT: 4710,4711,4712,4713,4714,4715,4716,4717,4718,4719
// > DEX: 4720,4721,4722,4723,4724,4725,4726,4727,4728,4729
// > LUK: 4750,4751,4752,4753,4754,4755,4756,4757,4758,4759
setarray .attr1[0],4700,4701,4702,4703,4704,4705,4706,4707,4708,4709;
setarray .attr2[0],4730,4731,4732,4733,4734,4735,4736,4737,4738,4739;
setarray .attr3[0],4740,4741,4742,4743,4744,4745,4746,4747,4748,4749;
setarray .attr4[0],4710,4711,4712,4713,4714,4715,4716,4717,4718,4719;
setarray .attr5[0],4720,4721,4722,4723,4724,4725,4726,4727,4728,4729;
setarray .attr6[0],4750,4751,4752,4753,4754,4755,4756,4757,4758,4759;
// Chances in % (No double entries!) - affects Upgrade only:
setarray .attr_p[0],100,90,80,70,65,50,35,25,10,5;
// * Status Enchants - ATK/MATK/FLEE/CRIT/DEF/MDEF/HP/SP/ASPD
// > ATK: 4882,4766,4767,4894,4895,4904,4905
// > MATK: 4883,4896,4897,4898,4899,4906,4907,4760,4761,4806
// > FLEE: 4859,4860,4762,4763,4942,4943,4944
// > CRIT: 4926,4939,4940,4941,4764,4765,
// > DEF: 4791,4792,4793,4794,4893,4902,4903
// > MDEF: 4890,4786,4891,4787,4892,4788,4789,4790
// > HP: 4927,4795,4796,4797,4798,4799,4861,4862,4867,4868,4900
// > SP: 4870,4800,4871,4801,4802,4929
// > ASPD: 4807,4842
// > Regeneration: 4930,4931,4932
// > SP Consume: 4945,4946,4947
setarray .stats_atk[0],4882,4766,4767,4894,4895,4904,4905;
setarray .stats_matk[0],4883,4896,4897,4898,4899,4906,4907,4760,4761,4806;
setarray .stats_flee[0],4859,4860,4762,4763,4942,4943,4944;
setarray .stats_crit[0],4926,4939,4940,4941,4764,4765;
setarray .stats_def[0],4791,4792,4793,4794,4893,4902,4903;
setarray .stats_mdef[0],4890,4786,4891,4787,4892,4788,4789,4790;
setarray .stats_hp[0],4927,4795,4796,4797,4798,4799,4861,4862,4867,4868,4900;
setarray .stats_sp[0],4870,4800,4871,4801,4802,4929;
setarray .stats_aspd[0],4807,4842;
setarray .stats_reg[0],4930,4931,4932;
setarray .stats_spc[0],4945,4946,4947;
// Chances in % (No double entries!) - affects Upgrade only:
setarray .stats_p[0],100,90,80,70,60,55,45,35,30,10,5;
// * Special Enchants
// > Heal Amount: 4850,4851,4852
// > Fighting Spirit: 4811,4810,4809,4808,4820,4821,4822,4823,4824,4825
// > Spell: 4815,4814,4813,4812,4826,4827,4828,4829,4830,4831
// > Sharp: 4818,4817,4816,4843,4844
// > Expert Archer: 4832,4833,4834,4835,4836,4837,4838,4839,4840,4841
// > Neutral Resistance/Immune: 4933,4934,4935,4848
// > Cranial: 4849
// > Special <STAT>: 4853,4854,4855,4856,4857,4858
// > Fatal: 4863,4864,4865,4866
// > Attack Delay: 4869,4872,4873,4881
// > After Skill Delay: 4948,4949,4950
// > Conjure (Spell): 4885,4886,4887,4888,4889
// > Highness Heal, Coluceo Heal, Archbishop, Bear's Power, Runaway Magic, Speed of Light, Muscle Fool, Hawkeye, Lucky Day
// > 4803,4804,4805,4875,4876,4877,4878,4879,4880
// > ATK Size: 4938,4937,4936
setarray .spec_heal[0],4850,4851,4852;
setarray .spec_spirit[0],4811,4810,4809,4808,4820,4821,4822,4823,4824,4825;
setarray .spec_spell[0],4815,4814,4813,4812,4826,4827,4828,4829,4830,4831;
setarray .spec_sharp[0],4818,4817,4816,4843,4844;
setarray .spec_expert[0],4832,4833,4834,4835,4836,4837,4838,4839,4840,4841;
setarray .spec_resist[0],4933,4934,4935,4848;
setarray .spec_cran[0],4849;
setarray .spec_spec[0],4853,4854,4855,4856,4857,4858;
setarray .spec_fatal[0],4863,4864,4865,4866;
setarray .spec_atkd[0],4869,4872,4873,4881;
setarray .spec_skilld[0],4948,4949,4950;
setarray .spec_conju[0],4885,4886,4887,4888,4889;
setarray .spec_glasth[0],4803,4804,4805,4875,4876,4877,4878,4879,4880;
setarray .spec_atksize[0],4938,4937,4936;
// ========= These are for the dynamic flow and config ===============
// Note: If you want to add/remove your enchants, change the _n$ and _v$ entries respectively
// Note2: You can enable/disable Enchantments in the _e arrays respectively!
// * === Equipment === *
setarray .EQ_Name$[0],"Top Headgear","Middle Headgear","Lower Headgear","Armor","Weapon","Shield","Garment","Shoes","Acc L.","Acc R.","Costume Top","Costume Middle","Costume Lower","Costume Garment","Shadow Armor","Shadow Weapon","Shadow Shield","Shadow Shoes","Shadow Acc L.","Shadow Acc R.";
setarray .restrict_v$[0],"headgear_rct","headgear_rct","headgear_rct","armor_rct","weapon_rct","shield_rct","garment_rct","shoes_rct","acc_rct","acc_rct","costume_headgear_rct","costume_headgear_rct","costume_headgear_rct","costume_garment_rct","shadow_armor_rct","shadow_weapon_rct","shadow_shield_rct","shadow_shoes_rct","shadow_acc_rct","shadow_acc_rct";
setarray .limit_v$[0],"headgear_enc","headgear_enc","headgear_enc","armor_enc","weapon_enc","shield_enc","garment_enc","shoes_enc","acc_enc","acc_enc","costume_headgear_enc","costume_headgear_enc","costume_headgear_enc","costume_garment_enc","shadow_armor_enc","shadow_weapon_enc","shadow_shield_enc","shadow_shoes_enc","shadow_acc_enc","shadow_acc_enc";
// * === Shop === *
setarray .shop_name$[0],"EShop_Headgear","EShop_Armor","EShop_Weapon","EShop_Shield","EShop_Garment","EShop_Shoes","EShop_Acc","EShop_Costume_Headgear","EShop_Costume_Garment","EShop_Shadow_Armor","EShop_Shadow_Weapon","EShop_Shadow_Shield","EShop_Shadow_Shoes","EShop_Shadow_Acc";
setarray .shop_t$[0],"Headgear","Armor","Weapon","Shield","Garment","Shoes","Accessory","Costume Headgear","Costume Garment","Shadow Armor","Shadow Weapon","Shadow Shield","Shadow Shoes","Shadow Accessory";
// * === Attribute Enchants === *
setarray .attr_n$[0],"STR","AGI","VIT","INT","DEX","LUK";
setarray .attr_v$[0],"attr1","attr2","attr3","attr4","attr5","attr6";
// Enable(1) or Disable(0) Enchantments
setarray .attr_e[0],1,1,1,1,1,1;
// * === Status Enchants === *
setarray .stats_n$[0],"ATK","MATK","FLEE","CRIT","DEF","MDEF","HP","SP","ASPD","Regeneration","SP Consume";
setarray .stats_v$[0],"stats_atk","stats_matk","stats_flee","stats_crit","stats_def","stats_mdef","stats_hp","stats_sp","stats_aspd","stats_reg","stats_spc";
// Enable(1) or Disable(0) Enchantments
setarray .stats_e[0],1,1,1,1,1,1,1,1,1,1,1;
// * === Special Enchants === *
setarray .special_n$[0],"Heal Amount","Fighting Spirit","Spell","Sharp","Expert Archer","Neutral Resistance","Cranial","Special <STAT>","Fatal","Attack Delay","After Skill Delay","Conjure","Glastheim Enchants","ATK Size";
setarray .special_v$[0],"spec_heal","spec_spirit","spec_spell","spec_sharp","spec_expert","spec_resist","spec_cran","spec_spec","spec_fatal","spec_atkd","spec_skilld","spec_conju","spec_glasth","spec_atksize";
// Enable(1) or Disable(0) Enchantments
setarray .special_e[0],1,1,1,1,1,1,1,1,1,1,1,1,0,1;
// * === Menu Creation === *
// - Equipment Menu
for ( set .@l,0; .@l < getarraysize(.EQ_Name$); set .@l,.@l + 1)
set .eq_menu$,.eq_menu$+"- "+.EQ_Name$[.@l] + ( (.EQ_Name$[.@l+1] != "")?":":"");
// - Shop Menu
for ( set .@a,0; .@a < getarraysize(.shop_t$); set .@a,.@a + 1)
set .shop_m$,.shop_m$ + "- "+.shop_t$[.@a] + ( (.shop_t$[.@a+1] != "")?":":"");
// - Attribute Enchants
for ( set .@a,0; .@a < getarraysize(.attr_n$); set .@a,.@a + 1)
set .attr_m$,.attr_m$ + ( (.attr_e[.@a] == 1)?"- "+.attr_n$[.@a]:"") + ( (.attr_n$[.@a+1] != "")?":":"");
// - Status Enchants
for ( set .@a,0; .@a < getarraysize(.stats_n$); set .@a,.@a + 1)
set .stats_m$,.stats_m$ + ( (.stats_e[.@a] == 1)?"- "+.stats_n$[.@a]:"") + ( (.stats_n$[.@a+1] != "")?":":"");
// - Special Enchants
for ( set .@a,0; .@a < getarraysize(.special_n$); set .@a,.@a + 1)
set .special_m$,.special_m$ + ( (.special_e[.@a] == 1)?"- "+.special_n$[.@a]:"") + ( (.special_n$[.@a+1] != "")?":":"");
// ========= Random Option Database =========
// Format: RandomOption_ID,MinValue,MaxValue,
// Note: You are free to add/remove Random Options, but be sure the remove the respective values in each array, otherwise you'll break it
// - Physical Damage vs Element
setarray .RandOpt_PDMG_Ele[0],
RDMOPT_DAMAGE_PROPERTY_NOTHING_TARGET,1,50, // Physical Damage to Neutral Element
RDMOPT_DAMAGE_PROPERTY_GROUND_TARGET,1,50, // Physical Damage to Earth Element
RDMOPT_DAMAGE_PROPERTY_FIRE_TARGET,1,50, // Physical Damage to Fire Element
RDMOPT_DAMAGE_PROPERTY_WATER_TARGET,1,50, // Physical Damage to Water Element
RDMOPT_DAMAGE_PROPERTY_WIND_TARGET,1,50, // Physical Damage to Wind Element
RDMOPT_DAMAGE_PROPERTY_POISON_TARGET,1,50, // Physical Damage to Poison Element
RDMOPT_DAMAGE_PROPERTY_SAINT_TARGET,1,50, // Physical Damage to Holy Element
RDMOPT_DAMAGE_PROPERTY_DARKNESS_TARGET,1,50, // Physical Damage to Shadow Element
RDMOPT_DAMAGE_PROPERTY_TELEKINESIS_TARGET,1,50, // Physical Damage to Ghost Element
RDMOPT_DAMAGE_PROPERTY_UNDEAD_TARGET,1,50; // Physical Damage to Undead Element
setarray .RandOpt_PDMG_Ele_M$[0],"Damage vs Neutral element","Damage vs Earth element","Damage vs Fire element","Damage vs Water element","Damage vs Wind element","Damage vs Poison element","Damage vs Holy element","Damage vs Shadow element","Damage vs Ghost element","Damage vs Undead element";
// - Physical Damage vs Race
setarray .RandOpt_PDMG_RC[0],
RDMOPT_RACE_DAMAGE_NOTHING,1,50, // Physical Damage to Formless Race
RDMOPT_RACE_DAMAGE_UNDEAD,1,50, // Physical Damage to Undead Race
RDMOPT_RACE_DAMAGE_ANIMAL,1,50, // Physical Damage to Animal Race
RDMOPT_RACE_DAMAGE_PLANT,1,50, // Physical Damage to Plant Race
RDMOPT_RACE_DAMAGE_INSECT,1,50, // Physical Damage to Insect Race
RDMOPT_RACE_DAMAGE_FISHS,1,50, // Physical Damage to Fish Race
RDMOPT_RACE_DAMAGE_DEVIL,1,50, // Physical Damage to Demon Race
RDMOPT_RACE_DAMAGE_HUMAN,1,50, // Physical Damage to Human Race
RDMOPT_RACE_DAMAGE_ANGEL,1,50, // Physical Damage to Angel Race
RDMOPT_RACE_DAMAGE_DRAGON,1,50, // Physical Damage to Dragon Race
RDMOPT_RACE_IGNORE_DEF_PERCENT_NOTHING,1,10, // Bypass DEF of Formless Race
RDMOPT_RACE_IGNORE_DEF_PERCENT_UNDEAD,1,10, // Bypass DEF of Undead Race
RDMOPT_RACE_IGNORE_DEF_PERCENT_ANIMAL,1,10, // Bypass DEF of Animal Race
RDMOPT_RACE_IGNORE_DEF_PERCENT_PLANT,1,10, // Bypass DEF of Plant Race
RDMOPT_RACE_IGNORE_DEF_PERCENT_INSECT,1,10, // Bypass DEF of Insect Race
RDMOPT_RACE_IGNORE_DEF_PERCENT_FISHS,1,10, // Bypass DEF of Fish Race
RDMOPT_RACE_IGNORE_DEF_PERCENT_DEVIL,1,10, // Bypass DEF of Demon Race
RDMOPT_RACE_IGNORE_DEF_PERCENT_HUMAN,1,10, // Bypass DEF of Human Race
RDMOPT_RACE_IGNORE_DEF_PERCENT_ANGEL,1,10, // Bypass DEF of Angel Race
RDMOPT_RACE_IGNORE_DEF_PERCENT_DRAGON,1,10, // Bypass DEF of Dragon Race
RDMOPT_RACE_CRI_PERCENT_NOTHING,1,10, // Crit Chance against Formless Race
RDMOPT_RACE_CRI_PERCENT_UNDEAD,1,10, // Crit Chance against Undead Race
RDMOPT_RACE_CRI_PERCENT_ANIMAL,1,10, // Crit Chance against Animal Race
RDMOPT_RACE_CRI_PERCENT_PLANT,1,10, // Crit Chance against Plant Race
RDMOPT_RACE_CRI_PERCENT_INSECT,1,10, // Crit Chance against Insect Race
RDMOPT_RACE_CRI_PERCENT_FISHS,1,10, // Crit Chance against Fish Race
RDMOPT_RACE_CRI_PERCENT_DEVIL,1,10, // Crit Chance against Demon Race
RDMOPT_RACE_CRI_PERCENT_HUMAN,1,10, // Crit Chance against Human Race
RDMOPT_RACE_CRI_PERCENT_ANGEL,1,10, // Crit Chance against Angel Race
RDMOPT_RACE_CRI_PERCENT_DRAGON,1,10; // Crit Chance against Dragon Race
setarray .RandOpt_PDMG_RC_M$[0],"Damage vs Formless","Damage vs Undead","Damage vs Animal","Damage vs Plant","Damage vs Insect","Damage vs Fish","Damage vs Demon","Damage vs Human","Damage vs Angel","Damage vs Dragon",
"Bypass DEF of Formless","Bypass DEF of Undead","Bypass DEF of Animal","Bypass DEF of Plant","Bypass DEF of Insect","Bypass DEF of Fish","Bypass DEF of Demon","Bypass DEF of Human","Bypass DEF of Angel","Bypass DEF of Dragon",
"Crit Chance vs Formless","Crit Chance vs Undead","Crit Chance vs Animal","Crit Chance vs Plant","Crit Chance vs Insect","Crit Chance vs Fish","Crit Chance vs Demon","Crit Chance vs Human","Crit Chance vs Angel","Crit Chance vs Dragon";
// - Physical Damage vs Size/Class
setarray .RandOpt_PDMG_SC[0],
RDMOPT_DAMAGE_SIZE_SMALL_TARGET,1,50, // Physical Damage to Small Targets
RDMOPT_DAMAGE_SIZE_MIDIUM_TARGET,1,50, // Physical Damage to Medium Targets
RDMOPT_DAMAGE_SIZE_LARGE_TARGET,1,50, // Physical Damage to Large Targets
RDMOPT_CLASS_DAMAGE_NORMAL_TARGET,1,50, // Physical Damage to Normal Targets
RDMOPT_CLASS_DAMAGE_BOSS_TARGET,1,50, // Physical Damage to Boss Targets
RDMOPT_CLASS_IGNORE_DEF_PERCENT_NORMAL,1,50, // Bypass DEF of Normal Targets
RDMOPT_CLASS_IGNORE_DEF_PERCENT_BOSS,1,50; // Bypass DEF of Boss Targets
setarray .RandOpt_PDMG_SC_M$[0],"Damage vs Small Size","Damage vs Medium Size","Damage vs Large Size","Damage vs Normal class","Damage vs Boss class","Bypass DEF of Normal class","Bypass DEF of Boss class";
// - Magical Damage vs Element
setarray .RandOpt_MDMG_Ele[0],
RDMOPT_MDAMAGE_PROPERTY_NOTHING_TARGET,1,20, // Magical Damage to Neutral Element
RDMOPT_MDAMAGE_PROPERTY_GROUND_TARGET,1,20, // Magical Damage to Earth Element
RDMOPT_MDAMAGE_PROPERTY_FIRE_TARGET,1,20, // Magical Damage to Fire Element
RDMOPT_MDAMAGE_PROPERTY_WATER_TARGET,1,20, // Magical Damage to Water Element
RDMOPT_MDAMAGE_PROPERTY_WIND_TARGET,1,20, // Magical Damage to Wind Element
RDMOPT_MDAMAGE_PROPERTY_POISON_TARGET,1,20, // Magical Damage to Poison Element
RDMOPT_MDAMAGE_PROPERTY_SAINT_TARGET,1,20, // Magical Damage to Holy Element
RDMOPT_MDAMAGE_PROPERTY_DARKNESS_TARGET,1,20, // Magical Damage to Dark Element
RDMOPT_MDAMAGE_PROPERTY_TELEKINESIS_TARGET,1,20,// Magical Damage to Ghost Element
RDMOPT_MDAMAGE_PROPERTY_UNDEAD_TARGET,1,20; // Magical Damage to Undead Element
setarray .RandOpt_MDMG_Ele_M$[0],"Damage vs Neutral element","Damage vs Earth element","Damage vs Fire element","Damage vs Water element","Damage vs Wind element","Damage vs Poison element","Damage vs Holy element","Damage vs Shadow element","Damage vs Ghost element","Damage vs Undead element";
// - Magical Damage vs Race
setarray .RandOpt_MDMG_RC[0],
RDMOPT_RACE_MDAMAGE_NOTHING,1,50, // Magical Damage to Neutral Race
RDMOPT_RACE_MDAMAGE_UNDEAD,1,50, // Magical Damage to Undead Race
RDMOPT_RACE_MDAMAGE_ANIMAL,1,50, // Magical Damage to Animal Race
RDMOPT_RACE_MDAMAGE_PLANT,1,50, // Magical Damage to Plant Race
RDMOPT_RACE_MDAMAGE_INSECT,1,50, // Magical Damage to Insect Race
RDMOPT_RACE_MDAMAGE_FISHS,1,50, // Magical Damage to Fish Race
RDMOPT_RACE_MDAMAGE_DEVIL,1,50, // Magical Damage to Devil Race
RDMOPT_RACE_MDAMAGE_HUMAN,1,50, // Magical Damage to Human Race
RDMOPT_RACE_MDAMAGE_ANGEL,1,50, // Magical Damage to Angel Race
RDMOPT_RACE_MDAMAGE_DRAGON,1,50, // Magical Damage to Dragon Race
RDMOPT_RACE_IGNORE_MDEF_PERCENT_NOTHING,1,10, // Bypass MDEF of Neutral Race
RDMOPT_RACE_IGNORE_MDEF_PERCENT_UNDEAD,1,10, // Bypass MDEF of Undead Race
RDMOPT_RACE_IGNORE_MDEF_PERCENT_ANIMAL,1,10, // Bypass MDEF of Animal Race
RDMOPT_RACE_IGNORE_MDEF_PERCENT_PLANT,1,10, // Bypass MDEF of Plant Race
RDMOPT_RACE_IGNORE_MDEF_PERCENT_INSECT,1,10, // Bypass MDEF of Insect Race
RDMOPT_RACE_IGNORE_MDEF_PERCENT_FISHS,1,10, // Bypass MDEF of Fish Race
RDMOPT_RACE_IGNORE_MDEF_PERCENT_DEVIL,1,10, // Bypass MDEF of Demon Race
RDMOPT_RACE_IGNORE_MDEF_PERCENT_HUMAN,1,10, // Bypass MDEF of Human Race
RDMOPT_RACE_IGNORE_MDEF_PERCENT_ANGEL,1,10, // Bypass MDEF of Angel Race
RDMOPT_RACE_IGNORE_MDEF_PERCENT_DRAGON,1,10; // Bypass MDEF of Dragon Race
setarray .RandOpt_MDMG_RC_M$[0],"Damage vs Formless","Damage vs Undead","Damage vs Animal","Damage vs Plant","Damage vs Insect","Damage vs Fish","Damage vs Demon","Damage vs Human","Damage vs Angel","Damage vs Dragon",
"Bypass MDEF of Formless","Bypass MDEF of Undead","Bypass MDEF of Animal","Bypass MDEF of Plant","Bypass MDEF of Insect","Bypass MDEF of Fish","Bypass MDEF of Demon","Bypass MDEF of Human","Bypass MDEF of Angel","Bypass MDEF of Dragon";
// - Magical Damage vs Size/Class
setarray .RandOpt_MDMG_SC[0],
RDMOPT_MDAMAGE_SIZE_SMALL_TARGET,1,50, // Magical damage to Small Targets
RDMOPT_MDAMAGE_SIZE_MIDIUM_TARGET,1,50, // Magical damage to Medium Targets
RDMOPT_MDAMAGE_SIZE_LARGE_TARGET,1,50, // Magical damage to Large Targets
RDMOPT_CLASS_MDAMAGE_NORMAL,1,50, // Magical Damage to Normal Targets
RDMOPT_CLASS_MDAMAGE_BOSS,1,50, // Magical Damage to Boss Targets
RDMOPT_CLASS_IGNORE_MDEF_PERCENT_NORMAL,1,50, // Bypass MDEF of Normal Targets
RDMOPT_CLASS_IGNORE_MDEF_PERCENT_BOSS,1,50; // Bypass MDEF of Boss Targets
setarray .RandOpt_MDMG_SC_M$[0],"Damage vs Small Size","Damage vs Medium Size","Damage vs Large Size","Damage vs Normal class","Damage vs Boss class","Bypass MDEF of Normal class","Bypass MDEF of Boss class";
// - Physical Resistances
setarray .RandOpt_RES_P[0],
RDMOPT_DAMAGE_PROPERTY_NOTHING_USER,1,20, // Physical Damage Reduction from Neutral Element
RDMOPT_DAMAGE_PROPERTY_GROUND_USER,1,20, // Physical Damage Reduction from Earth Element
RDMOPT_DAMAGE_PROPERTY_FIRE_USER,1,20, // Physical Damage Reduction from Fire Element
RDMOPT_DAMAGE_PROPERTY_WATER_USER,1,20, // Physical Damage Reduction from Water Element
RDMOPT_DAMAGE_PROPERTY_WIND_USER,1,20, // Physical Damage Reduction from Wind Element
RDMOPT_DAMAGE_PROPERTY_POISON_USER,1,20, // Physical Damage Reduction from Poison Element
RDMOPT_DAMAGE_PROPERTY_SAINT_USER,1,20, // Physical Damage Reduction from Holy Element
RDMOPT_DAMAGE_PROPERTY_DARKNESS_USER,1,20, // Physical Damage Reduction from Shadow Element
RDMOPT_DAMAGE_PROPERTY_TELEKINESIS_USER,1,20, // Physical Damage Reduction from Ghost Element
RDMOPT_DAMAGE_PROPERTY_UNDEAD_USER,1,20; // Physical Damage Reduction from Undead Element
setarray .RandOpt_RES_P_M$[0],"Reduction from Neutral Element","Reduction from Earth Element","Reduction from Fire Element","Reduction from Water Element","Reduction from Wind Element","Reduction from Poison Element","Reduction from Holy Element","Reduction from Shadow Element","Reduction from Ghost Element","Reduction from Undead";
// - Magical Resistances
setarray .RandOpt_RES_M[0],
RDMOPT_MDAMAGE_PROPERTY_NOTHING_USER,1,20, // Magical Damage Reduction from Neutral Element
RDMOPT_MDAMAGE_PROPERTY_GROUND_USER,1,20, // Magical Damage Reduction from Earth Element
RDMOPT_MDAMAGE_PROPERTY_FIRE_USER,1,20, // Magical Damage Reduction from Fire Element
RDMOPT_MDAMAGE_PROPERTY_WATER_USER,1,20, // Magical Damage Reduction from Water Element
RDMOPT_MDAMAGE_PROPERTY_WIND_USER,1,20, // Magical Damage Reduction from Wind Element
RDMOPT_MDAMAGE_PROPERTY_POISON_USER,1,20, // Magical Damage Reduction from Poison Element
RDMOPT_MDAMAGE_PROPERTY_SAINT_USER,1,20, // Magical Damage Reduction from Holy Element
RDMOPT_MDAMAGE_PROPERTY_DARKNESS_USER,1,20, // Magical Damage Reduction from Shadow Element
RDMOPT_MDAMAGE_PROPERTY_TELEKINESIS_USER,1,20, // Magical Damage Reduction from Ghost Element
RDMOPT_MDAMAGE_PROPERTY_UNDEAD_USER,1,20; // Magical Damage Reduction from Undead Element
setarray .RandOpt_RES_M_M$[0],"Reduction from Neutral Element","Reduction from Earth Element","Reduction from Fire Element","Reduction from Water Element","Reduction from Wind Element","Reduction from Poison Element","Reduction from Holy Element","Reduction from Shadow Element","Reduction from Ghost Element","Reduction from Undead";
// - Resistances vs Race, Size, Class, Ranged and Critical Attacks
setarray .RandOpt_RES_ETC[0],
RDMOPT_RACE_TOLERACE_NOTHING,1,20, // Damage Reduction from Formless Race
RDMOPT_RACE_TOLERACE_UNDEAD,1,20, // Damage Reduction from Undead Race
RDMOPT_RACE_TOLERACE_ANIMAL,1,20, // Damage Reduction from Animal Race
RDMOPT_RACE_TOLERACE_PLANT,1,20, // Damage Reduction from Plant Race
RDMOPT_RACE_TOLERACE_INSECT,1,20, // Damage Reduction from Insect Race
RDMOPT_RACE_TOLERACE_FISHS,1,20, // Damage Reduction from Fish Race
RDMOPT_RACE_TOLERACE_DEVIL,1,20, // Damage Reduction from Demon Race
RDMOPT_RACE_TOLERACE_HUMAN,1,20, // Damage Reduction from Human Race
RDMOPT_RACE_TOLERACE_ANGEL,1,20, // Damage Reduction from Angel Race
RDMOPT_RACE_TOLERACE_DRAGON,1,20, // Damage Reduction from Dragon Race
RDMOPT_CLASS_DAMAGE_NORMAL_USER,1,20, // Damage Reduction from Normal Targets
RDMOPT_CLASS_DAMAGE_BOSS_USER,1,20, // Damage Reduction from Boss Targets
RDMOPT_DAMAGE_SIZE_SMALL_USER,1,20, // Damage Reduction from Small Targets
RDMOPT_DAMAGE_SIZE_MIDIUM_USER,1,20, // Damage Reduction from Medium Targets
RDMOPT_DAMAGE_SIZE_LARGE_USER,1,20, // Damage Reduction from Large Targets
RDMOPT_RANGE_ATTACK_DAMAGE_USER,1,20, // Damage Reduction from Ranged Attacks
RDMOPT_DAMAGE_CRI_USER,1,20; // Damage Reduction from Critical Attacks
setarray .RandOpt_RES_ETC_M$[0],"Reduction from Formless Race","Reduction from Undead Race","Reduction from Animal Race","Reduction from Plant Race","Reduction from Insect Race","Reduction from Fish Race","Reduction from Demon Race","Reduction from Human Race","Reduction from Angel Race","Reduction from Dragon Race","Reduction from Normal Targets","Reduction from Boss Targets","Reduction from Small Targets","Damage Reduction from Medium Targets","Reduction from Large Targets","Reduction from Ranged Attacks","Reduction from Critical Attacks";
// - Weapon Elements
setarray .RandOpt_WEle[0],
RDMOPT_WEAPON_ATTR_NOTHING, // Neutral
RDMOPT_WEAPON_ATTR_WATER, // Water
RDMOPT_WEAPON_ATTR_GROUND, // Earth
RDMOPT_WEAPON_ATTR_FIRE, // Fire
RDMOPT_WEAPON_ATTR_WIND, // Wind
RDMOPT_WEAPON_ATTR_POISON, // Poison
RDMOPT_WEAPON_ATTR_SAINT, // Holy
RDMOPT_WEAPON_ATTR_DARKNESS, // Shadow
RDMOPT_WEAPON_ATTR_TELEKINESIS, // Ghost
RDMOPT_WEAPON_ATTR_UNDEAD; // Undead
// - Armor Elements
setarray .RandOpt_AEle[0],
RDMOPT_BODY_ATTR_NOTHING, // Neutral
RDMOPT_BODY_ATTR_WATER, // Water
RDMOPT_BODY_ATTR_GROUND, // Earth
RDMOPT_BODY_ATTR_FIRE, // Fire
RDMOPT_BODY_ATTR_WIND, // Wind
RDMOPT_BODY_ATTR_POISON, // Poison
RDMOPT_BODY_ATTR_SAINT, // Holy
RDMOPT_BODY_ATTR_DARKNESS, // Shadow
RDMOPT_BODY_ATTR_TELEKINESIS, // Ghost
RDMOPT_BODY_ATTR_UNDEAD; // Undead
setarray .RandOpt_Ele_M$[0],"Neutral","Water","Earth","Fire","Wind","Poison","Holy","Shadow","Ghost","Undead";
// - Attributes
setarray .RandOpt_ATT[0],
RDMOPT_VAR_STRAMOUNT,1,100, // STR
RDMOPT_VAR_AGIAMOUNT,1,100, // AGI
RDMOPT_VAR_VITAMOUNT,1,100, // VIT
RDMOPT_VAR_INTAMOUNT,1,100, // INT
RDMOPT_VAR_DEXAMOUNT,1,100, // DEX
RDMOPT_VAR_LUKAMOUNT,1,100, // LUK
RDMOPT_VAR_ATTPOWER,1,100, // ATK
RDMOPT_VAR_ATKPERCENT,1,100, // ATK %
RDMOPT_VAR_ATTMPOWER,1,100, // MATK
RDMOPT_VAR_MAGICATKPERCENT,1,100, // MATK %
RDMOPT_VAR_CRITICALSUCCESSVALUE,1,100, // Crit Chance
RDMOPT_DAMAGE_CRI_TARGET,1,100, // Crit Damage %
RDMOPT_VAR_PLUSASPD,1,100, // ASPD Flat
RDMOPT_VAR_PLUSASPDPERCENT,1,100, // ASPD %
RDMOPT_VAR_MAXHPPERCENT,1,100, // Max HP %
RDMOPT_VAR_MAXSPPERCENT,1,100, // Max SP %
RDMOPT_VAR_HPACCELERATION,1,100, // HP Recovery %
RDMOPT_VAR_SPACCELERATION,1,100, // SP Recovery %
RDMOPT_VAR_HITSUCCESSVALUE,1,100, // HIT
RDMOPT_VAR_AVOIDSUCCESSVALUE,1,100, // FLEE
RDMOPT_VAR_PLUSAVOIDSUCCESSVALUE,1,100, // Perfect Dodge
RDMOPT_VAR_ITEMDEFPOWER,1,100, // DEF
RDMOPT_VAR_MDEFPOWER,1,100, // MDEF
RDMOPT_RANGE_ATTACK_DAMAGE_TARGET,1,100;// Ranged Damage +%
setarray .RandOpt_ATT_M$[0],"STR","AGI","VIT","INT","DEX","LUK","ATK","ATK %","MATK","MATK %","Critical Chance","Critical Damage","ASPD","ASPD %","Max HP %","Max SP %","HP Recovery %","SP Recovery %","HIT","FLEE","Perfect Dodge","DEF","MDEF","Ranged Damage %";
// - Special
setarray .RandOpt_Spec[0],
RDMOPT_HEAL_VALUE,1,100, // Outgoing Heal Power
RDMOPT_HEAL_MODIFY_PERCENT,1,100, // Incoming Heal Power
RDMOPT_WEAPON_INDESTRUCTIBLE,0,0, // Weapon Instructible
RDMOPT_BODY_INDESTRUCTIBLE,0,0, // Armor Instructible
RDMOPT_DAMAGE_SIZE_PERFECT,0,0, // Size will be ignored
RDMOPT_DEC_SPELL_CAST_TIME,1,20, // Variable Cast Time -%
RDMOPT_DEC_SPELL_DELAY_TIME,1,20, // Cast Delay -%
RDMOPT_DEC_SP_CONSUMPTION,1,20; // Skill SP Cost -%
setarray .RandOpt_Spec_M$[0],"Outgoing Heal Power ","Incoming Heal Power","Weapon Instructible","Armor Instructible","Ignore Size Penalty","Variable Cast Time","Cast Delay","SP Cost";
// Limits the Special Random Options Enchantments on one Equipment to once only
// 1 = Enabled
// 0 = Disable
setarray .RandOpt_Spec_Limit,1;
end;
}
// Shops for the .enchant_restrict
- pointshop EShop_Headgear -1,EnchantShop,512:1
- pointshop EShop_Weapon -1,EnchantShop,512:1
- pointshop EShop_Armor -1,EnchantShop,512:1
- pointshop EShop_Shield -1,EnchantShop,512:1
- pointshop EShop_Garment -1,EnchantShop,512:1
- pointshop EShop_Shoes -1,EnchantShop,512:1
- pointshop EShop_Acc -1,EnchantShop,512:1
- pointshop EShop_Costume_Headgear -1,EnchantShop,512:1
- pointshop EShop_Shadow_Armor -1,EnchantShop,512:1
- pointshop EShop_Shadow_Weapon -1,EnchantShop,512:1
- pointshop EShop_Shadow_Shield -1,EnchantShop,512:1
- pointshop EShop_Costume_Garment -1,EnchantShop,512:1
- pointshop EShop_Shadow_Shoes -1,EnchantShop,512:1
- pointshop EShop_Shadow_Acc -1,EnchantShop,512:1