Major Auto Spell Shadow Armor

Item ID 24728 Name Major Auto Spell Shadow Armor
A suit of armor worn on top of normal armor for additional defense. Needs a complete set to have bonus effect.
_______________________
MATK +3%
_______________________
For each 2 Refine Levels:
Increases Magical Damage with every element by 1%.
_______________________
Refine Level +9:
ASPD +1
_______________________
Refine Level +10:
Physical melee attacks have a 7% chance to auto-cast Level 3 Frost Misty.
(If you learned a higher Level, it will auto cast that Level instead.)
_______________________
When equipped with Major Auto Spell Shadow Shoes:
MATK +2%

Total Refine Level of entire set at least +18:
Physical melee attacks have a 4% chance to auto-cast Level 2 Jack Frost.
(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 4 Jack Frost.
(If you learned a higher Level, it will auto cast that Level instead.)
_______________________
Type: Shadow Armor
_______________________
Requirement: None
Weapon Level 0 Identifier S_M_AutoSpell_Armor
Attack 0 Type Shadow Equipment
MATK 0 Equip Locations Shadow Armor
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 bMatkRate,3;
bonus2 bMagicAtkEle,Ele_All,(.@r/2);
if (.@r>=9) {
   bonus bAspd,1;
   if (.@r>=10) {
      bonus3 bAutoSpell,"WL_FROSTMISTY",max(getskilllv("WL_FROSTMISTY"),3),70;
   }
}

Set Script
Major Auto Spell Shadow Armor
Major Auto Spell Shadow Shoes
.@sum = getequiprefinerycnt(EQI_SHADOW_ARMOR)+getequiprefinerycnt(EQI_SHADOW_SHOES);
bonus bMatkRate,2;
if (.@sum >= 20) {
   bonus3 bAutoSpell,"WL_JACKFROST",max(getskilllv("WL_JACKFROST"),4),80;
}
else if (.@sum >= 18) {
   bonus3 bAutoSpell,"WL_JACKFROST",max(getskilllv("WL_JACKFROST"),2),40;
}