Gemstone Shadow Earring II

Item ID 24322 Name Gemstone Shadow Earring II
A sacred earring which is believed to protect its wearer. It also draws the wearer's potential abilities.
_______________________
MATK +5
_______________________
Decreases SP Consumption by 2%.
_______________________
Refine Level +7:
Decreases SP Consumption by additional 1%.
_______________________
When equipped with Gemstone Shadow Weapon, Gemstone Shadow Armor, Gemstone Shadow Shield, Gemstone Shadow Shoes and Gemstone Shadow Pendant:
All Basic Stats +1
_______________________
Total Refine Level of entire set at least +45:
Removes Gemstone requirement from certain skills.
Increases SP Consumption by 100%.
_______________________
For each Refine Level of entire set:
Decreases SP Consumption by additional 1%.
_______________________
Type: Shadow Earring
_______________________
Requirement: None
Weapon Level 0 Identifier S2_Gemstone_Earring
Attack 0 Type Shadow Equipment
MATK 0 Equip Locations Shadow Accessory Right (Earring)
Defense 0 Equippable Jobs None
Range 0 Equip Gender Both (Male and Female)
Slots 0 Equip Upper None
Weight 0 Min Equip Level 1
NPC Buy 0 Max Equip Level None
NPC Sell 0 Refineable Yes
Credit Price None Trade restriction None
Item Script
.@r = getrefine();
bonus bMaxHP,.@r*10;
if (.@r >= 7) {
   .@val = 3;
}
else {
   .@val = 2;
}
bonus bMatk,5;
bonus bUseSPrate,-.@val;

Set Script
Gemstone Shadow Armor
Gemstone Shadow Shoes
Gemstone Shadow Shield
Gemstone Shadow Weapon
Gemstone Shadow Pendant
Gemstone Shadow Earring II
.@r = getequiprefinerycnt(EQI_SHADOW_ARMOR)+getequiprefinerycnt(EQI_SHADOW_WEAPON)+getequiprefinerycnt(EQI_SHADOW_SHIELD)+getequiprefinerycnt(EQI_SHADOW_SHOES)+getequiprefinerycnt(EQI_SHADOW_ACC_R)+getequiprefinerycnt(EQI_SHADOW_ACC_L);
bonus bAllStats,1;
if (.@r >= 45) {
   bonus bNoGemStone;
   bonus bUseSPrate,(100-.@r);
}
Gemstone Shadow Earring II
Gemstone Shadow Weapon II
Gemstone Shadow Shield II
bonus bAllStats,1;
.@r = getequiprefinerycnt(EQI_SHADOW_ACC_R) + getequiprefinerycnt(EQI_SHADOW_WEAPON) + getequiprefinerycnt(EQI_SHADOW_SHIELD);
if (.@r >= 25) {
   bonus bNoGemStone;
   bonus bUseSPrate,70-.@r;
}