Index: scripts/globals/abilities/boost.lua =================================================================== --- scripts/globals/abilities/boost.lua (revision 1825) +++ scripts/globals/abilities/boost.lua (working copy) @@ -10,7 +10,7 @@ ----------------------------------- function OnUseAbility(player, target, ability) - local sHands = player:getEquipID(6); + local sHands = player:getEquipID(SLOT_HANDS); local power = 12.5 if(sHands == 13962 or sHands == 14891) then power = power + 5.5; @@ -18,8 +18,7 @@ if(player:hasStatusEffect(EFFECT_BOOST) == true) then local effect = player:getStatusEffect(EFFECT_BOOST); - newPower = effect:getPower() + power; - effect:setPower(newPower); + effect:setPower(effect:getPower() + power); player:addMod(MOD_ATTP,power); else player:addStatusEffect(EFFECT_BOOST,power,1,180); Index: scripts/globals/abilities/call_beast.lua =================================================================== --- scripts/globals/abilities/call_beast.lua (revision 1825) +++ scripts/globals/abilities/call_beast.lua (working copy) @@ -3,7 +3,6 @@ ----------------------------------- require("scripts/globals/common"); -require("scripts/globals/settings"); require("scripts/globals/status"); ----------------------------------- @@ -12,7 +11,7 @@ function OnUseAbility(player, target, ability) --TODO: Look at ammo slot for jug pet type etc - switch(player:getEquipID(3)) : caseof{ + switch(player:getEquipID(SLOT_RANGED)) : caseof{ [17860] = function (x) player:spawnPet(22) end, -- Hare Familiar ok [17861] = function (x) player:spawnPet(37) end, -- Keeneared Steffi OK [17862] = function (x) player:spawnPet(31) end, -- Mayfly Familiar ok Index: scripts/globals/abilities/camouflage.lua =================================================================== --- scripts/globals/abilities/camouflage.lua (revision 1825) +++ scripts/globals/abilities/camouflage.lua (working copy) @@ -11,14 +11,14 @@ function OnUseAbility(player, target, ability) + local duration = math.random(30, 300); duration = math.random(30, 300); duration = math.random(30, 300); - duration = math.random(30, 300); - if (target:getEquipID(5) == 14224) then -- Hunter's Jerkin + if (target:getEquipID(SLOT_BODY) == 14224) then -- Hunter's Jerkin duration = duration * 1.3; - elseif (target:getEquipID(5) == 15571) then -- Hunter's Jerkin +1 + elseif (target:getEquipID(SLOT_BODY) == 15571) then -- Hunter's Jerkin +1 duration = duration * 1.5; end - player:addStatusEffect(EFFECT_CAMOUFLAGE,1,0,math.floor(duration)); + player:addStatusEffect(EFFECT_CAMOUFLAGE,1,0,(math.floor(duration) * SNEAK_INVIS_DURATION_MULTIPLIER)); end; \ No newline at end of file Index: scripts/globals/abilities/chakra.lua =================================================================== --- scripts/globals/abilities/chakra.lua (revision 1825) +++ scripts/globals/abilities/chakra.lua (working copy) @@ -2,7 +2,6 @@ -- Ability: Chakra ----------------------------------- -require("scripts/globals/settings"); require("scripts/globals/status"); ----------------------------------- @@ -14,8 +13,8 @@ local vit = player:getStat(MOD_VIT); local multi = 2; - local body = player:getEquipID(4); - local hand = player:getEquipID(6); + local body = player:getEquipID(SLOT_BODY); + local hand = player:getEquipID(SLOT_HANDS); if(player:hasStatusEffect(EFFECT_POISON)) then player:delStatusEffect(EFFECT_POISON); Index: scripts/globals/abilities/convert.lua =================================================================== --- scripts/globals/abilities/convert.lua (revision 1825) +++ scripts/globals/abilities/convert.lua (working copy) @@ -7,6 +7,8 @@ -- In the past, the ability would still activate, but it would have no effect. ----------------------------------- +require("scripts/globals/status"); + ----------------------------------- -- OnUseAbility ----------------------------------- @@ -16,7 +18,7 @@ local HP = player:getHP(); if (MP > 0) then -- Murgleis sword augments Convert. - if ((player:getEquipID(0) == 18995 or player:getEquipID(1) == 18995) and (HP > (player:getMaxHP()/2))) then + if ((player:getEquipID(SLOT_MAIN) == 18995 or player:getEquipID(SLOT_SUB) == 18995) and (HP > (player:getMaxHP()/2))) then HP = HP * 2; end player:setHP(MP); Index: scripts/globals/abilities/dodge.lua =================================================================== --- scripts/globals/abilities/dodge.lua (revision 1825) +++ scripts/globals/abilities/dodge.lua (working copy) @@ -10,7 +10,7 @@ ----------------------------------- function OnUseAbility(player, target, ability) - local sLegs = player:getEquipID(5); + local sLegs = player:getEquipID(SLOT_LEGS); local power = 20 if(sLegs == 14090 or sLegs == 15353) then power = power + 10; Index: scripts/globals/abilities/flee.lua =================================================================== --- scripts/globals/abilities/flee.lua (revision 1825) +++ scripts/globals/abilities/flee.lua (working copy) @@ -10,8 +10,9 @@ ----------------------------------- function OnUseAbility(player, target, ability) - buff = 30; - if (player:getEquipID(8) == 14094) or (player:getEquipID(8) == 15357) then + local buff = 30; + local sFeet = player:getEquipID(SLOT_FEET); + if (sFeet == 14094) or (sFeet == 15357) then buff = buff + 15; end player:addStatusEffect(EFFECT_FLEE,100,0,buff); Index: scripts/globals/abilities/focus.lua =================================================================== --- scripts/globals/abilities/focus.lua (revision 1825) +++ scripts/globals/abilities/focus.lua (working copy) @@ -2,7 +2,6 @@ -- Ability: Focus ----------------------------------- -require("scripts/globals/settings"); require("scripts/globals/status"); ----------------------------------- @@ -10,7 +9,7 @@ ----------------------------------- function OnUseAbility(player, target, ability) - local sLegs = player:getEquipID(4); + local sLegs = player:getEquipID(SLOT_LEGS); local power = 20 if(sLegs == 12512 or sLegs == 15226) then power = power + 10; Index: scripts/globals/abilities/hide.lua =================================================================== --- scripts/globals/abilities/hide.lua (revision 1825) +++ scripts/globals/abilities/hide.lua (working copy) @@ -10,5 +10,10 @@ ----------------------------------- function OnUseAbility(player, target, ability) - player:addStatusEffect(EFFECT_HIDE,1,0,30); + + local duration = math.random(30, 300); + duration = math.random(30, 300); + duration = math.random(30, 300); + + player:addStatusEffect(EFFECT_HIDE,1,0,(duration * SNEAK_INVIS_DURATION_MULTIPLIER)); end; \ No newline at end of file Index: scripts/globals/abilities/meditate.lua =================================================================== --- scripts/globals/abilities/meditate.lua (revision 1825) +++ scripts/globals/abilities/meditate.lua (working copy) @@ -2,7 +2,6 @@ -- Ability: Meditate ----------------------------------- -require("scripts/globals/settings"); require("scripts/globals/status"); ----------------------------------- @@ -10,15 +9,15 @@ ----------------------------------- function OnUseAbility(player, target, ability) - amount = 12; + local amount = 12; if(player:getMainJob()==12) then amount = 20; end --TODO: Meditate doesnt actually give an icon, it's not regain as such. local tick = 15; local extratick = 0; - local sHands = target:getEquipID(6); - local sHead = target:getEquipID(4); + local sHands = target:getEquipID(SLOT_HANDS); + local sHead = target:getEquipID(SLOT_HEAD); if (sHands == 15113 or sHands == 14920) then extratick = 1; end @@ -31,5 +30,5 @@ extratick = math.random(2,3); end tick = tick + (extratick * 3); - player:addStatusEffect(EFFECT_REGAIN,20,3,tick); + player:addStatusEffect(EFFECT_REGAIN,amount,3,tick); end; Index: scripts/globals/abilities/spirit_link.lua =================================================================== --- scripts/globals/abilities/spirit_link.lua (revision 1825) +++ scripts/globals/abilities/spirit_link.lua (working copy) @@ -2,7 +2,6 @@ -- Ability: Spirit Link ----------------------------------- -require("scripts/globals/settings"); require("scripts/globals/status"); ----------------------------------- @@ -39,7 +38,7 @@ local healPet = drainamount * 2; local petTP = pet:getTP(); - if(player:getEquipID(4)==15238) then + if(player:getEquipID(SLOT_HEAD)==15238) then healPet = healPet + 15; end Index: scripts/globals/abilities/warcry.lua =================================================================== --- scripts/globals/abilities/warcry.lua (revision 1825) +++ scripts/globals/abilities/warcry.lua (working copy) @@ -2,7 +2,6 @@ -- Ability: Warcry ----------------------------------- -require("scripts/globals/settings"); require("scripts/globals/status"); ----------------------------------- @@ -10,16 +9,17 @@ ----------------------------------- function OnUseAbility(player, target, ability) - duration = 30; - if player:getEquipID(4) == 15072 or player:getEquipID(4) == 15245 then + local duration = 30; + local sHead = player:getEquipID(SLOT_HEAD) + if(sHead == 15072 or sHead == 15245) then duration = duration + 10; - elseif player:getEquipID(4) == 10650 then + elseif(sHead == 10650) then duration = duration + 20; end if player:getMainJob() == 1 then - power = math.floor((player:getMainLvl()/4)+4.75)/256; + local power = math.floor((player:getMainLvl()/4)+4.75)/256; else - power = math.floor((player:getSubLvl()/4)+4.75)/256; + local power = math.floor((player:getSubLvl()/4)+4.75)/256; end power = power * 100; target:addStatusEffect(EFFECT_WARCRY,power,0,30); Index: scripts/globals/effects/avatar.lua =================================================================== --- scripts/globals/effects/avatar.lua (revision 1825) +++ scripts/globals/effects/avatar.lua (working copy) @@ -23,10 +23,10 @@ if element == nil or element == 0 then target:delStatusEffect(EFFECT_AVATAR); else - if target:getEquipID(6) == 14062 and target:getPetName() == 'Carbuncle' then + if target:getEquipID(SLOT_HANDS) == 14062 and target:getPetName() == 'Carbuncle' then power = math.floor(power/2); end - if target:getEquipID(4) == 16154 and target:getPetName() == 'Garuda' then + if target:getEquipID(SLOT_HEAD) == 16154 and target:getPetName() == 'Garuda' then power = power - 2; end strong = {MOD_FIRE_AFFINITY, MOD_EARTH_AFFINITY, MOD_WATER_AFFINITY, MOD_WIND_AFFINITY, MOD_ICE_AFFINITY, MOD_THUNDER_AFFINITY, MOD_LIGHT_AFFINITY, MOD_DARK_AFFINITY} Index: scripts/globals/harvesting.lua =================================================================== --- scripts/globals/harvesting.lua (revision 1825) +++ scripts/globals/harvesting.lua (working copy) @@ -6,6 +6,7 @@ ------------------------------------------------- require("scripts/globals/settings"); +require("scripts/globals/status"); ------------------------------------------------- -- npcid and drop by zone @@ -77,9 +78,9 @@ -------------------- -- Begin Gear Bonus -------------------- - Body = player:getEquipID(6); - Legs = player:getEquipID(8); - Feet = player:getEquipID(9); + Body = player:getEquipID(SLOT_BODY); + Legs = player:getEquipID(SLOT_LEGS); + Feet = player:getEquipID(SLOT_FEET); if(Body == 14374 or Body == 14375) then sicklebreak = sicklebreak + 0.073; Index: scripts/globals/items/aoidos_cothurnes_+1.lua =================================================================== --- scripts/globals/items/aoidos_cothurnes_+1.lua (revision 1825) +++ scripts/globals/items/aoidos_cothurnes_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(8) == 11253) then + if (target:getEquipID(SLOT_FEET) == 11253) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,11253); else target:delStatusEffect(EFFECT_AUTO_REGEN,11253); Index: scripts/globals/items/aoidos_cothurnes_+2.lua =================================================================== --- scripts/globals/items/aoidos_cothurnes_+2.lua (revision 1825) +++ scripts/globals/items/aoidos_cothurnes_+2.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(8) == 11153) then + if (target:getEquipID(SLOT_FEET) == 11153) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,11153); else target:delStatusEffect(EFFECT_AUTO_REGEN,11153); Index: scripts/globals/items/arcane_robe.lua =================================================================== --- scripts/globals/items/arcane_robe.lua (revision 1825) +++ scripts/globals/items/arcane_robe.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14369) then + if (target:getEquipID(SLOT_BODY) == 14369) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,14369); else target:delStatusEffect(EFFECT_AUTO_REFRESH,14369); Index: scripts/globals/items/aress_cuirass.lua =================================================================== --- scripts/globals/items/aress_cuirass.lua (revision 1825) +++ scripts/globals/items/aress_cuirass.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14546) then + if (target:getEquipID(SLOT_BODY) == 14546) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,14546); else target:delStatusEffect(EFFECT_AUTO_REFRESH,14546); Index: scripts/globals/items/aristocrats_coat.lua =================================================================== --- scripts/globals/items/aristocrats_coat.lua (revision 1825) +++ scripts/globals/items/aristocrats_coat.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 13774) then + if (target:getEquipID(SLOT_BODY) == 13774) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,13774); else target:delStatusEffect(EFFECT_AUTO_REFRESH,13774); Index: scripts/globals/items/bale_choker.lua =================================================================== --- scripts/globals/items/bale_choker.lua (revision 1825) +++ scripts/globals/items/bale_choker.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(9) == 11616) then + if (target:getEquipID(SLOT_NECK) == 11616) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11616); else target:delStatusEffect(EFFECT_AUTO_REFRESH,11616); Index: scripts/globals/items/barone_corazza.lua =================================================================== --- scripts/globals/items/barone_corazza.lua (revision 1825) +++ scripts/globals/items/barone_corazza.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14416) then + if (target:getEquipID(SLOT_BODY) == 14416) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,14416); else target:delStatusEffect(EFFECT_AUTO_REGEN,14416); Index: scripts/globals/items/black_cloak.lua =================================================================== --- scripts/globals/items/black_cloak.lua (revision 1825) +++ scripts/globals/items/black_cloak.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 13779) then + if (target:getEquipID(SLOT_BODY) == 13779) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,13779); else target:delStatusEffect(EFFECT_AUTO_REFRESH,13779); Index: scripts/globals/items/blood_mask.lua =================================================================== --- scripts/globals/items/blood_mask.lua (revision 1825) +++ scripts/globals/items/blood_mask.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(4) == 13909) then + if (target:getEquipID(SLOT_HEAD) == 13909) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,13909); else target:delStatusEffect(EFFECT_AUTO_REGEN,13909); Index: scripts/globals/items/bloom_buckler.lua =================================================================== --- scripts/globals/items/bloom_buckler.lua (revision 1825) +++ scripts/globals/items/bloom_buckler.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(1) == 16190) then + if (target:getEquipID(SLOT_SUB) == 16190) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,16190); else target:delStatusEffect(EFFECT_AUTO_REGEN,16190); Index: scripts/globals/items/callers_horn_+1.lua =================================================================== --- scripts/globals/items/callers_horn_+1.lua (revision 1825) +++ scripts/globals/items/callers_horn_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(4) == 11178) then + if (target:getEquipID(SLOT_HEAD) == 11178) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11178); else target:delStatusEffect(EFFECT_AUTO_REFRESH,11178); Index: scripts/globals/items/clerics_briault.lua =================================================================== --- scripts/globals/items/clerics_briault.lua (revision 1825) +++ scripts/globals/items/clerics_briault.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 15089) then + if (target:getEquipID(SLOT_BODY) == 15089) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,15089); else target:delStatusEffect(EFFECT_AUTO_REFRESH,15089); Index: scripts/globals/items/clerics_briault_+1.lua =================================================================== --- scripts/globals/items/clerics_briault_+1.lua (revision 1825) +++ scripts/globals/items/clerics_briault_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14502) then + if (target:getEquipID(SLOT_BODY) == 14502) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,14502); else target:delStatusEffect(EFFECT_AUTO_REFRESH,14502); Index: scripts/globals/items/clerics_briault_+2.lua =================================================================== --- scripts/globals/items/clerics_briault_+2.lua (revision 1825) +++ scripts/globals/items/clerics_briault_+2.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 10672) then + if (target:getEquipID(SLOT_BODY) == 10672) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,10672); else target:delStatusEffect(EFFECT_AUTO_REFRESH,10672); Index: scripts/globals/items/coatl_gorget.lua =================================================================== --- scripts/globals/items/coatl_gorget.lua (revision 1825) +++ scripts/globals/items/coatl_gorget.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(9) == 10946) then + if (target:getEquipID(SLOT_NECK) == 10946) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,10946); else target:delStatusEffect(EFFECT_AUTO_REFRESH,10946); Index: scripts/globals/items/conte_corazza.lua =================================================================== --- scripts/globals/items/conte_corazza.lua (revision 1825) +++ scripts/globals/items/conte_corazza.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14417) then + if (target:getEquipID(SLOT_BODY) == 14417) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,2,3,0,14417); else target:delStatusEffect(EFFECT_AUTO_REGEN,14417); Index: scripts/globals/items/creed_collar.lua =================================================================== --- scripts/globals/items/creed_collar.lua (revision 1825) +++ scripts/globals/items/creed_collar.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(9) == 11595) then + if (target:getEquipID(SLOT_NECK) == 11595) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11595); else target:delStatusEffect(EFFECT_AUTO_REFRESH,11595); Index: scripts/globals/items/crimson_mask.lua =================================================================== --- scripts/globals/items/crimson_mask.lua (revision 1825) +++ scripts/globals/items/crimson_mask.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(4) == 13908) then + if (target:getEquipID(SLOT_HEAD) == 13908) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,13908); else target:delStatusEffect(EFFECT_AUTO_REGEN,13908); Index: scripts/globals/items/dalmatica.lua =================================================================== --- scripts/globals/items/dalmatica.lua (revision 1825) +++ scripts/globals/items/dalmatica.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 13787) then + if (target:getEquipID(SLOT_BODY) == 13787) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,13787); else target:delStatusEffect(EFFECT_AUTO_REFRESH,13787); Index: scripts/globals/items/dalmatica_+1.lua =================================================================== --- scripts/globals/items/dalmatica_+1.lua (revision 1825) +++ scripts/globals/items/dalmatica_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 13788) then + if (target:getEquipID(SLOT_BODY) == 13788) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,13788); else target:delStatusEffect(EFFECT_AUTO_REFRESH,13788); Index: scripts/globals/items/demons_cloak.lua =================================================================== --- scripts/globals/items/demons_cloak.lua (revision 1825) +++ scripts/globals/items/demons_cloak.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 13780) then + if (target:getEquipID(SLOT_BODY) == 13780) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,13780); else target:delStatusEffect(EFFECT_AUTO_REFRESH,13780); Index: scripts/globals/items/duelists_chapeau.lua =================================================================== --- scripts/globals/items/duelists_chapeau.lua (revision 1825) +++ scripts/globals/items/duelists_chapeau.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(4) == 15076) then + if (target:getEquipID(SLOT_HEAD) == 15076) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,15076); else target:delStatusEffect(EFFECT_AUTO_REFRESH,15076); Index: scripts/globals/items/duelists_chapeau_+1.lua =================================================================== --- scripts/globals/items/duelists_chapeau_+1.lua (revision 1825) +++ scripts/globals/items/duelists_chapeau_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(4) == 15249) then + if (target:getEquipID(SLOT_HEAD) == 15249) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,15249); else target:delStatusEffect(EFFECT_AUTO_REFRESH,15249); Index: scripts/globals/items/duelists_chapeau_+2.lua =================================================================== --- scripts/globals/items/duelists_chapeau_+2.lua (revision 1825) +++ scripts/globals/items/duelists_chapeau_+2.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(4) == 10654) then + if (target:getEquipID(SLOT_HEAD) == 10654) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,10654); else target:delStatusEffect(EFFECT_AUTO_REFRESH,10654); Index: scripts/globals/items/dusk_jerkin.lua =================================================================== --- scripts/globals/items/dusk_jerkin.lua (revision 1825) +++ scripts/globals/items/dusk_jerkin.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 12573) then + if (target:getEquipID(SLOT_BODY) == 12573) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,12573); else target:delStatusEffect(EFFECT_AUTO_REGEN,12573); Index: scripts/globals/items/dusk_jerkin_+1.lua =================================================================== --- scripts/globals/items/dusk_jerkin_+1.lua (revision 1825) +++ scripts/globals/items/dusk_jerkin_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14391) then + if (target:getEquipID(SLOT_BODY) == 14391) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,14391); else target:delStatusEffect(EFFECT_AUTO_REGEN,14391); Index: scripts/globals/items/ebon_bliaut.lua =================================================================== --- scripts/globals/items/ebon_bliaut.lua (revision 1825) +++ scripts/globals/items/ebon_bliaut.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 12174) then + if (target:getEquipID(SLOT_BODY) == 12174) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,12174); else target:delStatusEffect(EFFECT_AUTO_REFRESH,12174); Index: scripts/globals/items/ebur_bliaut.lua =================================================================== --- scripts/globals/items/ebur_bliaut.lua (revision 1825) +++ scripts/globals/items/ebur_bliaut.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 12176) then + if (target:getEquipID(SLOT_BODY) == 12176) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,12176); else target:delStatusEffect(EFFECT_AUTO_REFRESH,12176); Index: scripts/globals/items/eerie_cloak_+1.lua =================================================================== --- scripts/globals/items/eerie_cloak_+1.lua (revision 1825) +++ scripts/globals/items/eerie_cloak_+1.lua (working copy) @@ -14,7 +14,7 @@ -- (I.E. 18:00-06:00 and Level 13, 26, 39, 52, 65, 78 and 91.) function onItemCheck(target, totd) - if (target:getEquipID(5) == 11301 and totd ~= 4) then + if (target:getEquipID(SLOT_BODY) == 11301 and totd ~= 4) then if (totd == 0 and (VanadielTOTD() == 3 or VanadielTOTD() == 7 or VanadielTOTD() == 8)) or totd == 7) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11301); end Index: scripts/globals/items/federation_aketon.lua =================================================================== --- scripts/globals/items/federation_aketon.lua (revision 1825) +++ scripts/globals/items/federation_aketon.lua (working copy) @@ -16,7 +16,7 @@ if (target:getNation() == 2) then - body = target:getEquipID(5); + body = target:getEquipID(SLOT_BODY); zone = target:getZone(); if (zone >= 238 and zone <= 242) then Index: scripts/globals/items/flanged_mace.lua =================================================================== --- scripts/globals/items/flanged_mace.lua (revision 1825) +++ scripts/globals/items/flanged_mace.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(0) == 18858) then + if (target:getEquipID(SLOT_MAIN) == 18858) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,18858); else target:delStatusEffect(EFFECT_AUTO_REGEN,18858); Index: scripts/globals/items/flanged_mace_+1.lua =================================================================== --- scripts/globals/items/flanged_mace_+1.lua (revision 1825) +++ scripts/globals/items/flanged_mace_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(0) == 18860) then + if (target:getEquipID(SLOT_MAIN) == 18860) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,18860); else target:delStatusEffect(EFFECT_AUTO_REGEN,18860); Index: scripts/globals/items/furia_bliaut.lua =================================================================== --- scripts/globals/items/furia_bliaut.lua (revision 1825) +++ scripts/globals/items/furia_bliaut.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 12175) then + if (target:getEquipID(SLOT_BODY) == 12175) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,12175); else target:delStatusEffect(EFFECT_AUTO_REFRESH,12175); Index: scripts/globals/items/goetia_coat_+1.lua =================================================================== --- scripts/globals/items/goetia_coat_+1.lua (revision 1825) +++ scripts/globals/items/goetia_coat_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 11187) then + if (target:getEquipID(SLOT_BODY) == 11187) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11187); else target:delStatusEffect(EFFECT_AUTO_REFRESH,11187); Index: scripts/globals/items/gram.lua =================================================================== --- scripts/globals/items/gram.lua (revision 1825) +++ scripts/globals/items/gram.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(0) == 19173) then + if (target:getEquipID(SLOT_MAIN) == 19173) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,19173); else target:delStatusEffect(EFFECT_AUTO_REFRESH,19173); Index: scripts/globals/items/ixion_cloak.lua =================================================================== --- scripts/globals/items/ixion_cloak.lua (revision 1825) +++ scripts/globals/items/ixion_cloak.lua (working copy) @@ -12,7 +12,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 11289) then + if (target:getEquipID(SLOT_BODY) == 11289) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11289); target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,1,11289); else Index: scripts/globals/items/keen_zaghnal.lua =================================================================== --- scripts/globals/items/keen_zaghnal.lua (revision 1825) +++ scripts/globals/items/keen_zaghnal.lua (working copy) @@ -13,7 +13,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(0) ~= 18067) then + if (target:getEquipID(SLOT_MAIN) ~= 18067) then target:delStatusEffect(EFFECT_ACCURACY_BOOST,18067); end return 0; Index: scripts/globals/items/kushas_ring.lua =================================================================== --- scripts/globals/items/kushas_ring.lua (revision 1825) +++ scripts/globals/items/kushas_ring.lua (working copy) @@ -13,8 +13,8 @@ function onItemCheck(target) -ring1 = target:getEquipID(13); -ring2 = target:getEquipID(14); +ring1 = target:getEquipID(SLOT_RING1); +ring2 = target:getEquipID(SLOT_RING2); if ((ring1 == 15851 and ring2 == 15850) or (ring1 == 15850 and ring2 == 15851)) then Index: scripts/globals/items/lavas_ring.lua =================================================================== --- scripts/globals/items/lavas_ring.lua (revision 1825) +++ scripts/globals/items/lavas_ring.lua (working copy) @@ -13,8 +13,8 @@ function onItemCheck(target) -ring1 = target:getEquipID(13); -ring2 = target:getEquipID(14); +ring1 = target:getEquipID(SLOT_RING1); +ring2 = target:getEquipID(SLOT_RING2); if ((ring1 == 15851 and ring2 == 15850) or (ring1 == 15850 and ring2 == 15851)) then Index: scripts/globals/items/marduks_dastanas.lua =================================================================== --- scripts/globals/items/marduks_dastanas.lua (revision 1825) +++ scripts/globals/items/marduks_dastanas.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(6) == 14973) then + if (target:getEquipID(SLOT_HANDS) == 14973) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,14973); else target:delStatusEffect(EFFECT_AUTO_REGEN,14973); Index: scripts/globals/items/marduks_jubbah.lua =================================================================== --- scripts/globals/items/marduks_jubbah.lua (revision 1825) +++ scripts/globals/items/marduks_jubbah.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14558) then + if (target:getEquipID(SLOT_BODY) == 14558) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,14558); else target:delStatusEffect(EFFECT_AUTO_REFRESH,14558); Index: scripts/globals/items/mavi_mintan_+2.lua =================================================================== --- scripts/globals/items/mavi_mintan_+2.lua (revision 1825) +++ scripts/globals/items/mavi_mintan_+2.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 11099) then + if (target:getEquipID(SLOT_BODY) == 11099) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11099); else target:delStatusEffect(EFFECT_AUTO_REFRESH,11099); Index: scripts/globals/items/melee_cyclas.lua =================================================================== --- scripts/globals/items/melee_cyclas.lua (revision 1825) +++ scripts/globals/items/melee_cyclas.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 15088) then + if (target:getEquipID(SLOT_BODY) == 15088) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,15088); else target:delStatusEffect(EFFECT_AUTO_REGEN,15088); Index: scripts/globals/items/melee_cyclas_+1.lua =================================================================== --- scripts/globals/items/melee_cyclas_+1.lua (revision 1825) +++ scripts/globals/items/melee_cyclas_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14501) then + if (target:getEquipID(SLOT_BODY) == 14501) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,14501); else target:delStatusEffect(EFFECT_AUTO_REGEN,14501); Index: scripts/globals/items/melee_cyclas_+2.lua =================================================================== --- scripts/globals/items/melee_cyclas_+2.lua (revision 1825) +++ scripts/globals/items/melee_cyclas_+2.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 10671) then + if (target:getEquipID(SLOT_BODY) == 10671) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,10671); else target:delStatusEffect(EFFECT_AUTO_REGEN,10671); Index: scripts/globals/items/mercenarys_earring.lua =================================================================== --- scripts/globals/items/mercenarys_earring.lua (revision 1825) +++ scripts/globals/items/mercenarys_earring.lua (working copy) @@ -15,8 +15,8 @@ sjob = target:getSubJob(); -earring1 = target:getEquipID(11); -earring2 = target:getEquipID(12); +earring1 = target:getEquipID(SLOT_EAR1); +earring2 = target:getEquipID(SLOT_EAR2); if ((earring1 == 13435 or earring2 == 13435)) then if (sjob == 1) then Index: scripts/globals/items/mirage_jubbah.lua =================================================================== --- scripts/globals/items/mirage_jubbah.lua (revision 1825) +++ scripts/globals/items/mirage_jubbah.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 11292) then + if (target:getEquipID(SLOT_BODY) == 11292) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11292); else target:delStatusEffect(EFFECT_AUTO_REFRESH,11292); Index: scripts/globals/items/mirage_jubbah_+1.lua =================================================================== --- scripts/globals/items/mirage_jubbah_+1.lua (revision 1825) +++ scripts/globals/items/mirage_jubbah_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 11293) then + if (target:getEquipID(SLOT_BODY) == 11293) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11293); else target:delStatusEffect(EFFECT_AUTO_REFRESH,11293); Index: scripts/globals/items/mirage_jubbah_+2.lua =================================================================== --- scripts/globals/items/mirage_jubbah_+2.lua (revision 1825) +++ scripts/globals/items/mirage_jubbah_+2.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 10685) then + if (target:getEquipID(SLOT_BODY) == 10685) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,10685); else target:delStatusEffect(EFFECT_AUTO_REFRESH,10685); Index: scripts/globals/items/morrigans_robe.lua =================================================================== --- scripts/globals/items/morrigans_robe.lua (revision 1825) +++ scripts/globals/items/morrigans_robe.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14562) then + if (target:getEquipID(SLOT_BODY) == 14562) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,14562); else target:delStatusEffect(EFFECT_AUTO_REFRESH,14562); Index: scripts/globals/items/muscle_belt.lua =================================================================== --- scripts/globals/items/muscle_belt.lua (revision 1825) +++ scripts/globals/items/muscle_belt.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - sItem = target:getEquipID(10); + sItem = target:getEquipID(SLOT_WAIST); FiftyPercent = ((target:getMaxHP())*(1/2)); currentHP = target:getHP(); @@ -34,7 +34,7 @@ ----------------------------------- function onEffectTick(target,effect) - sItem = target:getEquipID(10); + sItem = target:getEquipID(SLOT_WAIST); currentHP = target:getHP(); FiftyPercent = ((target:getMaxHP())*(1/2)); Index: scripts/globals/items/muscle_belt_+1.lua =================================================================== --- scripts/globals/items/muscle_belt_+1.lua (revision 1825) +++ scripts/globals/items/muscle_belt_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - sItem = target:getEquipID(10); + sItem = target:getEquipID(SLOT_WAIST); FiftyPercent = ((target:getMaxHP())*(1/2)); currentHP = target:getHP(); @@ -35,7 +35,7 @@ ----------------------------------- function onEffectTick(target,effect) - sItem = target:getEquipID(10); + sItem = target:getEquipID(SLOT_WAIST); currentHP = target:getHP(); FiftyPercent = ((target:getMaxHP())*(1/2)); Index: scripts/globals/items/nimbus_doublet.lua =================================================================== --- scripts/globals/items/nimbus_doublet.lua (revision 1825) +++ scripts/globals/items/nimbus_doublet.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14410) then + if (target:getEquipID(SLOT_BODY) == 14410) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,14410); else target:delStatusEffect(EFFECT_AUTO_REGEN,14410); Index: scripts/globals/items/nobles_tunic.lua =================================================================== --- scripts/globals/items/nobles_tunic.lua (revision 1825) +++ scripts/globals/items/nobles_tunic.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 12605) then + if (target:getEquipID(SLOT_BODY) == 12605) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,12605); else target:delStatusEffect(EFFECT_AUTO_REFRESH,12605); Index: scripts/globals/items/ocelomeh_headpiece.lua =================================================================== --- scripts/globals/items/ocelomeh_headpiece.lua (revision 1825) +++ scripts/globals/items/ocelomeh_headpiece.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(1) == 10864) then + if (target:getEquipID(SLOT_HEAD) == 10864) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,10864); else target:delStatusEffect(EFFECT_AUTO_REGEN,10864); Index: scripts/globals/items/ocelomeh_headpiece_+1.lua =================================================================== --- scripts/globals/items/ocelomeh_headpiece_+1.lua (revision 1825) +++ scripts/globals/items/ocelomeh_headpiece_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(4) == 10867) then + if (target:getEquipID(SLOT_HEAD) == 10867) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,10867); else target:delStatusEffect(EFFECT_AUTO_REGEN,10867); Index: scripts/globals/items/oneiros_grip.lua =================================================================== --- scripts/globals/items/oneiros_grip.lua (revision 1825) +++ scripts/globals/items/oneiros_grip.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(1) == 18811) then + if (target:getEquipID(SLOT_SUB) == 18811) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,18811); else target:delStatusEffect(EFFECT_AUTO_REGEN,18811); Index: scripts/globals/items/oneiros_harp.lua =================================================================== --- scripts/globals/items/oneiros_harp.lua (revision 1825) +++ scripts/globals/items/oneiros_harp.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(2) == 17358) then + if (target:getEquipID(SLOT_RANGED) == 17358) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,17358); else target:delStatusEffect(EFFECT_AUTO_REGEN,17358); Index: scripts/globals/items/orison_bliaud_+1.lua =================================================================== --- scripts/globals/items/orison_bliaud_+1.lua (revision 1825) +++ scripts/globals/items/orison_bliaud_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 11186) then + if (target:getEquipID(SLOT_BODY) == 11186) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11186); else target:delStatusEffect(EFFECT_AUTO_REFRESH,11186); Index: scripts/globals/items/orochi_nodowa.lua =================================================================== --- scripts/globals/items/orochi_nodowa.lua (revision 1825) +++ scripts/globals/items/orochi_nodowa.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(9) == 15539) then + if (target:getEquipID(SLOT_NECK) == 15539) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,15539); else target:delStatusEffect(EFFECT_AUTO_REGEN,15539); Index: scripts/globals/items/orochi_nodowa_+1.lua =================================================================== --- scripts/globals/items/orochi_nodowa_+1.lua (revision 1825) +++ scripts/globals/items/orochi_nodowa_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(9) == 15540) then + if (target:getEquipID(SLOT_NECK) == 15540) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,15540); else target:delStatusEffect(EFFECT_AUTO_REGEN,15540); Index: scripts/globals/items/owleyes.lua =================================================================== --- scripts/globals/items/owleyes.lua (revision 1825) +++ scripts/globals/items/owleyes.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(0) == 17113) then + if (target:getEquipID(SLOT_MAIN) == 17113) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,17113); else target:delStatusEffect(EFFECT_AUTO_REFRESH,17113); Index: scripts/globals/items/pantin_taj.lua =================================================================== --- scripts/globals/items/pantin_taj.lua (revision 1825) +++ scripts/globals/items/pantin_taj.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(4) == 11471) then + if (target:getEquipID(SLOT_HEAD) == 11471) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,11471); else target:delStatusEffect(EFFECT_AUTO_REGEN,11471); Index: scripts/globals/items/pantin_taj_+1.lua =================================================================== --- scripts/globals/items/pantin_taj_+1.lua (revision 1825) +++ scripts/globals/items/pantin_taj_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(4) == 11472) then + if (target:getEquipID(SLOT_HEAD) == 11472) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,11472); else target:delStatusEffect(EFFECT_AUTO_REGEN,11472); Index: scripts/globals/items/pantin_taj_+2.lua =================================================================== --- scripts/globals/items/pantin_taj_+2.lua (revision 1825) +++ scripts/globals/items/pantin_taj_+2.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(4) == 10667) then + if (target:getEquipID(SLOT_HEAD) == 10667) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,10667); else target:delStatusEffect(EFFECT_AUTO_REGEN,10667); Index: scripts/globals/items/plastron.lua =================================================================== --- scripts/globals/items/plastron.lua (revision 1825) +++ scripts/globals/items/plastron.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14382) then + if (target:getEquipID(SLOT_BODY) == 14382) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,14382); else target:delStatusEffect(EFFECT_AUTO_REFRESH,14382); Index: scripts/globals/items/plastron_+1.lua =================================================================== --- scripts/globals/items/plastron_+1.lua (revision 1825) +++ scripts/globals/items/plastron_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14383) then + if (target:getEquipID(SLOT_BODY) == 14383) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,14383); else target:delStatusEffect(EFFECT_AUTO_REFRESH,14383); Index: scripts/globals/items/pluviale.lua =================================================================== --- scripts/globals/items/pluviale.lua (revision 1825) +++ scripts/globals/items/pluviale.lua (working copy) @@ -12,7 +12,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 11361) then + if (target:getEquipID(SLOT_BODY) == 11361) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11361); target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,11361); else Index: scripts/globals/items/ramblers_cloak.lua =================================================================== --- scripts/globals/items/ramblers_cloak.lua (revision 1825) +++ scripts/globals/items/ramblers_cloak.lua (working copy) @@ -15,7 +15,7 @@ function onItemCheck(target) TP = target:getTP(); - body = target:getEquipID(5); + body = target:getEquipID(SLOT_BODY); if(body == 11312) then if (TP >= 100) then Index: scripts/globals/items/rossignol.lua =================================================================== --- scripts/globals/items/rossignol.lua (revision 1825) +++ scripts/globals/items/rossignol.lua (working copy) @@ -12,7 +12,7 @@ function onItemCheck(target, totd) -main = target:getEquipID(0); +main = target:getEquipID(SLOT_MAIN); if (main == 18075) then if (VanadielTOTD() ~= 3) then Index: scripts/globals/items/royal_cloak.lua =================================================================== --- scripts/globals/items/royal_cloak.lua (revision 1825) +++ scripts/globals/items/royal_cloak.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 13749) then + if (target:getEquipID(SLOT_BODY) == 13749) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,13749); else target:delStatusEffect(EFFECT_AUTO_REFRESH,13749); Index: scripts/globals/items/savants_gown_+2.lua =================================================================== --- scripts/globals/items/savants_gown_+2.lua (revision 1825) +++ scripts/globals/items/savants_gown_+2.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 11103) then + if (target:getEquipID(SLOT_BODY) == 11103) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11103); else target:delStatusEffect(EFFECT_AUTO_REFRESH,11103); Index: scripts/globals/items/scuta_cape.lua =================================================================== --- scripts/globals/items/scuta_cape.lua (revision 1825) +++ scripts/globals/items/scuta_cape.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(15) == 10970) then + if (target:getEquipID(SLOT_BACK) == 10970) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,10970); else target:delStatusEffect(EFFECT_AUTO_REGEN,10970); Index: scripts/globals/items/shadow_breastplate.lua =================================================================== --- scripts/globals/items/shadow_breastplate.lua (revision 1825) +++ scripts/globals/items/shadow_breastplate.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14573) then + if (target:getEquipID(SLOT_BODY) == 14573) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,14573); else target:delStatusEffect(EFFECT_AUTO_REGEN,14573); Index: scripts/globals/items/snakeeye.lua =================================================================== --- scripts/globals/items/snakeeye.lua (revision 1825) +++ scripts/globals/items/snakeeye.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(2) == 18708) then + if (target:getEquipID(SLOT_RANGED) == 18708) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,18708); else target:delStatusEffect(EFFECT_AUTO_REGEN,18708); Index: scripts/globals/items/snakeeye_+1.lua =================================================================== --- scripts/globals/items/snakeeye_+1.lua (revision 1825) +++ scripts/globals/items/snakeeye_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(2) == 18709) then + if (target:getEquipID(SLOT_RANGED) == 18709) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,18709); else target:delStatusEffect(EFFECT_AUTO_REGEN,18709); Index: scripts/globals/items/sol_cap.lua =================================================================== --- scripts/globals/items/sol_cap.lua (revision 1825) +++ scripts/globals/items/sol_cap.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(4) == 16144) then + if (target:getEquipID(SLOT_HEAD) == 16144) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,16144); else target:delStatusEffect(EFFECT_AUTO_REGEN,16144); Index: scripts/globals/items/sorcerers_coat.lua =================================================================== --- scripts/globals/items/sorcerers_coat.lua (revision 1825) +++ scripts/globals/items/sorcerers_coat.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 15090) then + if (target:getEquipID(SLOT_BODY) == 15090) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,15090); else target:delStatusEffect(EFFECT_AUTO_REFRESH,15090); Index: scripts/globals/items/sorcerers_coat_+1.lua =================================================================== --- scripts/globals/items/sorcerers_coat_+1.lua (revision 1825) +++ scripts/globals/items/sorcerers_coat_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14503) then + if (target:getEquipID(SLOT_BODY) == 14503) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,14503); else target:delStatusEffect(EFFECT_AUTO_REFRESH,14503); Index: scripts/globals/items/sorcerers_coat_+2.lua =================================================================== --- scripts/globals/items/sorcerers_coat_+2.lua (revision 1825) +++ scripts/globals/items/sorcerers_coat_+2.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 10673) then + if (target:getEquipID(SLOT_BODY) == 10673) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,10673); else target:delStatusEffect(EFFECT_AUTO_REFRESH,10673); Index: scripts/globals/items/twilight_cloak.lua =================================================================== --- scripts/globals/items/twilight_cloak.lua (revision 1825) +++ scripts/globals/items/twilight_cloak.lua (working copy) @@ -4,13 +4,15 @@ -- Able to cast "Impact" ----------------------------------------- +require("script/globals/status"); + ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) -body = target:getEquipID(5); +body = target:getEquipID(SLOT_BODY); if (body == 11363) then target:addSpell(503); Index: scripts/globals/items/twilight_helm.lua =================================================================== --- scripts/globals/items/twilight_helm.lua (revision 1825) +++ scripts/globals/items/twilight_helm.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(4) == 11798) then + if (target:getEquipID(SLOT_HEAD) == 11798) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,11798); else target:delStatusEffect(EFFECT_AUTO_REGEN,11798); Index: scripts/globals/items/twilight_mail.lua =================================================================== --- scripts/globals/items/twilight_mail.lua (revision 1825) +++ scripts/globals/items/twilight_mail.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 11362) then + if (target:getEquipID(SLOT_BODY) == 11362) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,11362); else target:delStatusEffect(EFFECT_AUTO_REFRESH,11362); Index: scripts/globals/items/unicorn_harness.lua =================================================================== --- scripts/globals/items/unicorn_harness.lua (revision 1825) +++ scripts/globals/items/unicorn_harness.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14448) then + if (target:getEquipID(SLOT_BODY) == 14448) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,14448); else target:delStatusEffect(EFFECT_AUTO_REGEN,14448); Index: scripts/globals/items/unicorn_harness_+1.lua =================================================================== --- scripts/globals/items/unicorn_harness_+1.lua (revision 1825) +++ scripts/globals/items/unicorn_harness_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14449) then + if (target:getEquipID(SLOT_BODY) == 14449) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,14449); else target:delStatusEffect(EFFECT_AUTO_REGEN,14449); Index: scripts/globals/items/valkyries_breastplate.lua =================================================================== --- scripts/globals/items/valkyries_breastplate.lua (revision 1825) +++ scripts/globals/items/valkyries_breastplate.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14574) then + if (target:getEquipID(SLOT_BODY) == 14574) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,14574); else target:delStatusEffect(EFFECT_AUTO_REGEN,14574); Index: scripts/globals/items/vermillion_cloak.lua =================================================================== --- scripts/globals/items/vermillion_cloak.lua (revision 1825) +++ scripts/globals/items/vermillion_cloak.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 13748) then + if (target:getEquipID(SLOT_BODY) == 13748) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,13748); else target:delStatusEffect(EFFECT_AUTO_REFRESH,13748); Index: scripts/globals/items/war_shinobi_gi.lua =================================================================== --- scripts/globals/items/war_shinobi_gi.lua (revision 1825) +++ scripts/globals/items/war_shinobi_gi.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 12617) then + if (target:getEquipID(SLOT_BODY) == 12617) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,12617); else target:delStatusEffect(EFFECT_AUTO_REGEN,12617); Index: scripts/globals/items/war_shinobi_gi_+1.lua =================================================================== --- scripts/globals/items/war_shinobi_gi_+1.lua (revision 1825) +++ scripts/globals/items/war_shinobi_gi_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 13770) then + if (target:getEquipID(SLOT_BODY) == 13770) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,13770); else target:delStatusEffect(EFFECT_AUTO_REGEN,13770); Index: scripts/globals/items/wiglen_gorget.lua =================================================================== --- scripts/globals/items/wiglen_gorget.lua (revision 1825) +++ scripts/globals/items/wiglen_gorget.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(9) == 10936) then + if (target:getEquipID(SLOT_NECK) == 10936) then target:addStatusEffectEx(EFFECT_AUTO_REGEN,0,1,3,0,10936); else target:delStatusEffect(EFFECT_AUTO_REGEN,10936); Index: scripts/globals/items/yhel_jacket.lua =================================================================== --- scripts/globals/items/yhel_jacket.lua (revision 1825) +++ scripts/globals/items/yhel_jacket.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14364) then + if (target:getEquipID(SLOT_BODY) == 14364) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,14364); else target:delStatusEffect(EFFECT_AUTO_REFRESH,14364); Index: scripts/globals/items/yhel_jacket_+1.lua =================================================================== --- scripts/globals/items/yhel_jacket_+1.lua (revision 1825) +++ scripts/globals/items/yhel_jacket_+1.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 12623) then + if (target:getEquipID(SLOT_BODY) == 12623) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,12623); else target:delStatusEffect(EFFECT_AUTO_REFRESH,12623); Index: scripts/globals/items/yinyang_robe.lua =================================================================== --- scripts/globals/items/yinyang_robe.lua (revision 1825) +++ scripts/globals/items/yinyang_robe.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------------- function onItemCheck(target) - if (target:getEquipID(5) == 14468) then + if (target:getEquipID(SLOT_BODY) == 14468) then target:addStatusEffectEx(EFFECT_AUTO_REFRESH,0,1,3,0,14468); else target:delStatusEffect(EFFECT_AUTO_REFRESH,14468); Index: scripts/globals/logging.lua =================================================================== --- scripts/globals/logging.lua (revision 1825) +++ scripts/globals/logging.lua (working copy) @@ -6,6 +6,7 @@ ------------------------------------------------- require("scripts/globals/settings"); +require("scripts/globals/status"); ------------------------------------------------- -- npcid and drop by zone @@ -88,9 +89,9 @@ -- Begin Gear Bonus -------------------- - Body = player:getEquipID(6); - Hands = player:getEquipID(7); - Legs = player:getEquipID(8); + Body = player:getEquipID(SLOT_BODY); + Hands = player:getEquipID(SLOT_HANDS); + Legs = player:getEquipID(SLOT_LEGS); if(Body == 14374 or Body == 14375) then hatchetbreak = hatchetbreak + 0.073; Index: scripts/globals/magic.lua =================================================================== --- scripts/globals/magic.lua (revision 1825) +++ scripts/globals/magic.lua (working copy) @@ -140,22 +140,22 @@ ----------------------------------- function curePotency(caster) c = 0; -main = caster:getEquipID(1); -sub = caster:getEquipID(2); -range = caster:getEquipID(3); -ammo = caster:getEquipID(4); -head = caster:getEquipID(5); -body = caster:getEquipID(6); -hand = caster:getEquipID(7); -leg = caster:getEquipID(8); -foot = caster:getEquipID(9); -neck = caster:getEquipID(10); -waist = caster:getEquipID(11); -ear1 = caster:getEquipID(12); -ear2 = caster:getEquipID(13); -ring1 = caster:getEquipID(14); -ring2 = caster:getEquipID(15); -back = caster:getEquipID(16); +main = caster:getEquipID(SLOT_MAIN); +sub = caster:getEquipID(SLOT_SUB); +range = caster:getEquipID(SLOT_RANGED); +ammo = caster:getEquipID(SLOT_AMMO); +head = caster:getEquipID(SLOT_HEAD); +body = caster:getEquipID(SLOT_BODY); +hand = caster:getEquipID(SLOT_HANDS); +leg = caster:getEquipID(SLOT_LEGS); +foot = caster:getEquipID(SLOT_FEET); +neck = caster:getEquipID(SLOT_NECK); +waist = caster:getEquipID(SLOT_WAIST); +ear1 = caster:getEquipID(SLOT_EAR1); +ear2 = caster:getEquipID(SLOT_EAR2); +ring1 = caster:getEquipID(SLOT_RING1); +ring2 = caster:getEquipID(SLOT_RING2); +back = caster:getEquipID(SLOT_BACK); if (main == 0x443a or sub == 0x443a) then c = (c+0.01); @@ -475,9 +475,9 @@ end function calculateMagicBurstAndBonus(caster, spell, target) - local hand = caster:getEquipID(7); - local ear1 = caster:getEquipID(12); - local ear2 = caster:getEquipID(13); + local hand = caster:getEquipID(SLOT_HANDS); + local ear1 = caster:getEquipID(SLOT_EAR1); + local ear2 = caster:getEquipID(SLOT_EAR2); local burst = 1.0; local burstBonus = 1.0; @@ -547,19 +547,19 @@ dayWeatherBonus = 1.00; if caster:getWeather() == singleWeatherStrong[ele] then - if math.random() < 0.33 or caster:getEquipID(10) == elementalObi[ele] then + if math.random() < 0.33 or caster:getEquipID(SLOT_WAIST) == elementalObi[ele] then dayWeatherBonus = dayWeatherBonus + 0.10; end elseif caster:getWeather() == singleWeatherWeak[ele] then - if math.random() < 0.33 or caster:getEquipID(10) == elementalObiWeak[ele] then + if math.random() < 0.33 or caster:getEquipID(SLOT_WAIST) == elementalObiWeak[ele] then dayWeatherBonus = dayWeatherBonus - 0.10; end elseif caster:getWeather() == doubleWeatherStrong[ele] then - if math.random() < 0.33 or caster:getEquipID(10) == elementalObi[ele] then + if math.random() < 0.33 or caster:getEquipID(SLOT_WAIST) == elementalObi[ele] then dayWeatherBonus = dayWeatherBonus + 0.25; end elseif caster:getWeather() == doubleWeatherWeak[ele] then - if math.random() < 0.33 or caster:getEquipID(10) == elementalObiWeak[ele] then + if math.random() < 0.33 or caster:getEquipID(SLOT_WAIST) == elementalObiWeak[ele] then dayWeatherBonus = dayWeatherBonus - 0.25; end end @@ -569,11 +569,11 @@ if legs == 15120 or legs == 15583 then dayWeatherBonus = dayWeatherBonus + 0.05; end - if math.random() < 0.33 or caster:getEquipID(10) == elementalObi[ele] then + if math.random() < 0.33 or caster:getEquipID(SLOT_WAIST) == elementalObi[ele] then dayWeatherBonus = dayWeatherBonus + 0.10; end elseif VanadielDayElement() == dayWeak[ele] then - if math.random() < 0.33 or caster:getEquipID(10) == elementalObiWeak[ele] then + if math.random() < 0.33 or caster:getEquipID(SLOT_WAIST) == elementalObiWeak[ele] then dayWeatherBonus = dayWeatherBonus + 0.10; end end Index: scripts/globals/mining.lua =================================================================== --- scripts/globals/mining.lua (revision 1825) +++ scripts/globals/mining.lua (working copy) @@ -6,6 +6,7 @@ ------------------------------------------------- require("scripts/globals/settings"); +require("scripts/globals/status"); ------------------------------------------------- -- npcid and drop by zone @@ -82,9 +83,9 @@ -- Begin Gear Bonus -------------------- - Body = player:getEquipID(6); - Hands = player:getEquipID(7); - Feet = player:getEquipID(9); + Body = player:getEquipID(SLOT_BODY); + Hands = player:getEquipID(SLOT_HANDS); + Feet = player:getEquipID(SLOT_FEET); if(Body == 14374 or Body == 14375) then pickaxebreak = pickaxebreak + 0.073; Index: scripts/globals/mobs.lua =================================================================== --- scripts/globals/mobs.lua (revision 1825) +++ scripts/globals/mobs.lua (working copy) @@ -9,6 +9,7 @@ require("scripts/globals/quests"); require("scripts/globals/missions"); require("scripts/globals/conquest"); +require("scripts/globals/status"); ----------------------------------- -- @@ -17,7 +18,7 @@ function onMobDeathEx(mob,killer) -- DRK quest - Blade Of Darkness - if(killer:getEquipID(0) == 16607) then + if(killer:getEquipID(SLOT_MAIN) == 16607) then local SwordKills = killer:getVar("Blade_of_Darkness_SwordKills"); if(SwordKills < 200) then killer:setVar("Blade_of_Darkness_SwordKills", SwordKills + 1); Index: scripts/globals/monstertpmoves.lua =================================================================== --- scripts/globals/monstertpmoves.lua (revision 1825) +++ scripts/globals/monstertpmoves.lua (working copy) @@ -385,29 +385,29 @@ dayWeatherBonus = 1.00; if caster:getWeather() == singleWeatherStrong[ele] then - if math.random() < 0.33 or caster:getEquipID(10) == elementalObi[ele] then + if math.random() < 0.33 or caster:getEquipID(SLOT_WAIST) == elementalObi[ele] then dayWeatherBonus = dayWeatherBonus + 0.10; end elseif caster:getWeather() == singleWeatherWeak[ele] then - if math.random() < 0.33 or caster:getEquipID(10) == elementalObiWeak[ele] then + if math.random() < 0.33 or caster:getEquipID(SLOT_WAIST) == elementalObiWeak[ele] then dayWeatherBonus = dayWeatherBonus - 0.10; end elseif caster:getWeather() == doubleWeatherStrong[ele] then - if math.random() < 0.33 or caster:getEquipID(10) == elementalObi[ele] then + if math.random() < 0.33 or caster:getEquipID(SLOT_WAIST) == elementalObi[ele] then dayWeatherBonus = dayWeatherBonus + 0.25; end elseif caster:getWeather() == doubleWeatherWeak[ele] then - if math.random() < 0.33 or caster:getEquipID(10) == elementalObiWeak[ele] then + if math.random() < 0.33 or caster:getEquipID(SLOT_WAIST) == elementalObiWeak[ele] then dayWeatherBonus = dayWeatherBonus - 0.25; end end if VanadielDayElement() == dayStrong[ele] then - if math.random() < 0.33 or caster:getEquipID(10) == elementalObi[ele] then + if math.random() < 0.33 or caster:getEquipID(SLOT_WAIST) == elementalObi[ele] then dayWeatherBonus = dayWeatherBonus + 0.10; end elseif VanadielDayElement() == dayWeak[ele] then - if math.random() < 0.33 or caster:getEquipID(10) == elementalObiWeak[ele] then + if math.random() < 0.33 or caster:getEquipID(SLOT_WAIST) == elementalObiWeak[ele] then dayWeatherBonus = dayWeatherBonus + 0.10; end end Index: scripts/globals/spells/invisible.lua =================================================================== --- scripts/globals/spells/invisible.lua (revision 1825) +++ scripts/globals/spells/invisible.lua (working copy) @@ -4,6 +4,7 @@ -- Duration is random number between 30 seconds and 5 minutes ----------------------------------------- +require("scripts/globals/settings"); require("scripts/globals/status"); ----------------------------------------- @@ -13,9 +14,9 @@ function onSpellCast(caster,target,spell) if (target:hasStatusEffect(EFFECT_INVISIBLE) == false) then + local duration = math.random(30, 300); duration = math.random(30, 300); duration = math.random(30, 300); - duration = math.random(30, 300); if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; @@ -29,7 +30,7 @@ end spell:setMsg(0); - target:addStatusEffect(EFFECT_INVISIBLE,0,10,math.floor(duration)); + target:addStatusEffect(EFFECT_INVISIBLE,0,10,(math.floor(duration) * SNEAK_INVIS_DURATION_MULTIPLIER)); else spell:setMsg(75); -- no effect. end Index: scripts/globals/spells/regen.lua =================================================================== --- scripts/globals/spells/regen.lua (revision 1825) +++ scripts/globals/spells/regen.lua (working copy) @@ -17,7 +17,7 @@ hp = 5; - body = caster:getEquipID(5); + body = caster:getEquipID(SLOT_BODY); if (body == 15089 or body == 14502) then hp = hp+1; end Index: scripts/globals/spells/regen_ii.lua =================================================================== --- scripts/globals/spells/regen_ii.lua (revision 1825) +++ scripts/globals/spells/regen_ii.lua (working copy) @@ -17,7 +17,7 @@ hp = 12; - body = caster:getEquipID(5); + body = caster:getEquipID(SLOT_BODY); if (body == 15089 or body == 14502) then hp = hp+2; end Index: scripts/globals/spells/regen_iii.lua =================================================================== --- scripts/globals/spells/regen_iii.lua (revision 1825) +++ scripts/globals/spells/regen_iii.lua (working copy) @@ -17,7 +17,7 @@ hp = 20; - body = caster:getEquipID(5); + body = caster:getEquipID(SLOT_BODY); if (body == 15089 or body == 14502) then hp = hp+3; end Index: scripts/globals/spells/sneak.lua =================================================================== --- scripts/globals/spells/sneak.lua (revision 1825) +++ scripts/globals/spells/sneak.lua (working copy) @@ -4,6 +4,7 @@ -- Duration is random number between 30 seconds and 5 minutes ----------------------------------------- +require("scripts/globals/settings"); require("scripts/globals/status"); ----------------------------------------- @@ -13,9 +14,9 @@ function onSpellCast(caster,target,spell) if (target:hasStatusEffect(EFFECT_SNEAK) == false) then + local duration = math.random(30, 300); duration = math.random(30, 300); duration = math.random(30, 300); - duration = math.random(30, 300); if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; end @@ -23,11 +24,11 @@ if (target:getMainLvl() < 20) then duration = duration * target:getMainLvl() / 20; -- level adjustment end - if (target:getEquipID(15) == 13692) then -- skulker's cape + if (target:getEquipID(SLOT_BACK) == 13692) then -- skulker's cape duration = duration * 1.5; end spell:setMsg(0); - target:addStatusEffect(EFFECT_SNEAK,0,10,math.floor(duration)); + target:addStatusEffect(EFFECT_SNEAK,0,10,(math.floor(duration) * SNEAK_INVIS_DURATION_MULTIPLIER)); else spell:setMsg(75); -- no effect. end Index: scripts/globals/spells/stoneskin.lua =================================================================== --- scripts/globals/spells/stoneskin.lua (revision 1825) +++ scripts/globals/spells/stoneskin.lua (working copy) @@ -28,16 +28,16 @@ pAbs = 350; end -- equipment mods - if (caster:getEquipID(9) == 13177) then -- stone gorget + if (caster:getEquipID(SLOT_NECK) == 13177) then -- stone gorget pEquipMods = pEquipMods + 30; end - if (caster:getEquipID(6) == 15034) then -- stone mufflers + if (caster:getEquipID(SLOT_HANDS) == 15034) then -- stone mufflers pEquipMods = pEquipMods + 30; end - if (caster:getEquipID(10) == 15960) then -- siegel sash + if (caster:getEquipID(SLOT_WAIST) == 15960) then -- siegel sash pEquipMods = pEquipMods + 20; end - if (caster:getEquipID(7) == 11949) then -- haven hose + if (caster:getEquipID(SLOT_LEGS) == 11949) then -- haven hose pEquipMods = pEquipMods + 20; end Index: scripts/globals/status.lua =================================================================== --- scripts/globals/status.lua (revision 1825) +++ scripts/globals/status.lua (working copy) @@ -738,4 +738,25 @@ MOD_THUNDER_AFFINITY = 0x15F MOD_WIND_AFFINITY = 0x160 MOD_LIGHT_AFFINITY = 0x161 -MOD_DARK_AFFINITY = 0x162 \ No newline at end of file +MOD_DARK_AFFINITY = 0x162 + +----------------------------------- +-- Slot Definitions +----------------------------------- + +SLOT_MAIN = 0 +SLOT_SUB = 1 +SLOT_RANGED = 2 +SLOT_AMMO = 3 +SLOT_HEAD = 4 +SLOT_BODY = 5 +SLOT_HANDS = 6 +SLOT_LEGS = 7 +SLOT_FEET = 8 +SLOT_NECK = 9 +SLOT_WAIST = 10 +SLOT_EAR1 = 11 +SLOT_EAR2 = 12 +SLOT_RING1 = 13 +SLOT_RING2 = 14 +SLOT_BACK = 15 \ No newline at end of file Index: scripts/globals/weaponskills.lua =================================================================== --- scripts/globals/weaponskills.lua (revision 1825) +++ scripts/globals/weaponskills.lua (working copy) @@ -8,6 +8,7 @@ -- applications of accuracy mods ('Accuracy varies with TP.') -- applications of damage mods ('Damage varies with TP.') -- performance of the actual WS (rand numbers, etc) +require("scripts/globals/status"); function doPhysicalWeaponskill(attacker,target, numHits, str_wsc,dex_wsc,vit_wsc,agi_wsc,int_wsc,mnd_wsc,chr_wsc, canCrit,crit100,crit200,crit300, acc100,acc200,acc300, atkmulti) @@ -157,7 +158,7 @@ -- print("Landed " .. hitslanded .. "/" .. numHits .. " hits with hitrate " .. hitrate .. "!"); if attacker:hasStatusEffect(EFFECT_SOULEATER) and attacker:getHP() > 10 then local percent = 0.1; - if attacker:getEquipID(4) == 12516 or attacker:getEquipID(4) == 15232 or attacker:getEquipID(5) == 14409 or attacker:getEquipID(7) == 15370 then + if attacker:getEquipID(SLOT_HEAD) == 12516 or attacker:getEquipID(SLOT_HEAD) == 15232 or attacker:getEquipID(SLOT_BODY) == 14409 or attacker:getEquipID(SLOT_LEGS) == 15370 then percent = 0.12; end attacker:delHP((tpHitsLanded+extraHitsLanded)*percent*attacker:getHP()); @@ -170,7 +171,7 @@ local health = attacker:getHP(); if health > 10 then local percent = 0.1; - if attacker:getEquipID(4) == 12516 or attacker:getEquipID(4) == 15232 or attacker:getEquipID(5) == 14409 or attacker:getEquipID(7) == 15370 then + if attacker:getEquipID(SLOT_HEAD) == 12516 or attacker:getEquipID(SLOT_HEAD) == 15232 or attacker:getEquipID(SLOT_BODY) == 14409 or attacker:getEquipID(SLOT_LEGS) == 15370 then percent = 0.12; end return health*percent; Index: scripts/globals/weaponskills/tornado_kick.lua =================================================================== --- scripts/globals/weaponskills/tornado_kick.lua (revision 1825) +++ scripts/globals/weaponskills/tornado_kick.lua (working copy) @@ -9,9 +9,10 @@ -- Delivers a twofold attack. Damage varies with TP. ------------------------------- -require("/scripts/globals/settings"); -require("/scripts/globals/weaponskills"); +require("scripts/globals/settings"); +require("scripts/globals/status"); require("scripts/globals/weaponskills"); + function OnUseWeaponSkill(attacker, target, wsID) --number of normal hits for ws @@ -42,7 +43,7 @@ damage = damage + 18; end - if( attacker:getEquipID(8) == 14128 ) then + if( attacker:getEquipID(SLOT_FEET) == 14128 ) then damage =damage + 25; end Index: scripts/zones/Bastok_Markets/npcs/Brygid.lua =================================================================== --- scripts/zones/Bastok_Markets/npcs/Brygid.lua (revision 1825) +++ scripts/zones/Bastok_Markets/npcs/Brygid.lua (working copy) @@ -10,6 +10,7 @@ ----------------------------------- require("scripts/globals/settings"); +require("scripts/globals/status"); require("scripts/globals/keyitems"); require("scripts/globals/titles"); require("scripts/globals/quests"); @@ -39,8 +40,8 @@ function onTrigger(player,npc) BrygidTheStylist = player:getQuestStatus(BASTOK,BRYGID_THE_STYLIST); - body = player:getEquipID(0x05); - legs = player:getEquipID(0x07); + body = player:getEquipID(SLOT_BODY); + legs = player:getEquipID(SLOT_LEGS); if(BrygidTheStylist == QUEST_ACCEPTED and body == 12600 and legs == 12832) then player:startEvent(0x0137); Index: scripts/zones/North_Gustaberg/npcs/qm1.lua =================================================================== --- scripts/zones/North_Gustaberg/npcs/qm1.lua (revision 1825) +++ scripts/zones/North_Gustaberg/npcs/qm1.lua (working copy) @@ -9,6 +9,7 @@ package.loaded["scripts/zones/North_Gustaberg/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/status"); require("scripts/globals/quests"); require("scripts/zones/North_Gustaberg/TextIDs"); @@ -51,8 +52,8 @@ if (csid == 0x000a and option == 0) then - mainweapon = player:getEquipID(0x00); - subweapon = player:getEquipID(0x01); + mainweapon = player:getEquipID(SLOT_MAIN); + subweapon = player:getEquipID(SLOT_SUB); currentJob = player:getMainJob(); if (mainweapon == 0 and subweapon == 0 and currentJob ~= 3) then Index: scripts/zones/Port_Bastok/npcs/Bartolomeo.lua =================================================================== --- scripts/zones/Port_Bastok/npcs/Bartolomeo.lua (revision 1825) +++ scripts/zones/Port_Bastok/npcs/Bartolomeo.lua (working copy) @@ -7,6 +7,7 @@ package.loaded["scripts/zones/Port_Bastok/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/status"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); require("scripts/zones/Port_Bastok/TextIDs"); @@ -26,7 +27,7 @@ WelcometoBastok = player:getQuestStatus(BASTOK,WELCOME_TO_BASTOK); - if (WelcometoBastok == QUEST_ACCEPTED and player:getVar("WelcometoBastok_Event") ~= 1 and player:getEquipID(1) == 12415) then -- Shell Shield + if (WelcometoBastok == QUEST_ACCEPTED and player:getVar("WelcometoBastok_Event") ~= 1 and player:getEquipID(SLOT_SUB) == 12415) then -- Shell Shield player:startEvent(0x0034); else player:startEvent(0x008c); Index: scripts/zones/Port_Bastok/npcs/Steel_Bones.lua =================================================================== --- scripts/zones/Port_Bastok/npcs/Steel_Bones.lua (revision 1825) +++ scripts/zones/Port_Bastok/npcs/Steel_Bones.lua (working copy) @@ -7,6 +7,7 @@ package.loaded["scripts/zones/Port_Bastok/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/status"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); require("scripts/zones/Port_Bastok/TextIDs"); @@ -25,7 +26,7 @@ function onTrigger(player,npc) GuestofHauteur = player:getQuestStatus(BASTOK,GUEST_OF_HAUTEUR); - itemEquipped = player:getEquipID(0); + itemEquipped = player:getEquipID(SLOT_MAIN); if (GuestofHauteur == QUEST_ACCEPTED and player:getVar("GuestofHauteur_Event") ~= 1 and (itemEquipped == 17045 or itemEquipped == 17426)) then -- Maul / Replica Maul player:startEvent(0x39); Index: scripts/zones/Windurst_Waters/npcs/Angelica.lua =================================================================== --- scripts/zones/Windurst_Waters/npcs/Angelica.lua (revision 1825) +++ scripts/zones/Windurst_Waters/npcs/Angelica.lua (working copy) @@ -9,6 +9,7 @@ package.loaded["scripts/zones/Windurst_Waters/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/status"); require("scripts/globals/quests"); require("scripts/globals/settings"); require("scripts/globals/titles"); @@ -53,7 +54,7 @@ elseif (posestatus == QUEST_ACCEPTED) then starttime = player:getVar("QuestAPoseByOtherName_time"); if ((starttime + 600) >= os.time()) then - if (player:getEquipID(5) == player:getVar("QuestAPoseByOtherName_equip")) then + if (player:getEquipID(SLOT_BODY) == player:getVar("QuestAPoseByOtherName_equip")) then player:startEvent(0x0060); ------------------------------------------ QUEST FINISH else player:startEvent(0x005d,0,0,0,player:getVar("QuestAPoseByOtherName_equip"));-- QUEST REMINDER