Major Auto Spell Shadow Earring

Item ID 24730 Name Major Auto Spell Shadow Earring
A sacred earring which is believed to protect its wearer. It also draws the wearer's potential abilities.
_______________________
ATK +3%
_______________________
For each 2 Refine Levels:
Increases Melee Physical Damage by 1%.
_______________________
Refine Level +9:
ASPD +1
_______________________
Refine Level +10:
Physical melee attacks have a 7% chance to auto-cast Level 7 Fatal Menace.
(If you learned a higher Level, it will auto cast that Level instead.)
_______________________
When equipped with Major Auto Spell Shadow Pendant:
ATK +2%

Total Refine Level of entire set at least +18:
Physical melee attacks have a 4% chance to auto-cast Level 4 Power Swing.
(If you learned a higher Level, it will auto cast that Level instead.)

Total Refine Level of entire set at least +20:
Physical melee attacks have a 8% chance to auto-cast Level 8 Power Swing.
(If you learned a higher Level, it will auto cast that Level instead.)
_______________________
Type: Shadow Earring
_______________________
Requirement: None
Weapon Level 0 Identifier S_M_AutoSpell_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 None
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;
bonus bAtkRate,3;
bonus bShortAtkRate,(.@r/2);
if (.@r>=9) {
   bonus bAspd,1;
   if (.@r>=10) {
      bonus5 bAutoSpell,"SC_FATALMENACE",max(getskilllv("SC_FATALMENACE"),7),70,BF_SHORT|BF_NORMAL,1;
   }
}

Set Script
Major Auto Spell Shadow Earring
Major Auto Spell Shadow Pendant
.@sum = getequiprefinerycnt(EQI_SHADOW_ACC_R)+getequiprefinerycnt(EQI_SHADOW_ACC_L);
bonus bAtkRate,2;
if (.@sum >= 20) {
   bonus5 bAutoSpell,"NC_POWERSWING",max(getskilllv("NC_POWERSWING"),8),80,BF_SHORT|BF_NORMAL,1;
}
else if (.@sum >= 18) {
   bonus5 bAutoSpell,"NC_POWERSWING",max(getskilllv("NC_POWERSWING"),4),40,BF_SHORT|BF_NORMAL,1;
}