Index: conf/map_darkstar.conf =================================================================== --- conf/map_darkstar.conf (revision 3304) +++ conf/map_darkstar.conf (working copy) @@ -91,7 +91,57 @@ # 0111 7 Parry, Block, & Guard newstyle_skillups: 7 +#Multiplies the distance that you can engage target. Change to 2 for double the distance. Default is 1. +engage_dist_mod: 2 +#Multiplies the distance that you can cast magic on a target. Change to 2 for double the distance. Default is 1. +magic_dist_mod: 2 + +#Multiplies the distance that you can used ranged attack on a target. Change to 2 for double the distance. Default is 1. +ranged_dist_mod: 2 + +#Set to 1 to disable the delay that happens just after killing a target, or after equipping a weapon. +remove_engage_delay: 1 + +#Set to 1 to allow movement while casting magic. +magic_movement: 1 + +#Increases chance of exp mobs dropping seals or crests. Set from 0 - 60. Default is 0. +seal_crest_bonus: 5 + +#Allows non exp beastman mobs to drop seals and crests. Set to 1 for non exp beastman mobs to drop seals and crests. Default is 0. +always_seal_crest: 0 + +#Adds to the drop rate percentage. Set to 20 to add additional %20 drop rate on items. Default 0. +drop_rate_bonus: 10 + +#Set to 1 to allow all mobs to drop gil. Currently does not display in-game messages for these gil drops. Default is 0. +all_mobs_drop_gil: 0 + +#Multiplies the amount of gil dropped. Default is 1. +gil_bonus: 1 + +#Allows exp chain on any exp mob. Default is 0. +chain_on_easy: 1 + +#Increases the time frame allowed to get an exp chain. Default is 1. +chain_bonus: 3 + +#Allows same skill-up on chance for failures as crafting successes have. Default is 0. +craft_skill_onfail: 1 + +#Increases the chance of getting larger skill-ups while crafting. Set 0 to 100. Default 0. +craft_skillamt: 10 + +#Increases the chance of succeeding at crafting. Set 0 to 100. Default 0. +craft_success: 10 + +#Multiplies the amount of conquest points earned on an exp mob kill. Default is 1. +conquest_bonus: 1 + +notorious_hp_mod: 4.5 +notorious_mp_mod: 4.5 + #Max allowed merits points players can hold # 10 classic # 30 abyssea Index: scripts/globals/abilities/aggressor.lua =================================================================== --- scripts/globals/abilities/aggressor.lua (revision 3304) +++ scripts/globals/abilities/aggressor.lua (working copy) @@ -14,5 +14,10 @@ end; function OnUseAbility(player, target, ability) - player:addStatusEffect(EFFECT_AGGRESSOR,1,0,180); + local body = target:getEquipID(SLOT_BODY); + duration = 180; + if (body == 10670) then -- Warriors Lorica +2 + duration = duration + 10; + end + player:addStatusEffect(EFFECT_AGGRESSOR,1,0,duration); end; \ No newline at end of file Index: scripts/globals/abilities/azure_lore.lua =================================================================== --- scripts/globals/abilities/azure_lore.lua (revision 0) +++ scripts/globals/abilities/azure_lore.lua (working copy) @@ -0,0 +1,18 @@ +----------------------------------- +-- Author: Kegsay +-- Azure Lore +-- Enhances the effect of blue magic spells. +----------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + +function OnUseAbility(player, target, ability) + --print(); + player:addStatusEffect(EFFECT_AZURE_LORE,1,0,30); + target:updateEnmity(player,300,1); +end; \ No newline at end of file Index: scripts/globals/abilities/berserk.lua =================================================================== --- scripts/globals/abilities/berserk.lua (revision 3304) +++ scripts/globals/abilities/berserk.lua (working copy) @@ -14,7 +14,12 @@ end; function OnUseAbility(player, target, ability) - player:addStatusEffect(EFFECT_BERSERK,1,0,180); + local feet = target:getEquipID(SLOT_FEET); + duration = 180; + if (feet == 10730) then -- Warriors Calligae +2 + duration = duration + 10; + end + player:addStatusEffect(EFFECT_BERSERK,1,0,duration); return EFFECT_BERSERK; end; \ No newline at end of file Index: scripts/globals/abilities/blade_bash.lua =================================================================== --- scripts/globals/abilities/blade_bash.lua (revision 0) +++ scripts/globals/abilities/blade_bash.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------- +-- Blade Bash +-- Delivers an attack that can plague the target. Two-handed weapon required. +-- +-- Mainly added for enmity, but will also do damage. +----------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + +function OnUseAbility(player, target, ability) + + if (player:isWeaponTwoHanded()) then + final = player:getMainLvl(); + + if (player:getEquipID(SLOT_EAR1) == 0x39a6 or player:getEquipID(SLOT_EAR2) == 0x39a6) then --Knightly Earring + final = final+10; + end + + target:removeHP(final); + target:updateEnmity(player,900,1); + ability:setMsg(110); + ability:setResult(final); + end + +end; \ No newline at end of file Index: scripts/globals/abilities/boost.lua =================================================================== --- scripts/globals/abilities/boost.lua (revision 3304) +++ scripts/globals/abilities/boost.lua (working copy) @@ -17,7 +17,7 @@ local sHands = player:getEquipID(SLOT_HANDS); local power = 12.5 if(sHands == 13962 or sHands == 14891) then - power = power + 5.5; + power = power + 6.25; end if(player:hasStatusEffect(EFFECT_BOOST) == true) then Index: scripts/globals/abilities/call_wyvern.lua =================================================================== --- scripts/globals/abilities/call_wyvern.lua (revision 3304) +++ scripts/globals/abilities/call_wyvern.lua (working copy) @@ -13,6 +13,8 @@ function OnAbilityCheck(player,target,ability) if (player:getPet() ~= nil) then return MSGBASIC_ALREADY_HAS_A_PET,0; + elseif(player:hasStatusEffect(EFFECT_SPIRIT_SURGE) == true) then + return MSGBASIC_UNABLE_TO_USE_JA,0; else return 0,0; end Index: scripts/globals/abilities/camouflage.lua =================================================================== --- scripts/globals/abilities/camouflage.lua (revision 3304) +++ scripts/globals/abilities/camouflage.lua (working copy) @@ -16,8 +16,7 @@ function OnUseAbility(player, target, ability) local duration = math.random(30, 300); - duration = math.random(30, 300); - duration = math.random(30, 300); + duration = duration + (duration * target:getMod(MOD_INVIS_DUR)); if (target:getEquipID(SLOT_BODY) == 14224) then -- Hunter's Jerkin duration = duration * 1.3; Index: scripts/globals/abilities/chain_affinity.lua =================================================================== --- scripts/globals/abilities/chain_affinity.lua (revision 0) +++ scripts/globals/abilities/chain_affinity.lua (working copy) @@ -0,0 +1,18 @@ +----------------------------------- +-- Author: Kegsay +-- Chain Affinity +-- Makes it possible for your next "physical" blue magic spell to be used in a skillchain. Effect varies with TP. +----------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + +function OnUseAbility(player, target, ability) + --print(); + player:addStatusEffect(EFFECT_CHAIN_AFFINITY,1,0,30); + target:updateEnmity(player,300,1); +end; \ No newline at end of file Index: scripts/globals/abilities/chakra.lua =================================================================== --- scripts/globals/abilities/chakra.lua (revision 3304) +++ scripts/globals/abilities/chakra.lua (working copy) @@ -38,6 +38,15 @@ end multi = multi + 0.6; end + if(hand == 10691) then -- Melee Gloves (+2) equipped + if(player:hasStatusEffect(EFFECT_DISEASE)) then + player:delStatusEffect(EFFECT_DISEASE); + end + if(player:hasStatusEffect(EFFECT_PLAUGE)) then + player:delStatusEffect(EFFECT_PLAUGE); + end + multi = multi + 0.8; + end local recover = (multi * vit); player:setHP((hp + recover)); Index: scripts/globals/abilities/chocobo_jig.lua =================================================================== --- scripts/globals/abilities/chocobo_jig.lua (revision 3304) +++ scripts/globals/abilities/chocobo_jig.lua (working copy) @@ -1,30 +1,30 @@ ----------------------------------- --- Ability: Chocobo jig +-- Chocobo Jig +-- Increases movement speed. ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/status"); ------------------------------------ --- OnUseAbility ------------------------------------ +function OnAbilityCheck(player,target,ability) + return 0,0; +end; -function OnAbilityCheck(player,target,ability) - return 0,0; -end; - function OnUseAbility(player, target, ability) + -- Lasts for 120 seconds + duration = 120; + -- Jig Duration Bonus + duration = duration + player:getMod(MOD_JIG_TIME); - -- Increases movement speed by 25% for 120s - -- AF feet and Relic legs increase duration by 30s each - local legs = player:getEquipID(SLOT_LEGS); - local feet = player:getEquipID(SLOT_FEET); - local duration = 120; - if(legs == 16360 or legs == 16361 or legs == 10728) then - duration = duration + 30; - end - if(feet == 15746 or feet == 15747 or feet == 11393 or feet == 11394) then - duration = duration + 30; - end - player:addStatusEffect(EFFECT_QUICKENING,25,0,duration); -end; \ No newline at end of file + if (player:getStatusEffect(EFFECT_QUICKENING)) then + player:removeStatusType(EFFECT_QUICKENING); + end + + -- No effect if Flee or Mazurka is active + if (player:getStatusEffect(EFFECT_FLEE) or player:getStatusEffect(EFFECT_MAZURKA)) then + ability:setMsg(323); + else + player:addStatusEffect(EFFECT_QUICKENING,25,0,duration); + ability:setMsg(126); + end +end; Index: scripts/globals/abilities/convert.lua =================================================================== --- scripts/globals/abilities/convert.lua (revision 3304) +++ scripts/globals/abilities/convert.lua (working copy) @@ -24,6 +24,18 @@ -- Murgleis sword augments Convert. if ((player:getEquipID(SLOT_MAIN) == 18995 or player:getEquipID(SLOT_SUB) == 18995) and (HP > (player:getMaxHP()/2))) then HP = HP * 2; + elseif ((player:getEquipID(SLOT_MAIN) == 19064 or player:getEquipID(SLOT_SUB) == 19064) and (HP > (player:getMaxHP()/2))) then + HP = HP * 2; + elseif ((player:getEquipID(SLOT_MAIN) == 19084 or player:getEquipID(SLOT_SUB) == 19084) and (HP > (player:getMaxHP()/2))) then + HP = HP * 2; + elseif ((player:getEquipID(SLOT_MAIN) == 19616 or player:getEquipID(SLOT_SUB) == 19616) and (HP > (player:getMaxHP()/2))) then + HP = HP * 2; + elseif ((player:getEquipID(SLOT_MAIN) == 19714 or player:getEquipID(SLOT_SUB) == 19714) and (HP > (player:getMaxHP()/2))) then + HP = HP * 2; + elseif ((player:getEquipID(SLOT_MAIN) == 19823 or player:getEquipID(SLOT_SUB) == 19823) and (HP > (player:getMaxHP()/2))) then + HP = HP * 3; + elseif ((player:getEquipID(SLOT_MAIN) == 19952 or player:getEquipID(SLOT_SUB) == 19952) and (HP > (player:getMaxHP()/2))) then + HP = HP * 3; end player:setHP(MP); player:setMP(HP); Index: scripts/globals/abilities/counterstance.lua =================================================================== --- scripts/globals/abilities/counterstance.lua (revision 3304) +++ scripts/globals/abilities/counterstance.lua (working copy) @@ -16,11 +16,6 @@ function OnUseAbility(player, target, ability) local power = 50; - local feet = player:getEquipID(SLOT_FEET); - if(feet == 15133 or feet == 15666) then - power = power + 10; - end - target:delStatusEffect(EFFECT_COUNTERSTANCE); --if not found this will do nothing target:addStatusEffect(EFFECT_COUNTERSTANCE,power,0,300); end; Index: scripts/globals/abilities/cover.lua =================================================================== --- scripts/globals/abilities/cover.lua (revision 0) +++ scripts/globals/abilities/cover.lua (working copy) @@ -0,0 +1,24 @@ +----------------------------------- +-- Author: Tenjou +-- Cover +-- Allows player to protect the target by placing themselves between them and the enemy. +----------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + +function OnUseAbility(player, target, ability) + --print(); + ability:setMsg(0); + duration = 60 + player:getMerit(MERIT_COVER_EFFECT_LENGTH); + if (target ~= player) then + target:addStatusEffect(EFFECT_COVER,1,0,duration); + cover = target:getStatusEffect(EFFECT_COVER); + cover:setEffector(player); + end + --target:updateEnmity(player,300,1); +end; \ No newline at end of file Index: scripts/globals/abilities/curing_waltz.lua =================================================================== --- scripts/globals/abilities/curing_waltz.lua (revision 3304) +++ scripts/globals/abilities/curing_waltz.lua (working copy) @@ -26,8 +26,11 @@ local mjob = player:getMainJob(); --19 for DNC main. local sjob = player:getSubJob(); local cure = 0; - - + local pEquipMods = 0; + local body = caster:getEquipID(SLOT_BODY); + local head = caster:getEquipID(SLOT_HEAD); + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); --Performing sj mj check. if(mjob == 19) then @@ -37,6 +40,34 @@ if(sjob == 19) then cure = (vit+chr)*0.125+60; end + + -- equipment mods + if (head == 10407) then -- Khepri Bonnet + pEquipMods = pEquipMods + .08; + elseif (head == 10688) then -- Etoile Tiara +2 + pEquipMods = pEquipMods + .07; + elseif (head == 10402 or head == 11478 or head == 11479) then -- Kheper Bonnet Etoile Tiara & +1 + pEquipMods = pEquipMods + .05; + end + if (body == 11302 or body == 11303 or body == 14578 or body == 14579) then -- Dancers Casaque & +1 + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_MAIN) == 19136 or caster:getEquipID(SLOT_SUB) == 19136) then -- Phurba + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_EAR1) == 16002 or caster:getEquipID(SLOT_EAR2) == 16002) then -- Roundel Earring + pEquipMods = pEquipMods + .05; + end + if (caster:getEquipID(SLOT_AMMO) == 18735) then -- Sonias Plectrum + pEquipMods = pEquipMods + .08; + end + if (ring1 == 10751 or ring2 == 10751) then -- Valseurs Ring + pEquipMods = pEquipMods + .03; + end + if (target:getEquipID(SLOT_RING1) == 10787 or target:getEquipID(SLOT_RING2) == 10787) then -- Asklepian Ring + pEquipMods = pEquipMods + .03; + end + cure = cure + (cure * pEquipMods); --Reducing TP. Index: scripts/globals/abilities/curing_waltz_ii.lua =================================================================== --- scripts/globals/abilities/curing_waltz_ii.lua (revision 3304) +++ scripts/globals/abilities/curing_waltz_ii.lua (working copy) @@ -26,7 +26,11 @@ local mjob = player:getMainJob(); --19 for DNC main. local sjob = player:getSubJob(); local cure = 0; - + local pEquipMods = 0; + local body = caster:getEquipID(SLOT_BODY); + local head = caster:getEquipID(SLOT_HEAD); + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); --Performing sj mj check. @@ -37,6 +41,34 @@ if(sjob == 19) then cure = (vit+chr)*0.25+130; end + + -- equipment mods + if (head == 10407) then -- Khepri Bonnet + pEquipMods = pEquipMods + .08; + elseif (head == 10688) then -- Etoile Tiara +2 + pEquipMods = pEquipMods + .07; + elseif (head == 10402 or head == 11478 or head == 11479) then -- Kheper Bonnet Etoile Tiara & +1 + pEquipMods = pEquipMods + .05; + end + if (body == 11302 or body == 11303 or body == 14578 or body == 14579) then -- Dancers Casaque & +1 + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_MAIN) == 19136 or caster:getEquipID(SLOT_SUB) == 19136) then -- Phurba + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_EAR1) == 16002 or caster:getEquipID(SLOT_EAR2) == 16002) then -- Roundel Earring + pEquipMods = pEquipMods + .05; + end + if (caster:getEquipID(SLOT_AMMO) == 18735) then -- Sonias Plectrum + pEquipMods = pEquipMods + .08; + end + if (ring1 == 10751 or ring2 == 10751) then -- Valseurs Ring + pEquipMods = pEquipMods + .03; + end + if (target:getEquipID(SLOT_RING1) == 10787 or target:getEquipID(SLOT_RING2) == 10787) then -- Asklepian Ring + pEquipMods = pEquipMods + .03; + end + cure = cure + (cure * pEquipMods); --Reducing TP. Index: scripts/globals/abilities/curing_waltz_iii.lua =================================================================== --- scripts/globals/abilities/curing_waltz_iii.lua (revision 3304) +++ scripts/globals/abilities/curing_waltz_iii.lua (working copy) @@ -25,14 +25,45 @@ local chr = player:getStat(MOD_CHR); local mjob = player:getMainJob(); --19 for DNC main. local cure = 0; - + local pEquipMods = 0; + local body = caster:getEquipID(SLOT_BODY); + local head = caster:getEquipID(SLOT_HEAD); + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); - --Performing mj check. if(mjob == 19) then cure = (vit+chr)*0.75+270; end + -- equipment mods + if (head == 10407) then -- Khepri Bonnet + pEquipMods = pEquipMods + .08; + elseif (head == 10688) then -- Etoile Tiara +2 + pEquipMods = pEquipMods + .07; + elseif (head == 10402 or head == 11478 or head == 11479) then -- Kheper Bonnet Etoile Tiara & +1 + pEquipMods = pEquipMods + .05; + end + if (body == 11302 or body == 11303 or body == 14578 or body == 14579) then -- Dancers Casaque & +1 + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_MAIN) == 19136 or caster:getEquipID(SLOT_SUB) == 19136) then -- Phurba + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_EAR1) == 16002 or caster:getEquipID(SLOT_EAR2) == 16002) then -- Roundel Earring + pEquipMods = pEquipMods + .05; + end + if (caster:getEquipID(SLOT_AMMO) == 18735) then -- Sonias Plectrum + pEquipMods = pEquipMods + .08; + end + if (ring1 == 10751 or ring2 == 10751) then -- Valseurs Ring + pEquipMods = pEquipMods + .03; + end + if (target:getEquipID(SLOT_RING1) == 10787 or target:getEquipID(SLOT_RING2) == 10787) then -- Asklepian Ring + pEquipMods = pEquipMods + .03; + end + cure = cure + (cure * pEquipMods); + --Reducing TP. --Applying server mods.... Index: scripts/globals/abilities/curing_waltz_iv.lua =================================================================== --- scripts/globals/abilities/curing_waltz_iv.lua (revision 3304) +++ scripts/globals/abilities/curing_waltz_iv.lua (working copy) @@ -25,12 +25,46 @@ local chr = player:getStat(MOD_CHR); local mjob = player:getMainJob(); --19 for DNC main. local cure = 0; - + local pEquipMods = 0; + local body = caster:getEquipID(SLOT_BODY); + local head = caster:getEquipID(SLOT_HEAD); + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + --Performing mj check. if(mjob == 19) then cure = (vit+chr)+450; end + -- equipment mods + if (head == 10407) then -- Khepri Bonnet + pEquipMods = pEquipMods + .08; + elseif (head == 10688) then -- Etoile Tiara +2 + pEquipMods = pEquipMods + .07; + elseif (head == 10402 or head == 11478 or head == 11479) then -- Kheper Bonnet Etoile Tiara & +1 + pEquipMods = pEquipMods + .05; + end + if (body == 11302 or body == 11303 or body == 14578 or body == 14579) then -- Dancers Casaque & +1 + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_MAIN) == 19136 or caster:getEquipID(SLOT_SUB) == 19136) then -- Phurba + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_EAR1) == 16002 or caster:getEquipID(SLOT_EAR2) == 16002) then -- Roundel Earring + pEquipMods = pEquipMods + .05; + end + if (caster:getEquipID(SLOT_AMMO) == 18735) then -- Sonias Plectrum + pEquipMods = pEquipMods + .08; + end + if (ring1 == 10751 or ring2 == 10751) then -- Valseurs Ring + pEquipMods = pEquipMods + .03; + end + if (target:getEquipID(SLOT_RING1) == 10787 or target:getEquipID(SLOT_RING2) == 10787) then -- Asklepian Ring + pEquipMods = pEquipMods + .03; + end + cure = cure + (cure * pEquipMods); + + --Reducing TP. --Applying server mods.... Index: scripts/globals/abilities/curing_waltz_v.lua =================================================================== --- scripts/globals/abilities/curing_waltz_v.lua (revision 0) +++ scripts/globals/abilities/curing_waltz_v.lua (working copy) @@ -0,0 +1,80 @@ +----------------------------------- +-- Ability: Curing Waltz V +----------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------- +-- OnUseAbility +----------------------------------- + +function OnAbilityCheck(player,target,ability) + if (player:getTP() < 80) then + return MSGBASIC_UNABLE_TO_USE_JA2,0; + else + player:delTP(80); + return 0,0; + end +end; + +function OnUseAbility(player, target, ability) + + --Grabbing variables. + local vit = target:getStat(MOD_VIT); + local chr = player:getStat(MOD_CHR); + local cure = 0; + local pEquipMods = 0; + local body = caster:getEquipID(SLOT_BODY); + local head = caster:getEquipID(SLOT_HEAD); + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + + cure = ((vit+chr) * 1.25) + 600; + + -- equipment mods + if (head == 10407) then -- Khepri Bonnet + pEquipMods = pEquipMods + .08; + elseif (head == 10688) then -- Etoile Tiara +2 + pEquipMods = pEquipMods + .07; + elseif (head == 10402 or head == 11478 or head == 11479) then -- Kheper Bonnet Etoile Tiara & +1 + pEquipMods = pEquipMods + .05; + end + if (body == 11302 or body == 11303 or body == 14578 or body == 14579) then -- Dancers Casaque & +1 + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_MAIN) == 19136 or caster:getEquipID(SLOT_SUB) == 19136) then -- Phurba + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_EAR1) == 16002 or caster:getEquipID(SLOT_EAR2) == 16002) then -- Roundel Earring + pEquipMods = pEquipMods + .05; + end + if (caster:getEquipID(SLOT_AMMO) == 18735) then -- Sonias Plectrum + pEquipMods = pEquipMods + .08; + end + if (ring1 == 10751 or ring2 == 10751) then -- Valseurs Ring + pEquipMods = pEquipMods + .03; + end + if (target:getEquipID(SLOT_RING1) == 10787 or target:getEquipID(SLOT_RING2) == 10787) then -- Asklepian Ring + pEquipMods = pEquipMods + .03; + end + cure = cure + (cure * pEquipMods); + + + --Reducing TP. + + --Applying server mods.... + cure = cure * CURE_POWER; + + --Cap the final amount to max HP. + if((target:getMaxHP() - target:getHP()) < cure) then + cure = (target:getMaxHP() - target:getHP()); + end + + --Do it + target:addHP(cure); + player:updateEnmityFromCure(target,cure*(240 / ( ( 31 * target:getMainLvl() / 50 ) + 6 )),cure*(40 / ( ( 31 * target:getMainLvl() / 50 ) + 6 ))); + + return cure; + +end; \ No newline at end of file Index: scripts/globals/abilities/dark_seal.lua =================================================================== --- scripts/globals/abilities/dark_seal.lua (revision 3304) +++ scripts/globals/abilities/dark_seal.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------- --- Ability: Elemental Seal +-- Ability: Dark Seal ----------------------------------- require("scripts/globals/settings"); @@ -10,7 +10,7 @@ ----------------------------------- function OnAbilityCheck(player,target,ability) - return 0,0; + return 0,0; end; function OnUseAbility(player, target, ability) Index: scripts/globals/abilities/devotion.lua =================================================================== --- scripts/globals/abilities/devotion.lua (revision 0) +++ scripts/globals/abilities/devotion.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------- +-- Ability: Devotion +----------------------------------- + +require("scripts/globals/status"); + +----------------------------------- +-- OnUseAbility +----------------------------------- + +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + +function OnUseAbility(player, target, ability) + if (player:getHP() > 3) then + effectPower = player:getHP()/4; + player:delHP(effectPower); + target:addMP(effectPower); + end +end; Index: scripts/globals/abilities/diabolic_eye.lua =================================================================== --- scripts/globals/abilities/diabolic_eye.lua (revision 3304) +++ scripts/globals/abilities/diabolic_eye.lua (working copy) @@ -1,5 +1,6 @@ ----------------------------------- --- Ability: Berserk +-- Ability: Diabolic Eye +-- Reduces Max HP, Increases Acc ----------------------------------- require("scripts/globals/settings"); Index: scripts/globals/abilities/divine_waltz.lua =================================================================== --- scripts/globals/abilities/divine_waltz.lua (revision 3304) +++ scripts/globals/abilities/divine_waltz.lua (working copy) @@ -26,6 +26,11 @@ local mjob = player:getMainJob(); --19 for DNC main. local sjob = player:getSubJob(); local cure = 0; + local pEquipMods = 0; + local body = caster:getEquipID(SLOT_BODY); + local head = caster:getEquipID(SLOT_HEAD); + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); --Performing sj mj check. if(mjob == 19) then @@ -36,11 +41,40 @@ cure = (vit+chr)*0.125+60; end + -- equipment mods + if (head == 10407) then -- Khepri Bonnet + pEquipMods = pEquipMods + .08; + elseif (head == 10688) then -- Etoile Tiara +2 + pEquipMods = pEquipMods + .07; + elseif (head == 10402 or head == 11478 or head == 11479) then -- Kheper Bonnet Etoile Tiara & +1 + pEquipMods = pEquipMods + .05; + end + if (body == 11302 or body == 11303 or body == 14578 or body == 14579) then -- Dancers Casaque & +1 + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_MAIN) == 19136 or caster:getEquipID(SLOT_SUB) == 19136) then -- Phurba + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_EAR1) == 16002 or caster:getEquipID(SLOT_EAR2) == 16002) then -- Roundel Earring + pEquipMods = pEquipMods + .05; + end + if (caster:getEquipID(SLOT_AMMO) == 18735) then -- Sonias Plectrum + pEquipMods = pEquipMods + .08; + end + if (ring1 == 10751 or ring2 == 10751) then -- Valseurs Ring + pEquipMods = pEquipMods + .03; + end + if (target:getEquipID(SLOT_RING1) == 10787 or target:getEquipID(SLOT_RING2) == 10787) then -- Asklepian Ring + pEquipMods = pEquipMods + .03; + end + cure = cure + (cure * pEquipMods); + --Cap the final amount to max HP. if((target:getMaxHP() - target:getHP()) < cure) then cure = (target:getMaxHP() - target:getHP()); end + --Applying server mods.... cure = cure * CURE_POWER; Index: scripts/globals/abilities/divine_waltz_ii.lua =================================================================== --- scripts/globals/abilities/divine_waltz_ii.lua (revision 0) +++ scripts/globals/abilities/divine_waltz_ii.lua (working copy) @@ -0,0 +1,72 @@ +----------------------------------- +-- Ability: Divine Waltz +----------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------- +-- OnUseAbility +----------------------------------- + +function OnAbilityCheck(player,target,ability) + if (player:getTP() < 80) then + return MSGBASIC_UNABLE_TO_USE_JA2,0; + else + player:delTP(80); + return 0,0; + end +end; + +function OnUseAbility(player, target, ability) + + --Grabbing variables. + local vit = target:getStat(MOD_VIT); + local chr = player:getStat(MOD_CHR); + local cure = 0; + local pEquipMods = 0; + local body = caster:getEquipID(SLOT_BODY); + local head = caster:getEquipID(SLOT_HEAD); + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + + cure = (vit+chr)*0.39+295; + + -- equipment mods + if (head == 10407) then -- Khepri Bonnet + pEquipMods = pEquipMods + .08; + elseif (head == 10688) then -- Etoile Tiara +2 + pEquipMods = pEquipMods + .07; + elseif (head == 10402 or head == 11478 or head == 11479) then -- Kheper Bonnet Etoile Tiara & +1 + pEquipMods = pEquipMods + .05; + end + if (body == 11302 or body == 11303 or body == 14578 or body == 14579) then -- Dancers Casaque & +1 + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_MAIN) == 19136 or caster:getEquipID(SLOT_SUB) == 19136) then -- Phurba + pEquipMods = pEquipMods + .10; + end + if (caster:getEquipID(SLOT_EAR1) == 16002 or caster:getEquipID(SLOT_EAR2) == 16002) then -- Roundel Earring + pEquipMods = pEquipMods + .05; + end + if (caster:getEquipID(SLOT_AMMO) == 18735) then -- Sonias Plectrum + pEquipMods = pEquipMods + .08; + end + if (ring1 == 10751 or ring2 == 10751) then -- Valseurs Ring + pEquipMods = pEquipMods + .03; + end + if (target:getEquipID(SLOT_RING1) == 10787 or target:getEquipID(SLOT_RING2) == 10787) then -- Asklepian Ring + pEquipMods = pEquipMods + .03; + end + cure = cure + (cure * pEquipMods); + + + --Applying server mods.... + cure = cure * CURE_POWER; + + player:addHP(cure); + player:updateEnmityFromCure(target,cure*(240 / ( ( 31 * target:getMainLvl() / 50 ) + 6 )),cure*(40 / ( ( 31 * target:getMainLvl() / 50 ) + 6 ))); + + return cure; + +end; \ No newline at end of file Index: scripts/globals/abilities/eagle_eye_shot.lua =================================================================== --- scripts/globals/abilities/eagle_eye_shot.lua (revision 3304) +++ scripts/globals/abilities/eagle_eye_shot.lua (working copy) @@ -14,4 +14,10 @@ end; function OnUseAbility(player, target, ability) +final = player:getBaseDmg()*5; --NEEDS TO BE FIXED + +--Do it! +target:removeHP(final); +ability:setMsg(110); +ability:setResult(final); end; Index: scripts/globals/abilities/healing_waltz.lua =================================================================== --- scripts/globals/abilities/healing_waltz.lua (revision 3304) +++ scripts/globals/abilities/healing_waltz.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------- --- Ability: Divine Waltz +-- Ability: Healing Waltz ----------------------------------- require("scripts/globals/settings"); Index: scripts/globals/abilities/jump.lua =================================================================== --- scripts/globals/abilities/jump.lua (revision 3304) +++ scripts/globals/abilities/jump.lua (working copy) @@ -14,4 +14,13 @@ end; function OnUseAbility(player, target, ability) + if(player:getEquipID(SLOT_MAIN) == 19794) then + target:addStatusEffect(EFFECT_STUN,1,0,30); + end + -- Under Spirit Surge, Jump also decreases target defense by 20% for 60 seconds + if(player:hasStatusEffect(EFFECT_SPIRIT_SURGE) == true) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN, 20, 0, 60); + end + end end; \ No newline at end of file Index: scripts/globals/abilities/martyr.lua =================================================================== --- scripts/globals/abilities/martyr.lua (revision 0) +++ scripts/globals/abilities/martyr.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------- +-- Ability: Martyr +----------------------------------- + +require("scripts/globals/status"); + +----------------------------------- +-- OnUseAbility +----------------------------------- + +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + +function OnUseAbility(player, target, ability) + if (player:getHP() > 3) then + effectPower = player:getHP()/4; + target:delHP(effectPower); + player:addHP(effectPower*2); + end +end; Index: scripts/globals/abilities/meditate.lua =================================================================== --- scripts/globals/abilities/meditate.lua (revision 3304) +++ scripts/globals/abilities/meditate.lua (working copy) @@ -18,21 +18,9 @@ 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(SLOT_HANDS); - local sHead = target:getEquipID(SLOT_HEAD); - if (sHands == 15113 or sHands == 14920) then - extratick = 1; - end - if (sHead == 13868 or sHead == 15236) then - extratick = extratick + 1; - end - if (extratick == 1) then - extratick = math.random(1,2); - elseif (extratick == 2) then - extratick = math.random(2,3); - end - tick = tick + (extratick * 3); + tick = tick + target:getMod(MOD_MEDITATE_DUR); + player:addStatusEffectEx(EFFECT_REGAIN,0,amount,3,tick); end; Index: scripts/globals/abilities/mijin_gakure.lua =================================================================== --- scripts/globals/abilities/mijin_gakure.lua (revision 3304) +++ scripts/globals/abilities/mijin_gakure.lua (working copy) @@ -9,20 +9,20 @@ -- OnUseAbility ----------------------------------- --- Do not use setHP(0) for a spell/ability that kills you. It does not work, --- and creates a zombie entity that cannot be added to the enmity list. - function OnAbilityCheck(player,target,ability) return 0,0; end; function OnUseAbility(player, target, ability) --- local dmg = (player:getHP() * 0.8) + (player:getMainLvl() / 0.5); + local dmg = (player:getHP() * 0.8) + (player:getMainLvl() / 0.5); + if (target:getEquipID(SLOT_AMMO) == 19211) then + dmg = dmg * 1.1; + end --- player:setHP(0); --- target:delHP(dmg); + player:setHP(0); + target:delHP(dmg); --- return dmg; + return dmg; end; Index: scripts/globals/abilities/mug.lua =================================================================== --- scripts/globals/abilities/mug.lua (revision 3304) +++ scripts/globals/abilities/mug.lua (working copy) @@ -22,7 +22,7 @@ -- is notorious -- all notorious monsters can be mugged if(target:isMobType(2) and gil <= 0) then - gil = target:getMainLvl() * 20; + gil = target:getMainLvl() * 30; end if(gil <= 0) then Index: scripts/globals/abilities/nightingale.lua =================================================================== --- scripts/globals/abilities/nightingale.lua (revision 0) +++ scripts/globals/abilities/nightingale.lua (working copy) @@ -0,0 +1,20 @@ +----------------------------------- +-- Ability: Nightingale +-- Halves recast times of songs. +----------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------- +-- OnUseAbility +----------------------------------- + +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + +function OnUseAbility(player, target, ability) + local merits = player:getMerit(MERIT_NIGHTINGALE); + player:addStatusEffect(EFFECT_NIGHTINGALE,merits,0,60); +end; Index: scripts/globals/abilities/rampart.lua =================================================================== --- scripts/globals/abilities/rampart.lua (revision 3304) +++ scripts/globals/abilities/rampart.lua (working copy) @@ -11,8 +11,23 @@ function OnAbilityCheck(player,target,ability) return 0,0; -end; +end; function OnUseAbility(player, target, ability) - target:addStatusEffect(EFFECT_MAGIC_SHIELD,1,0,30); + duration = 30; + local head = caster:getEquipID(SLOT_HEAD); + local pEquipMods = 0; + + -- Equipment Bonus + if (head == 15078) then -- Valor Coronet + pEquipMods = 15; + elseif (head == 15251) then -- Valor Coronet +1 + pEquipMods = 20; + elseif (head == 10656) then -- Valor Coronet +2 + pEquipMods = 25; + end + + duration = duration + pEquipMods + + target:addStatusEffect(EFFECT_MAGIC_SHIELD,1,0,duration); end; Index: scripts/globals/abilities/retaliation.lua =================================================================== --- scripts/globals/abilities/retaliation.lua (revision 0) +++ scripts/globals/abilities/retaliation.lua (working copy) @@ -0,0 +1,20 @@ +----------------------------------- +-- Ability: Retaliation +-- Allows you to counterattack but +-- reduces movement speed. +----------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------- +-- OnUseAbility +----------------------------------- + +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + +function OnUseAbility(player, target, ability) + player:addStatusEffect(EFFECT_RETALIATION,1,0,180); +end; Index: scripts/globals/abilities/reward.lua =================================================================== --- scripts/globals/abilities/reward.lua (revision 3304) +++ scripts/globals/abilities/reward.lua (working copy) @@ -10,20 +10,45 @@ -- OnUseAbility ----------------------------------- -function OnAbilityCheck(player,target,ability) +function OnAbilityCheck(player,target,ability) if (player:getPet() == nil) then return MSGBASIC_REQUIRES_A_PET,0; else local id = player:getEquipID(SLOT_AMMO); - if(id >= 17016 and id <= 17023) then + if(id >= 17016 and id <= 17023 or id == 19252) then player:setBattleSubTarget(player:getPet()); return 0,0; + elseif(id == 19251) then + local pet = player:getPet(); + player:setBattleSubTarget(player:getPet()); + pet:delStatusEffect(EFFECT_PARALYSIS); + pet:delStatusEffect(EFFECT_POISON); + pet:delStatusEffect(EFFECT_BLINDNESS); + pet:delStatusEffect(EFFECT_WEIGHT); + pet:delStatusEffect(EFFECT_SLOW); + pet:delStatusEffect(EFFECT_SILENCE); + pet:delStatusEffect(EFFECT_CHOKE); + pet:delStatusEffect(EFFECT_RASP); + pet:delStatusEffect(EFFECT_PLAGUE); + pet:delStatusEffect(EFFECT_DISEASE); + pet:delStatusEffect(EFFECT_FROST); + pet:delStatusEffect(EFFECT_BURN); + pet:delStatusEffect(EFFECT_STUN); + pet:delStatusEffect(EFFECT_PETRIFICATION); + pet:delStatusEffect(EFFECT_ADDLE); + pet:delStatusEffect(EFFECT_BIND); + pet:delStatusEffect(EFFECT_CURSE_I); + pet:delStatusEffect(EFFECT_CURSE_II); + pet:delStatusEffect(EFFECT_ATTACK_DOWN); + pet:delStatusEffect(EFFECT_DEFENSE_DOWN); + return 0; else + return MSGBASIC_MUST_HAVE_FOOD,0; end - end -end; - + end +end; + function OnUseAbility(player, target, ability) -- 1st need to get the pet food is equipped in the range slot. @@ -94,6 +119,14 @@ regenAmount = 20; totalHealing = math.floor(minimumHealing + 4*(playerMnd-55)); end, + [19252] = function (x) -- pet poultice + -- printf("Food: pet Poultice."); + minimumHealing = 0; + regenAmount = math.floor(petMaxHP / 100); + totalHealing = 0; + regenTime = 300; + end, + } @@ -127,7 +160,7 @@ pet:delStatusEffect(EFFECT_SLOW); pet:delStatusEffect(EFFECT_SILENCE); end, - [14481] = function (x) -- monster jackcoat +1 + [14508] = function (x) -- monster jackcoat +1 -- This will remove Paralyze, Poison, Blind, Weight, Slow and Silence from the pet. -- printf("Monster jackcoat +1 detected."); pet:delStatusEffect(EFFECT_PARALYSIS); @@ -136,6 +169,16 @@ pet:delStatusEffect(EFFECT_WEIGHT); pet:delStatusEffect(EFFECT_SLOW); pet:delStatusEffect(EFFECT_SILENCE); + end, + [10678] = function (x) -- monster jackcoat +2 + -- This will remove Paralyze, Poison, Blind, Weight, Slow and Silence from the pet. + -- printf("Monster jackcoat +1 detected."); + pet:delStatusEffect(EFFECT_PARALYSIS); + pet:delStatusEffect(EFFECT_POISON); + pet:delStatusEffect(EFFECT_BLINDNESS); + pet:delStatusEffect(EFFECT_WEIGHT); + pet:delStatusEffect(EFFECT_SLOW); + pet:delStatusEffect(EFFECT_SILENCE); end, } @@ -145,17 +188,18 @@ totalHealing = totalHealing + math.floor(totalHealing * rewardHealingMod / 100); end + -- Applying server mods + totalHealing = totalHealing * PETFOOD_POWER; + regenAmount = regenAmount * PETFOOD_POWER; + -- Apply healing. if (petCurrentHP + totalHealing <= petMaxHP) then - -- printf("Healing pet for %u HP.", totalHealing); pet:addHP(totalHealing); else - -- printf("Total healing more than pet max HP. Restoring pet HP to %u.", petMaxHP); pet:setHP(petMaxHP); end -- Apply regen effect. - pet:delStatusEffect(EFFECT_REGEN); pet:addStatusEffect(EFFECT_REGEN,regenAmount,3,regenTime); -- 3 = tick, each 3 seconds. Index: scripts/globals/abilities/scavenge.lua =================================================================== --- scripts/globals/abilities/scavenge.lua (revision 3304) +++ scripts/globals/abilities/scavenge.lua (working copy) @@ -1,22 +1,19 @@ ----------------------------------- --- Ability: Scavenge +-- Scavenge +-- Player will have a default 10% chance of finding an item +-- Hunter's Socks equipped will increase chance by 5% +-- Items found are dependant on the average level of zone's mobs +-- Items can not be scavenged in Cities, Transports, or Battlefields ----------------------------------- - require("scripts/globals/settings"); require("scripts/globals/status"); +function OnAbilityCheck(player,target,ability) + return 0,0; +end; +function OnUseAbility(player, target, ability) ------------------------------------ --- OnUseAbility ------------------------------------ - -function OnAbilityCheck(player,target,ability) - return 0,0; -end; - -function OnUseAbility(user, target, ability) - -- RNG AF2 quest check local FireAndBrimstoneCS = user:getVar("fireAndBrimstone"); @@ -33,12 +30,118 @@ user:messageSpecial(ITEM_OBTAINED,1113); end - else + end + + ----------------------------------- + -- zoneSet contains an array of zoneIds and corresponding setId + -- (zoneId,setId,zoneId,setId,zoneId,setId,...) + ----------------------------------- + zoneSet = {2,2,4,6,5,9,7,6,9,8,11,5,12,5,24,6,25,6,27,7,28,8,29,8,30,7, + 33,9,34,9,35,9,51,8,52,8,54,9,57,9,61,9,62,9,65,9,68,9,72,9,79, + 8,81,7,82,8,83,9,84,9,85,9,88,7,89,9,90,9,91,8,92,9,95,7,96,9, + 97,9,98,9,99,9,100,1,101,1,102,2,103,4,104,5,105,5,106,1,107,1, + 108,2,109,5,110,5,111,6,112,7,113,9,114,6,115,2,116,1,117,2,118,4, + 119,5,120,5,121,5,122,9,123,6,124,6,125,7,126,5,127,7,128,9,130,9, + 136,9,137,7,140,1,141,2,142,2,143,1,145,1,147,5,148,7,149,5,150,7, + 151,5,152,7,153,9,154,9,157,6,158,6,159,8,160,9,161,8,162,8,164,9, + 166,6,167,8,169,7,171,9,172,1,173,5,174,8,175,9,176,7,177,9,178,9, + 184,5,190,4,191,1,192,1,193,4,194,2,195,7,196,4,197,7,198,4,200,7, + 204,8,205,9,208,8,212,9,213,8}; + ----------------------------------- + -- itemSet contains an array of setIds and corresponding item + -- tables (setId,{itemlist}) + ----------------------------------- + itemSet = {0,{0X0000}, + 1,{0x04BB,0x04BE,0x02CB,0x02C1,0x04C5,0x1064,0x1065}, + 2,{0x04BF,0x04DA,0x02CB,0x02C1,0x04C6,0x1064,0x1065,0x1496,0x149E}, + 3,{0x04DB,0x05EB,0x02CB,0x02C1,0x04C6,0x1064,0x1065,0x1496,0x149E}, + 4,{0x04DB,0x05EB,0x02CB,0x02C1,0x04C6,0x1064,0x1065,0x1496,0x149E,0x03B3}, + 5,{0x04C1,0x04DD,0x04C6,0x02CB,0x02C1,0x1064,0x1065,0x1496,0x149E,0x14A4,0x03B3}, + 6,{0x04E1,0x04DC,0x04C7,0x02CB,0x02C1,0x1064,0x1065,0x1496,0x149E,0x14A4,0x03B3}, + 7,{0x04BC,0x04E2,0x02CB,0x02C1,0x04C8,0x1064,0x1065,0x1496,0x149E,0x14A4,0x03B3}, + 8,{0x065B,0x04BD,0x02CB,0x02C1,0x04E6,0x1064,0x1065,0x1496,0x149E,0x14A4,0x03B3}, + 9,{0x04E3,0x04BD,0x04E6,0x02CB,0x02C1,0x1064,0x1065,0x1496,0x149E,0x14A4,0x03B3}}; + + ----------------------------------- + -- Determine the current zone's setId + ----------------------------------- + currZone = player:getZone(); + setId = 0; + i = 1; + while i <= (table.getn(zoneSet)-1) do + if (zoneSet[i] == currZone) then + setId = zoneSet[i+1]; + break; + end + i = i+2; + end; + + ----------------------------------- + -- Set itemList array based on setId + ----------------------------------- + itemList = {0X0000}; + j = 1 + while j <= (table.getn(itemSet))do + if (itemSet[j] == setId) then + itemList = itemSet[j+1]; + break; + end + j = j+2; + end; + + ----------------------------------- + -- Determine found item and if player gets the item + -- Player will receive item 10% of the time + -- Hunter's Socks & Hunter's Socks +1 increase rate by 5% + ----------------------------------- + rate = SCAVENGE_RATE * 100; + if (player:getEquipID(SLOT_FEET) == 0x3713 or player:getEquipID(SLOT_FEET) == 0x3C02) then + rate = rate + 5; + end; + if (rate > 100) then rate = 100; end - -- TODO: whom ever fancies making scavenger. The RNG stuff can then be refactored + rand = math.random(1,table.getn(itemList)); + item = itemList[rand]; + rand = math.random(0,99); + if (rand >= rate) then + item = 0x0000; + end; + + ----------------------------------- + -- Compensate for multiple itemIDs for the same item (Old Ammo) + ----------------------------------- + oldAmmo = {0x1496,0x1497,0x1498,0x1499,0x149A,0x149B,0x149C,0x149D, + 0x149E,0x149F,0x14A0,0x14A1,0x14A2,0x14A3,0x14A4,0x14A5}; + + if (item == 0x1496 or item == 0x149E or item == 0x14A4) then + if (item == 0x1496) then + min = 1; + max = 8; + + elseif (item == 0x149E) then + min = 9; + max = 14; + else + min = 15; + max = 16; + end; + rand = math.random(min,max); + item = oldAmmo[rand]; + end; + + ----------------------------------- + -- Give player the scavenged item + ----------------------------------- + if (player:getFreeSlotsCount() == 0) then + ability:setMsg(356); + else + if (item ~= 0) then + ability:setMsg(140); + player:addItem(item); + else + ability:setMsg(139); + end end - + end; - - Index: scripts/globals/abilities/sentinel.lua =================================================================== --- scripts/globals/abilities/sentinel.lua (revision 3304) +++ scripts/globals/abilities/sentinel.lua (working copy) @@ -8,20 +8,24 @@ -- OnUseAbility ----------------------------------- -function OnAbilityCheck(player,target,ability) - return 0,0; -end; - +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + function OnUseAbility(player, target, ability) -- Whether feet have to be equipped before using ability, or if they can be swapped in -- is disputed. Source used: http://wiki.bluegartr.com/bg/Sentinel local sFeet = player:getEquipID(SLOT_FEET); local power = 90; - if(sFeet == 15138 or sFeet == 15671) then - power = power + 13; -- -103%. This is oddly correct. + local duration = 30; + local merit = player:getMerit(MERIT_GUARDIAN); + if(sFeet == 15138 or sFeet == 15671 or sFeet == 10736) then + power = power + 13; end + if(sFeet == 10736) then + duration = duration + (2 * merit); + end - -- Sent as positive power because UINTs, man. - player:addStatusEffect(EFFECT_SENTINEL,power,3,30); + player:addStatusEffect(EFFECT_SENTINEL,power,3,duration); end; \ No newline at end of file Index: scripts/globals/abilities/shield_bash.lua =================================================================== --- scripts/globals/abilities/shield_bash.lua (revision 3304) +++ scripts/globals/abilities/shield_bash.lua (working copy) @@ -69,4 +69,4 @@ ability:setMsg(110); return damage; -end; \ No newline at end of file +end; Index: scripts/globals/abilities/shikikoyo.lua =================================================================== --- scripts/globals/abilities/shikikoyo.lua (revision 0) +++ scripts/globals/abilities/shikikoyo.lua (working copy) @@ -0,0 +1,42 @@ +------------------------- +-- Shikikoyo +------------------------- +require("scripts/globals/settings"); +require("scripts/globals/status"); + +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + +function OnUseAbility(player, target, ability) + selftp = player:getTP(); + targettp = target:getTP(); + + if (selftp <= 100) then + newttp = targettp; + newstp = selftp; + addtp = 0; + end + if (selftp >= 100) then + addtp = selftp - 100; + newttp = targettp + addtp; + newstp = 100; + end + + if (targettp >= 300) then + newttp = targettp; + newstp = selftp; + addtp = 0; + end + if (selftp <= 100) then + ability:setMsg(323); + ability:setResult(addtp); + else + ability:setMsg(452); + ability:setResult(addtp); + end + + player:setTP(newstp); + target:setTP(newttp); + target:updateEnmity(player,300,1); --Possibly the same as Devotion or Martyr. +end; \ No newline at end of file Index: scripts/globals/abilities/soul_voice.lua =================================================================== --- scripts/globals/abilities/soul_voice.lua (revision 0) +++ scripts/globals/abilities/soul_voice.lua (working copy) @@ -0,0 +1,18 @@ +----------------------------------- +-- Soul Voice +-- Enhances the effect of songs. +-- +-- Actually doubles the effect of songs. +----------------------------------- + +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +function OnUseAbility(player, target, ability) + target:addStatusEffect(EFFECT_SOUL_VOICE,1,0,180); + target:updateEnmity(player,0,1); +end; \ No newline at end of file Index: scripts/globals/abilities/spectral_jig.lua =================================================================== --- scripts/globals/abilities/spectral_jig.lua (revision 3304) +++ scripts/globals/abilities/spectral_jig.lua (working copy) @@ -10,31 +10,23 @@ ----------------------------------- function OnAbilityCheck(player,target,ability) - return 0,0; + return 0,0; end; function OnUseAbility(player, target, ability) + local duration = 0; + local maxDuration = 90; + -- Jig Duration Bonus + maxDuration = maxDuration + player:getMod(MOD_JIG_TIME); + + local randTime = math.random(30,maxDuration); - local baseDuration = math.random(30,60); - local finalDuration = baseDuration; - local legs = target:getEquipID(SLOT_LEGS); - local feet = target:getEquipID(SLOT_FEET); - - -- Reports have been changed from +30 sec to "extends duration by 100%" - if(legs == 16360 or legs == 16361 or legs == 10728) then - finalDuration = finalDuration + baseDuration; - end - if(feet == 15746 or feet == 15747 or feet == 11393 or feet == 11394) then - finalDuration = finalDuration + baseDuration; - end - - if(player:hasStatusEffect(EFFECT_SNEAK) == false) then - player:addStatusEffect(EFFECT_SNEAK,0,10,finalDuration); - player:addStatusEffect(EFFECT_INVISIBLE,0,10,finalDuration); - ability:setMsg(532); -- Gains the effect of sneak and invisible - else + if(player:hasStatusEffect(EFFECT_SNEAK) == false and player:hasStatusEffect(EFFECT_INVISIBLE) == false) then + player:addStatusEffect(EFFECT_SNEAK,0,10,randTime); + player:addStatusEffect(EFFECT_INVISIBLE,0,10,randTime); + else ability:setMsg(283); -- no effect on player. - end + end - return 1; + return 1; end; \ No newline at end of file Index: scripts/globals/abilities/spirit_surge.lua =================================================================== --- scripts/globals/abilities/spirit_surge.lua (revision 0) +++ scripts/globals/abilities/spirit_surge.lua (working copy) @@ -0,0 +1,36 @@ +----------------------------------- +-- Ability: Spirit Surge +----------------------------------- + +require("scripts/globals/status"); + +----------------------------------- +-- OnUseAbility +----------------------------------- + +function OnAbilityCheck(player,target,ability) + -- The wyvern must be present in order to use Spirit Surge + if (target:getPet() == nil) then + return MSGBASIC_REQUIRES_A_PET,0; + else + return 0,0; + end +end; + +function OnUseAbility(player, target, ability) + -- Spirit Surge gives a Strength boost dependant of DRG level + local strBoost = 0; + if(target:getMainJob()==JOB_DRG) then + strBoost = (1 + target:getMainLvl()/5); -- Use Mainjob Lvl + elseif(target:getSubJob()==JOB_DRG) then + strBoost = (1 + target:getSubLvl()/5); -- Use Subjob Lvl + end + + -- Spirit Surge lasts 60 seconds, or 20 more if Wyrm Mail+2 is equipped + local duration = 60; + if(target:getEquipID(SLOT_BODY)==10683) then + duration = duration + 20; + end + + target:addStatusEffect(EFFECT_SPIRIT_SURGE, strBoost, 0, duration); +end; \ No newline at end of file Index: scripts/globals/abilities/sublimation.lua =================================================================== --- scripts/globals/abilities/sublimation.lua (revision 0) +++ scripts/globals/abilities/sublimation.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------- +-- Sublimation +-- Gradually creates a storage of MP while reducing your HP. +----------------------------------- +require("scripts/globals/settings"); +require("scripts/globals/status"); + +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + +function OnUseAbility(player, target, ability) + local power = 2 + player:getMod(MOD_SUBLIMATION); + if (player:hasStatusEffect(EFFECT_SUBLIMATION_ACTIVATED) or player:hasStatusEffect(EFFECT_SUBLIMATION_COMPLETE)) then + mp = player:getMod(MOD_SUBLIMATION_POOL); + if (player:hasStatusEffect(EFFECT_SUBLIMATION_ACTIVATED) == true) then + player:delStatusEffect(EFFECT_SUBLIMATION_ACTIVATED); + player:delMod(MOD_SUBLIMATION_POOL,player:getMod(MOD_SUBLIMATION_POOL)); + end + if (player:hasStatusEffect(EFFECT_SUBLIMATION_COMPLETE) == true) then + player:delStatusEffect(EFFECT_SUBLIMATION_COMPLETE); + end + + if ((player:getMaxMP() - player:getMP()) < mp) then + mp = (player:getMaxMP() - player:getMP()); + end + + ability:setMsg(451); + player:addMP(mp); + else + player:addStatusEffect(EFFECT_SUBLIMATION_ACTIVATED,power,3,7200); + end +end; \ No newline at end of file Index: scripts/globals/abilities/troubadour.lua =================================================================== --- scripts/globals/abilities/troubadour.lua (revision 0) +++ scripts/globals/abilities/troubadour.lua (working copy) @@ -0,0 +1,22 @@ +----------------------------------- +-- Ability: Troubadour +-- Increases casting time for songs +-- by 1.5 and double effect and +-- duration +----------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------- +-- OnUseAbility +----------------------------------- + +function OnAbilityCheck(player,target,ability) + return 0,0; +end; + +function OnUseAbility(player, target, ability) + local merits = player:getMerit(MERIT_TROUBADOUR); + player:addStatusEffect(EFFECT_TROUBADOUR,merits,0,60); +end; Index: scripts/globals/abilities/warcry.lua =================================================================== --- scripts/globals/abilities/warcry.lua (revision 3304) +++ scripts/globals/abilities/warcry.lua (working copy) @@ -18,6 +18,8 @@ local sHead = player:getEquipID(SLOT_HEAD) if(sHead == 15072 or sHead == 15245) then duration = duration + 10; + elseif(sHead == 15245) then + duration = duration + 15; elseif(sHead == 10650) then duration = duration + 20; end Index: scripts/globals/abilities/warding_circle.lua =================================================================== --- scripts/globals/abilities/warding_circle.lua (revision 3304) +++ scripts/globals/abilities/warding_circle.lua (working copy) @@ -14,5 +14,12 @@ end; function OnUseAbility(player, target, ability) - target:addStatusEffect(EFFECT_WARDING_CIRCLE,1,0,60); + local power = 8; + local duration = 60; + local head = target:getEquipID(SLOT_HEAD); + if(head == 15236 or head == 13868) then + power = 10; + duration = 90; + end + target:addStatusEffect(EFFECT_WARDING_CIRCLE,power,0,duration); end; Index: scripts/globals/abilities/weapon_bash.lua =================================================================== --- scripts/globals/abilities/weapon_bash.lua (revision 3304) +++ scripts/globals/abilities/weapon_bash.lua (working copy) @@ -9,14 +9,14 @@ -- OnUseAbility ----------------------------------- -function OnAbilityCheck(player,target,ability) +function OnAbilityCheck(player,target,ability) if (not player:isWeaponTwoHanded()) then return MSGBASIC_NEEDS_2H_WEAPON,0; else return 0,0; - end -end; - + end +end; + function OnUseAbility(player, target, ability) -- Applying Weapon Bash stun. Rate is said to be near 100%, so let's say 99%. if(math.random()*100 < 99) then Index: scripts/globals/bcnm.lua =================================================================== --- scripts/globals/bcnm.lua (revision 3304) +++ scripts/globals/bcnm.lua (working copy) @@ -7,26 +7,31 @@ -- array to map (for each zone) the item id of the valid trade item with the bcnmid in the database -- e.g. zone,{itemid,bcnmid,itemid,bcnmid,itemid,bcnmid} -- DO NOT INCLUDE MAAT FIGHTS -itemid_bcnmid_map = {10,{0,0},--The_Shrouded_Maw - 17,{0,0},--spire of holla - 19,{0,0},--spire of dem - 21,{0,0},--spire of mea - 23,{0,0},--Spire_of_Vahzl - 31,{0,0},--Monarch Linn - 139,{1553,11,1175,15,1180,17}, -- Horlais Peak - 140,{1551,34,1552,35,1552,36}, -- Ghelsba Outpost + +itemid_bcnmid_map = { 6,{640,0}, -- Bearclaw Pinnacle + 8,{672,0}, -- Boneyard + 10,{704,0,706,2}, -- The_Shrouded_Maw + 13,{736,0}, -- Mineshaft + 17,{0,0}, -- Spire of Holla + 19,{0,0}, -- Spire of Dem + 21,{0,0}, -- Spire of Mea + 23,{0,0}, -- Spire_of_Vahzl + 31,{0,0}, -- Monarch Linn + 32,{992,0,993,1}, -- Sealion Den + 139,{1553,11,1175,15,1180,17}, -- Horlais Peak + 140,{1551,34,1552,35,1552,36}, -- Ghelsba Outpost 144,{1166,68,1178,81,1553,76,1180,82,1130,79}, -- Waughroon Shrine - 146,{1553,107,1551,105}, -- Balgas Dias - 168,{0,0}, -- Chamber of Oracles - 170,{0,0}, -- Full Moon Fountain - 180,{1550,293}, -- LaLoff Amphitheater - 201,{1546,418,1174,417}, -- Cloister of Gales - 202,{1548,450,1172,449}, -- Cloister of Storms - 203,{1545,482,1171,481}, -- Cloister of Frost - 206,{0,0}, -- Qu'Bia Arena - 207,{1544,545}, -- Cloister of Flames - 209,{1547,578,1169,577}, -- Cloister of Tremors - 211,{1549,609}}; -- Cloister of Tides + 146,{1553,107,1551,105}, -- Balgas Dias + 168,{0,0}, -- Chamber of Oracles + 170,{0,0}, -- Full Moon Fountain + 180,{1550,293}, -- LaLoff Amphitheater + 201,{1546,418,1174,417}, -- Cloister of Gales + 202,{1548,450,1172,449}, -- Cloister of Storms + 203,{1545,482,1171,481}, -- Cloister of Frost + 206,{0,0}, -- Qu'Bia Arena + 207,{1544,545}, -- Cloister of Flames + 209,{1547,578,1169,577}, -- Cloister of Tremors + 211,{1549,609}}; -- Cloister of Tides -- array to map (for each zone) the BCNM ID to the Event Parameter corresponding to this ID. -- DO NOT INCLUDE MAAT FIGHTS (only included one for testing!) @@ -40,7 +45,7 @@ 21,{832,0}, 23,{864,0}, 31,{960,0,961,1}, - 139,{0,0,5,5,6,6,7,7,11,11,15,15,17,17}, + 139,{0,0,3,3,5,5,6,6,7,7,11,11,15,15,17,17}, 140,{32,0,33,1,34,2,35,3,36,4}, 144,{64,0,67,3,68,4,70,6,71,7,72,8,81,17,76,12,82,18,79,15}, 146,{96,0,101,5,102,6,103,7,107,11,105,9}, @@ -340,8 +345,18 @@ local mask = 0; Zone = player:getZone(); - - if(Zone == 10) then--The_Shrouded_Maw + + if(Zone == 6) then--bearclaw + if(player:getCurrentMission(COP) >= THREE_PATHS and player:getVar("Prishe") == 9) then--snoll + mask = GetBattleBitmask(640,Zone,1); + player:setVar("trade_bcnmid",640); + end + elseif(Zone == 8) then--boneyard + if(player:getVar("Prishe") == 5) then--h_wind + mask = GetBattleBitmask(672,Zone,1); + player:setVar("trade_bcnmid",672); + end + elseif(Zone == 10) then--The_Shrouded_Maw if(player:getCurrentMission(COP) == DARKNESS_NAMED and player:getVar("PromathiaStatus") == 2) then--DARKNESS_NAMED mask = GetBattleBitmask(704,Zone,1); player:setVar("trade_bcnmid",704); @@ -349,8 +364,14 @@ mask = GetBattleBitmask(706,Zone,1); player:setVar("trade_bcnmid",706); end + elseif(Zone == 13) then--mineshaft + if(player:getCurrentMission(COP) >= THREE_PATHS and player:getVar("louverance") == 5) then--bugbear + mask = GetBattleBitmask(736,Zone,1); + player:setVar("trade_bcnmid",736); + end + elseif(Zone == 17) then --Spire of Holla - if(player:getCurrentMission(COP) == THE_MOTHERCRYSTALS and player:hasKeyItem(LIGHT_OF_HOLLA) == false) then -- light of holla + if(player:getCurrentMission(COP) == THE_MOTHERCRYSTALS and player:hasKeyItem(LIGHT_OF_HOLLA) == false) then -- light of holla mask = GetBattleBitmask(768,Zone,1); player:setVar("trade_bcnmid",768); end @@ -376,12 +397,24 @@ elseif(player:getCurrentMission(COP) == THE_SAVAGE and player:getVar("PromathiaStatus") == 1) then mask = GetBattleBitmask(961,Zone,1); player:setVar("trade_bcnmid",961); - end + end + + elseif(Zone == 32) then --sealion den + if(player:getCurrentMission(COP) == ONE_TO_BE_FEARED and player:getVar("PromathiaStatus") == 1) then + mask = GetBattleBitmask(992,Zone,1); + player:setVar("trade_bcnmid",992); + elseif(player:getCurrentMission(COP) == THE_WARRIOR_S_PATH and player:getVar("PromathiaStatus") == 0) then + mask = GetBattleBitmask(993,Zone,1); + player:setVar("trade_bcnmid",993); + end elseif(Zone == 139) then -- Horlais Peak if((player:getCurrentMission(BASTOK) == THE_EMISSARY_SANDORIA2 or player:getCurrentMission(WINDURST) == THE_THREE_KINGDOMS_SANDORIA2) and player:getVar("MissionStatus") == 9) then -- Mission 2-3 mask = GetBattleBitmask(0,Zone,1); player:setVar("trade_bcnmid",0); + elseif(player:getCurrentMission(SANDORIA) == THE_SECRET_WEAPON and player:getVar("MissionStatus") == 0) then + mask = GetBattleBitmask(3,Zone,1); + player:setVar("trade_bcnmid",3); end elseif(Zone == 140) then -- Ghelsba Outpost MissionStatus = player:getVar("MissionStatus"); Index: scripts/globals/effects/addle.lua =================================================================== --- scripts/globals/effects/addle.lua (revision 3304) +++ scripts/globals/effects/addle.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------- -- --- --- +-- EFFECT ADDLE +-- Decreases enemy's MACC and +-- increases spellcasting time. ----------------------------------- ----------------------------------- @@ -9,6 +10,9 @@ ----------------------------------- function onEffectGain(target,effect) + local negPower = effect:getPower() * -1; + target:addMod(MOD_MACC, negPower); + target:addMod(MOD_FASTCAST, negPower); end; ----------------------------------- @@ -23,4 +27,7 @@ ----------------------------------- function onEffectLose(target,effect) + local negPower = effect:getPower() * -1; + target:delMod(MOD_MACC, negPower); + target:delMod(MOD_FASTCAST, negPower); end; \ No newline at end of file Index: scripts/globals/effects/aggressor.lua =================================================================== --- scripts/globals/effects/aggressor.lua (revision 3304) +++ scripts/globals/effects/aggressor.lua (working copy) @@ -11,8 +11,16 @@ ----------------------------------- function onEffectGain(target,effect) - target:addMod(MOD_ACC,25); - target:addMod(MOD_EVA,-25); + + local merit = target:getMerit(MERIT_AGGRESSIVE_AIM); + if(target:getObjType() == TYPE_PC) then + if ((target:getMainLvl() >= 75) and (target:getMainJob() == JOB_WAR)) then + target:addMod(MOD_RACC,merit); + end + end + + target:addMod(MOD_EVA,-25); + target:addMod(MOD_ACC,25); end; ----------------------------------- @@ -27,6 +35,12 @@ ----------------------------------- function onEffectLose(target,effect) - target:delMod(MOD_ACC,25); - target:delMod(MOD_EVA,-25); + local merit = target:getMerit(MERIT_AGGRESSIVE_AIM); + if(target:getObjType() == TYPE_PC) then + if ((target:getMainLvl() >= 75) and (target:getMainJob() == JOB_WAR)) then + target:delMod(MOD_RACC,merit); + end + end + target:delMod(MOD_ACC,25); + target:delMod(MOD_EVA,-25); end; \ No newline at end of file Index: scripts/globals/effects/aria.lua =================================================================== --- scripts/globals/effects/aria.lua (revision 3304) +++ scripts/globals/effects/aria.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_ARIA +-- Increases Charm Resistance to +-- Party Members within target AoE ----------------------------------- ----------------------------------- @@ -9,6 +9,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_CHARMRES,effect:getPower()); end; ----------------------------------- @@ -23,4 +24,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_CHARMRES,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/aubade.lua =================================================================== --- scripts/globals/effects/aubade.lua (revision 3304) +++ scripts/globals/effects/aubade.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------- -- --- --- +-- EFFECT_AUBADE +-- Increases Sleep Resistance to +-- Party Members within target AoE ----------------------------------- ----------------------------------- @@ -9,6 +10,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_SLEEPRES,effect:getPower()); end; ----------------------------------- @@ -23,4 +25,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_SLEEPRES,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/ballad.lua =================================================================== --- scripts/globals/effects/ballad.lua (revision 3304) +++ scripts/globals/effects/ballad.lua (working copy) @@ -18,7 +18,11 @@ ----------------------------------- function onEffectTick(target,effect) - target:addMP(effect:getPower()); + local mp = effect:getPower(); + + mp = mp + target:getMod(MOD_BALLAD) + target:getMod(MOD_ALL_SONGS); + + target:addMP(mp); end; ----------------------------------- Index: scripts/globals/effects/baraero.lua =================================================================== --- scripts/globals/effects/baraero.lua (revision 3304) +++ scripts/globals/effects/baraero.lua (working copy) @@ -12,6 +12,11 @@ function onEffectGain(target,effect) target:addMod(MOD_WINDRES,effect:getPower()); + extraBarspellEffect = 0; + if(target:getEquipID(SLOT_MAIN) == 17077 or target:getEquipID(SLOT_MAIN) == 17077) then + target:addMod(MOD_MDEF, 5); + extraBarspellEffect = 1; + end end; ----------------------------------- @@ -27,4 +32,7 @@ function onEffectLose(target,effect) target:delMod(MOD_WINDRES,effect:getPower()); + if(extraBarspellEffect == 1) then + target:delMod(MOD_MDEF, 5); + end end; \ No newline at end of file Index: scripts/globals/effects/barblizzard.lua =================================================================== --- scripts/globals/effects/barblizzard.lua (revision 3304) +++ scripts/globals/effects/barblizzard.lua (working copy) @@ -12,6 +12,11 @@ function onEffectGain(target,effect) target:addMod(MOD_ICERES,effect:getPower()); + extraBarspellEffect = 0; + if(target:getEquipID(SLOT_MAIN) == 17077 or target:getEquipID(SLOT_MAIN) == 17077) then + target:addMod(MOD_MDEF, 5); + extraBarspellEffect = 1; + end end; ----------------------------------- @@ -27,4 +32,7 @@ function onEffectLose(target,effect) target:delMod(MOD_ICERES,effect:getPower()); + if(extraBarspellEffect == 1) then + target:delMod(MOD_MDEF, 5); + end end; \ No newline at end of file Index: scripts/globals/effects/barfire.lua =================================================================== --- scripts/globals/effects/barfire.lua (revision 3304) +++ scripts/globals/effects/barfire.lua (working copy) @@ -11,7 +11,12 @@ ----------------------------------- function onEffectGain(target,effect) - target:addMod(MOD_FIRERES,effect:getPower()); + target:addMod(MOD_FIRERES,effect:getPower()); + extraBarspellEffect = 0; + if(target:getEquipID(SLOT_MAIN) == 17077 or target:getEquipID(SLOT_MAIN) == 17077) then + target:addMod(MOD_MDEF, 5); + extraBarspellEffect = 1; + end end; ----------------------------------- @@ -26,5 +31,8 @@ ----------------------------------- function onEffectLose(target,effect) - target:delMod(MOD_FIRERES,effect:getPower()); + target:delMod(MOD_FIRERES,effect:getPower()); + if(extraBarspellEffect == 1) then + target:delMod(MOD_MDEF, 5); + end end; \ No newline at end of file Index: scripts/globals/effects/barstone.lua =================================================================== --- scripts/globals/effects/barstone.lua (revision 3304) +++ scripts/globals/effects/barstone.lua (working copy) @@ -12,6 +12,11 @@ function onEffectGain(target,effect) target:addMod(MOD_EARTHRES,effect:getPower()); + extraBarspellEffect = 0; + if(target:getEquipID(SLOT_MAIN) == 17077 or target:getEquipID(SLOT_MAIN) == 17077) then + target:addMod(MOD_MDEF, 5); + extraBarspellEffect = 1; + end end; ----------------------------------- @@ -27,4 +32,7 @@ function onEffectLose(target,effect) target:delMod(MOD_EARTHRES,effect:getPower()); + if(extraBarspellEffect == 1) then + target:delMod(MOD_MDEF, 5); + end end; \ No newline at end of file Index: scripts/globals/effects/barthunder.lua =================================================================== --- scripts/globals/effects/barthunder.lua (revision 3304) +++ scripts/globals/effects/barthunder.lua (working copy) @@ -12,6 +12,11 @@ function onEffectGain(target,effect) target:addMod(MOD_THUNDERRES,effect:getPower()); + extraBarspellEffect = 0; + if(target:getEquipID(SLOT_MAIN) == 17077 or target:getEquipID(SLOT_MAIN) == 17077) then + target:addMod(MOD_MDEF, 5); + extraBarspellEffect = 1; + end end; ----------------------------------- @@ -27,4 +32,7 @@ function onEffectLose(target,effect) target:delMod(MOD_THUNDERRES,effect:getPower()); + if(extraBarspellEffect == 1) then + target:delMod(MOD_MDEF, 5); + end end; \ No newline at end of file Index: scripts/globals/effects/barwater.lua =================================================================== --- scripts/globals/effects/barwater.lua (revision 3304) +++ scripts/globals/effects/barwater.lua (working copy) @@ -12,6 +12,11 @@ function onEffectGain(target,effect) target:addMod(MOD_WATERRES,effect:getPower()); + extraBarspellEffect = 0; + if(target:getEquipID(SLOT_MAIN) == 17077 or target:getEquipID(SLOT_MAIN) == 17077) then + target:addMod(MOD_MDEF, 5); + extraBarspellEffect = 1; + end end; ----------------------------------- @@ -27,4 +32,7 @@ function onEffectLose(target,effect) target:delMod(MOD_WATERRES,effect:getPower()); + if(extraBarspellEffect == 1) then + target:delMod(MOD_MDEF, 5); + end end; \ No newline at end of file Index: scripts/globals/effects/berserk.lua =================================================================== --- scripts/globals/effects/berserk.lua (revision 3304) +++ scripts/globals/effects/berserk.lua (working copy) @@ -11,9 +11,42 @@ ----------------------------------- function onEffectGain(target,effect) -target:addMod(MOD_ATTP,25); -target:addMod(MOD_RATTP, 25); -target:addMod(MOD_DEFP,-25); + + defMod = -25; + atkMod = 25; + critMod = 0; + feet = target:getEquipID(SLOT_FEET); + weapon = target:getEquipID(SLOT_MAIN); + if (feet == 15132 or feet == 15665 or feet == 10730) then -- Warriors Calligae /+1/+2 + defMod = defMod + 10 + end + if (weapon == 18991) then -- Conqueror Lvl 75 + defMod = defMod - 5; + atkMod = atkMod + 5; + critMod = critMod + 5; + elseif (weapon == 19060) then -- Conqueror Lvl 80 + defMod = defMod - 6; + atkMod = atkMod + 6; + critMod = critMod + 7; + elseif (weapon == 19080) then -- Conqueror Lvl 85 + defMod = defMod - 7; + atkMod = atkMod + 7; + critMod = critMod + 9; + elseif (weapon == 19612 or weapon == 19710) then -- Conqueror Lvl 90-95 + defMod = defMod - 8; + atkMod = atkMod + 8; + critMod = critMod + 11; + elseif (weapon == 19819 or weapon == 19948) then -- Conqueror Lvl 99-99 + defMod = defMod - 8.5; + atkMod = atkMod + 8.5; + critMod = critMod + 14; + end + target:addMod(MOD_DEFP,defMod); + target:addMod(MOD_ATTP,atkMod); + target:addMod(MOD_RATTP, 25); + if (critMod > 0) then + target:addMod(MOD_CRITHITRATE, critMod); + end end; ----------------------------------- @@ -28,7 +61,10 @@ ----------------------------------- function onEffectLose(target,effect) -target:delMod(MOD_ATTP,25); -target:delMod(MOD_DEFP,-25); -target:delMod(MOD_RATTP, 25); + target:delMod(MOD_ATTP,atkMod); + target:delMod(MOD_RATTP, 25); + target:delMod(MOD_DEFP,defMod); + if (critMod > 0) then + target:delMod(MOD_CRITHITRATE, critMod); + end end; \ No newline at end of file Index: scripts/globals/effects/capriccio.lua =================================================================== --- scripts/globals/effects/capriccio.lua (revision 3304) +++ scripts/globals/effects/capriccio.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------- -- --- --- +-- EFFECT_CAPRICCIO +-- Increases Petrification Resistance +-- to Party Members within target AoE ----------------------------------- ----------------------------------- @@ -9,6 +10,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_PETRIFYRES,effect:getPower()); end; ----------------------------------- @@ -23,4 +25,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_PETRIFYRES,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/carol.lua =================================================================== --- scripts/globals/effects/carol.lua (revision 3304) +++ scripts/globals/effects/carol.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- +-- Carol +-- Increases a targets given elemental resistance -- --- --- ----------------------------------- ----------------------------------- @@ -9,6 +9,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(effect:getSubPower(), effect:getPower()); end; ----------------------------------- @@ -23,4 +24,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(effect:getSubPower(), effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/curse_i.lua =================================================================== --- scripts/globals/effects/curse_i.lua (revision 0) +++ scripts/globals/effects/curse_i.lua (working copy) @@ -0,0 +1,36 @@ +----------------------------------- +-- +-- +-- +----------------------------------- + +require("scripts/globals/status"); + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + --NOTE: The power amount dictates the amount to REDUCE MAX VALUES BY. E.g. Power=75 means 'reduce max hp/mp by 75%' + target:addMod(MOD_HPP,-effect:getPower()); + target:addMod(MOD_MPP,-effect:getPower()); + target:addMod(MOD_MOVE,-effect:getPower()); +end; + +----------------------------------- +-- onEffectTick Action +----------------------------------- + +function onEffectTick(target,effect) +end; + +----------------------------------- +-- onEffectLose Action +----------------------------------- + +function onEffectLose(target,effect) + --restore HP and MP to its former state. Remove 100% slow + target:delMod(MOD_HPP,-effect:getPower()); + target:delMod(MOD_MPP,-effect:getPower()); + target:delMod(MOD_MOVE,-effect:getPower()); +end; \ No newline at end of file Index: scripts/globals/effects/dark_seal.lua =================================================================== --- scripts/globals/effects/dark_seal.lua (revision 3304) +++ scripts/globals/effects/dark_seal.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_DARK_SEAL +-- Increases MACC of next Dark +-- Magic Spell cast ----------------------------------- ----------------------------------- @@ -9,6 +9,14 @@ ----------------------------------- function onEffectGain(target,effect) + if(target:getObjType() == TYPE_PC) then + local merit = target:getMerit(MERIT_DARK_SEAL); + local amount = 0; + if (merit > 0) then + amount = (merit - 1) * 10; + end + target:addMod(MOD_DARK_MAG_CAST, amount) + end end; ----------------------------------- @@ -23,4 +31,12 @@ ----------------------------------- function onEffectLose(target,effect) + if(target:getObjType() == TYPE_PC) then + local merit = target:getMerit(MERIT_DARK_SEAL); + local amount = 0; + if (merit > 0) then + amount = (merit - 1) * 10; + end + target:delMod(MOD_DARK_MAG_CAST, amount) + end end; \ No newline at end of file Index: scripts/globals/effects/defense_down.lua =================================================================== --- scripts/globals/effects/defense_down.lua (revision 3304) +++ scripts/globals/effects/defense_down.lua (working copy) @@ -11,10 +11,89 @@ ----------------------------------- function onEffectGain(target,effect) - if(effect:getPower()>100) then + omod = target:getMod(MOD_PIERCERES); + omod1 = target:getMod(MOD_SLASHRES); + omod2 = target:getMod(MOD_IMPACTRES); + omod3 = target:getMod(MOD_HTHRES); + if(effect:getPower()>100 and effect:getPower()< 500) then effect:setPower(50); + target:addMod(MOD_DEFP,-effect:getPower()); end - target:addMod(MOD_DEFP,-effect:getPower()); + if(effect:getPower()<100) then + target:addMod(MOD_DEFP,-effect:getPower()); + end + if(effect:getPower() == 500) then + target:addMod(MOD_PIERCERES,(omod * .5)); + target:addMod(MOD_SLASHRES,(omod1 * .5)); + target:addMod(MOD_IMPACTRES,(omod2 * .5)); + target:addMod(MOD_HTHRES,(omod3 * .5)); + end + if(effect:getPower() == 525) then + target:addMod(MOD_PIERCERES,(omod * .535)); + target:addMod(MOD_SLASHRES,(omod1 * .535)); + target:addMod(MOD_IMPACTRES,(omod2 * .535)); + target:addMod(MOD_HTHRES,(omod3 * .535)); + end + if(effect:getPower() == 550) then + target:addMod(MOD_PIERCERES,(omod * .57)); + target:addMod(MOD_SLASHRES,(omod1 * .57)); + target:addMod(MOD_IMPACTRES,(omod2 * .57)); + target:addMod(MOD_HTHRES,(omod3 * .57)); + end + if(effect:getPower() == 575) then + target:addMod(MOD_PIERCERES,(omod * .605)); + target:addMod(MOD_SLASHRES,(omod1 * .605)); + target:addMod(MOD_IMPACTRES,(omod2 * .605)); + target:addMod(MOD_HTHRES,(omod3 * .605)); + end + if(effect:getPower() == 600) then + target:addMod(MOD_PIERCERES,(omod * .703)); + target:addMod(MOD_SLASHRES,(omod1 * .703)); + target:addMod(MOD_IMPACTRES,(omod2 * .703)); + target:addMod(MOD_HTHRES,(omod3 * .703)); + end + if(effect:getPower() == 625) then + target:addMod(MOD_PIERCERES,(omod * .738)); + target:addMod(MOD_SLASHRES,(omod1 * .738)); + target:addMod(MOD_IMPACTRES,(omod2 * .738)); + target:addMod(MOD_HTHRES,(omod3 * .738)); + end + if(effect:getPower() == 650) then + target:addMod(MOD_PIERCERES,(omod * .773)); + target:addMod(MOD_SLASHRES,(omod1 * .773)); + target:addMod(MOD_IMPACTRES,(omod2 * .773)); + target:addMod(MOD_HTHRES,(omod3 * .773)); + end + if(effect:getPower() == 675) then + target:addMod(MOD_PIERCERES,(omod * .808)); + target:addMod(MOD_SLASHRES,(omod1 * .808)); + target:addMod(MOD_IMPACTRES,(omod2 * .808)); + target:addMod(MOD_HTHRES,(omod3 * .808)); + end + if(effect:getPower() == 700) then + target:addMod(MOD_PIERCERES,(omod * .969)); + target:addMod(MOD_SLASHRES,(omod1 * .969)); + target:addMod(MOD_IMPACTRES,(omod2 * .969)); + target:addMod(MOD_HTHRES,(omod3 * .969)); + end + if(effect:getPower() == 725 or effect:getPower() == 750 or effect:getPower() == 775) then + target:addMod(MOD_PIERCERES,omod); + target:addMod(MOD_SLASHRES,omod1); + target:addMod(MOD_IMPACTRES,omod2); + target:addMod(MOD_HTHRES,omod3); + end + if(effect:getPower() == 825 or effect:getPower() == 850 or effect:getPower() == 875) then + target:addMod(MOD_PIERCERES,omod); + target:addMod(MOD_SLASHRES,omod1); + target:addMod(MOD_IMPACTRES,omod2); + target:addMod(MOD_HTHRES,omod3); + end + if(effect:getPower() == 925 or effect:getPower() == 950 or effect:getPower() == 975) then + target:addMod(MOD_PIERCERES,omod); + target:addMod(MOD_SLASHRES,omod1); + target:addMod(MOD_IMPACTRES,omod2); + target:addMod(MOD_HTHRES,omod3); + end end; ----------------------------------- @@ -29,5 +108,82 @@ ----------------------------------- function onEffectLose(target,effect) - target:delMod(MOD_DEFP,-effect:getPower()); + if(effect:getPower()>100 and effect:getPower()<500)then + target:delMod(MOD_DEFP,-effect:getPower()); + end + if(effect:getPower()<100) then + target:delMod(MOD_DEFP,-effect:getPower()); + end + if(effect:getPower() == 500) then -- Banish I + target:delMod(MOD_PIERCERES,(omod * .5)); + target:delMod(MOD_SLASHRES,(omod1 * .5)); + target:delMod(MOD_IMPACTRES,(omod2 * .5)); + target:delMod(MOD_HTHRES,(omod3 * .5)); + end + if(effect:getPower() == 525) then -- Banish I with Ring or Mitts /+1 + target:delMod(MOD_PIERCERES,(omod * .535)); + target:delMod(MOD_SLASHRES,(omod1 * .535)); + target:delMod(MOD_IMPACTRES,(omod2 * .535)); + target:delMod(MOD_HTHRES,(omod3 * .535)); + end + if(effect:getPower() == 550) then -- Banish I with Ring and Mitts /+1 + target:delMod(MOD_PIERCERES,(omod * .57)); + target:delMod(MOD_SLASHRES,(omod1 * .57)); + target:delMod(MOD_IMPACTRES,(omod2 * .57)); + target:delMod(MOD_HTHRES,(omod3 * .57)); + end + if(effect:getPower() == 575) then -- Banish I with Ring and Mitts +2 + target:delMod(MOD_PIERCERES,(omod * .605)); + target:delMod(MOD_SLASHRES,(omod1 * .605)); + target:delMod(MOD_IMPACTRES,(omod2 * .605)); + target:delMod(MOD_HTHRES,(omod3 * .605)); + end + if(effect:getPower() == 600) then -- Banish II + target:delMod(MOD_PIERCERES,(omod * .703)); + target:delMod(MOD_SLASHRES,(omod1 * .703)); + target:delMod(MOD_IMPACTRES,(omod2 * .703)); + target:delMod(MOD_HTHRES,(omod3 * .703)); + end + if(effect:getPower() == 625) then -- Banish II with Ring or Mitts /+1 + target:delMod(MOD_PIERCERES,(omod * .738)); + target:delMod(MOD_SLASHRES,(omod1 * .738)); + target:delMod(MOD_IMPACTRES,(omod2 * .738)); + target:delMod(MOD_HTHRES,(omod3 * .738)); + end + if(effect:getPower() == 650) then -- Banish II with Ring and Mitts /+1 + target:delMod(MOD_PIERCERES,(omod * .773)); + target:delMod(MOD_SLASHRES,(omod1 * .773)); + target:delMod(MOD_IMPACTRES,(omod2 * .773)); + target:delMod(MOD_HTHRES,(omod3 * .773)); + end + if(effect:getPower() == 675) then -- Banish II with Ring and Mitts /+1 + target:delMod(MOD_PIERCERES,(omod * .805)); + target:delMod(MOD_SLASHRES,(omod1 * .805)); + target:delMod(MOD_IMPACTRES,(omod2 * .805)); + target:delMod(MOD_HTHRES,(omod3 * .805)); + end + if(effect:getPower() == 700) then -- Banish II + target:delMod(MOD_PIERCERES,(omod * .969)); + target:delMod(MOD_SLASHRES,(omod1 * .969)); + target:delMod(MOD_IMPACTRES,(omod2 * .969)); + target:delMod(MOD_HTHRES,(omod3 * .969)); + end + if(effect:getPower() == 725 or effect:getPower() == 750 or effect:getPower() == 775) then -- Banish III with Ring and Mitts + target:delMod(MOD_PIERCERES,omod); + target:delMod(MOD_SLASHRES,omod1); + target:delMod(MOD_IMPACTRES,omod2); + target:delMod(MOD_HTHRES,omod3); + end + if(effect:getPower() == 825 or effect:getPower() == 850 or effect:getPower() == 875) then -- Banish IV with Ring and Mitts + target:delMod(MOD_PIERCERES,omod); + target:delMod(MOD_SLASHRES,omod1); + target:delMod(MOD_IMPACTRES,omod2); + target:delMod(MOD_HTHRES,omod3); + end + if(effect:getPower() == 925 or effect:getPower() == 950 or effect:getPower() == 975) then -- Banish V with Ring and Mitts + target:delMod(MOD_PIERCERES,omod); + target:delMod(MOD_SLASHRES,omod1); + target:delMod(MOD_IMPACTRES,omod2); + target:delMod(MOD_HTHRES,omod3); + end end; \ No newline at end of file Index: scripts/globals/effects/dia.lua =================================================================== --- scripts/globals/effects/dia.lua (revision 3304) +++ scripts/globals/effects/dia.lua (working copy) @@ -1,13 +1,15 @@ ------------------------------------ --- +------------------------------------------- -- EFFECT_DIA --- ----------------------------------- +-- Lowers an enemy's defense and +-- gradually deals light elemental damage. +------------------------------------------- -- Quick Explanation of Algorithm: -- Dia 1: Power of 1. Results in reduced defense of ~5.27% (27/512) and 1 hp/tick damage. -- Dia 2: Power of 2. Results in reduced defense of ~10.35% (53/512) and 2 hp/tick damage. -- Dia 3: Power of 3. Results in reduced defense of ~15.4% (79/512) and 3 hp/tick damage. ------------------------------------ +-- Dia 4: Power of 4. Results in reduced defense of ~20.5% (105/512) and 4 hp/tick damage. +-- Dia 5: Power of 5. Results in reduced defense of ~25.6% (131/512) and 5 hp/tick damage. +------------------------------------------- require("scripts/globals/status"); @@ -28,9 +30,9 @@ function onEffectTick(target,effect) if(target:hasStatusEffect(EFFECT_STONESKIN)) then local skin = target:getMod(MOD_STONESKIN); - local dmg = effect:getPower(); + local dmg = effect:getPower() + diaPowerMod; if(skin >= dmg) then --absorb all damage - target:delMod(MOD_STONESKIN,effect:getPower()); + target:delMod(MOD_STONESKIN,(effect:getPower() + diaPowerMod)); else target:delStatusEffect(EFFECT_STONESKIN); target:delHP(dmg - skin); @@ -38,7 +40,7 @@ end else - target:delHP(effect:getPower()); + target:delHP(effect:getPower() + diaPowerMod); target:wakeUp(); end end; Index: scripts/globals/effects/dirge.lua =================================================================== --- scripts/globals/effects/dirge.lua (revision 3304) +++ scripts/globals/effects/dirge.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_DIRGE +-- Enmity - and gains it back over time +-- I'm sure it's not correct but a stop gap until it's implemented. ----------------------------------- ----------------------------------- @@ -9,6 +9,9 @@ ----------------------------------- function onEffectGain(target,effect) + emod = effect:getPower() * -1; + emod = emod + (target:getMod(MOD_ALL_SONGS) * 2); + target:addMod(MOD_ENMITY,emod); end; ----------------------------------- @@ -16,6 +19,12 @@ ----------------------------------- function onEffectTick(target,effect) + -- the effect gains enmity of 1 every 3 ticks depending on the source of the enmity boost + enmity_effect_size = (effect:getPower() + (target:getMod(MOD_ALL_SONGS) * 2)); + if(enmity_effect_size > 0) then + effect:setPower(enmity_effect_size - 1); + target:delMod(MOD_ENMITY,-1); + end end; ----------------------------------- @@ -23,4 +32,8 @@ ----------------------------------- function onEffectLose(target,effect) + if(enmity_effect_size > 0) then + enmity_effect_size = enmity_effect_size * -1; + target:delMod(MOD_ENMITY,enmity_effect_size); + end end; \ No newline at end of file Index: scripts/globals/effects/disease.lua =================================================================== --- scripts/globals/effects/disease.lua (revision 3304) +++ scripts/globals/effects/disease.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- EFFECT_NONE --- +-- EFFECT_DISEASE +-- Covered in Healing effect +-- Can not regain HP or MP by /heal ----------------------------------- ----------------------------------- Index: scripts/globals/effects/doom.lua =================================================================== --- scripts/globals/effects/doom.lua (revision 3304) +++ scripts/globals/effects/doom.lua (working copy) @@ -1,7 +1,6 @@ ----------------------------------- --- --- --- +-- EFFECT_DOOM +-- Countdown from 10 then die. ----------------------------------- ----------------------------------- Index: scripts/globals/effects/elegy.lua =================================================================== --- scripts/globals/effects/elegy.lua (revision 3304) +++ scripts/globals/effects/elegy.lua (working copy) @@ -1,7 +1,6 @@ ----------------------------------- --- --- EFFECT_NONE --- +-- EFFECT_ELEGY +-- Reduces an enemy's attack speed ----------------------------------- require("scripts/globals/status"); Index: scripts/globals/effects/embrava.lua =================================================================== --- scripts/globals/effects/embrava.lua (revision 0) +++ scripts/globals/effects/embrava.lua (working copy) @@ -0,0 +1,34 @@ +----------------------------------- +-- +-- EFFECT_REGEN +-- +----------------------------------- + +require("scripts/globals/status"); + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_REGEN, embravaRegen); + target:addMod(MOD_REGAIN, embravaRegain); + target:addMod(MOD_HASTE_MAGIC, embravaHaste); +end; + +----------------------------------- +-- onEffectTick Action +----------------------------------- + +function onEffectTick(target,effect) +end; + +----------------------------------- +-- onEffectLose Action +----------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_REGEN, embravaRegen); + target:delMod(MOD_REGAIN, embravaRegain); + target:delMod(MOD_HASTE_MAGIC, embravaHaste); +end; \ No newline at end of file Index: scripts/globals/effects/enfire.lua =================================================================== --- scripts/globals/effects/enfire.lua (revision 3304) +++ scripts/globals/effects/enfire.lua (working copy) @@ -1,7 +1,6 @@ ----------------------------------- --- --- --- +-- EFFECT_ENFIRE +-- Enchants weapon with fire dmg ----------------------------------- require("scripts/globals/status"); Index: scripts/globals/effects/enmity_boost.lua =================================================================== --- scripts/globals/effects/enmity_boost.lua (revision 3304) +++ scripts/globals/effects/enmity_boost.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- -- --- --- +-- EFFECT_ENMITY_BOOST +-- Increases enmity ----------------------------------- require("scripts/globals/status"); Index: scripts/globals/effects/fantasia.lua =================================================================== --- scripts/globals/effects/fantasia.lua (revision 3304) +++ scripts/globals/effects/fantasia.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_FANTASIA +-- Increases Blindness Resistance to +-- Party Members within target AoE ----------------------------------- ----------------------------------- @@ -9,6 +9,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_BLINDRES,effect:getPower()); end; ----------------------------------- @@ -23,4 +24,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_BLINDRES,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/fugue.lua =================================================================== --- scripts/globals/effects/fugue.lua (revision 3304) +++ scripts/globals/effects/fugue.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_FUGUE +-- Increases Gravity Resistance to +-- Party Members within target AoE ----------------------------------- ----------------------------------- @@ -9,6 +9,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_GRAVITYRES,effect:getPower()); end; ----------------------------------- @@ -23,4 +24,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_GRAVITYRES,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/gavotte.lua =================================================================== --- scripts/globals/effects/gavotte.lua (revision 3304) +++ scripts/globals/effects/gavotte.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_GAVOTTE +-- Increases Bind Resistance to +-- Party Members within target AoE ----------------------------------- ----------------------------------- @@ -9,6 +9,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_BINDRES,effect:getPower()); end; ----------------------------------- @@ -23,4 +24,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_BINDRES,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/hum.lua =================================================================== --- scripts/globals/effects/hum.lua (revision 3304) +++ scripts/globals/effects/hum.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_HUM +-- Increases Paralyze Resistance to +-- Party Members within target AoE ----------------------------------- ----------------------------------- @@ -9,6 +9,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_PARALYZERES,effect:getPower()); end; ----------------------------------- @@ -23,4 +24,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_PARALYZERES,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/hymnus.lua =================================================================== --- scripts/globals/effects/hymnus.lua (revision 3304) +++ scripts/globals/effects/hymnus.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------- -- --- --- +-- EFFECT_HYMNUS +-- Grants Reraise to Party Members +-- within target AoE ----------------------------------- ----------------------------------- @@ -9,6 +10,7 @@ ----------------------------------- function onEffectGain(target,effect) + -- power level is the raise number (3) end; ----------------------------------- @@ -16,6 +18,9 @@ ----------------------------------- function onEffectTick(target,effect) + if(target:getHP() <= 0) then + target:sendRaise(effect:getPower()); + end end; ----------------------------------- Index: scripts/globals/effects/ifrits_favor.lua =================================================================== --- scripts/globals/effects/ifrits_favor.lua (revision 3304) +++ scripts/globals/effects/ifrits_favor.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- +-- Effect: Ifrit's Favor +-- Effect: Enhances Double Attack -- --- --- ----------------------------------- ----------------------------------- @@ -9,6 +9,10 @@ ----------------------------------- function onEffectGain(target,effect) + if(effect:getPower()>100) then + effect:setPower(50); + end + target:addMod(MOD_DOUBLE_ATTACK,effect:getPower()); end; ----------------------------------- @@ -23,4 +27,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_DOUBLE_ATTACK,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/innin.lua =================================================================== --- scripts/globals/effects/innin.lua (revision 3304) +++ scripts/globals/effects/innin.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- +-- Effect: +-- Innin -- --- --- ----------------------------------- require("scripts/globals/status"); ----------------------------------- Index: scripts/globals/effects/kaustra.lua =================================================================== --- scripts/globals/effects/kaustra.lua (revision 0) +++ scripts/globals/effects/kaustra.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------- +-- EFFECT_KAUSTRA +-- Relentless dark damage slowly +-- devours an enemy. +----------------------------------- + +require("scripts/globals/status"); + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------- +-- onEffectTick Action +----------------------------------- + +function onEffectTick(target,effect) + if(target:hasStatusEffect(EFFECT_STONESKIN)) then + local skin = target:getMod(MOD_STONESKIN); + local dmg = effect:getPower(); + if(skin >= dmg) then --absorb all damage + target:delMod(MOD_STONESKIN,effect:getPower()); + else + target:delStatusEffect(EFFECT_STONESKIN); + target:delHP(dmg - skin); + target:wakeUp(); + end + + else + target:delHP(effect:getPower()); + target:wakeUp(); + end +end; + + +----------------------------------- +-- onEffectLose Action +----------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/effects/last_resort.lua =================================================================== --- scripts/globals/effects/last_resort.lua (revision 3304) +++ scripts/globals/effects/last_resort.lua (working copy) @@ -11,9 +11,16 @@ ----------------------------------- function onEffectGain(target,effect) - target:addMod(MOD_ATTP,15 + target:getMerit(MERIT_LAST_RESORT_EFFECT)); + local defMod = 0; + local merit = target:getMerit(MERIT_LAST_RESORT_EFFECT); + local feet = target:getEquipID(SLOT_FEET); + if(feet == 10737 or feet == 15672 or feet == 15139) then + defMod = defMod + 10; + end + target:addMod(MOD_ATTP,15 + merit); -- print(target:getMerit(MERIT_LAST_RESORT_EFFECT)); - target:addMod(MOD_DEFP,-15 - target:getMerit(MERIT_LAST_RESORT_EFFECT)); + + target:addMod(MOD_DEFP,((-15 - merit) + defMod)); target:addMod(MOD_HASTE_ABILITY, effect:getPower()) end; @@ -29,7 +36,7 @@ ----------------------------------- function onEffectLose(target,effect) - target:delMod(MOD_ATTP,15 + target:getMerit(MERIT_LAST_RESORT_EFFECT)); - target:delMod(MOD_DEFP,-15 - target:getMerit(MERIT_LAST_RESORT_EFFECT)); + target:delMod(MOD_ATTP,15 + merit); + target:delMod(MOD_DEFP,((-15 - merit) + defMod)); target:delMod(MOD_HASTE_ABILITY, effect:getPower()) end; \ No newline at end of file Index: scripts/globals/effects/madrigal.lua =================================================================== --- scripts/globals/effects/madrigal.lua (revision 3304) +++ scripts/globals/effects/madrigal.lua (working copy) @@ -1,15 +1,55 @@ ----------------------------------- --- -- EFFECT_MADRIGAL -- getPower returns the TIER (e.g. 1,2,3,4) ----------------------------------- + require("scripts/globals/status"); + ----------------------------------- -- onEffectGain Action ----------------------------------- function onEffectGain(target,effect) - target:addMod(MOD_ACC, effect:getPower()); + acc = 0; + local accCap1 = 15; + local accCap2 = 30; + if(effect:getPower()==1) then + acc = accCap1; + elseif(effect:getPower()==2) then + acc = accCap2; + end + + if(target:getObjType() == TYPE_PC) then + local merit = target:getMerit(MERIT_MADRIGAL_EFFECT); + acc = acc + merit; + end + + local mod = 0; + local power = 0; + power = power + target:getMod(MOD_MADRIGAL) + target:getMod(MOD_ALL_SONGS); + + if (power == 1) then + mod = 1; + elseif (power == 2) then + mod = 4; + elseif (power == 3) then + mod = 7; + elseif (power == 4) then + mod = 10; + elseif (power == 5) then + mod = 13; + end + + acc = acc + mod; + + oneirosTathlum = 0; + if(target:getEquipID(SLOT_AMMO) == 19762) then -- Oneiros Tathlum + target:addMod(MOD_ATT,6); + oneirosTathlum = 1; + end + -- printf("Acc Gained %u",acc); + + target:addMod(MOD_ACC,acc); end; ----------------------------------- @@ -24,5 +64,9 @@ ----------------------------------- function onEffectLose(target,effect) - target:delMod(MOD_ACC, effect:getPower()); + target:delMod(MOD_ACC,acc); + -- printf("Acc Lost %u",acc); + if(oneirosTathlum == 1) then -- Oneiros Tathlum was equipped on song cast + target:delMod(MOD_ATT,6); + end end; \ No newline at end of file Index: scripts/globals/effects/magic_acc_down.lua =================================================================== --- scripts/globals/effects/magic_acc_down.lua (revision 3304) +++ scripts/globals/effects/magic_acc_down.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------- -- --- EFFECT_NONE --- +-- EFFECT_MAGIC_ACC_DOWN +-- Increases / Decreases +-- Magic Acc ----------------------------------- ----------------------------------- @@ -9,7 +10,9 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_MACC,effect:getPower()); end; +end; ----------------------------------- -- onEffectTick Action @@ -23,4 +26,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_MACC,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/mambo.lua =================================================================== --- scripts/globals/effects/mambo.lua (revision 3304) +++ scripts/globals/effects/mambo.lua (working copy) @@ -11,10 +11,20 @@ ----------------------------------- function onEffectGain(target,effect) + local mod = 0; + mamboPower = 15; + mamboPower2 = 28; + + mod = mod + target:getMod(MOD_MAMBO) + target:getMod(MOD_ALL_SONGS); + + mamboPower = mamboPower + (mod * 3); + mamboPower2 = mamboPower2 + (mod * 7); + + if(effect:getPower()==1) then - target:addMod(MOD_EVA, 15); + target:addMod(MOD_EVA, mamboPower); elseif(effect:getPower()==2) then - target:addMod(MOD_EVA, 28); + target:addMod(MOD_EVA, mamboPower2); end end; @@ -31,8 +41,8 @@ function onEffectLose(target,effect) if(effect:getPower()==1) then - target:delMod(MOD_EVA, 15); + target:delMod(MOD_EVA, mamboPower); elseif(effect:getPower()==2) then - target:delMod(MOD_EVA, 28); + target:delMod(MOD_EVA, mamboPower2); end end; \ No newline at end of file Index: scripts/globals/effects/march.lua =================================================================== --- scripts/globals/effects/march.lua (revision 3304) +++ scripts/globals/effects/march.lua (working copy) @@ -1,20 +1,39 @@ ----------------------------------- --- -- EFFECT_MARCH -- getPower returns the TIER (e.g. 1,2,3,4) -- DO NOT ALTER ANY OF THE EFFECT VALUES! DO NOT ALTER EFFECT POWER! -- Todo: Find a better way of doing this. Need to account for varying modifiers + CASTER's skill (not target) ----------------------------------- + require("scripts/globals/status"); + ----------------------------------- -- onEffectGain Action ----------------------------------- function onEffectGain(target,effect) - if(effect:getPower()==1) then - target:addMod(MOD_HASTE_MAGIC, 64); - elseif(effect:getPower()==2) then - target:addMod(MOD_HASTE_MAGIC, 96); + haste1 = 64; + haste2 = 96; + + local mod = 0; + + mod = mod + target:getMod(MOD_MARCH) + target:getMod(MOD_ALL_SONGS); + + if (mod < 5) then + haste1 = haste1 + (16 * mod); + haste2 = haste2 + (16 * mod); + elseif (mod == 5) then + haste1 = haste1 + 80; + haste2 = haste2 + 80; + end; + + -- printf("Haste Tier 1 %u",haste1); + -- printf("Haste Tier 2 %u",haste2); + + if(effect:getPower() == 1) then + target:addMod(MOD_HASTE_MAGIC, haste1); + elseif(effect:getPower() == 2) then + target:addMod(MOD_HASTE_MAGIC, haste2); end end; @@ -30,9 +49,9 @@ ----------------------------------- function onEffectLose(target,effect) - if(effect:getPower()==1) then - target:delMod(MOD_HASTE_MAGIC, 64); - elseif(effect:getPower()==2) then - target:delMod(MOD_HASTE_MAGIC, 96); + if(effect:getPower() == 1) then + target:delMod(MOD_HASTE_MAGIC, haste1); + elseif(effect:getPower() == 2) then + target:delMod(MOD_HASTE_MAGIC, haste2); end end; \ No newline at end of file Index: scripts/globals/effects/minne.lua =================================================================== --- scripts/globals/effects/minne.lua (revision 3304) +++ scripts/globals/effects/minne.lua (working copy) @@ -1,5 +1,4 @@ ----------------------------------- --- -- EFFECT_MINNE -- getPower returns the TIER (e.g. 1,2,3,4) -- DO NOT ALTER ANY OF THE EFFECT VALUES! DO NOT ALTER EFFECT POWER! @@ -11,16 +10,45 @@ ----------------------------------- function onEffectGain(target,effect) + titanisEarring = 0; + if (target:getEquipID(SLOT_EAR1) == 14765 or target:getEquipID(SLOT_EAR2) == 14765) then -- Titanis Earring + target:addMod(MOD_ENMITY, 4); + titanisEarring = 1; + end + local power = 0; + mod = 0; + + power = power + target:getMod(MOD_MINNE) + target:getMod(MOD_ALL_SONGS); + + if (power == 1) then + mod = 1; + elseif (power == 2) then + mod = 5; + elseif (power == 3) then + mod = 9; + elseif (power == 4) then + mod = 13; + elseif (power == 5) then + mod = 17; + else + mod = 0; + end + + if(target:getObjType() == TYPE_PC) then + mod = mod + target:getMerit(MERIT_MINNE_EFFECT); + end + -- printf("Mod Power %u",mod); + -- printf("Mods %u",power); if(effect:getPower()==1) then - target:addMod(MOD_DEF, 14); + target:addMod(MOD_DEF, (14 + mod)); elseif(effect:getPower()==2) then - target:addMod(MOD_DEF, 28); + target:addMod(MOD_DEF, (28 + mod)); elseif(effect:getPower()==3) then - target:addMod(MOD_DEF, 40); + target:addMod(MOD_DEF, (40 + mod)); elseif(effect:getPower()==4) then - target:addMod(MOD_DEF, 48); + target:addMod(MOD_DEF, (48 + mod)); elseif(effect:getPower()==5) then - target:addMod(MOD_DEF, 60); + target:addMod(MOD_DEF, (60 + mod)); end end; @@ -36,15 +64,18 @@ ----------------------------------- function onEffectLose(target,effect) + if (titanisEarring == 1) then -- Titanis Earring equipped when song was cast + target:delMod(MOD_ENMITY, 4); + end if(effect:getPower()==1) then - target:delMod(MOD_DEF, 14); + target:delMod(MOD_DEF, (14 + mod)); elseif(effect:getPower()==2) then - target:delMod(MOD_DEF, 28); + target:delMod(MOD_DEF, (28 + mod)); elseif(effect:getPower()==3) then - target:delMod(MOD_DEF, 40); + target:delMod(MOD_DEF, (40 + mod)); elseif(effect:getPower()==4) then - target:delMod(MOD_DEF, 48); + target:delMod(MOD_DEF, (48 + mod)); elseif(effect:getPower()==5) then - target:delMod(MOD_DEF, 60); + target:delMod(MOD_DEF, (60 + mod)); end end; \ No newline at end of file Index: scripts/globals/effects/minuet.lua =================================================================== --- scripts/globals/effects/minuet.lua (revision 3304) +++ scripts/globals/effects/minuet.lua (working copy) @@ -1,5 +1,4 @@ ----------------------------------- --- -- EFFECT_MINUET -- getPower returns the TIER (e.g. 1,2,3,4) -- DO NOT ALTER ANY OF THE EFFECT VALUES! DO NOT ALTER EFFECT POWER! @@ -11,14 +10,49 @@ ----------------------------------- function onEffectGain(target,effect) + local power = 0; + mod = 0; + minuetEarring = 0; + if (target:getEquipID(SLOT_EAR1) == 14764 or target:getEquipID(SLOT_EAR2) == 14764) then -- Minuet Earring + target:addMod(MOD_ACC, 3); + minuetEarring = 1; + end + + power = power + target:getMod(MOD_MINUET) + target:getMod(MOD_ALL_SONGS); + + + if (power == 1) then + mod = 1; + elseif (power == 2) then + mod = 5; + elseif (power == 3) then + mod = 9; + elseif (power == 4) then + mod = 13; + elseif (power == 5) then + mod = 17; + end + + if(target:getObjType() == TYPE_PC) then + mod = mod + target:getMerit(MERIT_MINUET_EFFECT); + end + + -- printf("Mod Power %u",mod); if(effect:getPower()==1) then - target:addMod(MOD_ATT, 15); + target:addMod(MOD_ATT, (15 + mod)); + target:addMod(MOD_RATT, (15 + mod)); elseif(effect:getPower()==2) then - target:addMod(MOD_ATT, 32); + target:addMod(MOD_ATT, (32 + mod)); + target:addMod(MOD_RATT, (32 + mod)); elseif(effect:getPower()==3) then - target:addMod(MOD_ATT, 48); + target:addMod(MOD_ATT, (48 + mod)); + target:addMod(MOD_RATT, (48 + mod)); elseif(effect:getPower()==4) then - target:addMod(MOD_ATT, 56); + target:addMod(MOD_ATT, (56 + mod)); + target:addMod(MOD_RATT, (56 + mod)); + elseif(effect:getPower()==5) then + target:addMod(MOD_ATT, (62 + mod)); + target:addMod(MOD_RATT, (62 + mod)); end end; @@ -34,13 +68,24 @@ ----------------------------------- function onEffectLose(target,effect) + if (minuetEarring == 1) then -- Minuet Earring was equipped when song was cast + target:delMod(MOD_ACC, 3); + end + if(effect:getPower()==1) then - target:delMod(MOD_ATT, 15); + target:delMod(MOD_ATT, (15 + mod)); + target:delMod(MOD_RATT, (15 + mod)); elseif(effect:getPower()==2) then - target:delMod(MOD_ATT, 32); + target:delMod(MOD_ATT, (32 + mod)); + target:delMod(MOD_RATT, (32 + mod)); elseif(effect:getPower()==3) then - target:delMod(MOD_ATT, 48); + target:delMod(MOD_ATT, (48 + mod)); + target:delMod(MOD_RATT, (48 + mod)); elseif(effect:getPower()==4) then - target:delMod(MOD_ATT, 56); + target:delMod(MOD_ATT, (56 + mod)); + target:delMod(MOD_RATT, (56 + mod)); + elseif(effect:getPower()==5) then + target:delMod(MOD_ATT, (62 + mod)); + target:delMod(MOD_RATT, (62 + mod)); end end; \ No newline at end of file Index: scripts/globals/effects/negate_amnesia.lua =================================================================== --- scripts/globals/effects/negate_amnesia.lua (revision 3304) +++ scripts/globals/effects/negate_amnesia.lua (working copy) @@ -1,7 +1,6 @@ ----------------------------------- --- --- --- +-- EFFECT_NEGATE_AMNESIA +-- Amnesia Resistance +100 ----------------------------------- ----------------------------------- @@ -9,6 +8,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_AMNESIARES, 100); end; ----------------------------------- @@ -23,4 +23,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_AMNESIARES, 100); end; \ No newline at end of file Index: scripts/globals/effects/negate_doom.lua =================================================================== --- scripts/globals/effects/negate_doom.lua (revision 3304) +++ scripts/globals/effects/negate_doom.lua (working copy) @@ -1,7 +1,6 @@ ----------------------------------- --- --- --- +-- EFFECT_NEGATE_DOOM +-- DooM Resistance +100 ----------------------------------- ----------------------------------- @@ -9,6 +8,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_DOOMRES, 100); end; ----------------------------------- @@ -23,4 +23,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_DOOMRES, 100); end; \ No newline at end of file Index: scripts/globals/effects/negate_petrify.lua =================================================================== --- scripts/globals/effects/negate_petrify.lua (revision 3304) +++ scripts/globals/effects/negate_petrify.lua (working copy) @@ -1,7 +1,6 @@ ----------------------------------- --- --- --- +-- EFFECT_NEGATE_PETRIFY +-- Pterify Resistance +100 ----------------------------------- ----------------------------------- @@ -9,6 +8,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_PETRIFYRES, 100); end; ----------------------------------- @@ -23,4 +23,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_PETRIFYRES, 100); end; \ No newline at end of file Index: scripts/globals/effects/negate_poison.lua =================================================================== --- scripts/globals/effects/negate_poison.lua (revision 3304) +++ scripts/globals/effects/negate_poison.lua (working copy) @@ -1,7 +1,6 @@ ----------------------------------- --- --- --- +-- EFFECT_NEGATE_POISON +-- Poison Resistance +100 ----------------------------------- ----------------------------------- @@ -9,6 +8,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_POISONRES, 100); end; ----------------------------------- @@ -23,4 +23,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_POISONRES, 100); end; \ No newline at end of file Index: scripts/globals/effects/negate_terror.lua =================================================================== --- scripts/globals/effects/negate_terror.lua (revision 3304) +++ scripts/globals/effects/negate_terror.lua (working copy) @@ -1,7 +1,6 @@ ----------------------------------- --- --- --- +-- EFFECT_NEGATE_TERROR +-- Terror Resistance +100 ----------------------------------- ----------------------------------- @@ -9,6 +8,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_TERRORRES, 100); end; ----------------------------------- @@ -23,4 +23,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_TERRORRES, 100); end; \ No newline at end of file Index: scripts/globals/effects/nightingale.lua =================================================================== --- scripts/globals/effects/nightingale.lua (revision 3304) +++ scripts/globals/effects/nightingale.lua (working copy) @@ -1,7 +1,6 @@ ----------------------------------- --- --- --- +-- EFFECT_NIGHTINGALE +-- Halves recast times of songs. ----------------------------------- ----------------------------------- @@ -9,6 +8,22 @@ ----------------------------------- function onEffectGain(target,effect) + + local power = 0; + + if(effect:getPower() == 25) then + power = 50; + elseif(effect:getPower() == 50) then + power = 63; + elseif(effect:getPower() == 75) then + power = 75; + elseif(effect:getPower() == 100) then + power = 88; + elseif(effect:getPower() == 125) then + power = 100; + end + + target:addMod(MOD_SONG_RECAST,power) end; ----------------------------------- @@ -23,4 +38,21 @@ ----------------------------------- function onEffectLose(target,effect) + + local power = 0; + + if(effect:getPower() == 25) then + power = 50; + elseif(effect:getPower() == 50) then + power = 63; + elseif(effect:getPower() == 75) then + power = 75; + elseif(effect:getPower() == 100) then + power = 88; + elseif(effect:getPower() == 125) then + power = 100; + end + + target:delMod(MOD_SONG_RECAST,power) + end; \ No newline at end of file Index: scripts/globals/effects/operetta.lua =================================================================== --- scripts/globals/effects/operetta.lua (revision 3304) +++ scripts/globals/effects/operetta.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_OPERETTA +-- Puppet's, Scop's, and Jester's +-- Operettas ----------------------------------- ----------------------------------- @@ -9,6 +9,20 @@ ----------------------------------- function onEffectGain(target,effect) + modPower = 0; + + modPower = modPower + (target:getMod(MOD_ALL_SONGS) * 5) + + if(effect:getPower()==1) then + modPower = 20; + target:addMod(MOD_SILENCERES,modPower); + elseif(effect:getPower()==2) then + modPower = modPower + 20; + target:addMod(MOD_SILENCERES,modPower); + elseif(effect:getPower()==3) then + modPower = modPower + 20; + target:addMod(MOD_SILENCERES,modPower); + end end; ----------------------------------- @@ -23,4 +37,11 @@ ----------------------------------- function onEffectLose(target,effect) + if(effect:getPower()==1) then + target:delMod(MOD_SILENCERES,modPower); + elseif(effect:getPower()==2) then + target:delMod(MOD_SILENCERES,modPower); + elseif(effect:getPower()==3) then + target:delMod(MOD_SILENCERES,modPower); + end end; \ No newline at end of file Index: scripts/globals/effects/paeon.lua =================================================================== --- scripts/globals/effects/paeon.lua (revision 3304) +++ scripts/globals/effects/paeon.lua (working copy) @@ -1,5 +1,4 @@ ----------------------------------- --- -- EFFECT_PAEON -- getPower returns the TIER (e.g. 1,2,3,4) -- DO NOT ALTER ANY OF THE EFFECT VALUES! DO NOT ALTER EFFECT POWER! @@ -18,7 +17,12 @@ ----------------------------------- function onEffectTick(target,effect) - target:addHP(effect:getPower()); + local hp = effect:getPower(); + + hp = hp + target:getMod(MOD_PAEON) + target:getMod(MOD_ALL_SONGS); + + -- printf("HP Gained %u",hp); + target:addHP(hp); end; ----------------------------------- Index: scripts/globals/effects/pastoral.lua =================================================================== --- scripts/globals/effects/pastoral.lua (revision 3304) +++ scripts/globals/effects/pastoral.lua (working copy) @@ -1,14 +1,16 @@ ----------------------------------- -- --- --- ------------------------------------ +-- EFFECT_PASTORAL +-- Increases Poison Resistance to +-- Party Members within target AoE +---------------------------------- ----------------------------------- -- onEffectGain Action ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_POISONRES,effect:getPower()); end; ----------------------------------- @@ -23,4 +25,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_POISONRES,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/pax.lua =================================================================== --- scripts/globals/effects/pax.lua (revision 3304) +++ scripts/globals/effects/pax.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------- -- +-- EFFECT_PAX +-- Reduces a player's enmity generation -- --- ----------------------------------- ----------------------------------- @@ -9,6 +10,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_ENMITY,effect:getPower()); end; ----------------------------------- @@ -23,4 +25,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_ENMITY,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/plague.lua =================================================================== --- scripts/globals/effects/plague.lua (revision 3304) +++ scripts/globals/effects/plague.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------- -- -- Plague ---Plague is a harmful status effect that reduces a character's TP and MP over time. +-- Plague is a harmful status effect that reduces a character's TP and MP over time. +-- Covered in Healing effect, can not regain HP or MP by /heal -- Also, causes Steps to only grant One Finishing Move when Main Job is Dancer. -- Normal power is 5. ----------------------------------- Index: scripts/globals/effects/potency.lua =================================================================== --- scripts/globals/effects/potency.lua (revision 3304) +++ scripts/globals/effects/potency.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- -- --- --- +-- EFFECT_POTENCY +-- Increases Crit Hit % ----------------------------------- ----------------------------------- @@ -9,6 +9,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_CRITHITRATE,effect:getPower()); end; ----------------------------------- @@ -23,4 +24,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_CRITHITRATE,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/prelude.lua =================================================================== --- scripts/globals/effects/prelude.lua (revision 3304) +++ scripts/globals/effects/prelude.lua (working copy) @@ -1,14 +1,31 @@ ----------------------------------- --- --- --- +-- +-- EFFECT_PRELUDE +-- getPower returns the TIER (e.g. 1,2,3,4) +-- DO NOT ALTER ANY OF THE EFFECT VALUES! DO NOT ALTER EFFECT POWER! +-- Todo: Find a better way of doing this. Need to account for varying modifiers + CASTER's skill (not target) ----------------------------------- - +require("scripts/globals/status"); ----------------------------------- -- onEffectGain Action ----------------------------------- function onEffectGain(target,effect) + preludePower = 15; + preludePower2 = 34; + local mod = 0; + + mod = mod + target:getMod(MOD_PRELUDE) + target:getMod(MOD_ALL_SONGS); + + preludePower = preludePower + (mod * 3); + preludePower2 = preludePower2 + (mod * 7); + + + if(effect:getPower()==1) then + target:addMod(MOD_RACC, preludePower); + elseif(effect:getPower()==2) then + target:addMod(MOD_RACC, preludePower2); + end end; ----------------------------------- @@ -23,4 +40,9 @@ ----------------------------------- function onEffectLose(target,effect) + if(effect:getPower()==1) then + target:delMod(MOD_RACC, preludePower); + elseif(effect:getPower()==2) then + target:delMod(MOD_RACC, preludePower2); + end end; \ No newline at end of file Index: scripts/globals/effects/requiem.lua =================================================================== --- scripts/globals/effects/requiem.lua (revision 3304) +++ scripts/globals/effects/requiem.lua (working copy) @@ -5,6 +5,7 @@ ----------------------------------- require("scripts/globals/status"); +require("scripts/globals/magic"); ----------------------------------- -- onEffectGain Action @@ -18,11 +19,13 @@ ----------------------------------- function onEffectTick(target,effect) + local power = effect:getPower(); + if(target:hasStatusEffect(EFFECT_STONESKIN)) then local skin = target:getMod(MOD_STONESKIN); - local dmg = effect:getPower(); + local dmg = power; if(skin >= dmg) then --absorb all damage - target:delMod(MOD_STONESKIN,effect:getPower()); + target:delMod(MOD_STONESKIN,power); else target:delStatusEffect(EFFECT_STONESKIN); target:delHP(dmg - skin); @@ -30,7 +33,7 @@ end else - target:delHP(effect:getPower()); + target:delHP(power); target:wakeUp(); end end; Index: scripts/globals/effects/reraise.lua =================================================================== --- scripts/globals/effects/reraise.lua (revision 3304) +++ scripts/globals/effects/reraise.lua (working copy) @@ -25,6 +25,6 @@ function onEffectLose(target,effect) if(target:getHP() <= 0) then - target:sendReraise(effect:getPower()); + target:sendRaise(effect:getPower()); end end; \ No newline at end of file Index: scripts/globals/effects/retaliation.lua =================================================================== --- scripts/globals/effects/retaliation.lua (revision 3304) +++ scripts/globals/effects/retaliation.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_RETALIATION +-- Allows you to counterattack but +-- reduces movement speed. ----------------------------------- ----------------------------------- @@ -9,6 +9,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_MOVE, -30); end; ----------------------------------- @@ -16,6 +17,7 @@ ----------------------------------- function onEffectTick(target,effect) + target:delMod(MOD_MOVE, -30); end; ----------------------------------- Index: scripts/globals/effects/rhapsody.lua =================================================================== --- scripts/globals/effects/rhapsody.lua (revision 3304) +++ scripts/globals/effects/rhapsody.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------- --- --- --- +-- EFFECT_RHAPSODY +-- Increases Confusion Resistance to +-- Party Members within target AoE +-- Addle ?? ----------------------------------- ----------------------------------- @@ -9,6 +10,7 @@ ----------------------------------- function onEffectGain(target,effect) + -- target:addMod(MOD_CONFUSIONRES,effect:getPower()); end; ----------------------------------- @@ -23,4 +25,5 @@ ----------------------------------- function onEffectLose(target,effect) + -- target:delMod(MOD_CONFUSIONRES,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/round.lua =================================================================== --- scripts/globals/effects/round.lua (revision 3304) +++ scripts/globals/effects/round.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_ROUND +-- Increases Curse Resistance to +-- Party Members within target AoE ----------------------------------- ----------------------------------- @@ -9,6 +9,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_CURSERES,effect:getPower()); end; ----------------------------------- @@ -23,4 +24,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_CURSERES,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/sanction.lua =================================================================== --- scripts/globals/effects/sanction.lua (revision 3304) +++ scripts/globals/effects/sanction.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- -- +-- EFFECT_SANCTION -- --- ----------------------------------- ----------------------------------- @@ -16,6 +16,11 @@ ----------------------------------- function onEffectTick(target,effect) + if(effect:getPower() == 1) then + target:addHP(3); + elseif(effect:getPower() == 2) then + target:addMP(3); + end end; ----------------------------------- Index: scripts/globals/effects/scherzo.lua =================================================================== --- scripts/globals/effects/scherzo.lua (revision 3304) +++ scripts/globals/effects/scherzo.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_SCHERZO +-- Mitigates Impact of severly +-- damaging attacks. ----------------------------------- ----------------------------------- Index: scripts/globals/effects/seigan.lua =================================================================== --- scripts/globals/effects/seigan.lua (revision 3304) +++ scripts/globals/effects/seigan.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- +-- Effect: +-- Seigan -- --- --- ----------------------------------- require("scripts/globals/status"); @@ -11,7 +11,16 @@ ----------------------------------- function onEffectGain(target,effect) - target:addMod(MOD_COUNTER,(target:getMod(MOD_ZANSHIN)/4)); + + local head = caster:getEquipID(SLOT_HEAD); + local pEquipMods = 0; + + -- Equipment Bonus + if (head == 11075 or head == 11175) then -- Unkai Kabuto +2 & +1 + pEquipMods = 5; + end + + target:addMod(MOD_COUNTER,((target:getMod(MOD_ZANSHIN)/4)+pEquipMods)); target:addMod(MOD_FASTCAST,-50); end; Index: scripts/globals/effects/serenade.lua =================================================================== --- scripts/globals/effects/serenade.lua (revision 3304) +++ scripts/globals/effects/serenade.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_SERENADE +-- Increases Disease Resistance to +-- Party Members within target AoE ----------------------------------- ----------------------------------- @@ -9,6 +9,7 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_VIRUSRES,effect:getPower()); end; ----------------------------------- @@ -23,4 +24,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_VIRUSRES,effect:getPower()); end; \ No newline at end of file Index: scripts/globals/effects/sirvente.lua =================================================================== --- scripts/globals/effects/sirvente.lua (revision 3304) +++ scripts/globals/effects/sirvente.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_SIRVENTE +-- Enmity - and gains it back over time +-- I'm sure it's not correct but a stop gap until it's implemented. ----------------------------------- ----------------------------------- @@ -9,6 +9,8 @@ ----------------------------------- function onEffectGain(target,effect) + emod = effect:getPower() * -1 + target:addMod(MOD_ENMITY,emod); end; ----------------------------------- @@ -16,6 +18,12 @@ ----------------------------------- function onEffectTick(target,effect) + -- the effect gains enmity of 1 every 3 ticks depending on the source of the enmity boost + local enmity_effect_size = effect:getPower(); + if(enmity_effect_size > 0) then + effect:setPower(enmity_effect_size - 1) + target:delMod(MOD_ENMITY,-1); + end end; ----------------------------------- @@ -23,4 +31,9 @@ ----------------------------------- function onEffectLose(target,effect) + local enmity_effect_size = effect:getPower(); + if(enmity_effect_size > 0) then + enmity_effect_size = enmity_effect_size * -1; + target:delMod(MOD_ENMITY,enmity_effect_size); + end end; \ No newline at end of file Index: scripts/globals/effects/souleater.lua =================================================================== --- scripts/globals/effects/souleater.lua (revision 3304) +++ scripts/globals/effects/souleater.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_SOULEATER +-- Consumes 10% of your HP to +-- enhance attacks. ----------------------------------- require("scripts/globals/status"); @@ -11,6 +11,14 @@ ----------------------------------- function onEffectGain(target,effect) + if(target:getObjType() == TYPE_PC) then + local merit = target:getMerit(MERIT_MUTED_SOUL); + local amount = 0; + if (merit > 0) then + amount = -1 * merit * 10; + end + target:addMod(MOD_ENMITY, amount) + end target:addMod(MOD_ACC,25); end; @@ -26,5 +34,13 @@ ----------------------------------- function onEffectLose(target,effect) + if(target:getObjType() == TYPE_PC) then + local merit = target:getMerit(MERIT_MUTED_SOUL); + local amount = 0; + if (merit > 0) then + amount = -1 * merit * 10; + end + target:delMod(MOD_ENMITY, amount) + end target:delMod(MOD_ACC,25); end; \ No newline at end of file Index: scripts/globals/effects/spirit_surge.lua =================================================================== --- scripts/globals/effects/spirit_surge.lua (revision 3304) +++ scripts/globals/effects/spirit_surge.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- -- +-- EFFECT_SPIRIT_SURGE -- --- ----------------------------------- ----------------------------------- @@ -9,6 +9,34 @@ ----------------------------------- function onEffectGain(target,effect) + -- TODO: The dragoon's MAX HP increases by (25% of wyvern MAXHP) + -- local petMaxHP = target:getPet():getMaxHP(); + -- ... but there's no LUA function to change MAX HP ... + + -- The dragoon is healed by wyvern's remaining HP + local petHP = target:getPet():getHP(); + target:addHP(petHP); + + -- The wyvern's current TP is transfered to the dragoon + local petTP = target:getPet():getTP(); + target:addTP(petTP); + + -- The wyvern is "absorbed" into the dragoon (Call Wyvern will not allow a resummon during the effect) + target:despawnPet(); + + -- All Jump recast times are reset + target:resetAbilityRecast(158); -- Jump + target:resetAbilityRecast(159); -- High Jump + target:resetAbilityRecast(160); -- Super Jump + + -- The dragoon gets a Strength boost relative to his level + target:addMod(MOD_STR,effect:getPower()); + + -- The dragoon gets a 50 Accuracy boost + target:addMod(MOD_ACC,50); + + -- The dragoon gets 25% Haste (256/1024, see http://wiki.bluegartr.com/bg/Job_Ability_Haste for haste calculation) + target:addMod(MOD_HASTE_ABILITY,256); end; ----------------------------------- @@ -23,4 +51,14 @@ ----------------------------------- function onEffectLose(target,effect) + -- TODO: The dragoon's MAX HP returns to normal (when the MAXHP boost in onEffectGain() gets implemented) + + -- The dragoon loses the Strength boost + target:delMod(MOD_STR,effect:getPower()); + + -- The dragoon loses the 50 Accuracy boost + target:delMod(MOD_ACC,50); + + -- The dragoon loses 25% Haste + target:delMod(MOD_HASTE_ABILITY,256); end; \ No newline at end of file Index: scripts/globals/effects/store_tp.lua =================================================================== --- scripts/globals/effects/store_tp.lua (revision 0) +++ scripts/globals/effects/store_tp.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------- +-- +-- MOD_STORETP +-- +----------------------------------- + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STORETP, effect:getPower()); +end; + +----------------------------------- +-- onEffectTick Action +----------------------------------- + +function onEffectTick(target,effect) +end; + +----------------------------------- +-- onEffectLose Action +----------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STORETP, effect:getPower()); +end; \ No newline at end of file Index: scripts/globals/effects/sublimation_activated.lua =================================================================== --- scripts/globals/effects/sublimation_activated.lua (revision 3304) +++ scripts/globals/effects/sublimation_activated.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT SUBLIMATION_ACTIVATED +-- Gradually creates a storage of +-- MP while reducing your HP. ----------------------------------- ----------------------------------- @@ -9,6 +9,8 @@ ----------------------------------- function onEffectGain(target,effect) + sublimationPower = -1 * effect:getPower(); + target:addMod(MOD_REGEN, sublimationPower); end; ----------------------------------- @@ -16,6 +18,37 @@ ----------------------------------- function onEffectTick(target,effect) + local lvlMod = 0; + if (target:getMainJob() == 20) then + if (target:getMainLvl() <= 95 and target:getMainLvl() <= 99) then + lvlMod = 6; + elseif (target:getMainLvl() <= 85 and target:getMainLvl() <= 94) then + lvlMod = 5; + elseif (target:getMainLvl() <= 75 and target:getMainLvl() <= 84) then + lvlMod = 4; + elseif (target:getMainLvl() <= 65 and target:getMainLvl() <= 74) then + lvlMod = 3; + elseif (target:getMainLvl() <= 55 and target:getMainLvl() <= 64) then + lvlMod = 2; + elseif (target:getMainLvl() <= 45 and target:getMainLvl() <= 54) then + lvlMod = 1; + else + lvlMod = 0; + end + elseif (target:getSubJob() == 20) then + if (target:getSubLvl() <= 45 and target:getSubLvl() <= 49) then + lvlMod = 1; + else + lvlMod = 0; + end + end + if((target:getMod(MOD_SUBLIMATION_POOL) < ((target:getMaxMP() * .25) + target:getMerit(MERIT_MAX_SUBLIMATION))) + or ((target:getMaxHP() - target:getHP()) > (target:getMaxHP() * .5))) then + target:addMod(MOD_SUBLIMATION_POOL,(lvlMod + effect:getPower())); + else + target:delStatusEffect(EFFECT_SUBLIMATION_ACTIVATED); + target:addStatusEffect(EFFECT_SUBLIMATION_COMPLETE,0,0,3600); + end end; ----------------------------------- @@ -23,4 +56,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_REGEN, sublimationPower); end; \ No newline at end of file Index: scripts/globals/effects/sublimation_complete.lua =================================================================== --- scripts/globals/effects/sublimation_complete.lua (revision 3304) +++ scripts/globals/effects/sublimation_complete.lua (working copy) @@ -1,7 +1,6 @@ ----------------------------------- --- --- --- +-- EFFECT_SUBLIMATION_COMPLETE +-- MP Storage Pool Complete ----------------------------------- ----------------------------------- @@ -23,4 +22,5 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_SUBLIMATION_POOL,target:getMod(MOD_SUBLIMATION_POOL)); end; \ No newline at end of file Index: scripts/globals/effects/third_eye.lua =================================================================== --- scripts/globals/effects/third_eye.lua (revision 3304) +++ scripts/globals/effects/third_eye.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- Effect +-- Third Eye +-- Augmented with Saotome Haidate - +1 - +2 ----------------------------------- ----------------------------------- Index: scripts/globals/effects/transcendency.lua =================================================================== --- scripts/globals/effects/transcendency.lua (revision 3304) +++ scripts/globals/effects/transcendency.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- --- --- --- +-- EFFECT_TRANSCENDENCY +-- Maxes your character out +-- Makes you a God ----------------------------------- ----------------------------------- @@ -9,6 +9,21 @@ ----------------------------------- function onEffectGain(target,effect) + target:addMod(MOD_HP, 9999); + target:addMod(MOD_MP, 9999); + target:addMod(MOD_STR, 999); + target:addMod(MOD_DEX, 999); + target:addMod(MOD_AGI, 999); + target:addMod(MOD_VIT, 999); + target:addMod(MOD_INT, 999); + target:addMod(MOD_MND, 999); + target:addMod(MOD_CHR, 999); + target:addMod(MOD_ATT, 999); + target:addMod(MOD_DEF, 999); + target:addMod(MOD_REGEN, 300); + target:addMod(MOD_REFRESH, 300); + target:addMod(MOD_REGAIN, 50); + target:addMod(MOD_DMG, -90); end; ----------------------------------- @@ -23,4 +38,19 @@ ----------------------------------- function onEffectLose(target,effect) + target:delMod(MOD_HP, 9999); + target:delMod(MOD_MP, 9999); + target:delMod(MOD_STR, 999); + target:delMod(MOD_DEX, 999); + target:delMod(MOD_AGI, 999); + target:delMod(MOD_VIT, 999); + target:delMod(MOD_INT, 999); + target:delMod(MOD_MND, 999); + target:delMod(MOD_CHR, 999); + target:delMod(MOD_ATT, 999); + target:delMod(MOD_DEF, 999); + target:delMod(MOD_REGEN, 300); + target:delMod(MOD_REFRESH, 300); + target:delMod(MOD_REGAIN, 50); + target:delMod(MOD_DMG, -90); end; \ No newline at end of file Index: scripts/globals/effects/troubadour.lua =================================================================== --- scripts/globals/effects/troubadour.lua (revision 3304) +++ scripts/globals/effects/troubadour.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------- --- --- --- +-- EFFECT_TROUBADOUR +-- Increases casting time for songs +-- by 1.5 and double effect and +-- duration ----------------------------------- ----------------------------------- @@ -9,6 +10,9 @@ ----------------------------------- function onEffectGain(target,effect) + + target:addMod(MOD_SONG_RECAST,-50); + target:addMod(MOD_SONG_DURATION, 100); end; ----------------------------------- @@ -23,4 +27,8 @@ ----------------------------------- function onEffectLose(target,effect) + + target:delMod(MOD_SONG_RECAST,-50) + target:delMod(MOD_SONG_DURATION, 100); + end; \ No newline at end of file Index: scripts/globals/effects/warding_circle.lua =================================================================== --- scripts/globals/effects/warding_circle.lua (revision 3304) +++ scripts/globals/effects/warding_circle.lua (working copy) @@ -11,7 +11,7 @@ ----------------------------------- function onEffectGain(target,effect) - target:addMod(MOD_DEMON_KILLER,8); + target:addMod(MOD_DEMON_KILLER,effect:getPower()); end; ----------------------------------- @@ -26,5 +26,5 @@ ----------------------------------- function onEffectLose(target,effect) - target:delMod(MOD_DEMON_KILLER,8); + target:delMod(MOD_DEMON_KILLER,effect:getPower()); end; Index: scripts/globals/effects/weakness.lua =================================================================== --- scripts/globals/effects/weakness.lua (revision 3304) +++ scripts/globals/effects/weakness.lua (working copy) @@ -43,6 +43,7 @@ target:delMod(MOD_HPP,-75); target:delMod(MOD_MPP,-75); target:delMod(MOD_HASTE_MAGIC,-1024); + target:updateHealth(); if(effect:getPower() == 2) then -- handle double weakness Index: scripts/globals/festivals.lua =================================================================== --- scripts/globals/festivals.lua (revision 0) +++ scripts/globals/festivals.lua (working copy) @@ -0,0 +1,196 @@ +----------------------------------------------- +----- Special In Game Events/Festivals ------ +----------------------------------------------- + +package.loaded["scripts/globals/festivals"] = nil; +require("scripts/globals/status"); +require("scripts/globals/settings"); + +--------------------------------------------------------- +--------------------------------------------------------- +------------ Harvest Festivals -------------------- +------------ Author: Metalfiiish -------------------- +--------------------------------------------------------- +--------------------------------------------------------- + +function isHalloweenEnabled() + local option = 0; + if(HALLOWEEN_2005 == 1) then + option = 1; + elseif(HALLOWEEN_2008 == 1) then + option = 2; + elseif(HALLOWEEN_2009 == 1) then + option = 3; + elseif(HALLOWEEN_2010 == 1) then + option = 4; + end + return option; +end; + +-- Add two custom dragon skins: @420/421 +-- @422 dancing weapon +-- @ 433/432 golem +-- 265 dark eye, 266 Giant version +-- 290 dark bombs +-- 301 dark flour dude +-- 313 black spiders +-- 488 gob +-- 531 - 548 shade +-- 564/579 skele + +function npcCostumeCheck(player,npc) + + -- Possible costume values: + Yagudo = 580; + Quadav = 0; + Shade = 548; + Orc = 0; + Ghost = 368; + Hound = 365; + Skeleton = 564; + Dark_Stalker = 547; + + halloween_costum_list = {Yagudo,Shade,Ghost,Hound}; + + player:addStatusEffect(EFFECT_COSTUME,halloween_costum_list[math.random(1,table.getn(halloween_costum_list)) ],0,3600); + +end; + + +function halloweenItemsCheck(player) + local headSlot = player:getEquipID(SLOT_HEAD); + local mainHand = player:getEquipID(SLOT_MAIN); + local reward = 0; + + -- Normal Quality Rewards + local pumpkinHead = 13916 + local pumpkinHead2 = 15176; + local trickStaff = 17565; + local trickStaff2 = 17587; + + reward_list = {pumpkinHead,pumpkinHead2,trickStaff,trickStaff2}; + + -- Checks for HQ Upgrade + for ri = 1, table.getn(reward_list) do + printf("Checking for HQ"); + if(headSlot == reward_list[ri] or mainHand == reward_list[ri]) then + if(headSlot == pumpkinHead and player:hasItem(13917) == false) then + reward = 13917; -- Horror Head + elseif(headSlot == pumpkinHead2 and player:hasItem(15177) == false) then + reward = 15177; -- Horror Head II + elseif(mainHand == trickStaff and player:hasItem(17566) == false) then + reward = 17566; -- Treat Staff + elseif(mainHand == trickStaff2 and player:hasItem(17588) == false) then + reward = 17588; -- Treat Staff II + end + printf("HQ was %u",reward); + return reward; + end + end + + -- Checks the possible item rewards to ensure player doesnt already have the item we are about to give them + local cnt = table.getn(reward_list); + printf("Cnt starts at: %u",cnt); + printf("Reward List: %u",reward_list[1]); + printf("Reward List: %u",reward_list[2]); + printf("Reward List: %u",reward_list[3]); + printf("Reward List: %u",reward_list[4]); + while cnt ~= 0 do + printf("...in loop..cnt = %u",cnt); + + local picked = reward_list[math.random(1,table.getn(reward_list))]; + printf("Picked reward: %u",picked); + if(player:hasItem(picked) == false) then + printf("Hit if"); + reward = picked; + cnt = 0; + else + printf("Hit else"); + table.remove(reward_list,picked); + cnt = cnt - 1; + end + printf("Item reward: %u",reward); + return reward; + end; +end; + +function onHalloweenTrade(player,trade,npc) + local contentEnabled = isHalloweenEnabled(); + local item = trade:getItem(); + printf("Started with item %u",item); + ------------------- + -- 2005 edition --- + ------------------- + if(contentEnabled == 1) then + printf("Content is eabled!"); + ----------------------------------- + -- Treats allowed + ----------------------------------- + treats_table = {4510, -- Acorn Cookie + 5646, -- Bloody Chocolate + 4496, -- Bubble Chocolate + 4397, -- Cinna-cookie + 4394, -- Ginger Cookie + 4495, -- Goblin Chocolate + 4413, -- Apple Pie + 4488, -- Jack-o'-Pie + 4421, -- Melon Pie + 4563, -- Pamama Tart + 4446, -- Pumpkin Pie + 4414, -- Rolanberry Pie + 4406, -- Baked Apple + 5729, -- Bavarois + 5745, -- Cherry Bavarois + 5653, -- Cherry Muffin + 5655, -- Coffee Muffin + 5718, -- Cream Puff + 5144, -- Crimson Jelly + 5681, -- Cupid Chocolate + 5672, -- Dried Berry + 5567, -- Dried Date + 4556, -- Icecap Rolanberry + 5614, -- Konigskuchen + 5230, -- Love Chocolate + 4502, -- Marron Glace + 4393, -- Orange Kuchen + 5147, -- Snoll Gelato + 4270, -- Sweet Rice Cake + 5645, -- Witch Nougat + 5552, -- Black Pudding + 5550, -- Buche au Chocolat + 5616, -- Lebkuchen House + 5633, -- Chocolate Cake + 5542, -- Gateau aux Fraises + 5572, -- Irmik Helvasi + 5625, -- Maple Cake + 5559, -- Mille Feuille + 5557, -- Mont Blanc + 5629, -- Orange Cake + 5631, -- Pumpkin Cake + 5577, -- Sutlac + 5627}; -- Yogurt Cake + + for itemInList = 1, table.getn(treats_table) do + printf("...running item check..."); + if(item == treats_table[itemInList]) then + + local itemReward = halloweenItemsCheck(player); + + if(itemReward ~= 0 and player:getFreeSlotsCount() >= 1) then -- Math.random added so you have 33% chance on getting item /and math.random(1,3) < 2 + local TextIDs = "scripts/zones/" .. player:getZoneName() .. "/TextIDs"; + package.loaded[TextIDs] = nil; + require(TextIDs); + player:addItem(itemReward); + player:messageSpecial(ITEM_OBTAINED,itemReward); + elseif(player:canUseCostume()) then + npcCostumeCheck(player,npc); + end + player:tradeComplete(); + break; + end + end + end +end; + + + Index: scripts/globals/fieldsofvalor.lua =================================================================== --- scripts/globals/fieldsofvalor.lua (revision 3304) +++ scripts/globals/fieldsofvalor.lua (working copy) @@ -271,13 +271,13 @@ FOV_EVENT_YUHTUNGA =0x003d; FOV_EVENT_YHOATOR =0x003d; FOV_EVENT_WEST_ALTEPA =0x003d; -FOV_EVENT_EAST_ALTEPA =0x003d; --test +FOV_EVENT_EAST_ALTEPA =0x003d; FOV_EVENT_BEAUCEDINE =0x00da; FOV_EVENT_XARCABARD =0x0030; FOV_EVENT_BEHEMOTH =0x003d; FOV_EVENT_ZITAH =0x003d; FOV_EVENT_ROMAEVE =0x003d; -FOV_EVENT_TERIGGAN =0x003d; --test +FOV_EVENT_TERIGGAN =0x003d; FOV_EVENT_SORROWS =0x003d; ---------------------------------- @@ -507,10 +507,7 @@ if(killer:getVar("fov_regimeid") == rid) then --player is doing this regime - -- Need to add difference because a lvl1 can xp with a level 75 at ro'maeve - local difference = math.abs(mob:getMainLvl() - killer:getMainLvl()); - - if(partyType < 2 and mob:checkBaseExp() and killer:checkDistance(mob) < 100 and difference <= 15) then + if(partyType < 2 and mob:checkBaseExp() and killer:checkDistance(mob) < 100) then --get the number of mobs needed/killed local needed = killer:getVar("fov_numneeded"..index); local killed = killer:getVar("fov_numkilled"..index); @@ -538,7 +535,7 @@ killer:addGil(reward); --TODO: display msgs (based on zone annoyingly, so will need killer:getZone() then a lookup) - killer:addExp(reward); + killer:addExp(reward*EXP_RATE); if (k1 ~= 0) then killer:setVar("fov_numkilled1",0); end if (k2 ~= 0) then killer:setVar("fov_numkilled2",0); end if (k3 ~= 0) then killer:setVar("fov_numkilled3",0); end Index: scripts/globals/gear_sets.lua =================================================================== --- scripts/globals/gear_sets.lua (revision 3304) +++ scripts/globals/gear_sets.lua (working copy) @@ -15,7 +15,7 @@ item_set = {16084,{14546,14961,15625,15711,MOD_DOUBLE_ATTACK,5}, -- Ares's set (5% DA) 16088,{14550,14965,15629,15715,MOD_CRITHITRATE,5}, -- Skadi's set (5% critrate is guess) - 16092,{14554,14969,15633,15719,MOD_HASTE_GEAR,50}, -- Usukane's set (5% Haste) + 16092,{14554,14969,15633,15719,MOD_HASTE_GEAR,50}, -- Usukane's set (5% Haste) 16107,{14569,14984,15648,15734,MOD_ACC,20}, -- Denali Jacket Set (Increases Accuracy +20) 16106,{14568,14983,15647,15733,MOD_HPP,10}, -- Askar Korazin Set (Max HP Boost %10) 16069,{14530,14940,15609,15695,MOD_SUBTLE_BLOW,8}, -- Pahluwan Khazagand Set (8% is guess) @@ -23,18 +23,22 @@ 16096,{14558,14973,15637,15723,MOD_FASTCAST,5}, -- Marduk's Jubbah Set (5% fastcast) 16108,{14570,14985,15649,15735,MOD_MDEF,10}, -- Goliard Saio Set - Total Set Bonus +10% Magic Def. Bonus 16064,{14527,14935,15606,15690,MOD_REFRESH,1}, -- Yigit Gomlek Set (1mp per tick) Adds "Refresh" effect - 11503,{13759,12745,14210,11413,MOD_HASTE_GEAR,50}, -- Perle Hauberk Set 5% haste + 11503,{13759,12745,14210,11413,MOD_HASTE_GEAR,50}, -- Perle Hauberk Set 5% haste 11504,{13760,12746,14257,11414,MOD_STORETP,8}, -- Aurore Doublet Set store tp +8 11505,{13778,12747,14258,11415,MOD_FASTCAST,10}, -- Teal Saio Set fastcast 10% - 10890,{10462,10512,11980,10610,MOD_HASTE_GEAR,61}, -- Calma Armor Set haste%6 + 10890,{10462,10512,11980,10610,MOD_HASTE_GEAR,61}, -- Calma Armor Set haste%6 10892,{10464,10514,11982,10612,MOD_MACC,5}, -- Magavan Armor Set magic accuracy +5 - 10891,{10463,10513,11981,10611,MOD_CRITHITRATE,5}}; -- Mustela Harness Set crit rate 5% + 10891,{10463,10513,11981,10611,MOD_CRITHITRATE,5}; -- Mustela Harness Set crit rate 5% + 10877,{10451,10501,11970,10601,MOD_CRITHITRATE,6}; -- Athos's Armor set crit rate +6%. (crit rate 3% for the first 2 pieces, +1% for each additional piece) + 10878,{10452,10502,11971,10602,MOD_FASTCAST,10}; -- Rubeus' Armor set "Fast Cast" effect +10% (2 or 3 pieces equipped: Fast Cast +4, 4 or 5 pieces equipped: Fast Cast +10) + 10876,{10450,10500,11969,10600,MOD_REFRESH,2}; -- Ogier's Armor set 1 -3 pieces 1% Refresh, 4-5 pieces 2% Refresh + 27652,{27792,27932,28075,28212,MOD_MATT,9}; -- Morrigan's Armor +1 set Magic Attack Bonus +9 with all 5 pieces + 27651,{27791,27931,28074,28211,MOD_FASTCAST,9}; -- Marduk's Armor +1 Fast Cast +9% with full set + 27649,{27789,27929,28072,28209,MOD_CRITHITRATE,9}; -- Skadi's Armor +1 Crit hit rate +9% with full set + 27648,{27788,27928,28071,28208,MOD_DOUBLE_ATTACK,9}; -- Ares' Armor +1 Double Attack effect +9% with full set + 27650,{27790,27930,28073,28210,MOB_HASTE_GEAR,90}}; -- Usukane Armor +1 Haste (Gear) +9% with full set +function checkForGearSet(player) - - - -function checkForGearSet(player) - local head = player:getEquipID(SLOT_HEAD); local body = player:getEquipID(SLOT_BODY); local hands = player:getEquipID(SLOT_HANDS); @@ -300,44 +304,7 @@ 11362 -- Twilight Mail -- Set Bonus: Auto-Reraise -======= -Voidwatch -======= ---Ogier's Armor Set -------------- -10876 -- Ogier's Helm -10450 -- Ogier's Surcoat -10500 -- Ogier's Gauntlets -11969 -- Ogier's Breeches -10600 -- Ogier's Leggings --- Set Bonus: Adds "Refresh" Effect --- Provides 1 mp/tick for 2-3 pieces worn, 2 mp/tick for 4-5 pieces worn. - ---Athos's Armor Set -------------- -10877 -- Athos's Chapeau -10451 -- Athos's Tabard -10501 -- Athos's Gloves -11970 -- Athos's Tights -10601 -- Athos's Boots --- Set Bonus: Increases rate of critical hits. --- Gives +3% for the first 2 pieces and +1% for every additional piece. - ---Rubeus Armor Set -------------- -10878 -- Rubeus Bandeau -10452 -- Rubeus Jacket -10502 -- Rubeus Gloves -11971 -- Rubeus Spats -10602 -- Rubeus Boots --- Set Bonus: Enhances "Fast Cast" Effect --- 2 or 3 pieces equipped: Fast Cast +4 --- 4 or 5 pieces equipped: Fast Cast +10 - - - - ======= Empyrean +2 ======= Index: scripts/globals/harvest_festivals.lua =================================================================== --- scripts/globals/harvest_festivals.lua (revision 0) +++ scripts/globals/harvest_festivals.lua (working copy) @@ -0,0 +1,235 @@ +--------------------------------------------------------- +--------------------------------------------------------- +------------ Harvest Festivals -------------------- +------------ Author: Metalfiiish -------------------- +--------------------------------------------------------- +--------------------------------------------------------- + +package.loaded["scripts/globals/harvest_festivals"] = nil; +require("scripts/globals/status"); +require("scripts/globals/settings"); + +--------------------------------------------------------- +--------------------------------------------------------- + + +function isHalloweenEnabled() + local option = 0; + if(HALLOWEEN_2005 == 1) then + option = 1; + elseif(HALLOWEEN_2008 == 1) then + option = 2; + elseif(HALLOWEEN_2009 == 1) then + option = 3; + elseif(HALLOWEEN_2010 == 1) then + option = 4; + end + return option; +end; + + + +function playerCostumeCheck(player,npc) +---- Other neat looking halloween type costumes +-- two dragon skins: @420/421 +-- @422 dancing weapon +-- @ 433/432 golem +-- 265 dark eye, 266 Giant version +-- 290 dark bombs +-- 301 dark mandy +-- 313 black spiders +-- 488 gob +-- 531 - 548 shade +-- 564/579 skele + + -- Possible costume values: + Yagudo = math.random(580,607); + Quadav = math.random(644,671); + Shade = math.random(535,538); + Orc = math.random(612,639); + Ghost = 368; + Hound = 365; + Skeleton = 564; + Dark_Stalker = math.random(531,534); + + halloween_costume_list = {Quadav,Orc,Yagudo,Shade,Ghost,Hound,Skeleton,Dark_Stalker}; + + player:addStatusEffect(EFFECT_COSTUME,halloween_costume_list[math.random(1,table.getn(halloween_costume_list)) ],0,3600); + +end; + + +function halloweenItemsCheck(player) + local headSlot = player:getEquipID(SLOT_HEAD); + local mainHand = player:getEquipID(SLOT_MAIN); + local reward = 0; + + -- Normal Quality Rewards + local pumpkinHead = 13916 + local pumpkinHead2 = 15176; + local trickStaff = 17565; + local trickStaff2 = 17587; + + reward_list = {pumpkinHead,pumpkinHead2,trickStaff,trickStaff2}; + + -- Checks for HQ Upgrade + for ri = 1, table.getn(reward_list) do + printf("Checking for HQ"); + if(headSlot == reward_list[ri] or mainHand == reward_list[ri]) then + if(headSlot == pumpkinHead and player:hasItem(13917) == false) then + reward = 13917; -- Horror Head + elseif(headSlot == pumpkinHead2 and player:hasItem(15177) == false) then + reward = 15177; -- Horror Head II + elseif(mainHand == trickStaff and player:hasItem(17566) == false) then + reward = 17566; -- Treat Staff + elseif(mainHand == trickStaff2 and player:hasItem(17588) == false) then + reward = 17588; -- Treat Staff II + end + printf("HQ was %u",reward); + return reward; + end + end + + -- Checks the possible item rewards to ensure player doesnt already have the item we are about to give them + local cnt = table.getn(reward_list); + printf("Cnt starts at: %u",cnt); + printf("Reward List: %u",reward_list[1]); + printf("Reward List: %u",reward_list[2]); + printf("Reward List: %u",reward_list[3]); + printf("Reward List: %u",reward_list[4]); + while cnt ~= 0 do + printf("...in loop..cnt = %u",cnt); + + local picked = reward_list[math.random(1,table.getn(reward_list))]; + printf("Picked reward: %u",picked); + if(player:hasItem(picked) == false) then + printf("Hit if"); + reward = picked; + cnt = 0; + else + printf("Hit else"); + table.remove(reward_list,picked); + cnt = cnt - 1; + end + printf("Item reward: %u",reward); + return reward; + end; +end; + +function onHalloweenTrade(player,trade,npc) + local contentEnabled = isHalloweenEnabled(); + local item = trade:getItem(); + printf("Started with item %u",item); + ------------------- + -- 2005 edition --- + ------------------- + if(contentEnabled == 1) then + printf("Content is eabled!"); + ----------------------------------- + -- Treats allowed + ----------------------------------- + treats_table = {4510, -- Acorn Cookie + 5646, -- Bloody Chocolate + 4496, -- Bubble Chocolate + 4397, -- Cinna-cookie + 4394, -- Ginger Cookie + 4495, -- Goblin Chocolate + 4413, -- Apple Pie + 4488, -- Jack-o'-Pie + 4421, -- Melon Pie + 4563, -- Pamama Tart + 4446, -- Pumpkin Pie + 4414, -- Rolanberry Pie + 4406, -- Baked Apple + 5729, -- Bavarois + 5745, -- Cherry Bavarois + 5653, -- Cherry Muffin + 5655, -- Coffee Muffin + 5718, -- Cream Puff + 5144, -- Crimson Jelly + 5681, -- Cupid Chocolate + 5672, -- Dried Berry + 5567, -- Dried Date + 4556, -- Icecap Rolanberry + 5614, -- Konigskuchen + 5230, -- Love Chocolate + 4502, -- Marron Glace + 4393, -- Orange Kuchen + 5147, -- Snoll Gelato + 4270, -- Sweet Rice Cake + 5645, -- Witch Nougat + 5552, -- Black Pudding + 5550, -- Buche au Chocolat + 5616, -- Lebkuchen House + 5633, -- Chocolate Cake + 5542, -- Gateau aux Fraises + 5572, -- Irmik Helvasi + 5625, -- Maple Cake + 5559, -- Mille Feuille + 5557, -- Mont Blanc + 5629, -- Orange Cake + 5631, -- Pumpkin Cake + 5577, -- Sutlac + 5627}; -- Yogurt Cake + + for itemInList = 1, table.getn(treats_table) do + printf("...running item check..."); + if(item == treats_table[itemInList]) then + + local itemReward = halloweenItemsCheck(player); + + if(itemReward ~= 0 and player:getFreeSlotsCount() >= 1) then -- Math.random added so you have 33% chance on getting item, re-add "and math.random(1,3) < 2" + local TextIDs = "scripts/zones/" .. player:getZoneName() .. "/TextIDs"; + package.loaded[TextIDs] = nil; + require(TextIDs); + player:addItem(itemReward); + player:messageSpecial(ITEM_OBTAINED,itemReward); + elseif(player:canUseCostume()) then + playerCostumeCheck(player,npc); + end + player:tradeComplete(); + break; + end + end + end +end; + +function applyHalloweenNpcCostumes() +-- npcID, skinID (skin ID can be found in mob_change_skin Sql table) + npc_costume_map = {17735787,40, -- Proud_Beard - Bastok Mines + 17735742,41, -- Faustin - Bastok Mines + 17814119,42, -- Aulavia - Bastok Mines + 17735744,43, -- Mille - Bastok Mines + 17735810,44, -- Emaliveulaux - Bastok Mines + 17739805,45, -- Olwyn - Bastok Markets + 17719306,46, -- Apairemant - Southern Sandoria + 17719303,47, -- Machielle - Southern Sandoria + 17719305,48, -- Phamelise - Southern Sandoria + 17719485,49, -- Pourette - Southern Sandoria + 17719304,50, -- Corua -- Southern Sandoria + 17723497,51, -- Attarena - Northern Sandoria + 17723492,52, -- Antonian - Northern Sandoria + 17723487,53, -- Vichuel - Northern Sandoria + 17764401,54, -- Kuzah_Hpirohpon - Windurst Woods + 17764400,55, -- Meriri - Windurst Woods + 17764464,56, -- Nhobi_Zalkia - Windurst Woods + 17764465,57, -- Millerovieunet - Windurst Woods + 17764462,58, -- Taraihi-Perunhi - Windurst Woods + 17752101,59, -- Ness_Rugetomal - Windurst Waters + 17752098,60, -- Upih_Khachla - Windurst Waters + 17752097,61, -- Ensasa - Windurst Waters + 17752103,62, -- Ahyeekih - Windurst Waters + 17752102,63}; -- Maqu_Molpih - Windurst Waters + printf("List made"); + for costumePair = 1, table.getn(npc_costume_map), 2 do + printf("Looping NPC..%u",npc_costume_map[costumePair]); + printf("..with costume..%u",npc_costume_map[costumePair + 1]); + hfNpc = GetNPCByID(npc_costume_map[costumePair]); + printf("In the middle"); + hfNpc:changeSkin(npc_costume_map[costumePair + 1]); + printf("Harvest Festival NPC's have been costume-ized!"); + end +end; + + + Index: scripts/globals/harvesting.lua =================================================================== --- scripts/globals/harvesting.lua (revision 3304) +++ scripts/globals/harvesting.lua (working copy) @@ -84,6 +84,8 @@ Body = player:getEquipID(SLOT_BODY); Legs = player:getEquipID(SLOT_LEGS); Feet = player:getEquipID(SLOT_FEET); + Waist = player:getEquipID(SLOT_WAIST); + Neck = player:getEquipID(SLOT_NECK); if(Body == 14374 or Body == 14375) then sicklebreak = sicklebreak + 0.073; @@ -94,6 +96,12 @@ if(Feet == 14176 or Feet == 14177) then sicklebreak = sicklebreak + 0.073; end + if(Waist == 11769) then + sicklebreak = sicklebreak + 0.073; + end + if(Neck == 10926) then + sicklebreak = sicklebreak + 0.073; + end if(sicklebreak < HARVESTING_BREAK_CHANCE) then broke = 1; Index: scripts/globals/items/aalak_axe.lua =================================================================== --- scripts/globals/items/aalak_axe.lua (revision 0) +++ scripts/globals/items/aalak_axe.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 20831 +-- Item: Aalak Axe +-- Item Effect: Pet Dbl Atk +2% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_MAIN) == 20831 or target:getEquipID(SLOT_SUB) == 20831) then + pet:addMod(MOD_DOUBLE_ATTACK, 2); + else + pet:delMod(MOD_DOUBLE_ATTACK, 2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/aalak_axe_+1.lua =================================================================== --- scripts/globals/items/aalak_axe_+1.lua (revision 0) +++ scripts/globals/items/aalak_axe_+1.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 20832 +-- Item: Aalak Axe +1 +-- Item Effect: Pet Dbl Atk +3% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_MAIN) == 20832 or target:getEquipID(SLOT_SUB) == 20832) then + pet:addMod(MOD_DOUBLE_ATTACK, 3); + else + pet:delMod(MOD_DOUBLE_ATTACK, 3); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/acrobats_belt.lua =================================================================== --- scripts/globals/items/acrobats_belt.lua (revision 0) +++ scripts/globals/items/acrobats_belt.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 15866 +-- Item: Acrobat's Belt +-- Enchantment: AGI +3 +-- Durration: 10 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,600,15866); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_AGI, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_AGI, 3); +end; Index: scripts/globals/items/adaman_bolt_quiver.lua =================================================================== --- scripts/globals/items/adaman_bolt_quiver.lua (revision 0) +++ scripts/globals/items/adaman_bolt_quiver.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5913 +-- Item: Adaman Bolt Quiver +-- When used, you will obtain one stack of Adaman Bolts +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(19801,99); +end; \ No newline at end of file Index: scripts/globals/items/adaman_bullet_pouch.lua =================================================================== --- scripts/globals/items/adaman_bullet_pouch.lua (revision 0) +++ scripts/globals/items/adaman_bullet_pouch.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 5915 +-- Item: Adaman Bullet Pouch +-- Effect: When used, you will obtain stack of Adaman Bullets +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(19803,99); +end; + Index: scripts/globals/items/agaricus_mushroom.lua =================================================================== --- scripts/globals/items/agaricus_mushroom.lua (revision 0) +++ scripts/globals/items/agaricus_mushroom.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5680 +-- Item: Agaricus Mushroom +-- Food Effect: 5 Mins, All Races +----------------------------------------- +-- Strength -4 +-- Mind 2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5680); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, -4); + target:addMod(MOD_MND, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, -4); + target:delMod(MOD_MND, 2); +end; Index: scripts/globals/items/aileens_delight.lua =================================================================== --- scripts/globals/items/aileens_delight.lua (revision 0) +++ scripts/globals/items/aileens_delight.lua (working copy) @@ -0,0 +1,72 @@ +----------------------------------------- +-- ID: 5674 +-- Item: Aileen's Delight +-- Food Effect: 60 Mins, All Races +----------------------------------------- +-- HP 51 +-- MP 51 +-- Strength 4 +-- Dexterity 4 +-- Vitality 4 +-- Intelligence 4 +-- Agility 4 +-- Mind 5 +-- Charisma 4 +-- MP Recovered while healing 4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,3600,5674); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 51); + target:addMod(MOD_MP, 51); + target:addMod(MOD_STR, 4); + target:addMod(MOD_DEX, 4); + target:addMod(MOD_VIT, 4); + target:addMod(MOD_AGI, 4); + target:addMod(MOD_INT, 4); + target:addMod(MOD_MND, 4); + target:addMod(MOD_CHR, 4); + target:addMod(MOD_MPHEAL, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 51); + target:delMod(MOD_MP, 51); + target:delMod(MOD_STR, 4); + target:delMod(MOD_DEX, 4); + target:delMod(MOD_VIT, 4); + target:delMod(MOD_AGI, 4); + target:delMod(MOD_INT, 4); + target:delMod(MOD_MND, 4); + target:delMod(MOD_CHR, 4); + target:delMod(MOD_MPHEAL, 4); +end; Index: scripts/globals/items/aiming_gloves.lua =================================================================== --- scripts/globals/items/aiming_gloves.lua (revision 0) +++ scripts/globals/items/aiming_gloves.lua (working copy) @@ -0,0 +1,42 @@ +----------------------------------------- +-- ID: 14957 +-- Item: Aiming Gloves +-- Enchantment: Ranged Accuracy +3 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,14957); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_RACC, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_RACC, 3); +end; \ No newline at end of file Index: scripts/globals/items/airmids_gorget.lua =================================================================== --- scripts/globals/items/airmids_gorget.lua (revision 0) +++ scripts/globals/items/airmids_gorget.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 10963 +-- Item: Arimid's Gorget +-- Enchantment: Reraise III +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 3600; + target:delStatusEffect(EFFECT_RERAISE); + target:addStatusEffect(EFFECT_RERAISE,3,0,duration); +end; \ No newline at end of file Index: scripts/globals/items/alabaligi.lua =================================================================== --- scripts/globals/items/alabaligi.lua (revision 0) +++ scripts/globals/items/alabaligi.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5461 +-- Item: Alabaligi +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 2 +-- Mind -4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5461); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 2); + target:addMod(MOD_MND, -4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 2); + target:delMod(MOD_MND, -4); +end; Index: scripts/globals/items/angler_stewpot.lua =================================================================== --- scripts/globals/items/angler_stewpot.lua (revision 0) +++ scripts/globals/items/angler_stewpot.lua (working copy) @@ -0,0 +1,65 @@ +----------------------------------------- +-- ID: 5611 +-- Item: Angler's Stewpot +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% +-- MP +10 +-- HP Recoverd while healing 5 +-- MP Recovered while healing 1 +-- Accuracy +15% Cap 15 +-- Ranged Accuracy 15% Cap 15 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5611); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HPP, 10); + target:addMod(MOD_MP, 10); + target:addMod(MOD_HPHEAL, 5); + target:addMod(MOD_MPHEAL, 1); + target:addMod(MOD_FOOD_ACCP, 15); + target:addMod(MOD_FOOD_ACC_CAP, 15); + target:addMod(MOD_FOOD_RACCP, 15); + target:addMod(MOD_FOOD_RACC_CAP, 15); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HPP, 10); + target:delMod(MOD_MP, 10); + target:delMod(MOD_HPHEAL, 5); + target:delMod(MOD_MPHEAL, 1); + target:delMod(MOD_FOOD_ACCP, 15); + target:delMod(MOD_FOOD_ACC_CAP, 15); + target:delMod(MOD_FOOD_RACCP, 15); + target:delMod(MOD_FOOD_RACC_CAP, 15); +end; Index: scripts/globals/items/ankylosis_wand.lua =================================================================== --- scripts/globals/items/ankylosis_wand.lua (revision 0) +++ scripts/globals/items/ankylosis_wand.lua (working copy) @@ -0,0 +1,34 @@ +----------------------------------------- +-- ID: 18888 +-- Item: Ankylosis Wand +-- Enchantment: Bind +-- Latent Effect: Magic Accuracy +20 Magic Atk Bonus +20 +-- Latent activated when bound. +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + if (target:delStatusEffect(EFFECT_BIND) == true) then + target:addMod(MOD_MACC, 20); + target:addMod(MOD_MATT, 20); + elseif (target:delStatusEffect(EFFECT_BIND) == false) then + target:delMod(MOD_MACC, 20); + target:delMod(MOD_MATT, 20); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 60; + target:delStatusEffect(EFFECT_BIND); + target:addStatusEffect(EFFECT_BIND,1,0,duration); +end; \ No newline at end of file Index: scripts/globals/items/anniversary_ring.lua =================================================================== --- scripts/globals/items/anniversary_ring.lua (revision 0) +++ scripts/globals/items/anniversary_ring.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 15793 +-- Item: Anniversary Ring +-- Experience point bonus +----------------------------------------- +-- Bonus: +100% +-- Duration: 720 min +-- Max bonus: 3000 exp +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_DEDICATION) == true) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_DEDICATION,100,0,43200); + target:addMod(MOD_DEDICATION_CAP, 3000); +end; \ No newline at end of file Index: scripts/globals/items/anubiss_knife.lua =================================================================== --- scripts/globals/items/anubiss_knife.lua (revision 0) +++ scripts/globals/items/anubiss_knife.lua (working copy) @@ -0,0 +1,27 @@ +----------------------------------------- +-- ID: 17624 +-- Item: Anubis's Knife +-- Enchantment: Poison +-- Durration: 3 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 180; + target:delStatusEffect(EFFECT_POISON); + target:addStatusEffect(EFFECT_POISON,1,0,duration); +end; \ No newline at end of file Index: scripts/globals/items/ark_saber.lua =================================================================== --- scripts/globals/items/ark_saber.lua (revision 0) +++ scripts/globals/items/ark_saber.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 18912 +-- Ark Saber +-- Enchantment: 60Min, Costume - Ark Angel HM +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,784,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/ark_scythe.lua =================================================================== --- scripts/globals/items/ark_scythe.lua (revision 0) +++ scripts/globals/items/ark_scythe.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 18563 +-- Ark Scythe +-- Enchantment: 60Min, Costume - Ark Angel TT +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,787,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/ark_sword.lua =================================================================== --- scripts/globals/items/ark_sword.lua (revision 0) +++ scripts/globals/items/ark_sword.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 18913 +-- Ark Sword +-- Enchantment: 60Min, Costume - Ark Angel EV +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,785,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/ark_tabar.lua =================================================================== --- scripts/globals/items/ark_tabar.lua (revision 0) +++ scripts/globals/items/ark_tabar.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 18545 +-- Ark Tabar +-- Enchantment: 60Min, Costume - Ark Angel MR +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,786,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/ark_tachi.lua =================================================================== --- scripts/globals/items/ark_tachi.lua (revision 0) +++ scripts/globals/items/ark_tachi.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 18464 +-- Ark Tachi +-- Enchantment: 60Min, Costume - Ark Angel GK +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,788,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/armored_ring.lua =================================================================== --- scripts/globals/items/armored_ring.lua (revision 0) +++ scripts/globals/items/armored_ring.lua (working copy) @@ -0,0 +1,41 @@ +----------------------------------------- +-- ID: 15783 +-- Item: Armored Ring +-- Enchantment: DEF +8 +-- Durration: 30 Mins +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,15783); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEF, 8); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEF, 8); +end; + Index: scripts/globals/items/assailants_axe.lua =================================================================== --- scripts/globals/items/assailants_axe.lua (revision 0) +++ scripts/globals/items/assailants_axe.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 18488 +-- Item: Assailant's Axe +-- Enchantment: Accuracy +3 +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,18488); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ACC, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ACC, 3); +end; + Index: scripts/globals/items/assassins_ring.lua =================================================================== --- scripts/globals/items/assassins_ring.lua (revision 0) +++ scripts/globals/items/assassins_ring.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 14678 +-- Item: Assassin's Ring +-- Enchantment: Ranged Accuracy +20 +-- Durration: 3 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,180,14678); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_RACC, 20); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_RACC, 20); +end; + Index: scripts/globals/items/astral_pot.lua =================================================================== --- scripts/globals/items/astral_pot.lua (revision 0) +++ scripts/globals/items/astral_pot.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 18243 +-- Item: Astral Pot +-- Enchantment: Avatar MAB +22 +-- Charges: 20 Reuse Delay: 30 Mins +-- Duration: 5 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,300,18243); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_PET_MABB, 22); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_PET_MABB, 22); +end; \ No newline at end of file Index: scripts/globals/items/augmenting_belt.lua =================================================================== --- scripts/globals/items/augmenting_belt.lua (revision 0) +++ scripts/globals/items/augmenting_belt.lua (working copy) @@ -0,0 +1,40 @@ +----------------------------------------- +-- ID: 15889 +-- Item: Augmenting Belt +-- Enchantment: HP while healing +2 +-- Durration: 30 Mins +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,15889); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HPHEAL, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HPHEAL, 2); +end; \ No newline at end of file Index: scripts/globals/items/axe_of_trials.lua =================================================================== --- scripts/globals/items/axe_of_trials.lua (revision 0) +++ scripts/globals/items/axe_of_trials.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16735 +-- Equip: Axe of Trials +-- Latent effect is active while less then 300 weapon skills have been preformed on EP+ Mobs using this weapon. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target,prevsjob) + + mainEquip = target:getEquipID(SLOT_MAIN); + + if (mainEquip == 16735) then + if (target:getVar("WSNMHits") < 300) then + target:addMod(MOD_HP, 20); + target:addMod(MOD_EARTHDEF, 10); + target:addMod(MOD_WATERDEF, 10); + else + target:delMod(MOD_HP, 20); + target:delMod(MOD_EARTHDEF, 10); + target:delMod(MOD_WATERDEF, 10); + end + end + +end; \ No newline at end of file Index: scripts/globals/items/aymur.lua =================================================================== --- scripts/globals/items/aymur.lua (revision 0) +++ scripts/globals/items/aymur.lua (working copy) @@ -0,0 +1,67 @@ +----------------------------------------- +-- ID: 18999 - 19086 - 19088 - 19620 - 19718 - 19827 - 19956 +-- Item: Aymur +-- Item Effect: Pet Attack Bonus +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + // Aymur Lvl 75 - 2 + if (target:getEquipID(SLOT_MAIN) == 18999 or target:getEquipID(SLOT_SUB) == 18999) then + pet:addMod(MOD_ATT, 10); + else + pet:delMod(MOD_ATT, 10); + end + // Aymur Lvl 80 + if (target:getEquipID(SLOT_MAIN) == 19068 or target:getEquipID(SLOT_SUB) == 19068) then + pet:addMod(MOD_ATT, 22); + else + pet:delMod(MOD_ATT, 22); + end + // Aymur Lvl 85 + if (target:getEquipID(SLOT_MAIN) == 19088 or target:getEquipID(SLOT_SUB) == 19088) then + pet:addMod(MOD_ATT, 35); + else + pet:delMod(MOD_ATT, 35); + end + // Aymur Lvl 90 + if (target:getEquipID(SLOT_MAIN) == 19620 or target:getEquipID(SLOT_SUB) == 19620) then + pet:addMod(MOD_ATT, 48); + else + pet:delMod(MOD_ATT, 48); + end + // Aymur Lvl 95 + if (target:getEquipID(SLOT_MAIN) == 19718 or target:getEquipID(SLOT_SUB) == 19718) then + pet:addMod(MOD_ATT, 48); + else + pet:delMod(MOD_ATT, 48); + end + // Aymur Lvl 99 + if (target:getEquipID(SLOT_MAIN) == 19827 or target:getEquipID(SLOT_SUB) == 19827) then + pet:addMod(MOD_ATT, 60); + else + pet:delMod(MOD_ATT, 60); + end + // Aymur Lvl 99 - 2 + if (target:getEquipID(SLOT_MAIN) == 19956 or target:getEquipID(SLOT_SUB) == 19956) then + pet:addMod(MOD_ATT, 60); + else + pet:delMod(MOD_ATT, 60); + end + +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/bannaret_mail.lua =================================================================== --- scripts/globals/items/bannaret_mail.lua (revision 0) +++ scripts/globals/items/bannaret_mail.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 14531 +-- Item: Bannaret Mail +-- Enchantment: HP +15 Eminity +2 +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,14531); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 15); + target:addMod(MOD_ENMITY, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 15); + target:delMod(MOD_ENMITY, 2); +end; \ No newline at end of file Index: scripts/globals/items/bar_of_campfire_chocolate.lua =================================================================== --- scripts/globals/items/bar_of_campfire_chocolate.lua (revision 0) +++ scripts/globals/items/bar_of_campfire_chocolate.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 5941 +-- Item: Bar of Campfire Chocolate +-- Food Effect: 30Min, All Races +----------------------------------------- +-- Mind +1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,5941); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MND, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MND, 1); +end; Index: scripts/globals/items/bastok_markets_gate_glyph.lua =================================================================== --- scripts/globals/items/bastok_markets_gate_glyph.lua (revision 0) +++ scripts/globals/items/bastok_markets_gate_glyph.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 4188 +-- Item: Bastok Markets Gate Glyph +-- Enchantment: "Teleport" (Bastok Markets) +----------------------------------------- + +require("scripts/globals/teleports"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + bastokMarketsGlyph(target); +end; \ No newline at end of file Index: scripts/globals/items/bastok_mines_gate_glyph.lua =================================================================== --- scripts/globals/items/bastok_mines_gate_glyph.lua (revision 0) +++ scripts/globals/items/bastok_mines_gate_glyph.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 4187 +-- Item: Bastok Mines Gate Glyph +-- Enchantment: "Teleport" (Bastok Mines) +----------------------------------------- + +require("scripts/globals/teleports"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + bastokMinesGlyph(target); +end; \ No newline at end of file Index: scripts/globals/items/bastore_bream.lua =================================================================== --- scripts/globals/items/bastore_bream.lua (revision 3304) +++ scripts/globals/items/bastore_bream.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/bastore_sardine.lua =================================================================== --- scripts/globals/items/bastore_sardine.lua (revision 3304) +++ scripts/globals/items/bastore_sardine.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/bastore_sweeper.lua =================================================================== --- scripts/globals/items/bastore_sweeper.lua (revision 0) +++ scripts/globals/items/bastore_sweeper.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 5473 +-- Item: Bastore Sweeper +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity -5 +-- Vitality 3 +-- Defense +15% +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5473); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, -5); + target:addMod(MOD_VIT, 3); + target:addMod(MOD_DEFP, 15); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, -5); + target:delMod(MOD_VIT, 3); + target:delMod(MOD_DEFP, 15); +end; Index: scripts/globals/items/beef_stewpot.lua =================================================================== --- scripts/globals/items/beef_stewpot.lua (revision 0) +++ scripts/globals/items/beef_stewpot.lua (working copy) @@ -0,0 +1,65 @@ +----------------------------------------- +-- ID: 5547 +-- Item: Beef Stewpot +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% Cap 50 +-- MP +10 +-- HP Recoverd while healing 5 +-- MP Recovered while healing 1 +-- Attack +15% Cap 40 +-- Evasion +5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5611); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_FOOD_HP_CAP, 50); + target:addMod(MOD_MP, 10); + target:addMod(MOD_HPHEAL, 5); + target:addMod(MOD_MPHEAL, 1); + target:addMod(MOD_FOOD_ATTP, 15); + target:addMod(MOD_FOOD_ATT_CAP, 40); + target:addMod(MOD_EVA, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_FOOD_HP_CAP, 50); + target:delMod(MOD_MP, 10); + target:delMod(MOD_HPHEAL, 5); + target:delMod(MOD_MPHEAL, 1); + target:delMod(MOD_FOOD_ATTP, 15); + target:delMod(MOD_FOOD_ATT_CAP, 40); + target:delMod(MOD_EVA, 5); +end; Index: scripts/globals/items/betta.lua =================================================================== --- scripts/globals/items/betta.lua (revision 0) +++ scripts/globals/items/betta.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5139 +-- Item: Betta +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 3 +-- Mind -5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5139); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 3); + target:addMod(MOD_MND, -5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 3); + target:delMod(MOD_MND, -5); +end; Index: scripts/globals/items/bibiki_slug.lua =================================================================== --- scripts/globals/items/bibiki_slug.lua (revision 3304) +++ scripts/globals/items/bibiki_slug.lua (working copy) @@ -18,7 +18,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/bibikibo.lua =================================================================== --- scripts/globals/items/bibikibo.lua (revision 0) +++ scripts/globals/items/bibikibo.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 4314 +-- Item: Bibikibo +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 1 +-- Mind -3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,4314); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 1); + target:addMod(MOD_MND, -3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 1); + target:delMod(MOD_MND, -3); +end; Index: scripts/globals/items/black_bubble-eye.lua =================================================================== --- scripts/globals/items/black_bubble-eye.lua (revision 3304) +++ scripts/globals/items/black_bubble-eye.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/black_eel.lua =================================================================== --- scripts/globals/items/black_eel.lua (revision 3304) +++ scripts/globals/items/black_eel.lua (working copy) @@ -18,7 +18,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/black_ghost.lua =================================================================== --- scripts/globals/items/black_ghost.lua (revision 0) +++ scripts/globals/items/black_ghost.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5138 +-- Item: Black Ghost +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 4 +-- Mind -6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5138); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 4); + target:addMod(MOD_MND, -6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 4); + target:delMod(MOD_MND, -6); +end; Index: scripts/globals/items/black_sole.lua =================================================================== --- scripts/globals/items/black_sole.lua (revision 3304) +++ scripts/globals/items/black_sole.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/blaze_feather.lua =================================================================== --- scripts/globals/items/blaze_feather.lua (revision 0) +++ scripts/globals/items/blaze_feather.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 5257 +-- Item: Blaze Feather +-- Effect: Blaze Spikes +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local legs = target:getEquipID(SLOT_LEGS); + local int = target:getStat(MOD_INT); + local magicAtk = target:getMod(MOD_MATT); + local power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)); + + -- Equipment Bonus Amount + if (legs == 15622) then -- Mercenarys Trousers + power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)) + (int * (4/256)); + elseif (legs == 15121 or legs == 15584) then -- Duelist Tights & +1 + power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)) + (int * (6/256)); + elseif (legs == 10714) then -- Duelist Tights +2 + power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)) + (int * (8/256)); + end + + if(target:addStatusEffect(EFFECT_BLAZE_SPIKES,power,0,90)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; \ No newline at end of file Index: scripts/globals/items/blaze_hose.lua =================================================================== --- scripts/globals/items/blaze_hose.lua (revision 3304) +++ scripts/globals/items/blaze_hose.lua (working copy) @@ -1,23 +1,23 @@ ------------------------------------------ --- ID: 15652 --- Item: Blaze Hose --- Item Effect: Blaze Spikes ------------------------------------------ - -require("scripts/globals/settings"); - ------------------------------------------ --- OnItemCheck ------------------------------------------ - -function onItemCheck(target) - return 0; -end; - ------------------------------------------ --- OnItemUse ------------------------------------------ - -function onItemUse(target) - target:addStatusEffect(EFFECT_BLAZE_SPIKES, 15, 0, 180); -end; \ No newline at end of file +----------------------------------------- +-- ID: 15652 +-- Item: Blaze Hose +-- Enchantment: Blaze Spikes +-- Durration: 5 Mins +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:delStatusEffect(EFFECT_BLAZE_SPIKES); + target:addStatusEffect(EFFECT_BLAZE_SPIKES,0,0,300); +end; Index: scripts/globals/items/blind_ring.lua =================================================================== --- scripts/globals/items/blind_ring.lua (revision 0) +++ scripts/globals/items/blind_ring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15834 +-- Item: Blind Ring +-- Enchantment: Blind +-- Durration: 1 Min +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_BLINDNESS, 5, 0, 60)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; Index: scripts/globals/items/blindfish.lua =================================================================== --- scripts/globals/items/blindfish.lua (revision 0) +++ scripts/globals/items/blindfish.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 4313 +-- Item: Blindfish +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 2 +-- Mind -4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,4313); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 2); + target:addMod(MOD_MND, -4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 2); + target:delMod(MOD_MND, -4); +end; Index: scripts/globals/items/block_of_rock_cheese.lua =================================================================== --- scripts/globals/items/block_of_rock_cheese.lua (revision 0) +++ scripts/globals/items/block_of_rock_cheese.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 4593 +-- Item: Block of Rock Cheese +-- Food Effect: 30Min, All Races +----------------------------------------- +-- Health % 5.5 +-- Health Cap 45 +-- HP Recovered while healing 1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,4593); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 5.5); + target:addMod(MOD_FOOD_HP_CAP, 45); + target:addMod(MOD_HPHEAL, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 5.5); + target:delMod(MOD_FOOD_HP_CAP, 45); + target:delMod(MOD_HPHEAL, 1); +end; Index: scripts/globals/items/blowfish.lua =================================================================== --- scripts/globals/items/blowfish.lua (revision 0) +++ scripts/globals/items/blowfish.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5812 +-- Item: Blowfish +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 1 +-- Mind -3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5812); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 3); + target:addMod(MOD_MND, -5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 3); + target:delMod(MOD_MND, -5); +end; Index: scripts/globals/items/bluetail.lua =================================================================== --- scripts/globals/items/bluetail.lua (revision 0) +++ scripts/globals/items/bluetail.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 4399 +-- Item: Bluetail +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 3 +-- Mind -5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,4399); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 3); + target:addMod(MOD_MND, -5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 3); + target:delMod(MOD_MND, -5); +end; Index: scripts/globals/items/bolt_belt.lua =================================================================== --- scripts/globals/items/bolt_belt.lua (revision 0) +++ scripts/globals/items/bolt_belt.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15289 +-- Bolt Belt +-- When used, you will obtain 1 Stack of Bronze Bolts +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(17339,99); +end; \ No newline at end of file Index: scripts/globals/items/bottle_of_ascetics_gambir.lua =================================================================== --- scripts/globals/items/bottle_of_ascetics_gambir.lua (revision 0) +++ scripts/globals/items/bottle_of_ascetics_gambir.lua (working copy) @@ -0,0 +1,50 @@ +----------------------------------------- +-- ID: 5842 +-- Item: Bottle of Ascetic's Gambir +-- Item Effect: Temporarily increases magic atk power and acc +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5842)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MACC, 30); + target:addMod(MOD_MATT, 30); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MACC, 30); + target:delMod(MOD_MATT, 30); +end; Index: scripts/globals/items/bottle_of_ascetics_tonic.lua =================================================================== --- scripts/globals/items/bottle_of_ascetics_tonic.lua (revision 0) +++ scripts/globals/items/bottle_of_ascetics_tonic.lua (working copy) @@ -0,0 +1,50 @@ +----------------------------------------- +-- ID: 5841 +-- Item: Bottle of Ascetic's Tonic +-- Item Effect: Temporarily increases magic atk power and acc +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5841)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MACC, 10); + target:addMod(MOD_MATT, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MACC, 10); + target:delMod(MOD_MATT, 10); +end; Index: scripts/globals/items/bottle_of_assassins_drink.lua =================================================================== --- scripts/globals/items/bottle_of_assassins_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_assassins_drink.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5388 +-- Item: Bottle of Assassin's Drink +-- Item Effect: +50 MAcc +-- Durration: 60 Secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5838)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MACC, 50); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MACC, 50); +end; Index: scripts/globals/items/bottle_of_barbarians_drink.lua =================================================================== --- scripts/globals/items/bottle_of_barbarians_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_barbarians_drink.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5385 +-- Item: Bottle of Barbarian's Drink +-- Item Effect: +50% Attk +-- Durration: 60 Secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5835)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ATTP, 50); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ATTP, 50); +end; Index: scripts/globals/items/bottle_of_berserkers_drink.lua =================================================================== --- scripts/globals/items/bottle_of_berserkers_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_berserkers_drink.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5849 +-- Item: Bottle of Berserker's Drink +-- Item Effect: Increases Dbl Attk 100% +-- Duration: 60 secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5849)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DOUBLE_ATTACK, 100); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DOUBLE_ATTACK, 100); +end; Index: scripts/globals/items/bottle_of_berserkers_tonic.lua =================================================================== --- scripts/globals/items/bottle_of_berserkers_tonic.lua (revision 0) +++ scripts/globals/items/bottle_of_berserkers_tonic.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5851 +-- Item: Bottle of Berserker's Tonic +-- Item Effect: Increases Dbl Attk 80% +-- Duration: 60 secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5851)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DOUBLE_ATTACK, 80); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DOUBLE_ATTACK, 80); +end; Index: scripts/globals/items/bottle_of_bravers_drink.lua =================================================================== --- scripts/globals/items/bottle_of_bravers_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_bravers_drink.lua (working copy) @@ -0,0 +1,61 @@ +----------------------------------------- +-- ID: 5390 +-- Item: Bottle of Braver's Drink +-- Item Effect: +15 All Attribs +-- Durration: 180 Secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,180,5390)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 15); + target:addMod(MOD_DEX, 15); + target:addMod(MOD_AGI, 15); + target:addMod(MOD_VIT, 15); + target:addMod(MOD_INT, 15); + target:addMod(MOD_MND, 15); + target:addMod(MOD_CHR, 15); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 15); + target:delMod(MOD_DEX, 15); + target:delMod(MOD_AGI, 15); + target:delMod(MOD_VIT, 15); + target:delMod(MOD_INT, 15); + target:delMod(MOD_MND, 15); + target:delMod(MOD_CHR, 15); +end; Index: scripts/globals/items/bottle_of_buffalo_bonanza_milk.lua =================================================================== --- scripts/globals/items/bottle_of_buffalo_bonanza_milk.lua (revision 0) +++ scripts/globals/items/bottle_of_buffalo_bonanza_milk.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------------- +-- ID: 5742 +-- Item: Bottle of Buffalo Bonanza Milk +-- Item Effect: Restores 120 HP over 60 seconds. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_REGEN) == false) then + target:addStatusEffect(EFFECT_REGEN,2,1,60); + else + target:messageBasic(423); + end +end; + Index: scripts/globals/items/bottle_of_cantarella.lua =================================================================== --- scripts/globals/items/bottle_of_cantarella.lua (revision 0) +++ scripts/globals/items/bottle_of_cantarella.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 4246 +-- Item: Bottle of Cantarella +-- Item Effect: Poison 10HP / 3Tic +-- Duration: 10 Mins +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:hasStatusEffect(EFFECT_POISON) == false) then + target:addStatusEffect(EFFECT_POISON,10,3,600); + else + target:messageBasic(423); + end +end; Index: scripts/globals/items/bottle_of_catholicon.lua =================================================================== --- scripts/globals/items/bottle_of_catholicon.lua (revision 0) +++ scripts/globals/items/bottle_of_catholicon.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 4206 +-- Item: Catholicon +-- Item Effect: Removes up to 3 negative status effects +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local effect = target:eraseStatusEffect(); + if(effect == EFFECT_NONE) then + target:messageBasic(423); -- no effect + else + local z = 0; + while z <= 3 do + target:eraseStatusEffect(); + if(effect == EFFECT_NONE) then + z = 3; + end + z = z + 1; + end; + end + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/bottle_of_catholicon_+1.lua =================================================================== --- scripts/globals/items/bottle_of_catholicon_+1.lua (revision 0) +++ scripts/globals/items/bottle_of_catholicon_+1.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 4208 +-- Item: Bottle of Catholicon +1 +-- Item Effect: Removes up to 7 negative status effects +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local effect = target:eraseStatusEffect(); + if(effect == EFFECT_NONE) then + target:messageBasic(423); -- no effect + else + local z = 0; + while z <= 7 do + target:eraseStatusEffect(); + if(effect == EFFECT_NONE) then + z = 7; + end + z = z + 1; + end; + end + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/bottle_of_champions_drink.lua =================================================================== --- scripts/globals/items/bottle_of_champions_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_champions_drink.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5392 +-- Item: Bottle of Champion's Drink +-- Item Effect: Potency +-- Durration: 60 Secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5843)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_CRITHITRATE, 50); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_CRITHITRATE, 50); +end; Index: scripts/globals/items/bottle_of_champions_gambir.lua =================================================================== --- scripts/globals/items/bottle_of_champions_gambir.lua (revision 0) +++ scripts/globals/items/bottle_of_champions_gambir.lua (working copy) @@ -0,0 +1,50 @@ +----------------------------------------- +-- ID: 5844 +-- Item: Bottle of Champion's Gambir +-- Item Effect: Temporarily increases potency and haste +-- Duration: 60 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5844)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HASTE_MAGIC, 154); + target:addMod(MOD_CRITHITRATE, 50); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HASTE_MAGIC, 154); + target:delMod(MOD_CRITHITRATE, 50); +end; Index: scripts/globals/items/bottle_of_champions_tonic.lua =================================================================== --- scripts/globals/items/bottle_of_champions_tonic.lua (revision 0) +++ scripts/globals/items/bottle_of_champions_tonic.lua (working copy) @@ -0,0 +1,50 @@ +----------------------------------------- +-- ID: 5843 +-- Item: Bottle of Champion's Tonic +-- Item Effect: Temporarily increases potency and haste +-- Duration: 60 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5843)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HASTE_MAGIC, 154); + target:addMod(MOD_CRITHITRATE, 30); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HASTE_MAGIC, 154); + target:delMod(MOD_CRITHITRATE, 30); +end; Index: scripts/globals/items/bottle_of_clerics_drink.lua =================================================================== --- scripts/globals/items/bottle_of_clerics_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_clerics_drink.lua (working copy) @@ -0,0 +1,52 @@ +----------------------------------------- +-- ID: 5395 +-- Item: Bottle of Cleric's Drink +-- Item Effect: Removes most status ailments AoE +----------------------------------------- + +--TODO: Make AoE + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + local effect = target:eraseStatusEffect(); + if(effect == EFFECT_NONE) then + target:messageBasic(423); -- no effect + else + while effect ~= EFFECT_NONE do + target:eraseStatusEffect(); + end; + end + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/bottle_of_dawn_mulsum.lua =================================================================== --- scripts/globals/items/bottle_of_dawn_mulsum.lua (revision 0) +++ scripts/globals/items/bottle_of_dawn_mulsum.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 5411 +-- Item: Bottle of Dawn Mulsum +-- Item Effect: Restores 25-45% HP to Pet +----------------------------------------- + +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + pet = target:getPet(); + mHP = pet:getMaxHP(); + cHP = pet:getHP(); + local rand = math.random(25,45) / 100; + rHP = mHP * rand; + if (mHP == cHP) then + result = 56; -- Does not let player use item if their pet's hp is full + end + if (pet:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + pet:addStatusEffect(EFFECT_MEDICINE,0,0,180); + pet:addHP(rHP) + target:messageBasic(25,0,rHP); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/bottle_of_fanatics_drink.lua =================================================================== --- scripts/globals/items/bottle_of_fanatics_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_fanatics_drink.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5434 +-- Item: Bottle of Fanatic's Drink +-- Item Effect: Temp nullifies all physical dmg +-- Duration: 60 secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5434)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_UDMGPHYS,-100); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_UDMGPHYS,-100); +end; + Index: scripts/globals/items/bottle_of_fanatics_tonic.lua =================================================================== --- scripts/globals/items/bottle_of_fanatics_tonic.lua (revision 0) +++ scripts/globals/items/bottle_of_fanatics_tonic.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5845 +-- Item: Bottle of Fanatic's Tonic +-- Item Effect: Temp nullifies 50% physical dmg +-- Duration: 60 secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5845)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_UDMGPHYS, -50); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_UDMGPHYS, -50); +end; Index: scripts/globals/items/bottle_of_fighters_drink.lua =================================================================== --- scripts/globals/items/bottle_of_fighters_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_fighters_drink.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5386 +-- Item: Bottle of Fighter's Drink +-- Item Effect: +50% Acc +-- Durration: 60 Secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5836)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ACCP, 50); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ACCP, 50); +end; Index: scripts/globals/items/bottle_of_fools_drink.lua =================================================================== --- scripts/globals/items/bottle_of_fools_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_fools_drink.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5435 +-- Item: Bottle of Fool's Drink +-- Item Effect: Temp nullifies all magic dmg +-- Duration: 60 secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5435)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_UDMGMAGIC,-256); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_UDMGMAGIC,-256); +end; \ No newline at end of file Index: scripts/globals/items/bottle_of_fools_tonic.lua =================================================================== --- scripts/globals/items/bottle_of_fools_tonic.lua (revision 0) +++ scripts/globals/items/bottle_of_fools_tonic.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5846 +-- Item: Bottle of Fool's Tonic +-- Item Effect: Temp nullifies 50% magical dmg +-- Duration: 60 secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5846)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_UDMGMAGIC, -128); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_UDMGMAGIC, -128); +end; Index: scripts/globals/items/bottle_of_frontier_soda.lua =================================================================== --- scripts/globals/items/bottle_of_frontier_soda.lua (revision 0) +++ scripts/globals/items/bottle_of_frontier_soda.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------------- +-- ID: 5944 +-- Item: Bottle of Frontier Soda +-- Item Effect: Restores 20 TP over 60 seconds. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_REGAIN) == false) then + target:addStatusEffect(EFFECT_REGAIN,1,3,60); + else + target:messageBasic(423); + end +end; + Index: scripts/globals/items/bottle_of_giants_drink.lua =================================================================== --- scripts/globals/items/bottle_of_giants_drink.lua (revision 3304) +++ scripts/globals/items/bottle_of_giants_drink.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------------- --- ID: 4172 --- Item: Reraiser +-- ID: 5241 +-- Item: Bottle of Giant's Drink -- Item Effect: +100% HP +-- Durration: 15 mins ----------------------------------------- require("scripts/globals/status"); @@ -11,7 +12,11 @@ ----------------------------------------- function onItemCheck(target) - return 0; +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; end; ----------------------------------------- @@ -19,7 +24,26 @@ ----------------------------------------- function onItemUse(target) - duration = 900; - target:delStatusEffect(EFFECT_MAX_HP_BOOST); - target:addStatusEffect(EFFECT_MAX_HP_BOOST,100,0,duration); + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,900,5241)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HPP, 100); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HPP, 100); +end; Index: scripts/globals/items/bottle_of_gnostics_drink.lua =================================================================== --- scripts/globals/items/bottle_of_gnostics_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_gnostics_drink.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5394 +-- Item: Bottle of Gnostic's Drink +-- Item Effect: Pax (Enmity Down) +-- Duration: 3 Mins +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,180,5394)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ENMITY,-30); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ENMITY,-30); +end; Index: scripts/globals/items/bottle_of_lethe_water.lua =================================================================== --- scripts/globals/items/bottle_of_lethe_water.lua (revision 0) +++ scripts/globals/items/bottle_of_lethe_water.lua (working copy) @@ -0,0 +1,36 @@ +----------------------------------------- +-- ID: 4210 +-- Item: Bottle of Lethe Water +-- Item Effect: Removes up to 3 status effects from target +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local effect = target:dispelStatusEffect(); + if(effect == EFFECT_NONE) then + target:messageBasic(423); -- no effect + else + local z = 0; + while z <= 3 do + target:dispelStatusEffect(); + if(effect == EFFECT_NONE) then + z = 3; + end + z = z + 1; + end; + end +end; + Index: scripts/globals/items/bottle_of_lethe_water_+1.lua =================================================================== --- scripts/globals/items/bottle_of_lethe_water_+1.lua (revision 0) +++ scripts/globals/items/bottle_of_lethe_water_+1.lua (working copy) @@ -0,0 +1,36 @@ +----------------------------------------- +-- ID: 4212 +-- Item: Bottle of Lethe Water +1 +-- Item Effect: Removes up to 5 status effects from target +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local effect = target:dispelStatusEffect(); + if(effect == EFFECT_NONE) then + target:messageBasic(423); -- no effect + else + local z = 0; + while z <= 5 do + target:dispelStatusEffect(); + if(effect == EFFECT_NONE) then + z = 5; + end + z = z + 1; + end; + end +end; + Index: scripts/globals/items/bottle_of_monarchs_drink.lua =================================================================== --- scripts/globals/items/bottle_of_monarchs_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_monarchs_drink.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5393 +-- Item: Bottle of Monarch's Drink +-- Item Effect: Regain 3/sec 180 TP +-- Duration 3 Mins +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,180,5393)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_REGAIN, 30); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_REGAIN, 30); +end; \ No newline at end of file Index: scripts/globals/items/bottle_of_movalpolos_water.lua =================================================================== --- scripts/globals/items/bottle_of_movalpolos_water.lua (revision 0) +++ scripts/globals/items/bottle_of_movalpolos_water.lua (working copy) @@ -0,0 +1,39 @@ +----------------------------------------- +-- ID: 5165 +-- Item: Bottle of Movalpolos Water +-- Item Effect: Refresh 2 MP 3/Tic under 85% MP. +-- Duration: 30 Mins +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local mMP = target:getMaxMP(); + local cMP = target:getMP(); + if(VanadielDayElement() == LIGHTDAY) then + if(cMP < (mMP * .85)) then + if(target:hasStatusEffect(EFFECT_REFRESH) == false) then + target:addStatusEffect(EFFECT_REFRESH,2,3,1800); + else + target:messageBasic(423); + end + else + target:messageBasic(423); + end + else + target:messageBasic(423); + end +end; + Index: scripts/globals/items/bottle_of_mulsum.lua =================================================================== --- scripts/globals/items/bottle_of_mulsum.lua (revision 3304) +++ scripts/globals/items/bottle_of_mulsum.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- --- ID: 4128 --- Item: Ether +-- ID: 4156 +-- Item: Bottle of Mulsum -- Item Effect: Restores 10 MP ----------------------------------------- Index: scripts/globals/items/bottle_of_oracles_drink.lua =================================================================== --- scripts/globals/items/bottle_of_oracles_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_oracles_drink.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5387 +-- Item: Bottle of Oracle's Drink +-- Item Effect: +50 MAtt +-- Durration: 60 Secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5837)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MATT, 50); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MATT, 50); +end; Index: scripts/globals/items/bottle_of_orange_juice.lua =================================================================== --- scripts/globals/items/bottle_of_orange_juice.lua (revision 3304) +++ scripts/globals/items/bottle_of_orange_juice.lua (working copy) @@ -19,8 +19,13 @@ ----------------------------------------- function onItemUse(target) + local power = 1; + local legs = target:getEquipID(SLOT_LEGS); + if (legs == 11966 or legs == 11968) then -- Dream Trousers +1 & Dream Pants +1 + power = power + 1; + end if(target:hasStatusEffect(EFFECT_REFRESH) == false) then - target:addStatusEffect(EFFECT_REFRESH,1,3,90); + target:addStatusEffect(EFFECT_REFRESH,power,3,90); else target:messageBasic(423); end Index: scripts/globals/items/bottle_of_shepherds_drink.lua =================================================================== --- scripts/globals/items/bottle_of_shepherds_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_shepherds_drink.lua (working copy) @@ -0,0 +1,53 @@ +----------------------------------------- +-- ID: 5396 +-- Item: Bottle of Shepherd's Drink +-- Item Effect: Restor Pet's HP +----------------------------------------- + +--TODO: Make AoE + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + pet = target:getPet(); + result = 0; + if (pet:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + mHP = pet:getMaxHP(); + cHP = pet:getHP(); + + if (mHP == cHP) then + value = 56; -- Does not let player use item if their pet's hp is full + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local rHP = mHP - cHP; + pet:addStatusEffect(EFFECT_MEDICINE,0,0,180); + pet:addHP(rHP); + target:messageBasic(24,0,rHP); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/bottle_of_soldiers_drink.lua =================================================================== --- scripts/globals/items/bottle_of_soldiers_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_soldiers_drink.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5391 +-- Item: Bottle of Soldier's Drink +-- Item Effect: +50% Attk +-- Durration: 30 Secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,30,5391)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ATTP, 50); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ATTP, 50); +end; Index: scripts/globals/items/bottle_of_sprinters_drink.lua =================================================================== --- scripts/globals/items/bottle_of_sprinters_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_sprinters_drink.lua (working copy) @@ -0,0 +1,36 @@ +----------------------------------------- +-- ID: 5397 +-- Item: Bottle of Sprinter's Drink +-- Item Effect: Increases Movement Speed +100 +-- Duration: 60 Secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5397)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MOVE,100); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MOVE,100); +end; Index: scripts/globals/items/bottle_of_spys_drink.lua =================================================================== --- scripts/globals/items/bottle_of_spys_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_spys_drink.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5389 +-- Item: Bottle of Spy's Drink +-- Item Effect: +30% Haste +-- Durration: 120 Secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,120,5389)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HASTE_MAGIC, 307); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HASTE_MAGIC, 307); +end; Index: scripts/globals/items/bottle_of_stalwarts_gambir.lua =================================================================== --- scripts/globals/items/bottle_of_stalwarts_gambir.lua (revision 0) +++ scripts/globals/items/bottle_of_stalwarts_gambir.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5840 +-- Item: Bottle of Stalwart's Gambir +-- Item Effect: Temporarily increases atk power and acc +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5840)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ACC, 30); + target:addMod(MOD_ATT, 30); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ACC, 30); + target:delMod(MOD_ATT, 30); +end; \ No newline at end of file Index: scripts/globals/items/bottle_of_stalwarts_tonic.lua =================================================================== --- scripts/globals/items/bottle_of_stalwarts_tonic.lua (revision 0) +++ scripts/globals/items/bottle_of_stalwarts_tonic.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5839 +-- Item: Bottle of Stalwart's Tonic +-- Item Effect: Temporarily increases atk power and acc +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5839)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ACC, 10); + target:addMod(MOD_ATT, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ACC, 10); + target:delMod(MOD_ATT, 10); +end; \ No newline at end of file Index: scripts/globals/items/bottle_of_strange_juice.lua =================================================================== --- scripts/globals/items/bottle_of_strange_juice.lua (revision 0) +++ scripts/globals/items/bottle_of_strange_juice.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 5438 +-- Item: Bottle of Strange Juice +-- Item Effect: Restores 200 MP over 300 seconds. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + worked = 0; + if(target:hasStatusEffect(EFFECT_REFRESH) == false) then + target:addStatusEffect(EFFECT_REFRESH,2,3,300); + else + target:messageBasic(423); + end +end; + Index: scripts/globals/items/bottle_of_swiftshot_drink.lua =================================================================== --- scripts/globals/items/bottle_of_swiftshot_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_swiftshot_drink.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5850 +-- Item: Bottle of Swiftshot Drink +-- Item Effect: Increases likelihood of shooting 2x +-- Duration: 60 secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5850)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_RAPID_SHOT, 100); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_RAPID_SHOT, 100); +end; Index: scripts/globals/items/bottle_of_swiftshot_tonic.lua =================================================================== --- scripts/globals/items/bottle_of_swiftshot_tonic.lua (revision 0) +++ scripts/globals/items/bottle_of_swiftshot_tonic.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5852 +-- Item: Bottle of Swiftshot Tonic +-- Item Effect: Increases likelihood of shooting 2x +-- Duration: 60 secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,60,5852)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_RAPID_SHOT, 80); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_RAPID_SHOT, 80); +end; Index: scripts/globals/items/bottle_of_vicars_drink.lua =================================================================== --- scripts/globals/items/bottle_of_vicars_drink.lua (revision 0) +++ scripts/globals/items/bottle_of_vicars_drink.lua (working copy) @@ -0,0 +1,50 @@ +----------------------------------------- +-- ID: 5439 +-- Item: Bottle of Vicar's Drink +-- Item Effect: Removes most status ailments AoE +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + local effect = target:eraseStatusEffect(); + if(effect == EFFECT_NONE) then + target:messageBasic(423); -- no effect + else + while effect ~= EFFECT_NONE do + target:eraseStatusEffect(); + end; + end + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/bottle_of_wizards_drink.lua =================================================================== --- scripts/globals/items/bottle_of_wizards_drink.lua (revision 3304) +++ scripts/globals/items/bottle_of_wizards_drink.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------------- --- ID: 4172 --- Item: Wizards Drink +-- ID: 5242 +-- Item: Bottle of Wizard's Drink -- Item Effect: +100% MP +-- Durration: 15 mins ----------------------------------------- require("scripts/globals/status"); @@ -11,7 +12,11 @@ ----------------------------------------- function onItemCheck(target) - return 0; +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; end; ----------------------------------------- @@ -19,7 +24,26 @@ ----------------------------------------- function onItemUse(target) - duration = 900; - target:delStatusEffect(EFFECT_MAX_MP_BOOST); - target:addStatusEffect(EFFECT_MAX_MP_BOOST,100,0,duration); + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,900,5242)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MPP, 100); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MPP, 100); +end; Index: scripts/globals/items/bowl_of_loach_gruel.lua =================================================================== --- scripts/globals/items/bowl_of_loach_gruel.lua (revision 0) +++ scripts/globals/items/bowl_of_loach_gruel.lua (working copy) @@ -0,0 +1,62 @@ +----------------------------------------- +-- ID: 5670 +-- Item: Bowl of Loach Gruel +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Make Group Effect +-- Dexterity 2 +-- Agility 2 +-- Accuracy 7% Cap 30 +-- HP 7% Cap 30 +-- Evasion 4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5670); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 2); + target:addMod(MOD_AGI, 2); + target:addMod(MOD_FOOD_ACCP, 7); + target:addMod(MOD_FOOD_ACC_CAP, 30); + target:addMod(MOD_FOOD_HPP, 7); + target:addMod(MOD_FOOD_HP_CAP, 30); + target:addMod(MOD_EVA, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 2); + target:delMod(MOD_AGI, 2); + target:delMod(MOD_FOOD_ACCP, 7); + target:delMod(MOD_FOOD_ACC_CAP, 30); + target:delMod(MOD_FOOD_HPP, 7); + target:delMod(MOD_FOOD_HP_CAP, 30); + target:delMod(MOD_EVA, 4); +end; Index: scripts/globals/items/bowl_of_loach_slop.lua =================================================================== --- scripts/globals/items/bowl_of_loach_slop.lua (revision 0) +++ scripts/globals/items/bowl_of_loach_slop.lua (working copy) @@ -0,0 +1,56 @@ +----------------------------------------- +-- ID: 5669 +-- Item: Bowl of Loach Slop +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Make Group Effect +-- Accuracy 7% Cap 15 +-- HP 7% Cap 15 +-- Evasion 3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5669); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_ACCP, 7); + target:addMod(MOD_FOOD_ACC_CAP, 15); + target:addMod(MOD_FOOD_HPP, 7); + target:addMod(MOD_FOOD_HP_CAP, 15); + target:addMod(MOD_EVA, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_ACCP, 7); + target:delMod(MOD_FOOD_ACC_CAP, 15); + target:delMod(MOD_FOOD_HPP, 7); + target:delMod(MOD_FOOD_HP_CAP, 15); + target:delMod(MOD_EVA, 3); +end; Index: scripts/globals/items/bowl_of_loach_soup.lua =================================================================== --- scripts/globals/items/bowl_of_loach_soup.lua (revision 0) +++ scripts/globals/items/bowl_of_loach_soup.lua (working copy) @@ -0,0 +1,61 @@ +----------------------------------------- +-- ID: 5671 +-- Item: Bowl of Loach Soup +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- Dexterity 4 +-- Agility 4 +-- Accuracy 7% Cap 50 +-- HP 7% Cap 50 +-- Evasion 5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5671); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 4); + target:addMod(MOD_AGI, 4); + target:addMod(MOD_FOOD_ACCP, 7); + target:addMod(MOD_FOOD_ACC_CAP, 50); + target:addMod(MOD_FOOD_HPP, 7); + target:addMod(MOD_FOOD_HP_CAP, 50); + target:addMod(MOD_EVA, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 4); + target:delMod(MOD_AGI, 4); + target:delMod(MOD_FOOD_ACCP, 7); + target:delMod(MOD_FOOD_ACC_CAP, 50); + target:delMod(MOD_FOOD_HPP, 7); + target:delMod(MOD_FOOD_HP_CAP, 50); + target:delMod(MOD_EVA, 5); +end; Index: scripts/globals/items/bowl_of_moogurt.lua =================================================================== --- scripts/globals/items/bowl_of_moogurt.lua (revision 0) +++ scripts/globals/items/bowl_of_moogurt.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 5935 +-- Item: Bowl of Moogurt +-- Food Effect: 30Min, All Races +----------------------------------------- +-- HP 20 +-- Vitality 3 +-- Defense 1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,5935); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 20); + target:addMod(MOD_VIT, 3); + target:addMod(MOD_DEF, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 20); + target:delMod(MOD_VIT, 3); + target:delMod(MOD_DEF, 1); +end; Index: scripts/globals/items/bowl_of_nashmau_stew.lua =================================================================== --- scripts/globals/items/bowl_of_nashmau_stew.lua (revision 0) +++ scripts/globals/items/bowl_of_nashmau_stew.lua (working copy) @@ -0,0 +1,77 @@ +----------------------------------------- +-- ID: 5595 +-- Item: Bowl of Nashmau Stew +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- MP -100 +-- Vitality -10 +-- Agility -10 +-- Intelligence -10 +-- Mind -10 +-- Charisma -10 +-- Accuracy +15% Cap 25 +-- Attack +18% Cap 60 +-- Defense -100 +-- Evasion -100 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5595); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MP, -100); + target:addMod(MOD_VIT, -10); + target:addMod(MOD_AGI, -10); + target:addMod(MOD_INT, -10); + target:addMod(MOD_MND, -10); + target:addMod(MOD_CHR, -10); + target:addMod(MOD_FOOD_ACCP, 18); + target:addMod(MOD_FOOD_ACC_CAP, 25); + target:addMod(MOD_FOOD_ATTP, 15); + target:addMod(MOD_FOOD_ATT_CAP, 60); + target:addMod(MOD_DEF, -100); + target:addMod(MOD_EVA, -100); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MP, -100); + target:delMod(MOD_VIT, -10); + target:delMod(MOD_AGI, -10); + target:delMod(MOD_INT, -10); + target:delMod(MOD_MND, -10); + target:delMod(MOD_CHR, -10); + target:delMod(MOD_FOOD_ACCP, 18); + target:delMod(MOD_FOOD_ACC_CAP, 25); + target:delMod(MOD_FOOD_ATTP, 15); + target:delMod(MOD_FOOD_ATT_CAP, 60); + target:delMod(MOD_DEF, -100); + target:delMod(MOD_EVA, -100); +end; Index: scripts/globals/items/bowl_of_pebble_soup.lua =================================================================== --- scripts/globals/items/bowl_of_pebble_soup.lua (revision 0) +++ scripts/globals/items/bowl_of_pebble_soup.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 4455 +-- Item: Bowl of Pebble Soup +-- Food Effect: 3 Hr, All Races +----------------------------------------- +-- MP Recovered while healing 2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,4455); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MPHEAL, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MPHEAL, 2); +end; Index: scripts/globals/items/bowl_of_sprightly_soup.lua =================================================================== --- scripts/globals/items/bowl_of_sprightly_soup.lua (revision 0) +++ scripts/globals/items/bowl_of_sprightly_soup.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 5930 +-- Item: Bowl of Sprightly Soup +-- Food Effect: 3Hrs, All Races +----------------------------------------- +-- MP 30 +-- Mind 4 +-- HP Recovered While Healing 4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5930); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MP, 30); + target:addMod(MOD_MND, 4); + target:addMod(MOD_HPHEAL, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MP, 30); + target:delMod(MOD_MND, 4); + target:delMod(MOD_HPHEAL, 4); +end; Index: scripts/globals/items/bowl_of_sutlac.lua =================================================================== --- scripts/globals/items/bowl_of_sutlac.lua (revision 0) +++ scripts/globals/items/bowl_of_sutlac.lua (working copy) @@ -0,0 +1,55 @@ +----------------------------------------- +-- ID: 5577 +-- Item: Bowl of Sutlac +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +8 +-- MP +10 +-- INT +1 +-- MP Recovered while healing +2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5577); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 8); + target:addMod(MOD_MP, 10); + target:addMod(MOD_INT, 1); + target:addMod(MOD_MPHEAL, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 8); + target:delMod(MOD_MP, 10); + target:delMod(MOD_INT, 1); + target:delMod(MOD_MPHEAL, 2); +end; Index: scripts/globals/items/bowl_of_sutlac_+1.lua =================================================================== --- scripts/globals/items/bowl_of_sutlac_+1.lua (revision 0) +++ scripts/globals/items/bowl_of_sutlac_+1.lua (working copy) @@ -0,0 +1,55 @@ +----------------------------------------- +-- ID: 5578 +-- Item: Bowl of Sutlac +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10 +-- MP +10 +-- INT +2 +-- MP Recovered while healing +2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5578); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 10); + target:addMod(MOD_MP, 10); + target:addMod(MOD_INT, 2); + target:addMod(MOD_MPHEAL, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 10); + target:delMod(MOD_MP, 10); + target:delMod(MOD_INT, 2); + target:delMod(MOD_MPHEAL, 2); +end; Index: scripts/globals/items/bowl_of_ulbuconut_milk.lua =================================================================== --- scripts/globals/items/bowl_of_ulbuconut_milk.lua (revision 0) +++ scripts/globals/items/bowl_of_ulbuconut_milk.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5976 +-- Item: Bowl of Ulbuconut Milk +-- Food Effect: 3Min, All Races +----------------------------------------- +-- Charisma +3 +-- Vitality -2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,180,5976); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_CHR, 3); + target:addMod(MOD_VIT, -2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_CHR, 3); + target:delMod(MOD_VIT, -2); +end; Index: scripts/globals/items/bowl_of_ulbuconut_milk_+1.lua =================================================================== --- scripts/globals/items/bowl_of_ulbuconut_milk_+1.lua (revision 0) +++ scripts/globals/items/bowl_of_ulbuconut_milk_+1.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5977 +-- Item: Bowl of Ulbuconut Milk +1 +-- Food Effect: 3Min, All Races +----------------------------------------- +-- Charisma +4 +-- Vitality -1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,180,5977); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_CHR, 4); + target:addMod(MOD_VIT, -1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_CHR, 4); + target:delMod(MOD_VIT, -1); +end; Index: scripts/globals/items/bowl_of_zesti_zoni.lua =================================================================== --- scripts/globals/items/bowl_of_zesti_zoni.lua (revision 0) +++ scripts/globals/items/bowl_of_zesti_zoni.lua (working copy) @@ -0,0 +1,66 @@ +----------------------------------------- +-- ID: 5619 +-- Item: Bowl of Zesti Zoni +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- HP 10 +-- MP 10 +-- Strength 1 +-- Dexterity 1 +-- Vitality 1 +-- Agility 1 +-- MP Recovered while healing 1 +-- HP Recovered while healing 1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5619); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 10); + target:addMod(MOD_MP, 10); + target:addMod(MOD_STR, 1); + target:addMod(MOD_DEX, 1); + target:addMod(MOD_VIT, 1); + target:addMod(MOD_AGI, 1); + target:addMod(MOD_HPHEAL, 1); + target:addMod(MOD_MPHEAL, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 10); + target:delMod(MOD_MP, 10); + target:delMod(MOD_STR, 1); + target:delMod(MOD_DEX, 1); + target:delMod(MOD_VIT, 1); + target:delMod(MOD_AGI, 1); + target:delMod(MOD_HPHEAL, 1); + target:delMod(MOD_MPHEAL, 1); +end; Index: scripts/globals/items/breath_mantle.lua =================================================================== --- scripts/globals/items/breath_mantle.lua (revision 0) +++ scripts/globals/items/breath_mantle.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 15486 +-- Item: Breath Mantle +-- Enchantment: HP +18 Eminity +3 +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,15486); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 18); + target:addMod(MOD_ENMITY, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 18); + target:delMod(MOD_ENMITY, 3); +end; \ No newline at end of file Index: scripts/globals/items/broach_lance.lua =================================================================== --- scripts/globals/items/broach_lance.lua (revision 0) +++ scripts/globals/items/broach_lance.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 18122 +-- Item: Broach Lance +-- Item Effect: TP +10 +-- Durration: Instant +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addTP(10); +end; Index: scripts/globals/items/bronze_bandolier.lua =================================================================== --- scripts/globals/items/bronze_bandolier.lua (revision 0) +++ scripts/globals/items/bronze_bandolier.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15926 +-- Bronze Bandolier +-- When used, you will obtain 1 Stack Bronze Bullets +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(17343,99); +end; \ No newline at end of file Index: scripts/globals/items/bubble_breeze.lua =================================================================== --- scripts/globals/items/bubble_breeze.lua (revision 0) +++ scripts/globals/items/bubble_breeze.lua (working copy) @@ -0,0 +1,20 @@ +----------------------------------------- +-- ID: 5937 +-- Item: Bubble Breeze +-- Effect: Ephemereal Firework +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; \ No newline at end of file Index: scripts/globals/items/bunch_of_gysahl_greens.lua =================================================================== --- scripts/globals/items/bunch_of_gysahl_greens.lua (revision 3304) +++ scripts/globals/items/bunch_of_gysahl_greens.lua (working copy) @@ -34,8 +34,15 @@ ----------------------------------- function onEffectGain(target,effect) - target:addMod(MOD_AGI, 3); - target:addMod(MOD_VIT, -5); + chocoboShirt = 0; + if(target:getEquipID(SLOT_MAIN) == 10293) then + chocoboShirt = 1; + target:addMod(MOD_AGI, 13); + target:addMod(MOD_VIT, -5); + else + target:addMod(MOD_AGI, 3); + target:addMod(MOD_VIT, -5); + end end; ----------------------------------------- @@ -43,6 +50,11 @@ ----------------------------------------- function onEffectLose(target,effect) - target:delMod(MOD_AGI, 3); - target:delMod(MOD_VIT, -5); + if(chocoboShirt == 1) then + target:delMod(MOD_AGI, 13); + target:delMod(MOD_VIT, -5); + else + target:delMod(MOD_AGI, 3); + target:delMod(MOD_VIT, -5); + end end; Index: scripts/globals/items/bunch_of_pamamas.lua =================================================================== --- scripts/globals/items/bunch_of_pamamas.lua (revision 0) +++ scripts/globals/items/bunch_of_pamamas.lua (working copy) @@ -0,0 +1,93 @@ +----------------------------------------- +-- ID: 4468 +-- Item: Bunch of Pamamas +-- Food Effect: 30Min, All Races +----------------------------------------- +-- Strength -3 +-- Intelligence 1 +-- Additional Effect with Opo-Opo Crown +-- HP 50 +-- MP 50 +-- CHR 14 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,4468); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + pEquipMods = 0; + pEquipMods2 = 0; + local head = target:getEquipID(SLOT_HEAD); + local main = target:getEquipID(SLOT_MAIN); + if (head == 13870) then -- Opo-Opo Crown + pEquipMods = 1; + end + if (main == 17592 or main == 17590) then -- Kinkobo - Primate Staff + pEquipMods2 = 1; + end + if (main == 17591) then -- Primate Staff +1 + pEquipMods2 = 2; + end + if (pEquipMods == 1) then + target:addMod(MOD_HP, 50); + target:addMod(MOD_MP, 50); + target:addMod(MOD_AGI, -3); + target:addMod(MOD_CHR, 14); + end + if (pEquipMods2 == 1) then + target:addMod(MOD_DELAY, -90); + target:addMod(MOD_ACC, 10); + end + if (pEquipMods2 == 2) then + target:addMod(MOD_DELAY, -80); + target:addMod(MOD_ACC, 12); + end + target:addMod(MOD_STR, -3); + target:addMod(MOD_INT, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + if (pEquipMods == 1) then + target:delMod(MOD_HP, 50); + target:delMod(MOD_MP, 50); + target:delMod(MOD_AGI, -3); + target:delMod(MOD_CHR, 14); + end + if (pEquipMods2 == 1) then + target:delMod(MOD_DELAY, -90); + target:delMod(MOD_ACC, 10); + end + if (pEquipMods2 == 2) then + target:delMod(MOD_DELAY, -80); + target:delMod(MOD_ACC, 12); + end + target:delMod(MOD_STR, -3); + target:delMod(MOD_INT, 1); +end; Index: scripts/globals/items/bunch_of_wild_pamamas.lua =================================================================== --- scripts/globals/items/bunch_of_wild_pamamas.lua (revision 3304) +++ scripts/globals/items/bunch_of_wild_pamamas.lua (working copy) @@ -5,6 +5,10 @@ ----------------------------------------- -- Strength -3 -- Intelligence 1 +-- Additional Effect with Opo-Opo Crown +-- HP 50 +-- MP 50 +-- CHR 14 ----------------------------------------- require("scripts/globals/status"); @@ -34,6 +38,33 @@ ----------------------------------- function onEffectGain(target,effect) + pEquipMods = 0; + pEquipMods2 = 0; + local head = target:getEquipID(SLOT_HEAD); + local main = target:getEquipID(SLOT_MAIN); + if (head == 13870) then -- Opo-Opo Crown + pEquipMods = 1; + end + if (main == 17592 or main == 17590) then -- Kinkobo - Primate Staff + pEquipMods2 = 1; + end + if (main == 17591) then -- Primate Staff +1 + pEquipMods2 = 2; + end + if (pEquipMods == 1) then + target:addMod(MOD_HP, 50); + target:addMod(MOD_MP, 50); + target:addMod(MOD_AGI, -3); + target:addMod(MOD_CHR, 14); + end + if (pEquipMods2 == 1) then + target:addMod(MOD_DELAY, -90); + target:addMod(MOD_ACC, 10); + end + if (pEquipMods2 == 2) then + target:addMod(MOD_DELAY, -80); + target:addMod(MOD_ACC, 12); + end target:addMod(MOD_STR, -3); target:addMod(MOD_INT, 1); end; @@ -43,6 +74,20 @@ ----------------------------------------- function onEffectLose(target,effect) + if (pEquipMods == 1) then + target:delMod(MOD_HP, 50); + target:delMod(MOD_MP, 50); + target:delMod(MOD_AGI, -3); + target:delMod(MOD_CHR, 14); + end + if (pEquipMods2 == 1) then + target:delMod(MOD_DELAY, -90); + target:delMod(MOD_ACC, 10); + end + if (pEquipMods2 == 2) then + target:delMod(MOD_DELAY, -80); + target:delMod(MOD_ACC, 12); + end target:delMod(MOD_STR, -3); target:delMod(MOD_INT, 1); end; Index: scripts/globals/items/burdock_root.lua =================================================================== --- scripts/globals/items/burdock_root.lua (revision 0) +++ scripts/globals/items/burdock_root.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5651 +-- Item: Burdock Root +-- Food Effect: 5Min, All Races +----------------------------------------- +-- Agility 2 +-- Vitality -4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5651); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_AGI, 2); + target:addMod(MOD_VIT, -4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_AGI, 2); + target:delMod(MOD_VIT, -4); +end; Index: scripts/globals/items/caedarva_frog.lua =================================================================== --- scripts/globals/items/caedarva_frog.lua (revision 0) +++ scripts/globals/items/caedarva_frog.lua (working copy) @@ -0,0 +1,60 @@ +----------------------------------------- +-- ID: 5465 +-- Item: Caedarva Frog +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 2 +-- Agility 2 +-- Mind -4 +-- Evasion 5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5465); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 2); + target:addMod(MOD_MND, -4); + target:addMod(MOD_AGI, 2); + target:addMod(MOD_EVA, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 2); + target:delMod(MOD_MND, -4); + target:delMod(MOD_AGI, 2); + target:delMod(MOD_EVA, 5); +end; Index: scripts/globals/items/callers_pendant.lua =================================================================== --- scripts/globals/items/callers_pendant.lua (revision 0) +++ scripts/globals/items/callers_pendant.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11619 +-- Item: Callers Pendant +-- Item Effect: Pet Regain +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_NECK) == 11619) then + pet:addMod(MOD_REGAIN, 3); + else + pet:delMod(MOD_REGAIN, 3); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/caloussu_ring.lua =================================================================== --- scripts/globals/items/caloussu_ring.lua (revision 0) +++ scripts/globals/items/caloussu_ring.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 10777 +-- Item: Caloussu Ring +-- Item Effect: Enchantment: DEF +30 +-- Durration : 5 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,300,10777); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEF, 30); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEF, 30); +end; \ No newline at end of file Index: scripts/globals/items/candy_cane.lua =================================================================== --- scripts/globals/items/candy_cane.lua (revision 0) +++ scripts/globals/items/candy_cane.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 5622 +-- Item: Candy Cane +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- Intelligence 4 +-- Mind 4 +-- MP Recovery while healing 2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5622); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_INT, 4); + target:addMod(MOD_MND, 4); + target:addMod(MOD_MPHEAL, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_INT, 4); + target:delMod(MOD_MND, 4); + target:delMod(MOD_MPHEAL, 2); +end; Index: scripts/globals/items/candy_ring.lua =================================================================== --- scripts/globals/items/candy_ring.lua (revision 0) +++ scripts/globals/items/candy_ring.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 5621 +-- Item: Candy Ring +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- Dexterity 4 +-- Agility 4 +-- Charisma 4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5621); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 4); + target:addMod(MOD_AGI, 4); + target:addMod(MOD_CHR, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 4); + target:delMod(MOD_AGI, 4); + target:delMod(MOD_CHR, 4); +end; Index: scripts/globals/items/cathedral_salad.lua =================================================================== --- scripts/globals/items/cathedral_salad.lua (revision 0) +++ scripts/globals/items/cathedral_salad.lua (working copy) @@ -0,0 +1,59 @@ +----------------------------------------- +-- ID: 5679 +-- Item: Cathedral Salad +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- MP 15% Cap 90 +-- Agility 7 +-- Mind 7 +-- Strength -5 +-- Vitality -5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD)) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5679); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_MPP, 15); + target:addMod(MOD_FOOD_MP_CAP, 90); + target:addMod(MOD_AGI, 7); + target:addMod(MOD_MND, 7); + target:addMod(MOD_STR, -5); + target:addMod(MOD_VIT, -5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_MPP, 15); + target:delMod(MOD_FOOD_MP_CAP, 90); + target:delMod(MOD_AGI, 7); + target:delMod(MOD_MND, 7); + target:delMod(MOD_STR, -5); + target:delMod(MOD_VIT, -5); +end; Index: scripts/globals/items/chanoixs_gorget.lua =================================================================== --- scripts/globals/items/chanoixs_gorget.lua (revision 0) +++ scripts/globals/items/chanoixs_gorget.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16270 +-- Item: Chanoixs Gorget +-- Item Effect: Pet HP +50 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_NECK) == 16270) then + pet:addMod(MOD_HP, 50); + else + pet:delMod(MOD_HP, 50); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/charivari_earring.lua =================================================================== --- scripts/globals/items/charivari_earring.lua (revision 0) +++ scripts/globals/items/charivari_earring.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 10296 +-- Item: Charivari Earring +-- Item Effect: Pet Acc Racc and Macc +3 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_EAR1) == 10296 or target:getEquipID(SLOT_EAR2) == 10296) then + pet:addMod(MOD_ACC, 3); + pet:addMod(MOD_RACC, 3); + pet:addMod(MOD_MACC, 3); + else + pet:delMod(MOD_ACC, 3); + pet:delMod(MOD_RACC, 3); + pet:delMod(MOD_MACC, 3); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/charm_wand.lua =================================================================== --- scripts/globals/items/charm_wand.lua (revision 0) +++ scripts/globals/items/charm_wand.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 18399 +-- Item : Charm Wand +-- This earring functions in the same way as the spell Reraise III. +-- Durration: 1 Hr +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 3600; + target:delStatusEffect(EFFECT_RERAISE); + target:addStatusEffect(EFFECT_RERAISE,3,0,duration); +end; Index: scripts/globals/items/charm_wand_+1.lua =================================================================== --- scripts/globals/items/charm_wand_+1.lua (revision 0) +++ scripts/globals/items/charm_wand_+1.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 18400 +-- Item : Charm Wand +1 +-- This earring functions in the same way as the spell Reraise III. +-- Durration: 1 Hr +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 3600; + target:delStatusEffect(EFFECT_RERAISE); + target:addStatusEffect(EFFECT_RERAISE,3,0,duration); +end; Index: scripts/globals/items/charred_salisbury_steak.lua =================================================================== --- scripts/globals/items/charred_salisbury_steak.lua (revision 0) +++ scripts/globals/items/charred_salisbury_steak.lua (working copy) @@ -0,0 +1,60 @@ +----------------------------------------- +-- ID: 5925 +-- Item: Charred Salisbury Steak +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- HP 32 +-- Strength 8 +-- Intelligence -6 +-- Attack 23% +-- StoreTP -10 +-- Dragon Killer 5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5925); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 32); + target:addMod(MOD_STR, 8); + target:addMod(MOD_INT, -6); + target:addMod(MOD_FOOD_ATTP, 23); + target:addMod(MOD_STORETP, -10); + target:addMod(MOD_DRAGON_KILLER, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 32); + target:delMod(MOD_STR, 8); + target:delMod(MOD_INT, -6); + target:delMod(MOD_FOOD_ATTP, 23); + target:delMod(MOD_STORETP, -10); + target:delMod(MOD_DRAGON_KILLER, 5); +end; Index: scripts/globals/items/cheval_salmon.lua =================================================================== --- scripts/globals/items/cheval_salmon.lua (revision 3304) +++ scripts/globals/items/cheval_salmon.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/chocobiscuit.lua =================================================================== --- scripts/globals/items/chocobiscuit.lua (revision 0) +++ scripts/globals/items/chocobiscuit.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5934 +-- Item: Chocobiscuit +-- Food Effect: 3Min, All Races +----------------------------------------- +-- Magic Regen While Healing 3 +-- Charisma 3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,180,5934); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MPHEAL, 3); + target:addMod(MOD_CHR, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MPHEAL, 3); + target:delMod(MOD_CHR, 3); +end; Index: scripts/globals/items/chocobo_beret.lua =================================================================== --- scripts/globals/items/chocobo_beret.lua (revision 0) +++ scripts/globals/items/chocobo_beret.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 11500 +-- Chocobo Beret +-- Enchantment: 60Min, Costume - Blue adolescent chocobo (INCOMPLETE) +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,(math.random(1996,2002)),0,3600); +end; \ No newline at end of file Index: scripts/globals/items/chocobo_pullus_torque.lua =================================================================== --- scripts/globals/items/chocobo_pullus_torque.lua (revision 0) +++ scripts/globals/items/chocobo_pullus_torque.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 16273 +-- Pullus Torque +-- Enchantment: 60Min, Costume - chicobo +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,1997,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/chocobo_shirt.lua =================================================================== --- scripts/globals/items/chocobo_shirt.lua (revision 0) +++ scripts/globals/items/chocobo_shirt.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 10293 +-- Item: Chocobo Shirt +-- Effect: When used, you will obtain 4-10 of crystals of the day +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local amount = math.random(4,10) + if(VanadielDayElement() == 0) then -- Fireday + target:addItem(4096,amount); + elseif(VanadielDayElement() == 1) then -- Earthsday + target:addItem(4099,amount); + elseif(VanadielDayElement() == 2) then -- Watersday + target:addItem(4101,amount); + elseif(VanadielDayElement() == 3) then -- Windsday + target:addItem(4098,amount); + elseif(VanadielDayElement() == 4) then -- Iceday + target:addItem(4097,amount); + elseif(VanadielDayElement() == 5) then -- Lightningday + target:addItem(4100,amount); + elseif(VanadielDayElement() == 6) then -- Lightsday + target:addItem(4102,amount); + elseif(VanadielDayElement() == 7) then -- Darksday + target:addItem(4103,amount); + end +end; \ No newline at end of file Index: scripts/globals/items/chocolate_cake.lua =================================================================== --- scripts/globals/items/chocolate_cake.lua (revision 0) +++ scripts/globals/items/chocolate_cake.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5633 +-- Item: Chocolate Cake +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- MP +3% +-- MP Recovered while healing +6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5633); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MPP, 3); + target:addMod(MOD_MPHEAL, 6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MPP, 3); + target:delMod(MOD_MPHEAL, 6); +end; Index: scripts/globals/items/chunk_of_orobon_meat.lua =================================================================== --- scripts/globals/items/chunk_of_orobon_meat.lua (revision 0) +++ scripts/globals/items/chunk_of_orobon_meat.lua (working copy) @@ -0,0 +1,63 @@ +----------------------------------------- +-- ID: 5563 +-- Item: Chunk of Orobon Meat +-- Effect: 5 Minutes, food effect, Galka Only +----------------------------------------- +-- HP 10 +-- MP -10 +-- Strength +6 +-- Intelligence -8 +-- Demon Killer 10 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getRace() ~= 8) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5563); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 10); + target:addMod(MOD_MP, -10); + target:addMod(MOD_STR, 6); + target:addMod(MOD_INT, -8); + target:addMod(MOD_DEMON_KILLER, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 10); + target:delMod(MOD_MP, -10); + target:delMod(MOD_STR, 6); + target:delMod(MOD_INT, -8); + target:delMod(MOD_DEMON_KILLER, 10); +end; \ No newline at end of file Index: scripts/globals/items/chunk_of_smelling_salts.lua =================================================================== --- scripts/globals/items/chunk_of_smelling_salts.lua (revision 0) +++ scripts/globals/items/chunk_of_smelling_salts.lua (working copy) @@ -0,0 +1,50 @@ +----------------------------------------- +-- ID: 5320 +-- Item: Chunk of Smelling Salts +-- Item Effect: Recover Pets from Sleep +-- Duration: 180 Secs Medicated +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + pet = target:getPet(); + if (pet:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,180,5320)) then + target:messageBasic(205); + pet:delStatusEffect(EFFECT_SLEEP_I); + pet:delStatusEffect(EFFECT_SLEEP_II); + pet:delStatusEffect(EFFECT_LULLABY); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/cirque_earring.lua =================================================================== --- scripts/globals/items/cirque_earring.lua (revision 0) +++ scripts/globals/items/cirque_earring.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 11720 +-- Item: Cirque Earring +-- Item Effect: Automation Atk +2 RAtk +2 MAB+2 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_EAR1) == 11720 or target:getEquipID(SLOT_EAR2) == 11720) then + pet:addMod(MOD_ATT, 2); + pet:addMod(MOD_RATT, 2); + pet:addMod(MOD_MATT, 2); + else + pet:delMod(MOD_ATT, 2); + pet:delMod(MOD_RATT, 2); + pet:delMod(MOD_MATT, 2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/cirque_guanti_+1.lua =================================================================== --- scripts/globals/items/cirque_guanti_+1.lua (revision 0) +++ scripts/globals/items/cirque_guanti_+1.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 11221 +-- Item: Cirque Guanti +1 +-- Item Effect: Automation Str +10 Dex +10 Agi +10 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HANDS) == 11221) then + pet:addMod(MOD_STR, 10); + pet:addMod(MOD_DEX, 10); + pet:addMod(MOD_AGI, 10); + else + pet:delMod(MOD_STR, 10); + pet:delMod(MOD_DEX, 10); + pet:delMod(MOD_AGI, 10); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/cirque_guanti_+2.lua =================================================================== --- scripts/globals/items/cirque_guanti_+2.lua (revision 0) +++ scripts/globals/items/cirque_guanti_+2.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 11121 +-- Item: Cirque Guanti +2 +-- Item Effect: Automation Str +13 Dex +13 Agi +13 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HANDS) == 11121) then + pet:addMod(MOD_STR, 13); + pet:addMod(MOD_DEX, 13); + pet:addMod(MOD_AGI, 13); + else + pet:delMod(MOD_STR, 13); + pet:delMod(MOD_DEX, 13); + pet:delMod(MOD_AGI, 13); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/cirque_pantaloni_+1.lua =================================================================== --- scripts/globals/items/cirque_pantaloni_+1.lua (revision 0) +++ scripts/globals/items/cirque_pantaloni_+1.lua (working copy) @@ -0,0 +1,35 @@ +----------------------------------------- +-- ID: 11241 +-- Item: Cirque Pantaloni +1 +-- Item Effect: Automation Combat Skill +5 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_LEGS) == 11241) then + pet:addMod(MOD_HTH, 5); + pet:addMod(MOD_ARCHERY, 5); + pet:addMod(MOD_MARKSMAN, 5); + pet:addMod(MOD_ELEM, 5); + else + pet:delMod(MOD_HTH, 5); + pet:delMod(MOD_ARCHERY, 5); + pet:delMod(MOD_MARKSMAN, 5); + pet:delMod(MOD_ELEM, 5); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/cirque_pantaloni_+2.lua =================================================================== --- scripts/globals/items/cirque_pantaloni_+2.lua (revision 0) +++ scripts/globals/items/cirque_pantaloni_+2.lua (working copy) @@ -0,0 +1,35 @@ +----------------------------------------- +-- ID: 11141 +-- Item: Cirque Pantaloni +2 +-- Item Effect: Automation Combat Skill +10 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_LEGS) == 11141) then + pet:addMod(MOD_HTH, 10); + pet:addMod(MOD_ARCHERY, 10); + pet:addMod(MOD_MARKSMAN, 10); + pet:addMod(MOD_ELEM, 10); + else + pet:delMod(MOD_HTH, 10); + pet:delMod(MOD_ARCHERY, 10); + pet:delMod(MOD_MARKSMAN, 10); + pet:delMod(MOD_ELEM, 10); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/cirque_scarpe_+1.lua =================================================================== --- scripts/globals/items/cirque_scarpe_+1.lua (revision 0) +++ scripts/globals/items/cirque_scarpe_+1.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 11261 +-- Item: Cirque Scarpe +1 +-- Item Effect: Automation INT +10 MND +10 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 11261) then + pet:addMod(MOD_INT, 10); + pet:addMod(MOD_MND, 10); + else + pet:delMod(MOD_INT, 10); + pet:delMod(MOD_MND, 10); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/cirque_scarpe_+2.lua =================================================================== --- scripts/globals/items/cirque_scarpe_+2.lua (revision 0) +++ scripts/globals/items/cirque_scarpe_+2.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 11161 +-- Item: Cirque Scarpe +2 +-- Item Effect: Automation INT +13 MND +13 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 11161) then + pet:addMod(MOD_INT, 13); + pet:addMod(MOD_MND, 13); + else + pet:delMod(MOD_INT, 13); + pet:delMod(MOD_MND, 13); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/club_of_trials.lua =================================================================== --- scripts/globals/items/club_of_trials.lua (revision 0) +++ scripts/globals/items/club_of_trials.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 17456 +-- Equip: Club of Trials +-- Latent effect is active while less then 300 weapon skills have been preformed on EP+ Mobs using this weapon. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target,prevsjob) + + mainEquip = target:getEquipID(SLOT_MAIN); + + if (mainEquip == 17456) then + if (target:getVar("WSNMHits") < 300) then + target:addMod(MOD_HP, 10); + target:addMod(MOD_MP, 10); + target:addMod(MOD_EARTHDEF, 10); + target:addMod(MOD_WATERDEF, 10); + else + target:delMod(MOD_HP, 10); + target:delMod(MOD_MP, 10); + target:delMod(MOD_EARTHDEF, 10); + target:delMod(MOD_WATERDEF, 10); + end + end + +end; \ No newline at end of file Index: scripts/globals/items/cluster_of_paprika.lua =================================================================== --- scripts/globals/items/cluster_of_paprika.lua (revision 0) +++ scripts/globals/items/cluster_of_paprika.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 5740 +-- Item: Cluster of Paprika +-- Food Effect: 5Min, All Races +----------------------------------------- +-- Agility 1 +-- Vitality -3 +-- Defense -1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5740); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_AGI, 1); + target:addMod(MOD_VIT, -3); + target:addMod(MOD_DEF, -1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_AGI, 1); + target:delMod(MOD_VIT, -3); + target:delMod(MOD_DEF, -1); +end; Index: scripts/globals/items/cobalt_jellyfish.lua =================================================================== --- scripts/globals/items/cobalt_jellyfish.lua (revision 3304) +++ scripts/globals/items/cobalt_jellyfish.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/cobra_staff.lua =================================================================== --- scripts/globals/items/cobra_staff.lua (revision 0) +++ scripts/globals/items/cobra_staff.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 18614 +-- Item: Cobra Staff +-- Enchantment: "Retrace" (Windurst) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(94) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + cobraStaff(target); +end; \ No newline at end of file Index: scripts/globals/items/combat_casters_quiver.lua =================================================================== --- scripts/globals/items/combat_casters_quiver.lua (revision 0) +++ scripts/globals/items/combat_casters_quiver.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15958 +-- Combat Caster Quiver +-- When used, you will obtain 1 Combat Casters Arrow +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(18740,1); +end; \ No newline at end of file Index: scripts/globals/items/cone_calamary.lua =================================================================== --- scripts/globals/items/cone_calamary.lua (revision 0) +++ scripts/globals/items/cone_calamary.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5128 +-- Item: Cone Calamary +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 3 +-- Mind -5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5128); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 3); + target:addMod(MOD_MND, -5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 3); + target:delMod(MOD_MND, -5); +end; Index: scripts/globals/items/container_of_carnal_incense.lua =================================================================== --- scripts/globals/items/container_of_carnal_incense.lua (revision 0) +++ scripts/globals/items/container_of_carnal_incense.lua (working copy) @@ -0,0 +1,50 @@ +----------------------------------------- +-- ID: 5243 +-- Item: Container of Carnal Incense +-- Item Effect: Temp nullifies all physical dmg +-- Duration: 20 secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,20,5243)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_UDMGPHYS,-100); + target:addMod(MOD_UDMGBREATH,-100); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_UDMGPHYS,-100); + target:delMod(MOD_UDMGBREATH,-100); +end; \ No newline at end of file Index: scripts/globals/items/container_of_celestial_incense.lua =================================================================== --- scripts/globals/items/container_of_celestial_incense.lua (revision 0) +++ scripts/globals/items/container_of_celestial_incense.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5245 +-- Item: Container of Celestial Incense +-- Item Effect: Temp nullifies all ranged attack dmg +-- Duration: 20 secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,20,5245)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_UDMGRANGE,-100); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_UDMGRANGE,-100); +end; \ No newline at end of file Index: scripts/globals/items/container_of_spiritual_incense.lua =================================================================== --- scripts/globals/items/container_of_spiritual_incense.lua (revision 0) +++ scripts/globals/items/container_of_spiritual_incense.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5244 +-- Item: Container of Spiritual Incense +-- Item Effect: Temp nullifies all magic dmg +-- Duration: 20 secs +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,20,5244)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_UDMGMAGIC,-256); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_UDMGMAGIC,-256); +end; \ No newline at end of file Index: scripts/globals/items/copper_frog.lua =================================================================== --- scripts/globals/items/copper_frog.lua (revision 3304) +++ scripts/globals/items/copper_frog.lua (working copy) @@ -18,7 +18,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/coral_butterfly.lua =================================================================== --- scripts/globals/items/coral_butterfly.lua (revision 0) +++ scripts/globals/items/coral_butterfly.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 4580 +-- Item: Coral Butterfly +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 2 +-- Mind -4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,4580); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 2); + target:addMod(MOD_MND, -4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 2); + target:delMod(MOD_MND, -4); +end; Index: scripts/globals/items/cotton_candy.lua =================================================================== --- scripts/globals/items/cotton_candy.lua (revision 0) +++ scripts/globals/items/cotton_candy.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 5708 +-- Item: Cotton Candy +-- Food Effect: 5 Min, All Races +----------------------------------------- +-- MP % 10 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD)) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5708); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MPP, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MPP, 10); +end; Index: scripts/globals/items/counter_earring.lua =================================================================== --- scripts/globals/items/counter_earring.lua (revision 0) +++ scripts/globals/items/counter_earring.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 14786 +-- Item: Counter Earring +-- Enchantment: Counter 5 +-- Charges: 20 Reuse Delay: 30 Secs +-- Duration: 30 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,30,14786); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_COUNTER, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_COUNTER, 5); +end; \ No newline at end of file Index: scripts/globals/items/crab_stewpot.lua =================================================================== --- scripts/globals/items/crab_stewpot.lua (revision 0) +++ scripts/globals/items/crab_stewpot.lua (working copy) @@ -0,0 +1,65 @@ +----------------------------------------- +-- ID: 5544 +-- Item: Crab Stewpot +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% Cap 50 +-- MP +10 +-- HP Recoverd while healing 5 +-- MP Recovered while healing 1 +-- Defense +15% Cap 50 +-- Evasion +5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5544); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_FOOD_HP_CAP, 50); + target:addMod(MOD_MP, 10); + target:addMod(MOD_HPHEAL, 5); + target:addMod(MOD_MPHEAL, 1); + target:addMod(MOD_FOOD_DEFP, 15); + target:addMod(MOD_FOOD_DEF_CAP, 50); + target:addMod(MOD_EVA, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_FOOD_HP_CAP, 50); + target:delMod(MOD_MP, 10); + target:delMod(MOD_HPHEAL, 5); + target:delMod(MOD_MPHEAL, 1); + target:delMod(MOD_FOOD_DEFP, 15); + target:delMod(MOD_FOOD_DEF_CAP, 50); + target:delMod(MOD_EVA, 5); +end; Index: scripts/globals/items/crayfish.lua =================================================================== --- scripts/globals/items/crayfish.lua (revision 3304) +++ scripts/globals/items/crayfish.lua (working copy) @@ -18,7 +18,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/creek_maillot_+1.lua =================================================================== --- scripts/globals/items/creek_maillot_+1.lua (revision 0) +++ scripts/globals/items/creek_maillot_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10268 +-- Creek Maillot +1 +-- When used, you will obtain 1 Berry Snowcone +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5710,1); +end; \ No newline at end of file Index: scripts/globals/items/creek_top_+1.lua =================================================================== --- scripts/globals/items/creek_top_+1.lua (revision 0) +++ scripts/globals/items/creek_top_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10269 +-- Creek Top +1 +-- When used, you will obtain 1 Berry Snowcone +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5710,1); +end; \ No newline at end of file Index: scripts/globals/items/crescent_fish.lua =================================================================== --- scripts/globals/items/crescent_fish.lua (revision 3304) +++ scripts/globals/items/crescent_fish.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/cup_of_date_tea.lua =================================================================== --- scripts/globals/items/cup_of_date_tea.lua (revision 0) +++ scripts/globals/items/cup_of_date_tea.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 5926 +-- Item: Cup of Date Tea +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- HP 20 +-- MP 30 +-- Vitality -1 +-- Charisma 5 +-- Intelligence 3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5926); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 20); + target:addMod(MOD_MP, 30); + target:addMod(MOD_VIT, -1); + target:addMod(MOD_CHR, 5); + target:addMod(MOD_INT, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 20); + target:delMod(MOD_MP, 30); + target:delMod(MOD_VIT, -1); + target:delMod(MOD_CHR, 5); + target:delMod(MOD_INT, 3); +end; Index: scripts/globals/items/curaga_earring.lua =================================================================== --- scripts/globals/items/curaga_earring.lua (revision 0) +++ scripts/globals/items/curaga_earring.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 14759 +-- Item : Curaga Earring +-- This earring functions in the same way as the spell Curaga. +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:curaga(); +end; Index: scripts/globals/items/cynosure_ring.lua =================================================================== --- scripts/globals/items/cynosure_ring.lua (revision 0) +++ scripts/globals/items/cynosure_ring.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 10781 +-- Item: Cynosure Ring +-- Enchantment: Magical Accuracy +5 +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,10781); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MACC, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MACC, 5); +end; \ No newline at end of file Index: scripts/globals/items/czars_belt.lua =================================================================== --- scripts/globals/items/czars_belt.lua (revision 0) +++ scripts/globals/items/czars_belt.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 15868 +-- Item: Czar's Belt +-- Enchantment: VIT +10 +-- Durration: 60 Secs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,60,15868); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_VIT, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_VIT, 10); +end; \ No newline at end of file Index: scripts/globals/items/daedalus_hammer.lua =================================================================== --- scripts/globals/items/daedalus_hammer.lua (revision 0) +++ scripts/globals/items/daedalus_hammer.lua (working copy) @@ -0,0 +1,27 @@ +----------------------------------------- +-- ID: 18867 +-- Item: Daedalus Hammer +-- Enchantment: Adds Refresh +-- Duration: 60 Secs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 60; + target:delStatusEffect(EFFECT_REFRESH); + target:addStatusEffect(EFFECT_REFRESH,1,1,duration); +end; \ No newline at end of file Index: scripts/globals/items/daedalus_wing.lua =================================================================== --- scripts/globals/items/daedalus_wing.lua (revision 3304) +++ scripts/globals/items/daedalus_wing.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------------- --- ID: 4202 --- Daedalus Wing --- Increases TP of the user by 100 +-- ID: 4202 +-- Item: Daedalus Wing +-- Effect: Increases TP of the user by 100 ----------------------------------------- ----------------------------------------- @@ -9,7 +9,11 @@ ----------------------------------------- function onItemCheck(target) - return 0; + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; end; ----------------------------------------- @@ -18,4 +22,5 @@ function onItemUse(target) target:addTP(100); + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); end; \ No newline at end of file Index: scripts/globals/items/dagger_of_trials.lua =================================================================== --- scripts/globals/items/dagger_of_trials.lua (revision 0) +++ scripts/globals/items/dagger_of_trials.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 17616 +-- Equip: Dagger of Trials +-- Latent effect is active while less then 300 weapon skills have been preformed on EP+ Mobs using this weapon. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target,prevsjob) + + mainEquip = target:getEquipID(SLOT_MAIN); + + if (mainEquip == 17616) then + if (target:getVar("WSNMHits") < 300) then + target:addMod(MOD_HP, 20); + target:addMod(MOD_ICEDEF, 10); + target:addMod(MOD_EARTHDEF, 10); + else + target:delMod(MOD_HP, 20); + target:delMod(MOD_ICEDEF, 10); + target:delMod(MOD_EARTHDEF, 10); + end + end + +end; \ No newline at end of file Index: scripts/globals/items/dark_adaman_bullet_pouch.lua =================================================================== --- scripts/globals/items/dark_adaman_bullet_pouch.lua (revision 0) +++ scripts/globals/items/dark_adaman_bullet_pouch.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5873 +-- Item: Dark Adaman Bullet Pouch +-- Effect: When used, you will obtain one stack of Dark Adaman Bullets +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(19184,99); +end; \ No newline at end of file Index: scripts/globals/items/dark_bass.lua =================================================================== --- scripts/globals/items/dark_bass.lua (revision 3304) +++ scripts/globals/items/dark_bass.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/dark_card_case.lua =================================================================== --- scripts/globals/items/dark_card_case.lua (revision 0) +++ scripts/globals/items/dark_card_case.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5409 +-- Item: Dark Card Case +-- Effect: When used, you will obtain one stack of Dark Cards +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(2183,99); +end; \ No newline at end of file Index: scripts/globals/items/date.lua =================================================================== --- scripts/globals/items/date.lua (revision 0) +++ scripts/globals/items/date.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5566 +-- Item: Date +-- Food Effect: 5 Mins, All Races +----------------------------------------- +-- Intelligence 1 +-- Agility -3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5566); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_INT, 1); + target:addMod(MOD_AGI, -3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_INT, 1); + target:delMod(MOD_AGI, -3); +end; Index: scripts/globals/items/deadeye_earring.lua =================================================================== --- scripts/globals/items/deadeye_earring.lua (revision 0) +++ scripts/globals/items/deadeye_earring.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 14787 +-- Item: Deadeye Earring +-- Enchantment: Ranged Attack +20 +-- Durration: 3 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,180,14787); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_RATT, 20); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_RATT, 20); +end; \ No newline at end of file Index: scripts/globals/items/death_chakram.lua =================================================================== --- scripts/globals/items/death_chakram.lua (revision 0) +++ scripts/globals/items/death_chakram.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 18231 +-- Item: Death Chakram +-- Enchantment: MP +5% +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,18231); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MMP, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MMP, 5); +end; \ No newline at end of file Index: scripts/globals/items/deathball.lua =================================================================== --- scripts/globals/items/deathball.lua (revision 0) +++ scripts/globals/items/deathball.lua (working copy) @@ -0,0 +1,34 @@ +----------------------------------------- +-- ID: 4566 +-- Item: Deathball +-- Food Effect: 3 Mins, All Races +----------------------------------------- +-- Poison 2HP / 3Tic +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,180,4566); + if(target:hasStatusEffect(EFFECT_POISON) == false) then + target:addStatusEffect(EFFECT_POISON,2,3,180); + else + target:messageBasic(423); + end +end; Index: scripts/globals/items/deathbone_knife.lua =================================================================== --- scripts/globals/items/deathbone_knife.lua (revision 0) +++ scripts/globals/items/deathbone_knife.lua (working copy) @@ -0,0 +1,24 @@ +----------------------------------------- +-- ID: 18035 +-- Item: Deathbone Knife +-- Item Effect: Restores 10 TP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addTP(10); +end; \ No newline at end of file Index: scripts/globals/items/decennial_coat_+1.lua =================================================================== --- scripts/globals/items/decennial_coat_+1.lua (revision 0) +++ scripts/globals/items/decennial_coat_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10253 +-- Decennial Coat +1 +-- When used, you will obtain 1 Moogurt +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5935,1); +end; \ No newline at end of file Index: scripts/globals/items/decennial_crown_+1.lua =================================================================== --- scripts/globals/items/decennial_crown_+1.lua (revision 0) +++ scripts/globals/items/decennial_crown_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10432 +-- Decennial Crown +1 +-- When used, you will obtain one Chocobiscuit +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5934,1); +end; \ No newline at end of file Index: scripts/globals/items/decennial_dress_+1.lua =================================================================== --- scripts/globals/items/decennial_dress_+1.lua (revision 0) +++ scripts/globals/items/decennial_dress_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10254 +-- Decennial Dress +1 +-- When used, you will obtain 1 Moogurt +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5935,1); +end; \ No newline at end of file Index: scripts/globals/items/decennial_hose_+1.lua =================================================================== --- scripts/globals/items/decennial_hose_+1.lua (revision 0) +++ scripts/globals/items/decennial_hose_+1.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 10596 +-- Item: Decennial Hose +1 +-- Effect: Enchantment Invisible, Sneak, & Deodorize +-- Durration: 3 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local duration = 180; + local duration2 = 180; + if (target:getEquipID(SLOT_BACK) == 13692) then -- Skulker's Cape + duration = duration * 1.5; + duration2 = duration2 * 1.5; + end + if (target:getEquipID(SLOT_FEET) == 15753) then -- Dream Boots +1 + duration2 = duration2 * 1.5; + end + if (target:getEquipID(SLOT_HANDS) == 15753) then -- Dream Mittens +1 + duration2 = duration2 * 1.5; + end + if (not target:hasStatusEffect(EFFECT_INVISIBLE)) then + target:addStatusEffect(EFFECT_INVISIBLE,0,10,duration); + end + if (not target:hasStatusEffect(EFFECT_SNEAK)) then + target:addStatusEffect(EFFECT_SNEAK,1,10,duration2); + end + if (not target:hasStatusEffect(EFFECT_DEODORIZE)) then + target:addStatusEffect(EFFECT_DEODORIZE,1,10,180); + end +end; Index: scripts/globals/items/decennial_tiara_+1.lua =================================================================== --- scripts/globals/items/decennial_tiara_+1.lua (revision 0) +++ scripts/globals/items/decennial_tiara_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10433 +-- Decennial Tiara +1 +-- When used, you will obtain one Chocobiscuit +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5934,1); +end; \ No newline at end of file Index: scripts/globals/items/decennial_tights_+1.lua =================================================================== --- scripts/globals/items/decennial_tights_+1.lua (revision 0) +++ scripts/globals/items/decennial_tights_+1.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 10595 +-- Item: Decennial Tights +1 +-- Effect: Enchantment Invisible, Sneak, & Deodorize +-- Durration: 3 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local duration = 180 + local duration2 = 180 + if (target:getEquipID(SLOT_BACK) == 13692) then -- Skulker's Cape + duration = duration * 1.5; + duration2 = duration2 * 1.5; + end + if (target:getEquipID(SLOT_FEET) == 15753) then -- Dream Boots +1 + duration2 = duration2 * 1.5; + end + if (target:getEquipID(SLOT_HANDS) == 15753) then -- Dream Mittens +1 + duration2 = duration2 * 1.5; + end + if (not target:hasStatusEffect(EFFECT_INVISIBLE)) then + target:addStatusEffect(EFFECT_INVISIBLE,0,10,duration); + end + if (not target:hasStatusEffect(EFFECT_SNEAK)) then + target:addStatusEffect(EFFECT_SNEAK,1,10,duration2); + end + if (not target:hasStatusEffect(EFFECT_DEODORIZE)) then + target:addStatusEffect(EFFECT_DEODORIZE,1,10,180); + end +end; Index: scripts/globals/items/deductive_brocade_obi.lua =================================================================== --- scripts/globals/items/deductive_brocade_obi.lua (revision 0) +++ scripts/globals/items/deductive_brocade_obi.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 15861 +-- Item: Deductive Brocade Obi +-- Enchantment: MND +10 +-- Durration: 60 Secs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,60,15861); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MND, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MND, 10); +end; \ No newline at end of file Index: scripts/globals/items/deductive_gold_obi.lua =================================================================== --- scripts/globals/items/deductive_gold_obi.lua (revision 0) +++ scripts/globals/items/deductive_gold_obi.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 15460 +-- Item: Deductive Gold Obi +-- Enchantment: MND +3 +-- Durration: 60 Secs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,60,15460); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MND, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MND, 3); +end; \ No newline at end of file Index: scripts/globals/items/demoralizer.lua =================================================================== --- scripts/globals/items/demoralizer.lua (revision 0) +++ scripts/globals/items/demoralizer.lua (working copy) @@ -0,0 +1,42 @@ +----------------------------------------- +-- ID: 5304 +-- Item: Demoralizer +-- Effect: Decreases TP of the target by 100 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:delTP(100); + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/demoralizer_+1.lua =================================================================== --- scripts/globals/items/demoralizer_+1.lua (revision 0) +++ scripts/globals/items/demoralizer_+1.lua (working copy) @@ -0,0 +1,42 @@ +----------------------------------------- +-- ID: 5305 +-- Item: Demoralizer +1 +-- Effect: Decreases TP of the target by 300 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:setTP(0); + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/denizanasi.lua =================================================================== --- scripts/globals/items/denizanasi.lua (revision 0) +++ scripts/globals/items/denizanasi.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5447 +-- Item: Denizanasi +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 1 +-- Mind -3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5447); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 1); + target:addMod(MOD_MND, -3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 1); + target:delMod(MOD_MND, -3); +end; Index: scripts/globals/items/destrier_beret.lua =================================================================== --- scripts/globals/items/destrier_beret.lua (revision 0) +++ scripts/globals/items/destrier_beret.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 11811 +-- Destrier Beret +-- EEnchantment: 60Min, Costume - Chocobo Egg (INCOMPLETE) +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,1996,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/dhalmel_whistle.lua =================================================================== --- scripts/globals/items/dhalmel_whistle.lua (revision 0) +++ scripts/globals/items/dhalmel_whistle.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 15505 +-- Item: Dhalmel Whistle +-- Enchantment: AGI +6 +-- Durration: 3 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,180,15505); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_AGI, 6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_AGI, 6); +end; + Index: scripts/globals/items/dil.lua =================================================================== --- scripts/globals/items/dil.lua (revision 0) +++ scripts/globals/items/dil.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5457 +-- Item: Dil +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 4 +-- Mind -6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5457); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 4); + target:addMod(MOD_MND, -6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 4); + target:delMod(MOD_MND, -6); +end; Index: scripts/globals/items/dish_of_spaghetti_nero_di_seppia_+1.lua =================================================================== --- scripts/globals/items/dish_of_spaghetti_nero_di_seppia_+1.lua (revision 0) +++ scripts/globals/items/dish_of_spaghetti_nero_di_seppia_+1.lua (working copy) @@ -0,0 +1,68 @@ +----------------------------------------- +-- ID: 5202 +-- Item: Dish of Spaghetti Nero Di Seppia +1 +-- Food Effect: 60 Mins, All Races +----------------------------------------- +-- HP % 17 (cap 140) +-- Dexterity 3 +-- Vitality 2 +-- Agility -1 +-- Mind -2 +-- Charisma -1 +-- Double Attack 1 +-- Store TP 6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,3600,5202); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 17); + target:addMod(MOD_FOOD_HP_CAP, 140); + target:addMod(MOD_DEX, 3); + target:addMod(MOD_VIT, 2); + target:addMod(MOD_AGI, -1); + target:addMod(MOD_MND, -2); + target:addMod(MOD_CHR, -1); + target:addMod(MOD_DOUBLE_ATTACK, 1); + target:addMod(MOD_STORETP, 6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 17); + target:delMod(MOD_FOOD_HP_CAP, 140); + target:delMod(MOD_DEX, 3); + target:delMod(MOD_VIT, 2); + target:delMod(MOD_AGI, -1); + target:delMod(MOD_MND, -2); + target:delMod(MOD_CHR, -1); + target:delMod(MOD_DOUBLE_ATTACK, 1); + target:delMod(MOD_STORETP, 6); +end; Index: scripts/globals/items/dish_of_spaghetti_ortolana.lua =================================================================== --- scripts/globals/items/dish_of_spaghetti_ortolana.lua (revision 0) +++ scripts/globals/items/dish_of_spaghetti_ortolana.lua (working copy) @@ -0,0 +1,56 @@ +----------------------------------------- +-- ID: 5658 +-- Item: Dish of Spafhetti Ortolana +-- Food Effect: 30 Mins, All Races +----------------------------------------- +-- Agility 2 +-- Vitality 2 +-- HP +30% Cap 70 +-- StoreTP +6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,3600,5658); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_VIT, 2); + target:addMod(MOD_AGI, 2); + target:addMod(MOD_FOOD_HPP, 30); + target:addMod(MOD_FOOD_HP_CAP, 70); + target:addMod(MOD_STORETP, 6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_VIT, 2); + target:delMod(MOD_AGI, 2); + target:delMod(MOD_FOOD_HPP, 30); + target:delMod(MOD_FOOD_HP_CAP, 70); + target:delMod(MOD_STORETP, 6); +end; Index: scripts/globals/items/dish_of_spaghetti_ortolana_+1.lua =================================================================== --- scripts/globals/items/dish_of_spaghetti_ortolana_+1.lua (revision 0) +++ scripts/globals/items/dish_of_spaghetti_ortolana_+1.lua (working copy) @@ -0,0 +1,56 @@ +----------------------------------------- +-- ID: 5659 +-- Item: Dish of Spafhetti Ortolana +-- Food Effect: 1 Hr, All Races +----------------------------------------- +-- Agility 2 +-- Vitality 2 +-- HP +30% Cap 75 +-- StoreTP +6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,7200,5659); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_VIT, 2); + target:addMod(MOD_AGI, 2); + target:addMod(MOD_FOOD_HPP, 30); + target:addMod(MOD_FOOD_HP_CAP, 75); + target:addMod(MOD_STORETP, 6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_VIT, 2); + target:delMod(MOD_AGI, 2); + target:delMod(MOD_FOOD_HPP, 30); + target:delMod(MOD_FOOD_HP_CAP, 75); + target:delMod(MOD_STORETP, 6); +end; Index: scripts/globals/items/dish_of_spaghetti_tonno_rosso.lua =================================================================== --- scripts/globals/items/dish_of_spaghetti_tonno_rosso.lua (revision 0) +++ scripts/globals/items/dish_of_spaghetti_tonno_rosso.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5623 +-- Item: Dish of Spaghetti Tonno Rosso +-- Food Effect: 30 Mins, All Races +----------------------------------------- +-- Health % 13 +-- Health Cap 180 +-- Dexterity 1 +-- Vitality 2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,3600,5623); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 13); + target:addMod(MOD_FOOD_HP_CAP, 180); + target:addMod(MOD_DEX, 1); + target:addMod(MOD_VIT, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 13); + target:delMod(MOD_FOOD_HP_CAP, 180); + target:delMod(MOD_DEX, 1); + target:delMod(MOD_VIT, 2); +end; Index: scripts/globals/items/dish_of_spaghetti_tonno_rosso_+1.lua =================================================================== --- scripts/globals/items/dish_of_spaghetti_tonno_rosso_+1.lua (revision 0) +++ scripts/globals/items/dish_of_spaghetti_tonno_rosso_+1.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5624 +-- Item: Dish of Spaghetti Tonno Rosso +1 +-- Food Effect: 60 Mins, All Races +----------------------------------------- +-- Health % 13 +-- Health Cap 185 +-- Dexterity 2 +-- Vitality 3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,7200,5624); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 13); + target:addMod(MOD_FOOD_HP_CAP, 185); + target:addMod(MOD_DEX, 2); + target:addMod(MOD_VIT, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 13); + target:delMod(MOD_FOOD_HP_CAP, 185); + target:delMod(MOD_DEX, 2); + target:delMod(MOD_VIT, 3); +end; Index: scripts/globals/items/dish_of_spaghetti_vongole_rosso_+1.lua =================================================================== --- scripts/globals/items/dish_of_spaghetti_vongole_rosso_+1.lua (revision 0) +++ scripts/globals/items/dish_of_spaghetti_vongole_rosso_+1.lua (working copy) @@ -0,0 +1,63 @@ +----------------------------------------- +-- ID: 5198 +-- Item: Dish of Spaghetti Vongole Rosso +1 +-- Food Effect: 60Min, All Races +----------------------------------------- +-- Health % 20 +-- Health Cap 95 +-- Vitality 2 +-- Mind -1 +-- Defense % 25 +-- Defense Cap 35 +-- Store TP 6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,3600,5198); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 20); + target:addMod(MOD_FOOD_HP_CAP, 95); + target:addMod(MOD_VIT, 2); + target:addMod(MOD_MND, -1); + target:addMod(MOD_FOOD_DEFP, 25); + target:addMod(MOD_FOOD_DEF_CAP, 35); + target:addMod(MOD_STORETP, 6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 20); + target:delMod(MOD_FOOD_HP_CAP, 95); + target:delMod(MOD_VIT, 2); + target:delMod(MOD_MND, -1); + target:delMod(MOD_FOOD_DEFP, 25); + target:delMod(MOD_FOOD_DEF_CAP, 35); + target:delMod(MOD_STORETP, 6); +end; Index: scripts/globals/items/dispel_couse.lua =================================================================== --- scripts/globals/items/dispel_couse.lua (revision 0) +++ scripts/globals/items/dispel_couse.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 18095 +-- Item: Dispel Couse +-- Enchantment: Sames as Dispel +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local dispel = target:dispelStatusEffect(); + if(dispel == EFFECT_NONE) then + skill:setMsg(MSG_NO_EFFECT); + else + skill:setMsg(MSG_DISPEL); + end +end; \ No newline at end of file Index: scripts/globals/items/diverters_ring.lua =================================================================== --- scripts/globals/items/diverters_ring.lua (revision 0) +++ scripts/globals/items/diverters_ring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15833 +-- Item: Diverters Ring +-- Item Effect: Avatar Enmity +2 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_RING1) == 15833 or target:getEquipID(SLOT_RING2) == 15833) then + pet:addMod(MOD_ENMITY, 2); + else + pet:delMod(MOD_ENMITY, 2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/dominus_shield.lua =================================================================== --- scripts/globals/items/dominus_shield.lua (revision 3304) +++ scripts/globals/items/dominus_shield.lua (working copy) @@ -1,30 +1,37 @@ ------------------------------------------ --- ID: 14491 --- Item: Dominus Shield --- Item Effect: Restores 20-35 MP ------------------------------------------ - -require("scripts/globals/settings"); - ------------------------------------------ --- OnItemCheck ------------------------------------------ - -function onItemCheck(target) - return 0; -end; - ------------------------------------------ --- OnItemUse ------------------------------------------ - -function onItemUse(target) - mpHeal = math.random(60,85); - - dif = target:getMaxMP() - target:getMP(); - if(mpHeal > dif) then - mpHeal = dif; - end - target:addMP(mpHeal); - target:messageBasic(276,0,mpHeal); +----------------------------------------- +-- ID: 12411 +-- Item: Ether +-- Item Effect: Restores 60 MP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; +mMP = target:getMaxMP(); +cMP = target:getMP(); +diff = mMP - cMP; + +if (mMP == cMP) then + result = 56; -- Does not let player use item if their mp is full +end + +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if (diff > 60) then + target:addMP(60); + elseif (diff < 60) then + target:addMP(diff); + end; end; \ No newline at end of file Index: scripts/globals/items/dose_of_baraero_ointment.lua =================================================================== --- scripts/globals/items/dose_of_baraero_ointment.lua (revision 0) +++ scripts/globals/items/dose_of_baraero_ointment.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 5249 +-- Item: Dose of Baraero Ointment +-- Item Effect: Wind Resistance +20 ? +-- Duration: 5 Mins ? +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_BARAERO,20,0,300,0,1);) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end + return EFFECT_BARAERO; +end; Index: scripts/globals/items/dose_of_barblizzard_ointment.lua =================================================================== --- scripts/globals/items/dose_of_barblizzard_ointment.lua (revision 0) +++ scripts/globals/items/dose_of_barblizzard_ointment.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 5248 +-- Item: Dose of Barblizzard Ointment +-- Item Effect: Ice Resistance +20 ? +-- Duration: 5 Mins ? +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_BARBLIZZARD,20,0,300,0,1);) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end + return EFFECT_BARBLIZZARD; +end; Index: scripts/globals/items/dose_of_barfire_ointment.lua =================================================================== --- scripts/globals/items/dose_of_barfire_ointment.lua (revision 0) +++ scripts/globals/items/dose_of_barfire_ointment.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 5247 +-- Item: Dose of Barfire Ointment +-- Item Effect: Fire Resistance +20 ? +-- Duration: 5 Mins ? +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_BARFIRE,20,0,300,0,1);) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end + return EFFECT_BARFIRE; +end; Index: scripts/globals/items/dose_of_barstone_ointment.lua =================================================================== --- scripts/globals/items/dose_of_barstone_ointment.lua (revision 0) +++ scripts/globals/items/dose_of_barstone_ointment.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 5250 +-- Item: Dose of Barstone Ointment +-- Item Effect: Earth Resistance +20 ? +-- Duration: 5 Mins ? +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_BARSTONE,20,0,300,0,1);) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end + return EFFECT_BARSTONE; +end; Index: scripts/globals/items/dose_of_barthunder_ointment.lua =================================================================== --- scripts/globals/items/dose_of_barthunder_ointment.lua (revision 0) +++ scripts/globals/items/dose_of_barthunder_ointment.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 5251 +-- Item: Dose of Barthunder Ointment +-- Item Effect: Thunder Resistance +20 ? +-- Duration: 5 Mins ? +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_BARTHUNDER,20,0,300,0,1);) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end + return EFFECT_BARTHUNDER; +end; Index: scripts/globals/items/dose_of_barwater_ointment.lua =================================================================== --- scripts/globals/items/dose_of_barwater_ointment.lua (revision 0) +++ scripts/globals/items/dose_of_barwater_ointment.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 5252 +-- Item: Dose of Barwater Ointment +-- Item Effect: Water Resistance +20 ? +-- Duration: 5 Mins ? +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_BARWATER,20,0,300,0,1);) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end + return EFFECT_BARWATER; +end; Index: scripts/globals/items/drachenstich.lua =================================================================== --- scripts/globals/items/drachenstich.lua (revision 0) +++ scripts/globals/items/drachenstich.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 19792 +-- Item: Drachenstich +-- Item Effect: Wyvern Dmg -5% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_MAIN) == 19792) then + if(pet:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_DMG, -5); + else + pet:delMod(MOD_DMG, -5); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/draconis_lance.lua =================================================================== --- scripts/globals/items/draconis_lance.lua (revision 0) +++ scripts/globals/items/draconis_lance.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 16843 +-- Item: Draconis Lance +-- Item Effect: Wyvern Acc Atk +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_MAIN) == 16843) then + if(pet:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_ATT, 10); + pet:addMod(MOD_ACC, 10); + else + pet:delMod(MOD_ATT, 10); + pet:delMod(MOD_ACC, 10); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/dragon_fruit.lua =================================================================== --- scripts/globals/items/dragon_fruit.lua (revision 0) +++ scripts/globals/items/dragon_fruit.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5662 +-- Item: Dragon Fruit +-- Food Effect: 5 Mins, All Races +----------------------------------------- +-- Intelligence 4 +-- Agility -6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5662); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_INT, 4); + target:addMod(MOD_AGI, -6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_INT, 4); + target:delMod(MOD_AGI, -6); +end; Index: scripts/globals/items/dragon_heart.lua =================================================================== --- scripts/globals/items/dragon_heart.lua (revision 0) +++ scripts/globals/items/dragon_heart.lua (working copy) @@ -0,0 +1,63 @@ +----------------------------------------- +-- ID: 4486 +-- Item: Dragon Heart +-- Food Effect: 3 Hr, Galka Only +----------------------------------------- +-- Strength 7 +-- Intelligence -9 +-- MP -40 +-- HP 40 +-- Dragon Killer 10 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:getRace() ~= 8) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,4486); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 7); + target:addMod(MOD_INT, -9); + target:addMod(MOD_MP, -40); + target:addMod(MOD_HP, 40); + target:addMod(MOD_DRAGON_KILLER, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 7); + target:delMod(MOD_INT, -9); + target:delMod(MOD_MP, -40); + target:delMod(MOD_HP, 40); + target:delMod(MOD_DRAGON_KILLER, 10); +end; Index: scripts/globals/items/dragon_tank.lua =================================================================== --- scripts/globals/items/dragon_tank.lua (revision 0) +++ scripts/globals/items/dragon_tank.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 11002 +-- Dragon Tank +-- When used, you will obtain one Dragon Fruit au Lait +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5933,1); +end; \ No newline at end of file Index: scripts/globals/items/dragonkin_earring.lua =================================================================== --- scripts/globals/items/dragonkin_earring.lua (revision 0) +++ scripts/globals/items/dragonkin_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11038 +-- Item: Dragonkin Earring +-- Item Effect: Pet Wyvern Physical Dmg taken -2% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_EAR1) == 11038 or target:getEquipID(SLOT_EAR2) == 11038) then + pet:addMod(MOD_DMGPHYS, -2); + else + pet:addMod(MOD_DMGPHYS, -2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/dream_boots_+1.lua =================================================================== --- scripts/globals/items/dream_boots_+1.lua (revision 0) +++ scripts/globals/items/dream_boots_+1.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------------- +-- ID: 15753 +-- Item: Dream Boots +1 +-- Enchantment: Sneak +-- Durration: 3 Mins 20 Secs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local duration = 200; + duration = duration + (duration * target:getMod(MOD_SNEAK_DUR)); + if (not target:hasStatusEffect(EFFECT_SNEAK)) then + target:addStatusEffect(EFFECT_SNEAK,1,10,duration); + end +end; Index: scripts/globals/items/dream_hat_+1.lua =================================================================== --- scripts/globals/items/dream_hat_+1.lua (revision 0) +++ scripts/globals/items/dream_hat_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15179 +-- Dream Hat +1 +-- When used, you will obtain one Ginger Cookie +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(4394,1); +end; \ No newline at end of file Index: scripts/globals/items/dream_mittens_+1.lua =================================================================== --- scripts/globals/items/dream_mittens_+1.lua (revision 0) +++ scripts/globals/items/dream_mittens_+1.lua (working copy) @@ -0,0 +1,27 @@ +----------------------------------------- +-- ID: 10383 +-- Item: Dream Mittens +1 +-- Enchantment: Invisible +-- Durration: 3 Mins 20 Secs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if (not target:hasStatusEffect(EFFECT_INVISIBLE)) then + target:addStatusEffect(EFFECT_INVISIBLE,0,10,200); + end +end; Index: scripts/globals/items/ducal_guards_ring.lua =================================================================== --- scripts/globals/items/ducal_guards_ring.lua (revision 0) +++ scripts/globals/items/ducal_guards_ring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 14657 +-- Item: Ducal Guard Ring +-- Enchantment: Ducal Recal +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(243) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + ducalGaurdRing(target); +end; Index: scripts/globals/items/duchy_earring.lua =================================================================== --- scripts/globals/items/duchy_earring.lua (revision 0) +++ scripts/globals/items/duchy_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16042 +-- Item: Duchy Earring +-- Enchantment: "Teleport" (Upper Jueno) +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/teleports"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(244) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duchyEarring(target); +end; \ No newline at end of file Index: scripts/globals/items/dune_gilet_+1.lua =================================================================== --- scripts/globals/items/dune_gilet_+1.lua (revision 0) +++ scripts/globals/items/dune_gilet_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10271 +-- Dune Gilet +1 +-- When used, you will obtain 1 Berry Snowcone +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5710,1); +end; \ No newline at end of file Index: scripts/globals/items/dusty_elixir.lua =================================================================== --- scripts/globals/items/dusty_elixir.lua (revision 0) +++ scripts/globals/items/dusty_elixir.lua (working copy) @@ -0,0 +1,37 @@ +----------------------------------------- +-- ID: 5433 +-- Item: Dusty Elixir +-- Item Effect: Instantly restores 25% of HP and MP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; +mHP = target:getMaxHP(); +cHP = target:getHP(); +mMP = target:getMaxMP(); +cMP = target:getMP(); + + +if (mHP == cHP and mMP == cMP) then + result = 56; -- Does not let player use item if their hp and mp are full +end + +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addHP((target:getMaxHP()/100)*25); + target:addMP((target:getMaxMP()/100)*25); + target:messageBasic(26); +end; \ No newline at end of file Index: scripts/globals/items/dusty_ether.lua =================================================================== --- scripts/globals/items/dusty_ether.lua (revision 0) +++ scripts/globals/items/dusty_ether.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5432 +-- Item: Dusty Ether +-- Item Effect: Restores 150 MP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addMP(150*ITEM_POWER); + target:messageBasic(25,0,150); +end; Index: scripts/globals/items/dusty_potion.lua =================================================================== --- scripts/globals/items/dusty_potion.lua (revision 0) +++ scripts/globals/items/dusty_potion.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 5431 +-- Item: Dusty Potion +-- Item Effect: Restores 150 HP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +value = 0; +mHP = target:getMaxHP(); +cHP = target:getHP(); + +if (mHP == cHP) then + value = 56; -- Does not let player use item if their hp is full +end + +return value; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addHP(150*ITEM_POWER); + target:messageBasic(24,0,150); +end; \ No newline at end of file Index: scripts/globals/items/dusty_reraise.lua =================================================================== --- scripts/globals/items/dusty_reraise.lua (revision 0) +++ scripts/globals/items/dusty_reraise.lua (working copy) @@ -0,0 +1,36 @@ +----------------------------------------- +-- ID: 5436 +-- Item: Dusty Scroll of ReRaise +-- Effect: Brings you back from the dead~! +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + power = 1; + duration = 1800; + if(target:hasStatusEffect(EFFECT_RERAISE) ==true)then + effect = target:getStatusEffect(EFFECT_RERAISE); + oPower = effect:getPower(); + if(oPower > power) then + target:messageBasic(283); -- Higher Tiered verson means no effect! + else + target:delStatusEffect(EFFECT_RERAISE); + target:addStatusEffect(EFFECT_RERAISE,power,0,duration); + end + else + target:addStatusEffect(EFFECT_RERAISE,power,0,duration); + end +end; \ No newline at end of file Index: scripts/globals/items/dusty_wing.lua =================================================================== --- scripts/globals/items/dusty_wing.lua (revision 3304) +++ scripts/globals/items/dusty_wing.lua (working copy) @@ -1,15 +1,21 @@ ----------------------------------------- --- ID: 5440 --- Dusty Wing --- Increases TP of the user by 300 +-- ID: 5440 +-- Item: Dusty Wing +-- Effect: Increases TP of the user by 300 ----------------------------------------- +require("scripts/globals/status"); + ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) - return 0; + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; end; ----------------------------------------- @@ -17,5 +23,6 @@ ----------------------------------------- function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); target:addTP(300); end; \ No newline at end of file Index: scripts/globals/items/earth_card_case.lua =================================================================== --- scripts/globals/items/earth_card_case.lua (revision 0) +++ scripts/globals/items/earth_card_case.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5405 +-- Item: Earth Card Case +-- Effect: When used, you will obtain one stack of Wind Cards +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(2179,99); +end; \ No newline at end of file Index: scripts/globals/items/eastern_san_doria_gate_glyph.lua =================================================================== --- scripts/globals/items/eastern_san_doria_gate_glyph.lua (revision 0) +++ scripts/globals/items/eastern_san_doria_gate_glyph.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 4190 +-- Item: East San d'Oria Gate Glyph +-- Enchantment: "Teleport" (East San d'Oria) +----------------------------------------- + +require("scripts/globals/teleports"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + sandoriaEastGlyph(target); +end; \ No newline at end of file Index: scripts/globals/items/ecphoria_ring.lua =================================================================== --- scripts/globals/items/ecphoria_ring.lua (revision 0) +++ scripts/globals/items/ecphoria_ring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15817 +-- Item: Ecphoria Ring +-- Item Effect: Remedies amnesia. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:hasStatusEffect(EFFECT_AMNESIA) == true) then + target:delStatusEffect(EFFECT_AMNESIA); + else + target:messageBasic(423); -- no effect + end +end; + Index: scripts/globals/items/elshimo_frog.lua =================================================================== --- scripts/globals/items/elshimo_frog.lua (revision 3304) +++ scripts/globals/items/elshimo_frog.lua (working copy) @@ -19,7 +19,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/elshimo_pachira_fruit.lua =================================================================== --- scripts/globals/items/elshimo_pachira_fruit.lua (revision 0) +++ scripts/globals/items/elshimo_pachira_fruit.lua (working copy) @@ -0,0 +1,34 @@ +----------------------------------------- +-- ID: 5604 +-- Item: Elshimo Pachira Fruit +-- Effect: 2 Mins, All Races +----------------------------------------- +-- Poison 1HP / 3Tic - 40 Total +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,120,5604); + if(target:hasStatusEffect(EFFECT_POISON) == false) then + target:addStatusEffect(EFFECT_POISON,1,3,120); + else + target:messageBasic(423); + end +end; Index: scripts/globals/items/empire_earring.lua =================================================================== --- scripts/globals/items/empire_earring.lua (revision 0) +++ scripts/globals/items/empire_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16049 +-- Item: Empire Earring +-- Enchantment: "Teleport" (Aht Urhgan Whitegate) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(50) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + toAhtUrhganWhitegate(target) +end; \ No newline at end of file Index: scripts/globals/items/enif_gambieras.lua =================================================================== --- scripts/globals/items/enif_gambieras.lua (revision 0) +++ scripts/globals/items/enif_gambieras.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 10367 +-- Item: Enif Gambieras +-- Item Effect: Wyvern HP +80 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 10367) then + pet:addMod(MOD_HP, 80); + else + pet:delMod(MOD_HP, 80); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/enthralling_brocade_obi.lua =================================================================== --- scripts/globals/items/enthralling_brocade_obi.lua (revision 0) +++ scripts/globals/items/enthralling_brocade_obi.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 15862 +-- Item: Enthralling Brocade Obi +-- Enchantment: CHR 10 +-- Charges: 30 Reuse Delay: 600 Secs +-- Duration: 60 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,60,15862); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_CHR, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_CHR, 10); +end; \ No newline at end of file Index: scripts/globals/items/enthralling_gold_obi.lua =================================================================== --- scripts/globals/items/enthralling_gold_obi.lua (revision 0) +++ scripts/globals/items/enthralling_gold_obi.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 15461 +-- Item: Enthralling Gold Obi +-- Enchantment: CHR 3 +-- Charges: 30 Reuse Delay: 600 Secs +-- Duration: 60 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,60,15461); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_CHR, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_CHR, 3); +end; \ No newline at end of file Index: scripts/globals/items/evokers_bracers.lua =================================================================== --- scripts/globals/items/evokers_bracers.lua (revision 0) +++ scripts/globals/items/evokers_bracers.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 13975 +-- Item: Evoker's Bracers +-- Item Effect: Avatar Enmity -2 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HANDS) == 13975) then + if(pet:getPetType() == PETTYPE_AVATAR) then + pet:addMod(MOD_ENMITY, -2); + else + pet:delMod(MOD_ENMITY, -2); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/evokers_bracers_+1.lua =================================================================== --- scripts/globals/items/evokers_bracers_+1.lua (revision 0) +++ scripts/globals/items/evokers_bracers_+1.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 14904 +-- Item: Evoker's Bracers +1 +-- Item Effect: Avatar Enmity -2 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HANDS) == 14904) then + if(pet:getPetType() == PETTYPE_AVATAR) then + pet:addMod(MOD_ENMITY, -2); + else + pet:delMod(MOD_ENMITY, -2); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/federation_earring.lua =================================================================== --- scripts/globals/items/federation_earring.lua (revision 0) +++ scripts/globals/items/federation_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16041 +-- Item: Federation Earring +-- Enchantment: "Teleport" (Windurst Waters) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(238) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + federationEarring(target); +end; \ No newline at end of file Index: scripts/globals/items/federation_signet_staff.lua =================================================================== --- scripts/globals/items/federation_signet_staff.lua (revision 0) +++ scripts/globals/items/federation_signet_staff.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 17585 +-- Item: Federation Signet Staff +-- Item Effect: Grants target Signet +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:getNation() ~= 2) then + result = 56; + end + if (target:checkSoloPartyAlliance() == 0) then + result = 56; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:delStatusEffect(EFFECT_SIGNET); + target:addStatusEffect(EFFECT_SIGNET,0,0,18000,0,0); +end; + + Index: scripts/globals/items/federation_stables_scarf.lua =================================================================== --- scripts/globals/items/federation_stables_scarf.lua (revision 0) +++ scripts/globals/items/federation_stables_scarf.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 13181 +-- Item: Federation Stables Scarf +-- Enchantment: "Teleport" (Windurst Chocobo Stables) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(241) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + federationStablesScarf(target); +end; \ No newline at end of file Index: scripts/globals/items/felicifruit.lua =================================================================== --- scripts/globals/items/felicifruit.lua (revision 0) +++ scripts/globals/items/felicifruit.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5964 +-- Item: Felicifruit +-- Food Effect: 5Min, All Races +----------------------------------------- +-- Agility -7 +-- Intelligence 5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5964); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_AGI, -7); + target:addMod(MOD_INT, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_AGI, -7); + target:delMod(MOD_INT, 5); +end; Index: scripts/globals/items/ferine_earring.lua =================================================================== --- scripts/globals/items/ferine_earring.lua (revision 0) +++ scripts/globals/items/ferine_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11711 +-- Item: Ferine Earring +-- Item Effect: Pet Accuracy +3 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_EAR1) == 11711 or target:getEquipID(SLOT_EAR2) == 11711) then + pet:addMod(MOD_ACC, 3); + else + pet:addMod(MOD_ACC, 3); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/ferine_mantle.lua =================================================================== --- scripts/globals/items/ferine_mantle.lua (revision 0) +++ scripts/globals/items/ferine_mantle.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11555 +-- Item: Ferine Mantle +-- Item Effect: Pet: Accuracy +10 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_BACK) == 11555) then + pet:addMod(MOD_ACC, 10); + else + pet:delMod(MOD_ACC, 10); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/ferine_necklace.lua =================================================================== --- scripts/globals/items/ferine_necklace.lua (revision 0) +++ scripts/globals/items/ferine_necklace.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11617 +-- Item: Ferine Necklace +-- Item Effect: Pet Double Attack +2% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_NECK) == 11617) then + pet:addMod(MOD_DOUBLE_ATTACK, 2); + else + pet:delMod(MOD_DOUBLE_ATTACK, 2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/ferine_quijotes_+1.lua =================================================================== --- scripts/globals/items/ferine_quijotes_+1.lua (revision 0) +++ scripts/globals/items/ferine_quijotes_+1.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11232 +-- Item: Ferine Quijotes +1 +-- Item Effect: Pet -1% Dmg +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_LEGS) == 11232) then + pet:addMod(MOD_DMG, -1); + else + pet:delMod(MOD_DMG, -1); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/ferine_quijotes_+2.lua =================================================================== --- scripts/globals/items/ferine_quijotes_+2.lua (revision 0) +++ scripts/globals/items/ferine_quijotes_+2.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11132 +-- Item: Ferine Quijotes +2 +-- Item Effect: Pet -2% Dmg +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_LEGS) == 11132) then + pet:addMod(MOD_DMG, -2); + else + pet:delMod(MOD_DMG, -2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/fidelity_mantle.lua =================================================================== --- scripts/globals/items/fidelity_mantle.lua (revision 0) +++ scripts/globals/items/fidelity_mantle.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11531 +-- Item: Fidelity Mantle +-- Item Effect: Pet Store TP +3 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_BACK) == 11531) then + pet:addMod(MOD_STORETP, 3); + else + pet:delMod(MOD_STORETP, 3); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/fire_card_case.lua =================================================================== --- scripts/globals/items/fire_card_case.lua (revision 0) +++ scripts/globals/items/fire_card_case.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5402 +-- Item: Fire Card Case +-- Effect: When used, you will obtain one stack of Fire Cards +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(2176,99); +end; \ No newline at end of file Index: scripts/globals/items/fire_feather.lua =================================================================== --- scripts/globals/items/fire_feather.lua (revision 0) +++ scripts/globals/items/fire_feather.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 5256 +-- Item: Fire Feather +-- Effect: Enfire +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENFIRE,25,0,90)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; \ No newline at end of file Index: scripts/globals/items/flask_of_healing_mist.lua =================================================================== --- scripts/globals/items/flask_of_healing_mist.lua (revision 0) +++ scripts/globals/items/flask_of_healing_mist.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 5832 +-- Item: Flask of Healing Mist +-- Item Effect: Restores 600 HP AoE 10' radius +----------------------------------------- + +-- TODO: Make AoE + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + mHP = target:getMaxHP(); + cHP = target:getHP(); + if (mHP == cHP) then + result = 56; -- Does not let player use item if their hp is full + end + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); + target:messageBasic(25,0,target:addHP(600)); + +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/flask_of_healing_powder.lua =================================================================== --- scripts/globals/items/flask_of_healing_powder.lua (revision 0) +++ scripts/globals/items/flask_of_healing_powder.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 5322 +-- Item: Flask of Healing Powder +-- Item Effect: Restores 25% MP AoE 10' radius +----------------------------------------- + +-- TODO: Make AoE + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + mMP = target:getMaxHP(); + cMP = target:getHP(); + rMP = mHP * .25; + if (mHP == cHP) then + result = 56; -- Does not let player use item if their HP is full + end + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); + target:messageBasic(25,0,target:addHP(rHP)); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/flask_of_holy_water.lua =================================================================== --- scripts/globals/items/flask_of_holy_water.lua (revision 3304) +++ scripts/globals/items/flask_of_holy_water.lua (working copy) @@ -23,6 +23,16 @@ curse = target:getStatusEffect(EFFECT_CURSE_I); curse2 = target:getStatusEffect(EFFECT_CURSE_II); bane = target:getStatusEffect(EFFECT_BANE); + local ring1 = target:getEquipID(SLOT_RING1); + local ring2 = target:getEquipID(SLOT_RING2); + local pEquipMods = 0.25; + + if(ring1 == 10795 or ring2 == 10795) then -- Blenmot's & +1 Ring + pEquipMods = pEquipMods + .10 + end + if(ring1 == 10794 or ring2 == 10794) then + pEquipMods = pEquipMods + .05 + end if(curse ~= nil and curse2 ~= nil and bane ~= nil) then target:delStatusEffect(EFFECT_CURSE_I); @@ -46,7 +56,7 @@ elseif(bane ~= nil) then target:delStatusEffect(EFFECT_BANE); final = EFFECT_BANE; - elseif(target:hasStatusEffect(EFFECT_DOOM) and math.random() <= 0.25) then + elseif(target:hasStatusEffect(EFFECT_DOOM) and math.random() <= pEquipMods) then -- remove doom target:delStatusEffect(EFFECT_DOOM); target:messageBasic(359); Index: scripts/globals/items/flask_of_invitriol.lua =================================================================== --- scripts/globals/items/flask_of_invitriol.lua (revision 0) +++ scripts/globals/items/flask_of_invitriol.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 4171 +-- Item: Flask of Vitriol +-- Item Effect: Defense -20% +-- Duration: 3 Mins +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,180,4171)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEFP, -20); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEFP, -20); +end; \ No newline at end of file Index: scripts/globals/items/flask_of_mana_mist.lua =================================================================== --- scripts/globals/items/flask_of_mana_mist.lua (revision 0) +++ scripts/globals/items/flask_of_mana_mist.lua (working copy) @@ -0,0 +1,50 @@ +----------------------------------------- +-- ID: 5833 +-- Item: Flask of Mana Mist +-- Item Effect: Restores 300 MP AoE 10' radius +----------------------------------------- + +-- TODO: Make AoE + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + mMP = target:getMaxMP(); + cMP = target:getMP(); + if (mHP == cHP) then + result = 56; -- Does not let player use item if their mp is full + end + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); + target:messageBasic(25,0,target:addMP(300)); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/flask_of_primeval_brew.lua =================================================================== --- scripts/globals/items/flask_of_primeval_brew.lua (revision 0) +++ scripts/globals/items/flask_of_primeval_brew.lua (working copy) @@ -0,0 +1,77 @@ +----------------------------------------- +-- ID: 5853 +-- Item: Flask of Primeval Brew +-- Item Effect: Makes you a God +-- Duration: 3 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,180,5853)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 9999); + target:addMod(MOD_MP, 9999); + target:addMod(MOD_STR, 999); + target:addMod(MOD_DEX, 999); + target:addMod(MOD_AGI, 999); + target:addMod(MOD_VIT, 999); + target:addMod(MOD_INT, 999); + target:addMod(MOD_MND, 999); + target:addMod(MOD_CHR, 999); + target:addMod(MOD_ATT, 999); + target:addMod(MOD_DEF, 999); + target:addMod(MOD_REGEN, 300); + target:addMod(MOD_REFRESH, 300); + target:addMod(MOD_REGAIN, 50); + target:addMod(MOD_DMG, -90); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 9999); + target:delMod(MOD_MP, 9999); + target:delMod(MOD_STR, 999); + target:delMod(MOD_DEX, 999); + target:delMod(MOD_AGI, 999); + target:delMod(MOD_VIT, 999); + target:delMod(MOD_INT, 999); + target:delMod(MOD_MND, 999); + target:delMod(MOD_CHR, 999); + target:delMod(MOD_ATT, 999); + target:delMod(MOD_DEF, 999); + target:delMod(MOD_REGEN, 300); + target:delMod(MOD_REFRESH, 300); + target:delMod(MOD_REGAIN, 50); + target:delMod(MOD_DMG, -90); +end; Index: scripts/globals/items/flask_of_strange_milk.lua =================================================================== --- scripts/globals/items/flask_of_strange_milk.lua (revision 0) +++ scripts/globals/items/flask_of_strange_milk.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------------- +-- ID: 5437 +-- Item: Flask of Strange Milk +-- Item Effect: Restores 500 HP over 300 seconds. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_REGEN) == false) then + target:addStatusEffect(EFFECT_REGEN,5,3,300); + else + target:messageBasic(423); + end +end; + Index: scripts/globals/items/flask_of_vitriol.lua =================================================================== --- scripts/globals/items/flask_of_vitriol.lua (revision 0) +++ scripts/globals/items/flask_of_vitriol.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 4171 +-- Item: Flask of Vitriol +-- Item Effect: Defense -20% +-- Duration: 3 Mins +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,180,4171)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEFP, -20); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEFP, -20); +end; \ No newline at end of file Index: scripts/globals/items/flask_of_walahra_water.lua =================================================================== --- scripts/globals/items/flask_of_walahra_water.lua (revision 0) +++ scripts/globals/items/flask_of_walahra_water.lua (working copy) @@ -0,0 +1,60 @@ +----------------------------------------- +-- ID: 5354 +-- Item: Flask of Walahra Water +-- Item Effect: HP +5% MP +5% +-- Durration: Medicated 3 Mins +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + mHP = target:getMaxHP(); + cHP = target:getHP(); + mMP = target:getMaxMP(); + cMP = target:getMP(); + + if (mHP == cHP and mMP == cMP) then + result = 56; -- Does not let player use item if their hp and mp are full + end + + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + if(target:addStatusEffect(EFFECT_MEDICINE,0,0,180,5354)) then + target:messageBasic(205); + target:addHP((target:getMaxHP()/100)*5); + target:addMP((target:getMaxMP()/100)*5); + target:messageBasic(26); + + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; Index: scripts/globals/items/flexible_pole.lua =================================================================== --- scripts/globals/items/flexible_pole.lua (revision 0) +++ scripts/globals/items/flexible_pole.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 18586 +-- Item: Flexible Pole +-- Enchantment: Attack +3 +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,18586); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ATT, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ATT, 3); +end; + Index: scripts/globals/items/forest_carp.lua =================================================================== --- scripts/globals/items/forest_carp.lua (revision 3304) +++ scripts/globals/items/forest_carp.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/fourth_staff.lua =================================================================== --- scripts/globals/items/fourth_staff.lua (revision 0) +++ scripts/globals/items/fourth_staff.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 18613 +-- Item: Fourth Staff +-- Enchantment: "Retrace" (Bastok) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(87) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + fourthStaff(target); +end; \ No newline at end of file Index: scripts/globals/items/frayed_pouch_of_advancement.lua =================================================================== --- scripts/globals/items/frayed_pouch_of_advancement.lua (revision 0) +++ scripts/globals/items/frayed_pouch_of_advancement.lua (working copy) @@ -0,0 +1,27 @@ +----------------------------------------- +-- ID: 5855 +-- Item: Frayed Pouch (A) +-- Effect: When used, you will obtain 1-12 Coins of Advancement +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local amount = math.random(1,12) + target:addItem(2604,amount); +end; + Index: scripts/globals/items/frayed_pouch_of_birth.lua =================================================================== --- scripts/globals/items/frayed_pouch_of_birth.lua (revision 0) +++ scripts/globals/items/frayed_pouch_of_birth.lua (working copy) @@ -0,0 +1,27 @@ +----------------------------------------- +-- ID: 5854 +-- Item: Frayed Pouch (B) +-- Effect: When used, you will obtain 1-12 Coins of Birth +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local amount = math.random(1,12) + target:addItem(2603,amount); +end; + Index: scripts/globals/items/frayed_pouch_of_decay.lua =================================================================== --- scripts/globals/items/frayed_pouch_of_decay.lua (revision 0) +++ scripts/globals/items/frayed_pouch_of_decay.lua (working copy) @@ -0,0 +1,27 @@ +----------------------------------------- +-- ID: 5857 +-- Item: Frayed Pouch (D) +-- Effect: When used, you will obtain 1-12 Coins of Decay +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local amount = math.random(1,12) + target:addItem(2606,amount); +end; + Index: scripts/globals/items/frayed_pouch_of_glory.lua =================================================================== --- scripts/globals/items/frayed_pouch_of_glory.lua (revision 0) +++ scripts/globals/items/frayed_pouch_of_glory.lua (working copy) @@ -0,0 +1,27 @@ +----------------------------------------- +-- ID: 5856 +-- Item: Frayed Pouch (G) +-- Effect: When used, you will obtain 1-12 Coins of Glory +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local amount = math.random(1,12) + target:addItem(2605,amount); +end; + Index: scripts/globals/items/frayed_pouch_of_ruin.lua =================================================================== --- scripts/globals/items/frayed_pouch_of_ruin.lua (revision 0) +++ scripts/globals/items/frayed_pouch_of_ruin.lua (working copy) @@ -0,0 +1,27 @@ +----------------------------------------- +-- ID: 5858 +-- Item: Frayed Pouch (R) +-- Effect: When used, you will obtain 1-12 Coins of Ruin +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local amount = math.random(1,12) + target:addItem(2607,amount); +end; + Index: scripts/globals/items/fum-long_salmon_sub.lua =================================================================== --- scripts/globals/items/fum-long_salmon_sub.lua (revision 0) +++ scripts/globals/items/fum-long_salmon_sub.lua (working copy) @@ -0,0 +1,60 @@ +----------------------------------------- +-- ID: 4266 +-- Item: Fum-Long Salmon Sub +-- Food Effect: 60Min, All Races +----------------------------------------- +-- Agility 1 +-- Vitality 1 +-- Dexterity 2 +-- Intelligence 2 +-- Mind -2 +-- Ranged Accuracy 3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,3600,4266); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_AGI, 1); + target:addMod(MOD_VIT, 1); + target:addMod(MOD_DEX, 2); + target:addMod(MOD_INT, 1); + target:addMod(MOD_MND, -2); + target:addMod(MOD_RACC, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_AGI, 1); + target:delMod(MOD_VIT, 1); + target:delMod(MOD_DEX, 2); + target:delMod(MOD_INT, 1); + target:delMod(MOD_MND, -2); + target:delMod(MOD_RACC, 3); +end; Index: scripts/globals/items/gaiardas_ring.lua =================================================================== --- scripts/globals/items/gaiardas_ring.lua (revision 0) +++ scripts/globals/items/gaiardas_ring.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 10775 +-- Item: Gaiardas Ring +-- Enchantment: Attack +10 +-- Durration: 5 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,300,10775); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ATT, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ATT, 10); +end; + Index: scripts/globals/items/gamushara_earring.lua =================================================================== --- scripts/globals/items/gamushara_earring.lua (revision 0) +++ scripts/globals/items/gamushara_earring.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 14788 +-- Item: Gamushara Earring +-- Enchantment: Attack +22 +-- Durration: 3 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,180,14788); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ATK, 22); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ATK, 22); +end; + Index: scripts/globals/items/gargouille_quiver.lua =================================================================== --- scripts/globals/items/gargouille_quiver.lua (revision 0) +++ scripts/globals/items/gargouille_quiver.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5912 +-- Item: Gargouille Quiver +-- When used, you will obtain one stack of Gargouille Arrows +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(19800,99); +end; \ No newline at end of file Index: scripts/globals/items/gargoyle_boots.lua =================================================================== --- scripts/globals/items/gargoyle_boots.lua (revision 0) +++ scripts/globals/items/gargoyle_boots.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- ID: 15326 +-- Item: Gargoyle Boots +-- Enchantment: Wyvern Stoneskin +-- Durration: 1 Min +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local pet = target:getPet(); + if(pet:addStatusEffect(EFFECT_STONESKIN, 200, 0, 60)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; Index: scripts/globals/items/gateau_aux_fraises.lua =================================================================== --- scripts/globals/items/gateau_aux_fraises.lua (revision 0) +++ scripts/globals/items/gateau_aux_fraises.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 5542 +-- Item: Gateau aux fraises +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP 8 +-- MP 8% Cap 50 +-- Intelligence 1 +-- MP Recovered while healing 1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5542); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 8); + target:addMod(MOD_INT, 1); + target:addMod(MOD_FOOD_MPP, 8); + target:addMod(MOD_FOOD_MP_CAP, 50); + target:addMod(MOD_MPHEAL, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 8); + target:delMod(MOD_INT, 1); + target:delMod(MOD_FOOD_MPP, 8); + target:delMod(MOD_FOOD_MP_CAP, 50); + target:delMod(MOD_MPHEAL, 1); +end; Index: scripts/globals/items/gaubious_ring.lua =================================================================== --- scripts/globals/items/gaubious_ring.lua (revision 0) +++ scripts/globals/items/gaubious_ring.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 10776 +-- Item: Gaubious Ring +-- Enchantment: Accuracy +10 +-- Durration: 5 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,300,10776); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ACC, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ACC, 10); +end; + Index: scripts/globals/items/geo-acumen.lua =================================================================== --- scripts/globals/items/geo-acumen.lua (revision 0) +++ scripts/globals/items/geo-acumen.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6114 +-- Item: Geo-Acumen +-- Teaches the Geomancer Magic Geo-Acumen +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(811); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(811); +end; \ No newline at end of file Index: scripts/globals/items/geo-agi.lua =================================================================== --- scripts/globals/items/geo-agi.lua (revision 0) +++ scripts/globals/items/geo-agi.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6108 +-- Item: Geo-AGI +-- Teaches the Geomancer Magic Geo-AGI +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(805); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(805); +end; \ No newline at end of file Index: scripts/globals/items/geo-attunement.lua =================================================================== --- scripts/globals/items/geo-attunement.lua (revision 0) +++ scripts/globals/items/geo-attunement.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6119 +-- Item: Geo-Attunement +-- Teaches the Geomancer Magic Geo-Atunement +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(816); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(816); +end; \ No newline at end of file Index: scripts/globals/items/geo-barrier.lua =================================================================== --- scripts/globals/items/geo-barrier.lua (revision 0) +++ scripts/globals/items/geo-barrier.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6113 +-- Item: Geo-Barrier +-- Teaches the Geomancer Magic Geo-Barrier +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(810); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(810); +end; \ No newline at end of file Index: scripts/globals/items/geo-chr.lua =================================================================== --- scripts/globals/items/geo-chr.lua (revision 0) +++ scripts/globals/items/geo-chr.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6111 +-- Item: Geo-CHR +-- Teaches the Geomancer Magic Geo-CHR +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(808); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(808); +end; \ No newline at end of file Index: scripts/globals/items/geo-dex.lua =================================================================== --- scripts/globals/items/geo-dex.lua (revision 0) +++ scripts/globals/items/geo-dex.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6106 +-- Item: Geo-DEX +-- Teaches the Geomancer Magic Geo-DEX +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(803); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(803); +end; \ No newline at end of file Index: scripts/globals/items/geo-fade.lua =================================================================== --- scripts/globals/items/geo-fade.lua (revision 0) +++ scripts/globals/items/geo-fade.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6122 +-- Item: Geo-Fade +-- Teaches the Geomancer Magic Geo-Fade +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(819); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(819); +end; \ No newline at end of file Index: scripts/globals/items/geo-fend.lua =================================================================== --- scripts/globals/items/geo-fend.lua (revision 0) +++ scripts/globals/items/geo-fend.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6115 +-- Item: Geo-Fend +-- Teaches the Geomancer Magic Geo-Fend +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(812); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(812); +end; \ No newline at end of file Index: scripts/globals/items/geo-focus.lua =================================================================== --- scripts/globals/items/geo-focus.lua (revision 0) +++ scripts/globals/items/geo-focus.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6118 +-- Item: Geo-Focus +-- Teaches the Geomancer Magic Geo-Focus +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(815); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(815); +end; \ No newline at end of file Index: scripts/globals/items/geo-frailty.lua =================================================================== --- scripts/globals/items/geo-frailty.lua (revision 0) +++ scripts/globals/items/geo-frailty.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6121 +-- Item: Geo-Frailty +-- Teaches the Geomancer Magic Geo-Frailty +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(818); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(818); +end; \ No newline at end of file Index: scripts/globals/items/geo-fury.lua =================================================================== --- scripts/globals/items/geo-fury.lua (revision 0) +++ scripts/globals/items/geo-fury.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6112 +-- Item: Geo-Fury +-- Teaches the Geomancer Magic Geo-Fury +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(809); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(809); +end; \ No newline at end of file Index: scripts/globals/items/geo-gravity.lua =================================================================== --- scripts/globals/items/geo-gravity.lua (revision 0) +++ scripts/globals/items/geo-gravity.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6130 +-- Item: Geo-Gravity +-- Teaches the Geomancer Magic Geo-Gravity +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(827); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(827); +end; \ No newline at end of file Index: scripts/globals/items/geo-int.lua =================================================================== --- scripts/globals/items/geo-int.lua (revision 0) +++ scripts/globals/items/geo-int.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6109 +-- Item: Geo-INT +-- Teaches the Geomancer Magic Geo-INT +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(806); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(806); +end; \ No newline at end of file Index: scripts/globals/items/geo-languor.lua =================================================================== --- scripts/globals/items/geo-languor.lua (revision 0) +++ scripts/globals/items/geo-languor.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6127 +-- Item: Geo-Languor +-- Teaches the Geomancer Magic Geo-Languor +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(824); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(824); +end; \ No newline at end of file Index: scripts/globals/items/geo-malaise.lua =================================================================== --- scripts/globals/items/geo-malaise.lua (revision 0) +++ scripts/globals/items/geo-malaise.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6123 +-- Item: Geo-Malaise +-- Teaches the Geomancer Magic Geo-Malaise +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(820); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(820); +end; \ No newline at end of file Index: scripts/globals/items/geo-mnd.lua =================================================================== --- scripts/globals/items/geo-mnd.lua (revision 0) +++ scripts/globals/items/geo-mnd.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6110 +-- Item: Geo-MND +-- Teaches the Geomancer Magic Geo-MND +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(807); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(807); +end; \ No newline at end of file Index: scripts/globals/items/geo-paralysis.lua =================================================================== --- scripts/globals/items/geo-paralysis.lua (revision 0) +++ scripts/globals/items/geo-paralysis.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6129 +-- Item: Geo-Paralysis +-- Teaches the Geomancer Magic Geo-Paralysis +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(826); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(826); +end; \ No newline at end of file Index: scripts/globals/items/geo-poison.lua =================================================================== --- scripts/globals/items/geo-poison.lua (revision 0) +++ scripts/globals/items/geo-poison.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6103 +-- Item: Geo-Poison +-- Teaches the Geomancer Magic Geo-Poison +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(799); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(799); +end; \ No newline at end of file Index: scripts/globals/items/geo-precision.lua =================================================================== --- scripts/globals/items/geo-precision.lua (revision 0) +++ scripts/globals/items/geo-precision.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6116 +-- Item: Geo-Precision +-- Teaches the Geomancer Magic Geo-Precision +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(813); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(813); +end; \ No newline at end of file Index: scripts/globals/items/geo-refresh.lua =================================================================== --- scripts/globals/items/geo-refresh.lua (revision 0) +++ scripts/globals/items/geo-refresh.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6104 +-- Item: Geo-Refresh +-- Teaches the Geomancer Magic Geo-Refresh +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(800); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(800); +end; \ No newline at end of file Index: scripts/globals/items/geo-regen.lua =================================================================== --- scripts/globals/items/geo-regen.lua (revision 0) +++ scripts/globals/items/geo-regen.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6102 +-- Item: Geo-Regen +-- Teaches the Geomancer Magic Geo-Regen +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(798); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(798); +end; \ No newline at end of file Index: scripts/globals/items/geo-slip.lua =================================================================== --- scripts/globals/items/geo-slip.lua (revision 0) +++ scripts/globals/items/geo-slip.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6124 +-- Item: Geo-Slip +-- Teaches the Geomancer Magic Geo-Slip +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(821); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(821); +end; \ No newline at end of file Index: scripts/globals/items/geo-slow.lua =================================================================== --- scripts/globals/items/geo-slow.lua (revision 0) +++ scripts/globals/items/geo-slow.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6128 +-- Item: Geo-Slow +-- Teaches the Geomancer Magic Geo-Slow +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(825); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(825); +end; \ No newline at end of file Index: scripts/globals/items/geo-str.lua =================================================================== --- scripts/globals/items/geo-str.lua (revision 0) +++ scripts/globals/items/geo-str.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6105 +-- Item: Geo-STR +-- Teaches the Geomancer Magic Geo-STR +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(802); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(802); +end; \ No newline at end of file Index: scripts/globals/items/geo-torpor.lua =================================================================== --- scripts/globals/items/geo-torpor.lua (revision 0) +++ scripts/globals/items/geo-torpor.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6125 +-- Item: Geo-Torpor +-- Teaches the Geomancer Magic Geo-Torpor +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(822); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(822); +end; \ No newline at end of file Index: scripts/globals/items/geo-vex.lua =================================================================== --- scripts/globals/items/geo-vex.lua (revision 0) +++ scripts/globals/items/geo-vex.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6126 +-- Item: Geo-Vex +-- Teaches the Geomancer Magic Geo-Vex +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(823); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(823); +end; \ No newline at end of file Index: scripts/globals/items/geo-vit.lua =================================================================== --- scripts/globals/items/geo-vit.lua (revision 0) +++ scripts/globals/items/geo-vit.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6107 +-- Item: Geo-VIT +-- Teaches the Geomancer Magic Geo-VIT +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(804); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(804); +end; \ No newline at end of file Index: scripts/globals/items/geo-voidance.lua =================================================================== --- scripts/globals/items/geo-voidance.lua (revision 0) +++ scripts/globals/items/geo-voidance.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6117 +-- Item: Geo-Voidance +-- Teaches the Geomancer Magic Geo-Voidance +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(814); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(814); +end; \ No newline at end of file Index: scripts/globals/items/geo-wilt.lua =================================================================== --- scripts/globals/items/geo-wilt.lua (revision 0) +++ scripts/globals/items/geo-wilt.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6120 +-- Item: Geo-Wilt +-- Teaches the Geomancer Magic Geo-Wilt +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(817); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(817); +end; \ No newline at end of file Index: scripts/globals/items/getsul_ring.lua =================================================================== --- scripts/globals/items/getsul_ring.lua (revision 0) +++ scripts/globals/items/getsul_ring.lua (working copy) @@ -0,0 +1,39 @@ +----------------------------------------- +-- ID: 14681 +-- Getsul Ring +-- Enchantment: Max HP +20% +-- Uses: 20 Duration: 3 Mins +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,180,14681); + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HPP, 20); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HPP, 20); +end; \ No newline at end of file Index: scripts/globals/items/gimlet_spear.lua =================================================================== --- scripts/globals/items/gimlet_spear.lua (revision 0) +++ scripts/globals/items/gimlet_spear.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 18117 +-- Item: Gimlet Spear +-- Enchantment: Attack +3 +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,18117); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ATT, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ATT, 3); +end; + Index: scripts/globals/items/glyph_axe.lua =================================================================== --- scripts/globals/items/glyph_axe.lua (revision 0) +++ scripts/globals/items/glyph_axe.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16654 +-- Item: Glyph Axe +-- Item Effect: Pet Regain +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_MAIN) == 16654 or target:getEquipID(SLOT_SUB) == 16654) then + pet:addMod(MOD_REGAIN, 1); + else + pet:delMod(MOD_REGAIN, 1); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/gobbie_gavel.lua =================================================================== --- scripts/globals/items/gobbie_gavel.lua (revision 0) +++ scripts/globals/items/gobbie_gavel.lua (working copy) @@ -0,0 +1,24 @@ +----------------------------------------- +-- ID: 17032 +-- Gobbie Gavel +-- Enchantment: 60Min, Costume - Random Goblin +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,(math.random(484,511)),0,3600); +end; \ No newline at end of file Index: scripts/globals/items/gold_carp.lua =================================================================== --- scripts/globals/items/gold_carp.lua (revision 3304) +++ scripts/globals/items/gold_carp.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/gold_lobster.lua =================================================================== --- scripts/globals/items/gold_lobster.lua (revision 3304) +++ scripts/globals/items/gold_lobster.lua (working copy) @@ -18,7 +18,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/greedie.lua =================================================================== --- scripts/globals/items/greedie.lua (revision 3304) +++ scripts/globals/items/greedie.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/grilled_lik.lua =================================================================== --- scripts/globals/items/grilled_lik.lua (revision 0) +++ scripts/globals/items/grilled_lik.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5648 +-- Item: Grilled Lik +-- Food Effect: 60 Mins, All Races +----------------------------------------- +-- Dexterity 4 +-- Mind -1 +---------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,7200,5648); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 4); + target:addMod(MOD_MND, -1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 4); + target:delMod(MOD_MND, -1); +end; Index: scripts/globals/items/gurnard.lua =================================================================== --- scripts/globals/items/gurnard.lua (revision 0) +++ scripts/globals/items/gurnard.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5132 +-- Item: Gurnard +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 2 +-- Mind -4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5132); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 2); + target:addMod(MOD_MND, -4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 2); + target:delMod(MOD_MND, -4); +end; Index: scripts/globals/items/gyokuto_obi.lua =================================================================== --- scripts/globals/items/gyokuto_obi.lua (revision 3304) +++ scripts/globals/items/gyokuto_obi.lua (working copy) @@ -1,9 +1,11 @@ ----------------------------------------- -- ID: 15860 -- Gyokuto Obi --- Enchantment: 60Min, Costume - Large Rarab +-- Enchantment: Costume - Large Rarab +-- Durration: 60 Mins ----------------------------------------- +require("scripts/globals/settings"); require("scripts/globals/status"); ----------------------------------------- Index: scripts/globals/items/halo_claymore.lua =================================================================== --- scripts/globals/items/halo_claymore.lua (revision 3304) +++ scripts/globals/items/halo_claymore.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------------- --- ID: 13682 --- Ether Tank --- When used, you will obtain one Ether +-- ID: 16603 +-- Item: Halo Claymore +-- Enchantment: TP +10 +-- Durration: Instant ----------------------------------------- ----------------------------------------- @@ -9,11 +10,8 @@ ----------------------------------------- function onItemCheck(target) -result = 0; - if (target:getFreeSlotsCount() == 0) then - result = 308; - end -return result; + result = 0; + return result; end; ----------------------------------------- Index: scripts/globals/items/hamsi.lua =================================================================== --- scripts/globals/items/hamsi.lua (revision 0) +++ scripts/globals/items/hamsi.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5449 +-- Item: Hamsi +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 1 +-- Mind -3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5449); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 1); + target:addMod(MOD_MND, -3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 1); + target:delMod(MOD_MND, -3); +end; Index: scripts/globals/items/hanafubuki.lua =================================================================== --- scripts/globals/items/hanafubuki.lua (revision 0) +++ scripts/globals/items/hanafubuki.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 18427 +-- Item: Hanafubuki +-- Item Effect: TP +10 +-- Durration: Instant +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addTP(10); +end; Index: scripts/globals/items/handful_of_roasted_almonds.lua =================================================================== --- scripts/globals/items/handful_of_roasted_almonds.lua (revision 0) +++ scripts/globals/items/handful_of_roasted_almonds.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 5649 +-- Item: Handful of Roasted Almonds +-- Food Effect: 5Min, All Races +----------------------------------------- +-- HP 30 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5649); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 30); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 30); +end; Index: scripts/globals/items/head_of_grauberg_lettuce.lua =================================================================== --- scripts/globals/items/head_of_grauberg_lettuce.lua (revision 0) +++ scripts/globals/items/head_of_grauberg_lettuce.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5688 +-- Item: Head of Grauberg Lettuce +-- Food Effect: 5Min, All Races +----------------------------------------- +-- Agility 1 +-- Vitality -3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5688); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_AGI, 1); + target:addMod(MOD_VIT, -3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_AGI, 1); + target:delMod(MOD_VIT, -3); +end; Index: scripts/globals/items/healing_feather.lua =================================================================== --- scripts/globals/items/healing_feather.lua (revision 0) +++ scripts/globals/items/healing_feather.lua (working copy) @@ -0,0 +1,42 @@ +----------------------------------------- +-- ID: 18239 +-- Item: Healing Feather +-- Enchantment: Enhances Healing Magic +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,600,18239); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_CURE_POTENCY, 15); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_CURE_POTENCY, 15); +end; \ No newline at end of file Index: scripts/globals/items/heavy_metal_pouch.lua =================================================================== --- scripts/globals/items/heavy_metal_pouch.lua (revision 0) +++ scripts/globals/items/heavy_metal_pouch.lua (working copy) @@ -0,0 +1,27 @@ +----------------------------------------- +-- ID: 5910 +-- Item: Heavy Metal Pouch +-- Effect: When used, you will obtain 3-19 Heavy Metal Sheets +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local amount = math.random(3,19) + target:addItem(3509,amount); +end; + Index: scripts/globals/items/hecteyes_belt.lua =================================================================== --- scripts/globals/items/hecteyes_belt.lua (revision 0) +++ scripts/globals/items/hecteyes_belt.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 10852 +-- Hecteyes Belt +-- Enchantment: 60Min, Costume - Hecteyes +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,384,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/high_breath_mantle.lua =================================================================== --- scripts/globals/items/high_breath_mantle.lua (revision 0) +++ scripts/globals/items/high_breath_mantle.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 15487 +-- Item: High Breath Mantle +-- Enchantment: HP +38 Eminity +5 +-- Durration: 30 Mins Charges: 50 +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,15487); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 38); + target:addMod(MOD_ENMITY, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 38); + target:delMod(MOD_ENMITY, 5); +end; \ No newline at end of file Index: scripts/globals/items/high_mana_wand.lua =================================================================== --- scripts/globals/items/high_mana_wand.lua (revision 0) +++ scripts/globals/items/high_mana_wand.lua (working copy) @@ -0,0 +1,42 @@ +----------------------------------------- +-- ID: 18403 +-- Item: High Mana Wand +-- Enchantment: MP Recovered while Healing +4 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,18403); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MPHEAL, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MPHEAL, 4); +end; \ No newline at end of file Index: scripts/globals/items/hikogami_yukata.lua =================================================================== --- scripts/globals/items/hikogami_yukata.lua (revision 0) +++ scripts/globals/items/hikogami_yukata.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 11861 +-- Hikogami Yukata +-- When used, you will obtain 1 Super Scoop +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(17003,1); +end; \ No newline at end of file Index: scripts/globals/items/himegami_yukata.lua =================================================================== --- scripts/globals/items/himegami_yukata.lua (revision 0) +++ scripts/globals/items/himegami_yukata.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 11862 +-- Himegami Yukata +-- When used, you will obtain 1 Super Scoop +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(17003,1); +end; \ No newline at end of file Index: scripts/globals/items/homam_gambieras.lua =================================================================== --- scripts/globals/items/homam_gambieras.lua (revision 0) +++ scripts/globals/items/homam_gambieras.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15661 +-- Item: Homam Gambieras +-- Item Effect: Wyvern HP +50 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 15661) then + pet:addMod(MOD_HP, 50); + else + pet:delMod(MOD_HP, 50); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/homing_ring.lua =================================================================== --- scripts/globals/items/homing_ring.lua (revision 0) +++ scripts/globals/items/homing_ring.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 15541 +-- Item: Homing Ring +-- Enchantment: "Teleport" (Outpost) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + homingRing(target); +end; \ No newline at end of file Index: scripts/globals/items/hydra_doublet.lua =================================================================== --- scripts/globals/items/hydra_doublet.lua (revision 3304) +++ scripts/globals/items/hydra_doublet.lua (working copy) @@ -1,30 +1,27 @@ ------------------------------------------ --- ID: 15170 --- Item: Stoneskin torque --- Item Effect: gives refresh ------------------------------------------ - -require("scripts/globals/settings"); - ------------------------------------------ --- OnItemCheck ------------------------------------------ - -function onItemCheck(target) - return 0; -end; - ------------------------------------------ --- OnItemUse ------------------------------------------ - -function onItemUse(target) - - if(target:hasStatusEffect(EFFECT_REFRESH)) then - target:messageBasic(423); - else - -- delete old - target:delStatusEffect(EFFECT_REFRESH); - target:addStatusEffect(EFFECT_REFRESH, 4, 3, 180); - end +----------------------------------------- +-- ID: 14515 +-- Item: Hydra Doublet +-- Enchantment: Adds Auto Refresh +-- Duration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 1800; + target:delStatusEffect(EFFECT_AUTO_REFRESH); + target:addStatusEffect(EFFECT_AUTO_REFRESH,4,1,duration); end; \ No newline at end of file Index: scripts/globals/items/hydra_harness.lua =================================================================== --- scripts/globals/items/hydra_harness.lua (revision 0) +++ scripts/globals/items/hydra_harness.lua (working copy) @@ -0,0 +1,46 @@ +----------------------------------------- +-- ID: 14516 +-- Item: Hydra Harness +-- Enchantment: Attack +25 Ranged Attack +25 +-- Durration: 3 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,180,14516); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ATT, 25); + target:addMod(MOD_RATT, 25); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ATT, 25); + target:delMod(MOD_RATT, 25); +end; + Index: scripts/globals/items/hydra_haubert.lua =================================================================== --- scripts/globals/items/hydra_haubert.lua (revision 3304) +++ scripts/globals/items/hydra_haubert.lua (working copy) @@ -1,30 +1,27 @@ ------------------------------------------ --- ID: 15170 --- Item: Stoneskin torque --- Item Effect: gives refresh ------------------------------------------ - -require("scripts/globals/settings"); - ------------------------------------------ --- OnItemCheck ------------------------------------------ - -function onItemCheck(target) - return 0; -end; - ------------------------------------------ --- OnItemUse ------------------------------------------ - -function onItemUse(target) - - if(target:hasStatusEffect(EFFECT_REFRESH)) then - target:messageBasic(423); - else - -- delete old - target:delStatusEffect(EFFECT_REFRESH); - target:addStatusEffect(EFFECT_REFRESH, 3, 3, 180); - end +----------------------------------------- +-- ID: 14517 +-- Item: Hydra Haubert +-- Enchantment: Adds Auto Refresh +-- Duration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 1800; + target:delStatusEffect(EFFECT_AUTO_REFRESH); + target:addStatusEffect(EFFECT_AUTO_REFRESH,3,1,duration); end; \ No newline at end of file Index: scripts/globals/items/hydra_mitts.lua =================================================================== --- scripts/globals/items/hydra_mitts.lua (revision 0) +++ scripts/globals/items/hydra_mitts.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 14925 +-- Item: Hydra Mitts +-- Enchantment: Accuracy +15 Ranged Accuracy +15 +-- Durration: 5 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,300,14925); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_RACC, 15); + target:addMod(MOD_ACC, 15); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_RACC, 15); + target:delMod(MOD_ACC, 15); +end; \ No newline at end of file Index: scripts/globals/items/hydra_tights.lua =================================================================== --- scripts/globals/items/hydra_tights.lua (revision 0) +++ scripts/globals/items/hydra_tights.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15596 +-- Item: Hydra Tights +-- Enchantment: Haste +-- Duration: 3 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_HASTE, 102, 0, 180)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; \ No newline at end of file Index: scripts/globals/items/ice_card_case.lua =================================================================== --- scripts/globals/items/ice_card_case.lua (revision 0) +++ scripts/globals/items/ice_card_case.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5403 +-- Item: Ice Card Case +-- Effect: When used, you will obtain one stack of Ice Cards +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(2177,99); +end; \ No newline at end of file Index: scripts/globals/items/icefish.lua =================================================================== --- scripts/globals/items/icefish.lua (revision 3304) +++ scripts/globals/items/icefish.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/idis_ledelsens.lua =================================================================== --- scripts/globals/items/idis_ledelsens.lua (revision 0) +++ scripts/globals/items/idis_ledelsens.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 28219 +-- Item: Idi's Ledelsend +-- Effect: Wyvern Evasion +2 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 28219) then + pet:addMod(MOD_EVA, 2); + else + pet:delMod(MOD_EVA, 2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/imperial_omelette.lua =================================================================== --- scripts/globals/items/imperial_omelette.lua (revision 3304) +++ scripts/globals/items/imperial_omelette.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------------- -- ID: 4331 --- Item: imperial_omelette --- Food Effect: 240Min, All Races +-- Item: Imperial Omelette +-- Food Effect: 240 Mins, All Races ----------------------------------------- -- Non Elvaan Stats -- Strength 5 @@ -12,6 +12,7 @@ -- Attack Cap 70 -- Ranged ATT % 22 -- Ranged ATT Cap 70 +----------------------------------------- -- Elvaan Stats -- Strength 6 -- Health 20 @@ -23,7 +24,6 @@ -- Attack Cap 85 -- Ranged ATT % 22 -- Ranged ATT Cap 85 - ----------------------------------------- require("scripts/globals/status"); @@ -98,7 +98,7 @@ target:delMod(MOD_DEX, 2); target:delMod(MOD_INT, -2); target:delMod(MOD_MND, 5); - target:delMod(MOD_CHR, 4); + target:delMod(MOD_CHR, 4); target:delMod(MOD_FOOD_ATTP, 22); target:delMod(MOD_FOOD_ATT_CAP, 85); target:delMod(MOD_FOOD_RATTP, 22); Index: scripts/globals/items/invisible_mantle.lua =================================================================== --- scripts/globals/items/invisible_mantle.lua (revision 3304) +++ scripts/globals/items/invisible_mantle.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------------- --- ID: 15170 --- Item: Stoneskin torque --- Item Effect: gives invisible +-- ID: 13685 +-- Item: Invisible Mantle +-- Item Effect: Invisible +-- Duration: 3 Mins Charges: 20 ----------------------------------------- require("scripts/globals/settings"); @@ -20,11 +21,13 @@ function onItemUse(target) - if(target:hasStatusEffect(EFFECT_INVISIBLE)) then - target:messageBasic(423); - else - -- delete old - target:delStatusEffect(EFFECT_INVISIBLE); - target:addStatusEffect(EFFECT_INVISIBLE, 0, 10, 180* SNEAK_INVIS_DURATION_MULTIPLIER); - end + if(target:hasStatusEffect(EFFECT_INVISIBLE)) then + target:messageBasic(423); + else + local duration = 180; + duration = duration + (duration * target:getMod(MOD_INVIS_DUR)); + if (not target:hasStatusEffect(EFFECT_INVISIBLE)) then + target:addStatusEffect(EFFECT_INVISIBLE,0,10,duration); + end + end end; \ No newline at end of file Index: scripts/globals/items/irmik_helvasi.lua =================================================================== --- scripts/globals/items/irmik_helvasi.lua (revision 0) +++ scripts/globals/items/irmik_helvasi.lua (working copy) @@ -0,0 +1,59 @@ +----------------------------------------- +-- ID: 5572 +-- Item: Irmik Helvasi +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% Cap 70 +-- MP +3% Cap 13 +-- Intelligence +1 +-- MP Recovered while healing +7 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5572); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_FOOD_HP_CAP, 70); + target:addMod(MOD_FOOD_MPP, 3); + target:addMod(MOD_FOOD_MP_CAP, 13); + target:addMod(MOD_INT, 1); + target:addMod(MOD_MPHEAL, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_FOOD_HP_CAP, 70); + target:delMod(MOD_FOOD_MPP, 3); + target:delMod(MOD_FOOD_MP_CAP, 13); + target:delMod(MOD_INT, 1); + target:delMod(MOD_MPHEAL, 1); +end; Index: scripts/globals/items/irmik_helvasi_+1.lua =================================================================== --- scripts/globals/items/irmik_helvasi_+1.lua (revision 0) +++ scripts/globals/items/irmik_helvasi_+1.lua (working copy) @@ -0,0 +1,59 @@ +----------------------------------------- +-- ID: 5573 +-- Item: Irmik Helvasi +1 +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% Cap 80 +-- MP +3% Cap 15 +-- Intelligence +1 +-- MP Recovered while healing +7 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5573); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_FOOD_HP_CAP, 80); + target:addMod(MOD_FOOD_MPP, 3); + target:addMod(MOD_FOOD_MP_CAP, 15); + target:addMod(MOD_INT, 1); + target:addMod(MOD_MPHEAL, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_FOOD_HP_CAP, 80); + target:delMod(MOD_FOOD_MPP, 3); + target:delMod(MOD_FOOD_MP_CAP, 15); + target:delMod(MOD_INT, 1); + target:delMod(MOD_MPHEAL, 1); +end; Index: scripts/globals/items/iron_musketeers_quiver.lua =================================================================== --- scripts/globals/items/iron_musketeers_quiver.lua (revision 0) +++ scripts/globals/items/iron_musketeers_quiver.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15957 +-- Iron Musketeer Quiver +-- When used, you will obtain 1 Iron Musketeer's Bolt +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(18739,1); +end; \ No newline at end of file Index: scripts/globals/items/istakoz.lua =================================================================== --- scripts/globals/items/istakoz.lua (revision 0) +++ scripts/globals/items/istakoz.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 5453 +-- Item: Istakoz +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity -5 +-- Vitality 3 +-- Defense +15.4% +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5453); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, -5); + target:addMod(MOD_VIT, 3); + target:addMod(MOD_DEFP, 16); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, -5); + target:delMod(MOD_VIT, 3); + target:delMod(MOD_DEFP, 16); +end; Index: scripts/globals/items/istiridye.lua =================================================================== --- scripts/globals/items/istiridye.lua (revision 0) +++ scripts/globals/items/istiridye.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 5456 +-- Item: Istiridye +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity -5 +-- Vitality 4 +-- Defense +17.07% +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5456); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, -5); + target:addMod(MOD_VIT, 4); + target:addMod(MOD_DEFP, 17.07); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, -5); + target:delMod(MOD_VIT, 4); + target:delMod(MOD_DEFP, 17.07); +end; Index: scripts/globals/items/jacknife.lua =================================================================== --- scripts/globals/items/jacknife.lua (revision 0) +++ scripts/globals/items/jacknife.lua (working copy) @@ -0,0 +1,59 @@ +----------------------------------------- +-- ID: 5123 +-- Item: Jacknife +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity -5 +-- Vitality 4 +-- Defence 16% Cap 50 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5123); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, -5); + target:addMod(MOD_VIT, 4); + target:addMod(MOD_FOOD_DEFP, 16); + target:addMod(MOD_FOOD_DEF_CAP, 50); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, -5); + target:delMod(MOD_VIT, 4); + target:delMod(MOD_FOOD_DEFP, 16); + target:delMod(MOD_FOOD_DEF_CAP, 50); +end; Index: scripts/globals/items/janizary_earring.lua =================================================================== --- scripts/globals/items/janizary_earring.lua (revision 0) +++ scripts/globals/items/janizary_earring.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 14785 +-- Item: Janizary Earring +-- Enchantment: DEF 32 +-- Charges: 20 Reuse Delay: 30 Mins +-- Duration: 60 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,60,14785); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEF, 32); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEF, 32); +end; \ No newline at end of file Index: scripts/globals/items/janus_guard.lua =================================================================== --- scripts/globals/items/janus_guard.lua (revision 0) +++ scripts/globals/items/janus_guard.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10808 +-- Janus Guard +-- When used, you will obtain one Saruta Orange +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(4392,1); +end; \ No newline at end of file Index: scripts/globals/items/jar_of_marinara_sauce.lua =================================================================== --- scripts/globals/items/jar_of_marinara_sauce.lua (revision 0) +++ scripts/globals/items/jar_of_marinara_sauce.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5747 +-- Item: Jar of Marinara Sauce +-- Food Effect: 5Min, All Races +----------------------------------------- +-- Mind 2 +-- Intelligence 1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5747); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MND, 2); + target:addMod(MOD_INT, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MND, 2); + target:delMod(MOD_INT, 1); +end; Index: scripts/globals/items/jet_sickle.lua =================================================================== --- scripts/globals/items/jet_sickle.lua (revision 0) +++ scripts/globals/items/jet_sickle.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 18945 +-- Item: Jet Sickle +-- Item Effect: TP +10 +-- Durration: Instant +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addTP(10); +end; Index: scripts/globals/items/jolt_axe.lua =================================================================== --- scripts/globals/items/jolt_axe.lua (revision 0) +++ scripts/globals/items/jolt_axe.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 17954 +-- Item: Jolt Axe +-- Enchantment: Attack +3 +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,17954); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ATT, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ATT, 3); +end; + Index: scripts/globals/items/jug_of_selbina_milk.lua =================================================================== --- scripts/globals/items/jug_of_selbina_milk.lua (revision 3304) +++ scripts/globals/items/jug_of_selbina_milk.lua (working copy) @@ -19,8 +19,13 @@ ----------------------------------------- function onItemUse(target) + local body = caster:getEquipID(SLOT_BODY); if(target:hasStatusEffect(EFFECT_REGEN) == false) then - target:addStatusEffect(EFFECT_REGEN,1,3,180); + if (body == 14520) then -- Dream Robe +1 + target:addStatusEffect(EFFECT_REGEN,1,3,120); + else + target:addStatusEffect(EFFECT_REGEN,1,3,150); + end else target:messageBasic(423); end Index: scripts/globals/items/juglan_jumble.lua =================================================================== --- scripts/globals/items/juglan_jumble.lua (revision 0) +++ scripts/globals/items/juglan_jumble.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5923 +-- Item: Juglan Jumble +-- Food Effect: 5 Mins, All Races +----------------------------------------- +-- Bird Killer 12 +-- MP Recovered While Healing 4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5923); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_BIRD_KILLER, 12); + target:addMod(MOD_MPHEAL, 8); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_BIRD_KILLER, 12); + target:delMod(MOD_MPHEAL, 8); +end; Index: scripts/globals/items/kalamar.lua =================================================================== --- scripts/globals/items/kalamar.lua (revision 0) +++ scripts/globals/items/kalamar.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5448 +-- Item: Kalamar +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 3 +-- Mind -5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5448); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 3); + target:addMod(MOD_MND, -5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 3); + target:delMod(MOD_MND, -5); +end; Index: scripts/globals/items/kaplumbaga.lua =================================================================== --- scripts/globals/items/kaplumbaga.lua (revision 0) +++ scripts/globals/items/kaplumbaga.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5464 +-- Item: Kaplumbaga +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 3 +-- Mind -5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5464); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 3); + target:addMod(MOD_MND, -5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 3); + target:delMod(MOD_MND, -5); +end; Index: scripts/globals/items/karagoz_mantle.lua =================================================================== --- scripts/globals/items/karagoz_mantle.lua (revision 0) +++ scripts/globals/items/karagoz_mantle.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11571 +-- Item: Karagoz Mantle +-- Item Effect: Automation: Accuracy +12 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_BACK) == 11571) then + pet:addMod(MOD_ACC, 12); + else + pet:delMod(MOD_ACC, 12); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/kawahori_kabuto.lua =================================================================== --- scripts/globals/items/kawahori_kabuto.lua (revision 0) +++ scripts/globals/items/kawahori_kabuto.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------------- +-- ID: 16071 +-- Item: Kawahori Kabuto +-- Enchantment: Blindness +-- Durration: 3 Mins +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_BLINDNESS) == false) then + target:addStatusEffect(EFFECT_BLINDNESS,25,0,180); + else + target:messageBasic(423); + end +end; Index: scripts/globals/items/kayabaligi.lua =================================================================== --- scripts/globals/items/kayabaligi.lua (revision 0) +++ scripts/globals/items/kayabaligi.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5460 +-- Item: Kayabaligi +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 4 +-- Mind -6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5460); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 4); + target:addMod(MOD_MND, -6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 4); + target:delMod(MOD_MND, -6); +end; Index: scripts/globals/items/kazham_earring.lua =================================================================== --- scripts/globals/items/kazham_earring.lua (revision 0) +++ scripts/globals/items/kazham_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16046 +-- Item: Kazham Earring +-- Enchantment: "Teleport" (Kazham) +----------------------------------------- + +require("scripts/globals/teleports") +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(250) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + kazhamEarring(target); +end; \ No newline at end of file Index: scripts/globals/items/kers_sollerets.lua =================================================================== --- scripts/globals/items/kers_sollerets.lua (revision 0) +++ scripts/globals/items/kers_sollerets.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 28213 +-- Item: Ker's Sollerets +-- Item Effect: Wyvern ATK +13 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 28213) then + pet:addMod(MOD_ATT, 13); + else + pet:delMod(MOD_ATT, 13); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/key_ring_belt.lua =================================================================== --- scripts/globals/items/key_ring_belt.lua (revision 0) +++ scripts/globals/items/key_ring_belt.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15880 +-- Key Ring Belt +-- When used, you will obtain 1 Skeleton Key +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(1115,1); +end; \ No newline at end of file Index: scripts/globals/items/kingdom_earring.lua =================================================================== --- scripts/globals/items/kingdom_earring.lua (revision 0) +++ scripts/globals/items/kingdom_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16039 +-- Item: Kingdom Earring +-- Enchantment: "Teleport" (Southern San d'Oria) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(230) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + kingdomEarring(target); +end; \ No newline at end of file Index: scripts/globals/items/kingdom_signet_staff.lua =================================================================== --- scripts/globals/items/kingdom_signet_staff.lua (revision 0) +++ scripts/globals/items/kingdom_signet_staff.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 17583 +-- Item: Kingdom Signet Staff +-- Item Effect: Grants target Signet +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:getNation() ~= 0) then + result = 56; + end + if (target:checkSoloPartyAlliance() == 0) then + result = 56; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:delStatusEffect(EFFECT_SIGNET); + target:addStatusEffect(EFFECT_SIGNET,0,0,18000,0,0); +end; + + Index: scripts/globals/items/kingdom_stables_collar.lua =================================================================== --- scripts/globals/items/kingdom_stables_collar.lua (revision 0) +++ scripts/globals/items/kingdom_stables_collar.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 13179 +-- Item: Kingdom Stables Collar +-- Enchantment: "Teleport" (San d'Oria Chocobo Stables) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(230) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + kingdomStablesScarf(target); +end; \ No newline at end of file Index: scripts/globals/items/kinkobo.lua =================================================================== --- scripts/globals/items/kinkobo.lua (revision 0) +++ scripts/globals/items/kinkobo.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 17592 +-- Item: Kinkobo +-- Enchantment: Subtle Blow +-- Duration: 60 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,3600,17592); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_SUBTLE_BLOW, 20); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_SUBTLE_BLOW, 20); +end; \ No newline at end of file Index: scripts/globals/items/kitron.lua =================================================================== --- scripts/globals/items/kitron.lua (revision 0) +++ scripts/globals/items/kitron.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 4273 +-- Item: Kitron +-- Food Effect: 5Min, All Races +----------------------------------------- +-- Agility -6 +-- Intelligence 4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,4273); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_AGI, -6); + target:addMod(MOD_INT, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_AGI, -6); + target:delMod(MOD_INT, 4); +end; Index: scripts/globals/items/knuckles_of_trials.lua =================================================================== --- scripts/globals/items/knuckles_of_trials.lua (revision 0) +++ scripts/globals/items/knuckles_of_trials.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 17507 +-- Equip: Knuckles of Trials +-- Latent effect is active while less then 300 weapon skills have been preformed on EP+ Mobs using this weapon. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target,prevsjob) + + mainEquip = target:getEquipID(SLOT_MAIN); + + if (mainEquip == 17507) then + if (target:getVar("WSNMHits") < 300) then + target:addMod(MOD_HP, 20); + target:addMod(MOD_EARTHDEF, 10); + target:addMod(MOD_WATERDEF, 10); + else + target:delMod(MOD_HP, 20); + target:delMod(MOD_EARTHDEF, 10); + target:delMod(MOD_WATERDEF, 10); + end + end + +end; \ No newline at end of file Index: scripts/globals/items/koccos_earring.lua =================================================================== --- scripts/globals/items/koccos_earring.lua (revision 0) +++ scripts/globals/items/koccos_earring.lua (working copy) @@ -0,0 +1,22 @@ +----------------------------------------- +-- ID: 15998 +-- Kocco's Earring +-- This earring functions in the same way as the spell Reraise II. +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 3600; + target:delStatusEffect(EFFECT_RERAISE); + target:addStatusEffect(EFFECT_RERAISE,2,0,duration); +end; Index: scripts/globals/items/kodachi_of_trials.lua =================================================================== --- scripts/globals/items/kodachi_of_trials.lua (revision 0) +++ scripts/globals/items/kodachi_of_trials.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 17773 +-- Equip: Kodachi of Trials +-- Latent effect is active while less then 300 weapon skills have been preformed on EP+ Mobs using this weapon. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target,prevsjob) + + mainEquip = target:getEquipID(SLOT_MAIN); + + if (mainEquip == 17773) then + if (target:getVar("WSNMHits") < 300) then + target:addMod(MOD_HP, 20); + target:addMod(MOD_FIREDEF, 10); + target:addMod(MOD_LIGHTDEF, 10); + else + target:delMod(MOD_HP, 20); + target:delMod(MOD_FIREDEF, 10); + target:delMod(MOD_LIGHTDEF, 10); + end + end + +end; \ No newline at end of file Index: scripts/globals/items/koen.lua =================================================================== --- scripts/globals/items/koen.lua (revision 0) +++ scripts/globals/items/koen.lua (working copy) @@ -0,0 +1,22 @@ +----------------------------------------- +-- ID: 6430 +-- Item: Koen +-- Enchantment: "Enfire" +-- Charges: 30 Reuse: 300 Secs +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENFIRE; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/kohlrouladen.lua =================================================================== --- scripts/globals/items/kohlrouladen.lua (revision 3304) +++ scripts/globals/items/kohlrouladen.lua (working copy) @@ -1,11 +1,14 @@ ----------------------------------------- -- ID: 5760 --- Item: kohlrouladen --- Food Effect: 1hour?, All Races +-- Item: Kohlrouladen +-- Food Effect: 2 Hours, All Races ----------------------------------------- -- Strength 3 -- Agility 3 -- Intelligence -5 +-- Ranged Accuracy 10% Cap 65 +-- Ranged Attack 8% Cap 60 +-- Enmity -4 ----------------------------------------- require("scripts/globals/status"); @@ -27,7 +30,7 @@ ----------------------------------------- function onItemUse(target) - target:addStatusEffect(EFFECT_FOOD,0,0,3600,5760); + target:addStatusEffect(EFFECT_FOOD,0,0,7200,5760); end; ----------------------------------------- @@ -38,6 +41,11 @@ target:addMod(MOD_STR, 3); target:addMod(MOD_AGI, 3); target:addMod(MOD_INT, -5); + target:addMod(MOD_FOOD_RACCP, 14); + target:addMod(MOD_FOOD_RACC_CAP, 65); + target:addMod(MOD_FOOD_RATTP, 8); + target:addMod(MOD_FOOD_RATT_CAP, 60); + target:addMod(MOD_ENMITY, -4); end; ----------------------------------------- @@ -48,4 +56,9 @@ target:delMod(MOD_STR, 3); target:delMod(MOD_AGI, 3); target:delMod(MOD_INT, -5); + target:delMod(MOD_FOOD_RACCP, 14); + target:delMod(MOD_FOOD_RACC_CAP, 65); + target:delMod(MOD_FOOD_RATTP, 8); + target:delMod(MOD_FOOD_RATT_CAP, 60); + target:delMod(MOD_ENMITY, -4); end; Index: scripts/globals/items/kohlrouladen_+1.lua =================================================================== --- scripts/globals/items/kohlrouladen_+1.lua (revision 0) +++ scripts/globals/items/kohlrouladen_+1.lua (working copy) @@ -0,0 +1,64 @@ +----------------------------------------- +-- ID: 5761 +-- Item: Kohlrouladen +1 +-- Food Effect: 2 Hours, All Races +----------------------------------------- +-- Strength 4 +-- Agility 4 +-- Intelligence -4 +-- Ranged Accuracy 10% Cap 70 +-- Ranged Attack 8% Cap 65 +-- Enmity -4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,3600,5761); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 4); + target:addMod(MOD_AGI, 4); + target:addMod(MOD_INT, -4); + target:addMod(MOD_FOOD_RACCP, 15); + target:addMod(MOD_FOOD_RACC_CAP, 70); + target:addMod(MOD_FOOD_RATTP, 10); + target:addMod(MOD_FOOD_RATT_CAP, 65); + target:addMod(MOD_ENMITY, -4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 4); + target:delMod(MOD_AGI, 4); + target:delMod(MOD_INT, -4); + target:delMod(MOD_FOOD_RACCP, 15); + target:delMod(MOD_FOOD_RACC_CAP, 70); + target:delMod(MOD_FOOD_RATTP, 10); + target:delMod(MOD_FOOD_RATT_CAP, 65); + target:delMod(MOD_ENMITY, -4); +end; Index: scripts/globals/items/kupofrieds_ring.lua =================================================================== --- scripts/globals/items/kupofrieds_ring.lua (revision 0) +++ scripts/globals/items/kupofrieds_ring.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 15840 +-- Item: Kupofrieds Ring +-- Experience point bonus +----------------------------------------- +-- Bonus: +100% +-- Duration: 1440 min +-- Max bonus: 6000 exp +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_DEDICATION) == true) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_DEDICATION,100,0,86400); + target:addMod(MOD_DEDICATION_CAP, 6000); +end; \ No newline at end of file Index: scripts/globals/items/lamiabane.lua =================================================================== --- scripts/globals/items/lamiabane.lua (revision 0) +++ scripts/globals/items/lamiabane.lua (working copy) @@ -0,0 +1,42 @@ +----------------------------------------- +-- ID: 18693 +-- Equip: Lamiabane +-- Latent effect: Enhances Magic Atk Bonus +2 +-- Enchantment: Adds "Refresh" +-- Durration: 60 Mins +-- Active while in Mamook, Arrapago Reef, or Halvung +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + +zone = target:getZone(); + +ranged = target:getEquipID(SLOT_RANGED); + + if (ranged == 18693) then + if (zone == 65 or zone == 54 or zone == 62) then + target:addMod(MOD_MATT, 2); + elseif (zone ~= 65 or zone ~= 54 or zone ~= 62) then + target:delMod(MOD_MATT, 2); + end + elseif (ranged ~= 18693 and zone == 65 or zone == 54 or zone == 62) then + target:delMod(MOD_MATT, 2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 3600; + target:delStatusEffect(EFFECT_REFRESH); + target:addStatusEffect(EFFECT_REFRESH,3,1,duration); +end; \ No newline at end of file Index: scripts/globals/items/lancers_earring.lua =================================================================== --- scripts/globals/items/lancers_earring.lua (revision 0) +++ scripts/globals/items/lancers_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11716 +-- Item: Lancer's Earring +-- Item Effect: Pet HP +20 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_EAR1) == 11716 or target:getEquipID(SLOT_EAR2) == 11716) then + pet:addMod(MOD_HP, 20); + else + pet:addMod(MOD_HP, 20); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/lancers_pelerine.lua =================================================================== --- scripts/globals/items/lancers_pelerine.lua (revision 0) +++ scripts/globals/items/lancers_pelerine.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16208 +-- Item: Lancer's Pelerine +-- Item Effect: Pet HP +30 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_BACK) == 16208) then + pet:addMod(MOD_HP,30); + else + pet:delMod(MOD_HP,30); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/laurel_crown.lua =================================================================== --- scripts/globals/items/laurel_crown.lua (revision 0) +++ scripts/globals/items/laurel_crown.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15213 +-- Item: Laurel Crown +-- Enchantment: "Teleport" (Ru'Lude Gardens) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck // TODO Check Ballista Points +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(243) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse // TODO Remove 1 Ballista Point +----------------------------------------- + +function onItemUse(target) + laurelCrown(target); +end; \ No newline at end of file Index: scripts/globals/items/lebkuchen_house.lua =================================================================== --- scripts/globals/items/lebkuchen_house.lua (revision 0) +++ scripts/globals/items/lebkuchen_house.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 5616 +-- Item: Lebkuchen House +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- MP 10% Cap 45 +-- Intelligence 3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5616); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_MPP, 10); + target:addMod(MOD_FOOD_MP_CAP, 45); + target:addMod(MOD_INT, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_MPP, 10); + target:delMod(MOD_FOOD_MP_CAP, 45); + target:delMod(MOD_INT, 3); +end; Index: scripts/globals/items/lebkuchen_manse.lua =================================================================== --- scripts/globals/items/lebkuchen_manse.lua (revision 0) +++ scripts/globals/items/lebkuchen_manse.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 5617 +-- Item: Lebkuchen Manse +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- MP 10% Cap 55 +-- Intelligence 4 +-- HP Recovered while healing 3 +-- MP Recovered while healing 2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5617); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_MPP, 10); + target:addMod(MOD_FOOD_MP_CAP, 55); + target:addMod(MOD_INT, 4); + target:addMod(MOD_HPHEAL, 3); + target:addMod(MOD_MPHEAL, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_MPP, 10); + target:delMod(MOD_FOOD_MP_CAP, 55); + target:delMod(MOD_INT, 4); + target:delMod(MOD_HPHEAL, 3); + target:delMod(MOD_MPHEAL, 2); +end; Index: scripts/globals/items/leech_belt.lua =================================================================== --- scripts/globals/items/leech_belt.lua (revision 0) +++ scripts/globals/items/leech_belt.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 10850 +-- Leech Belt +-- Enchantment: 60Min, Costume - Leech 1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,276,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/lieutenants_cape.lua =================================================================== --- scripts/globals/items/lieutenants_cape.lua (revision 3304) +++ scripts/globals/items/lieutenants_cape.lua (working copy) @@ -1,25 +1,54 @@ ------------------------------------------ --- ID: 14493 --- Item: Healing Vest --- Item Effect: Restores 50% hp and 25% mp ------------------------------------------ - -require("scripts/globals/settings"); - ------------------------------------------ --- OnItemCheck ------------------------------------------ - -function onItemCheck(target) - return 0; -end; - ------------------------------------------ --- OnItemUse ------------------------------------------ - -function onItemUse(target) - target:addHP((target:getMaxHP()/100)*50); - target:addMP((target:getMaxMP()/100)*25); - target:messageBasic(26); +----------------------------------------- +-- ID: 16230 +-- Item: Lieutenants Cape +-- Enchantment: Restore 50% HP & 25% MP +-- Max Charges: 100 Use Delay: 30 secs +-- Casting Time: 8 secs Reuse Delay: 30 mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + mHP = target:getMaxHP(); + cHP = target:getHP(); + mMP = target:getMaxMP(); + cMP = target:getMP(); + + if (mHP == cHP and mMP == cMP) then + result = 56; -- Does not let player use item if their hp and mp are full + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,14957); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addHP((target:getMaxHP()/100)*50); + target:addMP((target:getMaxMP()/100)*25); + target:messageBasic(26); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) end; \ No newline at end of file Index: scripts/globals/items/lieutenants_sash.lua =================================================================== --- scripts/globals/items/lieutenants_sash.lua (revision 0) +++ scripts/globals/items/lieutenants_sash.lua (working copy) @@ -0,0 +1,32 @@ +----------------------------------------- +-- ID: 15912 +-- Item: Lieutenant's Sash +-- Enchantment: Remove Food Effects +-- Max Charges: 100 Use Delay: 12 secs +-- Casting Time: 15 secs Reuse Delay: 30 mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) ~= true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_FOOD) == true) then + target:delStatusEffect(EFFECT_FOOD); + end +end; Index: scripts/globals/items/light_card_case.lua =================================================================== --- scripts/globals/items/light_card_case.lua (revision 0) +++ scripts/globals/items/light_card_case.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5408 +-- Item: Light Card Case +-- Effect: When used, you will obtain one stack of Light Cards +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(2182,99); +end; \ No newline at end of file Index: scripts/globals/items/lion_tamer.lua =================================================================== --- scripts/globals/items/lion_tamer.lua (revision 0) +++ scripts/globals/items/lion_tamer.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- ID: 17961 +-- Item: Lion Tamer +-- Effect: Pet DEF +10 +-- Enchantment: "Enfire" +-- Charges: 50 Reuse: 300 Secs +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_MAIN) == 17961 or target:getEquipID(SLOT_SUB) == 17961) then + pet:addMod(MOD_DEF, 10); + else + pet:delMod(MOD_DEF, 10); + end + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENFIRE; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/lionhead.lua =================================================================== --- scripts/globals/items/lionhead.lua (revision 3304) +++ scripts/globals/items/lionhead.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/little_worm_belt.lua =================================================================== --- scripts/globals/items/little_worm_belt.lua (revision 0) +++ scripts/globals/items/little_worm_belt.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15454 +-- Little Worm Belt +-- When used, you will obtain 1 Little Worm +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(17396,1); +end; \ No newline at end of file Index: scripts/globals/items/lucent_axe.lua =================================================================== --- scripts/globals/items/lucent_axe.lua (revision 0) +++ scripts/globals/items/lucent_axe.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 18481 +-- Item: Lucent Axe +-- Enchantment: Delay 442 +-- Charges: 50 Duration: 30 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,18481); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DELAY, -51); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DELAY, -51); +end; \ No newline at end of file Index: scripts/globals/items/lucent_lance.lua =================================================================== --- scripts/globals/items/lucent_lance.lua (revision 0) +++ scripts/globals/items/lucent_lance.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 18108 +-- Item: Lucent Lance +-- Enchantment: Delay 442 +-- Charges: 50 Duration: 30 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,18108); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DELAY, -50); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DELAY, -50); +end; \ No newline at end of file Index: scripts/globals/items/lucent_scythe.lua =================================================================== --- scripts/globals/items/lucent_scythe.lua (revision 0) +++ scripts/globals/items/lucent_scythe.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 18062 +-- Item: Lucent Scythe +-- Enchantment: Delay 475 +-- Charges: 50 Duration: 30 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,18062); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DELAY, -53); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DELAY, -53); +end; \ No newline at end of file Index: scripts/globals/items/lucent_sword.lua =================================================================== --- scripts/globals/items/lucent_sword.lua (revision 0) +++ scripts/globals/items/lucent_sword.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 18384 +-- Item: Lucent Sword +-- Enchantment: Delay 410 +-- Charges: 50 Duration: 30 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,18384); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DELAY, -46); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DELAY, -46); +end; \ No newline at end of file Index: scripts/globals/items/lucid_elixir_i.lua =================================================================== --- scripts/globals/items/lucid_elixir_i.lua (revision 0) +++ scripts/globals/items/lucid_elixir_i.lua (working copy) @@ -0,0 +1,37 @@ +----------------------------------------- +-- ID: 5830 +-- Item: Lucid Elixir I +-- Item Effect: Instantly restores 25% of HP and MP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; +mHP = target:getMaxHP(); +cHP = target:getHP(); +mMP = target:getMaxMP(); +cMP = target:getMP(); + + +if (mHP == cHP and mMP == cMP) then + result = 56; -- Does not let player use item if their hp and mp are full +end + +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addHP((target:getMaxHP()/100)*25); + target:addMP((target:getMaxMP()/100)*25); + target:messageBasic(26); +end; \ No newline at end of file Index: scripts/globals/items/lucid_elixir_ii.lua =================================================================== --- scripts/globals/items/lucid_elixir_ii.lua (revision 0) +++ scripts/globals/items/lucid_elixir_ii.lua (working copy) @@ -0,0 +1,37 @@ +----------------------------------------- +-- ID: 5831 +-- Item: Lucid Elixir II +-- Item Effect: Instantly restores 50% of HP and MP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; +mHP = target:getMaxHP(); +cHP = target:getHP(); +mMP = target:getMaxMP(); +cMP = target:getMP(); + + +if (mHP == cHP and mMP == cMP) then + result = 56; -- Does not let player use item if their hp and mp are full +end + +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addHP((target:getMaxHP()/100)*5); + target:addMP((target:getMaxMP()/100)*5); + target:messageBasic(26); +end; \ No newline at end of file Index: scripts/globals/items/lucid_ether_i.lua =================================================================== --- scripts/globals/items/lucid_ether_i.lua (revision 0) +++ scripts/globals/items/lucid_ether_i.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 5827 +-- Item: Lucid Ether I +-- Item Effect: Restores 250 MP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + value = 0; + mMP = target:getMaxMP(); + cMP = target:getMP(); + + if (mMP == cMP) then + value = 56; -- Does not let player use item if their hp is full + end + + return value; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addMP(250*ITEM_POWER); + target:messageBasic(25,0,250); +end; Index: scripts/globals/items/lucid_ether_ii.lua =================================================================== --- scripts/globals/items/lucid_ether_ii.lua (revision 0) +++ scripts/globals/items/lucid_ether_ii.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 5828 +-- Item: Lucid Ether II +-- Item Effect: Restores 500 MP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + value = 0; + mMP = target:getMaxMP(); + cMP = target:getMP(); + + if (mMP == cMP) then + value = 56; -- Does not let player use item if their hp is full + end + + return value; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addMP(500*ITEM_POWER); + target:messageBasic(25,0,500); +end; Index: scripts/globals/items/lucid_ether_iii.lua =================================================================== --- scripts/globals/items/lucid_ether_iii.lua (revision 0) +++ scripts/globals/items/lucid_ether_iii.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 5829 +-- Item: Lucid Ether III +-- Item Effect: Restores 750 MP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + value = 0; + mMP = target:getMaxMP(); + cMP = target:getMP(); + + if (mMP == cMP) then + value = 56; -- Does not let player use item if their hp is full + end + + return value; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addMP(750*ITEM_POWER); + target:messageBasic(25,0,750); +end; Index: scripts/globals/items/lucid_potion_i.lua =================================================================== --- scripts/globals/items/lucid_potion_i.lua (revision 0) +++ scripts/globals/items/lucid_potion_i.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 5824 +-- Item: Lucid Potion I +-- Item Effect: Restores 500 HP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +value = 0; +mHP = target:getMaxHP(); +cHP = target:getHP(); + +if (mHP == cHP) then + value = 56; -- Does not let player use item if their hp is full +end + +return value; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addHP(500*ITEM_POWER); + target:messageBasic(24,0,500); +end; \ No newline at end of file Index: scripts/globals/items/lucid_potion_ii.lua =================================================================== --- scripts/globals/items/lucid_potion_ii.lua (revision 0) +++ scripts/globals/items/lucid_potion_ii.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 5825 +-- Item: Lucid Potion II +-- Item Effect: Restores 1000 HP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +value = 0; +mHP = target:getMaxHP(); +cHP = target:getHP(); + +if (mHP == cHP) then + value = 56; -- Does not let player use item if their hp is full +end + +return value; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addHP(1000*ITEM_POWER); + target:messageBasic(24,0,1000); +end; \ No newline at end of file Index: scripts/globals/items/lucid_potion_iii.lua =================================================================== --- scripts/globals/items/lucid_potion_iii.lua (revision 0) +++ scripts/globals/items/lucid_potion_iii.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 5826 +-- Item: Lucid Potion III +-- Item Effect: Restores 1500 HP +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +value = 0; +mHP = target:getMaxHP(); +cHP = target:getHP(); + +if (mHP == cHP) then + value = 56; -- Does not let player use item if their hp is full +end + +return value; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addHP(1500*ITEM_POWER); + target:messageBasic(24,0,1500); +end; \ No newline at end of file Index: scripts/globals/items/lugworm_belt.lua =================================================================== --- scripts/globals/items/lugworm_belt.lua (revision 0) +++ scripts/globals/items/lugworm_belt.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15453 +-- Lugworm Belt +-- When used, you will obtain 1 Lugworm +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(17395,1); +end; \ No newline at end of file Index: scripts/globals/items/lunar_cap.lua =================================================================== --- scripts/globals/items/lunar_cap.lua (revision 0) +++ scripts/globals/items/lunar_cap.lua (working copy) @@ -0,0 +1,27 @@ +----------------------------------------- +-- ID: 16145 +-- Item: Lunar Cap +-- Enchantment: Adds Regen +-- Duration: 60 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck -- TODO check for party member with Sol Cap +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 3600; + target:delStatusEffect(EFFECT_REGEN; + target:addStatusEffect(EFFECT_REGEN,1,1,duration); +end; \ No newline at end of file Index: scripts/globals/items/lungfish.lua =================================================================== --- scripts/globals/items/lungfish.lua (revision 0) +++ scripts/globals/items/lungfish.lua (working copy) @@ -0,0 +1,53 @@ +----------------------------------------- +-- ID: 4315 +-- Item: Lungfish +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity -2 +-- Mind 4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,4315); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, -2); + target:addMod(MOD_MND, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, -2); + target:delMod(MOD_MND, 4); +end; Index: scripts/globals/items/m&p_cracker.lua =================================================================== --- scripts/globals/items/m&p_cracker.lua (revision 0) +++ scripts/globals/items/m&p_cracker.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5640 +-- Item: M&P Cracker +-- Food Effect: 3Min, All Races +----------------------------------------- +-- Vitality 5 +-- Mind -5 +-- Defense % 25 +-- Attack Cap 154 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,180,5640); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_VIT, 5); + target:addMod(MOD_MND, -5); + target:addMod(MOD_FOOD_DEFP, 25); + target:addMod(MOD_FOOD_DEF_CAP, 154); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_VIT, 5); + target:delMod(MOD_MND, -5); + target:delMod(MOD_FOOD_DEFP, 25); + target:delMod(MOD_FOOD_DEF_CAP, 154); +end; Index: scripts/globals/items/m&p_doner_kabob.lua =================================================================== --- scripts/globals/items/m&p_doner_kabob.lua (revision 0) +++ scripts/globals/items/m&p_doner_kabob.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5717 +-- Item: M&P Doner Kabob +-- Food Effect: 5Min, All Races +----------------------------------------- +-- HP 5% +-- MP 5% +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5717); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HPP, 5); + target:addMod(MOD_MPP, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HPP, 5); + target:delMod(MOD_MPP, 5); +end; Index: scripts/globals/items/m&p_dumpling.lua =================================================================== --- scripts/globals/items/m&p_dumpling.lua (revision 0) +++ scripts/globals/items/m&p_dumpling.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 5641 +-- Item: M&P Dumpling +-- Food Effect: 3Min, All Races +----------------------------------------- +-- Intelligence 5 +-- Agility -5 +-- MP 30 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,180,5641); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MP, 30); + target:addMod(MOD_INT, 5); + target:addMod(MOD_AGI, -5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MP, 30); + target:delMod(MOD_INT, 5); + target:delMod(MOD_AGI, -5); +end; Index: scripts/globals/items/maats_cap.lua =================================================================== --- scripts/globals/items/maats_cap.lua (revision 0) +++ scripts/globals/items/maats_cap.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15194 +-- Item: Maat's Cap +-- Enchantment: "Teleport" (Ru'Lude Gardens) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(243) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + maatsCap(target); +end; \ No newline at end of file Index: scripts/globals/items/maestros_baton.lua =================================================================== --- scripts/globals/items/maestros_baton.lua (revision 0) +++ scripts/globals/items/maestros_baton.lua (working copy) @@ -0,0 +1,24 @@ +----------------------------------------- +-- ID: 18880 +-- Maestro's Baton +-- Enchantment: 60Min, Costume - Hecteyes +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,738,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/magnus_stone_pouch.lua =================================================================== --- scripts/globals/items/magnus_stone_pouch.lua (revision 0) +++ scripts/globals/items/magnus_stone_pouch.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 5443 +-- Item: Magnus Stone Pouch +-- Effect: When used, you will obtain one stack of Magnus stones +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(19262,99); +end; + Index: scripts/globals/items/maharajas_belt.lua =================================================================== --- scripts/globals/items/maharajas_belt.lua (revision 0) +++ scripts/globals/items/maharajas_belt.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 15870 +-- Item: Maharaja's Belt +-- Enchantment: AGI +10 +-- Durration: 1 Min +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,60,15870); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_AGI, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_AGI, 3); +end; Index: scripts/globals/items/mamoolbane.lua =================================================================== --- scripts/globals/items/mamoolbane.lua (revision 0) +++ scripts/globals/items/mamoolbane.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 18692 +-- Item: Mamoolbane +-- Enchantment: Evasion +10 +-- Duration: 60 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + target:getZone(); + result = 0; + if(zone ~= 54 or zone ~= 62 or zone ~= 65) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,3600,18692); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_EVA, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_EVA, 10); +end; \ No newline at end of file Index: scripts/globals/items/mana_wand.lua =================================================================== --- scripts/globals/items/mana_wand.lua (revision 0) +++ scripts/globals/items/mana_wand.lua (working copy) @@ -0,0 +1,42 @@ +----------------------------------------- +-- ID: 18402 +-- Item: Mana Wand +-- Enchantment: MP Recovered while Healing +2 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,18402); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MPHEAL, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MPHEAL, 2); +end; \ No newline at end of file Index: scripts/globals/items/maple_cake.lua =================================================================== --- scripts/globals/items/maple_cake.lua (revision 0) +++ scripts/globals/items/maple_cake.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5625 +-- Item: Maple Cake +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP Recoverd while healing 1 +-- MP Recovered while healing 4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5625); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HPHEAL, 1); + target:addMod(MOD_MPHEAL, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HPHEAL, 1); + target:delMod(MOD_MPHEAL, 4); +end; Index: scripts/globals/items/marduks_crackows_+1.lua =================================================================== --- scripts/globals/items/marduks_crackows_+1.lua (revision 0) +++ scripts/globals/items/marduks_crackows_+1.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 28211 +-- Item: Marduk's Crackows +1 +-- Item Effect: Avatar ATK +3 Haste +2% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 28211) then + pet:addMod(MOD_ATT, 2); + pet:addMod(MOD_HASTE_GEAR, 20); + else + pet:delMod(MOD_ATT, 2); + pet:delMod(MOD_HASTE_GEAR, 20); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/marine_gilet_+1.lua =================================================================== --- scripts/globals/items/marine_gilet_+1.lua (revision 0) +++ scripts/globals/items/marine_gilet_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10264 +-- Marine Gilet +1 +-- When used, you will obtain 1 Berry Snowcone +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5710,1); +end; \ No newline at end of file Index: scripts/globals/items/marine_top_+1.lua =================================================================== --- scripts/globals/items/marine_top_+1.lua (revision 0) +++ scripts/globals/items/marine_top_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10265 +-- Marine Top +1 +-- When used, you will obtain 1 Berry Snowcone +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5710,1); +end; \ No newline at end of file Index: scripts/globals/items/meatloaf.lua =================================================================== --- scripts/globals/items/meatloaf.lua (revision 0) +++ scripts/globals/items/meatloaf.lua (working copy) @@ -0,0 +1,56 @@ +----------------------------------------- +-- ID: 5689 +-- Item: Meatloaf +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- Strength 6 +-- Agility 2 +-- Intelligence -3 +-- Attack 20% Cap 75 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD)) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5689); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 6); + target:addMod(MOD_AGI, 2); + target:addMod(MOD_INT, -3); + target:addMod(MOD_FOOD_ATTP, 20); + target:addMod(MOD_FOOD_ATT_CAP, 75); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 6); + target:delMod(MOD_AGI, 2); + target:delMod(MOD_INT, -3); + target:delMod(MOD_FOOD_ATTP, 20); + target:delMod(MOD_FOOD_ATT_CAP, 75); +end; Index: scripts/globals/items/meatloaf_+1.lua =================================================================== --- scripts/globals/items/meatloaf_+1.lua (revision 0) +++ scripts/globals/items/meatloaf_+1.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 5690 +-- Item: Meatloaf +1 +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Needs verification +-- Strength 6 +-- Agility 2 +-- Intelligence -2 +-- Attack 25% Cap 85 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD)) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5690); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 6); + target:addMod(MOD_AGI, 2); + target:addMod(MOD_INT, -2); + target:addMod(MOD_FOOD_ATTP, 25); + target:addMod(MOD_FOOD_ATT_CAP, 85); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 6); + target:delMod(MOD_AGI, 2); + target:delMod(MOD_INT, -2); + target:delMod(MOD_FOOD_ATTP, 25); + target:delMod(MOD_FOOD_ATT_CAP, 85); +end; Index: scripts/globals/items/megalixir.lua =================================================================== --- scripts/globals/items/megalixir.lua (revision 3304) +++ scripts/globals/items/megalixir.lua (working copy) @@ -1,10 +1,11 @@ ----------------------------------------- -- ID: 4145 --- Item: Elixir +-- Item: Mega Elixir -- Item Effect: Instantly restores 100% of HP and MP ----------------------------------------- require("scripts/globals/settings"); +require("scripts/globals/status"); ----------------------------------------- -- OnItemCheck Index: scripts/globals/items/megrim_crown.lua =================================================================== --- scripts/globals/items/megrim_crown.lua (revision 0) +++ scripts/globals/items/megrim_crown.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 16077 +-- Item: Megrim Crown +-- Enchantment: ??? Random +-- Durration: 15 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + var = math.random(1,8); + DEFmod = math.random(5,15) + ATKmod = math.random(5,15) + ACCmod = math.random(5,15) + if (var == 1) then + if (target:hasStatusEffect(EFFECT_DEFENSE_BOOST) == false) then + target:addStatusEffect(EFFECT_DEFEFENSE_BOOST,DEFmod,0,900); + end + elseif (var == 2) then + if (target:hasStatusEffect(EFFECT_ATTACK_BOOST) == false) then + target:addStatusEffect(EFFECT_ATTACK_BOOST,ATKmod,0,900); + end + elseif (var == 3) then + if (target:hasStatusEffect(EFFECT_ACCURACY_BOOST) == false) then + target:addStatusEffect(EFFECT_ACCURACY_BOOST,ACCmod,0,900); + end + elseif (var == 4) then + if (target:hasStatusEffect(EFFECT_BLINK) == false) then + target:addStatusEffect(EFFECT_BLINK,4,1,900); + end + elseif (var == 5) then + if (target:hasStatusEffect(EFFECT_REGEN) == false) then + target:addStatusEffect(EFFECT_REGEN,3,1,900); + end + elseif (var == 6) then + if(target:hasStatusEffect(EFFECT_REFRESH) == false) then + target:addStatusEffect(EFFECT_REFRESH,5,1,900); + end + elseif (var == 7) then + if(target:hasStatusEffect(EFFECT_BLAZE_SPIKES) == false) then + target:addStatusEffect(EFFECT_BLAZE_SPIKES,4,3,900); + end + end; +end; Index: scripts/globals/items/melomane_mallet.lua =================================================================== --- scripts/globals/items/melomane_mallet.lua (revision 0) +++ scripts/globals/items/melomane_mallet.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 18881 +-- Melomane Mallet +-- Enchantment: Costume - Lycopodium +-- Durration: 60 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,2247,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/melt_baselard.lua =================================================================== --- scripts/globals/items/melt_baselard.lua (revision 0) +++ scripts/globals/items/melt_baselard.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- ID: 18012 +-- Item: Melt Baselard +-- Item Effect: Defense Down 20% on Target +-- Charges: 15 Duration: 90 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,20,0,90); + else + target:messageBasic(423); + end +end; + Index: scripts/globals/items/melt_claws.lua =================================================================== --- scripts/globals/items/melt_claws.lua (revision 0) +++ scripts/globals/items/melt_claws.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- ID: 18357 +-- Item: Melt Claws +-- Item Effect: Defense Down 20% on Target +-- Charges: 15 Duration: 90 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,20,0,90); + else + target:messageBasic(423); + end +end; + Index: scripts/globals/items/melt_dagger.lua =================================================================== --- scripts/globals/items/melt_dagger.lua (revision 0) +++ scripts/globals/items/melt_dagger.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- ID: 18010 +-- Item: Melt Daggers +-- Item Effect: Defense Down 20% on Target +-- Charges: 15 Duration: 90 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,20,0,90); + else + target:messageBasic(423); + end +end; + Index: scripts/globals/items/melt_katana.lua =================================================================== --- scripts/globals/items/melt_katana.lua (revision 0) +++ scripts/globals/items/melt_katana.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- ID: 18410 +-- Item: Melt Katana +-- Item Effect: Defense Down 20% on Target +-- Charges: 15 Duration: 90 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,20,0,90); + else + target:messageBasic(423); + end +end; + Index: scripts/globals/items/melt_knife.lua =================================================================== --- scripts/globals/items/melt_knife.lua (revision 0) +++ scripts/globals/items/melt_knife.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- ID: 18011 +-- Item: Melt Knife +-- Item Effect: Defense Down 20% on Target +-- Charges: 15 Duration: 90 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,20,0,90); + else + target:messageBasic(423); + end +end; + Index: scripts/globals/items/melt_kukri.lua =================================================================== --- scripts/globals/items/melt_kukri.lua (revision 0) +++ scripts/globals/items/melt_kukri.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- ID: 18013 +-- Item: Melt Kukri +-- Item Effect: Defense Down 20% on Target +-- Charges: 15 Duration: 90 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,20,0,90); + else + target:messageBasic(423); + end +end; + Index: scripts/globals/items/mercanbaligi.lua =================================================================== --- scripts/globals/items/mercanbaligi.lua (revision 0) +++ scripts/globals/items/mercanbaligi.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5454 +-- Item: Mercanbaligi +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 4 +-- Mind -6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5454); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 4); + target:addMod(MOD_MND, -6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 4); + target:delMod(MOD_MND, -6); +end; Index: scripts/globals/items/messhikimaru.lua =================================================================== --- scripts/globals/items/messhikimaru.lua (revision 0) +++ scripts/globals/items/messhikimaru.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 17826 +-- Item: Messhikimaru +-- Enchantment: Arcana Killer +-- Durration: 10 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,600,17826); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ARCANA_KILLER, 20); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ARCANA_KILLER, 20); +end; + Index: scripts/globals/items/mhaura_earring.lua =================================================================== --- scripts/globals/items/mhaura_earring.lua (revision 0) +++ scripts/globals/items/mhaura_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16044 +-- Item: Mhaura Earring +-- Enchantment: "Teleport" (Mhaura) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(249) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + mhauraEarring(target); +end; \ No newline at end of file Index: scripts/globals/items/midwinter_dream.lua =================================================================== --- scripts/globals/items/midwinter_dream.lua (revision 0) +++ scripts/globals/items/midwinter_dream.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 5543 +-- Item: Midwinter Dream +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP 10 +-- MP 9% Cap 60 +-- Intelligence 2 +-- MP Recovered while healing 2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5543); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 10); + target:addMod(MOD_INT, 2); + target:addMod(MOD_FOOD_MPP, 9); + target:addMod(MOD_FOOD_MP_CAP, 60); + target:addMod(MOD_MPHEAL, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 10); + target:delMod(MOD_INT, 2); + target:delMod(MOD_FOOD_MPP, 9); + target:delMod(MOD_FOOD_MP_CAP, 60); + target:delMod(MOD_MPHEAL, 2); +end; Index: scripts/globals/items/mighty_ring.lua =================================================================== --- scripts/globals/items/mighty_ring.lua (revision 0) +++ scripts/globals/items/mighty_ring.lua (working copy) @@ -0,0 +1,46 @@ +----------------------------------------- +-- ID: 15558 +-- Item: Mighty Ring +-- Enchantment: Attack +5 Ranged Attack +5 +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,15558); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ATT, 5); + target:addMod(MOD_RATT, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ATT, 5); + target:delMod(MOD_RATT, 5); +end; + Index: scripts/globals/items/mihgo_mithkabob.lua =================================================================== --- scripts/globals/items/mihgo_mithkabob.lua (revision 0) +++ scripts/globals/items/mihgo_mithkabob.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 5708 +-- Item: Mihgo Mithkabob +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- Dexterity 5 +-- Vitality 2 +-- Mind -2 +-- Defense % 25 +-- Defense Cap 65 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5708); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 5); + target:addMod(MOD_VIT, 2); + target:addMod(MOD_MND, -2); + target:addMod(MOD_FOOD_DEFP, 25); + target:addMod(MOD_FOOD_DEF_CAP, 60); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 5); + target:delMod(MOD_VIT, 2); + target:delMod(MOD_MND, -2); + target:delMod(MOD_FOOD_DEFP, 25); + target:delMod(MOD_FOOD_DEF_CAP, 60); +end; Index: scripts/globals/items/miracle_wand.lua =================================================================== --- scripts/globals/items/miracle_wand.lua (revision 0) +++ scripts/globals/items/miracle_wand.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 18844 +-- Item: Miracle Wand +-- Item Effect: Party Member gets Regen +-- Durration: 120 Secs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (!target:getSoloPartyAlliance() ~= 1) + result = 56; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_REGEN) == false) then + target:addStatusEffect(EFFECT_REGEN,12,3,120); + else + target:messageBasic(423); + end +end; Index: scripts/globals/items/miracle_wand_+1.lua =================================================================== --- scripts/globals/items/miracle_wand_+1.lua (revision 0) +++ scripts/globals/items/miracle_wand_+1.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 18845 +-- Item: Miracle Wand +1 +-- Item Effect: Party Member gets Regen +-- Durration: 180 Secs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (!target:getSoloPartyAlliance() ~= 1) + result = 56; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_REGEN) == false) then + target:addStatusEffect(EFFECT_REGEN,12,3,180); + else + target:messageBasic(423); + end +end; Index: scripts/globals/items/mithran_rice_cake.lua =================================================================== --- scripts/globals/items/mithran_rice_cake.lua (revision 0) +++ scripts/globals/items/mithran_rice_cake.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 5297 +-- Mithran Rice Cake +-- Enchantment: 60Min, Costume - Mithra Child +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,182,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/moat_carp.lua =================================================================== --- scripts/globals/items/moat_carp.lua (revision 3304) +++ scripts/globals/items/moat_carp.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/moepapa_stone.lua =================================================================== --- scripts/globals/items/moepapa_stone.lua (revision 0) +++ scripts/globals/items/moepapa_stone.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------------- +-- ID: 10817 +-- Item: Moepapa Stone +-- Item Effect: Pet gets Haste 5% +----------------------------------------- + +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_WAIST) == 10817) then + pet:addStatusEffectEx(EFFECT_HASTE,0,51,0,10817); + else + pet:delStatusEffect(EFFECT_HASTE,10817); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/mog_missile.lua =================================================================== --- scripts/globals/items/mog_missile.lua (revision 0) +++ scripts/globals/items/mog_missile.lua (working copy) @@ -0,0 +1,20 @@ +----------------------------------------- +-- ID: 5936 +-- Item: Mog Missle +-- Effect: Moogle Firework +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; \ No newline at end of file Index: scripts/globals/items/mogratuity.lua =================================================================== --- scripts/globals/items/mogratuity.lua (revision 0) +++ scripts/globals/items/mogratuity.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 19776 +-- Item: Moggratuity +-- Effect: Festive funds furnished by merry moogles +-- Charges: 10 +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addGil(math.random(2000,10000); +end; \ No newline at end of file Index: scripts/globals/items/moogiebag.lua =================================================================== --- scripts/globals/items/moogiebag.lua (revision 0) +++ scripts/globals/items/moogiebag.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 19246 +-- Item: Moggiebag +-- Effect: Moogles Secret Cache +-- Charges: 8 +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addGil(math.random(2000,10000); +end; \ No newline at end of file Index: scripts/globals/items/moogle_cap.lua =================================================================== --- scripts/globals/items/moogle_cap.lua (revision 0) +++ scripts/globals/items/moogle_cap.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 16118 +-- Item: Moogle Cap +-- Enchantment: "Teleport" (Nation) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + nomadCap(target); +end; \ No newline at end of file Index: scripts/globals/items/moogle_pie.lua =================================================================== --- scripts/globals/items/moogle_pie.lua (revision 0) +++ scripts/globals/items/moogle_pie.lua (working copy) @@ -0,0 +1,69 @@ +----------------------------------------- +-- ID: 5561 +-- Item: Moogle Pie +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- HP 20 +-- MP 20 +-- Strength 1 +-- Dexterity 1 +-- Vitality 1 +-- Agility 1 +-- Intelligence 1 +-- Mind 1 +-- Charisma 1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5561); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 20); + target:addMod(MOD_MP, 20); + target:addMod(MOD_STR,1); + target:addMod(MOD_DEX, 1); + target:addMod(MOD_VIT,1); + target:addMod(MOD_AGI,1); + target:addMod(MOD_INT, 1); + target:addMod(MOD_MND,1); + target:addMod(MOD_CHR, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 20); + target:delMod(MOD_MP, 20); + target:delMod(MOD_STR,1); + target:delMod(MOD_DEX, 1); + target:delMod(MOD_VIT,1); + target:delMod(MOD_AGI,1); + target:delMod(MOD_INT, 1); + target:delMod(MOD_MND,1); + target:delMod(MOD_CHR, 1); +end; Index: scripts/globals/items/moogle_rod.lua =================================================================== --- scripts/globals/items/moogle_rod.lua (revision 0) +++ scripts/globals/items/moogle_rod.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------------- +-- ID: 18401 +-- Item: Moogle Rod +-- When used, your target will obtain one Moogle Pie. +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5561,1); +end; \ No newline at end of file Index: scripts/globals/items/moogle_suit.lua =================================================================== --- scripts/globals/items/moogle_suit.lua (revision 0) +++ scripts/globals/items/moogle_suit.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------------- +-- ID: 10250 +-- Item: Moogle Suit +-- When used, you will obtain one Mog Missle. +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5936,1); +end; \ No newline at end of file Index: scripts/globals/items/moogles_largess.lua =================================================================== --- scripts/globals/items/moogles_largess.lua (revision 0) +++ scripts/globals/items/moogles_largess.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 19181 +-- Item: Moogle's Largess +-- Effect: Moogle's generous gift +-- Charges: 9 +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addGil(math.random(2000,10000); +end; \ No newline at end of file Index: scripts/globals/items/moogles_largesse.lua =================================================================== --- scripts/globals/items/moogles_largesse.lua (revision 0) +++ scripts/globals/items/moogles_largesse.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 19181 +-- Item: Moogles Largesse +-- When used, you will obtain random 100 - 10,000 Gil. +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addGil(math.random(100,10000)); +end; \ No newline at end of file Index: scripts/globals/items/moorish_idol.lua =================================================================== --- scripts/globals/items/moorish_idol.lua (revision 0) +++ scripts/globals/items/moorish_idol.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5121 +-- Item: Moorish Idol +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 2 +-- Mind -4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5121); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 2); + target:addMod(MOD_MND, -4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 2); + target:delMod(MOD_MND, -4); +end; Index: scripts/globals/items/murzim_zucchetto.lua =================================================================== --- scripts/globals/items/murzim_zucchetto.lua (revision 0) +++ scripts/globals/items/murzim_zucchetto.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 10440 +-- Item: Murzim Zucchetto +-- Item Effect: Automation: Haste +6% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HEAD) == 10440) then + pet:addMod(MOD_HASTE_GEAR, 61); + else + pet:delMod(MOD_HASTE_GEAR, 61); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/mushroom_salad.lua =================================================================== --- scripts/globals/items/mushroom_salad.lua (revision 0) +++ scripts/globals/items/mushroom_salad.lua (working copy) @@ -0,0 +1,59 @@ +----------------------------------------- +-- ID: 5678 +-- Item: Mushroom Salad +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- MP 14% Cap 85 +-- Agility 6 +-- Mind 6 +-- Strength -5 +-- Vitality -5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD)) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5678); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_MPP, 14); + target:addMod(MOD_FOOD_MP_CAP, 85); + target:addMod(MOD_AGI, 6); + target:addMod(MOD_MND, 6); + target:addMod(MOD_STR, -5); + target:addMod(MOD_VIT, -5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_MPP, 14); + target:delMod(MOD_FOOD_MP_CAP, 85); + target:delMod(MOD_AGI, 6); + target:delMod(MOD_MND, 6); + target:delMod(MOD_STR, -5); + target:delMod(MOD_VIT, -5); +end; Index: scripts/globals/items/muzzling_collar.lua =================================================================== --- scripts/globals/items/muzzling_collar.lua (revision 0) +++ scripts/globals/items/muzzling_collar.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 10914 +-- Item: Muzzling Collar +-- Item Effect: Pet Enmity -2 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_NECK) == 10914) then + pet:addMod(MOD_ENMITY, -2); + else + pet:delMod(MOD_ENMITY, -2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/muzzling_collar_+1.lua =================================================================== --- scripts/globals/items/muzzling_collar_+1.lua (revision 0) +++ scripts/globals/items/muzzling_collar_+1.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 10915 +-- Item: Muzzling Collar +1 +-- Item Effect: Pet Enmity -3 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_NECK) == 10915) then + pet:addMod(MOD_ENMITY, -3); + else + pet:delMod(MOD_ENMITY, -3); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/nanger_ring.lua =================================================================== --- scripts/globals/items/nanger_ring.lua (revision 0) +++ scripts/globals/items/nanger_ring.lua (working copy) @@ -0,0 +1,42 @@ +----------------------------------------- +-- ID: 10778 +-- Item: Nanger Ring +-- Enchantment: Evasion +10 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,300,10778); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_EVA, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_EVA, 10); +end; \ No newline at end of file Index: scripts/globals/items/nashmau_earring.lua =================================================================== --- scripts/globals/items/nashmau_earring.lua (revision 0) +++ scripts/globals/items/nashmau_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16050 +-- Item: Nashmau Earring +-- Enchantment: "Teleport" (Nashmau) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(53) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + nashmauEarring(target); +end; \ No newline at end of file Index: scripts/globals/items/naval_rice_ball.lua =================================================================== --- scripts/globals/items/naval_rice_ball.lua (revision 0) +++ scripts/globals/items/naval_rice_ball.lua (working copy) @@ -0,0 +1,79 @@ +----------------------------------------- +-- ID: 4605 +-- Item: Naval Rice Ball +-- Food Effect: 30 Mins, All Races +----------------------------------------- +-- HP 26 +-- Dexterity 3 +-- Vitality 3 +-- HP Regeneration While Healing +2 +-- Effect with enhancing equipment +-- DEF +40 +-- ATK +40 +-- Arcana Killer +5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,4605); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + pEquipMods = 0; + local hands = target:getEquipID(SLOT_HANDS); + local head = target:getEquipID(SLOT_HEAD); + local feet = target:getEquipID(SLOT_FEET); + target:addMod(MOD_HP, 26); + target:addMod(MOD_DEX, 3); + target:addMod(MOD_VIT, 3); + target:addMod(MOD_HPHEAL, 2); + + -- Equipment Bonus + if (head == 13949 or head == 13910) then -- Roshi Jinpachi & +1 + pEquipMods = pEquipMods + 1; + end + if (hands == 14901 or hands == 13972) then -- Myochin Kote & +1 + pEquipMods = pEquipMods + 1; + end + if (feet == 11367) then -- Nobushi Kyahan + pEquipMods = pEquipMods + 1; + end + target:addMod(MOD_DEF, (pEquipMods * 40)); + target:addMod(MOD_ATT, (pEquipMods * 40)); + target:addMod(MOD_ARCANA_KILLER, (pEquipMods * 5)); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 26); + target:delMod(MOD_DEX, 3); + target:delMod(MOD_VIT, 3); + target:delMod(MOD_HPHEAL, 2); + target:delMod(MOD_DEF, (pEquipMods * 40)); + target:delMod(MOD_ATT, (pEquipMods * 40)); + target:delMod(MOD_ARCANA_KILLER, (pEquipMods * 5)); +end; Index: scripts/globals/items/nebimonite.lua =================================================================== --- scripts/globals/items/nebimonite.lua (revision 3304) +++ scripts/globals/items/nebimonite.lua (working copy) @@ -18,7 +18,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/nebimonite_belt.lua =================================================================== --- scripts/globals/items/nebimonite_belt.lua (revision 0) +++ scripts/globals/items/nebimonite_belt.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15300 +-- Nebimonite Belt +-- When used, you will obtain 1 Lugworm +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(4361,1); +end; \ No newline at end of file Index: scripts/globals/items/new_years_gift.lua =================================================================== --- scripts/globals/items/new_years_gift.lua (revision 0) +++ scripts/globals/items/new_years_gift.lua (working copy) @@ -0,0 +1,42 @@ +----------------------------------------- +-- ID: 4176 +-- Item: New Years Gift +-- Enchantment: ??? Random +-- Durration: 10 Mins - 2 Hrs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local var = math.random(1,4); + if (var == 1) then + if (target:hasStatusEffect(EFFECT_RERAISE) == false) then + target:addStatusEffect(EFFECT_RERAISE,1,0,3600); + end + elseif (var == 2) then + if (target:hasStatusEffect(EFFECT_ENBLIZZARD) == false) then + target:addStatusEffect(EFFECT_ENBLIZZARD,35,0,600); + end + elseif (var == 3) then + if (target:hasStatusEffect(EFFECT_ICE_SPIKES) == false) then + target:addStatusEffect(EFFECT_ICE_SPIKES,35,0,600); + end + elseif (var == 4) then + if (target:hasStatusEffect(EFFECT_BLINK) == false) then + target:addStatusEffect(EFFECT_FISHING_IMAGERY,0,0,7200); + end + end; +end; Index: scripts/globals/items/nexus_cape.lua =================================================================== --- scripts/globals/items/nexus_cape.lua (revision 0) +++ scripts/globals/items/nexus_cape.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 11538 +-- Item: Nexus Cape +-- Enchantment: "Teleport" (Party Leader) +----------------------------------------- + +require("scripts/globals/teleports"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +-- leader = CParty::GetLeader(); +-- pc = GetPlayerByName(leader) +-- if(pc~=nil) then +-- zone = pc:getZone(); +-- targetX = pc:getXPos(); +-- targetY = pc:getYPos(); +-- targetZ = pc:getZPos(); +-- target:setPos(targetX,targetY,targetZ,0,zone); +-- else +-- printf("Player named %s not found!",target); +-- end +end; \ No newline at end of file Index: scripts/globals/items/ngen_seraweels.lua =================================================================== --- scripts/globals/items/ngen_seraweels.lua (revision 0) +++ scripts/globals/items/ngen_seraweels.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11987 +-- Item: Ngen Seraweels +-- Item Effect: Avatar Regen +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_NECK) == 11987) then + pet:addMod(MOD_REGEN, 3); + else + pet:delMod(MOD_REGEN, 3); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/noble_himantes.lua =================================================================== --- scripts/globals/items/noble_himantes.lua (revision 0) +++ scripts/globals/items/noble_himantes.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 18755 +-- Item: Noble Himantes +-- Item Effect: TP +10 +-- Durration: Instant +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addTP(10); +end; Index: scripts/globals/items/noble_lady.lua =================================================================== --- scripts/globals/items/noble_lady.lua (revision 3304) +++ scripts/globals/items/noble_lady.lua (working copy) @@ -18,7 +18,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/nomad_cap.lua =================================================================== --- scripts/globals/items/nomad_cap.lua (revision 0) +++ scripts/globals/items/nomad_cap.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 16119 +-- Item: Nomad Cap +-- Enchantment: "Teleport" (Nation) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + nomadCap(target); +end; \ No newline at end of file Index: scripts/globals/items/nomad_moogle_rod.lua =================================================================== --- scripts/globals/items/nomad_moogle_rod.lua (revision 0) +++ scripts/globals/items/nomad_moogle_rod.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------------- +-- ID: 18842 +-- Item: Nomad Moogle Rod +-- When used, your target will obtain one Moggle Pie. +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5561,1); +end; \ No newline at end of file Index: scripts/globals/items/nomad_moogle_shield.lua =================================================================== --- scripts/globals/items/nomad_moogle_shield.lua (revision 3304) +++ scripts/globals/items/nomad_moogle_shield.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------------- -- ID: 16183 -- Nomad Moogle Shield --- Enchantment: 60Min, Costume - Moogle +-- Enchantment: 60Min, Enhancement - Moogle Jaspery ----------------------------------------- require("scripts/globals/status"); Index: scripts/globals/items/nopales_salad_+1.lua =================================================================== --- scripts/globals/items/nopales_salad_+1.lua (revision 0) +++ scripts/globals/items/nopales_salad_+1.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5702 +-- Item: Nopales Salad +1 +-- Food Effect: 3Hrs, All Races +----------------------------------------- +-- Strength 2 +-- Agility 7 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5702); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 2); + target:addMod(MOD_AGI, 7); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 2); + target:delMod(MOD_AGI, 7); +end; Index: scripts/globals/items/norg_earring.lua =================================================================== --- scripts/globals/items/norg_earring.lua (revision 0) +++ scripts/globals/items/norg_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16047 +-- Item: Norg Earring +-- Enchantment: "Teleport" (Norg) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(252) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + norgEarring(target); +end; \ No newline at end of file Index: scripts/globals/items/northern_san_doria_gate_glyph.lua =================================================================== --- scripts/globals/items/northern_san_doria_gate_glyph.lua (revision 0) +++ scripts/globals/items/northern_san_doria_gate_glyph.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 4192 +-- Item: North San d'Oria Gate Glyph +-- Enchantment: "Teleport" (North San d'Oria) +----------------------------------------- + +require("scripts/globals/teleports"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + sandoriaNorthGlyph(target); +end; \ No newline at end of file Index: scripts/globals/items/nosteau_herring.lua =================================================================== --- scripts/globals/items/nosteau_herring.lua (revision 3304) +++ scripts/globals/items/nosteau_herring.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/ogre_eel.lua =================================================================== --- scripts/globals/items/ogre_eel.lua (revision 3304) +++ scripts/globals/items/ogre_eel.lua (working copy) @@ -18,7 +18,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/olduum_ring.lua =================================================================== --- scripts/globals/items/olduum_ring.lua (revision 3304) +++ scripts/globals/items/olduum_ring.lua (working copy) @@ -4,6 +4,8 @@ -- Teleports to Wajoam Woodlands Leypoint ----------------------------------------- +require("scripts/globals/teleports"); +require("scripts/globals/settings"); require("scripts/globals/status"); ----------------------------------------- @@ -11,12 +13,16 @@ ----------------------------------------- function onItemCheck(target) - return 0; + result = 0; + if (target:isZoneVisited(51) == false) then + result = 56; + end + return result; end; ----------------------------------------- -- OnItemUse ----------------------------------------- function onItemUse(target) - target:setPos(-199, -10, 80, 94, 51); + olduumRing(target); end; Index: scripts/globals/items/omodaka_hizayoroi.lua =================================================================== --- scripts/globals/items/omodaka_hizayoroi.lua (revision 0) +++ scripts/globals/items/omodaka_hizayoroi.lua (working copy) @@ -0,0 +1,35 @@ +----------------------------------------- +-- ID: 28078 +-- Item: Omodaka Hizayoroi +-- Item Effect: Automation STR +6 DEX +6 AGI +6 Haste +4% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_LEGS) == 28078) then + pet:addMod(MOD_STR, 6); + pet:addMod(MOD_DEX, 6); + pet:addMod(MOD_AGI, 6); + pet:addMod(MOD_HASTE_GEAR, 61); + else + pet:delMod(MOD_STR, 6); + pet:delMod(MOD_DEX, 6); + pet:delMod(MOD_AGI, 6); + pet:delMod(MOD_HASTE_GEAR, 61); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/onago_yukata.lua =================================================================== --- scripts/globals/items/onago_yukata.lua (revision 0) +++ scripts/globals/items/onago_yukata.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 14533 +-- Onago Yukata +-- When used, you will obtain 1 Muteppo +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5360,1); +end; \ No newline at end of file Index: scripts/globals/items/oneiros_cappa.lua =================================================================== --- scripts/globals/items/oneiros_cappa.lua (revision 0) +++ scripts/globals/items/oneiros_cappa.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 10972 +-- Item: Oneiros Cappa +-- Item Effect: Pet Physical Dmg taken -3% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_BACK) == 10972) then + pet:addMod(MOD_DMGPHYS, -3); + else + pet:delMod(MOD_DMGPHYS, -3); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/onnagimi_yukata.lua =================================================================== --- scripts/globals/items/onnagimi_yukata.lua (revision 0) +++ scripts/globals/items/onnagimi_yukata.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 14535 +-- Onnagimi Yukata +-- When used, you will obtain 1 Datechochin +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5361,1); +end; \ No newline at end of file Index: scripts/globals/items/orange_cake.lua =================================================================== --- scripts/globals/items/orange_cake.lua (revision 0) +++ scripts/globals/items/orange_cake.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5629 +-- Item: Orange Cake +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP Recovered while healing +3 +-- MP Recovered while healing +4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5629); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HPHEAL, 3); + target:addMod(MOD_MPHEAL, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HPHEAL, 3); + target:delMod(MOD_MPHEAL, 4); +end; Index: scripts/globals/items/orc_belt.lua =================================================================== --- scripts/globals/items/orc_belt.lua (revision 0) +++ scripts/globals/items/orc_belt.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 10847 +-- Orc Belt +-- Enchantment: 60Min, Costume - Orc +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,612,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/orichalcum_bullet_pouch.lua =================================================================== --- scripts/globals/items/orichalcum_bullet_pouch.lua (revision 0) +++ scripts/globals/items/orichalcum_bullet_pouch.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 5914 +-- Item: Orichalcum Bullet Pouch +-- Effect: When used, you will obtain stack of Orichalcum Bullets +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(19802,99); +end; + Index: scripts/globals/items/ostreger_mitts.lua =================================================================== --- scripts/globals/items/ostreger_mitts.lua (revision 0) +++ scripts/globals/items/ostreger_mitts.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 14872 +-- Item: Ostreger Mitts +-- Item Effect: Wyvern HP +10 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HANDS) == 14872) then + if(pet:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_HP, 10); + else + pet:delMod(MOD_HP, 10); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/otoko_yukata.lua =================================================================== --- scripts/globals/items/otoko_yukata.lua (revision 0) +++ scripts/globals/items/otoko_yukata.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 14532 +-- Otoko Yukata +-- When used, you will obtain 1 Muteppo +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5360,1); +end; \ No newline at end of file Index: scripts/globals/items/otokogimi_yukata.lua =================================================================== --- scripts/globals/items/otokogimi_yukata.lua (revision 0) +++ scripts/globals/items/otokogimi_yukata.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 14534 +-- Otokogimi Yukata +-- When used, you will obtain 1 Datechochin +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5361,1); +end; \ No newline at end of file Index: scripts/globals/items/pacifist_ring.lua =================================================================== --- scripts/globals/items/pacifist_ring.lua (revision 0) +++ scripts/globals/items/pacifist_ring.lua (working copy) @@ -0,0 +1,39 @@ +----------------------------------------- +-- ID: 14680 +-- Pacifist Ring +-- Enchantment: Enmity -12 +-- Uses: 20 Duration: 3 Mins +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,180,14680); + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ENMITY, -12); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ENMITY, -12); +end; \ No newline at end of file Index: scripts/globals/items/pair_of_lucid_wings_i.lua =================================================================== --- scripts/globals/items/pair_of_lucid_wings_i.lua (revision 0) +++ scripts/globals/items/pair_of_lucid_wings_i.lua (working copy) @@ -0,0 +1,36 @@ +----------------------------------------- +-- ID: 5834 +-- Pair of Lucid Wings I +-- Increases TP of the user by 50% +----------------------------------------- + +-- TODO: Make AoE + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + mTP = target:getMaxTP(); + cTP = target:getTP(); + if (mTP == cTP) then + result = 56; -- Does not let player use item if their TP is full + end + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); + target:addTP((cTP * .5); +end; \ No newline at end of file Index: scripts/globals/items/pair_of_nopales.lua =================================================================== --- scripts/globals/items/pair_of_nopales.lua (revision 0) +++ scripts/globals/items/pair_of_nopales.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5650 +-- Item: Pair of Nopales +-- Food Effect: 5Min, All Races +----------------------------------------- +-- Agility 2 +-- Vitality -4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5650); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_AGI, 2); + target:addMod(MOD_VIT, -4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_AGI, 2); + target:delMod(MOD_VIT, -4); +end; Index: scripts/globals/items/palmers_bangles.lua =================================================================== --- scripts/globals/items/palmers_bangles.lua (revision 0) +++ scripts/globals/items/palmers_bangles.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 14864 +-- Item: Palmer's Bangles +-- Enchantment: Gilfinder +-- Duration: 30 Mins Charges: 20 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,14864); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_GILFINDER, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_GILFINDER, 1); +end; \ No newline at end of file Index: scripts/globals/items/pantin_babouches.lua =================================================================== --- scripts/globals/items/pantin_babouches.lua (revision 0) +++ scripts/globals/items/pantin_babouches.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11388 +-- Item: Patin Babouches +-- Item Effect: Automation: MATT +5 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 11388) then + pet:addMod(MOD_MATT, 5); + else + pet:delMod(MOD_MATT, 5); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/pantin_babouches_+1.lua =================================================================== --- scripts/globals/items/pantin_babouches_+1.lua (revision 0) +++ scripts/globals/items/pantin_babouches_+1.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11389 +-- Item: Patin Babouches +1 +-- Item Effect: Automation: MATT +5 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 11389) then + pet:addMod(MOD_MATT, 5); + else + pet:delMod(MOD_MATT, 5); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/pantin_babouches_+2.lua =================================================================== --- scripts/globals/items/pantin_babouches_+2.lua (revision 0) +++ scripts/globals/items/pantin_babouches_+2.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 10747 +-- Item: Patin Babouches +2 +-- Item Effect: Automation: MACC +5 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 10747) then + pet:addMod(MOD_MACC, 5); + else + pet:delMod(MOD_MACC, 5); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/pantin_cape.lua =================================================================== --- scripts/globals/items/pantin_cape.lua (revision 0) +++ scripts/globals/items/pantin_cape.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16245 +-- Item: Pantin Cape +-- Item Effect: Automation: Attack +15 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_BACK) == 16245) then + pet:addMod(MOD_ATT, 15); + else + pet:delMod(MOD_ATT, 15); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/pantin_dastanas.lua =================================================================== --- scripts/globals/items/pantin_dastanas.lua (revision 0) +++ scripts/globals/items/pantin_dastanas.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15031 +-- Item: Pantin Dastanas +-- Item Effect: Automation Haste +3% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HANDS) == 15031) then + pet:addMod(MOD_HASTE_GEAR, 31); + else + pet:delMod(MOD_HASTE_GEAR, 31); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/pantin_dastanas_+1.lua =================================================================== --- scripts/globals/items/pantin_dastanas_+1.lua (revision 0) +++ scripts/globals/items/pantin_dastanas_+1.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15032 +-- Item: Pantin Dastanas +1 +-- Item Effect: Automation Haste +3% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HANDS) == 15032) then + pet:addMod(MOD_HASTE_GEAR, 31); + else + pet:delMod(MOD_HASTE_GEAR, 31); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/pantin_dastanas_+2.lua =================================================================== --- scripts/globals/items/pantin_dastanas_+2.lua (revision 0) +++ scripts/globals/items/pantin_dastanas_+2.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 10707 +-- Item: Pantin Dastanas +2 +-- Item Effect: Automation Haste +4% Subtle Blow +5 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HANDS) == 10707) then + pet:addMod(MOD_HASTE_GEAR, 41); + pet:addMod(MOD_SUBTLE_BLOW, 5); + else + pet:delMod(MOD_HASTE_GEAR, 41); + pet:delMod(MOD_SUBTLE_BLOW, 5); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/pantin_taj_+1.lua =================================================================== --- scripts/globals/items/pantin_taj_+1.lua (revision 0) +++ scripts/globals/items/pantin_taj_+1.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11472 +-- Item: Pantin Taj +1 +-- Item Effect: Automation: Regen +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HEAD) == 10667) then + pet:addMod(EFFECT_REGEN,2,1,0); + else + pet:delMod(EFFECT_REGEN,2,1,0); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/pantin_taj_+2.lua =================================================================== --- scripts/globals/items/pantin_taj_+2.lua (revision 0) +++ scripts/globals/items/pantin_taj_+2.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 10667 +-- Item: Pantin Taj +2 +-- Item Effect: Automation: Regen and Refresh +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HEAD) == 10667) then + pet:addMod(EFFECT_REGEN,2,1,0); + pet:addMod(EFFECT_REFRESH,2,1,0); + else + pet:delMod(EFFECT_REGEN,2,1,0); + pet:delMod(EFFECT_REFRESH,2,1,0); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/pastoral_staff.lua =================================================================== --- scripts/globals/items/pastoral_staff.lua (revision 0) +++ scripts/globals/items/pastoral_staff.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 18591 +-- Item: Pastoral Staff +-- Item Effect: TP +10 +-- Durration: Instant +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addTP(10); +end; Index: scripts/globals/items/pellet_belt.lua =================================================================== --- scripts/globals/items/pellet_belt.lua (revision 0) +++ scripts/globals/items/pellet_belt.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15288 +-- Pellet Belt +-- When used, you will obtain 1 Stack of Pellets +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(17296,12); +end; \ No newline at end of file Index: scripts/globals/items/pendragons_belt.lua =================================================================== --- scripts/globals/items/pendragons_belt.lua (revision 0) +++ scripts/globals/items/pendragons_belt.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 15869 +-- Item: Pendragons Belt +-- Enchantment: DEX 10 +-- Charges: 30 Reuse Delay: 10 Mins +-- Duration: 30 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,30,15869); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 10); +end; \ No newline at end of file Index: scripts/globals/items/phial_of_amnesia_screen.lua =================================================================== --- scripts/globals/items/phial_of_amnesia_screen.lua (revision 0) +++ scripts/globals/items/phial_of_amnesia_screen.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5878 +-- Item: Phial of Amnesia Screen +-- Item Effect: Temporarily provides immunity to Amnesia +-- Duration: 2 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,120); + if(target:addStatusEffect(EFFECT_NEGATE_AMNESIA,0,0,120)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/phial_of_doom_screen.lua =================================================================== --- scripts/globals/items/phial_of_doom_screen.lua (revision 0) +++ scripts/globals/items/phial_of_doom_screen.lua (working copy) @@ -0,0 +1,47 @@ +----------------------------------------- +-- ID: 5879 +-- Item: Phial of DooM Screen +-- Item Effect: Temporarily provides immunity to DooM +-- Duration: 2 Mins +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,120); + if(target:addStatusEffect(EFFECT_NEGATE_DOOM,0,0,120)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/phial_of_osseous_serum.lua =================================================================== --- scripts/globals/items/phial_of_osseous_serum.lua (revision 0) +++ scripts/globals/items/phial_of_osseous_serum.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 5352 +-- Phial of Osseous Serum +-- Enchantment: 60Min, Costume - Skeleton +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,564,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/phial_of_petrify_screen.lua =================================================================== --- scripts/globals/items/phial_of_petrify_screen.lua (revision 0) +++ scripts/globals/items/phial_of_petrify_screen.lua (working copy) @@ -0,0 +1,47 @@ +----------------------------------------- +-- ID: 5876 +-- Item: Phial of Petrify Screen +-- Item Effect: Temporarily provides immunity to Petrify +-- Duration: 2 Mins +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,120); + if(target:addStatusEffect(EFFECT_NEGATE_PETRIFY,0,0,120)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/phial_of_poison_screen.lua =================================================================== --- scripts/globals/items/phial_of_poison_screen.lua (revision 0) +++ scripts/globals/items/phial_of_poison_screen.lua (working copy) @@ -0,0 +1,47 @@ +----------------------------------------- +-- ID: 5880 +-- Item: Phial of Poison Screen +-- Item Effect: Temporarily provides immunity to Poison +-- Duration: 2 Mins +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,120); + if(target:addStatusEffect(EFFECT_NEGATE_POISON,0,0,120)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/phial_of_terror_screen.lua =================================================================== --- scripts/globals/items/phial_of_terror_screen.lua (revision 0) +++ scripts/globals/items/phial_of_terror_screen.lua (working copy) @@ -0,0 +1,47 @@ +----------------------------------------- +-- ID: 5877 +-- Item: Phial of Terror Screen +-- Item Effect: Temporarily provides immunity to Terror +-- Duration: 2 Mins +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,120); + if(target:addStatusEffect(EFFECT_NEGATE_TERROR,0,0,120)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/pick_of_trials.lua =================================================================== --- scripts/globals/items/pick_of_trials.lua (revision 0) +++ scripts/globals/items/pick_of_trials.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 17933 +-- Equip: Pick of Trials +-- Latent effect is active while less then 300 weapon skills have been preformed on EP+ Mobs using this weapon. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target,prevsjob) + + mainEquip = target:getEquipID(SLOT_MAIN); + + if (mainEquip == 17933) then + if (target:getVar("WSNMHits") < 300) then + target:addMod(MOD_HP, 20); + target:addMod(MOD_WINDDEF, 10); + target:addMod(MOD_THUNDERDEF, 10); + else + target:delMod(MOD_HP, 20); + target:delMod(MOD_WINDDEF, 10); + target:delMod(MOD_THUNDERDEF, 10); + end + end + +end; \ No newline at end of file Index: scripts/globals/items/piece_of_cascade_candy.lua =================================================================== --- scripts/globals/items/piece_of_cascade_candy.lua (revision 0) +++ scripts/globals/items/piece_of_cascade_candy.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5942 +-- Item: Piece of Cascade Candy +-- Food Effect: 30Min, All Races +----------------------------------------- +-- Mind +4 +-- Charisma +4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,5942); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MND, 4); + target:addMod(MOD_CHR, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MND, 4); + target:delMod(MOD_CHR, 4); +end; Index: scripts/globals/items/piece_of_elvaan_mochi.lua =================================================================== --- scripts/globals/items/piece_of_elvaan_mochi.lua (revision 0) +++ scripts/globals/items/piece_of_elvaan_mochi.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 5204 +-- Piece of Elvaan Mochi +-- Enchantment: 60Min, Costume - Elvaan Child (male) +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,154,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/piece_of_galka_mochi.lua =================================================================== --- scripts/globals/items/piece_of_galka_mochi.lua (revision 0) +++ scripts/globals/items/piece_of_galka_mochi.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 5206 +-- Piece of Galka Mochi +-- Enchantment: 60Min, Costume - Galka Child +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,178,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/piece_of_hume_mochi.lua =================================================================== --- scripts/globals/items/piece_of_hume_mochi.lua (revision 0) +++ scripts/globals/items/piece_of_hume_mochi.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 5203 +-- Piece of Hume Mochi +-- Enchantment: 60Min, Costume - Hume child (male) +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,114,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/piercing_dagger.lua =================================================================== --- scripts/globals/items/piercing_dagger.lua (revision 0) +++ scripts/globals/items/piercing_dagger.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 18029 +-- Item: Piercing Dagger +-- Enchantment: Attack +3 +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,18029); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ATT, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ATT, 3); +end; + Index: scripts/globals/items/pinch_of_lethe_powder.lua =================================================================== --- scripts/globals/items/pinch_of_lethe_powder.lua (revision 0) +++ scripts/globals/items/pinch_of_lethe_powder.lua (working copy) @@ -0,0 +1,38 @@ +----------------------------------------- +-- ID: 4214 +-- Item: Pinch of Lethe Powder +-- Item Effect: Removes up to 3 status effects from target AoE +----------------------------------------- + +-- TODO: Make AoE + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local effect = target:dispelStatusEffect(); + if(effect == EFFECT_NONE) then + target:messageBasic(423); -- no effect + else + local z = 0; + while z <= 3 do + target:dispelStatusEffect(); + if(effect == EFFECT_NONE) then + z = 3; + end + z = z + 1; + end; + end +end; + Index: scripts/globals/items/pinch_of_mana_powder.lua =================================================================== --- scripts/globals/items/pinch_of_mana_powder.lua (revision 0) +++ scripts/globals/items/pinch_of_mana_powder.lua (working copy) @@ -0,0 +1,36 @@ +----------------------------------------- +-- ID: 4255 +-- Item: Pinch of Mana Powder +-- Item Effect: Restores 25% MP AoE 10' radius +----------------------------------------- + +-- TODO: Make AoE + +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + mMP = target:getMaxMP(); + cMP = target:getMP(); + rMP = mMP * .25; + if (mMP == cMP) then + result = 56; -- Does not let player use item if their mp is full + end + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); + target:messageBasic(25,0,target:addMP(rMP)); +end; Index: scripts/globals/items/pinch_of_prism_powder.lua =================================================================== --- scripts/globals/items/pinch_of_prism_powder.lua (revision 3304) +++ scripts/globals/items/pinch_of_prism_powder.lua (working copy) @@ -19,7 +19,9 @@ ----------------------------------------- function onItemUse(target) + local duration = 120; + duration = duration + (duration * target:getMod(MOD_INVIS_DUR)); if (not target:hasStatusEffect(EFFECT_INVISIBLE)) then - target:addStatusEffect(EFFECT_INVISIBLE,0,10,120); + target:addStatusEffect(EFFECT_INVISIBLE,0,10,duration); end end; Index: scripts/globals/items/pinch_of_prize_powder.lua =================================================================== --- scripts/globals/items/pinch_of_prize_powder.lua (revision 0) +++ scripts/globals/items/pinch_of_prize_powder.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 5945 +-- Item: Pinch of Prize Powder +-- Effect: 60Min, Costume - Treasure Chest +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,969,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/pinch_of_rainbow_powder.lua =================================================================== --- scripts/globals/items/pinch_of_rainbow_powder.lua (revision 3304) +++ scripts/globals/items/pinch_of_rainbow_powder.lua (working copy) @@ -23,7 +23,10 @@ ----------------------------------------- function onItemUse(target) - target:delStatusEffect(EFFECT_INVISIBLE); - target:addStatusEffect(EFFECT_INVISIBLE,0,10,180); - target:addStatusEffect(EFFECT_MEDICINE,0,0,180); + local duration = 180; + duration = duration + (duration * target:getMod(MOD_INVIS_DUR)); + if (not target:hasStatusEffect(EFFECT_INVISIBLE)) then + target:addStatusEffect(EFFECT_INVISIBLE,0,10,duration); + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); + end end; Index: scripts/globals/items/pinwheel_belt.lua =================================================================== --- scripts/globals/items/pinwheel_belt.lua (revision 0) +++ scripts/globals/items/pinwheel_belt.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15927 +-- Pinwheel Belt +-- When used, you will obtain 1 Stack of Pinwheels +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(17309,99); +end; \ No newline at end of file Index: scripts/globals/items/pipira.lua =================================================================== --- scripts/globals/items/pipira.lua (revision 3304) +++ scripts/globals/items/pipira.lua (working copy) @@ -18,7 +18,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/plate_of_indi-acumen.lua =================================================================== --- scripts/globals/items/plate_of_indi-acumen.lua (revision 0) +++ scripts/globals/items/plate_of_indi-acumen.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6085 +-- Item: Plate of Indi-Acumen +-- Teaches the Geomancer Magic Indi-Acumen +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(781); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(781); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-agi.lua =================================================================== --- scripts/globals/items/plate_of_indi-agi.lua (revision 0) +++ scripts/globals/items/plate_of_indi-agi.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6079 +-- Item: Plate of Indi-AGI +-- Teaches the Geomancer Magic Indi-AGI +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(775); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(775); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-attunement.lua =================================================================== --- scripts/globals/items/plate_of_indi-attunement.lua (revision 0) +++ scripts/globals/items/plate_of_indi-attunement.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6090 +-- Item: Plate of Indi-Attunement +-- Teaches the Geomancer Magic Indi-Attunement +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(786); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(786); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-barrier.lua =================================================================== --- scripts/globals/items/plate_of_indi-barrier.lua (revision 0) +++ scripts/globals/items/plate_of_indi-barrier.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6084 +-- Item: Plate of Indi-Barrier +-- Teaches the Geomancer Magic Indi-Barrier +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(780); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(780); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-chr.lua =================================================================== --- scripts/globals/items/plate_of_indi-chr.lua (revision 0) +++ scripts/globals/items/plate_of_indi-chr.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6082 +-- Item: Plate of Indi-CHR +-- Teaches the Geomancer Magic Indi-CHR +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(778); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(778); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-dex.lua =================================================================== --- scripts/globals/items/plate_of_indi-dex.lua (revision 0) +++ scripts/globals/items/plate_of_indi-dex.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6077 +-- Item: Plate of Indi-DEX +-- Teaches the Geomancer Magic Indi-DEX +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(773); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(773); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-fade.lua =================================================================== --- scripts/globals/items/plate_of_indi-fade.lua (revision 0) +++ scripts/globals/items/plate_of_indi-fade.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6093 +-- Item: Plate of Indi-Fade +-- Teaches the Geomancer Magic Indi-Fade +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(789); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(789); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-fend.lua =================================================================== --- scripts/globals/items/plate_of_indi-fend.lua (revision 0) +++ scripts/globals/items/plate_of_indi-fend.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6086 +-- Item: Plate of Indi-Fend +-- Teaches the Geomancer Magic Indi-Fend +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(782); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(782); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-focus.lua =================================================================== --- scripts/globals/items/plate_of_indi-focus.lua (revision 0) +++ scripts/globals/items/plate_of_indi-focus.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6089 +-- Item: Plate of Indi-Focus +-- Teaches the Geomancer Magic Indi-Focus +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(785); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(785); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-frailty.lua =================================================================== --- scripts/globals/items/plate_of_indi-frailty.lua (revision 0) +++ scripts/globals/items/plate_of_indi-frailty.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6092 +-- Item: Plate of Indi-Frailty +-- Teaches the Geomancer Magic Indi-Frailty +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(788); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(788); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-fury.lua =================================================================== --- scripts/globals/items/plate_of_indi-fury.lua (revision 0) +++ scripts/globals/items/plate_of_indi-fury.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6083 +-- Item: Plate of Indi-Fury +-- Teaches the Geomancer Magic Indi-Fury +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(779); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(779); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-gravity.lua =================================================================== --- scripts/globals/items/plate_of_indi-gravity.lua (revision 0) +++ scripts/globals/items/plate_of_indi-gravity.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6101 +-- Item: Plate of Indi-Gravity +-- Teaches the Geomancer Magic Indi-Gravity +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(797); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(797); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-int.lua =================================================================== --- scripts/globals/items/plate_of_indi-int.lua (revision 0) +++ scripts/globals/items/plate_of_indi-int.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6080 +-- Item: Plate of Indi-INT +-- Teaches the Geomancer Magic Indi-INT +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(776); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(776); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-languor.lua =================================================================== --- scripts/globals/items/plate_of_indi-languor.lua (revision 0) +++ scripts/globals/items/plate_of_indi-languor.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6098 +-- Item: Plate of Indi-Languor +-- Teaches the Geomancer Magic Indi-Languor +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(794); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(794); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-malaise.lua =================================================================== --- scripts/globals/items/plate_of_indi-malaise.lua (revision 0) +++ scripts/globals/items/plate_of_indi-malaise.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6094 +-- Item: Plate of Indi-Malaise +-- Teaches the Geomancer Magic Indi-Malaise +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(790); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(790); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-mnd.lua =================================================================== --- scripts/globals/items/plate_of_indi-mnd.lua (revision 0) +++ scripts/globals/items/plate_of_indi-mnd.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6081 +-- Item: Plate of Indi-MND +-- Teaches the Geomancer Magic Indi-MND +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(777); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(777); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-paralysis.lua =================================================================== --- scripts/globals/items/plate_of_indi-paralysis.lua (revision 0) +++ scripts/globals/items/plate_of_indi-paralysis.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6100 +-- Item: Plate of Indi-Paralysis +-- Teaches the Geomancer Magic Indi-Paralysis +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(796); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(796); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-poison.lua =================================================================== --- scripts/globals/items/plate_of_indi-poison.lua (revision 0) +++ scripts/globals/items/plate_of_indi-poison.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6074 +-- Item: Plate of Indi-Poison +-- Teaches the Geomancer Magic Indi-Poison +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(769); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(769); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-precision.lua =================================================================== --- scripts/globals/items/plate_of_indi-precision.lua (revision 0) +++ scripts/globals/items/plate_of_indi-precision.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6087 +-- Item: Plate of Indi-Precision +-- Teaches the Geomancer Magic Indi-Precision +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(783); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(783); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-refresh.lua =================================================================== --- scripts/globals/items/plate_of_indi-refresh.lua (revision 0) +++ scripts/globals/items/plate_of_indi-refresh.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6075 +-- Item: Plate of Indi-Refresh +-- Teaches the Geomancer Magic Indi-Refresh +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(770); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(770); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-regen.lua =================================================================== --- scripts/globals/items/plate_of_indi-regen.lua (revision 0) +++ scripts/globals/items/plate_of_indi-regen.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6073 +-- Item: Plate of Indi-Regen +-- Teaches the Geomancer Magic Indi-Regen +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(768); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(768); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-slip.lua =================================================================== --- scripts/globals/items/plate_of_indi-slip.lua (revision 0) +++ scripts/globals/items/plate_of_indi-slip.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6095 +-- Item: Plate of Indi-Slip +-- Teaches the Geomancer Magic Indi-Slip +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(791); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(791); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-slow.lua =================================================================== --- scripts/globals/items/plate_of_indi-slow.lua (revision 0) +++ scripts/globals/items/plate_of_indi-slow.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6099 +-- Item: Plate of Indi-Slow +-- Teaches the Geomancer Magic Indi-Slow +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(795); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(795); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-str.lua =================================================================== --- scripts/globals/items/plate_of_indi-str.lua (revision 0) +++ scripts/globals/items/plate_of_indi-str.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6076 +-- Item: Plate of Indi-STR +-- Teaches the Geomancer Magic Indi-STR +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(772); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(772); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-torpor.lua =================================================================== --- scripts/globals/items/plate_of_indi-torpor.lua (revision 0) +++ scripts/globals/items/plate_of_indi-torpor.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6096 +-- Item: Plate of Indi-Torpor +-- Teaches the Geomancer Magic Indi-Torpor +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(792); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(792); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-vex.lua =================================================================== --- scripts/globals/items/plate_of_indi-vex.lua (revision 0) +++ scripts/globals/items/plate_of_indi-vex.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6097 +-- Item: Plate of Indi-Vex +-- Teaches the Geomancer Magic Indi-Vex +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(793); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(793); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-vit.lua =================================================================== --- scripts/globals/items/plate_of_indi-vit.lua (revision 0) +++ scripts/globals/items/plate_of_indi-vit.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6078 +-- Item: Plate of Indi-VIT +-- Teaches the Geomancer Magic Indi-VIT +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(774); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(774); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-voidance.lua =================================================================== --- scripts/globals/items/plate_of_indi-voidance.lua (revision 0) +++ scripts/globals/items/plate_of_indi-voidance.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6088 +-- Item: Plate of Indi-Voidance +-- Teaches the Geomancer Magic Indi-Voidance +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(784); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(784); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_indi-wilt.lua =================================================================== --- scripts/globals/items/plate_of_indi-wilt.lua (revision 0) +++ scripts/globals/items/plate_of_indi-wilt.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 6091 +-- Item: Plate of Indi-Wilt +-- Teaches the Geomancer Magic Indi-Wilt +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(787); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(787); +end; \ No newline at end of file Index: scripts/globals/items/plate_of_mushroom_risotto.lua =================================================================== --- scripts/globals/items/plate_of_mushroom_risotto.lua (revision 0) +++ scripts/globals/items/plate_of_mushroom_risotto.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 4434 +-- Item: Plate of Mushroom Risotto +-- Food Effect: 3 Hr, All Races +----------------------------------------- +-- MP 30 +-- Strength -1 +-- Vitality 3 +-- Mind 3 +-- MP Recovered while healing 2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,4434); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MP, 30); + target:addMod(MOD_STR, -1); + target:addMod(MOD_VIT, 3); + target:addMod(MOD_MND, 3); + target:addMod(MOD_MPHEAL, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MP, 30); + target:delMod(MOD_STR, -1); + target:delMod(MOD_VIT, 3); + target:delMod(MOD_MND, 3); + target:delMod(MOD_MPHEAL, 2); +end; Index: scripts/globals/items/pole_of_trials.lua =================================================================== --- scripts/globals/items/pole_of_trials.lua (revision 0) +++ scripts/globals/items/pole_of_trials.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 17527 +-- Equip: Pole of Trials +-- Latent effect is active while less then 300 weapon skills have been preformed on EP+ Mobs using this weapon. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target,prevsjob) + + mainEquip = target:getEquipID(SLOT_MAIN); + + if (mainEquip == 17527) then + if (target:getVar("WSNMHits") < 300) then + target:addMod(MOD_HP, 10); + target:addMod(MOD_MP, 10); + target:addMod(MOD_FIREDEF, 10); + target:addMod(MOD_LIGHTDEF, 10); + else + target:delMod(MOD_HP, 10); + target:delMod(MOD_MP, 10); + target:delMod(MOD_FIREDEF, 10); + target:delMod(MOD_LIGHTDEF, 10); + end + end + +end; \ No newline at end of file Index: scripts/globals/items/port_bastok_gate_glyph.lua =================================================================== --- scripts/globals/items/port_bastok_gate_glyph.lua (revision 0) +++ scripts/globals/items/port_bastok_gate_glyph.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 4189 +-- Item: Bastok Port Gate Glyph +-- Enchantment: "Teleport" (Bastok Port) +----------------------------------------- + +require("scripts/globals/teleports"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + bastokPortGlyph(target); +end; \ No newline at end of file Index: scripts/globals/items/port_windurst_gate_glyph.lua =================================================================== --- scripts/globals/items/port_windurst_gate_glyph.lua (revision 0) +++ scripts/globals/items/port_windurst_gate_glyph.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 4194 +-- Item: Port Windurst Gate Glyph +-- Enchantment: "Teleport" (Port Windurst) +----------------------------------------- + +require("scripts/globals/teleports"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + windyPortGlyph(target); +end; \ No newline at end of file Index: scripts/globals/items/poseidons_ring.lua =================================================================== --- scripts/globals/items/poseidons_ring.lua (revision 0) +++ scripts/globals/items/poseidons_ring.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 14656 +-- Poseidon's Ring +-- This earring functions in the same way as the spell Water Spirit. +-- Uses: 50 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/pets"); +require("scripts/globals/summon"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:spawnPet(PET_WATER_SPIRIT); +end; Index: scripts/globals/items/pot_au_feu.lua =================================================================== --- scripts/globals/items/pot_au_feu.lua (revision 0) +++ scripts/globals/items/pot_au_feu.lua (working copy) @@ -0,0 +1,61 @@ +----------------------------------------- +-- ID: 5752 +-- Item: Pot-au-feu +-- Food Effect: 30Min, All Races +----------------------------------------- +-- Strength 3 +-- Agility 3 +-- Intelligence -3 +-- Ranged Attk % 15 Cap 35 ?? +-- Ranged ACC % 15 Cap 35 ?? +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,5752); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 3); + target:addMod(MOD_AGI, 3); + target:addMod(MOD_INT, -3); + target:addMod(MOD_FOOD_RATTP, 15); + target:addMod(MOD_FOOD_RATT_CAP, 35); + target:addMod(MOD_FOOD_RACCP, 15); + target:addMod(MOD_FOOD_RACC_CAP, 35); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 3); + target:delMod(MOD_AGI, 3); + target:delMod(MOD_INT, -3); + target:delMod(MOD_FOOD_RATTP, 15); + target:delMod(MOD_FOOD_RATT_CAP, 35); + target:delMod(MOD_FOOD_RACCP, 15); + target:delMod(MOD_FOOD_RACC_CAP, 35); +end; Index: scripts/globals/items/pot_au_feu_+1.lua =================================================================== --- scripts/globals/items/pot_au_feu_+1.lua (revision 0) +++ scripts/globals/items/pot_au_feu_+1.lua (working copy) @@ -0,0 +1,61 @@ +----------------------------------------- +-- ID: 5753 +-- Item: Pot-au-feu +-- Food Effect: 30Min, All Races +----------------------------------------- +-- Strength 4 +-- Agility 4 +-- Intelligence -2 +-- Ranged Attk % 15 Cap 35 ?? +-- Ranged ACC % 15 Cap 35 ?? +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,5753); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 4); + target:addMod(MOD_AGI, 4); + target:addMod(MOD_INT, -2); + target:addMod(MOD_FOOD_RATTP, 15); + target:addMod(MOD_FOOD_RATT_CAP, 35); + target:addMod(MOD_FOOD_RACCP, 15); + target:addMod(MOD_FOOD_RACC_CAP, 35); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 4); + target:delMod(MOD_AGI, 4); + target:delMod(MOD_INT, -2); + target:delMod(MOD_FOOD_RATTP, 15); + target:delMod(MOD_FOOD_RATT_CAP, 35); + target:delMod(MOD_FOOD_RACCP, 15); + target:delMod(MOD_FOOD_RACC_CAP, 35); +end; Index: scripts/globals/items/pot_of_silent_oil.lua =================================================================== --- scripts/globals/items/pot_of_silent_oil.lua (revision 3304) +++ scripts/globals/items/pot_of_silent_oil.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------------- --- ID: 4165 --- Silent oil --- This lubricant cuts down 99.99% of all friction +-- ID: 4165 +-- Item: Silent oil +-- Effect: This lubricant cuts down 99.99% of all friction ----------------------------------------- require("scripts/globals/status"); @@ -18,7 +18,9 @@ ----------------------------------------- function onItemUse(target) + local duration = 200 + duration = duration + (duration * target:getMod(MOD_SNEAK_DUR)); if (not target:hasStatusEffect(EFFECT_SNEAK)) then - target:addStatusEffect(EFFECT_SNEAK,1,10,200); + target:addStatusEffect(EFFECT_SNEAK,1,10,duration); end end; Index: scripts/globals/items/primal_belt.lua =================================================================== --- scripts/globals/items/primal_belt.lua (revision 0) +++ scripts/globals/items/primal_belt.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- ID: 15910 +-- Item: Primal Belt +-- Item Effect: Pet gets DEF +5 Enimity +3 +----------------------------------------- + +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_WAIST) == 15910) then + pet:addMod(MOD_DEF, 5); + pet:addMod(MOD_ENMITY, 3); + else + pet:delMod(MOD_DEF, 5); + pet:delMod(MOD_ENMITY, 3); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/prime_angler_stewpot.lua =================================================================== --- scripts/globals/items/prime_angler_stewpot.lua (revision 0) +++ scripts/globals/items/prime_angler_stewpot.lua (working copy) @@ -0,0 +1,74 @@ +----------------------------------------- +-- ID: 5612 +-- Item: Prime Angler Stewpot +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% +-- MP +15 +-- Dexterity 2 +-- Agility 1 +-- Mind 1 +-- HP Recovered while healing 7 +-- MP Recovered while healing 2 +-- Accuracy 15% Cap 30 +-- Ranged Accuracy 15% Cap 30 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5612); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_MP, 15); + target:addMod(MOD_DEX, 2); + target:addMod(MOD_AGI, 1); + target:addMod(MOD_MND, 1); + target:addMod(MOD_HPHEAL, 7); + target:addMod(MOD_MPHEAL, 2); + target:addMod(MOD_FOOD_ACCP, 15); + target:addMod(MOD_FOOD_ACC_CAP, 30); + target:addMod(MOD_FOOD_RACCP, 15); + target:addMod(MOD_FOOD_RACC_CAP, 30); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_MP, 15); + target:delMod(MOD_DEX, 2); + target:delMod(MOD_AGI, 1); + target:delMod(MOD_MND, 1); + target:delMod(MOD_HPHEAL, 7); + target:delMod(MOD_MPHEAL, 2); + target:delMod(MOD_FOOD_ACCP, 15); + target:delMod(MOD_FOOD_ACC_CAP, 30); + target:delMod(MOD_FOOD_RACCP, 15); + target:delMod(MOD_FOOD_RACC_CAP, 30); +end; Index: scripts/globals/items/prime_beef_stewpot.lua =================================================================== --- scripts/globals/items/prime_beef_stewpot.lua (revision 0) +++ scripts/globals/items/prime_beef_stewpot.lua (working copy) @@ -0,0 +1,74 @@ +----------------------------------------- +-- ID: 5548 +-- Item: Prime Beef Stewpot +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% Cap 75 +-- MP +15 +-- Strength +2 +-- Agility +1 +-- Mind +1 +-- HP Recovered while healing +7 +-- MP Recovered while healing +2 +-- Attack 18% Cap 60 +-- Evasion +6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5548); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_FOOD_HP_CAP, 75); + target:addMod(MOD_MP, 15); + target:addMod(MOD_STR, 2); + target:addMod(MOD_AGI, 1); + target:addMod(MOD_MND, 1); + target:addMod(MOD_HPHEAL, 7); + target:addMod(MOD_MPHEAL, 2); + target:addMod(MOD_FOOD_ATTP, 18); + target:addMod(MOD_FOOD_ATT_CAP, 60); + target:addMod(MOD_EVA, 6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_FOOD_HP_CAP, 75); + target:delMod(MOD_MP, 15); + target:delMod(MOD_STR, 2); + target:delMod(MOD_AGI, 1); + target:delMod(MOD_MND, 1); + target:delMod(MOD_HPHEAL, 7); + target:delMod(MOD_MPHEAL, 2); + target:delMod(MOD_FOOD_ATTP, 18); + target:delMod(MOD_FOOD_ATT_CAP, 60); + target:delMod(MOD_EVA, 6); +end; Index: scripts/globals/items/prime_crab_stewpot.lua =================================================================== --- scripts/globals/items/prime_crab_stewpot.lua (revision 0) +++ scripts/globals/items/prime_crab_stewpot.lua (working copy) @@ -0,0 +1,74 @@ +----------------------------------------- +-- ID: 5545 +-- Item: Prime Crab Stewpot +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% Cap 75 +-- MP +15 +-- Vitality +1 +-- Agility +1 +-- Mind +2 +-- HP Recovered while healing +7 +-- MP Recovered while healing +2 +-- Defense 20% Cap 75 +-- Evasion +6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5545); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_FOOD_HP_CAP, 75); + target:addMod(MOD_MP, 15); + target:addMod(MOD_VIT, 1); + target:addMod(MOD_AGI, 1); + target:addMod(MOD_MND, 2); + target:addMod(MOD_HPHEAL, 7); + target:addMod(MOD_MPHEAL, 2); + target:addMod(MOD_FOOD_DEFP, 20); + target:addMod(MOD_FOOD_DEF_CAP, 75); + target:addMod(MOD_EVA, 6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_FOOD_HP_CAP, 75); + target:delMod(MOD_MP, 15); + target:delMod(MOD_VIT, 1); + target:delMod(MOD_AGI, 1); + target:delMod(MOD_MND, 2); + target:delMod(MOD_HPHEAL, 7); + target:delMod(MOD_MPHEAL, 2); + target:delMod(MOD_FOOD_DEFP, 20); + target:delMod(MOD_FOOD_DEF_CAP, 75); + target:delMod(MOD_EVA, 6); +end; Index: scripts/globals/items/prime_seafood_stewpot.lua =================================================================== --- scripts/globals/items/prime_seafood_stewpot.lua (revision 0) +++ scripts/globals/items/prime_seafood_stewpot.lua (working copy) @@ -0,0 +1,75 @@ +----------------------------------------- +-- ID: 5239 +-- Item: Prime Seafood Stewpot +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% Cap 75 +-- MP +15 +-- Dexterity 1 +-- Vitality 1 +-- Agility 1 +-- Mind 1 +-- HP Recovered while healing 7 +-- MP Recovered while healing 2 +-- Accuracy 6 +-- Evasion 6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5239); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_FOOD_HP_CAP, 75); + target:addMod(MOD_MP, 15); + target:addMod(MOD_DEX, 1); + target:addMod(MOD_VIT, 1); + target:addMod(MOD_AGI, 1); + target:addMod(MOD_MND, 1); + target:addMod(MOD_HPHEAL, 7); + target:addMod(MOD_MPHEAL, 2); + target:addMod(MOD_ACC, 6); + target:addMod(MOD_EVA, 6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_FOOD_HP_CAP, 75); + target:delMod(MOD_MP, 15); + target:delMod(MOD_DEX, 1); + target:delMod(MOD_VIT, 1); + target:delMod(MOD_AGI, 1); + target:delMod(MOD_MND, 1); + target:delMod(MOD_HPHEAL, 7); + target:delMod(MOD_MPHEAL, 2); + target:delMod(MOD_ACC, 6); + target:delMod(MOD_EVA, 6); +end; Index: scripts/globals/items/prized_angler_stewpot.lua =================================================================== --- scripts/globals/items/prized_angler_stewpot.lua (revision 0) +++ scripts/globals/items/prized_angler_stewpot.lua (working copy) @@ -0,0 +1,74 @@ +----------------------------------------- +-- ID: 5613 +-- Item: Prized Angler's Stewpot +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% +-- MP +20 +-- Dexterity 4 +-- Agility 2 +-- Mind 2 +-- HP Recovered while healing 9 +-- MP Recovered while healing 3 +-- Accuracy 15% Cap 45 +-- Ranged Accuracy 15% Cap 45 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5613); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_MP, 20); + target:addMod(MOD_DEX, 4); + target:addMod(MOD_AGI, 2); + target:addMod(MOD_MND, 2); + target:addMod(MOD_HPHEAL, 9); + target:addMod(MOD_MPHEAL, 3); + target:addMod(MOD_FOOD_ACCP, 15); + target:addMod(MOD_FOOD_ACC_CAP, 45); + target:addMod(MOD_FOOD_RACCP, 15); + target:addMod(MOD_FOOD_RACC_CAP, 45); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_MP, 20); + target:delMod(MOD_DEX, 4); + target:delMod(MOD_AGI, 2); + target:delMod(MOD_MND, 2); + target:delMod(MOD_HPHEAL, 9); + target:delMod(MOD_MPHEAL, 3); + target:delMod(MOD_FOOD_ACCP, 15); + target:delMod(MOD_FOOD_ACC_CAP, 45); + target:delMod(MOD_FOOD_RACCP, 15); + target:delMod(MOD_FOOD_RACC_CAP, 45); +end; Index: scripts/globals/items/prized_beef_stewpot.lua =================================================================== --- scripts/globals/items/prized_beef_stewpot.lua (revision 0) +++ scripts/globals/items/prized_beef_stewpot.lua (working copy) @@ -0,0 +1,74 @@ +----------------------------------------- +-- ID: 5549 +-- Item: Prized Angler's Stewpot +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% Cap 100 +-- MP +20 +-- Strength +4 +-- Agility +2 +-- Mind +2 +-- HP Recovered while healing +9 +-- MP Recovered while healing +3 +-- Attack 15% Cap 80 +-- Evasion +7 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5549); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_FOOD_HP_CAP, 100); + target:addMod(MOD_MP, 20); + target:addMod(MOD_STR, 4); + target:addMod(MOD_AGI, 2); + target:addMod(MOD_MND, 2); + target:addMod(MOD_HPHEAL, 9); + target:addMod(MOD_MPHEAL, 3); + target:addMod(MOD_FOOD_ATTP, 18); + target:addMod(MOD_FOOD_ATT_CAP, 80); + target:addMod(MOD_EVA, 7); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_FOOD_HP_CAP, 100); + target:delMod(MOD_MP, 20); + target:delMod(MOD_STR, 4); + target:delMod(MOD_AGI, 2); + target:delMod(MOD_MND, 2); + target:delMod(MOD_HPHEAL, 9); + target:delMod(MOD_MPHEAL, 3); + target:delMod(MOD_FOOD_ATTP, 18); + target:delMod(MOD_FOOD_ATT_CAP, 80); + target:delMod(MOD_EVA, 7); +end; Index: scripts/globals/items/prized_crab_stewpot.lua =================================================================== --- scripts/globals/items/prized_crab_stewpot.lua (revision 0) +++ scripts/globals/items/prized_crab_stewpot.lua (working copy) @@ -0,0 +1,74 @@ +----------------------------------------- +-- ID: 5546 +-- Item: Prized Crab Stewpot +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% Cap 100 +-- MP +20 +-- Vitality +2 +-- Agility +2 +-- Mind +4 +-- HP Recovered while healing +9 +-- MP Recovered while healing +3 +-- Defense 20% Cap 100 +-- Evasion +7 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5546); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_FOOD_HP_CAP, 100); + target:addMod(MOD_MP, 20); + target:addMod(MOD_VIT, 2); + target:addMod(MOD_AGI, 2); + target:addMod(MOD_MND, 4); + target:addMod(MOD_HPHEAL, 9); + target:addMod(MOD_MPHEAL, 3); + target:addMod(MOD_FOOD_DEFP, 20); + target:addMod(MOD_FOOD_DEF_CAP, 100); + target:addMod(MOD_EVA, 7); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_FOOD_HP_CAP, 100); + target:delMod(MOD_MP, 20); + target:delMod(MOD_VIT, 2); + target:delMod(MOD_AGI, 2); + target:delMod(MOD_MND, 4); + target:delMod(MOD_HPHEAL, 9); + target:delMod(MOD_MPHEAL, 3); + target:delMod(MOD_FOOD_DEFP, 20); + target:delMod(MOD_FOOD_DEF_CAP, 100); + target:delMod(MOD_EVA, 7); +end; Index: scripts/globals/items/prized_seafood_stewpot.lua =================================================================== --- scripts/globals/items/prized_seafood_stewpot.lua (revision 0) +++ scripts/globals/items/prized_seafood_stewpot.lua (working copy) @@ -0,0 +1,75 @@ +----------------------------------------- +-- ID: 5240 +-- Item: Prized Seafood Stewpot +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% Cap 100 +-- MP +20 +-- Dexterity 2 +-- Vitality 2 +-- Agility 2 +-- Mind 2 +-- HP Recovered while healing 9 +-- MP Recovered while healing 3 +-- Accuracy 7 +-- Evasion 7 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5240); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_FOOD_HP_CAP, 100); + target:addMod(MOD_MP, 20); + target:addMod(MOD_DEX, 2); + target:addMod(MOD_VIT, 2); + target:addMod(MOD_AGI, 2); + target:addMod(MOD_MND, 2); + target:addMod(MOD_HPHEAL, 9); + target:addMod(MOD_MPHEAL, 3); + target:addMod(MOD_ACC, 7); + target:addMod(MOD_EVA, 7); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_FOOD_HP_CAP, 100); + target:delMod(MOD_MP, 20); + target:delMod(MOD_DEX, 2); + target:delMod(MOD_VIT, 2); + target:delMod(MOD_AGI, 2); + target:delMod(MOD_MND, 2); + target:delMod(MOD_HPHEAL, 9); + target:delMod(MOD_MPHEAL, 3); + target:delMod(MOD_ACC, 7); + target:delMod(MOD_EVA, 7); +end; Index: scripts/globals/items/prominence_axe.lua =================================================================== --- scripts/globals/items/prominence_axe.lua (revision 0) +++ scripts/globals/items/prominence_axe.lua (working copy) @@ -0,0 +1,22 @@ +----------------------------------------- +-- ID: 18220 +-- Item: Prominence Axe +-- Enchantment: "Enfire" +-- Charges: 30 Reuse: 300 Secs +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENFIRE; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/prominence_sword.lua =================================================================== --- scripts/globals/items/prominence_sword.lua (revision 0) +++ scripts/globals/items/prominence_sword.lua (working copy) @@ -0,0 +1,22 @@ +----------------------------------------- +-- ID: 18381 +-- Item: Prominence Sword +-- Enchantment: "Enfire" +-- Charges: 30 Reuse: 300 Secs +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENFIRE; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/protect_earring.lua =================================================================== --- scripts/globals/items/protect_earring.lua (revision 3304) +++ scripts/globals/items/protect_earring.lua (working copy) @@ -22,6 +22,13 @@ local power = 15; + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 2; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 2; + end + if(target:addStatusEffect(EFFECT_PROTECT, power, 0, 1800)) then target:messageBasic(205); else Index: scripts/globals/items/protect_ring.lua =================================================================== --- scripts/globals/items/protect_ring.lua (revision 3304) +++ scripts/globals/items/protect_ring.lua (working copy) @@ -21,6 +21,12 @@ function onItemUse(target) local power = 40; + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 4; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 4; + end if(target:addStatusEffect(EFFECT_PROTECT, power, 0, 1800)) then target:messageBasic(205); Index: scripts/globals/items/pumpkin_cake.lua =================================================================== --- scripts/globals/items/pumpkin_cake.lua (revision 0) +++ scripts/globals/items/pumpkin_cake.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5631 +-- Item: Pumpkin Cake +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP Recovered while healing +2 +-- MP Recovered while healing +4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5631); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HPHEAL, 2); + target:addMod(MOD_MPHEAL, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HPHEAL, 2); + target:delMod(MOD_MPHEAL, 4); +end; Index: scripts/globals/items/purgatory_collar.lua =================================================================== --- scripts/globals/items/purgatory_collar.lua (revision 0) +++ scripts/globals/items/purgatory_collar.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 15507 +-- Item: Purgatory Collar +-- Enchantment: Conserve MP +-- Charges: 20 Reuse Delay: 15 Mins +-- Duration: 5 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,300,15507); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_CONSERVE_MP, 15); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_CONSERVE_MP, 15); +end; \ No newline at end of file Index: scripts/globals/items/quadav_belt.lua =================================================================== --- scripts/globals/items/quadav_belt.lua (revision 0) +++ scripts/globals/items/quadav_belt.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 10848 +-- Quadav Belt +-- Enchantment: 60Min, Costume - Quadav +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,644,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/quies_ring.lua =================================================================== --- scripts/globals/items/quies_ring.lua (revision 0) +++ scripts/globals/items/quies_ring.lua (working copy) @@ -0,0 +1,42 @@ +----------------------------------------- +-- ID: 10780 +-- Item: Quies Ring +-- Enchantment: Magic Defense Bonus +3 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,300,10780); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MDEF, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MDEF, 3); +end; \ No newline at end of file Index: scripts/globals/items/quus.lua =================================================================== --- scripts/globals/items/quus.lua (revision 3304) +++ scripts/globals/items/quus.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/rabao_earring.lua =================================================================== --- scripts/globals/items/rabao_earring.lua (revision 0) +++ scripts/globals/items/rabao_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16045 +-- Item: Rabao Earring +-- Enchantment: "Teleport" (Rabao) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(247) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + rabaoEarring(target); +end; \ No newline at end of file Index: scripts/globals/items/raise_ii_rod.lua =================================================================== --- scripts/globals/items/raise_ii_rod.lua (revision 0) +++ scripts/globals/items/raise_ii_rod.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 17469 +-- Item: Raise II Rod +-- Item Effect: Casts Raise II on target +-- Charges: 20 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (!target:hasStatusEffect(EFFECT_KO)) then + result = 56; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:sendRaise(2); + target:messageBasic(309); +end; Index: scripts/globals/items/raise_rod.lua =================================================================== --- scripts/globals/items/raise_rod.lua (revision 0) +++ scripts/globals/items/raise_rod.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 17468 +-- Item: Raise Rod +-- Item Effect: Casts Raise on target +-- Charges: 20 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (!target:hasStatusEffect(EFFECT_KO)) then + result = 56; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:sendRaise(1); + target:messageBasic(309); +end; Index: scripts/globals/items/rajas_ring.lua =================================================================== --- scripts/globals/items/rajas_ring.lua (revision 0) +++ scripts/globals/items/rajas_ring.lua (working copy) @@ -0,0 +1,41 @@ +----------------------------------------- +-- ID: 15543 +-- Item: Rajas Ring +-- Item Effect: STR +2~5 DEX +2~5 Variable with Lvl +-- DEF +1 every 10 Lvls +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local lvl = target:getMainLvl(); + local attribMod = 0 + if (target:getEquipID(SLOT_BACK) == 13680) then + if(lvl >= 45) then + attribMod = attribMod + 1 + end + if(lvl >= 60) then + attribMod = attribMod + 1 + end + if(lvl >= 75) then + attribMod = attribMod + 1 + end + target:addMod(MOD_STR, attribMod); + target:addMod(MOD_DEX, attribMod); + else + target:delMod(MOD_STR, attribMod); + target:delMod(MOD_DEX, attribMod); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/ram_staff.lua =================================================================== --- scripts/globals/items/ram_staff.lua (revision 0) +++ scripts/globals/items/ram_staff.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 18612 +-- Item: Ram Staff +-- Enchantment: "Retrace" (San d'Oria) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(80) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + ramStaff(target); +end; \ No newline at end of file Index: scripts/globals/items/random_ring.lua =================================================================== --- scripts/globals/items/random_ring.lua (revision 0) +++ scripts/globals/items/random_ring.lua (working copy) @@ -0,0 +1,40 @@ +----------------------------------------- +-- ID: 15770 +-- Random Ring +-- Enchantment: DEX + 1~8 +-- Uses: 50 Duration: 3 Mins +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,180,15770); + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + local dexMod = math.random(1,8); + target:addMod(MOD_DEX, dexMod); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, dexMod); +end; \ No newline at end of file Index: scripts/globals/items/ravanas_axe.lua =================================================================== --- scripts/globals/items/ravanas_axe.lua (revision 0) +++ scripts/globals/items/ravanas_axe.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 18547 +-- Equip: Ravana's Axe +-- Pet: Adds "Regen" Effect +10 every 3 sec +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_MAIN) == 18547 or target:getEquipID(SLOT_SUB) == 18547) then + pet:addStatusEffectEx(EFFECT_AUTO_REGEN,0,10,3,0,18547); + else + pet:delStatusEffect(EFFECT_AUTO_REGEN,18547); + end +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------- +-- onEffectTick Action +----------------------------------- + +function onEffectTick(target,effect) + local pet = target:getPet(); + pet:addHP(effect:getPower()); +end; + +----------------------------------- +-- onEffectLose Action +----------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/rebirth_feather.lua =================================================================== --- scripts/globals/items/rebirth_feather.lua (revision 0) +++ scripts/globals/items/rebirth_feather.lua (working copy) @@ -0,0 +1,37 @@ +----------------------------------------- +-- ID: 5259 +-- Item: Rebirth Feather +-- Effect: Brings you back from the dead~! Reraise III +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + power = 3; + duration = 1800; + if(target:hasStatusEffect(EFFECT_RERAISE) ==true)then + effect = target:getStatusEffect(EFFECT_RERAISE); + oPower = effect:getPower(); + if(oPower > power) then + target:messageBasic(283); -- Higher Tiered verson means no effect! + else + target:delStatusEffect(EFFECT_RERAISE); + target:addStatusEffect(EFFECT_RERAISE,power,0,duration); + end + else + target:addStatusEffect(EFFECT_RERAISE,power,0,duration); + end +end; \ No newline at end of file Index: scripts/globals/items/red_terrapin.lua =================================================================== --- scripts/globals/items/red_terrapin.lua (revision 3304) +++ scripts/globals/items/red_terrapin.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/redeyes.lua =================================================================== --- scripts/globals/items/redeyes.lua (revision 0) +++ scripts/globals/items/redeyes.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 16120 +-- Redeyes +-- When used, you will obtain one Angelwing +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5441,1); +end; \ No newline at end of file Index: scripts/globals/items/refresh_musk.lua =================================================================== --- scripts/globals/items/refresh_musk.lua (revision 0) +++ scripts/globals/items/refresh_musk.lua (working copy) @@ -0,0 +1,27 @@ +----------------------------------------- +-- ID: 18541 +-- Item: Refresh Musk +-- Enchantment: Adds Refresh +-- Duration: 60 Secs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 60; + target:delStatusEffect(EFFECT_REFRESH); + target:addStatusEffect(EFFECT_REFRESH,3,1,duration); +end; \ No newline at end of file Index: scripts/globals/items/regain_feather.lua =================================================================== --- scripts/globals/items/regain_feather.lua (revision 0) +++ scripts/globals/items/regain_feather.lua (working copy) @@ -0,0 +1,53 @@ +----------------------------------------- +-- ID: 5260 +-- Item: Regain Feather +-- Effect: Restore 100% HP 100% MP 300% TP +-- Duration: Instant 2 Hrs Medicated +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + mHP = target:getMaxHP(); + cHP = target:getHP(); + mMP = target:getMaxMP(); + cMP = target:getMP(); + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + if (mHP == cHP and mMP == cMP) then + result = 56; -- Does not let player use item if their hp and mp are full + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,7200,5260); + target:setHP(mHP); + target:setMP(mMP); + target:setTP(300); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/regiment_kheten.lua =================================================================== --- scripts/globals/items/regiment_kheten.lua (revision 0) +++ scripts/globals/items/regiment_kheten.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 18493 +-- Item: Regiment Kheten +-- Item Effect: TP +10 +-- Durration: Instant +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addTP(10); +end; Index: scripts/globals/items/republic_earring.lua =================================================================== --- scripts/globals/items/republic_earring.lua (revision 0) +++ scripts/globals/items/republic_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16040 +-- Item: Republic Earring +-- Enchantment: "Teleport" (Bastok Markets) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(235) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + republicEarring(target); +end; \ No newline at end of file Index: scripts/globals/items/republic_signet_staff.lua =================================================================== --- scripts/globals/items/republic_signet_staff.lua (revision 0) +++ scripts/globals/items/republic_signet_staff.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 17584 +-- Item: Republic Signet Staff +-- Item Effect: Grants target Signet +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:getNation() ~= 1) then + result = 56; + end + if (target:checkSoloPartyAlliance() == 0) then + result = 56; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:delStatusEffect(EFFECT_SIGNET); + target:addStatusEffect(EFFECT_SIGNET,0,0,18000,0,0); +end; + + Index: scripts/globals/items/republic_stables_medal.lua =================================================================== --- scripts/globals/items/republic_stables_medal.lua (revision 0) +++ scripts/globals/items/republic_stables_medal.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 13180 +-- Item: Republic Stables Medal +-- Enchantment: "Teleport" (Bastok Chocobo Stables) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(235) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + republicStablesMedal(target); +end; \ No newline at end of file Index: scripts/globals/items/return_ring.lua =================================================================== --- scripts/globals/items/return_ring.lua (revision 0) +++ scripts/globals/items/return_ring.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 15541 +-- Item: Homing Ring +-- Enchantment: "Teleport" (Outpost) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + returnRing(target); +end; \ No newline at end of file Index: scripts/globals/items/revive_feather.lua =================================================================== --- scripts/globals/items/revive_feather.lua (revision 0) +++ scripts/globals/items/revive_feather.lua (working copy) @@ -0,0 +1,37 @@ +----------------------------------------- +-- ID: 5258 +-- Item: Revive Feather +-- Effect: Brings you back from the dead~! +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + power = 1; + duration = 1800; + if(target:hasStatusEffect(EFFECT_RERAISE) ==true)then + effect = target:getStatusEffect(EFFECT_RERAISE); + oPower = effect:getPower(); + if(oPower > power) then + target:messageBasic(283); -- Higher Tiered verson means no effect! + else + target:delStatusEffect(EFFECT_RERAISE); + target:addStatusEffect(EFFECT_RERAISE,power,0,duration); + end + else + target:addStatusEffect(EFFECT_RERAISE,power,0,duration); + end +end; \ No newline at end of file Index: scripts/globals/items/rice_ball.lua =================================================================== --- scripts/globals/items/rice_ball.lua (revision 0) +++ scripts/globals/items/rice_ball.lua (working copy) @@ -0,0 +1,73 @@ +----------------------------------------- +-- ID: 4405 +-- Item: rice ball +-- Food Effect: 30minutes, All Races +----------------------------------------- +-- HP 10 +-- Vitality 2 +-- Dexterity -1 +-- HP Regeneration While Healing +1 +-- Effect with enhancing equipment +-- DEF +50 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,4405); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + pEquipMods = 0; + local hands = target:getEquipID(SLOT_HANDS); + local head = target:getEquipID(SLOT_HEAD); + local feet = target:getEquipID(SLOT_FEET); + target:addMod(MOD_HP, 10); + target:addMod(MOD_VIT, 2); + target:addMod(MOD_DEX, -1); + target:addMod(MOD_HPHEAL, 1); + + -- Equipment Bonus + if (head == 13949 or head == 13910) then -- Roshi Jinpachi & +1 + pEquipMods = pEquipMods + 50; + end + if (hands == 14901 or hands == 13972) then -- Myochin Kote & +1 + pEquipMods = pEquipMods + 50; + end + if (feet == 11367) then -- Nobushi Kyahan + pEquipMods = pEquipMods + 50; + end + target:addMod(MOD_DEF, pEquipMods); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 10); + target:delMod(MOD_VIT, 2); + target:delMod(MOD_DEX, -1); + target:delMod(MOD_HPHEAL, 2); + target:addMod(MOD_DEF, pEquipMods); +end; Index: scripts/globals/items/river_top_+1.lua =================================================================== --- scripts/globals/items/river_top_+1.lua (revision 0) +++ scripts/globals/items/river_top_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10270 +-- River Top +1 +-- When used, you will obtain 1 Berry Snowcone +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5710,1); +end; \ No newline at end of file Index: scripts/globals/items/roll_of_buche_au_chocolat.lua =================================================================== --- scripts/globals/items/roll_of_buche_au_chocolat.lua (revision 0) +++ scripts/globals/items/roll_of_buche_au_chocolat.lua (working copy) @@ -0,0 +1,60 @@ +----------------------------------------- +-- ID: 5550 +-- Item: Roll of Buche Au Chocolat +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +8 +-- MP +3% Cap 13 +-- Intelligence +2 +-- HP Recovered while healing +1 +-- MP Recovered while healing +4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5550); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_MPP, 3); + target:addMod(MOD_FOOD_MP_CAP, 13); + target:addMod(MOD_HP, 8); + target:addMod(MOD_INT, 2); + target:addMod(MOD_HPHEAL, 1); + target:addMod(MOD_MPHEAL, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_MPP, 3); + target:delMod(MOD_FOOD_MP_CAP, 13); + target:delMod(MOD_HP, 8); + target:delMod(MOD_INT, 2); + target:delMod(MOD_HPHEAL, 1); + target:delMod(MOD_MPHEAL, 4); +end; Index: scripts/globals/items/roll_of_sylvan_excursion.lua =================================================================== --- scripts/globals/items/roll_of_sylvan_excursion.lua (revision 0) +++ scripts/globals/items/roll_of_sylvan_excursion.lua (working copy) @@ -0,0 +1,60 @@ +----------------------------------------- +-- ID: 5551 +-- Item: Roll of Sylvan Excursion +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10 +-- MP +3% Cap 15 +-- Intelligence +3 +-- HP Recovered while healing +2 +-- MP Recovered while healing +5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5551); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_MPP, 3); + target:addMod(MOD_FOOD_MP_CAP, 15); + target:addMod(MOD_HP, 10); + target:addMod(MOD_INT, 3); + target:addMod(MOD_HPHEAL, 2); + target:addMod(MOD_MPHEAL, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_MPP, 3); + target:delMod(MOD_FOOD_MP_CAP, 15); + target:delMod(MOD_HP, 10); + target:delMod(MOD_INT, 3); + target:delMod(MOD_HPHEAL, 2); + target:delMod(MOD_MPHEAL, 5); +end; Index: scripts/globals/items/root_sabots.lua =================================================================== --- scripts/globals/items/root_sabots.lua (revision 0) +++ scripts/globals/items/root_sabots.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- ID: 15328 +-- Item: Root Sabots +-- Enchantment: Bind +-- Bind Effect: Adds "Regen" +-- Durration: 2 Mins +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + if (target:hasStatusEffect(EFFECT_BIND) == true) then + target:addStatusEffect(EFFECT_REGEN,2,1,120); + end + elseif (target:hasStatusEffect(EFFECT_BIND) == false) then + target:delStatusEffect(EFFECT_REGEN); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + duration = 120; + target:delStatusEffect(EFFECT_BIND); + target:addStatusEffect(EFFECT_BIND,1,0,duration); +end; \ No newline at end of file Index: scripts/globals/items/rouge_rice_ball.lua =================================================================== --- scripts/globals/items/rouge_rice_ball.lua (revision 0) +++ scripts/globals/items/rouge_rice_ball.lua (working copy) @@ -0,0 +1,73 @@ +----------------------------------------- +-- ID: 4604 +-- Item: Rouge Rice Ball +-- Food Effect: 30 Mins, All Races +----------------------------------------- +-- HP 12 +-- Vitality 3 +-- HP Regeneration While Healing +2 +-- Effect with enhancing equipment +-- DEF +50 +-- Beast Killer 5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,4604); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + pEquipMods = 0; + local hands = target:getEquipID(SLOT_HANDS); + local head = target:getEquipID(SLOT_HEAD); + local feet = target:getEquipID(SLOT_FEET); + target:addMod(MOD_HP, 12); + target:addMod(MOD_VIT, 3); + target:addMod(MOD_HPHEAL, 2); + + -- Equipment Bonus + if (head == 13949 or head == 13910) then -- Roshi Jinpachi & +1 + pEquipMods = pEquipMods + 1; + end + if (hands == 14901 or hands == 13972) then -- Myochin Kote & +1 + pEquipMods = pEquipMods + 1; + end + if (feet == 11367) then -- Nobushi Kyahan + pEquipMods = pEquipMods + 1; + end + target:addMod(MOD_DEF, (pEquipMods * 50)); + target:addMod(MOD_BEAST_KILLER, (pEquipMods * 5)); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 12); + target:delMod(MOD_VIT, 3); + target:delMod(MOD_HPHEAL, 2); + target:delMod(MOD_DEF, (pEquipMods * 50)); + target:delMod(MOD_BEAST_KILLER, (pEquipMods * 5)); +end; Index: scripts/globals/items/rounsey_wand.lua =================================================================== --- scripts/globals/items/rounsey_wand.lua (revision 0) +++ scripts/globals/items/rounsey_wand.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 18879 +-- Item: Rounsey Wand +-- Enchantment: "Teleport" (Chocobo Circuit) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:setPos(-94,0,-67,0,70); +end; \ No newline at end of file Index: scripts/globals/items/royal_omelette.lua =================================================================== --- scripts/globals/items/royal_omelette.lua (revision 3304) +++ scripts/globals/items/royal_omelette.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------------- -- ID: 4564 --- Item: royal_omelette --- Food Effect: 180Min, All Races +-- Item: Royal Omelette +-- Food Effect: 180 Mins, All Races ----------------------------------------- -- Strength 5 -- Dexterity 2 @@ -12,6 +12,19 @@ -- Ranged ATT % 22 -- Ranged ATT Cap 65 ----------------------------------------- +-- IF ELVAAN ONLY +-- HP 20 +-- MP 20 +-- Strength 6 +-- Dexterity 2 +-- Intelligence -2 +-- Mind 5 +-- Charisma 4 +-- Attack % 22 +-- Attack Cap 80 +-- Ranged ATT % 22 +-- Ranged ATT Cap 80 +----------------------------------------- require("scripts/globals/status"); @@ -40,14 +53,28 @@ ----------------------------------- function onEffectGain(target,effect) - target:addMod(MOD_STR, 5); - target:addMod(MOD_DEX, 2); - target:addMod(MOD_INT, -3); - target:addMod(MOD_MND, 4); - target:addMod(MOD_FOOD_ATTP, 22); - target:addMod(MOD_FOOD_ATT_CAP, 65); - target:addMod(MOD_FOOD_RATTP, 22); - target:addMod(MOD_FOOD_RATT_CAP, 65); + if (target:getRace() == 3 or target:getRace() == 4) then + target:addMod(MOD_HP, 20); + target:addMod(MOD_MP, 20); + target:addMod(MOD_STR, 6); + target:addMod(MOD_DEX, 2); + target:addMod(MOD_INT, -2); + target:addMod(MOD_MND, 5); + target:addMod(MOD_CHR, 4); + target:addMod(MOD_FOOD_ATTP, 22); + target:addMod(MOD_FOOD_ATT_CAP, 80); + target:addMod(MOD_FOOD_RATTP, 22); + target:addMod(MOD_FOOD_RATT_CAP, 80); + else + target:addMod(MOD_STR, 5); + target:addMod(MOD_DEX, 2); + target:addMod(MOD_INT, -3); + target:addMod(MOD_MND, 4); + target:addMod(MOD_FOOD_ATTP, 22); + target:addMod(MOD_FOOD_ATT_CAP, 65); + target:addMod(MOD_FOOD_RATTP, 22); + target:addMod(MOD_FOOD_RATT_CAP, 65); + end end; ----------------------------------------- @@ -55,12 +82,26 @@ ----------------------------------------- function onEffectLose(target,effect) - target:delMod(MOD_STR, 5); - target:delMod(MOD_DEX, 2); - target:delMod(MOD_INT, -3); - target:delMod(MOD_MND, 4); - target:delMod(MOD_FOOD_ATTP, 22); - target:delMod(MOD_FOOD_ATT_CAP, 65); - target:delMod(MOD_FOOD_RATTP, 22); - target:delMod(MOD_FOOD_RATT_CAP, 65); + if (target:getRace() == 3 or target:getRace() == 4) then + target:delMod(MOD_HP, 20); + target:delMod(MOD_MP, 20); + target:delMod(MOD_STR, 6); + target:delMod(MOD_DEX, 2); + target:delMod(MOD_INT, -2); + target:delMod(MOD_MND, 5); + target:delMod(MOD_CHR, 4); + target:delMod(MOD_FOOD_ATTP, 22); + target:delMod(MOD_FOOD_ATT_CAP, 80); + target:delMod(MOD_FOOD_RATTP, 22); + target:delMod(MOD_FOOD_RATT_CAP, 80); + else + target:delMod(MOD_STR, 5); + target:delMod(MOD_DEX, 2); + target:delMod(MOD_INT, -3); + target:delMod(MOD_MND, 4); + target:delMod(MOD_FOOD_ATTP, 22); + target:delMod(MOD_FOOD_ATT_CAP, 65); + target:delMod(MOD_FOOD_RATTP, 22); + target:delMod(MOD_FOOD_RATT_CAP, 65); + end end; Index: scripts/globals/items/runners_belt.lua =================================================================== --- scripts/globals/items/runners_belt.lua (revision 0) +++ scripts/globals/items/runners_belt.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 15865 +-- Item: Runners Belt +-- Enchantment: DEX 3 +-- Charges: 30 Reuse Delay: 5 Mins +-- Duration: 30 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,30,15865); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 3); +end; \ No newline at end of file Index: scripts/globals/items/rusty_bolt_case.lua =================================================================== --- scripts/globals/items/rusty_bolt_case.lua (revision 0) +++ scripts/globals/items/rusty_bolt_case.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 4197 +-- Rusty Bolt Case +-- When used, you will obtain 12 Rusty Bolts +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(17335,12); +end; \ No newline at end of file Index: scripts/globals/items/ruszor_quiver.lua =================================================================== --- scripts/globals/items/ruszor_quiver.lua (revision 0) +++ scripts/globals/items/ruszor_quiver.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5871 +-- Item: Ruszor Quiver +-- When used, you will obtain one stack of Ruszor Arrows +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(19182,99); +end; \ No newline at end of file Index: scripts/globals/items/sabong_earring.lua =================================================================== --- scripts/globals/items/sabong_earring.lua (revision 0) +++ scripts/globals/items/sabong_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 10299 +-- Item: Sabopng Earring +-- Item Effect: Pet Dbl Attack + 2% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_EAR1) == 10299 or target:getEquipID(SLOT_EAR2) == 10299) then + pet:addMod(MOD_DOUBLE_ATTACK, 2); + else + pet:delMod(MOD_DOUBLE_ATTACK, 2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/sacred_degen.lua =================================================================== --- scripts/globals/items/sacred_degen.lua (revision 0) +++ scripts/globals/items/sacred_degen.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 17683 +-- Item: Sacred Degen +-- Enchantment: "Enlight" +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENLIGHT; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/sacred_lance.lua =================================================================== --- scripts/globals/items/sacred_lance.lua (revision 3304) +++ scripts/globals/items/sacred_lance.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------------- --- ID: 14988 --- Stone Bangles --- Enchantment: "Enstone" +-- ID: 16858 +-- Item: Sacred Lance +-- Enchantment: "Enlight" ----------------------------------------- ----------------------------------------- Index: scripts/globals/items/sacred_mace.lua =================================================================== --- scripts/globals/items/sacred_mace.lua (revision 0) +++ scripts/globals/items/sacred_mace.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 18391 +-- Item: Sacred Mace +-- Enchantment: "Enlight" +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENLIGHT; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/sacred_maul.lua =================================================================== --- scripts/globals/items/sacred_maul.lua (revision 0) +++ scripts/globals/items/sacred_maul.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 18392 +-- Item: Sacred Maul +-- Enchantment: "Enlight" +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENLIGHT; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/sacred_sword.lua =================================================================== --- scripts/globals/items/sacred_sword.lua (revision 0) +++ scripts/globals/items/sacred_sword.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 17682 +-- Item: Sacred Sword +-- Enchantment: "Enlight" +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENLIGHT; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/sacred_wand.lua =================================================================== --- scripts/globals/items/sacred_wand.lua (revision 0) +++ scripts/globals/items/sacred_wand.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 18393 +-- Item: Sacred Wand +-- Enchantment: "Enlight" +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENLIGHT; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/safehold_earring.lua =================================================================== --- scripts/globals/items/safehold_earring.lua (revision 0) +++ scripts/globals/items/safehold_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16048 +-- Item: Safehold Earring +-- Enchantment: "Teleport" (Tavnzanian Safehold) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(26) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + safeholdEarring(target); +end; \ No newline at end of file Index: scripts/globals/items/sagacious_gold_obi.lua =================================================================== --- scripts/globals/items/sagacious_gold_obi.lua (revision 0) +++ scripts/globals/items/sagacious_gold_obi.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- ID: 15459 +-- Item: Sagacious Gold Obi +-- INT+3 +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + + if (target:hasStatusEffect(EFFECT_INT_BOOST) == true) then + result = 56; + end + + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_INT_BOOST,3,0,3000,15459); +end; \ No newline at end of file Index: scripts/globals/items/salmon_rice_ball.lua =================================================================== --- scripts/globals/items/salmon_rice_ball.lua (revision 0) +++ scripts/globals/items/salmon_rice_ball.lua (working copy) @@ -0,0 +1,79 @@ +----------------------------------------- +-- ID: 4590 +-- Item: Salmon Rice Ball +-- Food Effect: 30 Mins, All Races +----------------------------------------- +-- HP 25 +-- Dexterity 2 +-- Vitality 2 +-- Mind -1 +-- HP Regeneration While Healing +1 +-- Effect with enhancing equipment +-- DEF +40 +-- ATK +40 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,4590); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + pEquipMods = 0; + local hands = target:getEquipID(SLOT_HANDS); + local head = target:getEquipID(SLOT_HEAD); + local feet = target:getEquipID(SLOT_FEET); + target:addMod(MOD_HP, 25); + target:addMod(MOD_DEX, 2); + target:addMod(MOD_VIT, 2); + target:addMod(MOD_MND, -1); + target:addMod(MOD_HPHEAL, 1); + + -- Equipment Bonus + if (head == 13949 or head == 13910) then -- Roshi Jinpachi & +1 + pEquipMods = pEquipMods + 1; + end + if (hands == 14901 or hands == 13972) then -- Myochin Kote & +1 + pEquipMods = pEquipMods + 1; + end + if (feet == 11367) then -- Nobushi Kyahan + pEquipMods = pEquipMods + 1; + end + target:addMod(MOD_DEF, (pEquipMods * 40)); + target:addMod(MOD_ATT, (pEquipMods * 40)); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 25); + target:delMod(MOD_DEX, 2); + target:delMod(MOD_VIT, 2); + target:delMod(MOD_MND, -1); + target:delMod(MOD_HPHEAL, 1); + target:delMod(MOD_DEF, (pEquipMods * 40)); + target:delMod(MOD_ATT, (pEquipMods * 40)); +end; Index: scripts/globals/items/sanation_ring.lua =================================================================== --- scripts/globals/items/sanation_ring.lua (revision 0) +++ scripts/globals/items/sanation_ring.lua (working copy) @@ -0,0 +1,39 @@ +----------------------------------------- +-- ID: 14677 +-- Sanation Ring +-- Enchantment: MP while healing +3 +-- Uses: 20 Duration: 3 Mins +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,180,14677); + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MPHEAL, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MPHEAL, 3); +end; \ No newline at end of file Index: scripts/globals/items/sandfish.lua =================================================================== --- scripts/globals/items/sandfish.lua (revision 3304) +++ scripts/globals/items/sandfish.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/sapara_of_trials.lua =================================================================== --- scripts/globals/items/sapara_of_trials.lua (revision 0) +++ scripts/globals/items/sapara_of_trials.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 17654 +-- Equip: Sapara of Trials +-- Latent effect is active while less then 300 weapon skills have been preformed on EP+ Mobs using this weapon. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target,prevsjob) + + mainEquip = target:getEquipID(SLOT_MAIN); + + if (mainEquip == 17654) then + if (target:getVar("WSNMHits") < 300) then + target:addMod(MOD_HP, 20); + target:addMod(MOD_FIREDEF, 10); + target:addMod(MOD_WINDDEF, 10); + else + target:delMod(MOD_HP, 20); + target:delMod(MOD_FIREDEF, 10); + target:delMod(MOD_WINDDEF, 10); + end + end + +end; \ No newline at end of file Index: scripts/globals/items/sazanbaligi.lua =================================================================== --- scripts/globals/items/sazanbaligi.lua (revision 0) +++ scripts/globals/items/sazanbaligi.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5459 +-- Item: Sazanbaligi +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 4 +-- Mind -6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5459); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 4); + target:addMod(MOD_MND, -6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 4); + target:delMod(MOD_MND, -6); +end; Index: scripts/globals/items/scapegoat.lua =================================================================== --- scripts/globals/items/scapegoat.lua (revision 0) +++ scripts/globals/items/scapegoat.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 5412 +-- Item: Scapegoat +-- Effect: Brings you back from the dead~! +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + power = 1; + duration = 1800; + if(target:hasStatusEffect(EFFECT_RERAISE) ==true)then + effect = target:getStatusEffect(EFFECT_RERAISE); + oPower = effect:getPower(); + if(oPower > power) then + target:messageBasic(283); -- Higher Tiered verson means no effect! + else + target:delStatusEffect(EFFECT_RERAISE); + target:addStatusEffect(EFFECT_RERAISE,power,0,duration); + target:addStatusEffect(EFFECT_MEDICINE,0,0,3600,5412); + end + else + target:addStatusEffect(EFFECT_RERAISE,power,0,duration); + target:addStatusEffect(EFFECT_MEDICINE,0,0,3600,5412); + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; Index: scripts/globals/items/scroll_of_absorb-attri.lua =================================================================== --- scripts/globals/items/scroll_of_absorb-attri.lua (revision 0) +++ scripts/globals/items/scroll_of_absorb-attri.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4887 +-- Scroll of Absorb-Attri +-- Teaches the black magic Absorb-Attri +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(243); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(243); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_addle.lua =================================================================== --- scripts/globals/items/scroll_of_addle.lua (revision 0) +++ scripts/globals/items/scroll_of_addle.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4849 +-- Scroll of Aero +-- Teaches the white magic Addle +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(286); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(286); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_aerora.lua =================================================================== --- scripts/globals/items/scroll_of_aerora.lua (revision 0) +++ scripts/globals/items/scroll_of_aerora.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4920 +-- Scroll of Aerora +-- Teaches the black magic Aerora +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(832); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(832); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_aerora_ii.lua =================================================================== --- scripts/globals/items/scroll_of_aerora_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_aerora_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4921 +-- Scroll of Aerora II +-- Teaches the black magic Aerora II +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(833); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(833); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_arise.lua =================================================================== --- scripts/globals/items/scroll_of_arise.lua (revision 0) +++ scripts/globals/items/scroll_of_arise.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5101 +-- Scroll of Arise +-- Teaches the white magic Arise +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(494); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(494); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_blizzaja.lua =================================================================== --- scripts/globals/items/scroll_of_blizzaja.lua (revision 0) +++ scripts/globals/items/scroll_of_blizzaja.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4891 +-- Scroll of Blizzaja +-- Teaches the black magic Blizzaja +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(497); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(497); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_blizzara.lua =================================================================== --- scripts/globals/items/scroll_of_blizzara.lua (revision 0) +++ scripts/globals/items/scroll_of_blizzara.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4918 +-- Scroll of Blizzara +-- Teaches the black magic Blizzara +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(830); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(830); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_blizzara_ii.lua =================================================================== --- scripts/globals/items/scroll_of_blizzara_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_blizzara_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4919 +-- Scroll of Blizzara II +-- Teaches the black magic Blizzara II +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(831); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(831); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_boost-dex.lua =================================================================== --- scripts/globals/items/scroll_of_boost-dex.lua (revision 0) +++ scripts/globals/items/scroll_of_boost-dex.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5095 +-- Scroll of Boost-DEX +-- Teaches the white magic Boost-DEX +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(480); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(480); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_boost-int.lua =================================================================== --- scripts/globals/items/scroll_of_boost-int.lua (revision 0) +++ scripts/globals/items/scroll_of_boost-int.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5098 +-- Scroll of Boost-INT +-- Teaches the white magic Boost-INT +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(483); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(483); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_boost-str.lua =================================================================== --- scripts/globals/items/scroll_of_boost-str.lua (revision 0) +++ scripts/globals/items/scroll_of_boost-str.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5094 +-- Scroll of Boost-STR +-- Teaches the white magic Boost-STR +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(479); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(479); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_breakga.lua =================================================================== --- scripts/globals/items/scroll_of_breakga.lua (revision 0) +++ scripts/globals/items/scroll_of_breakga.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4889 +-- Scroll of Breakga +-- Teaches the black magic Breakga +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(365); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(365); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_comet.lua =================================================================== --- scripts/globals/items/scroll_of_comet.lua (revision 0) +++ scripts/globals/items/scroll_of_comet.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4827 +-- Scroll of Comet +-- Teaches the black magic Comet +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(219); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(219); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_cura_iii.lua =================================================================== --- scripts/globals/items/scroll_of_cura_iii.lua (revision 0) +++ scripts/globals/items/scroll_of_cura_iii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5083 +-- Scroll of Cura III +-- Teaches the white magic Cura III +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(475); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(475); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_curaga_v.lua =================================================================== --- scripts/globals/items/scroll_of_curaga_v.lua (revision 0) +++ scripts/globals/items/scroll_of_curaga_v.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4619 +-- Scroll of Curaga V +-- Teaches the white magic Curaga V +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(11); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(11); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_dark_carol_ii.lua =================================================================== --- scripts/globals/items/scroll_of_dark_carol_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_dark_carol_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5061 +-- Scroll of Dark Carol II +-- Teaches the song Dark Carol II +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(453); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(453); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_endark.lua =================================================================== --- scripts/globals/items/scroll_of_endark.lua (revision 3304) +++ scripts/globals/items/scroll_of_endark.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------------- -- ID: 4707 -- Scroll of Endark --- Teaches the white magic Endark +-- Teaches the black magic Endark ----------------------------------------- ----------------------------------------- Index: scripts/globals/items/scroll_of_fira.lua =================================================================== --- scripts/globals/items/scroll_of_fira.lua (revision 0) +++ scripts/globals/items/scroll_of_fira.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4916 +-- Scroll of Fira +-- Teaches the black magic Fira +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(828); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(828); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_fira_ii.lua =================================================================== --- scripts/globals/items/scroll_of_fira_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_fira_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4917 +-- Scroll of Fira II +-- Teaches the black magic Fira II +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(829); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(829); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_foil.lua =================================================================== --- scripts/globals/items/scroll_of_foil.lua (revision 0) +++ scripts/globals/items/scroll_of_foil.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5102 +-- Scroll of Foil +-- Teaches the white magic Foil +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(840); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(840); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_gain-dex.lua =================================================================== --- scripts/globals/items/scroll_of_gain-dex.lua (revision 0) +++ scripts/globals/items/scroll_of_gain-dex.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5088 +-- Scroll of Gain-DEX +-- Teaches the white magic Gain-DEX +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(487); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(487); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_gain-int.lua =================================================================== --- scripts/globals/items/scroll_of_gain-int.lua (revision 0) +++ scripts/globals/items/scroll_of_gain-int.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5091 +-- Scroll of Gain-INT +-- Teaches the white magic Gain-INT +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(490); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(490); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_gain-str.lua =================================================================== --- scripts/globals/items/scroll_of_gain-str.lua (revision 0) +++ scripts/globals/items/scroll_of_gain-str.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5087 +-- Scroll of Gain-STR +-- Teaches the white magic Gain-STR +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(486); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(486); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_gravity_ii.lua =================================================================== --- scripts/globals/items/scroll_of_gravity_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_gravity_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4825 +-- Scroll of Gravity II +-- Teaches the black magic Gravity II +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(217); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(217); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_holy_ii.lua =================================================================== --- scripts/globals/items/scroll_of_holy_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_holy_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4630 +-- Scroll of Holy +-- Teaches the white magic Holy +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(22); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(22); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_horde_lullaby_ii.lua =================================================================== --- scripts/globals/items/scroll_of_horde_lullaby_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_horde_lullaby_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4985 +-- Scroll of Horde Lullaby II +-- Teaches the song Horde Lullaby II +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(377); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(377); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_ice_carol_ii.lua =================================================================== --- scripts/globals/items/scroll_of_ice_carol_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_ice_carol_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5055 +-- Scroll of Ice Carol II +-- Teaches the song Ice Carol II +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(447); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(474); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_instant_protect.lua =================================================================== --- scripts/globals/items/scroll_of_instant_protect.lua (revision 0) +++ scripts/globals/items/scroll_of_instant_protect.lua (working copy) @@ -0,0 +1,34 @@ +----------------------------------------- +-- ID: 5988 +-- Scroll of Instant Protect +-- Grants the user the effect of Protect magic +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local power = 15; + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 2; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 2; + end + + if(target:addStatusEffect(EFFECT_PROTECT, power, 0, 1800)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_instant_retrace.lua =================================================================== --- scripts/globals/items/scroll_of_instant_retrace.lua (revision 0) +++ scripts/globals/items/scroll_of_instant_retrace.lua (working copy) @@ -0,0 +1,32 @@ +----------------------------------------- +-- ID: 5428 +-- Item: Scroll of Instant Retrace +-- Description: "Retrace" (Nation) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + nation = target:getNation(); -- 0 = San d'Oria; 1 = Bastok; 2 = Windurst; + if (nation == 0) then + target:setPos(-98, 1, -41, 224, 0x50); + elseif (nation == 1) then + target:setPos(-291, -10, -107, 212, 0x57); + elseif (nation == 2) then + target:setPos(-31.442, -5, 129.202, 128, 0x5E); + end +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_instant_shell.lua =================================================================== --- scripts/globals/items/scroll_of_instant_shell.lua (revision 0) +++ scripts/globals/items/scroll_of_instant_shell.lua (working copy) @@ -0,0 +1,34 @@ +----------------------------------------- +-- ID: 5989 +-- Scroll of Instant Shell +-- Grants the user the effect of Shell magic +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local power = 24; + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 5; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 5; + end + + if(target:addStatusEffect(EFFECT_SHELL, power, 0, 1800)) then + target:messageBasic(205); + else + target:messageBasic(423); -- no effect + end +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_instant_stoneskin.lua =================================================================== --- scripts/globals/items/scroll_of_instant_stoneskin.lua (revision 0) +++ scripts/globals/items/scroll_of_instant_stoneskin.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5990 +-- Scroll of Instant Stoneskin +-- Grants the user the effect of Shell magic +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + + local pAbs = 350; + local pEquipMods = 0; + local duration = 300; + + -- equipment mods + if (target:getEquipID(SLOT_NECK) == 13177) then -- Stone Gorget + pEquipMods = pEquipMods + 30; + end + if (target:getEquipID(SLOT_HANDS) == 15034) then -- Stone Mufflers + pEquipMods = pEquipMods + 30; + end + if (target:getEquipID(SLOT_WAIST) == 15960) then -- Siegel Sash + pEquipMods = pEquipMods + 20; + end + if (target:getEquipID(SLOT_LEGS) == 11949) then -- Haven Hose + pEquipMods = pEquipMods + 20; + end + if (target:getEquipID(SLOT_LEGS) == 10329) then -- Shedir Seraweels + pEquipMods = pEquipMods + 35; + end + if (target:getEquipID(SLOT_LEGS) == 11037) then -- Earthcry Earring + pEquipMods = pEquipMods + 10; + end + + local final = pAbs + pEquipMods; + + target:addStatusEffect(EFFECT_STONESKIN,final,0,duration); + return EFFECT_STONESKIN; +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_kakka_ichi.lua =================================================================== --- scripts/globals/items/scroll_of_kakka_ichi.lua (revision 0) +++ scripts/globals/items/scroll_of_kakka_ichi.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4968 +-- Scroll of Kakka: Ichi +-- Teaches the ninjutsu Kakka: Ichi +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(509); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(509); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_light_carol_ii.lua =================================================================== --- scripts/globals/items/scroll_of_light_carol_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_light_carol_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5060 +-- Scroll of Light Carol II +-- Teaches the song Light Carol II +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(452); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(452); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_lightning_carol_ii.lua =================================================================== --- scripts/globals/items/scroll_of_lightning_carol_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_lightning_carol_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5058 +-- Scroll of Lightning Carol II +-- Teaches the song Lightning Carol II +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(450); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(450); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_meteor.lua =================================================================== --- scripts/globals/items/scroll_of_meteor.lua (revision 0) +++ scripts/globals/items/scroll_of_meteor.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4851 +-- Scroll of Meteor +-- Teaches the black magic Meteor +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(218); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(218); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_pining_nocturne.lua =================================================================== --- scripts/globals/items/scroll_of_pining_nocturne.lua (revision 0) +++ scripts/globals/items/scroll_of_pining_nocturne.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5080 +-- Scroll of Pining Nocturne +-- Teaches the song Pining Nocturne +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(472); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(472); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_regen_v.lua =================================================================== --- scripts/globals/items/scroll_of_regen_v.lua (revision 0) +++ scripts/globals/items/scroll_of_regen_v.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 5086 +-- Scroll of Regen V +-- Teaches the white magic Regen IV +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(504); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(504); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_stonera.lua =================================================================== --- scripts/globals/items/scroll_of_stonera.lua (revision 0) +++ scripts/globals/items/scroll_of_stonera.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4922 +-- Scroll of Stonera +-- Teaches the black magic Stonera +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(834); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(834); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_stonera_ii.lua =================================================================== --- scripts/globals/items/scroll_of_stonera_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_stonera_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4923 +-- Scroll of Stonera II +-- Teaches the black magic Stonera II +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(835); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(835); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_temper.lua =================================================================== --- scripts/globals/items/scroll_of_temper.lua (revision 0) +++ scripts/globals/items/scroll_of_temper.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4705 +-- Scroll of Temper +-- Teaches the white magic Temper +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(493); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(493); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_thundaja.lua =================================================================== --- scripts/globals/items/scroll_of_thundaja.lua (revision 0) +++ scripts/globals/items/scroll_of_thundaja.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4894 +-- Scroll of Thundaja +-- Teaches the black magic Thundaja +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(500); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(500); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_thundara.lua =================================================================== --- scripts/globals/items/scroll_of_thundara.lua (revision 0) +++ scripts/globals/items/scroll_of_thundara.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4924 +-- Scroll of Thundara +-- Teaches the black magic Thundara +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(836); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(836); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_thundara_ii.lua =================================================================== --- scripts/globals/items/scroll_of_thundara_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_thundara_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4925 +-- Scroll of Thundara II +-- Teaches the black magic Thundara II +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(837); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(837); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_thunder_v.lua =================================================================== --- scripts/globals/items/scroll_of_thunder_v.lua (revision 0) +++ scripts/globals/items/scroll_of_thunder_v.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4776 +-- Scroll of Thunder V +-- Teaches the black magic Thunder V +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(168); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(168); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_watera.lua =================================================================== --- scripts/globals/items/scroll_of_watera.lua (revision 0) +++ scripts/globals/items/scroll_of_watera.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4926 +-- Scroll of Watera +-- Teaches the black magic Watera +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(838); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(838); +end; \ No newline at end of file Index: scripts/globals/items/scroll_of_watera_ii.lua =================================================================== --- scripts/globals/items/scroll_of_watera_ii.lua (revision 0) +++ scripts/globals/items/scroll_of_watera_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- ID: 4927 +-- Scroll of Watera II +-- Teaches the black magic Watera II +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canLearnSpell(839); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addSpell(839); +end; \ No newline at end of file Index: scripts/globals/items/scythe_of_trials.lua =================================================================== --- scripts/globals/items/scythe_of_trials.lua (revision 0) +++ scripts/globals/items/scythe_of_trials.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16793 +-- Equip: Scythe of Trials +-- Latent effect is active while less then 300 weapon skills have been preformed on EP+ Mobs using this weapon. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target,prevsjob) + + mainEquip = target:getEquipID(SLOT_MAIN); + + if (mainEquip == 16793) then + if (target:getVar("WSNMHits") < 300) then + target:addMod(MOD_HP, 20); + target:addMod(MOD_THUNDERDEF, 10); + target:addMod(MOD_LIGHTDEF, 10); + else + target:delMod(MOD_HP, 20); + target:delMod(MOD_THUNDERDEF, 10); + target:delMod(MOD_LIGHTDEF, 10); + end + end + +end; \ No newline at end of file Index: scripts/globals/items/seafood_stewpot.lua =================================================================== --- scripts/globals/items/seafood_stewpot.lua (revision 0) +++ scripts/globals/items/seafood_stewpot.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 5238 +-- Item: Seafood Stewpot +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10% Cap 50 +-- MP +10 +-- Accuracy 5 +-- Evasion 5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5238); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_HPP, 10); + target:addMod(MOD_FOOD_HP_CAP, 50); + target:addMod(MOD_MP, 10); + target:addMod(MOD_ACC, 5); + target:addMod(MOD_EVA, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_HPP, 10); + target:delMod(MOD_FOOD_HP_CAP, 50); + target:delMod(MOD_MP, 10); + target:delMod(MOD_ACC, 5); + target:delMod(MOD_EVA, 5); +end; Index: scripts/globals/items/selbina_earring.lua =================================================================== --- scripts/globals/items/selbina_earring.lua (revision 0) +++ scripts/globals/items/selbina_earring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16043 +-- Item: Selbina Earring +-- Enchantment: "Teleport" (Tavnzanian Safehold) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:isZoneVisited(248) == false) then + result = 56; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + selbinaEarring(target); +end; \ No newline at end of file Index: scripts/globals/items/serving_of_black_pudding.lua =================================================================== --- scripts/globals/items/serving_of_black_pudding.lua (revision 0) +++ scripts/globals/items/serving_of_black_pudding.lua (working copy) @@ -0,0 +1,60 @@ +----------------------------------------- +-- ID: 5552 +-- Item: Serving of Black Pudding +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +8 +-- MP +5% Cap 25 +-- Intelligence +4 +-- HP Recovered while healing +1 +-- MP Recovered while healing +1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5552); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_MPP, 5); + target:addMod(MOD_FOOD_MP_CAP, 25); + target:addMod(MOD_HP, 8); + target:addMod(MOD_INT, 4); + target:addMod(MOD_HPHEAL, 1); + target:addMod(MOD_MPHEAL, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_MPP, 5); + target:delMod(MOD_FOOD_MP_CAP, 25); + target:delMod(MOD_HP, 8); + target:delMod(MOD_INT, 4); + target:delMod(MOD_HPHEAL, 1); + target:delMod(MOD_MPHEAL, 1); +end; Index: scripts/globals/items/serving_of_dusky_indulgence.lua =================================================================== --- scripts/globals/items/serving_of_dusky_indulgence.lua (revision 0) +++ scripts/globals/items/serving_of_dusky_indulgence.lua (working copy) @@ -0,0 +1,60 @@ +----------------------------------------- +-- ID: 5553 +-- Item: Serving of Dusky Indulgence +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10 +-- MP +5% Cap 30 +-- Intelligence +5 +-- HP Recovered while healing +2 +-- MP Recovered while healing +2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5553); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_FOOD_MPP, 5); + target:addMod(MOD_FOOD_MP_CAP, 30); + target:addMod(MOD_HP, 10); + target:addMod(MOD_INT, 5); + target:addMod(MOD_HPHEAL, 2); + target:addMod(MOD_MPHEAL, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_FOOD_MPP, 5); + target:delMod(MOD_FOOD_MP_CAP, 30); + target:delMod(MOD_HP, 10); + target:delMod(MOD_INT, 5); + target:delMod(MOD_HPHEAL, 2); + target:delMod(MOD_MPHEAL, 2); +end; Index: scripts/globals/items/serving_of_elysian_eclair.lua =================================================================== --- scripts/globals/items/serving_of_elysian_eclair.lua (revision 0) +++ scripts/globals/items/serving_of_elysian_eclair.lua (working copy) @@ -0,0 +1,58 @@ +----------------------------------------- +-- ID: 5560 +-- Item: Serving of Elysian Eclair +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10 +-- MP +15 +-- Intelligence +2 +-- HP Recoverd while healing 2 +-- MP Recovered while healing 2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5560); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 10); + target:addMod(MOD_MP, 15); + target:addMod(MOD_INT, 2); + target:addMod(MOD_HPHEAL, 2); + target:addMod(MOD_MPHEAL, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 10); + target:delMod(MOD_MP, 15); + target:delMod(MOD_INT, 2); + target:delMod(MOD_HPHEAL, 2); + target:delMod(MOD_MPHEAL, 2); +end; Index: scripts/globals/items/serving_of_golden_royale.lua =================================================================== --- scripts/globals/items/serving_of_golden_royale.lua (revision 0) +++ scripts/globals/items/serving_of_golden_royale.lua (working copy) @@ -0,0 +1,58 @@ +----------------------------------------- +-- ID: 5558 +-- Item: Serving of Golden Royale +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +10 +-- MP +10 +-- Intelligence +2 +-- HP Recoverd while healing 2 +-- MP Recovered while healing 2 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5558); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 10); + target:addMod(MOD_MP, 10); + target:addMod(MOD_INT, 2); + target:addMod(MOD_HPHEAL, 2); + target:addMod(MOD_MPHEAL, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 10); + target:delMod(MOD_MP, 10); + target:delMod(MOD_INT, 2); + target:delMod(MOD_HPHEAL, 2); + target:delMod(MOD_MPHEAL, 2); +end; Index: scripts/globals/items/serving_of_mille_feuille.lua =================================================================== --- scripts/globals/items/serving_of_mille_feuille.lua (revision 0) +++ scripts/globals/items/serving_of_mille_feuille.lua (working copy) @@ -0,0 +1,58 @@ +----------------------------------------- +-- ID: 5559 +-- Item: Serving of Mille Feuille +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +8 +-- MP +15 +-- Intelligence +1 +-- HP Recoverd while healing 1 +-- MP Recovered while healing 1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5559); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 8); + target:addMod(MOD_MP, 15); + target:addMod(MOD_INT, 1); + target:addMod(MOD_HPHEAL, 1); + target:addMod(MOD_MPHEAL, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 8); + target:delMod(MOD_MP, 15); + target:delMod(MOD_INT, 1); + target:delMod(MOD_HPHEAL, 1); + target:delMod(MOD_MPHEAL, 1); +end; Index: scripts/globals/items/serving_of_mont_blanc.lua =================================================================== --- scripts/globals/items/serving_of_mont_blanc.lua (revision 0) +++ scripts/globals/items/serving_of_mont_blanc.lua (working copy) @@ -0,0 +1,58 @@ +----------------------------------------- +-- ID: 5557 +-- Item: Serving of Mont Blanc +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP +8 +-- MP +10 +-- Intelligence +1 +-- HP Recoverd while healing 1 +-- MP Recovered while healing 1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5557); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 8); + target:addMod(MOD_MP, 10); + target:addMod(MOD_INT, 1); + target:addMod(MOD_HPHEAL, 1); + target:addMod(MOD_MPHEAL, 1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 8); + target:delMod(MOD_MP, 10); + target:delMod(MOD_INT, 1); + target:delMod(MOD_HPHEAL, 1); + target:delMod(MOD_MPHEAL, 1); +end; Index: scripts/globals/items/serving_of_patriarch_sautee.lua =================================================================== --- scripts/globals/items/serving_of_patriarch_sautee.lua (revision 0) +++ scripts/globals/items/serving_of_patriarch_sautee.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 5677 +-- Item: Serving of Patriarch Sautee +-- Food Effect: 4Hrs, All Races +----------------------------------------- +-- MP 60 +-- Mind 7 +-- MP Recovered While Healing 7 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5677); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MP, 60); + target:addMod(MOD_MND, 7); + target:addMod(MOD_MPHEAL, 7); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MP, 60); + target:delMod(MOD_MND, 7); + target:delMod(MOD_MPHEAL, 7); +end; Index: scripts/globals/items/serving_of_royal_jelly.lua =================================================================== --- scripts/globals/items/serving_of_royal_jelly.lua (revision 0) +++ scripts/globals/items/serving_of_royal_jelly.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 4508 +-- Item: Serving of Royal Jelly +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- MP Recovery while healing 3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,4508); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MPHEAL, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MPHEAL, 3); +end; Index: scripts/globals/items/shall_shell.lua =================================================================== --- scripts/globals/items/shall_shell.lua (revision 3304) +++ scripts/globals/items/shall_shell.lua (working copy) @@ -18,7 +18,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/shaolin_belt.lua =================================================================== --- scripts/globals/items/shaolin_belt.lua (revision 0) +++ scripts/globals/items/shaolin_belt.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11734 +-- Item: Shaolin Belt +-- Item Effect: Automation: Haste +3% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_WAIST) == 11734) then + pet:addMod(MOD_HASTE_GEAR, 31); + else + pet:delMod(MOD_HASTE_GEAR, 31); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/shell_scepter.lua =================================================================== --- scripts/globals/items/shell_scepter.lua (revision 0) +++ scripts/globals/items/shell_scepter.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 17031 +-- Shell Scepter +-- Enchantment: 60Min, Costume - Random Crab +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,(math.random(356,357)),0,3600); +end; \ No newline at end of file Index: scripts/globals/items/shining_trout.lua =================================================================== --- scripts/globals/items/shining_trout.lua (revision 3304) +++ scripts/globals/items/shining_trout.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/shogun_rice_ball.lua =================================================================== --- scripts/globals/items/shogun_rice_ball.lua (revision 0) +++ scripts/globals/items/shogun_rice_ball.lua (working copy) @@ -0,0 +1,79 @@ +----------------------------------------- +-- ID: 4278 +-- Item: Shogun Rice Ball +-- Food Effect: 60 Minutes, All Races +----------------------------------------- +-- HP 20 +-- Vitality 4 +-- Dexterity 4 +-- Charisma 4 +-- Effect with enhancing equipment +-- DBL ATK +5* +-- Attack +50* +-- Defense +30* +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,4278); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + pEquipMods = 0; + local hands = target:getEquipID(SLOT_HANDS); + local head = target:getEquipID(SLOT_HEAD); + local feet = target:getEquipID(SLOT_FEET); + target:addMod(MOD_HP, 20); + target:addMod(MOD_VIT, 4); + target:addMod(MOD_DEX, 4); + target:addMod(MOD_CHR, 4); + + -- Equipment Bonus + if (head == 13949 or head == 13910) then -- Roshi Jinpachi & +1 + pEquipMods = pEquipMods + 1; + end + if (hands == 14901 or hands == 13972) then -- Myochin Kote & +1 + pEquipMods = pEquipMods + 1; + end + if (feet == 11367) then -- Nobushi Kyahan + pEquipMods = pEquipMods + 1; + end + target:addMod(MOD_DEF, (pEquipMods * 30)); + target:addMod(MOD_ATT, (pEquipMods * 50)); + target:addMod(MOD_DOUBLE_ATTACK, (pEquipMods * 5)); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 20); + target:delMod(MOD_VIT, 4); + target:delMod(MOD_DEX, 4); + target:delMod(MOD_CHR, 4); + target:delMod(MOD_DEF, (pEquipMods * 30)); + target:delMod(MOD_ATT, (pEquipMods * 50)); + target:delMod(MOD_DOUBLE_ATTACK, (pEquipMods * 5)); +end; Index: scripts/globals/items/silken_sash.lua =================================================================== --- scripts/globals/items/silken_sash.lua (revision 0) +++ scripts/globals/items/silken_sash.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5632 +-- Item: Silken Sash +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP Recovered while healing +3 +-- MP Recovered while healing +5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5632); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HPHEAL, 3); + target:addMod(MOD_MPHEAL, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HPHEAL, 3); + target:delMod(MOD_MPHEAL, 5); +end; Index: scripts/globals/items/silken_siesta.lua =================================================================== --- scripts/globals/items/silken_siesta.lua (revision 0) +++ scripts/globals/items/silken_siesta.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5626 +-- Item: Silken Siesta +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP Recoverd while healing 2 +-- MP Recovered while healing 5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5626); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HPHEAL, 2); + target:addMod(MOD_MPHEAL, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HPHEAL, 2); + target:delMod(MOD_MPHEAL, 5); +end; Index: scripts/globals/items/silken_smile.lua =================================================================== --- scripts/globals/items/silken_smile.lua (revision 0) +++ scripts/globals/items/silken_smile.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5628 +-- Item: Silken Smile +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- Intelligence 2 +-- MP Recovered while healing 7 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5628); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_INT, 2); + target:addMod(MOD_MPHEAL, 7); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_INT, 2); + target:delMod(MOD_MPHEAL, 7); +end; Index: scripts/globals/items/silken_spirit.lua =================================================================== --- scripts/globals/items/silken_spirit.lua (revision 0) +++ scripts/globals/items/silken_spirit.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5634 +-- Item: Silken Spirit +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- MP +3% +-- MP Recovered while healing +7 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5634); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MPP, 3); + target:addMod(MOD_MPHEAL, 7); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MPP, 3); + target:delMod(MOD_MPHEAL, 7); +end; Index: scripts/globals/items/silken_squeeze.lua =================================================================== --- scripts/globals/items/silken_squeeze.lua (revision 0) +++ scripts/globals/items/silken_squeeze.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5630 +-- Item: Silken Squeeze +-- Food Effect: 4 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- HP Recovered while healing +4 +-- MP Recovered while healing +5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,14400,5630); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HPHEAL, 4); + target:addMod(MOD_MPHEAL, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HPHEAL, 4); + target:delMod(MOD_MPHEAL, 5); +end; Index: scripts/globals/items/silkworm_egg.lua =================================================================== --- scripts/globals/items/silkworm_egg.lua (revision 0) +++ scripts/globals/items/silkworm_egg.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 4526 +-- Item: Silkworm Egg +-- Food Effect: 5 Mins, All Races +----------------------------------------- +-- HP 12 +-- MP 12 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,4526); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 12); + target:addMod(MOD_MP, 12); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 12); + target:delMod(MOD_MP, 12); +end; Index: scripts/globals/items/silver_shark.lua =================================================================== --- scripts/globals/items/silver_shark.lua (revision 3304) +++ scripts/globals/items/silver_shark.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/skadis_bazubands_+1.lua =================================================================== --- scripts/globals/items/skadis_bazubands_+1.lua (revision 0) +++ scripts/globals/items/skadis_bazubands_+1.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 27929 +-- Item: Skadi's Bazubands +1 +-- Item Effect: Pet Haste +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HANDS) == 27929) then + pet:addMod(MOD_HASTE_GEAR, 31); + else + pet:delMod(MOD_HASTE_GEAR, 31); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/skewer_of_m&p_chicken.lua =================================================================== --- scripts/globals/items/skewer_of_m&p_chicken.lua (revision 0) +++ scripts/globals/items/skewer_of_m&p_chicken.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5639 +-- Item: Skewer of M&P Chicken +-- Food Effect: 3Min, All Races +----------------------------------------- +-- Strength 5 +-- Intelligence -5 +-- Attack % 25 +-- Attack Cap 154 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,180,5639); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 5); + target:addMod(MOD_INT, -5); + target:addMod(MOD_FOOD_ATTP, 25); + target:addMod(MOD_FOOD_ATT_CAP, 154); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 5); + target:delMod(MOD_INT, -5); + target:delMod(MOD_FOOD_ATTP, 25); + target:delMod(MOD_FOOD_ATT_CAP, 154); +end; Index: scripts/globals/items/slab_of_ruszor_meat.lua =================================================================== --- scripts/globals/items/slab_of_ruszor_meat.lua (revision 0) +++ scripts/globals/items/slab_of_ruszor_meat.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5755 +-- Item: Slab of Ruszor Meat +-- Food Effect: 30Min, Galka only +----------------------------------------- +-- Strength 5 +-- Intelligence -7 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getRace() ~= 8) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,5755); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 5); + target:addMod(MOD_INT, -7); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 5); + target:delMod(MOD_INT, -7); +end; Index: scripts/globals/items/slice_of_buffalo_meat.lua =================================================================== --- scripts/globals/items/slice_of_buffalo_meat.lua (revision 3304) +++ scripts/globals/items/slice_of_buffalo_meat.lua (working copy) @@ -18,7 +18,11 @@ result = 0; if (target:getRace() ~= 8) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/slice_of_cerberus_meat.lua =================================================================== --- scripts/globals/items/slice_of_cerberus_meat.lua (revision 3304) +++ scripts/globals/items/slice_of_cerberus_meat.lua (working copy) @@ -17,6 +17,12 @@ function onItemCheck(target) result = 0; + if (target:getRace() ~= 8) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end Index: scripts/globals/items/slice_of_cockatrice_meat.lua =================================================================== --- scripts/globals/items/slice_of_cockatrice_meat.lua (revision 3304) +++ scripts/globals/items/slice_of_cockatrice_meat.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 8) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/slice_of_coeurl_meat.lua =================================================================== --- scripts/globals/items/slice_of_coeurl_meat.lua (revision 3304) +++ scripts/globals/items/slice_of_coeurl_meat.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 8) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/slice_of_dhalmel_meat.lua =================================================================== --- scripts/globals/items/slice_of_dhalmel_meat.lua (revision 3304) +++ scripts/globals/items/slice_of_dhalmel_meat.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 8) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/slice_of_diatryma_meat.lua =================================================================== --- scripts/globals/items/slice_of_diatryma_meat.lua (revision 0) +++ scripts/globals/items/slice_of_diatryma_meat.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5290 +-- Item: Slice of Diatryma Meat +-- Effect: 5 Minutes, food effect, Galka Only +----------------------------------------- +-- Strength +3 +-- Intelligence -5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getRace() ~= 8) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5290); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 3); + target:addMod(MOD_INT, -5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 3); + target:delMod(MOD_INT, -5); +end; \ No newline at end of file Index: scripts/globals/items/slice_of_dragon_meat.lua =================================================================== --- scripts/globals/items/slice_of_dragon_meat.lua (revision 3304) +++ scripts/globals/items/slice_of_dragon_meat.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 8) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/slice_of_giant_sheep_meat.lua =================================================================== --- scripts/globals/items/slice_of_giant_sheep_meat.lua (revision 3304) +++ scripts/globals/items/slice_of_giant_sheep_meat.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 8) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/slice_of_hare_meat.lua =================================================================== --- scripts/globals/items/slice_of_hare_meat.lua (revision 3304) +++ scripts/globals/items/slice_of_hare_meat.lua (working copy) @@ -17,7 +17,11 @@ result = 0; if (target:getRace() ~= 8) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/slice_of_karakul_meat.lua =================================================================== --- scripts/globals/items/slice_of_karakul_meat.lua (revision 0) +++ scripts/globals/items/slice_of_karakul_meat.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5571 +-- Item: Slice of Karakul Meat +-- Effect: 5 Minutes, food effect, Galka Only +----------------------------------------- +-- Strength +2 +-- Intelligence -4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getRace() ~= 8) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5571); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 2); + target:addMod(MOD_INT, -4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 2); + target:delMod(MOD_INT, -4); +end; \ No newline at end of file Index: scripts/globals/items/slice_of_land_crab_meat.lua =================================================================== --- scripts/globals/items/slice_of_land_crab_meat.lua (revision 3304) +++ scripts/globals/items/slice_of_land_crab_meat.lua (working copy) @@ -18,7 +18,11 @@ result = 0; if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/slice_of_tavnazian_ram_meat.lua =================================================================== --- scripts/globals/items/slice_of_tavnazian_ram_meat.lua (revision 3304) +++ scripts/globals/items/slice_of_tavnazian_ram_meat.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 8) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/slice_of_ziz_meat.lua =================================================================== --- scripts/globals/items/slice_of_ziz_meat.lua (revision 0) +++ scripts/globals/items/slice_of_ziz_meat.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5581 +-- Item: Slice of Ziz Meat +-- Effect: 5 Minutes, food effect, Galka Only +----------------------------------------- +-- Strength +4 +-- Intelligence -6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getRace() ~= 8) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5581); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 4); + target:addMod(MOD_INT,-6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 4); + target:delMod(MOD_INT,-6); +end; \ No newline at end of file Index: scripts/globals/items/slime_belt.lua =================================================================== --- scripts/globals/items/slime_belt.lua (revision 0) +++ scripts/globals/items/slime_belt.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 10851 +-- Slime Belt +-- Enchantment: 60Min, Costume - Slime +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,292,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/smash_cesti.lua =================================================================== --- scripts/globals/items/smash_cesti.lua (revision 0) +++ scripts/globals/items/smash_cesti.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 18747 +-- Item: Smash Cesti +-- Enchantment: Attack +3 +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,18747); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ATT, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ATT, 3); +end; + Index: scripts/globals/items/smilodon_liver.lua =================================================================== --- scripts/globals/items/smilodon_liver.lua (revision 0) +++ scripts/globals/items/smilodon_liver.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5668 +-- Item: Smilodon Liver +-- Food Effect: 5Min, Galka only +----------------------------------------- +-- Strength 5 +-- Intelligence -7 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getRace() ~= 8) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_MEAT) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5668); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 5); + target:addMod(MOD_INT, -7); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 5); + target:delMod(MOD_INT, -7); +end; Index: scripts/globals/items/sneaking_boots.lua =================================================================== --- scripts/globals/items/sneaking_boots.lua (revision 3304) +++ scripts/globals/items/sneaking_boots.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------------- -- ID: 15320 --- Powder Boots --- Enchantment: "Flee" +-- Item: Sneaking Boots +-- Enchantment: Sneak +-- Charges: 15 Recast: 60 Mins ----------------------------------------- ----------------------------------------- @@ -16,6 +17,8 @@ ----------------------------------------- function onItemUse(target) - target:delStatusEffect(EFFECT_SNEAK); - target:addStatusEffect(EFFECT_SNEAK,1,0,180); + local duration = 180; + duration = duration + (duration * target:getMod(MOD_SNEAK_DUR)); + target:delStatusEffect(EFFECT_SNEAK); + target:addStatusEffect(EFFECT_SNEAK,1,0,duration); end; Index: scripts/globals/items/snow_bunny_hat.lua =================================================================== --- scripts/globals/items/snow_bunny_hat.lua (revision 0) +++ scripts/globals/items/snow_bunny_hat.lua (working copy) @@ -0,0 +1,37 @@ +----------------------------------------- +-- ID: 11490 +-- Snow Bunny Hat +-- Enchantment: 60Min, Costume - White Rarab +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,270,0,3600); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------- +-- onEffectLose Action +----------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/snow_bunny_hat_+1.lua =================================================================== --- scripts/globals/items/snow_bunny_hat_+1.lua (revision 3304) +++ scripts/globals/items/snow_bunny_hat_+1.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------------- -- ID: 11491 -- Snow bunny Hat +1 --- Enchantment: 60Min, Costume - White Rarab +-- Enchantment: Costume - White Rarab +-- Durration: 60 Mins ----------------------------------------- require("scripts/globals/status"); @@ -20,4 +21,18 @@ function onItemUse(target) target:addStatusEffect(EFFECT_COSTUME,270,0,3600); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------- +-- onEffectLose Action +----------------------------------- + +function onEffectLose(target,effect) end; \ No newline at end of file Index: scripts/globals/items/snowman_cap.lua =================================================================== --- scripts/globals/items/snowman_cap.lua (revision 3304) +++ scripts/globals/items/snowman_cap.lua (working copy) @@ -19,5 +19,5 @@ ----------------------------------------- function onItemUse(target) - target:addStatusEffect(EFFECT_COSTUME,279,0,3600); + target:addStatusEffect(EFFECT_COSTUME,283,0,3600); end; \ No newline at end of file Index: scripts/globals/items/sobbing_fungus.lua =================================================================== --- scripts/globals/items/sobbing_fungus.lua (revision 0) +++ scripts/globals/items/sobbing_fungus.lua (working copy) @@ -0,0 +1,34 @@ +----------------------------------------- +-- ID: 4565 +-- Item: Sobbing Fungus +-- Food Effect: 3 Mins, All Races +----------------------------------------- +-- Silence +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,180,4565); + if(target:hasStatusEffect(EFFECT_SILENCE) == false) then + target:addStatusEffect(EFFECT_SILENCE,1,3,180); + else + target:messageBasic(423); + end +end; Index: scripts/globals/items/soulscourge.lua =================================================================== --- scripts/globals/items/soulscourge.lua (revision 0) +++ scripts/globals/items/soulscourge.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 17105 +-- Item: Soulscourge +-- Item Effect: Enhances Avatar Attack +10 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_MAIN) == 17105 or target:getEquipID(SLOT_SUB) == 17105) then + pet:addMod(MOD_ATT, 10); + else + pet:delMod(MOD_ATT, 10); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/spear_of_trials.lua =================================================================== --- scripts/globals/items/spear_of_trials.lua (revision 0) +++ scripts/globals/items/spear_of_trials.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16892 +-- Equip: Spear of Trials +-- Latent effect is active while less then 300 weapon skills have been preformed on EP+ Mobs using this weapon. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target,prevsjob) + + mainEquip = target:getEquipID(SLOT_MAIN); + + if (mainEquip == 16892) then + if (target:getVar("WSNMHits") < 300) then + target:addMod(MOD_HP, 20); + target:addMod(MOD_DARKDEF, 10); + target:addMod(MOD_WATERDEF, 10); + else + target:delMod(MOD_HP, 20); + target:delMod(MOD_DARKDEF, 10); + target:delMod(MOD_WATERDEF, 10); + end + end + +end; \ No newline at end of file Index: scripts/globals/items/spirit_lantern.lua =================================================================== --- scripts/globals/items/spirit_lantern.lua (revision 0) +++ scripts/globals/items/spirit_lantern.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 18240 +-- Item: Spirit Lantern +-- Enchantment: Elemental Magic Dmg +10% +-- Charges: 20 Reuse Delay: 30 Mins +-- Duration: 5 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,300,18240); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_ELEM_MAG_DMG, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_ELEM_MAG_DMG, 10); +end; \ No newline at end of file Index: scripts/globals/items/spirit_maul.lua =================================================================== --- scripts/globals/items/spirit_maul.lua (revision 0) +++ scripts/globals/items/spirit_maul.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 18853 +-- Item: Spirit Maul +-- Item Effect: TP +10 +-- Durration: Instant +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addTP(10); +end; Index: scripts/globals/items/spirit_sword.lua =================================================================== --- scripts/globals/items/spirit_sword.lua (revision 3304) +++ scripts/globals/items/spirit_sword.lua (working copy) @@ -1,7 +1,8 @@ ----------------------------------------- --- ID: 13682 --- Ether Tank --- When used, you will obtain one Ether +-- ID: 16613 +-- Item: Spirit Sword +-- Enchantment: TP +10 +-- Durration: Instant ----------------------------------------- ----------------------------------------- @@ -9,11 +10,8 @@ ----------------------------------------- function onItemCheck(target) -result = 0; - if (target:getFreeSlotsCount() == 0) then - result = 308; - end -return result; + result = 0; + return result; end; ----------------------------------------- Index: scripts/globals/items/sprinters_shoes.lua =================================================================== --- scripts/globals/items/sprinters_shoes.lua (revision 0) +++ scripts/globals/items/sprinters_shoes.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 15754 +-- Item: Sprinter's Shoes +-- Enchantment: Movement Speed +20 +-- Duration: 60 Mins Charges: 15 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,3600,15754); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MOVE, 20); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MOVE, 20); +end; \ No newline at end of file Index: scripts/globals/items/spurrer_beret.lua =================================================================== --- scripts/globals/items/spurrer_beret.lua (revision 0) +++ scripts/globals/items/spurrer_beret.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11497 +-- Item: Spurrer Beret +-- Item Effect: Pet Haste +5% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HEAD) == 11497) then + pet:addMod(MOD_HASTE_GEAR, 51); + else + pet:delMod(MOD_HASTE_GEAR, 51); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/stars_cap.lua =================================================================== --- scripts/globals/items/stars_cap.lua (revision 0) +++ scripts/globals/items/stars_cap.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15212 +-- Item: Stars Cap +-- Enchantment: "Teleport" (Ru'Lude Gardens) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck // TODO Check Ballista Points +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:isZoneVisited(243) == false) then + result = 56; + end + return result; +end; + +----------------------------------------- +-- OnItemUse // TODO Remove 1 Ballista Point +----------------------------------------- + +function onItemUse(target) + starsCap(target); +end; \ No newline at end of file Index: scripts/globals/items/strip_of_smoked_mackerel.lua =================================================================== --- scripts/globals/items/strip_of_smoked_mackerel.lua (revision 0) +++ scripts/globals/items/strip_of_smoked_mackerel.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5943 +-- Item: Strip of Smoked Mackerel +-- Food Effect: 30Min, All Races +----------------------------------------- +-- Agility 4 +-- Vitality -3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,5943); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_AGI, 4); + target:addMod(MOD_VIT, -3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_AGI, 4); + target:delMod(MOD_VIT, -3); +end; Index: scripts/globals/items/summoner_doublet.lua =================================================================== --- scripts/globals/items/summoner_doublet.lua (revision 0) +++ scripts/globals/items/summoner_doublet.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15101 +-- Item: Summoner Doublet +-- Item Effect: Avatar: Crit Hit Rate +3% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_BODY) == 15101) then + pet:addMod(MOD_CRITHITRATE, 3); + else + pet:delMod(MOD_CRITHITRATE, 3); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/summoner_doublet_+1.lua =================================================================== --- scripts/globals/items/summoner_doublet_+1.lua (revision 0) +++ scripts/globals/items/summoner_doublet_+1.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 14514 +-- Item: Summoner Doublet +1 +-- Item Effect: Avatar: Crit Hit Rate +4% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_BODY) == 14514) then + pet:addMod(MOD_CRITHITRATE, 4); + else + pet:delMod(MOD_CRITHITRATE, 4); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/summoners_pigaches.lua =================================================================== --- scripts/globals/items/summoners_pigaches.lua (revision 0) +++ scripts/globals/items/summoners_pigaches.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15146 +-- Item: Summoner's Pigaches +-- Item Effect: Avatar: Atk +2 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 15146) then + pet:addMod(MOD_ATT, 2); + else + pet:delMod(MOD_ATT, 2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/summoners_pigaches_+1.lua =================================================================== --- scripts/globals/items/summoners_pigaches_+1.lua (revision 0) +++ scripts/globals/items/summoners_pigaches_+1.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 15679 +-- Item: Summoner's Pigaches +1 +-- Item Effect: Avatar: Enmity +2 Atk +2 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 15679) then + pet:addMod(MOD_ENMITY, 2); + pet:addMod(MOD_ATT, 2); + else + pet:delMod(MOD_ENMITY, 2); + pet:delMod(MOD_ATT, 2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/summoners_pigaches_+2.lua =================================================================== --- scripts/globals/items/summoners_pigaches_+2.lua (revision 0) +++ scripts/globals/items/summoners_pigaches_+2.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 10744 +-- Item: Summoner's Pigaches +2 +-- Item Effect: Avatar: Atk +2 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 10744) then + pet:addMod(MOD_ATT, 2); + else + pet:delMod(MOD_ATT, 2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/summoners_spats_+1.lua =================================================================== --- scripts/globals/items/summoners_spats_+1.lua (revision 0) +++ scripts/globals/items/summoners_spats_+1.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 15594 +-- Item: Summoner's Spats +1 +-- Item Effect: Avatar Enmity +2 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_LEGS) == 15594) then + pet:addMod(MOD_ENMITY, 2); + else + pet:delMod(MOD_ENMITY, 2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/sword_of_trials.lua =================================================================== --- scripts/globals/items/sword_of_trials.lua (revision 0) +++ scripts/globals/items/sword_of_trials.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16952 +-- Equip: Sword of Trials +-- Latent effect is active while less then 300 weapon skills have been preformed on EP+ Mobs using this weapon. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target,prevsjob) + + mainEquip = target:getEquipID(SLOT_MAIN); + + if (mainEquip == 16952) then + if (target:getVar("WSNMHits") < 300) then + target:addMod(MOD_HP, 20); + target:addMod(MOD_EARTHDEF, 10); + target:addMod(MOD_ICEDEF, 10); + else + target:delMod(MOD_HP, 20); + target:delMod(MOD_EARTHDEF, 10); + target:delMod(MOD_ICEDEF, 10); + end + end + +end; \ No newline at end of file Index: scripts/globals/items/tachi_of_trials.lua =================================================================== --- scripts/globals/items/tachi_of_trials.lua (revision 0) +++ scripts/globals/items/tachi_of_trials.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 17815 +-- Equip: Tachi of Trials +-- Latent effect is active while less then 300 weapon skills have been preformed on EP+ Mobs using this weapon. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target,prevsjob) + + mainEquip = target:getEquipID(SLOT_MAIN); + + if (mainEquip == 17815) then + if (target:getVar("WSNMHits") < 300) then + target:addMod(MOD_HP, 20); + target:addMod(MOD_ICEDEF, 10); + target:addMod(MOD_DARKDEF, 10); + else + target:delMod(MOD_HP, 20); + target:delMod(MOD_ICEDEF, 10); + target:delMod(MOD_DARKDEF, 10); + end + end + +end; \ No newline at end of file Index: scripts/globals/items/tactical_ring.lua =================================================================== --- scripts/globals/items/tactical_ring.lua (revision 0) +++ scripts/globals/items/tactical_ring.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- ID: 14679 +-- Tactical Ring +-- Casts Regain. +-- Uses: 20 +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,180,14679); + end +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + if(target:hasStatusEffect(EFFECT_REGAIN) == false) then + target:addStatusEffect(EFFECT_REGAIN,3,1,180); + end +end; \ No newline at end of file Index: scripts/globals/items/talaria.lua =================================================================== --- scripts/globals/items/talaria.lua (revision 0) +++ scripts/globals/items/talaria.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- ID: 11403 +-- Item: Talaria +-- Enchantment: Increases movement speed. +-- Durration: 60 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,3600,11403); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MOVE, 15); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MOVE, 15); +end; \ No newline at end of file Index: scripts/globals/items/talisman_cape.lua =================================================================== --- scripts/globals/items/talisman_cape.lua (revision 0) +++ scripts/globals/items/talisman_cape.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 15485 +-- Item: Talisman Cape +-- Enchantment: HP +18 Eminity +3 +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,15485); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 18); + target:addMod(MOD_ENMITY, 3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 18); + target:delMod(MOD_ENMITY, 3); +end; \ No newline at end of file Index: scripts/globals/items/tathlum_belt.lua =================================================================== --- scripts/globals/items/tathlum_belt.lua (revision 0) +++ scripts/globals/items/tathlum_belt.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15296 +-- Tathlum Belt +-- When used, you will obtain 1 Stack of Tathlums +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(17298,99); +end; \ No newline at end of file Index: scripts/globals/items/tavnazian_goby.lua =================================================================== --- scripts/globals/items/tavnazian_goby.lua (revision 0) +++ scripts/globals/items/tavnazian_goby.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5130 +-- Item: Tavnazian Goby +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 4 +-- Mind -4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5130); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 4); + target:addMod(MOD_MND, -4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 4); + target:delMod(MOD_MND, -4); +end; Index: scripts/globals/items/tavnazian_sheep_liver.lua =================================================================== --- scripts/globals/items/tavnazian_sheep_liver.lua (revision 0) +++ scripts/globals/items/tavnazian_sheep_liver.lua (working copy) @@ -0,0 +1,50 @@ +----------------------------------------- +-- ID: 5154 +-- Item: Tavnazian Sheep Liver +-- Food Effect: 5Min, Galka only +----------------------------------------- +-- Strength 2 +-- Intelligence -4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getRace() ~= 8) then + result = 247; + elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5154); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_STR, 2); + target:addMod(MOD_INT, -4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_STR, 2); + target:delMod(MOD_INT, -4); +end; Index: scripts/globals/items/tavnzanian_ring.lua =================================================================== --- scripts/globals/items/tavnzanian_ring.lua (revision 0) +++ scripts/globals/items/tavnzanian_ring.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 16048 +-- Item: Tavnzanian Ring +-- Enchantment: "Teleport" (Tavnzanian Safehold) +----------------------------------------- + +require("scripts/globals/teleports"); +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:isZoneVisited(26) == false) then + result = 56; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + tavnzanianRing(target); +end; \ No newline at end of file Index: scripts/globals/items/temple_knights_quiver.lua =================================================================== --- scripts/globals/items/temple_knights_quiver.lua (revision 0) +++ scripts/globals/items/temple_knights_quiver.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 15956 +-- Temple Knight Quiver +-- When used, you will obtain 1 Temple Knight Arrow +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(18738,1); +end; \ No newline at end of file Index: scripts/globals/items/thunder_card_case.lua =================================================================== --- scripts/globals/items/thunder_card_case.lua (revision 0) +++ scripts/globals/items/thunder_card_case.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5406 +-- Item: Thunder Card Case +-- Effect: When used, you will obtain one stack of Thunder Cards +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(2180,99); +end; \ No newline at end of file Index: scripts/globals/items/tiger_cod.lua =================================================================== --- scripts/globals/items/tiger_cod.lua (revision 3304) +++ scripts/globals/items/tiger_cod.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/tiny_goldfish.lua =================================================================== --- scripts/globals/items/tiny_goldfish.lua (revision 3304) +++ scripts/globals/items/tiny_goldfish.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/tonosama_rice_ball.lua =================================================================== --- scripts/globals/items/tonosama_rice_ball.lua (revision 0) +++ scripts/globals/items/tonosama_rice_ball.lua (working copy) @@ -0,0 +1,79 @@ +----------------------------------------- +-- ID: 4277 +-- Item: Tonosama Rice Ball +-- Food Effect: 30 Minutes, All Races +----------------------------------------- +-- HP 15 +-- Vitality 3 +-- Dexterity 3 +-- Charisma +3 +-- Effect with enhancing equipment +-- DBL ATK +1* +-- Attack +50* +-- Defense +30* +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,4277); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + pEquipMods = 0; + local hands = target:getEquipID(SLOT_HANDS); + local head = target:getEquipID(SLOT_HEAD); + local feet = target:getEquipID(SLOT_FEET); + target:addMod(MOD_HP, 15); + target:addMod(MOD_VIT, 3); + target:addMod(MOD_DEX, 3); + target:addMod(MOD_CHR, 3); + + -- Equipment Bonus + if (head == 13949 or head == 13910) then -- Roshi Jinpachi & +1 + pEquipMods = pEquipMods + 1; + end + if (hands == 14901 or hands == 13972) then -- Myochin Kote & +1 + pEquipMods = pEquipMods + 1; + end + if (feet == 11367) then -- Nobushi Kyahan + pEquipMods = pEquipMods + 1; + end + target:addMod(MOD_DEF, (pEquipMods * 30)); + target:addMod(MOD_ATT, (pEquipMods * 50)); + target:addMod(MOD_DOUBLE_ATTACK, (pEquipMods * 1)); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 15); + target:delMod(MOD_VIT, 3); + target:delMod(MOD_DEX, 3); + target:delMod(MOD_CHR, 3); + target:delMod(MOD_DEF, (pEquipMods * 30)); + target:delMod(MOD_ATT, (pEquipMods * 50)); + target:delMod(MOD_DOUBLE_ATTACK, (pEquipMods * 1)); +end; Index: scripts/globals/items/town_moogle_shield.lua =================================================================== --- scripts/globals/items/town_moogle_shield.lua (revision 3304) +++ scripts/globals/items/town_moogle_shield.lua (working copy) @@ -4,6 +4,7 @@ -- Enchantment: 60Min, Costume - Moogle ----------------------------------------- +require("scripts/globals/settings"); require("scripts/globals/status"); ----------------------------------------- Index: scripts/globals/items/trail_cookie.lua =================================================================== --- scripts/globals/items/trail_cookie.lua (revision 0) +++ scripts/globals/items/trail_cookie.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5940 +-- Item: Trail Cookie +-- Food Effect: 5Min, All Races +----------------------------------------- +-- Mind +4 +-- Charisma +4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5940); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_MPHEAL, 5); + target:addMod(MOD_AQUAN_KILLER, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_MPHEAL, 5); + target:delMod(MOD_AQUAN_KILLER, 5); +end; Index: scripts/globals/items/treat_staff.lua =================================================================== --- scripts/globals/items/treat_staff.lua (revision 0) +++ scripts/globals/items/treat_staff.lua (working copy) @@ -0,0 +1,24 @@ +----------------------------------------- +-- ID: 17566 +-- Treat Staff +-- Transports the user to their Home Point +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:warp(); +end; \ No newline at end of file Index: scripts/globals/items/treat_staff_ii.lua =================================================================== --- scripts/globals/items/treat_staff_ii.lua (revision 3304) +++ scripts/globals/items/treat_staff_ii.lua (working copy) @@ -1,21 +1,24 @@ ------------------------------------------ --- ID: 17588 --- Treat staff II --- Transports the user to their Home Point ------------------------------------------ - ------------------------------------------ --- OnItemCheck ------------------------------------------ - -function onItemCheck(target) - return 0; -end; - ------------------------------------------ --- OnItemUse ------------------------------------------ - -function onItemUse(target) - target:warp(); +----------------------------------------- +-- ID: 17588 +-- Treat Staff II +-- Transports the user to their Home Point +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:warp(); end; \ No newline at end of file Index: scripts/globals/items/trick_staff_ii.lua =================================================================== --- scripts/globals/items/trick_staff_ii.lua (revision 3304) +++ scripts/globals/items/trick_staff_ii.lua (working copy) @@ -1,21 +1,24 @@ ------------------------------------------ --- ID: 17587 --- Trick Staff II --- Transports the user to their Home Point ------------------------------------------ - ------------------------------------------ --- OnItemCheck ------------------------------------------ - -function onItemCheck(target) - return 0; -end; - ------------------------------------------ --- OnItemUse ------------------------------------------ - -function onItemUse(target) - target:warp(); +----------------------------------------- +-- ID: 17587 +-- Trick Staff II +-- Transports the user to their Home Point +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:warp(); end; \ No newline at end of file Index: scripts/globals/items/tricolored_carp.lua =================================================================== --- scripts/globals/items/tricolored_carp.lua (revision 3304) +++ scripts/globals/items/tricolored_carp.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/trilobite.lua =================================================================== --- scripts/globals/items/trilobite.lua (revision 0) +++ scripts/globals/items/trilobite.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 4317 +-- Item: Trilobite +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity -5 +-- Vitality 3 +-- Defense +16% +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,4317); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, -5); + target:addMod(MOD_VIT, 3); + target:addMod(MOD_DEFP, 16); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, -5); + target:delMod(MOD_VIT, 3); + target:delMod(MOD_DEFP, 16); +end; Index: scripts/globals/items/trollbane.lua =================================================================== --- scripts/globals/items/trollbane.lua (revision 0) +++ scripts/globals/items/trollbane.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 18694 +-- Item: Trollbane +-- Enchantment: Vit +10 +-- Duration: 60 Mins +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + target:getZone(); + result = 0; + if(zone ~= 54 or zone ~= 62 or zone ~= 65) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,3600,18694); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_VIT, 10); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_VIT, 10); +end; \ No newline at end of file Index: scripts/globals/items/tropical_clam.lua =================================================================== --- scripts/globals/items/tropical_clam.lua (revision 0) +++ scripts/globals/items/tropical_clam.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5124 +-- Item: Tropical Clam +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Vitality 4 +-- Dexterity -5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5124); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_VIT, 4); + target:addMod(MOD_DEX, -5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_VIT, 4); + target:delMod(MOD_DEX, -5); +end; Index: scripts/globals/items/trump_card_case.lua =================================================================== --- scripts/globals/items/trump_card_case.lua (revision 0) +++ scripts/globals/items/trump_card_case.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5870 +-- Item: Trump Card Case +-- Effect: When used, you will obtain one stack of Trump Cards +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(2974,99); +end; \ No newline at end of file Index: scripts/globals/items/trumpet_shell.lua =================================================================== --- scripts/globals/items/trumpet_shell.lua (revision 0) +++ scripts/globals/items/trumpet_shell.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5466 +-- Item: Trumpet Shell +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity -5 +-- Vitality 4 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5466); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, -5); + target:addMod(MOD_VIT, 4); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, -5); + target:delMod(MOD_VIT, 4); +end; Index: scripts/globals/items/tsurugitachi.lua =================================================================== --- scripts/globals/items/tsurugitachi.lua (revision 0) +++ scripts/globals/items/tsurugitachi.lua (working copy) @@ -0,0 +1,26 @@ +----------------------------------------- +-- ID: 18444 +-- Item: Tsurugitachi +-- Item Effect: TP +10 +-- Durration: Instant +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addTP(10); +end; Index: scripts/globals/items/tube_of_clear_salve_i.lua =================================================================== --- scripts/globals/items/tube_of_clear_salve_i.lua (revision 0) +++ scripts/globals/items/tube_of_clear_salve_i.lua (working copy) @@ -0,0 +1,50 @@ +----------------------------------------- +-- ID: 5837 +-- Item: Tube of Clear Salve I +-- Item Effect: Removes most status ailments from Pet +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:getObjType() ~= TYPE_PET) + result = 56; + end + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local effect = target:eraseStatusEffect(); + if(effect == EFFECT_NONE) then + target:messageBasic(423); -- no effect + else + target:eraseStatusEffect(); + end + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; Index: scripts/globals/items/tube_of_clear_salve_ii.lua =================================================================== --- scripts/globals/items/tube_of_clear_salve_ii.lua (revision 0) +++ scripts/globals/items/tube_of_clear_salve_ii.lua (working copy) @@ -0,0 +1,52 @@ +----------------------------------------- +-- ID: 5838 +-- Item: Tube of Clear Salve II +-- Item Effect: Removes most status ailments from Pet +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:getObjType() ~= TYPE_PET) + result = 56; + end + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + local effect = target:eraseStatusEffect(); + if(effect == EFFECT_NONE) then + target:messageBasic(423); -- no effect + else + while effect ~= EFFECT_NONE do + target:eraseStatusEffect(); + end; + end + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/tube_of_healing_salve_i.lua =================================================================== --- scripts/globals/items/tube_of_healing_salve_i.lua (revision 0) +++ scripts/globals/items/tube_of_healing_salve_i.lua (working copy) @@ -0,0 +1,53 @@ +----------------------------------------- +-- ID: 5835 +-- Item: Tube of Healing Salve I +-- Item Effect: Restores 50% HP to Pet +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + mHP = pet:getMaxHP(); + cHP = pet:getHP(); + rHP = mHP * .5; + if (mHP == cHP) then + result = 56; -- Does not let player use item if their pet's hp is full + end + if (target:getObjType() ~= TYPE_PET) + result = 56; + end + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); + target:addHP(rHP) + target:messageBasic(25,0,rHP); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/tube_of_healing_salve_ii.lua =================================================================== --- scripts/globals/items/tube_of_healing_salve_ii.lua (revision 0) +++ scripts/globals/items/tube_of_healing_salve_ii.lua (working copy) @@ -0,0 +1,53 @@ +----------------------------------------- +-- ID: 5836 +-- Item: Tube of Healing Salve II +-- Item Effect: Restores 100% HP to Pet +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + mHP = target:getMaxHP(); + cHP = target:getHP(); + rHP = mHP - cHP; + if (mHP == cHP) then + result = 56; -- Does not let player use item if their pet's hp is full + end + if (target:getObjType() ~= TYPE_PET) + result = 56; + end + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); + target:addHP(rHP) + target:messageBasic(25,0,rHP); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/twicer.lua =================================================================== --- scripts/globals/items/twicer.lua (revision 0) +++ scripts/globals/items/twicer.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- ID: 5584 +-- Item: Twicer +-- Enchantment: DBL Attack 90 +-- Charges: 20 Reuse Delay: 5 Mins +-- Duration: 30 Secs +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:addStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,30,5584); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DOUBLE_ATTACK, 90); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DOUBLE_ATTACK, 90); +end; \ No newline at end of file Index: scripts/globals/items/uskumru.lua =================================================================== --- scripts/globals/items/uskumru.lua (revision 0) +++ scripts/globals/items/uskumru.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- ID: 5452 +-- Item: Uskumru +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 3 +-- Mind -5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5452); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 3); + target:addMod(MOD_MND, -5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 3); + target:delMod(MOD_MND, -5); +end; Index: scripts/globals/items/variable_cape.lua =================================================================== --- scripts/globals/items/variable_cape.lua (revision 0) +++ scripts/globals/items/variable_cape.lua (working copy) @@ -0,0 +1,85 @@ +----------------------------------------- +-- ID: 13681 +-- Item: Variable Cape +-- Item Effect: Variable DEF and MP with Lvl +-- DEF +1 every 10 Lvls MP +2 every 5 Lvls +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local lvl = target:getMainLvl(); + local defMod = 0 + local mpMod = 0 + if (target:getEquipID(SLOT_BACK) == 13681) then + if(lvl >= 25) then + mpMod = mpMod + 2 + end + if(lvl >= 30) then + defMod = defMod + 1 + mpMod = mpMod + 2 + end + if(lvl >= 35) then + mpMod = mpMod + 2 + end + if(lvl >= 40) then + defMod = defMod + 1 + mpMod = mpMod + 2 + end + if(lvl >= 45) then + mpMod = mpMod + 2 + end + if(lvl >= 50) then + defMod = defMod + 1 + mpMod = mpMod + 2 + end + if(lvl >= 55) then + mpMod = mpMod + 2 + end + if(lvl >= 60) then + defMod = defMod + 1 + mpMod = mpMod + 2 + end + if(lvl >= 65) then + mpMod = mpMod + 2 + end + if(lvl >= 70) then + defMod = defMod + 1 + mpMod = mpMod + 2 + end + if(lvl >= 75) then + mpMod = mpMod + 2 + end + if(lvl >= 80) then + defMod = defMod + 1 + mpMod = mpMod + 2 + end + if(lvl >= 85) then + mpMod = mpMod + 2 + end + if(lvl >= 90) then + defMod = defMod + 1 + mpMod = mpMod + 2 + end + if(lvl >= 95) then + mpMod = mpMod + 2 + end + target:addMod(MOD_DEF, defMod); + target:addMod(MOD_MP, mpMod); + else + target:delMod(MOD_DEF, defMod); + target:delMod(MOD_MP, mpMod); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/variable_mantle.lua =================================================================== --- scripts/globals/items/variable_mantle.lua (revision 0) +++ scripts/globals/items/variable_mantle.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 13680 +-- Item: Variable Mantle +-- Item Effect: Variable DEF with Lvl +-- DEF +1 every 10 Lvls +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local lvl = target:getMainLvl(); + local defMod = 0 + if (target:getEquipID(SLOT_BACK) == 13680) then + if(lvl >= 30) then + defMod = defMod + 1 + end + if(lvl >= 40) then + defMod = defMod + 1 + end + if(lvl >= 50) then + defMod = defMod + 1 + end + if(lvl >= 60) then + defMod = defMod + 1 + end + if(lvl >= 70) then + defMod = defMod + 1 + end + if(lvl >= 80) then + defMod = defMod + 1 + end + if(lvl >= 90) then + defMod = defMod + 1 + end + target:addMod(MOD_DEF, defMod); + else + target:delMod(MOD_DEF, defMod); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/vial_of_drachenessence.lua =================================================================== --- scripts/globals/items/vial_of_drachenessence.lua (revision 0) +++ scripts/globals/items/vial_of_drachenessence.lua (working copy) @@ -0,0 +1,56 @@ +----------------------------------------- +-- ID: 5246 +-- Item: Vial of Drachenessence +-- Item Effect: Restores 25% HP to Wyvern Pet +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + mHP = target:getMaxHP(); + cHP = target:getHP(); + rHP = mHP * .25; + if (mHP == cHP) then + result = 56; -- Does not let player use item if their pet's hp is full + end + if (target:getObjType() ~= TYPE_PET) + result = 56; + end + if (!target:getPetType() == PETTYPE_WYVERN) then + result = 56; + end + if (target:hasStatusEffect(EFFECT_MEDICINE)) then + result = 111; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_MEDICINE,0,0,180); + target:addHP(rHP) + target:messageBasic(25,0,rHP); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) +end; \ No newline at end of file Index: scripts/globals/items/vision_ring.lua =================================================================== --- scripts/globals/items/vision_ring.lua (revision 0) +++ scripts/globals/items/vision_ring.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 15559 +-- Item: Vision Ring +-- Enchantment: Accuracy +2 Ranged Accuracy +2 +-- Durration: 30 Mins +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then + target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,1800,15559); + end; +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_RACC, 2); + target:addMod(MOD_ACC, 2); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_RACC, 2); + target:delMod(MOD_ACC, 2); +end; \ No newline at end of file Index: scripts/globals/items/vongola_clam.lua =================================================================== --- scripts/globals/items/vongola_clam.lua (revision 0) +++ scripts/globals/items/vongola_clam.lua (working copy) @@ -0,0 +1,64 @@ +----------------------------------------- +-- ID: 5131 +-- Item: Vongola Clam +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity -5 +-- Vitality 4 +-- Defense +17% - 50 Cap +-- HP 5% - 50 Cap +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5131); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, -5); + target:addMod(MOD_VIT, 4); + target:addMod(MOD_FOOD_DEFP, 17); + target:addMod(MOD_FOOD_DEF_CAP, 50); + target:addMod(MOD_FOOD_HPP, 5); + target:addMod(MOD_FOOD_HP_CAP, 50); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, -5); + target:delMod(MOD_VIT, 4); + target:delMod(MOD_FOOD_DEFP, 17); + target:delMod(MOD_FOOD_DEF_CAP, 50); + target:delMod(MOD_FOOD_HPP, 5); + target:delMod(MOD_FOOD_HP_CAP, 50); +end; Index: scripts/globals/items/vulcan_blade.lua =================================================================== --- scripts/globals/items/vulcan_blade.lua (revision 0) +++ scripts/globals/items/vulcan_blade.lua (working copy) @@ -0,0 +1,22 @@ +----------------------------------------- +-- ID: 17706 +-- Item: Vulcan Blade +-- Enchantment: "Enfire" +-- Charges: 30 Reuse: 300 Secs +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENFIRE; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/vulcan_claymore.lua =================================================================== --- scripts/globals/items/vulcan_claymore.lua (revision 0) +++ scripts/globals/items/vulcan_claymore.lua (working copy) @@ -0,0 +1,22 @@ +----------------------------------------- +-- ID: 18379 +-- Item: Vulcan Claymore +-- Enchantment: "Enfire" +-- Charges: 30 Reuse: 300 Secs +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENFIRE; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/vulcan_degen.lua =================================================================== --- scripts/globals/items/vulcan_degen.lua (revision 0) +++ scripts/globals/items/vulcan_degen.lua (working copy) @@ -0,0 +1,22 @@ +----------------------------------------- +-- ID: 17705 +-- Item: Vulcan Degen +-- Enchantment: "Enfire" +-- Charges: 30 Reuse: 300 Secs +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENFIRE; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/vulcan_sword.lua =================================================================== --- scripts/globals/items/vulcan_sword.lua (revision 0) +++ scripts/globals/items/vulcan_sword.lua (working copy) @@ -0,0 +1,22 @@ +----------------------------------------- +-- ID: 17704 +-- Item: Vulcan Sword +-- Enchantment: "Enfire" +-- Charges: 30 Reuse: 300 Secs +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + effect = EFFECT_ENFIRE; + doEnspell(target,target,nil,effect); +end; Index: scripts/globals/items/walnut.lua =================================================================== --- scripts/globals/items/walnut.lua (revision 0) +++ scripts/globals/items/walnut.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- ID: 5661 +-- Item: Walnut +-- Food Effect: 5Min, All Races +----------------------------------------- +-- HP 30 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5661); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_HP, 30); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_HP, 30); +end; Index: scripts/globals/items/water_card_case.lua =================================================================== --- scripts/globals/items/water_card_case.lua (revision 0) +++ scripts/globals/items/water_card_case.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5407 +-- Item: Water Card Case +-- Effect: When used, you will obtain one stack of Water Cards +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(2181,99); +end; \ No newline at end of file Index: scripts/globals/items/wayang_kulit_mantle.lua =================================================================== --- scripts/globals/items/wayang_kulit_mantle.lua (revision 0) +++ scripts/globals/items/wayang_kulit_mantle.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- ID: 11536 +-- Item: Wayang Kuilt Mantle +-- Item Effect: Automation: Melee skill +2 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_BACK) == 11536) then + pet:addMod(MOD_HTH, 2); + else + pet:delMod(MOD_HTH, 2); + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/western_san_doria_gate_glyph.lua =================================================================== --- scripts/globals/items/western_san_doria_gate_glyph.lua (revision 0) +++ scripts/globals/items/western_san_doria_gate_glyph.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 4191 +-- Item: West San d'Oria Gate Glyph +-- Enchantment: "Teleport" (West San d'Oria) +----------------------------------------- + +require("scripts/globals/teleports"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + sandoriaWestGlyph(target); +end; \ No newline at end of file Index: scripts/globals/items/wind_card_case.lua =================================================================== --- scripts/globals/items/wind_card_case.lua (revision 0) +++ scripts/globals/items/wind_card_case.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 5404 +-- Item: Wind Card Case +-- Effect: When used, you will obtain one stack of Wind Cards +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(2178,99); +end; \ No newline at end of file Index: scripts/globals/items/windurst_waters_gate_glyph.lua =================================================================== --- scripts/globals/items/windurst_waters_gate_glyph.lua (revision 0) +++ scripts/globals/items/windurst_waters_gate_glyph.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 4193 +-- Item: Windurst Waters Gate Glyph +-- Enchantment: "Teleport" (Windurst Waters) +----------------------------------------- + +require("scripts/globals/teleports"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + windyWatersGlyph(target); +end; \ No newline at end of file Index: scripts/globals/items/windurst_woods_gate_glyph.lua =================================================================== --- scripts/globals/items/windurst_woods_gate_glyph.lua (revision 0) +++ scripts/globals/items/windurst_woods_gate_glyph.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 4195 +-- Item: Windurst Woods Gate Glyph +-- Enchantment: "Teleport" (Windurst Woods) +----------------------------------------- + +require("scripts/globals/teleports"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return 0; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + windyWoodsGlyph(target); +end; \ No newline at end of file Index: scripts/globals/items/withered_rolanberry.lua =================================================================== --- scripts/globals/items/withered_rolanberry.lua (revision 0) +++ scripts/globals/items/withered_rolanberry.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- ID: 5675 +-- Item: Withered Rolanberry +-- Food Effect: 30 Mins, All Races +----------------------------------------- +-- Intelligence 1 +-- Agility -3 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,1800,5675); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_INT, 1); + target:addMod(MOD_AGI, -3); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_INT, 1); + target:delMod(MOD_AGI, -3); +end; Index: scripts/globals/items/woodsy_gilet_+1.lua =================================================================== --- scripts/globals/items/woodsy_gilet_+1.lua (revision 0) +++ scripts/globals/items/woodsy_gilet_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10266 +-- Woodsy Gilet +1 +-- When used, you will obtain 1 Berry Snowcone +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5710,1); +end; \ No newline at end of file Index: scripts/globals/items/woodsy_top_+1.lua =================================================================== --- scripts/globals/items/woodsy_top_+1.lua (revision 0) +++ scripts/globals/items/woodsy_top_+1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------------- +-- ID: 10267 +-- Woodsy Top +1 +-- When used, you will obtain 1 Berry Snowcone +----------------------------------------- + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0; + if (target:getFreeSlotsCount() == 0) then + result = 308; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addItem(5710,1); +end; \ No newline at end of file Index: scripts/globals/items/wyrm_brais.lua =================================================================== --- scripts/globals/items/wyrm_brais.lua (revision 0) +++ scripts/globals/items/wyrm_brais.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 15130 +-- Item: Wyrm Brais +-- Item Effect: Wyvern Physical Dmg -5% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_LEGS) == 15130) then + if(pet:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_DMGPHYS, -5); + else + pet:delMod(MOD_DMGPHYS, -5); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/wyrm_brais_+1.lua =================================================================== --- scripts/globals/items/wyrm_brais_+1.lua (revision 0) +++ scripts/globals/items/wyrm_brais_+1.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 15593 +-- Item: Wyrm Brais +1 +-- Item Effect: Wyvern Physical Dmg -6% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_LEGS) == 15593) then + if(pet:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_DMGPHYS, -6); + else + pet:delMod(MOD_DMGPHYS, -6); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/wyrm_brais_+2.lua =================================================================== --- scripts/globals/items/wyrm_brais_+2.lua (revision 0) +++ scripts/globals/items/wyrm_brais_+2.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 10723 +-- Item: Wyrm Brais +2 +-- Item Effect: Wyvern Physical Dmg -7% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_LEGS) == 10723) then + if(pet:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_DMGPHYS, -7); + else + pet:delMod(MOD_DMGPHYS, -7); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/wyrm_finger_gauntlets.lua =================================================================== --- scripts/globals/items/wyrm_finger_gauntlets.lua (revision 0) +++ scripts/globals/items/wyrm_finger_gauntlets.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 15115 +-- Item: Wyrm Finger Gauntlets +-- Item Effect: Wyvern Magic Dmg -5% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HANDS) == 15115) then + if(pet:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_DMGMAGIC, 13); + else + pet:delMod(MOD_DMGMAGIC, 13); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/wyrm_finger_gauntlets_+1.lua =================================================================== --- scripts/globals/items/wyrm_finger_gauntlets_+1.lua (revision 0) +++ scripts/globals/items/wyrm_finger_gauntlets_+1.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 14922 +-- Item: Wyrm Finger Gauntlets +1 +-- Item Effect: Wyvern Magic Dmg -5% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HANDS) == 14922) then + if(pet:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_DMGMAGIC, 13); + else + pet:delMod(MOD_DMGMAGIC, 13); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/wyrm_finger_gauntlets_+2.lua =================================================================== --- scripts/globals/items/wyrm_finger_gauntlets_+2.lua (revision 0) +++ scripts/globals/items/wyrm_finger_gauntlets_+2.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 10703 +-- Item: Wyrm Finger Gauntlets +2 +-- Item Effect: Wyvern Magic Dmg -7% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_HANDS) == 10703) then + if(pet:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_DMGMAGIC, 18); + else + pet:delMod(MOD_DMGMAGIC, 18); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/wyrm_greaves.lua =================================================================== --- scripts/globals/items/wyrm_greaves.lua (revision 0) +++ scripts/globals/items/wyrm_greaves.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 15145 +-- Item: Wyrm Greaves +-- Item Effect: Wyvern HP while healing +6 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 15145) then + if(pet:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_HPHEAL, 6); + else + pet:delMod(MOD_HPHEAL, 6); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/wyrm_greaves_+1.lua =================================================================== --- scripts/globals/items/wyrm_greaves_+1.lua (revision 0) +++ scripts/globals/items/wyrm_greaves_+1.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 15678 +-- Item: Wyrm Greaves +1 +-- Item Effect: Wyvern HP while healing +7 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (pet:getEquipID(SLOT_FEET) == 15678) then + if(target:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_HPHEAL, 7); + else + pet:delMod(MOD_HPHEAL, 7); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/wyrm_greaves_+2.lua =================================================================== --- scripts/globals/items/wyrm_greaves_+2.lua (revision 0) +++ scripts/globals/items/wyrm_greaves_+2.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 10743 +-- Item: Wyrm Greaves +2 +-- Item Effect: Wyvern HP +10% +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_FEET) == 10743) then + if(pet:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_HPP, 10); + else + pet:delMod(MOD_HPP, 10); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/wyvern_feed.lua =================================================================== --- scripts/globals/items/wyvern_feed.lua (revision 0) +++ scripts/globals/items/wyvern_feed.lua (working copy) @@ -0,0 +1,36 @@ +----------------------------------------- +-- ID: 18242 +-- Item: Wyvern Feed +-- Item Effect: Pet gets regen +-- Durration: 60 Secs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:getObjType() ~= TYPE_PET) + result = 56; + end + if (!target:getPetType() == PETTYPE_WYVERN) then + result = 56; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + if(target:hasStatusEffect(EFFECT_REGEN) == false) then + target:addStatusEffect(EFFECT_REGEN,12,3,60); + else + target:messageBasic(423); + end +end; Index: scripts/globals/items/wyvern_perch.lua =================================================================== --- scripts/globals/items/wyvern_perch.lua (revision 0) +++ scripts/globals/items/wyvern_perch.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- ID: 17579 +-- Item: Wyvern Perch +-- Item Effect: Wyvern HP +50 +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + local pet = target:getPet(); + + if (target:getEquipID(SLOT_MAIN) == 17579) then + if(pet:getPetType() == PETTYPE_WYVERN) then + pet:addMod(MOD_HP, 50); + else + pet:delMod(MOD_HP, 50); + end + end +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) +end; Index: scripts/globals/items/yagudo_belt.lua =================================================================== --- scripts/globals/items/yagudo_belt.lua (revision 0) +++ scripts/globals/items/yagudo_belt.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- ID: 10849 +-- Yagudo Belt +-- Enchantment: 60Min, Costume - Yagudo +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + return target:canUseCostume(); +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_COSTUME,1064,0,3600); +end; \ No newline at end of file Index: scripts/globals/items/yellow_globe.lua =================================================================== --- scripts/globals/items/yellow_globe.lua (revision 3304) +++ scripts/globals/items/yellow_globe.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/yilanbaligi.lua =================================================================== --- scripts/globals/items/yilanbaligi.lua (revision 0) +++ scripts/globals/items/yilanbaligi.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- ID: 5458 +-- Item: Yilanbaligi +-- Food Effect: 5Min, Mithra only +----------------------------------------- +-- Dexterity 2 +-- Mind -4 +-- Evasion 5 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:getRace() ~= 7) then + result = 247; + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5458); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_DEX, 2); + target:addMod(MOD_MND, -4); + target:addMod(MOD_EVA, 5); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_DEX, 2); + target:delMod(MOD_MND, -4); + target:delMod(MOD_EVA, 5); +end; Index: scripts/globals/items/yogurt_cake.lua =================================================================== --- scripts/globals/items/yogurt_cake.lua (revision 0) +++ scripts/globals/items/yogurt_cake.lua (working copy) @@ -0,0 +1,49 @@ +----------------------------------------- +-- ID: 5627 +-- Item: Yogurt Cake +-- Food Effect: 3 Hrs, All Races +----------------------------------------- +-- TODO: Group Effect +-- Intelligence 1 +-- MP Recovered while healing 6 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) +result = 0 + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end +return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,10800,5627); +end; + +----------------------------------- +-- onEffectGain Action +----------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_INT, 1); + target:addMod(MOD_MPHEAL, 6); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_INT, 1); + target:delMod(MOD_MPHEAL, 6); +end; Index: scripts/globals/items/zafmlug_bass.lua =================================================================== --- scripts/globals/items/zafmlug_bass.lua (revision 3304) +++ scripts/globals/items/zafmlug_bass.lua (working copy) @@ -17,7 +17,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/zebra_eel.lua =================================================================== --- scripts/globals/items/zebra_eel.lua (revision 3304) +++ scripts/globals/items/zebra_eel.lua (working copy) @@ -18,7 +18,11 @@ result = 0 if (target:getRace() ~= 7) then result = 247; - elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then + end + if(target:getMod(MOD_EAT_RAW_FISH) == 1) then + result = 0; + end + if (target:hasStatusEffect(EFFECT_FOOD) == true) then result = 246; end return result; Index: scripts/globals/items/zucchini.lua =================================================================== --- scripts/globals/items/zucchini.lua (revision 0) +++ scripts/globals/items/zucchini.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- ID: 5726 +-- Item: Zucchini +-- Food Effect: 5Min, All Races +----------------------------------------- +-- Agility 1 +-- Vitality -3 +-- Defense -1 +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnItemCheck +----------------------------------------- + +function onItemCheck(target) + result = 0; + if (target:hasStatusEffect(EFFECT_FOOD) == true) then + result = 246; + end + return result; +end; + +----------------------------------------- +-- OnItemUse +----------------------------------------- + +function onItemUse(target) + target:addStatusEffect(EFFECT_FOOD,0,0,300,5726); +end; + +----------------------------------------- +-- onEffectGain Action +----------------------------------------- + +function onEffectGain(target,effect) + target:addMod(MOD_AGI, 1); + target:addMod(MOD_VIT, -3); + target:addMod(MOD_DEF, -1); +end; + +----------------------------------------- +-- onEffectLose Action +----------------------------------------- + +function onEffectLose(target,effect) + target:delMod(MOD_AGI, 1); + target:delMod(MOD_VIT, -3); + target:delMod(MOD_DEF, -1); +end; Index: scripts/globals/keyitems.lua =================================================================== --- scripts/globals/keyitems.lua (revision 3304) +++ scripts/globals/keyitems.lua (working copy) @@ -1705,6 +1705,7 @@ WAUGYLS_CLAW = 1764; BOTTLE_OF_MILITARY_INK = 1765; MILITARY_INK_PACKAGE = 1766; +LOADSTONE = 2051; ----------------------------------- -- Magical Map Index: scripts/globals/logging.lua =================================================================== --- scripts/globals/logging.lua (revision 3304) +++ scripts/globals/logging.lua (working copy) @@ -90,7 +90,9 @@ Body = player:getEquipID(SLOT_BODY); Hands = player:getEquipID(SLOT_HANDS); Legs = player:getEquipID(SLOT_LEGS); - + Waist = player:getEquipID(SLOT_WAIST); + Neck = player:getEquipID(SLOT_NECK); + if(Body == 14374 or Body == 14375) then hatchetbreak = hatchetbreak + 0.073; end @@ -100,6 +102,12 @@ if(Hands == 14817 or Hands == 14818) then hatchetbreak = hatchetbreak + 0.073; end + if(Waist == 11769) then + hatchetbreak = hatchetbreak + 0.073; + end + if(Neck == 10926) then + hatchetbreak = hatchetbreak + 0.073; + end -------------------- -- End Gear Bonus Index: scripts/globals/magic.lua =================================================================== --- scripts/globals/magic.lua (revision 3304) +++ scripts/globals/magic.lua (working copy) @@ -5,25 +5,25 @@ MMSG_BUFF_FAIL = 75; - DIVINE_MAGIC_SKILL = 32; + DIVINE_MAGIC_SKILL = 32; HEALING_MAGIC_SKILL = 33; - ENHANCING_MAGIC_SKILL = 34; - ENFEEBLING_MAGIC_SKILL = 35; - ELEMENTAL_MAGIC_SKILL = 36; + ENHANCING_MAGIC_SKILL = 34; + ENFEEBLING_MAGIC_SKILL = 35; + ELEMENTAL_MAGIC_SKILL = 36; DARK_MAGIC_SKILL = 37; - NINJUTSU_SKILL = 39; - SUMMENING_SKILL = 38; - SINGING_SKILL = 40; - STRING_SKILL = 41; - WIND_SKILL = 42; - BLUE_SKILL = 43; + NINJUTSU_SKILL = 39; + SUMMENING_SKILL = 38; + SINGING_SKILL = 40; + STRING_SKILL = 41; + WIND_SKILL = 42; + BLUE_SKILL = 43; FIRESDAY = 0; EARTHSDAY = 1; WATERSDAY = 2; WINDSDAY = 3; ICEDAY = 4; - LIGHTNINGDAY = 5; + LIGHTNINGDAY = 5; LIGHTSDAY = 6; DARKSDAY = 7; @@ -31,10 +31,10 @@ ELE_EARTH = 2; ELE_WATER = 3; ELE_WIND = 4; - ELE_ICE = 5; - ELE_LIGHTNING = 6; + ELE_ICE = 5; + ELE_LIGHTNING = 6; -- added both because monsterstpmoves calls it thunder - ELE_THUNDER = 6; + ELE_THUNDER = 6; ELE_LIGHT = 7; ELE_DARK = 8; @@ -102,9 +102,14 @@ end local duration = 180; + duration = duration + target:getMod(MOD_ENSPELL_DURATION); + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; end + --calculate potency local magicskill = target:getSkillLevel(ENHANCING_MAGIC_SKILL) + target:getMod(79 + ENHANCING_MAGIC_SKILL); @@ -113,10 +118,7 @@ potency = 5 + ((5*magicskill)/100); end - -- enhancing sword - if(target:getEquipID(SLOT_MAIN) == 16605) then - potency = potency + 5; - end + potency = potency + target:getMod(MOD_ENSPELL_DMG); if(target:addStatusEffect(effect,potency,0,duration)) then spell:setMsg(230); @@ -258,6 +260,28 @@ -- Iridal and Chatoyant will return affinity for strong and weak, cancelling their bonus out, so they need to be specifically checked. -- Could do an if strong == weak, but that would cause problems once/if augments or magian gear is added. local equippedMain = caster:getEquipID(SLOT_MAIN); + + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + if(caster:getObjType() == TYPE_PC) then + if(job == JOB_BLM or sjob == JOB_BLM) then + if(ele == 1) then + affinity = affinity + caster:getMerit(MERIT_FIRE_MAGIC_POTENCY); + elseif(ele == 2) then + affinity = affinity + caster:getMerit(MERIT_EARTH_MAGIC_POTENCY); + elseif(ele == 3) then + affinity = affinity + caster:getMerit(MERIT_WATER_MAGIC_POTENCY); + elseif(ele == 4) then + affinity = affinity + caster:getMerit(MERIT_WIND_MAGIC_POTENCY); + elseif(ele == 5) then + affinity = affinity + caster:getMerit(MERIT_ICE_MAGIC_POTENCY); + elseif(ele == 6) then + affinity = affinity + caster:getMerit(MERIT_LIGHTNING_MAGIC_POTENCY); + else + affinity = affinity; + end + end + end if (equippedMain == 18632) then affinity = affinity + 1; elseif (equippedMain == 18633) then @@ -302,12 +326,113 @@ else magicacc = magicacc + diff; end - --add acc for ele/dark seal + --add acc for ele/dark seal/troubadour if(player:getStatusEffect(EFFECT_ELEMENTAL_SEAL) ~= nil) then magicaccbonus = magicaccbonus + 256; elseif(player:getStatusEffect(EFFECT_DARK_SEAL) ~= nil and skill == DARK_MAGIC_SKILL) then magicaccbonus = magicaccbonus + 256; + elseif(player:getStatusEffect(EFFECT_TROUBADOUR) ~= nil) then + local bardMerit = player:getMerit(MERIT_TROUBADOUR); + local mAccBonus = 0; + if(bardMerit == 50) then + mAccBonus = 64; + elseif(bardMerit == 75) then + mAccBonus = 128; + elseif(bardMerit == 100) then + mAccBonus = 192; + elseif(bardMerit == 125) then + mAccBonus = 256; + end + magicaccbonus = magicaccbonus + mAccBonus; end + + + -- add Magical Accuracy Bonus from BLM AM II Spells + local id = spell:getID(); + local merit = 0; + + if(player:getObjType() == TYPE_PC) then + if(id == 207 or id == 209 or id == 211 or id == 213 or id == 215 or id == 205) then + if (id == 205) then + merit = player:getMerit(MERIT_FLARE_II); + elseif (id == 207) then + merit = player:getMerit(MERIT_FREEZE_II); + elseif (id == 209) then + merit = player:getMerit(MERIT_TORNADO_II); + elseif (id == 211) then + merit = player:getMerit(MERIT_QUAKE_II); + elseif (id == 213) then + merit = player:getMerit(MERIT_BURST_II); + elseif (id == 215) then + merit = player:getMerit(MERIT_FLOOD_II); + end + magicaccbonus = magicaccbonus + (merit - 5); + end + end -- if BLM AM II + + + -- add Magical Accuracy Bonus from Merit RDM Spells + + local ele = spell:getElement(); + + if(player:getObjType() == TYPE_PC) then + if(job == JOB_RDM or sjob == JOB_RDM) then + if(ele == 1) then + magicaccbonus = magicaccbonus + player:getMerit(MERIT_FIRE_MAGIC_ACCURACY); + elseif(ele == 2) then + magicaccbonus = magicaccbonus + player:getMerit(MERIT_EARTH_MAGIC_ACCURACY); + elseif(ele == 3) then + magicaccbonus = magicaccbonus + player:getMerit(MERIT_WATER_MAGIC_ACCURACY); + elseif(ele == 4) then + magicaccbonus = magicaccbonus + player:getMerit(MERIT_WIND_MAGIC_ACCURACY); + elseif(ele == 5) then + magicaccbonus = magicaccbonus + player:getMerit(MERIT_ICE_MAGIC_ACCURACY); + elseif(ele == 6) then + magicaccbonus = magicaccbonus + player:getMerit(MERIT_LIGHTNING_MAGIC_ACCURACY); + else + magicaccbonus = magicaccbonus; + end + end + end + + if(player:getObjType() == TYPE_PC) then + if(id == 79) then + merit = player:getMerit(MERIT_SLOW_II); + magicaccbonus = magicaccbonus + (merit - 1); + end + end + + if(player:getObjType() == TYPE_PC) then + if(id == 80 or id == 276) then + if (id == 80) then + merit = player:getMerit(MERIT_PARALYZE_II); + elseif (id == 276) then + merit = player:getMerit(MERIT_BLIND_II); + end + end + magicaccbonus = magicaccbonus + (merit - 5); + end -- if RDM Merit Spells + + + -- add Magical Accuracy Bonus from Merit NIN Spells + if(player:getObjType() == TYPE_PC) then + if(id == 322 or id == 325 or id == 328 or id == 331 or id == 334 or id == 337) then + if(id == 322) then + merit = player:getMerit(MERIT_KATON_SAN); + elseif(id == 325) then + merit = player:getMerit(MERIT_HYOTON_SAN); + elseif(id == 328) then + merit = player:getMerit(MERIT_HUTON_SAN); + elseif(id == 331) then + merit = player:getMerit(MERIT_DOTON_SAN); + elseif(id == 334) then + merit = player:getMerit(MERIT_RAITON_SAN); + elseif(id == 337) then + merit = player:getMerit(MERIT_SUITON_SAN); + end + end + magicaccbonus = magicaccbonus + ((merit - 1)*5); + + end -- if NIN Merit Spells + + --add acc for staves local affinityBonus = AffinityBonus(player, spell); magicaccbonus = magicaccbonus + (affinityBonus-1) * 200; @@ -332,7 +457,9 @@ magicaccbonus = magicaccbonus / 2; --add magicacc bonus p = p + magicaccbonus; - -- printf("acc: %f, eva: %f, bonus: %f", magicacc, magiceva, magicaccbonus); + -- print(magicacc); + -- print(magiceva); + -- print(magicaccbonus); --double any acc over 50 if it's over 50 @@ -491,7 +618,10 @@ end; function finalMagicAdjustments(caster,target,spell,dmg) - + local skill = spell:getSkillType(); + local mpCost = spell:getMPCost(); + local recoverMP = 0; + local occultTP = 0; -- handle multiple targets if(spell:isAoE()) then local total = spell:getTotalTargets(); @@ -520,8 +650,8 @@ dmg = utils.dmgTaken(target, dmg); dmg = utils.magicDmgTaken(target, dmg); - dmg = dmg - target:getMod(MOD_PHALANX); + if(dmg < 0) then dmg = 0; end @@ -529,6 +659,8 @@ --handling stoneskin dmg = utils.stoneskin(target, dmg); + utils.dmgToMP(target, dmg); + utils.dmgToTP(target, dmg); target:delHP(dmg); target:updateEnmityFromDamage(caster,dmg); @@ -536,6 +668,26 @@ if (target:getObjType() ~= TYPE_PC) then target:addTP(10); end + + if(skill == 36) then + if(caster:getEquipID(SLOT_BODY) == 10286) then -- Seidr Cotehardie + recoverMP = dmg * .02; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + end + + if(skill == 36 or skill == 37) then + if(caster:getMod(MOD_OCCULT_ACCUMEN) > 0) then + if(mpCost >= 100) then + occultTP = (mpCost/100) * (caster:getMod(MOD_OCCULT_ACCUMEN)/1000); + caster:addTP(occultTP); + end + end + end return dmg; end; @@ -546,9 +698,6 @@ end; function calculateMagicBurstAndBonus(caster, spell, target) - local equippedHands = caster:getEquipID(SLOT_HANDS); - local equippedEar1 = caster:getEquipID(SLOT_EAR1); - local equippedEar2 = caster:getEquipID(SLOT_EAR2); local burst = 1.0; local burstBonus = 1.0; @@ -572,34 +721,44 @@ end -- Get burst bonus from gear/spell bonus + burstBonus = burstBonus + (target:getMod(MOD_MAG_BURST_DMG)/100); - -- Sorcerer's Gloves - if(equippedHands == 15105 or equippedHands == 14912) then - burstBonus = burstBonus + 0.05; - end - - if(equippedEar1 == 15962 or equippedEar2 == 15962) then - burstBonus = burstBonus + 0.05; - end - - -- TODO: This should be getting the spell ID, and checking + -- This should be getting the spell ID, and checking -- if it is an Ancient Magic II spell. Add 0.03 -- to burstBonus for each merit the caster has for - -- the given spell. + -- the given spell over the 1st merit. -- AM 2 get magic burst bonuses - --id = spell:getID(); - --if(id == 207 or id == 209 or id == 211 or id == 213 or id == 215 or id == 205) then - -- if(AM2 Merit 1) then - -- burstBonus = burstBonus + 0.03; - -- elseif(AM2 Merit 2) then - -- burstBonus += 0.06; - -- elseif(AM2 Merit 3) then - -- burstBonus += 0.09; - -- elseif(AM2 Merit 4) then - -- burstBonus += 0.12; - -- end - --end -- if AM2+ + local id = spell:getID(); + local merit = 0; + if(caster:getObjType() == TYPE_PC) then + if(id == 207 or id == 209 or id == 211 or id == 213 or id == 215 or id == 205) then + if (id == 205) then + merit = caster:getMerit(MERIT_FLARE_II); + elseif (id == 207) then + merit = caster:getMerit(MERIT_FREEZE_II); + elseif (id == 209) then + merit = caster:getMerit(MERIT_TORNADO_II); + elseif (id == 211) then + merit = caster:getMerit(MERIT_QUAKE_II); + elseif (id == 213) then + merit = caster:getMerit(MERIT_BURST_II); + elseif (id == 215) then + merit = caster:getMerit(MERIT_FLOOD_II); + end + end + if(merit == 5) then + burstBonus = burstBonus; + elseif(merit == 10) then + burstBonus = burstBonus + 0.03; + elseif(merit == 15) then + burstBonus = burstBonus + 0.06; + elseif(merit == 20) then + burstBonus = burstBonus + 0.09; + elseif(merit == 25) then + burstBonus = burstBonus + 0.12; + end + end -- if AM2+ end return burst, burstBonus; @@ -607,14 +766,34 @@ function addBonuses(caster, spell, target, dmg) local ele = spell:getElement(); + local id = spell:getID(); + local skill = spell:getSkillType(); + local merit = 0; + + -- Elemental Mag Dmg Bonus (Spirit Lantern etc.) + if(skill == 36) then + dmg = math.floor(dmg * (1 + (caster:getMod(MOD_ELEM_MAG_DMG)/100))); + end + -- Enfeebling Mag Dmg Bonus (Estoquers Sayon +2 etc.) + if(skill == 35) then + dmg = math.floor(dmg * (1 + (caster:getMod(MOD_ENFB_MAG_DMG)/100))); + end + -- Ninjutsu Mag Dmg Bonus (Koga Hatsuburi etc.) + if(skill == 39) then + dmg = math.floor(dmg * (1 + (caster:getMod(MOD_NIN_MAG_DMG)/100))); + end + -- Drain / Aspir Dmg Bonus (Bounty Sickle etc.) + if(id >= 245 and id <= 248) then + dmg = math.floor(dmg * (1 + (caster:getMod(MOD_DRAIN_ASPIR)/100))); + end local affinityBonus = AffinityBonus(caster, spell); dmg = math.floor(dmg * affinityBonus); - + --printf("Affinity Bonus DMG %u",dmg); local speciesReduction = target:getMod(defenseMod[ele]); speciesReduction = 1.00 - (speciesReduction/1000); dmg = math.floor(dmg * speciesReduction); - + --printf("Species Reduction Bonus 2 DMG %u",dmg); local dayWeatherBonus = 1.00; local equippedMain = caster:getEquipID(SLOT_MAIN); local equippedWaist = caster:getEquipID(SLOT_WAIST); @@ -680,13 +859,32 @@ dmg = math.floor(dmg * burst); local mab = (100 + caster:getMod(MOD_MATT)) / (100 + target:getMod(MOD_MDEF)); + + if(mab < 0) then + mab = 0; + end - if(mab < 0) then - mab = 0; - end - + -- add Magical Attack Bonus from Merit NIN Spells + if(caster:getObjType() == TYPE_PC) then + if(id == 322 or id == 325 or id == 328 or id == 331 or id == 334 or id == 337) then + if(id == 322) then + merit = caster:getMerit(MERIT_KATON_SAN); + elseif(id == 325) then + merit = caster:getMerit(MERIT_HYOTON_SAN); + elseif(id == 328) then + merit = caster:getMerit(MERIT_HUTON_SAN); + elseif(id == 331) then + merit = caster:getMerit(MERIT_DOTON_SAN); + elseif(id == 334) then + merit = caster:getMerit(MERIT_RAITON_SAN); + elseif(id == 337) then + merit = caster:getMerit(MERIT_SUITON_SAN); + end + mab = mab + ((merit - 1)*5); + end + end -- if NIN Merit Spells + dmg = math.floor(dmg * mab); - + -- Applies "Damage Taken" and "Magic Damage Taken" mods. -- The formulas look crazy because SE. -- Note that MOD_DMGMAGIC is stored in item_mods in amount/256 format @@ -774,16 +972,46 @@ -- Remove previous Threnody target:delStatusEffect(EFFECT_THRENODY); - -- TODO: Check equipment bounses, increase duration/power local power = basePower; local duration = baseDuration; + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_THRENODY) * 10)/100)); + + power = power + ((caster:getMod(MOD_THRENODY) + caster:getMod(MOD_ALL_SONGS)) * 5); -- Set spell message and apply status effect target:addStatusEffect(EFFECT_THRENODY, power, 0, duration, 0, modifier, 0); - return EFFECT_THRENODY; end; +function handleCarol(caster, target, spell, basePower, baseDuration, modifier) + + -- Remove previous Carol + target:delStatusEffect(EFFECT_CAROL); + + -- TODO: Check equipment bounses, increase duration/power + local power = basePower; + local duration = baseDuration; + + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_CAROL) * 10)/100)); + + power = power + ((caster:getMod(MOD_CAROL) + caster:getMod(MOD_ALL_SONGS)) * 5); + + -- Set spell message and apply status effect + if(target:addStatusEffect(EFFECT_CAROL, power, 0, duration, 0, modifier, 0)) then + spell:setMsg(230); + else + spell:setMsg(75); -- no effect + end + return EFFECT_CAROL; +end; + + function handleNinjutsuDebuff(caster, target, spell, basePower, baseDuration, modifier) -- Add new target:addStatusEffectEx(EFFECT_NINJUTSU_ELE_DEBUFF, 0, basePower, 0, baseDuration, 0, modifier, 0); Index: scripts/globals/mining.lua =================================================================== --- scripts/globals/mining.lua (revision 3304) +++ scripts/globals/mining.lua (working copy) @@ -84,6 +84,8 @@ Body = player:getEquipID(SLOT_BODY); Hands = player:getEquipID(SLOT_HANDS); Feet = player:getEquipID(SLOT_FEET); + Waist = player:getEquipID(SLOT_WAIST); + Neck = player:getEquipID(SLOT_NECK); if(Body == 14374 or Body == 14375) then pickaxebreak = pickaxebreak + 0.073; @@ -94,6 +96,12 @@ if(Feet == 14176 or Feet == 14177) then pickaxebreak = pickaxebreak + 0.073; end + if(Waist == 11769) then + pickaxebreak = pickaxebreak + 0.073; + end + if(Neck == 10926) then + pickaxebreak = pickaxebreak + 0.073; + end -------------------- -- End Gear Bonus Index: scripts/globals/missions.lua =================================================================== --- scripts/globals/missions.lua (revision 3304) +++ scripts/globals/missions.lua (working copy) @@ -36,10 +36,10 @@ LEAUTE_S_LAST_WISHES = 16; -- -- RANPERRE_S_FINAL_REST = 17; -- -- PRESTIGE_OF_THE_PAPSQUE = 18; -- -- -THE_SECRET_WEAPON = 19; -COMING_OF_AGE = 20; -LIGHTBRINGER = 21; -BREAKING_BARRIERS = 22; +THE_SECRET_WEAPON = 19; -- -- +COMING_OF_AGE = 20; -- -- +LIGHTBRINGER = 21; -- -- +BREAKING_BARRIERS = 22; THE_HEIR_TO_THE_LIGHT = 23; ----------------------------------- @@ -104,38 +104,38 @@ -- Zilart Missions (3) ----------------------------------- -THE_NEW_FRONTIER = 0; -- -- -WELCOME_TNORG = 4; -- -- -KAZAMS_CHIEFTAINESS = 6; -- -- +THE_NEW_FRONTIER = 0; -- -- +WELCOME_TNORG = 4; -- -- +KAZAMS_CHIEFTAINESS = 6; -- -- THE_TEMPLE_OF_UGGALEPIH = 8; -- -- HEADSTONE_PILGRIMAGE = 10; -- -- THROUGH_THE_QUICKSAND_CAVES = 12; -- -- THE_CHAMBER_OF_ORACLES = 14; -- -- RETURN_TO_DELKFUTTS_TOWER = 16; -- -- -ROMAEVE = 18; -- -- +ROMAEVE = 18; -- -- THE_TEMPLE_OF_DESOLATION = 20; -- -- THE_HALL_OF_THE_GODS = 22; -- -- THE_MITHRA_AND_THE_CRYSTAL = 23; -- -- THE_GATE_OF_THE_GODS = 24; -- -- -ARK_ANGELS = 26; -- -- -THE_SEALED_SHRINE = 27; -THE_CELESTIAL_NEXUS = 28; -AWAKENING = 30; -THE_LAST_VERSE = 31; +ARK_ANGELS = 26; -- -- +THE_SEALED_SHRINE = 27; +THE_CELESTIAL_NEXUS = 28; +AWAKENING = 30; +THE_LAST_VERSE = 31; ----------------------------------- -- Promathia Missions (6) ----------------------------------- -ANCIENT_FLAMES_BECKON = 0 -- Category +ANCIENT_FLAMES_BECKON = 0 -- Category THE_RITES_OF_LIFE = 1 -- -- BELOW_THE_ARKS = 2 -- -- -THE_MOTHERCRYSTALS = 3 -- -- --- THE_ISLE_OF_FORGOTTEN_SAINTS = -- Category -AN_INVITATION_WEST = 5 -- -- +THE_MOTHERCRYSTALS = 3 -- -- +-- THE_ISLE_OF_FORGOTTEN_SAINTS = -- Category +AN_INVITATION_WEST = 5 -- -- THE_LOST_CITY = 15 -- -- DISTANT_BELIEFS = 16 -- -- -AN_ETERNAL_MELODY = 17 -- -- +AN_ETERNAL_MELODY = 17 -- -- ANCIENT_VOWS = 18 -- -- A_TRANSIENT_DREAM = 19 -- Category THE_CALL_OF_THE_WYRMKING = 20 -- -- @@ -145,7 +145,7 @@ -- VICISSITUDES = -- -- DESCENDANTS_OF_A_LINE_LOST = 29 -- -- -- LOUVERANCE = -- -- --- MEMORIES_OF_A_MAIDEN = -- Sub-category +-- MEMORIES_OF_A_MAIDEN = -- Sub-category COMEDY_OF_ERRORS_ACT_I = 30 -- -- -- COMEDY_OF_ERRORS_ACT_II = -- -- -- EXIT_STAGE_LEFT = -- -- @@ -217,7 +217,7 @@ SWEETS_FOR_THE_SOUL = 18; TEAHOUSE_TUMULT = 19; FINDERS_KEEPERS = 20; -SHIELD_OF_DIPLOMACY = 21; +SHIELD_OF_DIPLOMACY = 21; SOCIAL_GRACES = 22; FOILED_AMBITION = 23; PLAYING_THE_PART = 24; @@ -249,118 +249,118 @@ -- Wings of the Goddess (5) ----------------------------------- -CAVERNOUS_MAWS = 0; +CAVERNOUS_MAWS = 0; BACK_TO_THE_BEGINNING = 1; -CAIT_SITH = 2; +CAIT_SITH = 2; THE_QUEEN_OF_THE_DANCE = 3; WHILE_THE_CAT_IS_AWAY = 4; A_TIMESWEPT_BUTTERFLY = 5; PURPLE,_THE_NEW_BLACK = 6; IN_THE_NAME_OF_THE_FATHER = 7; -DANCERS_IN_DISTRESS = 8; +DANCERS_IN_DISTRESS = 8; DAUGHTER_OF_A_KNIGHT = 9; -A_SPOONFUL_OF_SUGAR = 10; -AFFAIRS_OF_STATE = 11; -BORNE_BY_THE_WIND = 12; +A_SPOONFUL_OF_SUGAR = 10; +AFFAIRS_OF_STATE = 11; +BORNE_BY_THE_WIND = 12; A_NATION_ON_THE_BRINK = 13; -CROSSROADS_OF_TIME = 14; -SANDSWEPT_MEMORIES = 15; -NORTHLAND_EXPOSURE = 16; +CROSSROADS_OF_TIME = 14; +SANDSWEPT_MEMORIES = 15; +NORTHLAND_EXPOSURE = 16; TRAITOR_IN_THE_MIDST = 17; BETRAYAL_AT_BEAUCEDINE = 18; -ON_THIN_ICE = 19; -PROOF_OF_VALOR = 20; +ON_THIN_ICE = 19; +PROOF_OF_VALOR = 20; A_SANGUINARY_PRELUDE = 21; DUNGEONS_AND_DANCERS = 22; -DISTORTER_OF_TIME = 23; +DISTORTER_OF_TIME = 23; THE_WILL_OF_THE_WORLD = 24; -FATE_IN_HAZE = 25; -THE_SCENT_OF_BATTLE = 26; -ANOTHER_WORLD = 27; -A_HAWK_IN_REPOSE = 28; +FATE_IN_HAZE = 25; +THE_SCENT_OF_BATTLE = 26; +ANOTHER_WORLD = 27; +A_HAWK_IN_REPOSE = 28; THE_BATTLE_OF_XARCABARD = 29; -PRELUDE_TO_A_STORM = 30; -STORM_S_CRESCENDO = 31; +PRELUDE_TO_A_STORM = 30; +STORM_S_CRESCENDO = 31; INTO_THE_BEAST_S_MAW = 32; -THE_HUNTER_ENSNARED = 33; -FLIGHT_OF_THE_LION = 34; -FALL_OF_THE_HAWK = 35; -DARKNESS_DESCENDS = 36; -ADIEU__LILISETTE = 37; -BY_THE_FADING_LIGHT = 38; -EDGE_OF_EXISTENCE = 39; -HER_MEMORIES = 40; -FORGET_ME_NOT = 41; -PILLAR_OF_HOPE = 42; -GLIMMER_OF_LIFE = 43; -TIME_SLIPS_AWAY = 44; -WHEN_WILLS_COLLIDE = 45; -WHISPERS_OF_DAWN = 46; -A_DREAMY_INTERLUDE = 47; -CAIT_IN_THE_WOODS = 48; -FORK_IN_THE_ROAD = 49; -MAIDEN_OF_THE_DUSK = 50; -WHERE_IT_ALL_BEGAN = 51; -A_TOKEN_OF_TROTH = 52; -LEST_WE_FORGET = 53; +THE_HUNTER_ENSNARED = 33; +FLIGHT_OF_THE_LION = 34; +FALL_OF_THE_HAWK = 35; +DARKNESS_DESCENDS = 36; +ADIEU__LILISETTE = 37; +BY_THE_FADING_LIGHT = 38; +EDGE_OF_EXISTENCE = 39; +HER_MEMORIES = 40; +FORGET_ME_NOT = 41; +PILLAR_OF_HOPE = 42; +GLIMMER_OF_LIFE = 43; +TIME_SLIPS_AWAY = 44; +WHEN_WILLS_COLLIDE = 45; +WHISPERS_OF_DAWN = 46; +A_DREAMY_INTERLUDE = 47; +CAIT_IN_THE_WOODS = 48; +FORK_IN_THE_ROAD = 49; +MAIDEN_OF_THE_DUSK = 50; +WHERE_IT_ALL_BEGAN = 51; +A_TOKEN_OF_TROTH = 52; +LEST_WE_FORGET = 53; ----------------------------------- -- Assualt (7) ----------------------------------- -LEUJAOAM_CLEANSING = 1; -ORICHALCUM_SURVEY = 2; +LEUJAOAM_CLEANSING = 1; +ORICHALCUM_SURVEY = 2; ESCORT_PROFESSOR_CHANOIX = 3; SHANARHA_GRASS_CONSERVATION = 4; -COUNTING_SHEEP = 5; -SUPPLIES_RECOVERY = 6; -AZURE_EXPERIMENTS = 7; -IMPERIAL_CODE = 8; -RED_VERSUS_BLUE = 9; -BLOODY_RONDO = 10; +COUNTING_SHEEP = 5; +SUPPLIES_RECOVERY = 6; +AZURE_EXPERIMENTS = 7; +IMPERIAL_CODE = 8; +RED_VERSUS_BLUE = 9; +BLOODY_RONDO = 10; IMPERIAL_AGENT_RESCUE = 11; -PREEMPTIVE_STRIKE = 12; +PREEMPTIVE_STRIKE = 12; SAGELORD_ELIMINATION = 13; -BREAKING_MORALE = 14; -THE_DOUBLE_AGENT = 15; +BREAKING_MORALE = 14; +THE_DOUBLE_AGENT = 15; IMPERIAL_TREASURE_RETRIEVAL = 16; -BLITZKRIEG = 17; -MARIDS_IN_THE_MIST = 18; -AZURE_AILMENTS = 19; -THE_SUSANOO_SHUFFLE = 20; -EXCAVATION_DUTY = 21; -LEBROS_SUPPLIES = 22; -TROLL_FUGITIVES = 23; -EVADE_AND_ESCAPE = 24; +BLITZKRIEG = 17; +MARIDS_IN_THE_MIST = 18; +AZURE_AILMENTS = 19; +THE_SUSANOO_SHUFFLE = 20; +EXCAVATION_DUTY = 21; +LEBROS_SUPPLIES = 22; +TROLL_FUGITIVES = 23; +EVADE_AND_ESCAPE = 24; SIEGEMASTER_ASSASSINATION = 25; -APKALLU_BREEDING = 26; -WAMOURA_FARM_RAID = 27; -EGG_CONSERVATION = 28; +APKALLU_BREEDING = 26; +WAMOURA_FARM_RAID = 27; +EGG_CONSERVATION = 28; OPERATION__BLACK_PEARL = 29; -BETTER_THAN_ONE = 30; -SEAGULL_GROUNDED = 31; -REQUIEM = 32; -SAVING_PRIVATE_RYAAF = 33; +BETTER_THAN_ONE = 30; +SEAGULL_GROUNDED = 31; +REQUIEM = 32; +SAVING_PRIVATE_RYAAF = 33;-- -- SHOOTING_DOWN_THE_BARON = 34; -BUILDING_BRIDGES = 35; -STOP_THE_BLOODSHED = 36; -DEFUSE_THE_THREAT = 37; +BUILDING_BRIDGES = 35; +STOP_THE_BLOODSHED = 36; +DEFUSE_THE_THREAT = 37; OPERATION__SNAKE_EYES = 38; -WAKE_THE_PUPPET = 39; -THE_PRICE_IS_RIGHT = 40; -GOLDEN_SALVAGE = 41; -LAMIA_NO_13 = 42; -EXTERMINATION = 43; -DEMOLITION_DUTY = 44; -SEARAT_SALVATION = 45; -APKALLU_SEIZURE = 46; -LOST_AND_FOUND = 47; -DESERTER = 48; -DESPERATELY_SEEKING_CEPHALOPODS = 49; -BELLEROPHON_S_BLISS = 50; +WAKE_THE_PUPPET = 39; +THE_PRICE_IS_RIGHT = 40; +GOLDEN_SALVAGE = 41; +LAMIA_NO_13 = 42; +EXTERMINATION = 43; +DEMOLITION_DUTY = 44; +SEARAT_SALVATION = 45; +APKALLU_SEIZURE = 46; +LOST_AND_FOUND = 47; +DESERTER = 48; +DESPERATELY_SEEKING_CEPHALOPODS = 49; +BELLEROPHON_S_BLISS = 50; NYZUL_ISLE_INVESTIGATION = 51; -NYZUL_ISLE_UNCHARTED_AREA_SURVEY = 52; +NYZUL_ISLE_UNCHARTED_AREA_SURVEY = 52; ----------------------------------- -- Campaign (8) @@ -824,31 +824,36 @@ else timeline = { -- MissionID,{Guard#1 DialogID, option},{Guard#2 DialogID, option},{NPC#1 DialogID, option},{NPC#2 DialogID, option},{function list} - 0,{0x03e8,0},{0x07d0,0},{0,0}, {0,0},{{1},{2}}, -- MISSION 1-1 (First Mission [START]) - 0,{0x03fc,0},{0x07e4,0},{0,0}, {0,0},{{4},{5,150},{12}}, -- MISSION 1-1 - 0,{0x03ea,0},{0x07d2,0},{0,0}, {0,0},{{4},{5,150},{12}}, -- MISSION 1-1 [Repeat] - 1,{0x03ff,0},{0x07e7,0},{0,0}, {0,0},{{4},{14,0},{5,200},{12}}, -- MISSION 1-2 - 1,{0x03eb,0},{0x07d3,0},{0,0}, {0,0},{{4},{14,0},{5,200},{12}}, -- MISSION 1-2 [Repeat] + 0,{0x03e8,0},{0x07d0,0},{0,0}, {0,0},{{1},{2}}, -- MISSION 1-1 (First Mission [START]) + 0,{0x03fc,0},{0x07e4,0},{0,0}, {0,0},{{4},{5,150},{12}}, -- MISSION 1-1 + 0,{0x03ea,0},{0x07d2,0},{0,0}, {0,0},{{4},{5,150},{12}}, -- MISSION 1-1 [Repeat] + 1,{0x03ff,0},{0x07e7,0},{0,0}, {0,0},{{4},{14,0},{5,200},{12}}, -- MISSION 1-2 + 1,{0x03eb,0},{0x07d3,0},{0,0}, {0,0},{{4},{14,0},{5,200},{12}}, -- MISSION 1-2 [Repeat] 2,{0x03ec,0},{0x07d4,0},{0,0}, {0,0},{{11,2},{3,"OptionalCSforSTC",1},{14,0},{6},{8,1000},{12}}, -- MISSION 1-3 - 2,{0x0400,0},{0x07e8,0},{0,0}, {0,0},{{14,0},{5,250},{12}}, -- MISSION 1-3 [Repeat] - 3,{0x03ed,0},{0x07d5,0},{0,0}, {0,0},{{9,65},{14,0},{5,300},{12}}, -- MISSION 2-1 - 4,{0,0}, {0,0}, {0x02b7,0},{0,0},{{9,44},{14,0},{5,350},{12}}, -- MISSION 2-2 (Papal Chambers) + 2,{0x0400,0},{0x07e8,0},{0,0}, {0,0},{{14,0},{5,250},{12}}, -- MISSION 1-3 [Repeat] + 3,{0x03ed,0},{0x07d5,0},{0,0}, {0,0},{{9,65},{14,0},{5,300},{12}}, -- MISSION 2-1 + 4,{0,0}, {0,0}, {0x02b7,0},{0,0},{{9,44},{14,0},{5,350},{12}}, -- MISSION 2-2 (Papal Chambers) 5,{0,0}, {0,0}, {0x01fb,0},{0,0},{{10,35},{6},{13,207},{8,3000},{11,3},{9,29},{14,0},{12}}, -- MISSION 2-3 (Halver) - 10,{0,0}, {0,0}, {0x022a,0},{0,0},{{9,237},{14,0},{5,400},{12}}, -- MISSION 3-1 (Prince Trion (door)) - 10,{0x03f4,0},{0x07dc,0},{0,0}, {0,0},{{14,0},{5,300},{12}}, -- MISSION 3-1 (Guard)[Repeat] - 11,{0x0406,0},{0x07ee,0},{0,0}, {0,0},{{4},{14,2}}, -- MISSION 3-2 (dialog with the guard after trade) - 11,{0,0}, {0,0}, {0x022c,0},{0,0},{{14,0},{5,400},{12}}, -- MISSION 3-2 (Chalvatot) - 11,{0x03f5,0},{0x07dd,0},{0,0}, {0,0},{{4},{14,0},{5,400},{12}}, -- MISSION 3-2 (Guard)[Repeat] - 12,{0,0}, {0,0}, {0x0027,0},{0,0},{{11,4},{14,0},{6},{8,5000},{12}}, -- MISSION 3-3 (Finish (Nelcabrit)) + 10,{0,0}, {0,0}, {0x022a,0},{0,0},{{9,237},{14,0},{5,400},{12}}, -- MISSION 3-1 (Prince Trion (door)) + 10,{0x03f4,0},{0x07dc,0},{0,0}, {0,0},{{14,0},{5,300},{12}}, -- MISSION 3-1 (Guard)[Repeat] + 11,{0x0406,0},{0x07ee,0},{0,0}, {0,0},{{4},{14,2}}, -- MISSION 3-2 (dialog with the guard after trade) + 11,{0,0}, {0,0}, {0x022c,0},{0,0},{{14,0},{5,400},{12}}, -- MISSION 3-2 (Chalvatot) + 11,{0x03f5,0},{0x07dd,0},{0,0}, {0,0},{{4},{14,0},{5,400},{12}}, -- MISSION 3-2 (Guard)[Repeat] + 12,{0,0}, {0,0}, {0x0027,0},{0,0},{{11,4},{14,0},{6},{8,5000},{12}}, -- MISSION 3-3 (Finish (Nelcabrit)) 13,{0,0}, {0,0}, {0x0024,0},{0,0},{{11,5},{14,0},{13,212},{10,69},{6},{8,10000},{12},{1,14}}, -- MISSION 4-1 (Finish (Nelcabrit)) - 14,{0,0}, {0,0}, {0x0215,0},{0,0},{{10,72},{14,10}}, -- MISSION 5-1 (Finish (Halver)) - 14,{0,0}, {0,0}, {0x0216,0},{0,0},{{9,73},{5,400},{14,0},{13,10},{12}}, -- MISSION 5-1 (Finish (Halver)) - 15,{0,0}, {0,0}, {0x0224,0},{0,0},{{11,6},{14,4}}, -- MISSION 5-2 (Finish 1st Part (Halver)) - 15,{0,0}, {0,0}, {0x003D,0},{0,0},{{14,0},{9,74},{8,20000},{6},{12}}, -- MISSION 5-2 (Finish 2nd Part (Trion in Great Hall)) - 16,{0,0}, {0,0}, {0x006f,0},{0,0},{{14,0},{9,268},{10,270},{12}}, -- MISSION 6-1 (Finish (Chalvatot)) - 17,{0x040a,0},{0x0409,0},{0,0},{0,0},{{14,0},{11,7},{8,40000},{6},{12}}, -- MISSION 6-2 (Finish (Guard)) - 18,{0,0}, {0,0}, {0x0007,0},{0,0},{{14,1}}, -- MISSION 7-1 (setVar("MissionStatus",1) (Door: Papal Chambers)) - 18,{0,0}, {0,0}, {0x0008,0},{0,0},{{14,0},{9,283},{5,1000},{12}} -- MISSION 7-1 (Finish (Door: Papal Chambers)) + 14,{0,0}, {0,0}, {0x0215,0},{0,0},{{10,72},{14,10}}, -- MISSION 5-1 (Finish (Halver)) + 14,{0,0}, {0,0}, {0x0216,0},{0,0},{{9,73},{5,400},{14,0},{13,10},{12}}, -- MISSION 5-1 (Finish (Halver)) + 15,{0,0}, {0,0}, {0x0224,0},{0,0},{{11,6},{14,4}}, -- MISSION 5-2 (Finish 1st Part (Halver)) + 15,{0,0}, {0,0}, {0x003D,0},{0,0},{{14,0},{9,74},{8,20000},{6},{12}}, -- MISSION 5-2 (Finish 2nd Part (Trion in Great Hall)) + 16,{0,0}, {0,0}, {0x006f,0},{0,0},{{14,0},{5,600},{9,268},{10,270},{12}}, -- MISSION 6-1 (Finish (Chalvatot)) + 17,{0x040a,0},{0x0409,0},{0,0},{0,0},{{14,0},{11,7},{8,40000},{6},{12}}, -- MISSION 6-2 (Finish (Guard)) + 18,{0,0}, {0,0}, {0x0007,0},{0,0},{{14,1}}, -- MISSION 7-1 (setVar("MissionStatus",1) (Door: Papal Chambers)) + 18,{0,0}, {0,0}, {0x0008,0},{0,0},{{14,0},{9,283},{5,700},{12}}, -- MISSION 7-1 (Finish (Door: Papal Chambers)) + 19,{0x0414,0},{0x0413,0},{0,0},{0,0},{{14,0},{6},{3,"SecretWeapon",0},{9,284},{11,8},{8,60000},{12}}, -- MISSION 7-2 (Finish (Guard)) + 20,{0,0}, {0,0}, {0x0066,0},{0,0},{{14,0},{9,288},{5,800},{12}}, -- MISSION 8-1 (Finish (Halver)) + 21,{0,0}, {0,0}, {0x0068,0},{0,0},{{14,0},{9,284},{11,9},{8,80000},{6},{12}}, -- MISSION 8-2 (Finish (Door: Great Hall)) + 22,{0,0}, {0,0}, {0x0020,0},{0,0},{{14,1}}, -- MISSION 9-1 (setVar("MissionStatus",1) (Door: Great Hall)) + 22,{0,0}, {0,0}, {0x004c,0},{0,0},{{14,0},{9,481},{9,482},{9,483},{5,900},{12}} -- MISSION 9-1 (Finish (Door: Great Hall)) --[[0,{0,0},{0,0},{0,0},{0,0},{0},{0,0},{0,0},{0,0},{0,0},{0}, 0,{0,0},{0,0},{0,0},{0,0},{0},{0,0},{0,0},{0,0},{0,0},{0}, ]]-- }; @@ -858,26 +863,26 @@ timeline = {option,{0x03E9,option},{0,0},{0,0},{0,0},{{1},{2}}}; else timeline = { - 0,{0x03e8,0},{0,0},{0,0},{0,0},{{1},{2}}, -- MISSION 1-1 (First Mission [START]) - 1,{0x01f8,0},{0,0},{0,0},{0,0},{{9,4},{12}}, -- MISSION 1-2 (Finish Mission) - 2,{0x03F0,0},{0,0},{0,0},{0,0},{{4},{11,2},{8,1000},{12}}, -- MISSION 1-3 - 2,{0x03ED,0},{0,0},{0,0},{0,0},{{4},{8,1000},{12}}, -- MISSION 1-3 [Repeat] - 3,{0x02c8,0},{0,0},{0,0},{0,0},{{9,12},{14,0},{5,200},{12}}, -- MISSION 2-1 (Finish (Ayame)) - 4,{0x0174,0},{0,0},{0,0},{0,0},{{4},{5,250},{12}}, -- MISSION 2-2 (Finish (Alois)) - 4,{0x0175,0},{0,0},{0,0},{0,0},{{4},{5,250},{12}}, -- MISSION 2-2 (Finish (Alois)) [Repeat] - 5,{0x02ca,0},{0,0},{0,0},{0,0},{{10,35},{6},{13,207},{8,3000},{11,3},{9,29},{14,0},{12}}, -- MISSION 2-3 (Finish (Naji)) - 10,{0x000b,0},{0,0},{0,0},{0,0},{{14,0},{5,350},{12}}, -- MISSION 3-1 (Pashhow Marshlands Zone) - 11,{0x03F2,0},{0,0},{0,0},{0,0},{{4},{5,400},{12}}, -- MISSION 3-2 - 11,{0x03EE,0},{0,0},{0,0},{0,0},{{4},{5,400},{12}}, -- MISSION 3-2 [Repeat] - 12,{0x0026,0},{0,0},{0,0},{0,0},{{11,4},{14,0},{6},{8,5000},{12}}, -- MISSION 3-3 (Finish (Goggehn)) + 0,{0x03e8,0},{0,0},{0,0},{0,0},{{1},{2}}, -- MISSION 1-1 (First Mission [START]) + 1,{0x01f8,0},{0,0},{0,0},{0,0},{{9,4},{12}}, -- MISSION 1-2 (Finish Mission) + 2,{0x03F0,0},{0,0},{0,0},{0,0},{{4},{11,2},{8,1000},{12}}, -- MISSION 1-3 + 2,{0x03ED,0},{0,0},{0,0},{0,0},{{4},{8,1000},{12}}, -- MISSION 1-3 [Repeat] + 3,{0x02c8,0},{0,0},{0,0},{0,0},{{9,12},{14,0},{5,200},{12}}, -- MISSION 2-1 (Finish (Ayame)) + 4,{0x0174,0},{0,0},{0,0},{0,0},{{4},{5,250},{12}}, -- MISSION 2-2 (Finish (Alois)) + 4,{0x0175,0},{0,0},{0,0},{0,0},{{4},{5,250},{12}}, -- MISSION 2-2 (Finish (Alois)) [Repeat] + 5,{0x02ca,0},{0,0},{0,0},{0,0},{{10,35},{6},{13,207},{8,3000},{11,3},{9,29},{14,0},{12}}, -- MISSION 2-3 (Finish (Naji)) + 10,{0x000b,0},{0,0},{0,0},{0,0},{{14,0},{5,350},{12}}, -- MISSION 3-1 (Pashhow Marshlands Zone) + 11,{0x03F2,0},{0,0},{0,0},{0,0},{{4},{5,400},{12}}, -- MISSION 3-2 + 11,{0x03EE,0},{0,0},{0,0},{0,0},{{4},{5,400},{12}}, -- MISSION 3-2 [Repeat] + 12,{0x0026,0},{0,0},{0,0},{0,0},{{11,4},{14,0},{6},{8,5000},{12}}, -- MISSION 3-3 (Finish (Goggehn)) 13,{0x0023,0},{0,0},{0,0},{0,0},{{11,5},{14,0},{13,212},{10,70},{6},{8,10000},{12},{1,14}}, -- MISSION 4-1 (Finish (Goggehn)) - 14,{0x02d2,0},{0,0},{0,0},{0,0},{{14,0},{9,73},{5,600},{12}}, -- MISSION 5-1 (Finish (Naji)) - 15,{0x025b,0},{0,0},{0,0},{0,0},{{11,6},{14,0},{9,74},{8,20000},{6},{12}}, -- MISSION 5-2 (Finish (Naji)) - 16,{0x00b6,0},{0,0},{0,0},{0,0},{{14,0},{9,266},{5,650},{12}}, -- MISSION 6-1 (Finish (Tall Mountain)) - 17,{0x02fa,0},{0,0},{0,0},{0,0},{{14,0},{6},{11,7},{8,40000},{12}}, -- MISSION 6-2 (Finish (Naji)) - 18,{0x02fc,0},{0,0},{0,0},{0,0},{{14,0},{9,289},{5,700},{12}}, -- MISSION 7-1 (Finish (Cid)) + 14,{0x02d2,0},{0,0},{0,0},{0,0},{{14,0},{9,73},{5,600},{12}}, -- MISSION 5-1 (Finish (Naji)) + 15,{0x025b,0},{0,0},{0,0},{0,0},{{11,6},{14,0},{9,74},{8,20000},{6},{12}}, -- MISSION 5-2 (Finish (Naji)) + 16,{0x00b6,0},{0,0},{0,0},{0,0},{{14,0},{9,266},{5,650},{12}}, -- MISSION 6-1 (Finish (Tall Mountain)) + 17,{0x02fa,0},{0,0},{0,0},{0,0},{{14,0},{6},{11,7},{8,40000},{12}}, -- MISSION 6-2 (Finish (Naji)) + 18,{0x02fc,0},{0,0},{0,0},{0,0},{{14,0},{9,289},{5,700},{12}}, -- MISSION 7-1 (Finish (Cid)) 19,{0x02fe,0},{0,0},{0,0},{0,0},{{14,0},{6},{11,8},{8,60000},{3,"OptionalCSforOMW",1},{12}}, -- MISSION 7-2 (Finish (Karst)) - 20,{0x0300,0},{0,0},{0,0},{0,0},{{14,0},{5,1133},{12}} -- MISSION 8-1 (Finish (Iron Eater)) + 20,{0x0300,0},{0,0},{0,0},{0,0},{{14,0},{5,1133},{12}} -- MISSION 8-1 (Finish (Iron Eater)) }; end elseif(nation == WINDURST) then @@ -886,26 +891,26 @@ timeline = {option,{guardlist[guard],option},{guardlist[guard],option},{guardlist[guard],option},{guardlist[guard],option},{{1},{2}}}; else timeline = { - 0,{0x0079,1},{0x0076,1},{0x0053,1},{0x0060,1},{{1},{2}}, -- MISSION 1-1 (First Mission [START]) - 0,{0x005e,0},{0,0}, {0,0}, {0,0}, {{14,0},{5,150},{9,28},{12}}, -- MISSION 1-1 (Finish (Hakkuru-Rinkuru)) - 1,{0x0084,1},{0x0082,1},{0x0068,1},{0x006a,1},{{1},{2}}, -- MISSION 1-2 [START] - 1,{0x008f,0},{0,0}, {0,0}, {0,0}, {{14,0},{5,200},{12}}, -- MISSION 1-2 (Finish (Apururu)) [WITHOUT ORB] - 1,{0x0091,0},{0,0}, {0,0}, {0,0}, {{14,0},{5,250},{12}}, -- MISSION 1-2 (Finish (Apururu)) [WITH ORB] - 2,{0x0095,2},{0x0083,2},{0x006d,2},{0x006f,2},{{1},{2}}, -- MISSION 1-3 [START] - 2,{0x009A,0},{0x0094,0},{0x0072,0},{0x0074,0},{{11,2},{14,0},{5,300},{8,1000},{12}}, -- MISSION 1-3 - 3,{0x00a8,0},{0,0}, {0,0}, {0,0}, {{14,0},{5,350},{12}}, -- MISSION 2-1 (Finish (Tosuka-Porika)) - 4,{0x00C9,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,38},{5,400},{12}}, -- MISSION 2-2 (Finish (Moreno-Toeno)) (+35 mob killed) - 4,{0x00CE,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,38},{5,400},{12}}, -- MISSION 2-2 (Finish (Moreno-Toeno)) (+35 mob killed) [Repeat] - 4,{0x00C8,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,38},{5,250},{12}}, -- MISSION 2-2 (Finish (Moreno-Toeno)) (30-34 mob killed) - 4,{0x00D1,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,38},{5,250},{12}}, -- MISSION 2-2 (Finish (Moreno-Toeno)) (30-34 mob killed) [Repeat] - 5,{0x0065,0},{0,0}, {0,0}, {0,0}, {{10,35},{6},{13,207},{8,3000},{11,3},{9,29},{14,0},{12}},-- MISSION 2-3 (Finish (Kupipi)) - 10,{0,0}, {0x0072,0},{0,0}, {0,0}, {{5,450},{14,0},{12}}, -- MISSION 3-1 (Finish (Rhy Epocan)) - 11,{0x0087,0},{0,0}, {0,0}, {0,0}, {{5,500},{14,0},{12}}, -- MISSION 3-2 (Finish (Zubaba)) - 11,{0x0097,0},{0,0}, {0,0}, {0,0}, {{5,400},{14,0},{12}}, -- MISSION 3-2 (Finish (Zubaba)) [Repeat] - 12,{0x0028,0},{0,0}, {0,0}, {0,0}, {{11,4},{9,30},{14,0},{6},{8,5000},{12}}, -- MISSION 3-3 (Finish (Ambassador's door)) + 0,{0x0079,1},{0x0076,1},{0x0053,1},{0x0060,1},{{1},{2}}, -- MISSION 1-1 (First Mission [START]) + 0,{0x005e,0},{0,0}, {0,0}, {0,0}, {{14,0},{5,150},{9,28},{12}}, -- MISSION 1-1 (Finish (Hakkuru-Rinkuru)) + 1,{0x0084,1},{0x0082,1},{0x0068,1},{0x006a,1},{{1},{2}}, -- MISSION 1-2 [START] + 1,{0x008f,0},{0,0}, {0,0}, {0,0}, {{14,0},{5,200},{12}}, -- MISSION 1-2 (Finish (Apururu)) [WITHOUT ORB] + 1,{0x0091,0},{0,0}, {0,0}, {0,0}, {{14,0},{5,250},{12}}, -- MISSION 1-2 (Finish (Apururu)) [WITH ORB] + 2,{0x0095,2},{0x0083,2},{0x006d,2},{0x006f,2},{{1},{2}}, -- MISSION 1-3 [START] + 2,{0x009A,0},{0x0094,0},{0x0072,0},{0x0074,0},{{11,2},{14,0},{5,300},{8,1000},{12}}, -- MISSION 1-3 + 3,{0x00a8,0},{0,0}, {0,0}, {0,0}, {{14,0},{5,350},{12}}, -- MISSION 2-1 (Finish (Tosuka-Porika)) + 4,{0x00C9,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,38},{5,400},{12}}, -- MISSION 2-2 (Finish (Moreno-Toeno)) (+35 mob killed) + 4,{0x00CE,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,38},{5,400},{12}}, -- MISSION 2-2 (Finish (Moreno-Toeno)) (+35 mob killed) [Repeat] + 4,{0x00C8,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,38},{5,250},{12}}, -- MISSION 2-2 (Finish (Moreno-Toeno)) (30-34 mob killed) + 4,{0x00D1,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,38},{5,250},{12}}, -- MISSION 2-2 (Finish (Moreno-Toeno)) (30-34 mob killed) [Repeat] + 5,{0x0065,0},{0,0}, {0,0}, {0,0}, {{10,35},{6},{13,207},{8,3000},{11,3},{9,29},{14,0},{12}}, -- MISSION 2-3 (Finish (Kupipi)) + 10,{0,0}, {0x0072,0},{0,0}, {0,0}, {{5,450},{14,0},{12}}, -- MISSION 3-1 (Finish (Rhy Epocan)) + 11,{0x0087,0},{0,0}, {0,0}, {0,0}, {{5,500},{14,0},{12}}, -- MISSION 3-2 (Finish (Zubaba)) + 11,{0x0097,0},{0,0}, {0,0}, {0,0}, {{5,400},{14,0},{12}}, -- MISSION 3-2 (Finish (Zubaba)) [Repeat] + 12,{0x0028,0},{0,0}, {0,0}, {0,0}, {{11,4},{9,30},{14,0},{6},{8,5000},{12}}, -- MISSION 3-3 (Finish (Ambassador's door)) 13,{0x0025,0},{0,0}, {0,0}, {0,0}, {{11,5},{14,0},{13,212},{10,71},{6},{8,10000},{12}}, -- MISSION 4-1 (Finish (Pakh Jatalfih)) - 14,{0x00C0,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,73},{5,600},{12}}, -- MISSION 5-1 (Finish (Star Sibyl)) - 15,{0x00D8,0},{0,0}, {0,0}, {0,0}, {{11,6},{14,0},{9,74},{8,20000},{6},{12}} -- MISSION 5-2 (Finish (Star Sibyl)) + 14,{0x00C0,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,73},{5,600},{12}}, -- MISSION 5-1 (Finish (Star Sibyl)) + 15,{0x00D8,0},{0,0}, {0,0}, {0,0}, {{11,6},{14,0},{9,74},{8,20000},{6},{12}} -- MISSION 5-2 (Finish (Star Sibyl)) }; end end Index: scripts/globals/monstertpmoves.lua =================================================================== --- scripts/globals/monstertpmoves.lua (revision 3304) +++ scripts/globals/monstertpmoves.lua (working copy) @@ -1,6 +1,7 @@ require("scripts/globals/magic"); require("scripts/globals/magicburst") require("scripts/globals/status") +require("scripts/globals/utils") -- Foreword: A lot of this is good estimating since the FFXI playerbase has not found all of info for individual moves. -- What is known is that they roughly follow player Weaponskill calculations (pDIF, dMOD, ratio, etc) so this is what @@ -636,6 +637,7 @@ if(skilltype == MOBSKILL_PHYSICAL) then dmg = utils.physicalDmgTaken(target, dmg); + utils.dmgToTP(target, dmg); elseif(skilltype == MOBSKILL_MAGICAL) then @@ -648,6 +650,7 @@ elseif(skilltype == MOBSKILL_RANGED) then dmg = utils.rangedDmgTaken(target, dmg); + utils.dmgToTP(target, dmg); end @@ -659,6 +662,7 @@ end dmg = utils.stoneskin(target, dmg); + utils.dmgToMP(target, dmg); return dmg; end; Index: scripts/globals/quests.lua =================================================================== --- scripts/globals/quests.lua (revision 3304) +++ scripts/globals/quests.lua (working copy) @@ -280,7 +280,7 @@ FLOWER_CHILD = 65; -- -- THE_THREE_MAGI = 66; -- -- RECOLLECTIONS = 67; -- -- -THE_ROOT_OF_THE_PROBLEM = 68; +THE_ROOT_OF_THE_PROBLEM = 68; -- -- THE_TENSHODO_SHOWDOWN = 69; -- + -- AS_THICK_AS_THIEVES = 70; -- + -- HITTING_THE_MARQUISATE = 71; -- + -- @@ -444,9 +444,9 @@ WHENCE_BLOWS_THE_WIND = 130; -- + -- RIDING_ON_THE_CLOUDS = 131; -- + -- SHATTERING_STARS = 132; -- + -- -NEW_WORLDS_AWAIT = 133; -EXPANDING_HORIZONS = 134; -BEYOND_THE_STARS = 135; +NEW_WORLDS_AWAIT = 133; -- + -- +EXPANDING_HORIZONS = 134; -- + -- +BEYOND_THE_STARS = 135; -- + -- DORMANT_POWERS_DISLODGED = 136; BEYOND_INFINITY = 137; @@ -492,7 +492,7 @@ TRIAL_BY_LIGHTNING = 27; -- -- TRIAL_SIZE_TRIAL_BY_LIGHTNING = 28; -- + -- IT_S_RAINING_MANNEQUINS = 29; -RECYCLING_RODS = 30; +RECYCLING_RODS = 30; -- -- PICTURE_PERFECT = 31; WAKING_THE_BEAST = 32; SURVIVAL_OF_THE_WISEST = 33; @@ -585,8 +585,8 @@ THE_KUFTAL_TOUR = 195; THE_IMMORTAL_LU_SHANG = 196; -- -- TRIAL_SIZE_TRIAL_BY_WIND = 197; -- -- -CHASING_DREAMS = 199; -- CoP Quest -THE_SEARCH_FOR_GOLDMANE = 200; -- CoP Quest +CHASING_DREAMS = 199; -- CoP Quest +THE_SEARCH_FOR_GOLDMANE = 200; -- CoP Quest INDOMITABLE_SPIRIT = 201; -- -- ----------------------------------- @@ -601,9 +601,9 @@ AN_EMPTY_VESSEL = 5; -- + -- LUCK_OF_THE_DRAW = 6; -- -- NO_STRINGS_ATTACHED = 7; -- + -- -FINDING_FAULTS = 8; -GIVE_PEACE_A_CHANCE = 9; -THE_ART_OF_WAR = 10; +FINDING_FAULTS = 8; +GIVE_PEACE_A_CHANCE = 9; +THE_ART_OF_WAR = 10; na = 11; A_TASTE_OF_HONEY = 12; SUCH_SWEET_SORROW = 13; @@ -611,21 +611,21 @@ COOK_A_ROON = 15; THE_DIE_IS_CAST = 16; TWO_HORN_THE_SAVAGE = 17; -TOTOROONS_TREASURE_HUNT = 18; -WHAT_FRIENDS_ARE_FOR = 19; -ROCK_BOTTOM = 20; -BEGINNINGS = 21; -OMENS = 22; -TRANSFORMATIONS = 23; +TOTOROONS_TREASURE_HUNT = 18; +WHAT_FRIENDS_ARE_FOR = 19; +ROCK_BOTTOM = 20; +BEGINNINGS = 21; +OMENS = 22; +TRANSFORMATIONS = 23; EQUIPED_FOR_ALL_OCCASIONS = 24; -- + -- NAVIGATING_THE_UNFRIENDLY_SEAS = 25; -- + -- -AGAINST_ALL_ODDS = 26; -THE_WAYWARD_AUTOMATION = 27; -OPERATION_TEATIME = 28; -PUPPETMASTER_BLUES = 29; -MOMENT_OF_TRUTH = 30; +AGAINST_ALL_ODDS = 26; +THE_WAYWARD_AUTOMATION = 27; +OPERATION_TEATIME = 28; +PUPPETMASTER_BLUES = 29; +MOMENT_OF_TRUTH = 30; THREE_MEN_AND_A_CLOSET = 31; -- + -- -FIVE_SECONDS_OF_FAME = 32; +FIVE_SECONDS_OF_FAME = 32; DELIVERING_THE_GOODS = 61; -- + -- VANISHING_ACT = 62; -- + -- @@ -638,100 +638,125 @@ -- Crystal War ----------------------------------- -LOST_IN_TRANSLOCATION = 0; -MESSAGE_ON_THE_WINDS = 1; -THE_WEEKLY_ADVENTURER = 2; -HEALING_HERBS = 3; -REDEEMING_ROCKS = 4; -THE_DAWN_OF_DELECTABILITY = 5; -A_LITTLE_KNOWLEDGE = 6; -THE_FIGHTING_FOURTH = 7; -SNAKE_ON_THE_PLAINS = 8; -STEAMED_RAMS = 9; +LOST_IN_TRANSLOCATION = 0; +MESSAGE_ON_THE_WINDS = 1; +THE_WEEKLY_ADVENTURER = 2; +HEALING_HERBS = 3; +REDEEMING_ROCKS = 4; +THE_DAWN_OF_DELECTABILITY = 5; +A_LITTLE_KNOWLEDGE = 6; +THE_FIGHTING_FOURTH = 7; +SNAKE_ON_THE_PLAINS = 8; +STEAMED_RAMS = 9; SEEING_SPOTS = 10; -- + -- -THE_FLIPSIDE_OF_THINGS = 11; -BETTER_PART_OF_VALOR = 12; -FIRES_OF_DISCONTENT = 13; -HAMMERING_HEARTS = 14; -GIFTS_OF_THE_GRIFFON = 15; -CLAWS_OF_THE_GRIFFON = 16; -THE_TIGRESS_STIRS = 17; -THE_TIGRESS_STRIKES = 18; -LIGHT_IN_THE_DARKNESS = 19; -BURDEN_OF_SUSPICION = 20; -EVIL_AT_THE_INLET = 21; -THE_FUMBLING_FRIAR = 22; -REQUIEM_FOR_THE_DEPARTED = 23; -BOY_AND_THE_BEAST = 24; -WRATH_OF_THE_GRIFFON = 25; -THE_LOST_BOOK = 26; -KNOT_QUITE_THERE = 27; -A_MANIFEST_PROBLEM = 28; -BEANS_AHOY = 29; -- + -- -BEAST_FROM_THE_EAST = 30; -THE_SWARM = 31; -OH_SABBATICAL = 32; -DOWNWARD_HELIX = 33; -SEEING_BLOOD_RED = 34; -STORM_ON_THE_HORIZON = 35; -FIRE_IN_THE_HOLE = 36; -PERILS_OF_THE_GRIFFON = 37; -IN_A_HAZE_OF_GLORY = 38; -WHEN_ONE_MAN_IS_NOT_ENOUGH = 39; -A_FEAST_FOR_GNATS = 40; -SAY_IT_WITH_A_HANDBAG = 41; -QUELLING_THE_STORM = 42; -HONOR_UNDER_FIRE = 43; -THE_PRICE_OF_VALOR = 44; -BONDS_THAT_NEVER_DIE = 45; -THE_LONG_MARCH_NORTH = 46; -THE_FORBIDDEN_PATH = 47; -A_JEWELERS_LAMENT = 48; -BENEATH_THE_MASK = 49; -WHAT_PRICE_LOYALTY = 50; -SONGBIRDS_IN_A_SNOWSTORM = 51; -BLOOD_OF_HEROES = 52; -SINS_OF_THE_MOTHERS = 53; -HOWL_FROM_THE_HEAVENS = 54; -SUCCOR_TO_THE_SIDHE = 55; -THE_YOUNG_AND_THE_THREADLESS = 56; -SON_AND_FATHER = 57; -THE_TRUTH_LIES_HID = 58; -BONDS_OF_MYTHRIL = 59; -CHASING_SHADOWS = 60; -FACE_OF_THE_FUTURE = 61; -MANIFEST_DESTINY = 62; -AT_JOURNEYS_END = 63; -HER_MEMORIES_HOMECOMING_QUEEN = 64; -HER_MEMORIES_OLD_BEAN = 65; -HER_MEMORIES_THE_FAUX_PAS = 66; -HER_MEMORIES_THE_GRAVE_RESOLVE = 67; -HER_MEMORIES_OPERATION_CUPID = 68; -HER_MEMORIES_CARNELIAN_FOOTFALLS = 69; -HER_MEMORIES_AZURE_FOOTFALLS = 70; -HER_MEMORIES_VERDURE_FOOTFALLS = 71; -HER_MEMORIES_OF_MALIGN_MALADIES = 72; -GUARDIAN_OF_THE_VOID = 80; -DRAFTED_BY_THE_DUCHY = 81; -BATTLE_ON_A_NEW_FRONT = 82; -VOIDWALKER_OP_126 = 83; -A_CAIT_CALLS = 84; -THE_TRUTH_IS_OUT_THERE = 85; -REDRAFTED_BY_THE_DUCHY = 86; -A_NEW_MENACE = 87; -NO_REST_FOR_THE_WEARY = 88; -A_WORLD_IN_FLUX = 89; -BETWEEN_A_ROCK_AND_RIFT = 90; -A_FAREWELL_TO_FELINES = 91; -THIRD_TOUR_OF_DUCHY = 92; -GLIMMER_OF_HOPE = 93; -BRACE_FOR_THE_UNKNOWN = 94; -PROVENANCE = 95; -CRYSTAL_GUARDIAN = 96; -ENDINGS_AND_BEGINNINGS = 97; -AD_INFINITUM = 98; +THE_FLIPSIDE_OF_THINGS = 11; +BETTER_PART_OF_VALOR = 12; +FIRES_OF_DISCONTENT = 13; +HAMMERING_HEARTS = 14; +GIFTS_OF_THE_GRIFFON = 15; +CLAWS_OF_THE_GRIFFON = 16; +THE_TIGRESS_STIRS = 17; +THE_TIGRESS_STRIKES = 18; +LIGHT_IN_THE_DARKNESS = 19; +BURDEN_OF_SUSPICION = 20; +EVIL_AT_THE_INLET = 21; +THE_FUMBLING_FRIAR = 22; +REQUIEM_FOR_THE_DEPARTED = 23; +BOY_AND_THE_BEAST = 24; +WRATH_OF_THE_GRIFFON = 25; +THE_LOST_BOOK = 26; +KNOT_QUITE_THERE = 27; +A_MANIFEST_PROBLEM = 28; +BEANS_AHOY = 29; -- + -- +BEAST_FROM_THE_EAST = 30; +THE_SWARM = 31; +OH_SABBATICAL = 32; +DOWNWARD_HELIX = 33; +SEEING_BLOOD_RED = 34; +STORM_ON_THE_HORIZON = 35; +FIRE_IN_THE_HOLE = 36; +PERILS_OF_THE_GRIFFON = 37; +IN_A_HAZE_OF_GLORY = 38; +WHEN_ONE_MAN_IS_NOT_ENOUGH = 39; +A_FEAST_FOR_GNATS = 40; +SAY_IT_WITH_A_HANDBAG = 41; +QUELLING_THE_STORM = 42; +HONOR_UNDER_FIRE = 43; +THE_PRICE_OF_VALOR = 44; +BONDS_THAT_NEVER_DIE = 45; +THE_LONG_MARCH_NORTH = 46; +THE_FORBIDDEN_PATH = 47; +A_JEWELERS_LAMENT = 48; +BENEATH_THE_MASK = 49; +WHAT_PRICE_LOYALTY = 50; +SONGBIRDS_IN_A_SNOWSTORM = 51; +BLOOD_OF_HEROES = 52; +SINS_OF_THE_MOTHERS = 53; +HOWL_FROM_THE_HEAVENS = 54; +SUCCOR_TO_THE_SIDHE = 55; +THE_YOUNG_AND_THE_THREADLESS = 56; +SON_AND_FATHER = 57; +THE_TRUTH_LIES_HID = 58; +BONDS_OF_MYTHRIL = 59; +CHASING_SHADOWS = 60; +FACE_OF_THE_FUTURE = 61; +MANIFEST_DESTINY = 62; +AT_JOURNEYS_END = 63; +HER_MEMORIES_HOMECOMING_QUEEN = 64; +HER_MEMORIES_OLD_BEAN = 65; +HER_MEMORIES_THE_FAUX_PAS = 66; +HER_MEMORIES_THE_GRAVE_RESOLVE = 67; +HER_MEMORIES_OPERATION_CUPID = 68; +HER_MEMORIES_CARNELIAN_FOOTFALLS= 69; +HER_MEMORIES_AZURE_FOOTFALLS = 70; +HER_MEMORIES_VERDURE_FOOTFALLS = 71; +HER_MEMORIES_OF_MALIGN_MALADIES = 72; +GUARDIAN_OF_THE_VOID = 80; +DRAFTED_BY_THE_DUCHY = 81; +BATTLE_ON_A_NEW_FRONT = 82; +VOIDWALKER_OP_126 = 83; +A_CAIT_CALLS = 84; +THE_TRUTH_IS_OUT_THERE = 85; +REDRAFTED_BY_THE_DUCHY = 86; +A_NEW_MENACE = 87; +NO_REST_FOR_THE_WEARY = 88; +A_WORLD_IN_FLUX = 89; +BETWEEN_A_ROCK_AND_RIFT = 90; +A_FAREWELL_TO_FELINES = 91; +THIRD_TOUR_OF_DUCHY = 92; +GLIMMER_OF_HOPE = 93; +BRACE_FOR_THE_UNKNOWN = 94; +PROVENANCE = 95; +CRYSTAL_GUARDIAN = 96; +ENDINGS_AND_BEGINNINGS = 97; +AD_INFINITUM = 98; +THE_WEEKLY_ADVENTURER = 2; +THE_FIGHTING_FOURTH = 7; + ----------------------------------- -- Abyssea ----------------------------------- + +CATERING_CAPERS = 0; +GIFT_OF_LIGHT = 1; +FEAR_OF_THE_DARK_III = 2; +AN_EYE_FOR_REVENGE = 3; +UNBREAK_HIS_HEART = 4; +EXPLOSIVE_ENDEAVORS = 5; +THE_ANGLING_ARMORER = 6; +WATER_OF_LIFE = 7; +OUT_OF_TOUCH = 8; +LOST_MEMORIES = 9; +HOPE_BLOOMS_ON_THE_BATTLEFIELD = 10; +OF_MALNOURISHED_MARTELLOS = 11; +ROSE_ON_THE_HEATH = 12; +FULL_OF_THE_HIMSELF_ALCHEMIST = 13; +THE_WALKING_WOUNDED = 14; +SHADY_BUSINESS_REDUX = 15; +ADDLED_MIND_UNDYING_DREAMS = 16; +THE_SOUL_OF_THE_MATTER = 17; +SECRET_AGENT_MAN = 18; +PLAYING_PAPARAZZI = 19; +HIS_BOX_HIS_BELOVED = 20; \ No newline at end of file Index: scripts/globals/server.lua =================================================================== --- scripts/globals/server.lua (revision 3304) +++ scripts/globals/server.lua (working copy) @@ -4,6 +4,7 @@ -- ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/conquest"); require("scripts/globals/keyitems"); require("scripts/globals/missions"); @@ -25,16 +26,22 @@ if (FIELD_MANUALS == 1) then SetFieldManual(); end + + -- Harvest Festival + if(isHalloweenEnabled() ~= 0) then + applyHalloweenNpcCostumes() + end + SetRegionalConquestOverseers() - -- Charybdis PH alternates, remove one - DespawnMob(17498518); - - -- Timed Spawns - SetTimedSpawns(); - - -- Spawns Silk Caterpillar (temporary until someone implements a way to make it spawn properly) - SpawnMob(17227782,300,660); + -- Charybdis PH alternates, remove one + DespawnMob(17498518); + + -- Timed Spawns + SetTimedSpawns(); + + -- Spawns Silk Caterpillar (temporary until someone implements a way to make it spawn properly) + SpawnMob(17227782,300,660); end; ----------------------------------- Index: scripts/globals/settings.lua =================================================================== --- scripts/globals/settings.lua (revision 3304) +++ scripts/globals/settings.lua (working copy) @@ -18,56 +18,57 @@ --See chocoprice.lua to adjust chocobo stables. --require("scripts/globals/chocoprice"); -- Enable Extension (1= yes 0= no) -ENABLE_COP = 0; -ENABLE_TOAU = 0; -ENABLE_WOTG = 0; +ENABLE_COP = 1; +ENABLE_TOAU = 1; +ENABLE_WOTG = 1; -- CHARACTER CONFIG -INITIAL_LEVEL_CAP = 50; --The initial level cap for new players. There seems to be a hardcap of 255. -MAX_LEVEL = 75; -- Level max of the server, works by disabling Maat quests. -START_GIL = 10; --Amount of gil given to newly created characters. -START_INVENTORY = 30; --Starting inventory and satchel size. Ignores values < 30. Do not set above 80! +INITIAL_LEVEL_CAP = 99; --The initial level cap for new players. There seems to be a hardcap of 255. +MAX_LEVEL = 99; -- Level max of the server, works by disabling Maat quests. +START_GIL = 10000000; --Amount of gil given to newly created characters. +START_INVENTORY = 80; --Starting inventory and satchel size. Ignores values < 30. Do not set above 80! OPENING_CUTSCENE_ENABLE = 0; --Set to 1 to enable opening cutscenes, 0 to disable. -SUBJOB_QUEST_LEVEL = 18; --Minimum level to accept either subjob quest. Set to 0 to start the game with subjobs unlocked. -ADVANCED_JOB_LEVEL = 30; --Minimum level to accept advanced job quests. Set to 0 to start the game with advanced jobs. -ALL_MAPS = 0; -- Set to 1 to give starting characters all the maps. +SUBJOB_QUEST_LEVEL = 0; --Minimum level to accept either subjob quest. Set to 0 to start the game with subjobs unlocked. +ADVANCED_JOB_LEVEL = 0; --Minimum level to accept advanced job quests. Set to 0 to start the game with advanced jobs. +ALL_MAPS = 1; -- Set to 1 to give starting characters all the maps. SHOP_PRICE = 1.000; --Multiplies prices in NPC shops. GIL_RATE = 1.000; --Multiplies gil earned from quests. Won't always display in game. -EXP_RATE = 1.000; --Multiplies exp earned from fov. +EXP_RATE = 10.000; --Multiplies exp earned from fov. TABS_RATE = 1.000; --Multiplies tabs earned from fov. -SAN_FAME = 1.000; --Multiplies fame earned from San d'Oria quests. -BAS_FAME = 1.000; --Multiplies fame earned from Bastok quests. -WIN_FAME = 1.000; --Multiplies fame earned from Windurst quests. -NORG_FAME = 1.000; --Multiplies fame earned from Norg and Tenshodo quests. +SAN_FAME = 2.000; --Multiplies fame earned from San d'Oria quests. +BAS_FAME = 2.000; --Multiplies fame earned from Bastok quests. +WIN_FAME = 2.000; --Multiplies fame earned from Windurst quests. +NORG_FAME = 2.000; --Multiplies fame earned from Norg and Tenshodo quests. -FISHING_GUILD_POINTS = 1.000; --Multiplies guild points earned from fishermans' guild trades. -WOODWORKING_GUILD_POINTS = 1.000; --Multiplies guild points earned from carpenters' guild trades. -SMITHING_GUILD_POINTS = 1.000; --Multiplies guild points earned from blacksmiths' guild trades. -GOLDSMITHING_GUILD_POINTS = 1.000; --Multiplies guild points earned from goldsmiths' guild trades. -CLOTHCRAFT_GUILD_POINTS = 1.000; --Multiplies guild points earned from weavers' guild trades. -LEATHERCRAFT_GUILD_POINTS = 1.000; --Multiplies guild points earned from tanners' guild trades. -BONECRAFT_GUILD_POINTS = 1.000; --Multiplies guild points earned from boneworkers' guild trades. -ALCHEMY_GUILD_POINTS = 1.000; --Multiplies guild points earned from alchemists' guild trades. -COOKING_GUILD_POINTS = 1.000; --Multiplies guild points earned from culinarians' guild trades. -DISABLE_GUILD_CONTRACTS = 0; --Set to 1 to disable guild contracts, allowing players to accumulate guild points from all guilds at once. +FISHING_GUILD_POINTS = 5.000; --Multiplies guild points earned from fishermans' guild trades. +WOODWORKING_GUILD_POINTS = 5.000; --Multiplies guild points earned from carpenters' guild trades. +SMITHING_GUILD_POINTS = 5.000; --Multiplies guild points earned from blacksmiths' guild trades. +GOLDSMITHING_GUILD_POINTS = 5.000; --Multiplies guild points earned from goldsmiths' guild trades. +CLOTHCRAFT_GUILD_POINTS = 5.000; --Multiplies guild points earned from weavers' guild trades. +LEATHERCRAFT_GUILD_POINTS = 5.000; --Multiplies guild points earned from tanners' guild trades. +BONECRAFT_GUILD_POINTS = 5.000; --Multiplies guild points earned from boneworkers' guild trades. +ALCHEMY_GUILD_POINTS = 5.000; --Multiplies guild points earned from alchemists' guild trades. +COOKING_GUILD_POINTS = 5.000; --Multiplies guild points earned from culinarians' guild trades. +DISABLE_GUILD_CONTRACTS = 1; --Set to 1 to disable guild contracts, allowing players to accumulate guild points from all guilds at once. -CURE_POWER = 1.000; --Multiplies amount healed from Healing Magic, including the relevant Blue Magic. +CURE_POWER = 2.000; --Multiplies amount healed from Healing Magic, including the relevant Blue Magic. SPELL_POWER = 1.000; --Multiplies damage dealt by Elemental and Divine Magic. BLUE_POWER = 1.000; --Multiplies damage dealt by most Blue Magic. DRAIN_POWER = 1.000; --Multiplies amount drained by Drain, Aspir, and relevant Blue Magic spells. ITEM_POWER = 1.000; --Multiplies the effect of items such as Potions and Ethers. +PETFOOD_POWER = 1.000; --Multiplies the effect of pet foods biscuits and pet healing items. WEAPON_SKILL_POWER = 1.000; -- Multiplies damage dealt by Weapon Skills. -WEAPON_SKILL_POINTS = 1.000; --Multiplies points earned during weapon unlocking. +WEAPON_SKILL_POINTS = 2.000; --Multiplies points earned during weapon unlocking. -HARVESTING_BREAK_CHANCE = 0.33; --% chance for the sickle to break during harvesting. Set between 0 and 1. -EXCAVATION_BREAK_CHANCE = 0.33; --% chance for the pickaxe to break during excavation. Set between 0 and 1. -LOGGING_BREAK_CHANCE = 0.33; --% chance for the hatchet to break during logging. Set between 0 and 1. -MINING_BREAK_CHANCE = 0.33; --% chance for the pickaxe to break during mining. Set between 0 and 1. -HARVESTING_RATE = 0.50; --% chance to recieve an item from haresting. Set between 0 and 1. -EXCAVATION_RATE = 0.50; --% chance to recieve an item from excavation. Set between 0 and 1. -LOGGING_RATE = 0.50; --% chance to recieve an item from logging. Set between 0 and 1. -MINING_RATE = 0.50; --% chance to recieve an item from mining. Set between 0 and 1. +HARVESTING_BREAK_CHANCE = 0.2; --% chance for the sickle to break during harvesting. Set between 0 and 1. +EXCAVATION_BREAK_CHANCE = 0.2; --% chance for the pickaxe to break during excavation. Set between 0 and 1. +LOGGING_BREAK_CHANCE = 0.2; --% chance for the hatchet to break during logging. Set between 0 and 1. +MINING_BREAK_CHANCE = 0.2; --% chance for the pickaxe to break during mining. Set between 0 and 1. +HARVESTING_RATE = 0.70; --% chance to recieve an item from haresting. Set between 0 and 1. +EXCAVATION_RATE = 0.70; --% chance to recieve an item from excavation. Set between 0 and 1. +LOGGING_RATE = 0.70; --% chance to recieve an item from logging. Set between 0 and 1. +MINING_RATE = 0.70; --% chance to recieve an item from mining. Set between 0 and 1. -- SE implemented coffer/chest illusion time in order to prevent coffer farming. No-one in the same area can open a chest or coffer for loot (gil, gems & items) -- till a random time between MIN_ILLSION_TIME and MAX_ILLUSION_TIME. During this time players can loot keyitem and item related to quests (AF, maps... etc.) @@ -78,7 +79,7 @@ CHEST_MIN_ILLUSION_TIME = 1800; -- 30 minutes -- DYNAMIS SETTINGS - BETWEEN_2DYNA_WAIT_TIME = 1; -- wait time between 2 dynamis (in real day) min: 1 day + BETWEEN_2DYNA_WAIT_TIME = 0; -- wait time between 2 dynamis (in real day) min: 1 day DYNA_LEVEL_MIN = 65; -- level min for entering in dynamis TIMELESS_HOURGLASS_COST = 500000; -- cost of the timeless hourglass for Dynamis. CURRENCY_EXCHANGE_RATE = 100; -- X Tier 1 ancient currency -> 1 Tier 2, and so on. Certain values may conflict with shop items. Not designed to exceed 198. @@ -98,32 +99,32 @@ QM_RESET_TIME = 300; -- Default time (in seconds) you have from killing ???-pop mission NMs to click again and get key item, until ??? resets. -- FIELDS OF VALOR SETTINGS -REGIME_WAIT = 1; --Make people wait till 00:00 game time as in retail. If it's 0, there is no wait time. +REGIME_WAIT = 0; --Make people wait till 00:00 game time as in retail. If it's 0, there is no wait time. FIELD_MANUALS = 1; -- Enables Fields of Valor manuals -LOW_LEVEL_REGIME = 0; --Allow people to kill regime targets even if they give no exp, allowing people to farm regime targets at 75 in low level areas. +LOW_LEVEL_REGIME = 1; --Allow people to kill regime targets even if they give no exp, allowing people to farm regime targets at 75 in low level areas. -- JOB ABILITY/TRAIT SPECIFIC SETTINGS -SCAVENGE_RATE = 0.1; --The chance of obtaining an item when you use the Ranger job ability Scavenge. Do not set above 1! -STATUS_RESIST_MULTIPLIER = 10; -- Sets the strength of status resist traits. +SCAVENGE_RATE = 0.2; --The chance of obtaining an item when you use the Ranger job ability Scavenge. Do not set above 1! +STATUS_RESIST_MULTIPLIER = 20; -- Sets the strength of status resist traits. CIRCLE_DURATION = 300; -- Sets the duration of circle effects, in seconds. Retail is 5 minutes. CIRCLE_KILLER_EFFECT = 20; -- Intimidation percentage granted by circle effects. (made up number) -KILLER_EFFECT = 10; -- Intimidation percentage from killer job traits. +KILLER_EFFECT = 20; -- Intimidation percentage from killer job traits. -- SPELL SPECIFIC SETTINGS MILK_OVERWRITE = 1; --Set to 1 to allow Milk and Regen to overwrite each other. Default is 1. JUICE_OVERWRITE = 1; --Set to 1 to allow Juice and Refresh to overwrite each other. Default is 1. DIA_OVERWRITE = 1; --Set to 1 to allow Bio to overwrite same tier Dia. Default is 1. BIO_OVERWRITE = 0; --Set to 1 to allow Dia to overwrite same tier Bio. Default is 0. -BARELEMENT_OVERWRITE = 1; --Set to 1 to allow Barelement spells to overwrite each other (prevent stacking). Default is 1. -BARSTATUS_OVERWRITE = 1; --Set to 1 to allow Barstatus spells to overwrite each other (prevent stacking). Default is 1. -BARD_SONG_LIMIT = 1; --Maximum amount of songs from a single Bard that can be granted to a single target at once. Set between 1 and 31. -BARD_INSTRUMENT_LIMIT = 2; --Maximum amount of songs from a single Bard with an instrument that can be granted to a single target at once. Set between 2 and 32. -ENHANCING_SONG_DURATION = 120; -- duration of enhancing bard songs such as Minuets, Ballads, etc. -STONESKIN_CAP = 350; -- soft cap for hp absorbed by stoneskin -BLINK_SHADOWS = 2; -- number of shadows supplied by Blink spell -ENSPELL_DURATION = 180; -- duration of RDM en-spells -SPIKE_EFFECT_DURATION = 180; -- the duration of RDM, BLM spikes effects (not Reprisal) -ELEMENTAL_DEBUFF_DURATION = 120; -- base duration of elemental debuffs +BARELEMENT_OVERWRITE = 0; --Set to 1 to allow Barelement spells to overwrite each other (prevent stacking). Default is 1. +BARSTATUS_OVERWRITE = 0; --Set to 1 to allow Barstatus spells to overwrite each other (prevent stacking). Default is 1. +BARD_SONG_LIMIT = 3; --Maximum amount of songs from a single Bard that can be granted to a single target at once. Set between 1 and 31. +BARD_INSTRUMENT_LIMIT = 4; --Maximum amount of songs from a single Bard with an instrument that can be granted to a single target at once. Set between 2 and 32. +ENHANCING_SONG_DURATION = 240; -- duration of enhancing bard songs such as Minuets, Ballads, etc. +STONESKIN_CAP = 650; -- soft cap for hp absorbed by stoneskin +BLINK_SHADOWS = 4; -- number of shadows supplied by Blink spell +ENSPELL_DURATION = 360; -- duration of RDM en-spells +SPIKE_EFFECT_DURATION = 360; -- the duration of RDM, BLM spikes effects (not Reprisal) +ELEMENTAL_DEBUFF_DURATION = 240; -- base duration of elemental debuffs STORM_DURATION = 180; -- duration of Scholar storm spells KLIMAFORM_MACC = 30; -- magic accuracy added by Klimaform. 30 is just a guess. AQUAVEIL_INTERR_RATE = 25; -- percent spell interruption rate reduction from Aquaveil (see http://www.bluegartrls.com/forum/82143-spell-interruption-down-cap-aquaveil-tests.html) @@ -143,12 +144,13 @@ SUNBREEZE_2011 = 0; -- Set to 1 to give starting characters Far East dress from 2011. Ex: Hikogami Yukata CHRISTMAS = 0; -- Set to 1 to give starting characters Christmas dress. HALLOWEEN = 0; -- Set to 1 to give starting characters Halloween items. +HALLOWEEN_2005 = 0 -- Set to 1 to Enable the 2005 version of Harvest Festival --MISC HOMEPOINT_HEAL = 0; --Set to 1 if you want Home Points to heal you like in single-player Final Fantasy games. RIVERNE_PORTERS = 120; -- Time in seconds that Unstable Displacements in Cape Riverne stay open after trading a scale. LANTERNS_STAY_LIT = 1200; -- time in seconds that lanterns in the Den of Rancor stay lit. -ENABLE_COP_ZONE_CAP=1; -- enable or disable lvl cap +ENABLE_COP_ZONE_CAP=0; -- enable or disable lvl cap TIMEZONE_OFFSET = 9.0; -- Offset from UTC used to determine when "JP Midnight" is for the server. Default is JST (+9.0). ALLOW_MULTIPLE_EXP_RINGS = 0; -- Set to 1 to remove ownership restrictions on the Chariot/Empress/Emperor Band trio. BYPASS_EXP_RING_ONE_PER_WEEK = 0; -- -- Set to 1 to bypass the limit of one ring per Conquest Tally Week. \ No newline at end of file Index: scripts/globals/spells/absorb-acc.lua =================================================================== --- scripts/globals/spells/absorb-acc.lua (revision 3304) +++ scripts/globals/spells/absorb-acc.lua (working copy) @@ -16,7 +16,64 @@ end; function onSpellCast(caster,target,spell) + local durationMods = ABSORB_SPELL_TICK; + local amountMods = ABSORB_SPELL_AMOUNT + local weapon = caster:getEquipID(SLOT_MAIN); + local head = caster:getEquipID(SLOT_HEAD); + local feet = caster:getEquipID(SLOT_FEET); + local legs = caster:getEquipID(SLOT_LEGS); + local hands = caster:getEquipID(SLOT_HANDS); + local back = caster:getEquipID(SLOT_BACK); + -- Equipment Bonus Duration + if (weapon == 18559) then -- Void Scythe + durationMods = durationMods + 3; + end + if (head == 13887) then -- Black Sallet + durationMods = durationMods + 1; + end + if (head == 13888) then -- Onyx Sallet + durationMods = durationMods + 2; + end + if (hands == 14010) then -- Black Gadlings + durationMods = durationMods + 1; + end + if (hands == 14011 or hands == 15013) then -- Onyx Gadlings & Vicious Mufflers + durationMods = durationMods + 2; + end + if (legs == 15400) then -- Black Cuisses + durationMods = durationMods + 1; + end + if (legs == 15401) then -- Onyx Cuisses + durationMods = durationMods + 2; + end + if (feet == 15339) then -- Black Sollerets + durationMods = durationMods + 1; + end + if (feet == 15340) then -- Onyx Sollerets + durationMods = durationMods + 2; + end + if (back == 10944) then -- Chuparrosa Mantle + durationMods = durationMods + 1; + end + + -- Equipment Bonus Amount + if (back == 10944) then -- Chuparrosa Mantle + amountMods = amountMods + 2; + end + if (hands == 11922) then -- Pavor Gauntlets + amountMods = amountMods + 1; + end + if (weapon == 18998 or weapon == 19067 or weapon == 19087) then -- Liberator Lvl 75 - 80 - 85 + amountMods = amountMods + 1; + end + if (weapon == 19619 or weapon == 19717 or weapon == 19826) then -- Liberator Lvl 90 - 95 - 99-1 + amountMods = amountMods + 2; + end + if (weapon == 19955) then -- Liberator Lvl 99-2 + amountMods = amountMods + 3; + end + if(caster:hasStatusEffect(EFFECT_ACCURACY_BOOST)) then spell:setMsg(75); -- no effect else @@ -27,8 +84,8 @@ spell:setMsg(85); else spell:setMsg(533); - caster:addStatusEffect(EFFECT_ACCURACY_BOOST,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_DISPELABLE); -- caster gains ACC - target:addStatusEffect(EFFECT_ACCURACY_DOWN,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_ERASBLE); -- target loses ACC + caster:addStatusEffect(EFFECT_ACCURACY_BOOST,amountMods*resist, durationMods, amountMods*durationMods,FLAG_DISPELABLE); -- caster gains ACC + target:addStatusEffect(EFFECT_ACCURACY_DOWN,amountMods*resist, durationMods, amountMods*durationMods,FLAG_ERASBLE); -- target loses ACC end end return EFFECT_ACCURACY_BOOST; Index: scripts/globals/spells/absorb-agi.lua =================================================================== --- scripts/globals/spells/absorb-agi.lua (revision 3304) +++ scripts/globals/spells/absorb-agi.lua (working copy) @@ -16,6 +16,65 @@ end; function onSpellCast(caster,target,spell) + + local durationMods = ABSORB_SPELL_TICK; + local amountMods = ABSORB_SPELL_AMOUNT + local weapon = caster:getEquipID(SLOT_MAIN); + local head = caster:getEquipID(SLOT_HEAD); + local feet = caster:getEquipID(SLOT_FEET); + local legs = caster:getEquipID(SLOT_LEGS); + local hands = caster:getEquipID(SLOT_HANDS); + local back = caster:getEquipID(SLOT_BACK); + + -- Equipment Bonus Duration + if (weapon == 18559) then -- Void Scythe + durationMods = durationMods + 3; + end + if (head == 13887) then -- Black Sallet + durationMods = durationMods + 1; + end + if (head == 13888) then -- Onyx Sallet + durationMods = durationMods + 2; + end + if (hands == 14010) then -- Black Gadlings + durationMods = durationMods + 1; + end + if (hands == 14011 or hands == 15013) then -- Onyx Gadlings & Vicious Mufflers + durationMods = durationMods + 2; + end + if (legs == 15400) then -- Black Cuisses + durationMods = durationMods + 1; + end + if (legs == 15401) then -- Onyx Cuisses + durationMods = durationMods + 2; + end + if (feet == 15339) then -- Black Sollerets + durationMods = durationMods + 1; + end + if (feet == 15340) then -- Onyx Sollerets + durationMods = durationMods + 2; + end + if (back == 10944) then -- Chuparrosa Mantle + durationMods = durationMods + 1; + end + + -- Equipment Bonus Amount + if (back == 10944) then -- Chuparrosa Mantle + amountMods = amountMods + 2; + end + if (hands == 11922) then -- Pavor Gauntlets + amountMods = amountMods + 1; + end + if (weapon == 18998 or weapon == 19067 or weapon == 19087) then -- Liberator Lvl 75 - 80 - 85 + amountMods = amountMods + 1; + end + if (weapon == 19619 or weapon == 19717 or weapon == 19826) then -- Liberator Lvl 90 - 95 - 99-1 + amountMods = amountMods + 2; + end + if (weapon == 19955) then -- Liberator Lvl 99-2 + amountMods = amountMods + 3; + end + if(target:hasStatusEffect(EFFECT_AGI_DOWN) or caster:hasStatusEffect(EFFECT_AGI_BOOST)) then spell:setMsg(75); -- no effect @@ -27,8 +86,8 @@ spell:setMsg(85); else spell:setMsg(332); - caster:addStatusEffect(EFFECT_AGI_BOOST,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_DISPELABLE); -- caster gains AGI - target:addStatusEffect(EFFECT_AGI_DOWN,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_ERASBLE); -- target loses AGI + caster:addStatusEffect(EFFECT_AGI_BOOST,amountMods*resist, durationMods, amountMods*durationMods,FLAG_DISPELABLE); -- caster gains AGI + target:addStatusEffect(EFFECT_AGI_DOWN,amountMods*resist, durationMods, amountMods*durationMods,FLAG_ERASBLE); -- target loses AGI end end return EFFECT_AGI_DOWN; Index: scripts/globals/spells/absorb-attri.lua =================================================================== --- scripts/globals/spells/absorb-attri.lua (revision 0) +++ scripts/globals/spells/absorb-attri.lua (working copy) @@ -0,0 +1,93 @@ +-------------------------------------- +-- Spell: Absorb-Attri +-- Steals an enemy's beneficial status +-- effect. +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local durationMods = ABSORB_SPELL_TICK; + local amountMods = ABSORB_SPELL_AMOUNT + local weapon = caster:getEquipID(SLOT_MAIN); + local head = caster:getEquipID(SLOT_HEAD); + local feet = caster:getEquipID(SLOT_FEET); + local legs = caster:getEquipID(SLOT_LEGS); + local hands = caster:getEquipID(SLOT_HANDS); + local back = caster:getEquipID(SLOT_BACK); + + -- Equipment Bonus Duration + if (weapon == 18559) then -- Void Scythe + durationMods = durationMods + 3; + end + if (head == 13887) then -- Black Sallet + durationMods = durationMods + 1; + end + if (head == 13888) then -- Onyx Sallet + durationMods = durationMods + 2; + end + if (hands == 14010) then -- Black Gadlings + durationMods = durationMods + 1; + end + if (hands == 14011 or hands == 15013) then -- Onyx Gadlings & Vicious Mufflers + durationMods = durationMods + 2; + end + if (legs == 15400) then -- Black Cuisses + durationMods = durationMods + 1; + end + if (legs == 15401) then -- Onyx Cuisses + durationMods = durationMods + 2; + end + if (feet == 15339) then -- Black Sollerets + durationMods = durationMods + 1; + end + if (feet == 15340) then -- Onyx Sollerets + durationMods = durationMods + 2; + end + if (back == 10944) then -- Chuparrosa Mantle + durationMods = durationMods + 1; + end + + -- Equipment Bonus Amount + if (back == 10944) then -- Chuparrosa Mantle + amountMods = amountMods + 2; + end + if (hands == 11922) then -- Pavor Gauntlets + amountMods = amountMods + 1; + end + if (weapon == 18998 or weapon == 19067 or weapon == 19087) then -- Liberator Lvl 75 - 80 - 85 + amountMods = amountMods + 1; + end + if (weapon == 19619 or weapon == 19717 or weapon == 19826) then -- Liberator Lvl 90 - 95 - 99-1 + amountMods = amountMods + 2; + end + if (weapon == 19955) then -- Liberator Lvl 99-2 + amountMods = amountMods + 3; + end + + if(caster:hasStatusEffect(EFFECT_ACCURACY_BOOST)) then + spell:setMsg(75); -- no effect + else + bonus = AffinityBonus(caster,spell); + dINT = caster:getStat(MOD_INT) - target:getStat(MOD_INT); + resist = applyResistance(caster,spell,target,dINT,37,bonus); + if(resist <= 0.125) then + spell:setMsg(85); + else + spell:setMsg(533); + caster:addStatusEffect(EFFECT_ACCURACY_BOOST,amountMods*resist, durationMods, amountMods*durationMods,FLAG_DISPELABLE); -- caster gains ACC + target:addStatusEffect(EFFECT_ACCURACY_DOWN,amountMods*resist, durationMods, amountMods*durationMods,FLAG_ERASBLE); -- target loses ACC + end + end + return EFFECT_ACCURACY_BOOST; +end; \ No newline at end of file Index: scripts/globals/spells/absorb-chr.lua =================================================================== --- scripts/globals/spells/absorb-chr.lua (revision 3304) +++ scripts/globals/spells/absorb-chr.lua (working copy) @@ -16,6 +16,65 @@ end; function onSpellCast(caster,target,spell) + + local durationMods = ABSORB_SPELL_TICK; + local amountMods = ABSORB_SPELL_AMOUNT + local weapon = caster:getEquipID(SLOT_MAIN); + local head = caster:getEquipID(SLOT_HEAD); + local feet = caster:getEquipID(SLOT_FEET); + local legs = caster:getEquipID(SLOT_LEGS); + local hands = caster:getEquipID(SLOT_HANDS); + local back = caster:getEquipID(SLOT_BACK); + + -- Equipment Bonus Duration + if (weapon == 18559) then -- Void Scythe + durationMods = durationMods + 3; + end + if (head == 13887) then -- Black Sallet + durationMods = durationMods + 1; + end + if (head == 13888) then -- Onyx Sallet + durationMods = durationMods + 2; + end + if (hands == 14010) then -- Black Gadlings + durationMods = durationMods + 1; + end + if (hands == 14011 or hands == 15013) then -- Onyx Gadlings & Vicious Mufflers + durationMods = durationMods + 2; + end + if (legs == 15400) then -- Black Cuisses + durationMods = durationMods + 1; + end + if (legs == 15401) then -- Onyx Cuisses + durationMods = durationMods + 2; + end + if (feet == 15339) then -- Black Sollerets + durationMods = durationMods + 1; + end + if (feet == 15340) then -- Onyx Sollerets + durationMods = durationMods + 2; + end + if (back == 10944) then -- Chuparrosa Mantle + durationMods = durationMods + 1; + end + + -- Equipment Bonus Amount + if (back == 10944) then -- Chuparrosa Mantle + amountMods = amountMods + 2; + end + if (hands == 11922) then -- Pavor Gauntlets + amountMods = amountMods + 1; + end + if (weapon == 18998 or weapon == 19067 or weapon == 19087) then -- Liberator Lvl 75 - 80 - 85 + amountMods = amountMods + 1; + end + if (weapon == 19619 or weapon == 19717 or weapon == 19826) then -- Liberator Lvl 90 - 95 - 99-1 + amountMods = amountMods + 2; + end + if (weapon == 19955) then -- Liberator Lvl 99-2 + amountMods = amountMods + 3; + end + if(target:hasStatusEffect(EFFECT_CHR_DOWN) or caster:hasStatusEffect(EFFECT_CHR_BOOST)) then spell:setMsg(75); -- no effect @@ -27,8 +86,8 @@ spell:setMsg(85); else spell:setMsg(335); - caster:addStatusEffect(EFFECT_CHR_BOOST,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_DISPELABLE); -- caster gains CHR - target:addStatusEffect(EFFECT_CHR_DOWN,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_ERASBLE); -- target loses CHR + caster:addStatusEffect(EFFECT_CHR_BOOST,amountMods*resist, durationMods, amountMods*durationMods,FLAG_DISPELABLE); -- caster gains CHR + target:addStatusEffect(EFFECT_CHR_DOWN,amountMods*resist, durationMods, amountMods*durationMods,FLAG_ERASBLE); -- target loses CHR end end return EFFECT_CHR_DOWN; Index: scripts/globals/spells/absorb-dex.lua =================================================================== --- scripts/globals/spells/absorb-dex.lua (revision 3304) +++ scripts/globals/spells/absorb-dex.lua (working copy) @@ -16,6 +16,65 @@ end; function onSpellCast(caster,target,spell) + + local durationMods = ABSORB_SPELL_TICK; + local amountMods = ABSORB_SPELL_AMOUNT + local weapon = caster:getEquipID(SLOT_MAIN); + local head = caster:getEquipID(SLOT_HEAD); + local feet = caster:getEquipID(SLOT_FEET); + local legs = caster:getEquipID(SLOT_LEGS); + local hands = caster:getEquipID(SLOT_HANDS); + local back = caster:getEquipID(SLOT_BACK); + + -- Equipment Bonus Duration + if (weapon == 18559) then -- Void Scythe + durationMods = durationMods + 3; + end + if (head == 13887) then -- Black Sallet + durationMods = durationMods + 1; + end + if (head == 13888) then -- Onyx Sallet + durationMods = durationMods + 2; + end + if (hands == 14010) then -- Black Gadlings + durationMods = durationMods + 1; + end + if (hands == 14011 or hands == 15013) then -- Onyx Gadlings & Vicious Mufflers + durationMods = durationMods + 2; + end + if (legs == 15400) then -- Black Cuisses + durationMods = durationMods + 1; + end + if (legs == 15401) then -- Onyx Cuisses + durationMods = durationMods + 2; + end + if (feet == 15339) then -- Black Sollerets + durationMods = durationMods + 1; + end + if (feet == 15340) then -- Onyx Sollerets + durationMods = durationMods + 2; + end + if (back == 10944) then -- Chuparrosa Mantle + durationMods = durationMods + 1; + end + + -- Equipment Bonus Amount + if (back == 10944) then -- Chuparrosa Mantle + amountMods = amountMods + 2; + end + if (hands == 11922) then -- Pavor Gauntlets + amountMods = amountMods + 1; + end + if (weapon == 18998 or weapon == 19067 or weapon == 19087) then -- Liberator Lvl 75 - 80 - 85 + amountMods = amountMods + 1; + end + if (weapon == 19619 or weapon == 19717 or weapon == 19826) then -- Liberator Lvl 90 - 95 - 99-1 + amountMods = amountMods + 2; + end + if (weapon == 19955) then -- Liberator Lvl 99-2 + amountMods = amountMods + 3; + end + if(target:hasStatusEffect(EFFECT_DEX_DOWN) or caster:hasStatusEffect(EFFECT_DEX_BOOST)) then spell:setMsg(75); -- no effect @@ -27,8 +86,8 @@ spell:setMsg(85); else spell:setMsg(330); - caster:addStatusEffect(EFFECT_DEX_BOOST,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_DISPELABLE); -- caster gains DEX - target:addStatusEffect(EFFECT_DEX_DOWN,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_ERASBLE); -- target loses DEX + caster:addStatusEffect(EFFECT_DEX_BOOST,amountMods*resist, durationMods, amountMods*durationMods,FLAG_DISPELABLE); -- caster gains DEX + target:addStatusEffect(EFFECT_DEX_DOWN,amountMods*resist, durationMods, amountMods*durationMods,FLAG_ERASBLE); -- target loses DEX end end return EFFECT_DEX_DOWN; Index: scripts/globals/spells/absorb-int.lua =================================================================== --- scripts/globals/spells/absorb-int.lua (revision 3304) +++ scripts/globals/spells/absorb-int.lua (working copy) @@ -11,12 +11,71 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) + local durationMods = ABSORB_SPELL_TICK; + local amountMods = ABSORB_SPELL_AMOUNT + local weapon = caster:getEquipID(SLOT_MAIN); + local head = caster:getEquipID(SLOT_HEAD); + local feet = caster:getEquipID(SLOT_FEET); + local legs = caster:getEquipID(SLOT_LEGS); + local hands = caster:getEquipID(SLOT_HANDS); + local back = caster:getEquipID(SLOT_BACK); + + -- Equipment Bonus Duration + if (weapon == 18559) then -- Void Scythe + durationMods = durationMods + 3; + end + if (head == 13887) then -- Black Sallet + durationMods = durationMods + 1; + end + if (head == 13888) then -- Onyx Sallet + durationMods = durationMods + 2; + end + if (hands == 14010) then -- Black Gadlings + durationMods = durationMods + 1; + end + if (hands == 14011 or hands == 15013) then -- Onyx Gadlings & Vicious Mufflers + durationMods = durationMods + 2; + end + if (legs == 15400) then -- Black Cuisses + durationMods = durationMods + 1; + end + if (legs == 15401) then -- Onyx Cuisses + durationMods = durationMods + 2; + end + if (feet == 15339) then -- Black Sollerets + durationMods = durationMods + 1; + end + if (feet == 15340) then -- Onyx Sollerets + durationMods = durationMods + 2; + end + if (back == 10944) then -- Chuparrosa Mantle + durationMods = durationMods + 1; + end + + -- Equipment Bonus Amount + if (back == 10944) then -- Chuparrosa Mantle + amountMods = amountMods + 2; + end + if (hands == 11922) then -- Pavor Gauntlets + amountMods = amountMods + 1; + end + if (weapon == 18998 or weapon == 19067 or weapon == 19087) then -- Liberator Lvl 75 - 80 - 85 + amountMods = amountMods + 1; + end + if (weapon == 19619 or weapon == 19717 or weapon == 19826) then -- Liberator Lvl 90 - 95 - 99-1 + amountMods = amountMods + 2; + end + if (weapon == 19955) then -- Liberator Lvl 99-2 + amountMods = amountMods + 3; + end + + if(target:hasStatusEffect(EFFECT_INT_DOWN) or caster:hasStatusEffect(EFFECT_INT_BOOST)) then spell:setMsg(75); -- no effect else @@ -27,8 +86,8 @@ spell:setMsg(85); else spell:setMsg(333); - caster:addStatusEffect(EFFECT_INT_BOOST,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_DISPELABLE); -- caster gains INT - target:addStatusEffect(EFFECT_INT_DOWN,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_ERASBLE); -- target loses INT + caster:addStatusEffect(EFFECT_INT_BOOST,amountMods*resist, durationMods, amountMods*durationMods,FLAG_DISPELABLE); -- caster gains INT + target:addStatusEffect(EFFECT_INT_DOWN,amountMods*resist, durationMods, amountMods*durationMods,FLAG_ERASBLE); -- target loses INT end end return EFFECT_INT_DOWN; Index: scripts/globals/spells/absorb-mnd.lua =================================================================== --- scripts/globals/spells/absorb-mnd.lua (revision 3304) +++ scripts/globals/spells/absorb-mnd.lua (working copy) @@ -16,6 +16,65 @@ end; function onSpellCast(caster,target,spell) + + local durationMods = ABSORB_SPELL_TICK; + local amountMods = ABSORB_SPELL_AMOUNT + local weapon = caster:getEquipID(SLOT_MAIN); + local head = caster:getEquipID(SLOT_HEAD); + local feet = caster:getEquipID(SLOT_FEET); + local legs = caster:getEquipID(SLOT_LEGS); + local hands = caster:getEquipID(SLOT_HANDS); + local back = caster:getEquipID(SLOT_BACK); + + -- Equipment Bonus Duration + if (weapon == 18559) then -- Void Scythe + durationMods = durationMods + 3; + end + if (head == 13887) then -- Black Sallet + durationMods = durationMods + 1; + end + if (head == 13888) then -- Onyx Sallet + durationMods = durationMods + 2; + end + if (hands == 14010) then -- Black Gadlings + durationMods = durationMods + 1; + end + if (hands == 14011 or hands == 15013) then -- Onyx Gadlings & Vicious Mufflers + durationMods = durationMods + 2; + end + if (legs == 15400) then -- Black Cuisses + durationMods = durationMods + 1; + end + if (legs == 15401) then -- Onyx Cuisses + durationMods = durationMods + 2; + end + if (feet == 15339) then -- Black Sollerets + durationMods = durationMods + 1; + end + if (feet == 15340) then -- Onyx Sollerets + durationMods = durationMods + 2; + end + if (back == 10944) then -- Chuparrosa Mantle + durationMods = durationMods + 1; + end + + -- Equipment Bonus Amount + if (back == 10944) then -- Chuparrosa Mantle + amountMods = amountMods + 2; + end + if (hands == 11922) then -- Pavor Gauntlets + amountMods = amountMods + 1; + end + if (weapon == 18998 or weapon == 19067 or weapon == 19087) then -- Liberator Lvl 75 - 80 - 85 + amountMods = amountMods + 1; + end + if (weapon == 19619 or weapon == 19717 or weapon == 19826) then -- Liberator Lvl 90 - 95 - 99-1 + amountMods = amountMods + 2; + end + if (weapon == 19955) then -- Liberator Lvl 99-2 + amountMods = amountMods + 3; + end + if(target:hasStatusEffect(EFFECT_MND_DOWN) or caster:getStatusEffect(EFFECT_MND_BOOST)) then spell:setMsg(75); -- no effect @@ -27,8 +86,8 @@ spell:setMsg(85); else spell:setMsg(334); - caster:addStatusEffect(EFFECT_MND_BOOST,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_DISPELABLE); -- caster gains MND - target:addStatusEffect(EFFECT_MND_DOWN,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_ERASBLE); -- target loses MND + caster:addStatusEffect(EFFECT_MND_BOOST,amountMods*resist, durationMods, amountMods*durationMods,FLAG_DISPELABLE); -- caster gains MND + target:addStatusEffect(EFFECT_MND_DOWN,amountMods*resist, durationMods, amountMods*durationMods,FLAG_ERASBLE); -- target loses MND end end return EFFECT_MND_DOWN; Index: scripts/globals/spells/absorb-str.lua =================================================================== --- scripts/globals/spells/absorb-str.lua (revision 3304) +++ scripts/globals/spells/absorb-str.lua (working copy) @@ -16,6 +16,64 @@ end; function onSpellCast(caster,target,spell) + + local durationMods = ABSORB_SPELL_TICK; + local amountMods = ABSORB_SPELL_AMOUNT + local weapon = caster:getEquipID(SLOT_MAIN); + local head = caster:getEquipID(SLOT_HEAD); + local feet = caster:getEquipID(SLOT_FEET); + local legs = caster:getEquipID(SLOT_LEGS); + local hands = caster:getEquipID(SLOT_HANDS); + local back = caster:getEquipID(SLOT_BACK); + + -- Equipment Bonus Duration + if (weapon == 18559) then -- Void Scythe + durationMods = durationMods + 3; + end + if (head == 13887) then -- Black Sallet + durationMods = durationMods + 1; + end + if (head == 13888) then -- Onyx Sallet + durationMods = durationMods + 2; + end + if (hands == 14010) then -- Black Gadlings + durationMods = durationMods + 1; + end + if (hands == 14011 or hands == 15013) then -- Onyx Gadlings & Vicious Mufflers + durationMods = durationMods + 2; + end + if (legs == 15400) then -- Black Cuisses + durationMods = durationMods + 1; + end + if (legs == 15401) then -- Onyx Cuisses + durationMods = durationMods + 2; + end + if (feet == 15339) then -- Black Sollerets + durationMods = durationMods + 1; + end + if (feet == 15340) then -- Onyx Sollerets + durationMods = durationMods + 2; + end + if (back == 10944) then -- Chuparrosa Mantle + durationMods = durationMods + 1; + end + + -- Equipment Bonus Amount + if (back == 10944) then -- Chuparrosa Mantle + amountMods = amountMods + 2; + end + if (hands == 11922) then -- Pavor Gauntlets + amountMods = amountMods + 1; + end + if (weapon == 18998 or weapon == 19067 or weapon == 19087) then -- Liberator Lvl 75 - 80 - 85 + amountMods = amountMods + 1; + end + if (weapon == 19619 or weapon == 19717 or weapon == 19826) then -- Liberator Lvl 90 - 95 - 99-1 + amountMods = amountMods + 2; + end + if (weapon == 19955) then -- Liberator Lvl 99-2 + amountMods = amountMods + 3; + end if(target:hasStatusEffect(EFFECT_STR_DOWN) or caster:hasStatusEffect(EFFECT_STR_BOOST)) then spell:setMsg(75); -- no effect @@ -27,8 +85,8 @@ spell:setMsg(85); else spell:setMsg(329); - caster:addStatusEffect(EFFECT_STR_BOOST,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_DISPELABLE); -- caster gains STR - target:addStatusEffect(EFFECT_STR_DOWN,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_ERASBLE); -- target loses STR + caster:addStatusEffect(EFFECT_STR_BOOST,amountMods*resist, durationMods, amountMods*durationMods,FLAG_DISPELABLE); -- caster gains STR + target:addStatusEffect(EFFECT_STR_DOWN,amountMods*resist, durationMods, amountMods*durationMods,FLAG_ERASBLE); -- target loses STR end end return EFFECT_STR_DOWN; Index: scripts/globals/spells/absorb-tp.lua =================================================================== --- scripts/globals/spells/absorb-tp.lua (revision 3304) +++ scripts/globals/spells/absorb-tp.lua (working copy) @@ -16,7 +16,32 @@ end; function onSpellCast(caster,target,spell) + + local amountMods = 0; + local weapon = caster:getEquipID(SLOT_MAIN); + local hands = caster:getEquipID(SLOT_HANDS); + local back = caster:getEquipID(SLOT_BACK); + -- Equipment Bonus Amount + if (back == 10944) then -- Chuparrosa Mantle + amountMods = amountMods + 20; + end + if (hands == 11922 or hands == 11211) then -- Pavor & Bale +1 Gauntlets + amountMods = amountMods + 10; + end + if (hands == 11111) then -- Bale Gauntlets +2 + amountMods = amountMods + 20; + end + if (weapon == 18998 or weapon == 19067 or weapon == 19087) then -- Liberator Lvl 75 - 80 - 85 + amountMods = amountMods + 10; + end + if (weapon == 19619 or weapon == 19717 or weapon == 19826) then -- Liberator Lvl 90 - 95 - 99-1 + amountMods = amountMods + 20; + end + if (weapon == 19955) then -- Liberator Lvl 99-2 + amountMods = amountMods + 30; + end + dmg = math.random(10, 80); --get resist multiplier (1x if no resist) resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),DARK_MAGIC_SKILL,1.0); @@ -32,6 +57,8 @@ if (dmg > cap) then dmg = cap; end + + dmg = dmg + amountMods; -- for Equipment Bonus above cap if(resist <= 0.125) then spell:setMsg(85); Index: scripts/globals/spells/absorb-vit.lua =================================================================== --- scripts/globals/spells/absorb-vit.lua (revision 3304) +++ scripts/globals/spells/absorb-vit.lua (working copy) @@ -16,6 +16,64 @@ end; function onSpellCast(caster,target,spell) + + local durationMods = ABSORB_SPELL_TICK; + local amountMods = ABSORB_SPELL_AMOUNT + local weapon = caster:getEquipID(SLOT_MAIN); + local head = caster:getEquipID(SLOT_HEAD); + local feet = caster:getEquipID(SLOT_FEET); + local legs = caster:getEquipID(SLOT_LEGS); + local hands = caster:getEquipID(SLOT_HANDS); + local back = caster:getEquipID(SLOT_BACK); + + -- Equipment Bonus Duration + if (weapon == 18559) then -- Void Scythe + durationMods = durationMods + 3; + end + if (head == 13887) then -- Black Sallet + durationMods = durationMods + 1; + end + if (head == 13888) then -- Onyx Sallet + durationMods = durationMods + 2; + end + if (hands == 14010) then -- Black Gadlings + durationMods = durationMods + 1; + end + if (hands == 14011 or hands == 15013) then -- Onyx Gadlings & Vicious Mufflers + durationMods = durationMods + 2; + end + if (legs == 15400) then -- Black Cuisses + durationMods = durationMods + 1; + end + if (legs == 15401) then -- Onyx Cuisses + durationMods = durationMods + 2; + end + if (feet == 15339) then -- Black Sollerets + durationMods = durationMods + 1; + end + if (feet == 15340) then -- Onyx Sollerets + durationMods = durationMods + 2; + end + if (back == 10944) then -- Chuparrosa Mantle + durationMods = durationMods + 1; + end + + -- Equipment Bonus Amount + if (back == 10944) then -- Chuparrosa Mantle + amountMods = amountMods + 2; + end + if (hands == 11922) then -- Pavor Gauntlets + amountMods = amountMods + 1; + end + if (weapon == 18998 or weapon == 19067 or weapon == 19087) then -- Liberator Lvl 75 - 80 - 85 + amountMods = amountMods + 1; + end + if (weapon == 19619 or weapon == 19717 or weapon == 19826) then -- Liberator Lvl 90 - 95 - 99-1 + amountMods = amountMods + 2; + end + if (weapon == 19955) then -- Liberator Lvl 99-2 + amountMods = amountMods + 3; + end if(target:hasStatusEffect(EFFECT_VIT_DOWN) or caster:hasStatusEffect(EFFECT_VIT_BOOST)) then spell:setMsg(75); -- no effect @@ -27,8 +85,8 @@ spell:setMsg(85); else spell:setMsg(331); - caster:addStatusEffect(EFFECT_VIT_BOOST,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_DISPELABLE); -- caster gains VIT - target:addStatusEffect(EFFECT_VIT_DOWN,ABSORB_SPELL_AMOUNT*resist, ABSORB_SPELL_TICK, ABSORB_SPELL_AMOUNT*ABSORB_SPELL_TICK,FLAG_ERASBLE); -- target loses VIT + caster:addStatusEffect(EFFECT_VIT_BOOST,amountMods*resist, durationMods, amountMods*durationMods,FLAG_DISPELABLE); -- caster gains VIT + target:addStatusEffect(EFFECT_VIT_DOWN,amountMods*resist, durationMods, amountMods*durationMods,FLAG_ERASBLE); -- target loses VIT end end return EFFECT_VIT_DOWN; Index: scripts/globals/spells/addle.lua =================================================================== --- scripts/globals/spells/addle.lua (revision 0) +++ scripts/globals/spells/addle.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- Spell: Addle +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + power = 20; + + -- Duration + duration = 120 + + -- Equipment bonus + local back = caster:getEquipID(SLOT_BACK); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end + if (back == 10977) then -- Romanus Cape 6% Addle Bonus + duration = duration + (duration * .06); + end + + if(100 * math.random() >= target:getMod(MOD_SILENCERES)) then -- Silence resist used instead of addle resist for now. + if(target:addStatusEffect(EFFECT_ADDLE,power,0,duration)) then + spell:setMsg(236); + else + spell:setMsg(75); + end + else + spell:setMsg(284); + end + return EFFECT_ADDLE; +end; \ No newline at end of file Index: scripts/globals/spells/advancing_march.lua =================================================================== --- scripts/globals/spells/advancing_march.lua (revision 3304) +++ scripts/globals/spells/advancing_march.lua (working copy) @@ -16,29 +16,20 @@ end; function onSpellCast(caster,target,spell) - - local haste = 64; - local sItem = caster:getEquipID(2); - local duration = 120; - - -- Royal Spearman's Horn, Kingdom Horn, San d'Orian Horn Adds +1 haste - if(sItem == 17367 or sItem == 17836 or sItem == 17835) then - haste = haste + 16; - end - - -- Faerie Piccolo and Iron Ram Horn Adds +2 haste - if(sItem == 17349 or sItem == 17853) then - haste = haste + 32; - end - - -- half is subjob is brd + bardSubJob =0; + local duration = 120; + duration = duration + (duration * (target:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((target:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((target:getMod(MOD_PRELUDE) * 10)/100)); + + -- half if subjob is brd if(caster:getSubJob() == JOB_BRD) then - haste = math.ceil(haste / 2); + bardSubJob = 1; end -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. - target:addStatusEffect(EFFECT_MARCH,haste,0,duration); + target:addStatusEffect(EFFECT_MARCH,1,0,duration); spell:setMsg(230); return EFFECT_MARCH; end; \ No newline at end of file Index: scripts/globals/spells/adventurers_dirge.lua =================================================================== --- scripts/globals/spells/adventurers_dirge.lua (revision 0) +++ scripts/globals/spells/adventurers_dirge.lua (working copy) @@ -0,0 +1,38 @@ +----------------------------------------- +-- Spell: Adventurer's Dirge +-- Grants enmity minus to a party member. +-- I'm sure it's not correct but a stop gap until it's implemented. +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local duration = 120; + local power = 20; + if(caster:getObjType() == TYPE_PC) then + local merit =((target:getMerit(MERIT_ADVENTURERS_DIRGE) * .03) - .03); + power = power + (power * merit); + -- printf("Power and Merit %d",power); + end + + duration = duration + (duration * (target:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((target:getMod(MOD_ALL_SONGS) * 10)/100)); + + -- printf("Final Power %d",power); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_DIRGE); + target:addStatusEffect(EFFECT_DIRGE,power,3,duration); + spell:setMsg(230); + return EFFECT_DIRGE; +end; \ No newline at end of file Index: scripts/globals/spells/aero_ii.lua =================================================================== --- scripts/globals/spells/aero_ii.lua (revision 3304) +++ scripts/globals/spells/aero_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Aero +-- Spell: Aero II -- Deals wind damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/aero_iii.lua =================================================================== --- scripts/globals/spells/aero_iii.lua (revision 3304) +++ scripts/globals/spells/aero_iii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Aero +-- Spell: Aero III -- Deals wind damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/aero_iv.lua =================================================================== --- scripts/globals/spells/aero_iv.lua (revision 3304) +++ scripts/globals/spells/aero_iv.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Aero +-- Spell: Aero IV -- Deals wind damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/aero_v.lua =================================================================== --- scripts/globals/spells/aero_v.lua (revision 3304) +++ scripts/globals/spells/aero_v.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Aero +-- Spell: Aero V -- Deals wind damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/aeroga_ii.lua =================================================================== --- scripts/globals/spells/aeroga_ii.lua (revision 3304) +++ scripts/globals/spells/aeroga_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Aeroga +-- Spell: Aeroga II -- Deals wind damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/aeroga_iii.lua =================================================================== --- scripts/globals/spells/aeroga_iii.lua (revision 3304) +++ scripts/globals/spells/aeroga_iii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Aeroga 3 +-- Spell: Aeroga III -- Deals wind damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/aeroga_iv.lua =================================================================== --- scripts/globals/spells/aeroga_iv.lua (revision 0) +++ scripts/globals/spells/aeroga_iv.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Aeroga IV +-- Deals wind damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(788,2,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/aeroga_v.lua =================================================================== --- scripts/globals/spells/aeroga_v.lua (revision 0) +++ scripts/globals/spells/aeroga_v.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Aeroga V +-- Deals wind damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(1054,2.3,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/aisha_ichi.lua =================================================================== --- scripts/globals/spells/aisha_ichi.lua (revision 0) +++ scripts/globals/spells/aisha_ichi.lua (working copy) @@ -0,0 +1,63 @@ +----------------------------------------- +-- Spell: Aisha: Ichi +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + -- Pull base stats. + dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT)); + staff = StaffBonus(caster,spell); + + -- Base power. + power = 15; + + -- Duration, including resistance. Unconfirmed. + duration = 180 * applyResistance(caster,spell,target,dINT,43,staff); + + if(duration >= 90) then --Do it! + -- Try to erase a weaker attkdown. + attkdown = target:getStatusEffect(EFFECT_ATTACK_DOWN) + if(attkdown ~= nil) then + if(attkdown:getPower() < power) then + target:delStatusEffect(EFFECT_ATTACK_DOWN); + target:addStatusEffect(EFFECT_ATTACK_DOWN,power,0,duration); +-- if(spell:isAOE() == false) then +-- spell:setMsg(237); +-- else + spell:setMsg(267); +-- end + else + spell:setMsg(75); + end + else + target:addStatusEffect(EFFECT_ATTACK_DOWN,power,0,duration); +-- if(spell:isAOE() == false) then +-- spell:setMsg(237); +-- else + spell:setMsg(267); +-- end + end + else +-- if(spell:isAOE() == false) then +-- spell:setMsg(85); +-- else + spell:setMsg(284); +-- end + end + + target:updateEnmity(caster,320,1); + + return EFFECT_ATTACK_DOWN; + +end; \ No newline at end of file Index: scripts/globals/spells/aquaveil.lua =================================================================== --- scripts/globals/spells/aquaveil.lua (revision 3304) +++ scripts/globals/spells/aquaveil.lua (working copy) @@ -11,10 +11,10 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) target:delStatusEffect(EFFECT_AQUAVEIL); @@ -23,12 +23,23 @@ -- tests that quantify the relationship so I'm using 5 minutes for now. duration = 300; - + power = AQUAVEIL_INTERR_RATE; + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); - target:addStatusEffect(EFFECT_AQUAVEIL,AQUAVEIL_INTERR_RATE,0,duration); + if (caster:getEquipID(SLOT_WAIST) == 11753) then -- Emphatikos Rope + power = power + 12; + end + + if (caster:getEquipID(SLOT_LEGS) == 10329) then -- Shedir Seraweels + power = power + 12; + end + + target:addStatusEffect(EFFECT_AQUAVEIL,power,0,duration); spell:setMsg(230); return EFFECT_AQUAVEIL; Index: scripts/globals/spells/archers_prelude.lua =================================================================== --- scripts/globals/spells/archers_prelude.lua (revision 0) +++ scripts/globals/spells/archers_prelude.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- Spell: Archer's Prelude +-- Grants Ranged Accuracy bonus to target. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local duration = 120; + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + + duration = duration + (duration * (target:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((target:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((target:getMod(MOD_PRELUDE) * 10)/100)); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_PRELUDE); + target:addStatusEffect(EFFECT_PRELUDE,2,0,duration); + spell:setMsg(230); + return EFFECT_PRELUDE; +end; \ No newline at end of file Index: scripts/globals/spells/arise.lua =================================================================== --- scripts/globals/spells/arise.lua (revision 0) +++ scripts/globals/spells/arise.lua (working copy) @@ -0,0 +1,19 @@ +----------------------------------------- +-- Spell: Arise +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + target:sendRaise(3); + target:delStatusEffect(EFFECT_RERAISE); + target:addStatusEffect(EFFECT_RERAISE,3,0,3600); --reraise 3, 1 hr duration +end; \ No newline at end of file Index: scripts/globals/spells/armys_paeon.lua =================================================================== --- scripts/globals/spells/armys_paeon.lua (revision 3304) +++ scripts/globals/spells/armys_paeon.lua (working copy) @@ -17,25 +17,48 @@ end; function onSpellCast(caster,target,spell) - + local duration = 120; local hp = 1; - local sItem = caster:getEquipID(2); + sItem = caster:getEquipID(SLOT_RANGED); + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + -- If Job is Bard and Level is at or above 25 then get bonus HP. if(caster:getMainJob() == 10 and caster:getMainLvl() >= 25) then hp = hp + 1; end - -- Ebony Harp - if(sItem == 17357) then - hp = hp + 1; - end - -- Ebony Harp +1 and Ebony Harp + 2 - if(sItem == 17833 or sItem == 17848) then - hp = hp + 2; - end + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. target:delStatusEffect(EFFECT_PAEON); - target:addStatusEffect(EFFECT_PAEON,hp,3,120); + target:addStatusEffect(EFFECT_PAEON,1,3,duration); spell:setMsg(230); Index: scripts/globals/spells/armys_paeon_ii.lua =================================================================== --- scripts/globals/spells/armys_paeon_ii.lua (revision 3304) +++ scripts/globals/spells/armys_paeon_ii.lua (working copy) @@ -14,25 +14,48 @@ end; function onSpellCast(caster,target,spell) + local duration = 120; + local hp = 2; + sItem = caster:getEquipID(SLOT_RANGED); + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end - local hp = 2; - local sItem = caster:getEquipID(2); -- If Job is Bard and Level is at or above 40 then get bonus HP. if(caster:getMainJob() == 10 and caster:getMainLvl() >= 40) then hp = hp + 1; end - -- Ebony Harp - if(sItem == 17357) then - hp = hp + 1; - end - -- Ebony Harp +1 and Ebony Harp + 2 - if(sItem == 17833 or sItem == 17848) then - hp = hp + 2; - end + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. target:delStatusEffect(EFFECT_PAEON); - target:addStatusEffect(EFFECT_PAEON,hp,3,120); + target:addStatusEffect(EFFECT_PAEON,2,3,duration); spell:setMsg(230); return EFFECT_PAEON; end; \ No newline at end of file Index: scripts/globals/spells/armys_paeon_iii.lua =================================================================== --- scripts/globals/spells/armys_paeon_iii.lua (revision 3304) +++ scripts/globals/spells/armys_paeon_iii.lua (working copy) @@ -14,25 +14,48 @@ end; function onSpellCast(caster,target,spell) + local duration = 120; + local hp = 3; + sItem = caster:getEquipID(SLOT_RANGED); + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end - local hp = 3; - local sItem = caster:getEquipID(2); -- If Job is Bard and Level is at or above 55 then get bonus HP. if(caster:getMainJob() == 10 and caster:getMainLvl() >= 55) then hp = hp + 1; end - -- Ebony Harp - if(sItem == 17357) then - hp = hp + 1; - end - -- Ebony Harp +1 and Ebony Harp + 2 - if(sItem == 17833 or sItem == 17848) then - hp = hp + 2; - end + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. target:delStatusEffect(EFFECT_PAEON); - target:addStatusEffect(EFFECT_PAEON,hp,3,120); + target:addStatusEffect(EFFECT_PAEON,3,3,duration); spell:setMsg(230); return EFFECT_PAEON; end; \ No newline at end of file Index: scripts/globals/spells/armys_paeon_iv.lua =================================================================== --- scripts/globals/spells/armys_paeon_iv.lua (revision 3304) +++ scripts/globals/spells/armys_paeon_iv.lua (working copy) @@ -14,25 +14,48 @@ end; function onSpellCast(caster,target,spell) - + local duration = 120; local hp = 4; - local sItem = caster:getEquipID(2); + sItem = caster:getEquipID(SLOT_RANGED); + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + -- If Job is Bard and Level is at or above 70 then get bonus HP. if(caster:getMainJob() == 10 and caster:getMainLvl() >= 70) then hp = hp + 1; end - -- Ebony Harp - if(sItem == 17357) then - hp = hp + 1; - end - -- Ebony Harp +1 and Ebony Harp + 2 - if(sItem == 17833 or sItem == 17848) then - hp = hp + 2; - end + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. target:delStatusEffect(EFFECT_PAEON); - target:addStatusEffect(EFFECT_PAEON,hp,3,120); + target:addStatusEffect(EFFECT_PAEON,4,3,duration); spell:setMsg(230); return EFFECT_PAEON; end; \ No newline at end of file Index: scripts/globals/spells/armys_paeon_v.lua =================================================================== --- scripts/globals/spells/armys_paeon_v.lua (revision 3304) +++ scripts/globals/spells/armys_paeon_v.lua (working copy) @@ -14,25 +14,48 @@ end; function onSpellCast(caster,target,spell) - + local duration = 120; local hp = 5; - local sItem = caster:getEquipID(2); + sItem = caster:getEquipID(SLOT_RANGED); + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + -- If Job is Bard and Level is at or above 75 then get bonus HP. if(caster:getMainJob() == 10 and caster:getMainLvl() >= 75) then hp = hp + 1; end - -- Ebony Harp - if(sItem == 17357) then - hp = hp + 1; - end - -- Ebony Harp +1 and Ebony Harp + 2 - if(sItem == 17833 or sItem == 17848) then - hp = hp + 2; - end + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. target:delStatusEffect(EFFECT_PAEON); - target:addStatusEffect(EFFECT_PAEON,hp,3,120); + target:addStatusEffect(EFFECT_PAEON,5,3,duration); spell:setMsg(230); return EFFECT_PAEON; end; \ No newline at end of file Index: scripts/globals/spells/armys_paeon_vi.lua =================================================================== --- scripts/globals/spells/armys_paeon_vi.lua (revision 0) +++ scripts/globals/spells/armys_paeon_vi.lua (working copy) @@ -0,0 +1,61 @@ +----------------------------------------- +-- Spell: Army's Paeon VI +-- Gradually restores target's HP. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local duration = 120; + local hp = 6; + sItem = caster:getEquipID(SLOT_RANGED); + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + + -- If Job is Bard and Level is at or above 75 then get bonus HP. + if(caster:getMainJob() == 10 and caster:getMainLvl() >= 75) then + hp = hp + 1; + end + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_PAEON); + target:addStatusEffect(EFFECT_PAEON,6,3,duration); + spell:setMsg(230); + return EFFECT_PAEON; +end; \ No newline at end of file Index: scripts/globals/spells/aspir.lua =================================================================== --- scripts/globals/spells/aspir.lua (revision 3304) +++ scripts/globals/spells/aspir.lua (working copy) @@ -15,6 +15,7 @@ end; function onSpellCast(caster,target,spell) + --calculate raw damage (unknown function -> only dark skill though) - using http://www.bluegartr.com/threads/44518-Drain-Calculations -- also have small constant to account for 0 dark skill dmg = 5 + 0.375 * (caster:getSkillLevel(DARK_MAGIC_SKILL) + caster:getMod(79 + DARK_MAGIC_SKILL)); Index: scripts/globals/spells/aspir_ii.lua =================================================================== --- scripts/globals/spells/aspir_ii.lua (revision 0) +++ scripts/globals/spells/aspir_ii.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- Spell: Aspir II +-- Drain functions only on skill level!! +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + --calculate raw damage (unknown function -> only dark skill though) - using http://www.bluegartr.com/threads/44518-Drain-Calculations + -- also have small constant to account for 0 dark skill + dmg = 5 + 0.6 * (caster:getSkillLevel(DARK_MAGIC_SKILL) + caster:getMod(79 + DARK_MAGIC_SKILL)); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getMod(MOD_INT)-target:getMod(MOD_INT),DARK_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + + if(target:isUndead()) then + spell:setMsg(75); -- No effect + return; + end + + if(target:getMP() > dmg) then + caster:addMP(dmg); + target:delMP(dmg); + else + dmg = target:getMP(); + caster:addMP(dmg); + target:delMP(dmg); + end + + spell:setMsg(228); --change msg to 'xxx mp drained from the yyyy.' + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/banish.lua =================================================================== --- scripts/globals/spells/banish.lua (revision 3304) +++ scripts/globals/spells/banish.lua (working copy) @@ -17,6 +17,13 @@ function onSpellCast(caster,target,spell) --calculate raw damage dmg = calculateMagicDamage(14,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + if(job == JOB_WHM or sjob == JOB_WHM) then + dmg = calculateMagicDamage(14,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false) + caster:getMerit(MERIT_BANISH_EFFECT); + end + end --get resist multiplier (1x if no resist) resist = applyResistance(caster,spell,target,caster:getStat(MOD_MND)-target:getStat(MOD_MND),DIVINE_MAGIC_SKILL,1.0); --get the resisted damage @@ -27,5 +34,33 @@ dmg = adjustForTarget(target,dmg); --add in final adjustments dmg = finalMagicAdjustments(caster,target,spell,dmg); + duration = 15; + if(caster:getObjType() == TYPE_PC) then + if(job == JOB_WHM or sjob == JOB_WHM) then + duration = 15 + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + power = 500; + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + local hands = caster:getEquipID(SLOT_HANDS); + -- Equipment Bonuses + if(ring1 == 15831 or ring2 == 15831) then + power = power + 25; + end + if(hands == 15104 or hands == 14911) then + power = power + 25; + end + if(hands == 10692) then + power = power + 50; + end + if(target:isUndead()) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + elseif(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == true) then + target:delStatusEffect(EFFECT_DEFENSE_DOWN); + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + end + end return dmg; end; \ No newline at end of file Index: scripts/globals/spells/banish_ii.lua =================================================================== --- scripts/globals/spells/banish_ii.lua (revision 3304) +++ scripts/globals/spells/banish_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Banish +-- Spell: Banish II -- Deals light damage to an enemy. ----------------------------------------- @@ -17,6 +17,13 @@ function onSpellCast(caster,target,spell) --calculate raw damage dmg = calculateMagicDamage(85,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + if(job == JOB_WHM or sjob == JOB_WHM) then + dmg = calculateMagicDamage(85,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false) + caster:getMerit(MERIT_BANISH_EFFECT); + end + end --get resist multiplier (1x if no resist) resist = applyResistance(caster,spell,target,caster:getStat(MOD_MND)-target:getStat(MOD_MND),DIVINE_MAGIC_SKILL,1.0); --get the resisted damage @@ -27,5 +34,33 @@ dmg = adjustForTarget(target,dmg); --add in final adjustments dmg = finalMagicAdjustments(caster,target,spell,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + if(job == JOB_WHM or sjob == JOB_WHM) then + duration = 30 + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + power = 600; + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + local hands = caster:getEquipID(SLOT_HANDS); + -- Equipment Bonuses + if(ring1 == 15831 or ring2 == 15831) then + power = power + 25; + end + if(hands == 15104 or hands == 14911) then + power = power + 25; + end + if(hands == 10692) then + power = power + 50; + end + if(target:isUndead()) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + elseif(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == true) then + target:delStatusEffect(EFFECT_DEFENSE_DOWN); + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + end + end return dmg; end; \ No newline at end of file Index: scripts/globals/spells/banish_iii.lua =================================================================== --- scripts/globals/spells/banish_iii.lua (revision 3304) +++ scripts/globals/spells/banish_iii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Banish +-- Spell: Banish III -- Deals light damage to an enemy. ----------------------------------------- @@ -17,6 +17,13 @@ function onSpellCast(caster,target,spell) --calculate raw damage dmg = calculateMagicDamage(198,1.5,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + if(job == JOB_WHM or sjob == JOB_WHM) then + dmg = calculateMagicDamage(198,1.5,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false) + caster:getMerit(MERIT_BANISH_EFFECT); + end + end --get resist multiplier (1x if no resist) resist = applyResistance(caster,spell,target,caster:getStat(MOD_MND)-target:getStat(MOD_MND),DIVINE_MAGIC_SKILL,1.0); --get the resisted damage @@ -27,5 +34,33 @@ dmg = adjustForTarget(target,dmg); --add in final adjustments dmg = finalMagicAdjustments(caster,target,spell,dmg); + duration = 45; + if(caster:getObjType() == TYPE_PC) then + if(job == JOB_WHM or sjob == JOB_WHM) then + duration = 45 + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + power = 700; + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + local hands = caster:getEquipID(SLOT_HANDS); + -- Equipment Bonuses + if(ring1 == 15831 or ring2 == 15831) then + power = power + 25; + end + if(hands == 15104 or hands == 14911) then + power = power + 25; + end + if(hands == 10692) then + power = power + 50; + end + if(target:isUndead()) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + elseif(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == true) then + target:delStatusEffect(EFFECT_DEFENSE_DOWN); + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + end + end return dmg; end; \ No newline at end of file Index: scripts/globals/spells/banish_iv.lua =================================================================== --- scripts/globals/spells/banish_iv.lua (revision 3304) +++ scripts/globals/spells/banish_iv.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Banish +-- Spell: Banish IV -- Deals light damage to an enemy. ----------------------------------------- @@ -16,7 +16,14 @@ function onSpellCast(caster,target,spell) --calculate raw damage - dmg = calculateMagicDamage(396,1.5,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false); + dmg = calculateMagicDamage(398,1.5,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + if(job == JOB_WHM or sjob == JOB_WHM) then + dmg = calculateMagicDamage(398,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false) + caster:getMerit(MERIT_BANISH_EFFECT); + end + end --get resist multiplier (1x if no resist) resist = applyResistance(caster,spell,target,caster:getStat(MOD_MND)-target:getStat(MOD_MND),DIVINE_MAGIC_SKILL,1.0); --get the resisted damage @@ -27,5 +34,33 @@ dmg = adjustForTarget(target,dmg); --add in final adjustments dmg = finalMagicAdjustments(caster,target,spell,dmg); - return dmg; + duration = 60; + if(caster:getObjType() == TYPE_PC) then + if(job == JOB_WHM or sjob == JOB_WHM) then + duration = 60 + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + power = 800; + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + local hands = caster:getEquipID(SLOT_HANDS); + -- Equipment Bonuses + if(ring1 == 15831 or ring2 == 15831) then + power = power + 25; + end + if(hands == 15104 or hands == 14911) then + power = power + 25; + end + if(hands == 10692) then + power = power + 50; + end + if(target:isUndead()) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + elseif(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == true) then + target:delStatusEffect(EFFECT_DEFENSE_DOWN); + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + end + end + return dmg; end; \ No newline at end of file Index: scripts/globals/spells/banish_v.lua =================================================================== --- scripts/globals/spells/banish_v.lua (revision 0) +++ scripts/globals/spells/banish_v.lua (working copy) @@ -0,0 +1,66 @@ +----------------------------------------- +-- Spell: Banish V +-- Deals light damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(594,1.5,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + if(job == JOB_WHM or sjob == JOB_WHM) then + dmg = calculateMagicDamage(594,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false) + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_MND)-target:getStat(MOD_MND),DIVINE_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + duration = 75; + if(caster:getObjType() == TYPE_PC) then + if(job == JOB_WHM or sjob == JOB_WHM) then + duration = 75 + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + power = 900; + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + local hands = caster:getEquipID(SLOT_HANDS); + -- Equipment Bonuses + if(ring1 == 15831 or ring2 == 15831) then + power = power + 25; + end + if(hands == 15104 or hands == 14911) then + power = power + 25; + end + if(hands == 10692) then + power = power + 50; + end + if(target:isUndead()) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + elseif(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == true) then + target:delStatusEffect(EFFECT_DEFENSE_DOWN); + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + end + end + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/banishga.lua =================================================================== --- scripts/globals/spells/banishga.lua (revision 3304) +++ scripts/globals/spells/banishga.lua (working copy) @@ -17,6 +17,13 @@ function onSpellCast(caster,target,spell) --calculate raw damage dmg = calculateMagicDamage(50,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + if(job == JOB_WHM or sjob == JOB_WHM) then + dmg = calculateMagicDamage(50,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false) + caster:getMerit(MERIT_BANISH_EFFECT); + end + end --get resist multiplier (1x if no resist) resist = applyResistance(caster,spell,target,caster:getStat(MOD_MND)-target:getStat(MOD_MND),DIVINE_MAGIC_SKILL,1.0); --get the resisted damage @@ -27,5 +34,33 @@ dmg = adjustForTarget(target,dmg); --add in final adjustments dmg = finalMagicAdjustments(caster,target,spell,dmg); + duration = 15; + if(caster:getObjType() == TYPE_PC) then + if(job == JOB_WHM or sjob == JOB_WHM) then + duration = 15 + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + power = 500; + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + local hands = caster:getEquipID(SLOT_HANDS); + -- Equipment Bonuses + if(ring1 == 15831 or ring2 == 15831) then + power = power + 25; + end + if(hands == 15104 or hands == 14911) then + power = power + 25; + end + if(hands == 10692) then + power = power + 50; + end + if(target:isUndead()) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + elseif(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == true) then + target:delStatusEffect(EFFECT_DEFENSE_DOWN); + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + end + end return dmg; end; \ No newline at end of file Index: scripts/globals/spells/banishga_ii.lua =================================================================== --- scripts/globals/spells/banishga_ii.lua (revision 3304) +++ scripts/globals/spells/banishga_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Banishga 2 +-- Spell: Banishga II -- Deals light damage to an enemy. ----------------------------------------- @@ -17,6 +17,13 @@ function onSpellCast(caster,target,spell) --calculate raw damage dmg = calculateMagicDamage(180,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + if(job == JOB_WHM or sjob == JOB_WHM) then + dmg = calculateMagicDamage(180,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false) + caster:getMerit(MERIT_BANISH_EFFECT); + end + end --get resist multiplier (1x if no resist) resist = applyResistance(caster,spell,target,caster:getStat(MOD_MND)-target:getStat(MOD_MND),DIVINE_MAGIC_SKILL,1.0); --get the resisted damage @@ -27,5 +34,33 @@ dmg = adjustForTarget(target,dmg); --add in final adjustments dmg = finalMagicAdjustments(caster,target,spell,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + if(job == JOB_WHM or sjob == JOB_WHM) then + duration = 30 + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + power = 600; + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + local hands = caster:getEquipID(SLOT_HANDS); + -- Equipment Bonuses + if(ring1 == 15831 or ring2 == 15831) then + power = power + 25; + end + if(hands == 15104 or hands == 14911) then + power = power + 25; + end + if(hands == 10692) then + power = power + 50; + end + if(target:isUndead()) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + elseif(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == true) then + target:delStatusEffect(EFFECT_DEFENSE_DOWN); + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + end + end return dmg; end; \ No newline at end of file Index: scripts/globals/spells/banishga_iii.lua =================================================================== --- scripts/globals/spells/banishga_iii.lua (revision 3304) +++ scripts/globals/spells/banishga_iii.lua (working copy) @@ -1,31 +1,66 @@ ------------------------------------------ --- Spell: Banishga 3 --- Deals light damage to an enemy. ------------------------------------------ - -require("scripts/globals/magic"); -require("scripts/globals/status"); - ------------------------------------------ --- OnSpellCast ------------------------------------------ - +----------------------------------------- +-- Spell: Banishga III +-- Deals light damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + function OnMagicCastingCheck(caster,target,spell) return 0; end; -function onSpellCast(caster,target,spell) - --calculate raw damage - dmg = calculateMagicDamage(455,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false); - --get resist multiplier (1x if no resist) - resist = applyResistance(caster,spell,target,caster:getStat(MOD_MND)-target:getStat(MOD_MND),DIVINE_MAGIC_SKILL,1.0); - --get the resisted damage - dmg = dmg*resist; - --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - dmg = addBonuses(caster,spell,target,dmg); - --add in target adjustment - dmg = adjustForTarget(target,dmg); - --add in final adjustments - dmg = finalMagicAdjustments(caster,target,spell,dmg); - return dmg; +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(455,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + if(job == JOB_WHM or sjob == JOB_WHM) then + dmg = calculateMagicDamage(455,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false) + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_MND)-target:getStat(MOD_MND),DIVINE_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + duration = 45; + if(caster:getObjType() == TYPE_PC) then + if(job == JOB_WHM or sjob == JOB_WHM) then + duration = 45 + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + power = 700; + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + local hands = caster:getEquipID(SLOT_HANDS); + -- Equipment Bonuses + if(ring1 == 15831 or ring2 == 15831) then + power = power + 25; + end + if(hands == 15104 or hands == 14911) then + power = power + 25; + end + if(hands == 10692) then + power = power + 50; + end + if(target:isUndead()) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + elseif(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == true) then + target:delStatusEffect(EFFECT_DEFENSE_DOWN); + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + end + end + return dmg; end; \ No newline at end of file Index: scripts/globals/spells/banishga_iv.lua =================================================================== --- scripts/globals/spells/banishga_iv.lua (revision 0) +++ scripts/globals/spells/banishga_iv.lua (working copy) @@ -0,0 +1,66 @@ +----------------------------------------- +-- Spell: Banishga IV +-- Deals light damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(810,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + if(job == JOB_WHM or sjob == JOB_WHM) then + dmg = calculateMagicDamage(810,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false) + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_MND)-target:getStat(MOD_MND),DIVINE_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + duration = 60; + if(caster:getObjType() == TYPE_PC) then + if(job == JOB_WHM or sjob == JOB_WHM) then + duration = 60 + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + power = 800; + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + local hands = caster:getEquipID(SLOT_HANDS); + -- Equipment Bonuses + if(ring1 == 15831 or ring2 == 15831) then + power = power + 25; + end + if(hands == 15104 or hands == 14911) then + power = power + 25; + end + if(hands == 10692) then + power = power + 50; + end + if(target:isUndead()) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + elseif(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == true) then + target:delStatusEffect(EFFECT_DEFENSE_DOWN); + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + end + end + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/banishga_v.lua =================================================================== --- scripts/globals/spells/banishga_v.lua (revision 0) +++ scripts/globals/spells/banishga_v.lua (working copy) @@ -0,0 +1,66 @@ +----------------------------------------- +-- Spell: Banishga V +-- Deals light damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(1512,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + if(job == JOB_WHM or sjob == JOB_WHM) then + dmg = calculateMagicDamage(1512,1,caster,spell,target,DIVINE_MAGIC_SKILL,MOD_MND,false) + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_MND)-target:getStat(MOD_MND),DIVINE_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + duration = 75; + if(caster:getObjType() == TYPE_PC) then + if(job == JOB_WHM or sjob == JOB_WHM) then + duration = 75 + caster:getMerit(MERIT_BANISH_EFFECT); + end + end + power = 900; + local ring1 = caster:getEquipID(SLOT_RING1); + local ring2 = caster:getEquipID(SLOT_RING2); + local hands = caster:getEquipID(SLOT_HANDS); + -- Equipment Bonuses + if(ring1 == 15831 or ring2 == 15831) then + power = power + 25; + end + if(hands == 15104 or hands == 14911) then + power = power + 25; + end + if(hands == 10692) then + power = power + 50; + end + if(target:isUndead()) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + elseif(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == true) then + target:delStatusEffect(EFFECT_DEFENSE_DOWN); + target:addStatusEffect(EFFECT_DEFENSE_DOWN,power,0,duration); + end + end + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/baraera.lua =================================================================== --- scripts/globals/spells/baraera.lua (revision 3304) +++ scripts/globals/spells/baraera.lua (working copy) @@ -8,15 +8,18 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); + power = 40 + (0.2 * enchanceSkill); - power = 40 + 0.2 * enchanceSkill; - + if(caster:getObjType() == TYPE_PC) then + power = 40 + (0.2 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end + duration = 150; if(enchanceSkill >180)then @@ -27,6 +30,13 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + duration = duration + (duration * caster:getMod(MOD_BARSPELL_DUR)); + + power = power + caster:getMod(MOD_BARSPELL_PWR); + target:addStatusEffect(EFFECT_BARAERO,power,0,duration,0,1); return EFFECT_BARAERO; Index: scripts/globals/spells/baraero.lua =================================================================== --- scripts/globals/spells/baraero.lua (revision 3304) +++ scripts/globals/spells/baraero.lua (working copy) @@ -8,10 +8,10 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); @@ -27,6 +27,13 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + duration = duration + (duration * caster:getMod(MOD_BARSPELL_DUR)); + + power = power + caster:getMod(MOD_BARSPELL_PWR); + target:addStatusEffect(EFFECT_BARAERO,power,0,duration,0,1); return EFFECT_BARAERO; Index: scripts/globals/spells/baramnesia.lua =================================================================== --- scripts/globals/spells/baramnesia.lua (revision 0) +++ scripts/globals/spells/baramnesia.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- Spell: Baramnesia +----------------------------------------- +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + duration = 150; + enchanceSkill = caster:getSkillLevel(34); + power = 40 + 0.2 * enchanceSkill; + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster == target) then + duration = duration * 3; + end + + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + target:delStatusEffect(EFFECT_BARAMNESIA); + target:addStatusEffect(EFFECT_BARAMNESIA,power,0,duration); +end; \ No newline at end of file Index: scripts/globals/spells/baramnesra.lua =================================================================== --- scripts/globals/spells/baramnesra.lua (revision 0) +++ scripts/globals/spells/baramnesra.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------------- +-- Spell: Baramnesra +----------------------------------------- +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + duration = 150; + enchanceSkill = caster:getSkillLevel(34); + power = 40 + 0.2 * enchanceSkill; + + if(caster:getObjType() == TYPE_PC) then + power = power + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster == target) then + duration = duration * 3; + end + target:delStatusEffect(EFFECT_BARAMNESIA); + target:addStatusEffect(EFFECT_BARAMNESIA,power,0,duration); +end; \ No newline at end of file Index: scripts/globals/spells/barblind.lua =================================================================== --- scripts/globals/spells/barblind.lua (revision 3304) +++ scripts/globals/spells/barblind.lua (working copy) @@ -27,6 +27,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARBLIND,power,0,duration,0,1); return EFFECT_BARBLIND; Index: scripts/globals/spells/barblindra.lua =================================================================== --- scripts/globals/spells/barblindra.lua (revision 3304) +++ scripts/globals/spells/barblindra.lua (working copy) @@ -8,15 +8,17 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); + power = 1 + (0.02 * enchanceSkill); + if(caster:getObjType() == TYPE_PC) then + power = 1 + (0.02 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end - power = 1 + 0.02 * enchanceSkill; - duration = 150; if(enchanceSkill >180)then @@ -26,6 +28,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARBLIND,power,0,duration,0,1); return EFFECT_BARBLIND; Index: scripts/globals/spells/barblizzara.lua =================================================================== --- scripts/globals/spells/barblizzara.lua (revision 3304) +++ scripts/globals/spells/barblizzara.lua (working copy) @@ -8,15 +8,17 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); + power = 40 + (0.2 * enchanceSkill); - power = 40 + 0.2 * enchanceSkill; - + if(caster:getObjType() == TYPE_PC) then + power = 40 + (0.2 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end duration = 150; if(enchanceSkill >180)then @@ -27,7 +29,14 @@ duration = duration * 3; end - target:addStatusEffect(EFFECT_BARBLIZZARD,power,0,duration,0,1); + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + duration = duration + (duration * caster:getMod(MOD_BARSPELL_DUR)); + + power = power + caster:getMod(MOD_BARSPELL_PWR); + + target:addStatusEffect(EFFECT_BARBLIZZARD,power,0,duration,0,1); return EFFECT_BARBLIZZARD; end; Index: scripts/globals/spells/barblizzard.lua =================================================================== --- scripts/globals/spells/barblizzard.lua (revision 3304) +++ scripts/globals/spells/barblizzard.lua (working copy) @@ -8,10 +8,10 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); @@ -27,6 +27,13 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + duration = duration + (duration * caster:getMod(MOD_BARSPELL_DUR)); + + power = power + caster:getMod(MOD_BARSPELL_PWR); + target:addStatusEffect(EFFECT_BARBLIZZARD,power,0,duration,0,1); return EFFECT_BARBLIZZARD; Index: scripts/globals/spells/barfira.lua =================================================================== --- scripts/globals/spells/barfira.lua (revision 3304) +++ scripts/globals/spells/barfira.lua (working copy) @@ -8,15 +8,17 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); + power = 40 + (0.2 * enchanceSkill); - power = 40 + 0.2 * enchanceSkill; - + if(caster:getObjType() == TYPE_PC) then + power = 40 + (0.2 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end duration = 150; if(enchanceSkill >180)then @@ -27,7 +29,14 @@ duration = duration * 3; end - target:addStatusEffect(EFFECT_BARFIRE,power,0,duration,0,1); + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + duration = duration + (duration * caster:getMod(MOD_BARSPELL_DUR)); + + power = power + caster:getMod(MOD_BARSPELL_PWR); + + target:addStatusEffect(EFFECT_BARFIRE,power,0,duration,0,1); spell:setMsg(230); return EFFECT_BARFIRE; Index: scripts/globals/spells/barfire.lua =================================================================== --- scripts/globals/spells/barfire.lua (revision 3304) +++ scripts/globals/spells/barfire.lua (working copy) @@ -8,10 +8,10 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); @@ -27,6 +27,13 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + duration = duration + (duration * caster:getMod(MOD_BARSPELL_DUR)); + + power = power + caster:getMod(MOD_BARSPELL_PWR); + target:addStatusEffect(EFFECT_BARFIRE,power,0,duration,0,1); return EFFECT_BARFIRE; Index: scripts/globals/spells/barparalyze.lua =================================================================== --- scripts/globals/spells/barparalyze.lua (revision 3304) +++ scripts/globals/spells/barparalyze.lua (working copy) @@ -27,6 +27,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARPARALYZE,power,0,duration,0,1); return EFFECT_BARPARALYZE; Index: scripts/globals/spells/barparalyzra.lua =================================================================== --- scripts/globals/spells/barparalyzra.lua (revision 3304) +++ scripts/globals/spells/barparalyzra.lua (working copy) @@ -8,15 +8,16 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); - - power = 1 + 0.02 * enchanceSkill; - + power = 1 + (0.02 * enchanceSkill); + if(caster:getObjType() == TYPE_PC) then + power = 1 + (0.02 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end duration = 150; if(enchanceSkill >180)then @@ -27,6 +28,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARPARALYZE,power,0,duration,0,1); return EFFECT_BARPARALYZE; Index: scripts/globals/spells/barpetra.lua =================================================================== --- scripts/globals/spells/barpetra.lua (revision 3304) +++ scripts/globals/spells/barpetra.lua (working copy) @@ -8,15 +8,16 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); - - power = 1 + 0.02 * enchanceSkill; - + power = 1 + (0.02 * enchanceSkill); + if(caster:getObjType() == TYPE_PC) then + power = 1 + (0.02 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end duration = 150; if(enchanceSkill >180)then @@ -27,6 +28,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARPETRIFY,power,0,duration,0,1); return EFFECT_BARPETRIFY; Index: scripts/globals/spells/barpetrify.lua =================================================================== --- scripts/globals/spells/barpetrify.lua (revision 3304) +++ scripts/globals/spells/barpetrify.lua (working copy) @@ -27,6 +27,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARPETRIFY,power,0,duration,0,1); return EFFECT_BARPETRIFY; Index: scripts/globals/spells/barpoison.lua =================================================================== --- scripts/globals/spells/barpoison.lua (revision 3304) +++ scripts/globals/spells/barpoison.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: BARAERA +-- Spell: BARPOISON ----------------------------------------- require("scripts/globals/status"); @@ -27,6 +27,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARPOISON,power,0,duration,0,1); return EFFECT_BARPOISON; Index: scripts/globals/spells/barpoisonra.lua =================================================================== --- scripts/globals/spells/barpoisonra.lua (revision 3304) +++ scripts/globals/spells/barpoisonra.lua (working copy) @@ -8,15 +8,16 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); - - power = 1 + 0.02 * enchanceSkill; - + power = 1 + (0.02 * enchanceSkill); + if(caster:getObjType() == TYPE_PC) then + power = 1 + (0.02 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end duration = 150; if(enchanceSkill >180)then @@ -27,6 +28,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARPOISON,power,0,duration,0,1); return EFFECT_BARPOISON; Index: scripts/globals/spells/barsilence.lua =================================================================== --- scripts/globals/spells/barsilence.lua (revision 3304) +++ scripts/globals/spells/barsilence.lua (working copy) @@ -27,6 +27,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARSILENCE,power,0,duration,0,1); return EFFECT_BARSILENCE; Index: scripts/globals/spells/barsilencera.lua =================================================================== --- scripts/globals/spells/barsilencera.lua (revision 3304) +++ scripts/globals/spells/barsilencera.lua (working copy) @@ -8,15 +8,16 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); - - power = 1 + 0.02 * enchanceSkill; - + power = 1 + (0.02 * enchanceSkill); + if(caster:getObjType() == TYPE_PC) then + power = 1 + (0.02 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end duration = 150; if(enchanceSkill >180)then @@ -27,6 +28,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARSILENCE,power,0,duration,0,1); return EFFECT_BARSILENCE; Index: scripts/globals/spells/barsleep.lua =================================================================== --- scripts/globals/spells/barsleep.lua (revision 3304) +++ scripts/globals/spells/barsleep.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Barsleepra +-- Spell: Barsleep ----------------------------------------- require("scripts/globals/status"); @@ -27,6 +27,8 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); target:addStatusEffect(EFFECT_BARSLEEP,power,0,duration,0,1); return EFFECT_BARSLEEP; Index: scripts/globals/spells/barsleepra.lua =================================================================== --- scripts/globals/spells/barsleepra.lua (revision 3304) +++ scripts/globals/spells/barsleepra.lua (working copy) @@ -8,15 +8,16 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); - - power = 1 + 0.02 * enchanceSkill; - + power = 1 + (0.02 * enchanceSkill); + if(caster:getObjType() == TYPE_PC) then + power = 1 + (0.02 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end duration = 150; if(enchanceSkill >180)then @@ -27,6 +28,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARSLEEP,power,0,duration,0,1); return EFFECT_BARSLEEP; Index: scripts/globals/spells/barstone.lua =================================================================== --- scripts/globals/spells/barstone.lua (revision 3304) +++ scripts/globals/spells/barstone.lua (working copy) @@ -8,10 +8,10 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); @@ -27,6 +27,13 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + duration = duration + (duration * caster:getMod(MOD_BARSPELL_DUR)); + + power = power + caster:getMod(MOD_BARSPELL_PWR); + target:addStatusEffect(EFFECT_BARSTONE,power,0,duration,0,1); return EFFECT_BARSTONE; Index: scripts/globals/spells/barstonra.lua =================================================================== --- scripts/globals/spells/barstonra.lua (revision 3304) +++ scripts/globals/spells/barstonra.lua (working copy) @@ -8,15 +8,17 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); + power = 40 + (0.2 * enchanceSkill); - power = 40 + 0.2 * enchanceSkill; - + if(caster:getObjType() == TYPE_PC) then + power = 40 + (0.2 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end duration = 150; if(enchanceSkill >180)then @@ -27,7 +29,14 @@ duration = duration * 3; end - target:addStatusEffect(EFFECT_BARSTONE,power,0,duration,0,1); + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + duration = duration + (duration * caster:getMod(MOD_BARSPELL_DUR)); + + power = power + caster:getMod(MOD_BARSPELL_PWR); + + target:addStatusEffect(EFFECT_BARSTONE,power,0,duration,0,1); return EFFECT_BARSTONE; end; Index: scripts/globals/spells/barthunder.lua =================================================================== --- scripts/globals/spells/barthunder.lua (revision 3304) +++ scripts/globals/spells/barthunder.lua (working copy) @@ -8,10 +8,10 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); @@ -27,6 +27,13 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + duration = duration + (duration * caster:getMod(MOD_BARSPELL_DUR)); + + power = power + caster:getMod(MOD_BARSPELL_PWR); + target:addStatusEffect(EFFECT_BARTHUNDER,power,0,duration,0,1); return EFFECT_BARTHUNDER; Index: scripts/globals/spells/barthundra.lua =================================================================== --- scripts/globals/spells/barthundra.lua (revision 3304) +++ scripts/globals/spells/barthundra.lua (working copy) @@ -8,15 +8,17 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); + power = 40 + (0.2 * enchanceSkill); - power = 40 + 0.2 * enchanceSkill; - + if(caster:getObjType() == TYPE_PC) then + power = 40 + (0.2 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end duration = 150; if(enchanceSkill >180)then @@ -27,7 +29,14 @@ duration = duration * 3; end - target:addStatusEffect(EFFECT_BARTHUNDER,power,0,duration,0,1); + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + duration = duration + (duration * caster:getMod(MOD_BARSPELL_DUR)); + + power = power + caster:getMod(MOD_BARSPELL_PWR); + + target:addStatusEffect(EFFECT_BARTHUNDER,power,0,duration,0,1); return EFFECT_BARTHUNDER; end; Index: scripts/globals/spells/barvira.lua =================================================================== --- scripts/globals/spells/barvira.lua (revision 3304) +++ scripts/globals/spells/barvira.lua (working copy) @@ -14,9 +14,10 @@ function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); - - power = 1 + 0.02 * enchanceSkill; - + power = 1 + (0.02 * enchanceSkill); + if(caster:getObjType() == TYPE_PC) then + power = 1 + (0.02 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end duration = 150; if(enchanceSkill >180)then @@ -27,6 +28,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARVIRUS,power,0,duration,0,1); return EFFECT_BARVIRUS; Index: scripts/globals/spells/barvirus.lua =================================================================== --- scripts/globals/spells/barvirus.lua (revision 3304) +++ scripts/globals/spells/barvirus.lua (working copy) @@ -27,6 +27,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + target:addStatusEffect(EFFECT_BARVIRUS,power,0,duration,0,1); return EFFECT_BARVIRUS; Index: scripts/globals/spells/barwater.lua =================================================================== --- scripts/globals/spells/barwater.lua (revision 3304) +++ scripts/globals/spells/barwater.lua (working copy) @@ -8,10 +8,10 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); @@ -27,6 +27,13 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + duration = duration + (duration * caster:getMod(MOD_BARSPELL_DUR)); + + power = power + caster:getMod(MOD_BARSPELL_PWR); + target:addStatusEffect(EFFECT_BARWATER,power,0,duration,0,1); return EFFECT_BARWATER; Index: scripts/globals/spells/barwatera.lua =================================================================== --- scripts/globals/spells/barwatera.lua (revision 3304) +++ scripts/globals/spells/barwatera.lua (working copy) @@ -8,15 +8,17 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enchanceSkill = caster:getSkillLevel(34); + power = 40 + (0.2 * enchanceSkill); - power = 40 + 0.2 * enchanceSkill; - + if(caster:getObjType() == TYPE_PC) then + power = 40 + (0.2 * enchanceSkill) + caster:getMerit(MERIT_BAR_SPELL_EFFECT); + end duration = 150; if(enchanceSkill >180)then @@ -27,7 +29,14 @@ duration = duration * 3; end - target:addStatusEffect(EFFECT_BARWATER,power,0,duration,0,1); + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + duration = duration + (duration * caster:getMod(MOD_BARSPELL_DUR)); + + power = power + caster:getMod(MOD_BARSPELL_PWR); + + target:addStatusEffect(EFFECT_BARWATER,power,0,duration,0,1); return EFFECT_BARWATER; end; Index: scripts/globals/spells/battlefield_elegy.lua =================================================================== --- scripts/globals/spells/battlefield_elegy.lua (revision 3304) +++ scripts/globals/spells/battlefield_elegy.lua (working copy) @@ -28,29 +28,13 @@ if(100 * math.random() < target:getMod(MOD_SLOWRES)) then spell:setMsg(85); -- resisted spell else - local sItem = caster:getEquipID(2); - - -- horn +1 - if(sItem == 17371) then - power = power + 20; - duration = duration * 1.2; - end - - if(sItem == 17352) then - power = power + 11; - duration = duration * 1.1; - end - - if(sItem == 18342) then - power = power + 20; - duration = duration * 1.2; - end - - if(sItem == 17856) then - power = power + 30; - duration = duration * 1.3; - end - + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ELEGY) * 10)/100)); + + power = power + ((caster:getMod(MOD_ELEGY) + caster:getMod(MOD_ALL_SONGS)) * 5); + -- Try to overwrite weaker elegy if(target:addStatusEffect(EFFECT_ELEGY,power,0,duration)) then spell:setMsg(237); Index: scripts/globals/spells/bewitching_etude.lua =================================================================== --- scripts/globals/spells/bewitching_etude.lua (revision 0) +++ scripts/globals/spells/bewitching_etude.lua (working copy) @@ -0,0 +1,45 @@ +-------------------------------------- +-- Spell: Betwitching Etude +-- Boosts targets CHR stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + local duration = 120; + + if(enchanceSkill <416)then + power = 12 + elseif(enchanceSkill >=417 and enchanceSkill <=445)then + power = 13 + elseif(enchanceSkill >=446 and enchanceSkill <=474)then + power = 14 + elseif(enchanceSkill >=475)then + power = 15 + else + power = 15 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_CHR_DOWN) == true) then + target:delStatusEffect(EFFECT_CHR_DOWN); + else + target:addStatusEffect(EFFECT_CHR_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/bind.lua =================================================================== --- scripts/globals/spells/bind.lua (revision 3304) +++ scripts/globals/spells/bind.lua (working copy) @@ -22,8 +22,14 @@ --Resist resist = applyResistance(caster,spell,target,dINT,35,bonus); - - if(100 * math.random() >= target:getMod(MOD_BINDRES)) then + + local resistMod = 100 * math.random(); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + resistMod = resistMod + 10; + end + + if(resistMod >= target:getMod(MOD_BINDRES)) then if(resist >= 0.5) then --Do it! --Try to erase a weaker bind. if(target:addStatusEffect(EFFECT_BIND,target:speed(),0,duration)) then Index: scripts/globals/spells/bindga.lua =================================================================== --- scripts/globals/spells/bindga.lua (revision 0) +++ scripts/globals/spells/bindga.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------------- +-- Spell: Bindga +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + --Pull base stats. + dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT)); + bonus = AffinityBonus(caster,spell); + + --Duration, including resistance. May need more research. + duration = math.random(5,60); + + --Resist + resist = applyResistance(caster,spell,target,dINT,35,bonus); + + local resistMod = 100 * math.random(); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + resistMod = resistMod + 10; + end + + if(resistMod >= target:getMod(MOD_BINDRES)) then + if(resist >= 0.5) then --Do it! + --Try to erase a weaker bind. + if(target:addStatusEffect(EFFECT_BIND,target:speed(),0,duration)) then + spell:setMsg(236); + else + spell:setMsg(75); + end + end + else + spell:setMsg(85); + end + + + return EFFECT_BIND; + +end; \ No newline at end of file Index: scripts/globals/spells/bio.lua =================================================================== --- scripts/globals/spells/bio.lua (revision 3304) +++ scripts/globals/spells/bio.lua (working copy) @@ -21,9 +21,9 @@ basedmg = caster:getSkillLevel(DARK_MAGIC_SKILL) / 4; dmg = calculateMagicDamage(basedmg,1,caster,spell,target,DARK_MAGIC_SKILL,MOD_INT,false); - -- Softcaps at 15, should always do at least 1 - if(dmg > 15) then - dmg = 15; + -- Softcaps at 10, should always do at least 1 + if(dmg > 10) then + dmg = 10; end if(dmg < 1) then dmg = 1; Index: scripts/globals/spells/bio_ii.lua =================================================================== --- scripts/globals/spells/bio_ii.lua (revision 3304) +++ scripts/globals/spells/bio_ii.lua (working copy) @@ -21,9 +21,9 @@ basedmg = caster:getSkillLevel(DARK_MAGIC_SKILL) / 4; dmg = calculateMagicDamage(basedmg,2,caster,spell,target,DARK_MAGIC_SKILL,MOD_INT,false); - -- Softcaps at 8, should always do at least 1 - if(dmg > 30) then - dmg = 30; + -- Softcaps at 50, should always do at least 1 + if(dmg > 50) then + dmg = 50; end if(dmg < 1) then dmg = 1; @@ -47,7 +47,17 @@ dia = target:getStatusEffect(EFFECT_DIA); -- Calculate DoT (rough, though fairly accurate) - dotdmg = 3 + math.floor(caster:getSkillLevel(DARK_MAGIC_SKILL) / 60); + local darkSkill = caster:getSkillLevel(DARK_MAGIC_SKILL); + if(darkSkill <199)then + dotdmg = 4; + elseif(darkSkill >=200 and darkSkill <=210)then + dotdmg = 5; + elseif(darkSkill >=211 and darkSkill <=268)then + dotdmg = 6; + elseif(darkSkill >=269 and darkSkill <=290)then + dotdmg = 7; + elseif(darkSkill >=291)then + dotdmg = 8; -- Do it! if(dia == nil or (BIO_OVERWRITE == 0 and dia:getPower() <= 2) or (BIO_OVERWRITE == 1 and dia:getPower() < 2)) then Index: scripts/globals/spells/bio_iii.lua =================================================================== --- scripts/globals/spells/bio_iii.lua (revision 3304) +++ scripts/globals/spells/bio_iii.lua (working copy) @@ -21,9 +21,9 @@ basedmg = caster:getSkillLevel(DARK_MAGIC_SKILL) / 4; dmg = calculateMagicDamage(basedmg,3,caster,spell,target,DARK_MAGIC_SKILL,MOD_INT,false); - -- Softcaps at 32, should always do at least 1 - if(dmg > 62) then - dmg = 62; + -- Softcaps at 100, should always do at least 1 + if(dmg > 100) then + dmg = 100; end if(dmg < 1) then dmg = 1; @@ -50,7 +50,7 @@ dia = target:getStatusEffect(EFFECT_DIA); -- Calculate DoT (rough, though fairly accurate) - dotdmg = 4 + math.floor(caster:getSkillLevel(DARK_MAGIC_SKILL) / 60); + dotdmg = math.floor((caster:getSkillLevel(DARK_MAGIC_SKILL) + 59) / 27); -- Do it! if(dia == nil or (BIO_OVERWRITE == 0 and dia:getPower() <= 3) or (BIO_OVERWRITE == 1 and dia:getPower() < 3)) then Index: scripts/globals/spells/bio_iv.lua =================================================================== --- scripts/globals/spells/bio_iv.lua (revision 0) +++ scripts/globals/spells/bio_iv.lua (working copy) @@ -0,0 +1,67 @@ +----------------------------------------- +-- Spell: Bio IV +-- Deals dark damage that weakens an enemy's attacks and gruadually reduces its HP. +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + --calculate raw damage + basedmg = caster:getSkillLevel(DARK_MAGIC_SKILL) / 3; + dmg = calculateMagicDamage(basedmg,3,caster,spell,target,DARK_MAGIC_SKILL,MOD_INT,false); + + -- Softcaps at 150, should always do at least 1 + if(dmg > 150) then + dmg = 150; + end + if(dmg < 1) then + dmg = 1; + end + + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),DARK_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments including the actual damage dealt + final = finalMagicAdjustments(caster,target,spell,dmg); + + -- Calculate duration. + duration = 120; + + -- Check for Dia. + dia = target:getStatusEffect(EFFECT_DIA); + + -- Calculate DoT (rough, though fairly accurate) + dotdmg = 5 + math.floor(caster:getSkillLevel(DARK_MAGIC_SKILL) / 60); + + -- Do it! + if(dia == nil or (BIO_OVERWRITE == 0 and dia:getPower() <= 4) or (BIO_OVERWRITE == 1 and dia:getPower() < 4)) then + target:delStatusEffect(EFFECT_BIO); -- delete old bio + target:addStatusEffect(EFFECT_BIO,dotdmg,3,duration,FLAG_ERASABLE); + end + + --Try to kill same tier Dia (default behavior) + if(DIA_OVERWRITE == 1 and dia ~= nil) then + if(dia:getPower() <= 4) then + target:delStatusEffect(EFFECT_DIA); + end + end + + return final; + +end; Index: scripts/globals/spells/bio_v.lua =================================================================== --- scripts/globals/spells/bio_v.lua (revision 0) +++ scripts/globals/spells/bio_v.lua (working copy) @@ -0,0 +1,67 @@ +----------------------------------------- +-- Spell: Bio V +-- Deals dark damage that weakens an enemy's attacks and gruadually reduces its HP. +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + --calculate raw damage + basedmg = caster:getSkillLevel(DARK_MAGIC_SKILL) / 2; + dmg = calculateMagicDamage(basedmg,3,caster,spell,target,DARK_MAGIC_SKILL,MOD_INT,false); + + -- Softcaps at 200, should always do at least 1 + if(dmg > 200) then + dmg = 200; + end + if(dmg < 1) then + dmg = 1; + end + + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),DARK_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments including the actual damage dealt + final = finalMagicAdjustments(caster,target,spell,dmg); + + -- Calculate duration. + duration = 150; + + -- Check for Dia. + dia = target:getStatusEffect(EFFECT_DIA); + + -- Calculate DoT (rough, though fairly accurate) + dotdmg = 6 + math.floor(caster:getSkillLevel(DARK_MAGIC_SKILL) / 60); + + -- Do it! + if(dia == nil or (BIO_OVERWRITE == 0 and dia:getPower() <= 5) or (BIO_OVERWRITE == 1 and dia:getPower() < 5)) then + target:delStatusEffect(EFFECT_BIO); -- delete old bio + target:addStatusEffect(EFFECT_BIO,dotdmg,3,duration,FLAG_ERASABLE); + end + + --Try to kill same tier Dia (default behavior) + if(DIA_OVERWRITE == 1 and dia ~= nil) then + if(dia:getPower() <= 5) then + target:delStatusEffect(EFFECT_DIA); + end + end + + return final; + +end; Index: scripts/globals/spells/blade_madrigal.lua =================================================================== --- scripts/globals/spells/blade_madrigal.lua (revision 3304) +++ scripts/globals/spells/blade_madrigal.lua (working copy) @@ -16,17 +16,65 @@ function onSpellCast(caster,target,spell) local acc = caster:getSkillLevel(SINGING_SKILL) / 16 + 1; - local sItem = caster:getEquipID(2); + local sItem = caster:getEquipID(SLOT_RANGED); + local head = caster:getEquipID(SLOT_HEAD); local duration = 120; - - if(sItem == 17348) then - acc = acc + 2; + + if(caster:getObjType() == TYPE_PC) then + local merit = caster:getMerit(MERIT_MADRIGAL_EFFECT); + if(merit > 0) then + acc = acc + merit; + end end - -- traversiere + 1 - if(sItem == 17375 or sItem == 17845) then - acc = acc + 4; - end + -- Equipment Mods + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + + if(sItem == 18342 or sItem == 18577 or sItem == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + acc = acc + 4; + elseif(sItem == 18579 or sItem == 18580) then -- Gjallarhorn Lvl 90 - 95 + acc = acc + 6; + elseif(sItem == 18840 or sItem == 18572) then -- Gjallarhorn Lvl 99 - 99-2 + acc = acc + 8; + elseif(sItem == 17348) then -- Traversiere + acc = acc + 2; + elseif(sItem == 17375 or sItem == 17845) then -- Traversiere +1 & +2 + acc = acc + 4; + elseif(sItem == 18833) then -- Cantabanks Horn + acc = acc + 6; + end + + if(head == 11073) then -- Adidos Calot +2 + acc = acc + 2; + end -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. Index: scripts/globals/spells/blaze_spikes.lua =================================================================== --- scripts/globals/spells/blaze_spikes.lua (revision 3304) +++ scripts/globals/spells/blaze_spikes.lua (working copy) @@ -8,20 +8,34 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local duration = SPIKE_EFFECT_DURATION; - local typeEffect = EFFECT_BLAZE_SPIKES; + local typeEffect = EFFECT_BLAZE_SPIKES; + local legs = caster:getEquipID(SLOT_LEGS); + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; end + + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); local int = caster:getStat(MOD_INT); local magicAtk = caster:getMod(MOD_MATT); local power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)); + + -- Equipment Bonus Amount + if (legs == 15622) then -- Mercenarys Trousers + power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)) + (int * (4/256)); + elseif (legs == 15121 or legs == 15584) then -- Duelist Tights & +1 + power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)) + (int * (6/256)); + elseif (legs == 10714) then -- Duelist Tights +2 + power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)) + (int * (8/256)); + end if(target:addStatusEffect(typeEffect,power,0,duration)) then spell:setMsg(230); Index: scripts/globals/spells/blind.lua =================================================================== --- scripts/globals/spells/blind.lua (revision 3304) +++ scripts/globals/spells/blind.lua (working copy) @@ -19,7 +19,7 @@ dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT)); bonus = AffinityBonus(caster,spell); - -- Base power. May need more research. + -- Base power. power = math.floor((dINT + 60) / 4); if(power < 5) then power = 5; @@ -31,6 +31,11 @@ -- Duration, including resistance. Unconfirmed. duration = 120 * applyResistance(caster,spell,target,dINT,35,bonus); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end + if(100 * math.random() >= target:getMod(MOD_BLINDRES)) then if(duration >= 90) then --Do it! Index: scripts/globals/spells/blind_ii.lua =================================================================== --- scripts/globals/spells/blind_ii.lua (revision 3304) +++ scripts/globals/spells/blind_ii.lua (working copy) @@ -35,6 +35,11 @@ -- Duration, including resistance. Unconfirmed. duration = 180 * applyResistance(caster,spell,target,dINT,35,bonus); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end + if(100 * math.random() >= target:getMod(MOD_BLINDRES)) then if(duration >= 90) then --Do it! Index: scripts/globals/spells/blindga.lua =================================================================== --- scripts/globals/spells/blindga.lua (revision 0) +++ scripts/globals/spells/blindga.lua (working copy) @@ -0,0 +1,55 @@ +----------------------------------------- +-- Spell: Blindga +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + -- Pull base stats. + dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT)); + bonus = AffinityBonus(caster,spell); + + -- Base power. + power = math.floor((dINT + 60) / 4); + if(power < 5) then + power = 5; + end + if(power > 20) then + power = 20; + end + + -- Duration, including resistance. Unconfirmed. + duration = 120 * applyResistance(caster,spell,target,dINT,35,bonus); + + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end + + if(100 * math.random() >= target:getMod(MOD_BLINDRES)) then + if(duration >= 90) then --Do it! + + if(target:addStatusEffect(EFFECT_BLINDNESS,power,0,duration)) then + spell:setMsg(236); + else + + spell:setMsg(75); + end + else + spell:setMsg(85); + end + else + spell:setMsg(284); + end + return EFFECT_BLINDNESS; +end; \ No newline at end of file Index: scripts/globals/spells/blink.lua =================================================================== --- scripts/globals/spells/blink.lua (revision 3304) +++ scripts/globals/spells/blink.lua (working copy) @@ -8,16 +8,19 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) duration = 300; if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + if(target:addStatusEffect(EFFECT_BLINK, BLINK_SHADOWS, 0, duration)) then spell:setMsg(230); else Index: scripts/globals/spells/blizzaga_ii.lua =================================================================== --- scripts/globals/spells/blizzaga_ii.lua (revision 3304) +++ scripts/globals/spells/blizzaga_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Blizzaga 2 +-- Spell: Blizzaga II -- Deals ice damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/blizzaga_iii.lua =================================================================== --- scripts/globals/spells/blizzaga_iii.lua (revision 3304) +++ scripts/globals/spells/blizzaga_iii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Blizzaga 3 +-- Spell: Blizzaga III -- Deals ice damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/blizzaga_iv.lua =================================================================== --- scripts/globals/spells/blizzaga_iv.lua (revision 0) +++ scripts/globals/spells/blizzaga_iv.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Blizzaga IV +-- Deals ice damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(934,2,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/blizzaga_v.lua =================================================================== --- scripts/globals/spells/blizzaga_v.lua (revision 0) +++ scripts/globals/spells/blizzaga_v.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Blizzaga V +-- Deals ice damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(1146,2.3,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/blizzard_ii.lua =================================================================== --- scripts/globals/spells/blizzard_ii.lua (revision 3304) +++ scripts/globals/spells/blizzard_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Blizzard +-- Spell: Blizzard II -- Deals ice damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/blizzard_iii.lua =================================================================== --- scripts/globals/spells/blizzard_iii.lua (revision 3304) +++ scripts/globals/spells/blizzard_iii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Blizzard +-- Spell: Blizzard III -- Deals ice damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/blizzard_iv.lua =================================================================== --- scripts/globals/spells/blizzard_iv.lua (revision 3304) +++ scripts/globals/spells/blizzard_iv.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Blizzard +-- Spell: Blizzard IV -- Deals ice damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/blizzard_v.lua =================================================================== --- scripts/globals/spells/blizzard_v.lua (revision 3304) +++ scripts/globals/spells/blizzard_v.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Blizzard +-- Spell: Blizzard V -- Deals ice damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/bluemagic/blank_gaze.lua =================================================================== --- scripts/globals/spells/bluemagic/blank_gaze.lua (revision 0) +++ scripts/globals/spells/bluemagic/blank_gaze.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- Spell: Blank Gaze +-- +----------------------------------------- +require("scripts/globals/magic"); +require("scripts/globals/status"); +require("scripts/globals/settings"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + -- Pull base stats. + dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT)); + + -- apply bonus, flash is hard to fully resist + bonus = AffinityBonus(caster,spell) + 300; + + local resist = applyResistance(caster,spell,target,dINT,BLUE_SKILL,bonus); + local effect = EFFECT_NONE; + + if(resist > 0.0625) then + if(target:hasStatusEffect(EFFECT_FLASH) == false) then + spell:setMsg(341); + effect = target:dispelStatusEffect(); + if(effect == EFFECT_NONE) then + -- no effect + spell:setMsg(75); + end + else + spell:setMsg(75); + end + else + spell:setMsg(85); + end + + return effect; +end; Index: scripts/globals/spells/bluemagic/geist_wall.lua =================================================================== --- scripts/globals/spells/bluemagic/geist_wall.lua (revision 0) +++ scripts/globals/spells/bluemagic/geist_wall.lua (working copy) @@ -0,0 +1,42 @@ +----------------------------------------- +-- Spell: Geist Wall +-- +----------------------------------------- +require("scripts/globals/magic"); +require("scripts/globals/status"); +require("scripts/globals/settings"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Pull base stats. + dINT = (caster:getStat(MOD_INT)*1.3 - target:getStat(MOD_INT)); + + -- apply bonus, flash is hard to fully resist + bonus = AffinityBonus(caster,spell); + + local resist = applyResistance(caster,spell,target,dINT,BLUE_SKILL,bonus); + local effect = EFFECT_NONE; + + if(resist > 0.0625) then + if(target:hasStatusEffect(EFFECT_FLASH) == false) then + spell:setMsg(341); + effect = target:dispelStatusEffect(); + if(effect == EFFECT_NONE) then + -- no effect + spell:setMsg(75); + end + else + spell:setMsg(75); + end + else + spell:setMsg(85); + end + + return effect; +end; \ No newline at end of file Index: scripts/globals/spells/boost-agi.lua =================================================================== --- scripts/globals/spells/boost-agi.lua (revision 0) +++ scripts/globals/spells/boost-agi.lua (working copy) @@ -0,0 +1,38 @@ +-------------------------------------- +-- Spell: Boost-AGI +-- Boosts targets AGI stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_AGI_DOWN) == true) then + target:delStatusEffect(EFFECT_AGI_DOWN); + else + target:addStatusEffect(EFFECT_AGI_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/boost-chr.lua =================================================================== --- scripts/globals/spells/boost-chr.lua (revision 0) +++ scripts/globals/spells/boost-chr.lua (working copy) @@ -0,0 +1,38 @@ +-------------------------------------- +-- Spell: Boost-CHR +-- Boosts targets CHR stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_CHR_DOWN) == true) then + target:delStatusEffect(EFFECT_CHR_DOWN); + else + target:addStatusEffect(EFFECT_CHR_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/boost-dex.lua =================================================================== --- scripts/globals/spells/boost-dex.lua (revision 0) +++ scripts/globals/spells/boost-dex.lua (working copy) @@ -0,0 +1,38 @@ +-------------------------------------- +-- Spell: Boost-DEX +-- Boosts targets DEX stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_DEX_DOWN) == true) then + target:delStatusEffect(EFFECT_DEX_DOWN); + else + target:addStatusEffect(EFFECT_DEX_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/boost-int.lua =================================================================== --- scripts/globals/spells/boost-int.lua (revision 0) +++ scripts/globals/spells/boost-int.lua (working copy) @@ -0,0 +1,38 @@ +-------------------------------------- +-- Spell: Boost-INT +-- Boosts targets INT stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_INT_DOWN) == true) then + target:delStatusEffect(EFFECT_INT_DOWN); + else + target:addStatusEffect(EFFECT_INT_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/boost-mnd.lua =================================================================== --- scripts/globals/spells/boost-mnd.lua (revision 0) +++ scripts/globals/spells/boost-mnd.lua (working copy) @@ -0,0 +1,38 @@ +-------------------------------------- +-- Spell: Boost-MND +-- Boosts targets MND stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_MND_DOWN) == true) then + target:delStatusEffect(EFFECT_MND_DOWN); + else + target:addStatusEffect(EFFECT_MND_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/boost-str.lua =================================================================== --- scripts/globals/spells/boost-str.lua (revision 0) +++ scripts/globals/spells/boost-str.lua (working copy) @@ -0,0 +1,38 @@ +-------------------------------------- +-- Spell: Boost-STR +-- Boosts targets STR stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_STR_DOWN) == true) then + target:delStatusEffect(EFFECT_STR_DOWN); + else + target:addStatusEffect(EFFECT_STR_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/boost-vit.lua =================================================================== --- scripts/globals/spells/boost-vit.lua (revision 0) +++ scripts/globals/spells/boost-vit.lua (working copy) @@ -0,0 +1,38 @@ +-------------------------------------- +-- Spell: Boost-VIT +-- Boosts targets VIT stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_VIT_DOWN) == true) then + target:delStatusEffect(EFFECT_VIT_DOWN); + else + target:addStatusEffect(EFFECT_VIT_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/break.lua =================================================================== --- scripts/globals/spells/break.lua (revision 0) +++ scripts/globals/spells/break.lua (working copy) @@ -0,0 +1,55 @@ +----------------------------------------- +-- Spell: Break +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + -- Pull base stats. + dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT)); + bonus = AffinityBonus(caster,spell); + + -- Base power. + power = math.floor((dINT + 60) / 4); + if(power < 5) then + power = 5; + end + if(power > 20) then + power = 20; + end + + -- Duration, including resistance. Unconfirmed. + duration = 60 * applyResistance(caster,spell,target,dINT,35,bonus); + + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end + + if(100 * math.random() >= target:getMod(MOD_PETRIFYRES)) then + if(duration >= 45) then --Do it! + + if(target:addStatusEffect(EFFECT_PETRIFICATION,power,0,duration)) then + spell:setMsg(236); + else + + spell:setMsg(75); + end + else + spell:setMsg(85); + end + else + spell:setMsg(284); + end + return EFFECT_PETRIFICATION; +end; \ No newline at end of file Index: scripts/globals/spells/breakga.lua =================================================================== --- scripts/globals/spells/breakga.lua (revision 0) +++ scripts/globals/spells/breakga.lua (working copy) @@ -0,0 +1,64 @@ +----------------------------------------- +-- Spell: Breakga +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local effect = EFFECT_PETRIFICATION; + local duration = 30; + + pINT = caster:getStat(MOD_INT); + mINT = target:getStat(MOD_INT); + + dINT = (pINT - mINT); + local power = caster:getSkillLevel(ENFEEBLING_MAGIC_SKILL) / 20 + 1; + if power > 20 then + power = 20; + end + + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end + + if(math.random(0,100) >= target:getMod(MOD_PETRIFYRES)) then + bonus = AffinityBonus(caster, spell); + resist = applyResistance(caster,spell,target,dINT,ENFEEBLING_MAGIC_SKILL,bonus); + if(resist == 1 or resist == 0.5) then -- effect taken + duration = duration / resist; + + -- Try to erase a weaker petrify. + petrify = target:getStatusEffect(effect) + if(petrify ~= nil) then + if(petrify:getPower() < power) then + -- remove weaker petrify + target:delStatusEffect(effect); + target:addStatusEffect(effect,power,0,duration); + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + target:addStatusEffect(effect,power,0,duration); + spell:setMsg(236); + end + + else -- resist entirely. + spell:setMsg(85); + end + else + spell:setMsg(284); + end + return effect; +end; \ No newline at end of file Index: scripts/globals/spells/cactuar_fugue.lua =================================================================== --- scripts/globals/spells/cactuar_fugue.lua (revision 0) +++ scripts/globals/spells/cactuar_fugue.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- Spell: Cactuar Fugue +-- Increases Gravity Resistance to +-- Party Members within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + + power = power + (caster:getMod(MOD_ALL_SONGS) * 4); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_FUGUE); + target:addStatusEffect(EFFECT_FUGUE,power,0,duration); + spell:setMsg(230); + return EFFECT_FUGUE; +end; \ No newline at end of file Index: scripts/globals/spells/carnage_elegy.lua =================================================================== --- scripts/globals/spells/carnage_elegy.lua (revision 3304) +++ scripts/globals/spells/carnage_elegy.lua (working copy) @@ -28,29 +28,13 @@ if(100 * math.random() < target:getMod(MOD_SLOWRES)) then spell:setMsg(85); -- resisted spell else - local sItem = caster:getEquipID(2); - -- horn +1 - if(sItem == 17371) then - power = power + 20; - duration = duration * 1.2; - end + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ELEGY) * 10)/100)); + + power = power + ((caster:getMod(MOD_ELEGY) + caster:getMod(MOD_ALL_SONGS)) * 5); - if(sItem == 17352) then - power = power + 11; - duration = duration * 1.1; - end - - if(sItem == 18342) then - power = power + 20; - duration = duration * 1.2; - end - - if(sItem == 17856) then - power = power + 30; - duration = duration * 1.3; - end - -- Try to overwrite weaker elegy if(target:addStatusEffect(EFFECT_ELEGY,power,0,duration)) then spell:setMsg(237); Index: scripts/globals/spells/chocobo_hum.lua =================================================================== --- scripts/globals/spells/chocobo_hum.lua (revision 0) +++ scripts/globals/spells/chocobo_hum.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- Spell: Chocobo Hum +-- Increases Paralyze Resistance to +-- Party Members within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + + power = power + (caster:getMod(MOD_ALL_SONGS) * 4); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_HUM); + target:addStatusEffect(EFFECT_HUM,power,0,duration); + spell:setMsg(230); + return EFFECT_HUM; +end; \ No newline at end of file Index: scripts/globals/spells/chocobo_mazurka.lua =================================================================== --- scripts/globals/spells/chocobo_mazurka.lua (revision 3304) +++ scripts/globals/spells/chocobo_mazurka.lua (working copy) @@ -14,10 +14,19 @@ end; function onSpellCast(caster,target,spell) - + local duration = 120; + local power = 24; + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_MAZURKA) * 10)/100)); + + power = power + ((target:getMod(MOD_MAZURKA) + target:getMod(MOD_ALL_SONGS)) * 4); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. - target:addStatusEffect(EFFECT_MAZURKA,25,0,120); + target:addStatusEffect(EFFECT_MAZURKA,power,0,duration); return EFFECT_MAZURKA; end; Index: scripts/globals/spells/curaga.lua =================================================================== --- scripts/globals/spells/curaga.lua (revision 3304) +++ scripts/globals/spells/curaga.lua (working copy) @@ -40,6 +40,22 @@ if(final > diff) then final = diff; end + + local legs = caster:getEquipID(SLOT_LEGS); + local recoverMP = 0; + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:addHP(final); target:wakeUp(); Index: scripts/globals/spells/curaga_ii.lua =================================================================== --- scripts/globals/spells/curaga_ii.lua (revision 3304) +++ scripts/globals/spells/curaga_ii.lua (working copy) @@ -40,6 +40,22 @@ if(final > diff) then final = diff; end + + local legs = caster:getEquipID(SLOT_LEGS); + local recoverMP = 0; + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:addHP(final); target:wakeUp(); Index: scripts/globals/spells/curaga_iii.lua =================================================================== --- scripts/globals/spells/curaga_iii.lua (revision 3304) +++ scripts/globals/spells/curaga_iii.lua (working copy) @@ -40,6 +40,22 @@ if(final > diff) then final = diff; end + + local legs = caster:getEquipID(SLOT_LEGS); + local recoverMP = 0; + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:addHP(final); target:wakeUp(); Index: scripts/globals/spells/curaga_iv.lua =================================================================== --- scripts/globals/spells/curaga_iv.lua (revision 3304) +++ scripts/globals/spells/curaga_iv.lua (working copy) @@ -40,6 +40,22 @@ if(final > diff) then final = diff; end + + local legs = caster:getEquipID(SLOT_LEGS); + local recoverMP = 0; + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:addHP(final); target:wakeUp(); Index: scripts/globals/spells/curaga_v.lua =================================================================== --- scripts/globals/spells/curaga_v.lua (revision 3304) +++ scripts/globals/spells/curaga_v.lua (working copy) @@ -37,6 +37,22 @@ if(final > diff) then final = diff; end + + local legs = caster:getEquipID(SLOT_LEGS); + local recoverMP = 0; + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:restoreHP(final); target:wakeUp(); Index: scripts/globals/spells/cure.lua =================================================================== --- scripts/globals/spells/cure.lua (revision 3304) +++ scripts/globals/spells/cure.lua (working copy) @@ -93,6 +93,22 @@ if(final > diff) then final = diff; end + + local legs = caster:getEquipID(SLOT_LEGS); + local recoverMP = 0; + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:addHP(final); target:wakeUp(); @@ -109,6 +125,20 @@ dmg = adjustForTarget(target,dmg); dmg = finalMagicAdjustments(caster,target,spell,dmg); final = dmg; + + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:delHP(final); target:updateEnmityFromDamage(caster,final); elseif(caster:getObjType() == TYPE_PC) then Index: scripts/globals/spells/cure_ii.lua =================================================================== --- scripts/globals/spells/cure_ii.lua (revision 3304) +++ scripts/globals/spells/cure_ii.lua (working copy) @@ -93,6 +93,22 @@ if(final > diff) then final = diff; end + + local legs = caster:getEquipID(SLOT_LEGS); + local recoverMP = 0; + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:addHP(final); target:wakeUp(); @@ -107,6 +123,20 @@ dmg = adjustForTarget(target,dmg); dmg = finalMagicAdjustments(caster,target,spell,dmg); final = dmg; + + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:delHP(final); target:updateEnmityFromDamage(caster,final); elseif(caster:getObjType() == TYPE_PC) then Index: scripts/globals/spells/cure_iii.lua =================================================================== --- scripts/globals/spells/cure_iii.lua (revision 3304) +++ scripts/globals/spells/cure_iii.lua (working copy) @@ -89,6 +89,22 @@ if(final > diff) then final = diff; end + + local legs = caster:getEquipID(SLOT_LEGS); + local recoverMP = 0; + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:addHP(final); target:wakeUp(); @@ -103,6 +119,20 @@ dmg = adjustForTarget(target,dmg); dmg = finalMagicAdjustments(caster,target,spell,dmg); final = dmg; + + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:delHP(final); target:updateEnmityFromDamage(caster,final); elseif(caster:getObjType() == TYPE_PC) then Index: scripts/globals/spells/cure_iv.lua =================================================================== --- scripts/globals/spells/cure_iv.lua (revision 3304) +++ scripts/globals/spells/cure_iv.lua (working copy) @@ -88,6 +88,22 @@ if(final > diff) then final = diff; end + + local legs = caster:getEquipID(SLOT_LEGS); + local recoverMP = 0; + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:addHP(final); target:wakeUp(); caster:updateEnmityFromCure(target,final); @@ -101,6 +117,20 @@ dmg = adjustForTarget(target,dmg); dmg = finalMagicAdjustments(caster,target,spell,dmg); final = dmg; + + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:delHP(final); target:updateEnmityFromDamage(caster,final); elseif(caster:getObjType() == TYPE_PC) then Index: scripts/globals/spells/cure_v.lua =================================================================== --- scripts/globals/spells/cure_v.lua (revision 3304) +++ scripts/globals/spells/cure_v.lua (working copy) @@ -97,6 +97,22 @@ if(final > diff) then final = diff; end + + local legs = caster:getEquipID(SLOT_LEGS); + local recoverMP = 0; + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:addHP(final); target:wakeUp(); @@ -111,6 +127,20 @@ dmg = adjustForTarget(target,dmg); dmg = finalMagicAdjustments(caster,target,spell,dmg); final = dmg; + + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:delHP(final); target:updateEnmityFromDamage(caster,final); elseif(caster:getObjType() == TYPE_PC) then Index: scripts/globals/spells/cure_vi.lua =================================================================== --- scripts/globals/spells/cure_vi.lua (revision 3304) +++ scripts/globals/spells/cure_vi.lua (working copy) @@ -76,6 +76,22 @@ if(final > diff) then final = diff; end + + local legs = caster:getEquipID(SLOT_LEGS); + local recoverMP = 0; + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:restoreHP(final); target:wakeUp(); @@ -90,6 +106,20 @@ dmg = adjustForTarget(target,dmg); dmg = finalMagicAdjustments(caster,target,spell,dmg); final = dmg; + + if(legs == 11226) then -- Orison's Pantaloon's +1 + recoverMP = final * .02; + caster:addMP(recoverMP); + end + if(legs == 11126) then -- Orison's Pantaloon's +2 + recoverMP = final * .05; + caster:addMP(recoverMP); + end + -- printf("Cure MP Recovered %u",recoverMP); + if(recoverMP > 0) then + caster:messageBasic(25,0,recoverMP); + end + target:delHP(final); target:updateEnmityFromDamage(caster,final); elseif(caster:getObjType() == TYPE_PC) then Index: scripts/globals/spells/curse.lua =================================================================== --- scripts/globals/spells/curse.lua (revision 0) +++ scripts/globals/spells/curse.lua (working copy) @@ -0,0 +1,69 @@ +----------------------------------------- +-- Spell: Curse +-- Spell accuracy is most highly affected by +-- Enfeebling Magic Skill, Magic Accuracy, and MND. +-- Effect -Max HP -Max MP -Move +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + -- Calculate duration. + local double duration = 120; + + -- Grabbing variables for paralyze potency + mLVL = caster:getMainLvl(); + pMND = caster:getStat(MOD_MND); + mMND = target:getStat(MOD_MND); + + dMND = (pMND - mMND); + multiplier = 150 / mLVL; + + -- Calculate potency. + potency = (multiplier * dMND) / 10; + + if potency > 25 then + potency = 25; + end + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + potency = potency * 1.1; + end + --printf("Duration : %u",duration); + --printf("Potency : %u",potency); + if(target:hasStatusEffect(EFFECT_CURSE_I)) then --effect already on, do nothing + spell:setMsg(75); + elseif(math.random(0,100) >= target:getMod(MOD_CURSERES)) then + bonus = AffinityBonus(caster, spell); + resist = applyResistance(caster,spell,target,dMND,35,bonus); + + if(resist >= 0.25) then + if(target:addStatusEffect(EFFECT_CURSE_I,potency,0,duration*resist)) then + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + -- resist + spell:setMsg(85); + end + + + else -- resist entirely. + + spell:setMsg(85); + end + + return EFFECT_CURSE_I; +end; Index: scripts/globals/spells/cursna.lua =================================================================== --- scripts/globals/spells/cursna.lua (revision 3304) +++ scripts/globals/spells/cursna.lua (working copy) @@ -9,16 +9,21 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) curse = target:getStatusEffect(EFFECT_CURSE_I); curse2 = target:getStatusEffect(EFFECT_CURSE_II); bane = target:getStatusEffect(EFFECT_BANE); - + local pEquipMods = 0.25; + + -- Equipment Bonuses + pEquipMods = pEquipMods + (caster:getMod(MOD_CURSNA_EFFECT)/100); + pEquipMods = pEquipMods + (target:getMod(MOD_CURSNA_RCVD)/100); + spell:setMsg(75); if(curse ~= nil and curse2 ~= nil and bane ~= nil) then target:delStatusEffect(EFFECT_CURSE_I); @@ -48,7 +53,7 @@ target:delStatusEffect(EFFECT_BANE); final = EFFECT_BANE; spell:setMsg(83); - elseif(target:hasStatusEffect(EFFECT_DOOM) and math.random() <= 0.25) then + elseif(target:hasStatusEffect(EFFECT_DOOM) and math.random() <= pEquipMods) then -- remove doom final = EFFECT_DOOM; target:delStatusEffect(EFFECT_DOOM); Index: scripts/globals/spells/dark_carol.lua =================================================================== --- scripts/globals/spells/dark_carol.lua (revision 0) +++ scripts/globals/spells/dark_carol.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Dark Carol +-- MOD_DARKRES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 40, 120, MOD_DARKRES); +end; Index: scripts/globals/spells/dark_carol_ii.lua =================================================================== --- scripts/globals/spells/dark_carol_ii.lua (revision 0) +++ scripts/globals/spells/dark_carol_ii.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Dark Carol II +-- MOD_DARKRES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 50, 120, MOD_DARKRES); +end; Index: scripts/globals/spells/death.lua =================================================================== --- scripts/globals/spells/death.lua (revision 0) +++ scripts/globals/spells/death.lua (working copy) @@ -0,0 +1,47 @@ +----------------------------------------- +-- Spell: Death +-- Grim reaper time. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + pMND = caster:getStat(MOD_MND); + mMND = target:getStat(MOD_MND); + dMND = (pMND - mMND); + + if(5 * math.random() >= target:getMod(MOD_DARKRES)) then + if(target:hasImmunity(1)) then + spell:setMsg(75); + else + bonus = AffinityBonus(caster, spell); + resist = applyResistance(caster,spell,target,dMND,35,bonus); + if(resist >= 0.125) then + if(target:addStatusEffect(EFFECT_DEATH,1,0,1)) then + spell:setMsg(237); + else + -- no effect + spell:setMsg(75); + end + else + -- resist + spell:setMsg(85); + end + end + else + -- resist + spell:setMsg(85); + end + + return EFFECT_DEATH; +end; \ No newline at end of file Index: scripts/globals/spells/deodorize.lua =================================================================== --- scripts/globals/spells/deodorize.lua (revision 3304) +++ scripts/globals/spells/deodorize.lua (working copy) @@ -27,6 +27,9 @@ duration = duration * target:getMainLvl() / 15; -- level adjustment end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + spell:setMsg(230); target:addStatusEffect(EFFECT_DEODORIZE,0,10,(math.floor(duration) * SNEAK_INVIS_DURATION_MULTIPLIER)); else Index: scripts/globals/spells/devotees_serenade.lua =================================================================== --- scripts/globals/spells/devotees_serenade.lua (revision 0) +++ scripts/globals/spells/devotees_serenade.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- Spell: Devotees Serenade +-- Increases Disease Resistance to +-- Party Members within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + + power = power + (caster:getMod(MOD_ALL_SONGS) * 4); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_SERENADE); + target:addStatusEffect(EFFECT_SERENADE,power,0,duration); + spell:setMsg(230); + return EFFECT_SERENADE; +end; \ No newline at end of file Index: scripts/globals/spells/dextrous_etude.lua =================================================================== --- scripts/globals/spells/dextrous_etude.lua (revision 0) +++ scripts/globals/spells/dextrous_etude.lua (working copy) @@ -0,0 +1,51 @@ +-------------------------------------- +-- Spell: Dextrous Etude +-- Boosts targets DEX stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + local duration = 120; + + if(enchanceSkill <180)then + power = 3 + elseif(enchanceSkill >=181 and enchanceSkill <=235)then + power = 4 + elseif(enchanceSkill >=236 and enchanceSkill <=288)then + power = 5 + elseif(enchanceSkill >=289 and enchanceSkill <=342)then + power = 6 + elseif(enchanceSkill >=343 and enchanceSkill <=396)then + power = 7 + elseif(enchanceSkill >=397 and enchanceSkill <=449)then + power = 8 + elseif(enchanceSkill >=450)then + power = 9 + else + power = 10 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_DEX_DOWN) == true) then + target:delStatusEffect(EFFECT_DEX_DOWN); + else + target:addStatusEffect(EFFECT_DEX_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/dia.lua =================================================================== --- scripts/globals/spells/dia.lua (revision 3304) +++ scripts/globals/spells/dia.lua (working copy) @@ -37,6 +37,11 @@ final = finalMagicAdjustments(caster,target,spell,dmg); duration = 60; + diaPowerMod = 0; + + if(caster:getEquipID(SLOT_MAIN) == 17466 or caster:getEquipID(SLOT_SUB) == 17466) then -- Dia Wand + diaPowerMod = 1; + end -- Check for Bio. bio = target:getStatusEffect(EFFECT_BIO); Index: scripts/globals/spells/dia_ii.lua =================================================================== --- scripts/globals/spells/dia_ii.lua (revision 3304) +++ scripts/globals/spells/dia_ii.lua (working copy) @@ -38,6 +38,11 @@ -- Calculate duration. duration = 120; + diaPowerMod = 0; + + if(caster:getEquipID(SLOT_MAIN) == 17466 or caster:getEquipID(SLOT_SUB) == 17466) then -- Dia Wand + diaPowerMod = 1; + end -- Check for Bio. bio = target:getStatusEffect(EFFECT_BIO); Index: scripts/globals/spells/dia_iii.lua =================================================================== --- scripts/globals/spells/dia_iii.lua (revision 3304) +++ scripts/globals/spells/dia_iii.lua (working copy) @@ -40,6 +40,11 @@ local merits = caster:getMerit(MERIT_DIA_III); duration = 30 * merits; + diaPowerMod = 0; + + if(caster:getEquipID(SLOT_MAIN) == 17466 or caster:getEquipID(SLOT_SUB) == 17466) then -- Dia Wand + diaPowerMod = 1; + end -- Check for Bio. bio = target:getStatusEffect(EFFECT_BIO); Index: scripts/globals/spells/dia_iv.lua =================================================================== --- scripts/globals/spells/dia_iv.lua (revision 0) +++ scripts/globals/spells/dia_iv.lua (working copy) @@ -0,0 +1,67 @@ +----------------------------------------- +-- Spell: Dia IV +-- Lowers an enemy's defense and gradually deals light elemental damage. +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + --calculate raw damage + basedmg = caster:getSkillLevel(ENFEEBLING_MAGIC_SKILL) / 4; + dmg = calculateMagicDamage(basedmg,5,caster,spell,target,ENFEEBLING_MAGIC_SKILL,MOD_INT,false); + + -- Softcaps at 128, should always do at least 1 + + dmg = utils.clamp(dmg, 1, 128); + + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ENFEEBLING_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments including the actual damage dealt + final = finalMagicAdjustments(caster,target,spell,dmg); + + -- Calculate duration. + duration = 90; + diaPowerMod = 0; + + if(caster:getEquipID(SLOT_MAIN) == 17466 or caster:getEquipID(SLOT_SUB) == 17466) then -- Dia Wand + diaPowerMod = 1; + end + + -- Check for Bio. + bio = target:getStatusEffect(EFFECT_BIO); + + -- Do it! + if(bio == nil or (DIA_OVERWRITE == 0 and bio:getPower() <= 4) or (DIA_OVERWRITE == 1 and bio:getPower() < 4)) then + target:addStatusEffect(EFFECT_DIA,4,3,duration); + spell:setMsg(2); + else + spell:setMsg(75); + end + + -- Try to kill same tier Bio + if(BIO_OVERWRITE == 1 and bio ~= nil) then + if(bio:getPower() <= 4) then + target:delStatusEffect(EFFECT_BIO); + end + end + + return final; + +end; Index: scripts/globals/spells/dia_v.lua =================================================================== --- scripts/globals/spells/dia_v.lua (revision 0) +++ scripts/globals/spells/dia_v.lua (working copy) @@ -0,0 +1,67 @@ +----------------------------------------- +-- Spell: Dia V +-- Lowers an enemy's defense and gradually deals light elemental damage. +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + --calculate raw damage + basedmg = caster:getSkillLevel(ENFEEBLING_MAGIC_SKILL); + dmg = calculateMagicDamage(basedmg,5,caster,spell,target,ENFEEBLING_MAGIC_SKILL,MOD_INT,false); + + -- Softcaps at 512, should always do at least 1 + + dmg = utils.clamp(dmg, 1, 512); + + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ENFEEBLING_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments including the actual damage dealt + final = finalMagicAdjustments(caster,target,spell,dmg); + + -- Calculate duration. + duration = 120; + diaPowerMod = 0; + + if(caster:getEquipID(SLOT_MAIN) == 17466 or caster:getEquipID(SLOT_SUB) == 17466) then -- Dia Wand + diaPowerMod = 1; + end + + -- Check for Bio. + bio = target:getStatusEffect(EFFECT_BIO); + + -- Do it! + if(bio == nil or (DIA_OVERWRITE == 0 and bio:getPower() <= 5) or (DIA_OVERWRITE == 1 and bio:getPower() < 5)) then + target:addStatusEffect(EFFECT_DIA,5,3,duration); + spell:setMsg(2); + else + spell:setMsg(75); + end + + -- Try to kill same tier Bio + if(BIO_OVERWRITE == 1 and bio ~= nil) then + if(bio:getPower() <= 5) then + target:delStatusEffect(EFFECT_BIO); + end + end + + return final; + +end; Index: scripts/globals/spells/diaga_iv.lua =================================================================== --- scripts/globals/spells/diaga_iv.lua (revision 0) +++ scripts/globals/spells/diaga_iv.lua (working copy) @@ -0,0 +1,60 @@ +----------------------------------------- +-- Spell: Diaga IV +-- Lowers an enemy's defense and gradually deals light elemental damage. +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + --calculate raw damage + basedmg = caster:getSkillLevel(ENFEEBLING_MAGIC_SKILL) / 3; + dmg = calculateMagicDamage(basedmg,5,caster,spell,target,ENFEEBLING_MAGIC_SKILL,MOD_INT,false); + + dmg = utils.clamp(dmg, 1, 120); + + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ENFEEBLING_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments including the actual damage dealt + final = finalMagicAdjustments(caster,target,spell,dmg); + + -- Calculate duration. + duration = 150; + + -- Check for Bio. + bio = target:getStatusEffect(EFFECT_BIO); + + -- Do it! + if(bio == nil or (DIA_OVERWRITE == 0 and bio:getPower() <= 4) or (DIA_OVERWRITE == 1 and bio:getPower() < 4)) then + target:addStatusEffect(EFFECT_DIA,4,3,duration,FLAG_ERASABLE); + spell:setMsg(2); + else + spell:setMsg(75); + end + + -- Try to kill same tier Bio + if(BIO_OVERWRITE == 1 and bio ~= nil) then + if(bio:getPower() <= 4) then + target:delStatusEffect(EFFECT_BIO); + end + end + + return final; + +end; \ No newline at end of file Index: scripts/globals/spells/diaga_v.lua =================================================================== --- scripts/globals/spells/diaga_v.lua (revision 0) +++ scripts/globals/spells/diaga_v.lua (working copy) @@ -0,0 +1,60 @@ +----------------------------------------- +-- Spell: Diaga V +-- Lowers an enemy's defense and gradually deals light elemental damage. +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + --calculate raw damage + basedmg = caster:getSkillLevel(ENFEEBLING_MAGIC_SKILL) / 2; + dmg = calculateMagicDamage(basedmg,5,caster,spell,target,ENFEEBLING_MAGIC_SKILL,MOD_INT,false); + + dmg = utils.clamp(dmg, 1, 240); + + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ENFEEBLING_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments including the actual damage dealt + final = finalMagicAdjustments(caster,target,spell,dmg); + + -- Calculate duration. + duration = 180; + + -- Check for Bio. + bio = target:getStatusEffect(EFFECT_BIO); + + -- Do it! + if(bio == nil or (DIA_OVERWRITE == 0 and bio:getPower() <= 5) or (DIA_OVERWRITE == 1 and bio:getPower() < 5)) then + target:addStatusEffect(EFFECT_DIA,5,3,duration,FLAG_ERASABLE); + spell:setMsg(2); + else + spell:setMsg(75); + end + + -- Try to kill same tier Bio + if(BIO_OVERWRITE == 1 and bio ~= nil) then + if(bio:getPower() <= 5) then + target:delStatusEffect(EFFECT_BIO); + end + end + + return final; + +end; \ No newline at end of file Index: scripts/globals/spells/dispel.lua =================================================================== --- scripts/globals/spells/dispel.lua (revision 3304) +++ scripts/globals/spells/dispel.lua (working copy) @@ -1,8 +1,9 @@ ----------------------------------------- -- Spell: Dispel --- ----------------------------------------- - +require("scripts/globals/magic"); +require("scripts/globals/status"); +require("scripts/globals/settings"); ----------------------------------------- -- OnSpellCast ----------------------------------------- @@ -19,6 +20,11 @@ -- apply bonus, flash is hard to fully resist bonus = AffinityBonus(caster,spell) + 300; + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + bonus = bonus * 1.1; + end + local resist = applyResistance(caster,spell,target,dINT,ENFEEBLING_MAGIC_SKILL,bonus); local effect = EFFECT_NONE; Index: scripts/globals/spells/dispelga.lua =================================================================== --- scripts/globals/spells/dispelga.lua (revision 3304) +++ scripts/globals/spells/dispelga.lua (working copy) @@ -2,7 +2,9 @@ -- Spell: Dispelga -- ----------------------------------------- - +require("scripts/globals/magic"); +require("scripts/globals/status"); +require("scripts/globals/settings"); ----------------------------------------- -- OnSpellCast ----------------------------------------- @@ -18,6 +20,11 @@ -- apply bonus, flash is hard to fully resist bonus = AffinityBonus(caster,spell); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + bonus = bonus * 1.1; + end + local resist = applyResistance(caster,spell,target,dINT,ENFEEBLING_MAGIC_SKILL,bonus); local effect = EFFECT_NONE; Index: scripts/globals/spells/dokumori_ichi.lua =================================================================== --- scripts/globals/spells/dokumori_ichi.lua (revision 3304) +++ scripts/globals/spells/dokumori_ichi.lua (working copy) @@ -31,7 +31,7 @@ if(math.random(0,100) >= target:getMod(MOD_POISONRES)) then if(duration >= 30) then if(target:addStatusEffect(effect,power,3,duration)) then - spell:setMsg(236); + spell:setMsg(237); else spell:setMsg(75); end Index: scripts/globals/spells/dokumori_ni.lua =================================================================== --- scripts/globals/spells/dokumori_ni.lua (revision 3304) +++ scripts/globals/spells/dokumori_ni.lua (working copy) @@ -31,7 +31,7 @@ if(math.random(0,100) >= target:getMod(MOD_POISONRES)) then if(duration >= 60) then if(target:addStatusEffect(effect,power,3,duration)) then - spell:setMsg(236); + spell:setMsg(237); else spell:setMsg(75); end Index: scripts/globals/spells/dokumori_san.lua =================================================================== --- scripts/globals/spells/dokumori_san.lua (revision 3304) +++ scripts/globals/spells/dokumori_san.lua (working copy) @@ -31,7 +31,7 @@ if(math.random(0,100) >= target:getMod(MOD_POISONRES)) then if(duration >= 120) then if(target:addStatusEffect(effect,power,3,duration)) then - spell:setMsg(236); + spell:setMsg(237); else spell:setMsg(75); end Index: scripts/globals/spells/doom.lua =================================================================== --- scripts/globals/spells/doom.lua (revision 3304) +++ scripts/globals/spells/doom.lua (working copy) @@ -17,8 +17,10 @@ function onSpellCast(caster,target,spell) local effect = EFFECT_DOOM; if(target:hasStatusEffect(effect) == false) then - spell:setMsg(237); -- gains effect - target:addStatusEffect(effect,10,3,30); + if(math.random(0,100) >= target:getMod(MOD_DOOMRES)) then + spell:setMsg(237); -- gains effect + target:addStatusEffect(effect,10,3,30); + end else spell:setMsg(75) -- no effect end Index: scripts/globals/spells/doton_ichi.lua =================================================================== --- scripts/globals/spells/doton_ichi.lua (revision 3304) +++ scripts/globals/spells/doton_ichi.lua (working copy) @@ -22,20 +22,27 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end - + -- boost ninjitsu damage + -- 5% ninjitsu damage + local head = caster:getEquipID(SLOT_HEAD); + if(head == 15084 or head == 15257) then + dmg = math.floor(dmg * 1.05); + end + if(head == 10662) then + dmg = math.floor(dmg * 1.10); + end dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_DOTON_EFFECT); + duration = 30 + caster:getMerit(MERIT_DOTON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_WINDRES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_WINDRES); return final; Index: scripts/globals/spells/doton_ni.lua =================================================================== --- scripts/globals/spells/doton_ni.lua (revision 3304) +++ scripts/globals/spells/doton_ni.lua (working copy) @@ -22,20 +22,27 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end - + -- boost ninjitsu damage + -- 5% ninjitsu damage + local head = caster:getEquipID(SLOT_HEAD); + if(head == 15084 or head == 15257) then + dmg = math.floor(dmg * 1.05); + end + if(head == 10662) then + dmg = math.floor(dmg * 1.10); + end dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_DOTON_EFFECT); + duration = 30 + caster:getMerit(MERIT_DOTON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_WINDRES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_WINDRES); return final; Index: scripts/globals/spells/doton_san.lua =================================================================== --- scripts/globals/spells/doton_san.lua (revision 3304) +++ scripts/globals/spells/doton_san.lua (working copy) @@ -22,20 +22,27 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end - + -- boost ninjitsu damage + -- 5% ninjitsu damage + local head = caster:getEquipID(SLOT_HEAD); + if(head == 15084 or head == 15257) then + dmg = math.floor(dmg * 1.05); + end + if(head == 10662) then + dmg = math.floor(dmg * 1.10); + end dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_DOTON_EFFECT); + duration = 30 + caster:getMerit(MERIT_DOTON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_WINDRES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_WINDRES); return final; Index: scripts/globals/spells/dragonfoe_mambo.lua =================================================================== --- scripts/globals/spells/dragonfoe_mambo.lua (revision 3304) +++ scripts/globals/spells/dragonfoe_mambo.lua (working copy) @@ -14,16 +14,43 @@ end; function onSpellCast(caster,target,spell) - - local sItem = caster:getEquipID(2); - local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing - - -- TODO: mambo bonus - + local duration = 120; + local sItem = caster:getEquipID(SLOT_RANGED); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. target:delStatusEffect(EFFECT_MAMBO); - target:addStatusEffect(EFFECT_MAMBO,2,0,120); + target:addStatusEffect(EFFECT_MAMBO,2,0,duration); spell:setMsg(230); return EFFECT_MAMBO; end; \ No newline at end of file Index: scripts/globals/spells/drain_ii.lua =================================================================== --- scripts/globals/spells/drain_ii.lua (revision 3304) +++ scripts/globals/spells/drain_ii.lua (working copy) @@ -16,6 +16,7 @@ end; function onSpellCast(caster,target,spell) + --calculate raw damage (unknown function -> only dark skill though) - using http://www.bluegartr.com/threads/44518-Drain-Calculations -- also have small constant to account for 0 dark skill dmg = 20 + (1.236 * (caster:getSkillLevel(DARK_MAGIC_SKILL)) + caster:getMod(79 + DARK_MAGIC_SKILL)); Index: scripts/globals/spells/earth_carol.lua =================================================================== --- scripts/globals/spells/earth_carol.lua (revision 0) +++ scripts/globals/spells/earth_carol.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Earth Carol +-- MOD_EARTHRES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 40, 120, MOD_EARTHRES); +end; Index: scripts/globals/spells/earth_carol_ii.lua =================================================================== --- scripts/globals/spells/earth_carol_ii.lua (revision 0) +++ scripts/globals/spells/earth_carol_ii.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Earth Carol II +-- MOD_EARTHRES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 50, 120, MOD_EARTHRES); +end; Index: scripts/globals/spells/embrava.lua =================================================================== --- scripts/globals/spells/embrava.lua (revision 0) +++ scripts/globals/spells/embrava.lua (working copy) @@ -0,0 +1,34 @@ +----------------------------------------- +-- Spell: Embrava +-- Adds Regen Regain and Haste AoE +-- Stacks with other Status +-- Duration: 300 secs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local mpCost = caster:getMaxMP() * .2 + caster:addMP(-mpCost); + embravaRegen = (ENHANCING_MAGIC_SKILL / 7) + 1 + embravaRegain = (ENHANCING_MAGIC_SKILL / 100) + 1 + embravaHaste = (ENHANCING_MAGIC_SKILL / 15) + 1 + if (target:hasStatusEffect(EFFECT_EMBRAVA) == false) then + local duration = 300; + spell:setMsg(230); + target:addStatusEffect(EFFECT_EMBRAVA,1,0,duration); + else + spell:setMsg(75); -- no effect. + end + + return EFFECT_EMBRAVA; +end; Index: scripts/globals/spells/enchanting_etude.lua =================================================================== --- scripts/globals/spells/enchanting_etude.lua (revision 0) +++ scripts/globals/spells/enchanting_etude.lua (working copy) @@ -0,0 +1,51 @@ +-------------------------------------- +-- Spell: Enchanting Etude +-- Boosts targets CHR stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + local duration = 120; + + if(enchanceSkill <180)then + power = 3 + elseif(enchanceSkill >=181 and enchanceSkill <=235)then + power = 4 + elseif(enchanceSkill >=236 and enchanceSkill <=288)then + power = 5 + elseif(enchanceSkill >=289 and enchanceSkill <=342)then + power = 6 + elseif(enchanceSkill >=343 and enchanceSkill <=396)then + power = 7 + elseif(enchanceSkill >=397 and enchanceSkill <=449)then + power = 8 + elseif(enchanceSkill >=450)then + power = 9 + else + power = 10 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_CHR_DOWN) == true) then + target:delStatusEffect(EFFECT_CHR_DOWN); + else + target:addStatusEffect(EFFECT_CHR_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/esuna.lua =================================================================== --- scripts/globals/spells/esuna.lua (revision 3304) +++ scripts/globals/spells/esuna.lua (working copy) @@ -38,6 +38,5 @@ end spell:setMsg(75); -- no effect - return 0; end; Index: scripts/globals/spells/firaga_ii.lua =================================================================== --- scripts/globals/spells/firaga_ii.lua (revision 3304) +++ scripts/globals/spells/firaga_ii.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- --- Spell: Firaga 2 --- Deals wind damage to an enemy. +-- Spell: Firaga II +-- Deals fire damage to an enemy. ----------------------------------------- require("scripts/globals/magic"); Index: scripts/globals/spells/firaga_iii.lua =================================================================== --- scripts/globals/spells/firaga_iii.lua (revision 3304) +++ scripts/globals/spells/firaga_iii.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- --- Spell: Firaga 3 --- Deals wind damage to an enemy. +-- Spell: Firaga III +-- Deals fire damage to an enemy. ----------------------------------------- require("scripts/globals/magic"); Index: scripts/globals/spells/firaga_iv.lua =================================================================== --- scripts/globals/spells/firaga_iv.lua (revision 0) +++ scripts/globals/spells/firaga_iv.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Firaga IV +-- Deals fire damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(886,2,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/firaga_v.lua =================================================================== --- scripts/globals/spells/firaga_v.lua (revision 0) +++ scripts/globals/spells/firaga_v.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Firaga V +-- Deals fire damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(1178,2.3,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/fire_carol.lua =================================================================== --- scripts/globals/spells/fire_carol.lua (revision 0) +++ scripts/globals/spells/fire_carol.lua (working copy) @@ -0,0 +1,18 @@ +----------------------------------------- +-- Spell: Fire Carol +-- MOD_FIRERES +----------------------------------------- +package.loaded["scripts/globals/magic"] = nil; +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 40, 120, MOD_FIRERES); +end; Index: scripts/globals/spells/fire_carol_ii.lua =================================================================== --- scripts/globals/spells/fire_carol_ii.lua (revision 0) +++ scripts/globals/spells/fire_carol_ii.lua (working copy) @@ -0,0 +1,18 @@ +----------------------------------------- +-- Spell: Fire Carol II +-- MOD_FIRERES +----------------------------------------- +package.loaded["scripts/globals/magic"] = nil; +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 50, 120, MOD_FIRERES); +end; Index: scripts/globals/spells/fire_ii.lua =================================================================== --- scripts/globals/spells/fire_ii.lua (revision 3304) +++ scripts/globals/spells/fire_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Fire +-- Spell: Fire II -- Deals fire damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/fire_iii.lua =================================================================== --- scripts/globals/spells/fire_iii.lua (revision 3304) +++ scripts/globals/spells/fire_iii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Fire +-- Spell: Fire III -- Deals fire damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/fire_iv.lua =================================================================== --- scripts/globals/spells/fire_iv.lua (revision 3304) +++ scripts/globals/spells/fire_iv.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Fire +-- Spell: Fire IV -- Deals fire damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/fire_v.lua =================================================================== --- scripts/globals/spells/fire_v.lua (revision 3304) +++ scripts/globals/spells/fire_v.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Fire +-- Spell: Fire V -- Deals fire damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/foe_lullaby.lua =================================================================== --- scripts/globals/spells/foe_lullaby.lua (revision 3304) +++ scripts/globals/spells/foe_lullaby.lua (working copy) @@ -29,17 +29,10 @@ else -- add equipment bonus - local sItem = caster:getEquipID(2); + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_LULLABY) * 10)/100)); - -- Mary's Horn - if(sItem == 17366) then - duration = duration * 1.1; - end - - if(sItem == 17841 or sItem == 17854) then - duration = duration * 1.2; - end - if(target:addStatusEffect(EFFECT_LULLABY,1,0,duration)) then spell:setMsg(237); else Index: scripts/globals/spells/foe_lullaby_ii.lua =================================================================== --- scripts/globals/spells/foe_lullaby_ii.lua (revision 3304) +++ scripts/globals/spells/foe_lullaby_ii.lua (working copy) @@ -29,17 +29,10 @@ else -- add equipment bonus - local sItem = caster:getEquipID(2); + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_LULLABY) * 10)/100)); - -- Mary's Horn - if(sItem == 17366) then - duration = duration * 1.1; - end - - if(sItem == 17841 or sItem == 17854) then - duration = duration * 1.2; - end - if(target:addStatusEffect(EFFECT_LULLABY,1,0,duration)) then spell:setMsg(237); else Index: scripts/globals/spells/foe_requiem.lua =================================================================== --- scripts/globals/spells/foe_requiem.lua (revision 3304) +++ scripts/globals/spells/foe_requiem.lua (working copy) @@ -25,42 +25,12 @@ spell:setMsg(85);--resist message return 1; end - - local sItem = caster:getEquipID(2); - - -- flute +1 - if(sItem == 17372) then - power = power + 1; - end - - if(sItem == 17844) then - power = power + 1; - end - - if(sItem == 17346) then - power = power + 2; - end - - if(sItem == 17379) then - power = power + 2; - end - - if(sItem == 17362) then - power = power + 2; - end - - if(sItem == 17832) then - power = power + 3; - end - - if(sItem == 17852) then - power = power + 4; - end - - if(sItem == 18342) then - power = power + 2; - end - + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_REQUIEM) * 10)/100)); + + power = power + caster:getMod(MOD_REQUIEM) + caster:getMod(MOD_ALL_SONGS); + -- Try to overwrite weaker slow / haste if(canOverwrite(target, effect, power)) then -- overwrite them Index: scripts/globals/spells/foe_requiem_ii.lua =================================================================== --- scripts/globals/spells/foe_requiem_ii.lua (revision 3304) +++ scripts/globals/spells/foe_requiem_ii.lua (working copy) @@ -25,42 +25,13 @@ spell:setMsg(85);--resist message return 1; end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_REQUIEM) * 10)/100)); + + power = power + caster:getMod(MOD_REQUIEM) + caster:getMod(MOD_ALL_SONGS); - local sItem = caster:getEquipID(2); - - -- flute +1 - if(sItem == 17372) then - power = power + 1; - end - - if(sItem == 17844) then - power = power + 1; - end - - if(sItem == 17346) then - power = power + 2; - end - - if(sItem == 17379) then - power = power + 2; - end - - if(sItem == 17362) then - power = power + 2; - end - - if(sItem == 17832) then - power = power + 3; - end - - if(sItem == 17852) then - power = power + 4; - end - - if(sItem == 18342) then - power = power + 2; - end - -- Try to overwrite weaker slow / haste if(canOverwrite(target, effect, power)) then -- overwrite them Index: scripts/globals/spells/foe_requiem_iii.lua =================================================================== --- scripts/globals/spells/foe_requiem_iii.lua (revision 3304) +++ scripts/globals/spells/foe_requiem_iii.lua (working copy) @@ -25,42 +25,12 @@ spell:setMsg(85);--resist message return 1; end + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_REQUIEM) * 10)/100)); + + power = power + caster:getMod(MOD_REQUIEM) + caster:getMod(MOD_ALL_SONGS); - local sItem = caster:getEquipID(2); - - -- flute +1 - if(sItem == 17372) then - power = power + 1; - end - - if(sItem == 17844) then - power = power + 1; - end - - if(sItem == 17346) then - power = power + 2; - end - - if(sItem == 17379) then - power = power + 2; - end - - if(sItem == 17362) then - power = power + 2; - end - - if(sItem == 17832) then - power = power + 3; - end - - if(sItem == 17852) then - power = power + 4; - end - - if(sItem == 18342) then - power = power + 2; - end - -- Try to overwrite weaker slow / haste if(canOverwrite(target, effect, power)) then -- overwrite them Index: scripts/globals/spells/foe_requiem_iv.lua =================================================================== --- scripts/globals/spells/foe_requiem_iv.lua (revision 3304) +++ scripts/globals/spells/foe_requiem_iv.lua (working copy) @@ -25,42 +25,12 @@ spell:setMsg(85);--resist message return 1; end + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_REQUIEM) * 10)/100)); + + power = power + caster:getMod(MOD_REQUIEM) + caster:getMod(MOD_ALL_SONGS); - local sItem = caster:getEquipID(2); - - -- flute +1 - if(sItem == 17372) then - power = power + 1; - end - - if(sItem == 17844) then - power = power + 1; - end - - if(sItem == 17346) then - power = power + 2; - end - - if(sItem == 17379) then - power = power + 2; - end - - if(sItem == 17362) then - power = power + 2; - end - - if(sItem == 17832) then - power = power + 3; - end - - if(sItem == 17852) then - power = power + 4; - end - - if(sItem == 18342) then - power = power + 2; - end - -- Try to overwrite weaker slow / haste if(canOverwrite(target, effect, power)) then -- overwrite them Index: scripts/globals/spells/foe_requiem_v.lua =================================================================== --- scripts/globals/spells/foe_requiem_v.lua (revision 3304) +++ scripts/globals/spells/foe_requiem_v.lua (working copy) @@ -25,42 +25,12 @@ spell:setMsg(85);--resist message return 1; end + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_REQUIEM) * 10)/100)); + + power = power + caster:getMod(MOD_REQUIEM) + caster:getMod(MOD_ALL_SONGS); - local sItem = caster:getEquipID(2); - - -- flute +1 - if(sItem == 17372) then - power = power + 1; - end - - if(sItem == 17844) then - power = power + 1; - end - - if(sItem == 17346) then - power = power + 2; - end - - if(sItem == 17379) then - power = power + 2; - end - - if(sItem == 17362) then - power = power + 2; - end - - if(sItem == 17832) then - power = power + 3; - end - - if(sItem == 17852) then - power = power + 4; - end - - if(sItem == 18342) then - power = power + 2; - end - -- Try to overwrite weaker slow / haste if(canOverwrite(target, effect, power)) then -- overwrite them Index: scripts/globals/spells/foe_requiem_vi.lua =================================================================== --- scripts/globals/spells/foe_requiem_vi.lua (revision 3304) +++ scripts/globals/spells/foe_requiem_vi.lua (working copy) @@ -30,42 +30,12 @@ if(caster:getMainLvl() >= 75) then power = power + 1; end - - local sItem = caster:getEquipID(2); - - -- flute +1 - if(sItem == 17372) then - power = power + 1; - end - - if(sItem == 17844) then - power = power + 1; - end - - if(sItem == 17346) then - power = power + 2; - end - - if(sItem == 17379) then - power = power + 2; - end - - if(sItem == 17362) then - power = power + 2; - end - - if(sItem == 17832) then - power = power + 3; - end - - if(sItem == 17852) then - power = power + 4; - end - - if(sItem == 18342) then - power = power + 2; - end - + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_REQUIEM) * 10)/100)); + + power = power + caster:getMod(MOD_REQUIEM) + caster:getMod(MOD_ALL_SONGS); + -- Try to overwrite weaker slow / haste if(canOverwrite(target, effect, power)) then -- overwrite them Index: scripts/globals/spells/foe_requiem_vii.lua =================================================================== --- scripts/globals/spells/foe_requiem_vii.lua (revision 3304) +++ scripts/globals/spells/foe_requiem_vii.lua (working copy) @@ -14,7 +14,7 @@ function onSpellCast(caster,target,spell) local effect = EFFECT_REQUIEM; local duration = 160; - local power = 8; + local power = 7; bonus = AffinityBonus(caster, spell); pCHR = caster:getStat(MOD_CHR); @@ -25,42 +25,12 @@ spell:setMsg(85);--resist message return 1; end + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_REQUIEM) * 10)/100)); + + power = power + caster:getMod(MOD_REQUIEM) + caster:getMod(MOD_ALL_SONGS); - local sItem = caster:getEquipID(2); - - -- flute +1 - if(sItem == 17372) then - power = power + 1; - end - - if(sItem == 17844) then - power = power + 1; - end - - if(sItem == 17346) then - power = power + 2; - end - - if(sItem == 17379) then - power = power + 2; - end - - if(sItem == 17362) then - power = power + 2; - end - - if(sItem == 17832) then - power = power + 3; - end - - if(sItem == 17852) then - power = power + 4; - end - - if(sItem == 18342) then - power = power + 2; - end - -- Try to overwrite weaker slow / haste if(canOverwrite(target, effect, power)) then -- overwrite them Index: scripts/globals/spells/foe_requiem_viii.lua =================================================================== --- scripts/globals/spells/foe_requiem_viii.lua (revision 0) +++ scripts/globals/spells/foe_requiem_viii.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------------- +-- Spell: Foe Requiem VIII +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local effect = EFFECT_REQUIEM; + local duration = 160; + local power = 8; + + bonus = AffinityBonus(caster, spell); + pCHR = caster:getStat(MOD_CHR); + mCHR = target:getStat(MOD_CHR); + dCHR = (pCHR - mCHR); + resm = applyResistance(caster,spell,target,dCHR,SINGING_SKILL,bonus); + if(resm < 0.5) then + spell:setMsg(85);--resist message + return 1; + end + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_REQUIEM) * 10)/100)); + + power = power + caster:getMod(MOD_REQUIEM) + caster:getMod(MOD_ALL_SONGS); + + -- Try to overwrite weaker slow / haste + if(canOverwrite(target, effect, power)) then + -- overwrite them + target:delStatusEffect(effect); + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(237); + else + spell:setMsg(75); -- no effect + end + + return effect; +end; \ No newline at end of file Index: scripts/globals/spells/foe_sirvente.lua =================================================================== --- scripts/globals/spells/foe_sirvente.lua (revision 0) +++ scripts/globals/spells/foe_sirvente.lua (working copy) @@ -0,0 +1,36 @@ +----------------------------------------- +-- Spell: Foe Sirvente +-- Grants enmity minus to a party member. +-- I'm sure it's not correct but a stop gap until it's implemented. +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local duration = 120; + local power = 30; + if(caster:getObjType() == TYPE_PC) then + local merit =((target:getMerit(MERIT_FOE_SIRVENTE) * .01) - .05); + power = power + (power * merit); + end + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + + power = power + (caster:getMod(MOD_ALL_SONGS) * 2); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_SIRVENTE); + target:addStatusEffect(EFFECT_SIRVENTE,power,3,duration); + spell:setMsg(230); + return EFFECT_SIRVENTE; +end; \ No newline at end of file Index: scripts/globals/spells/fowl_aubade.lua =================================================================== --- scripts/globals/spells/fowl_aubade.lua (revision 0) +++ scripts/globals/spells/fowl_aubade.lua (working copy) @@ -0,0 +1,72 @@ +----------------------------------------- +-- Spell: Fowl Aubade +-- Increases Sleep Resistance to +-- Party Members within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + local sItem = caster:getEquipID(SLOT_RANGED); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + if(sItem == 18342 or sItem == 18577 or sItem == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + power = power + 4; + elseif(sItem == 18579 or sItem == 18580) then -- Gjallarhorn Lvl 90 - 95 + power = power + 6; + elseif(sItem == 18840 or sItem == 18572) then -- Gjallarhorn Lvl 99 - 99-2 + power = power + 8; + end + if (sItem == 18575) then -- Daurdabla Lvl 90 + duration = duration * 1.25; + elseif (sItem == 18576 or sItem == 18839 or sItem == 18571) then -- Daurdabla Lvl 95 - 99 - 99-2 + duration = duration * 1.3; + end + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_AUBADE); + target:addStatusEffect(EFFECT_AUBADE,power,0,duration); + spell:setMsg(230); + return EFFECT_AUBADE; +end; \ No newline at end of file Index: scripts/globals/spells/gain-agi.lua =================================================================== --- scripts/globals/spells/gain-agi.lua (revision 0) +++ scripts/globals/spells/gain-agi.lua (working copy) @@ -0,0 +1,79 @@ +-------------------------------------- +-- Spell: Gain-AGI +-- Boosts targets AGI stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5; + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6; + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7; + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8; + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9; + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10; + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11; + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12; + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13; + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14; + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15; + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16; + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17; + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18; + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19; + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20; + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21; + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22; + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23; + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24; + else + power = 25; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if(target:hasStatusEffect(EFFECT_AGI_DOWN) == true) then + target:delStatusEffect(EFFECT_AGI_DOWN); + else + target:addStatusEffect(EFFECT_AGI_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/gain-chr.lua =================================================================== --- scripts/globals/spells/gain-chr.lua (revision 0) +++ scripts/globals/spells/gain-chr.lua (working copy) @@ -0,0 +1,79 @@ +-------------------------------------- +-- Spell: Gain-CHR +-- Boosts targets CHR stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5; + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6; + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7; + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8; + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9; + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10; + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11; + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12; + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13; + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14; + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15; + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16; + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17; + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18; + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19; + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20; + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21; + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22; + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23; + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24; + else + power = 25; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if(target:hasStatusEffect(EFFECT_CHR_DOWN) == true) then + target:delStatusEffect(EFFECT_CHR_DOWN); + else + target:addStatusEffect(EFFECT_CHR_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/gain-dex.lua =================================================================== --- scripts/globals/spells/gain-dex.lua (revision 0) +++ scripts/globals/spells/gain-dex.lua (working copy) @@ -0,0 +1,80 @@ +-------------------------------------- +-- Spell: Gain-DEX +-- Boosts targets DEX stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5; + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6; + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7; + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8; + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9; + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10; + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11; + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12; + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13; + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14; + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15; + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16; + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17; + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18; + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19; + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20; + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21; + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22; + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23; + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24; + else + power = 25; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if(target:hasStatusEffect(EFFECT_DEX_DOWN) == true) then + target:delStatusEffect(EFFECT_DEX_DOWN); + else + target:addStatusEffect(EFFECT_DEX_BOOST,power,0,duration); + spell:setMsg(230); + end +end; Index: scripts/globals/spells/gain-int.lua =================================================================== --- scripts/globals/spells/gain-int.lua (revision 0) +++ scripts/globals/spells/gain-int.lua (working copy) @@ -0,0 +1,79 @@ +-------------------------------------- +-- Spell: Gain-INT +-- Boosts targets INT stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5 + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6 + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7 + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8 + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9 + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10 + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11 + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12 + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13 + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14 + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15 + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16 + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17 + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18 + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19 + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20 + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21 + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22 + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23 + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24 + else + power = 25 + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if(target:hasStatusEffect(EFFECT_INT_DOWN) == true) then + target:delStatusEffect(EFFECT_INT_DOWN); + else + target:addStatusEffect(EFFECT_INT_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/gain-mnd.lua =================================================================== --- scripts/globals/spells/gain-mnd.lua (revision 0) +++ scripts/globals/spells/gain-mnd.lua (working copy) @@ -0,0 +1,79 @@ +-------------------------------------- +-- Spell: Gain-MND +-- Boosts targets MND stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5 + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6 + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7 + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8 + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9 + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10 + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11 + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12 + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13 + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14 + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15 + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16 + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17 + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18 + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19 + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20 + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21 + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22 + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23 + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24 + else + power = 25 + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if(target:hasStatusEffect(EFFECT_MND_DOWN) == true) then + target:delStatusEffect(EFFECT_MND_DOWN); + else + target:addStatusEffect(EFFECT_MND_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/gain-str.lua =================================================================== --- scripts/globals/spells/gain-str.lua (revision 0) +++ scripts/globals/spells/gain-str.lua (working copy) @@ -0,0 +1,79 @@ +-------------------------------------- +-- Spell: Gain-STR +-- Boosts targets STR stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5 + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6 + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7 + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8 + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9 + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10 + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11 + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12 + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13 + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14 + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15 + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16 + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17 + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18 + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19 + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20 + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21 + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22 + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23 + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24 + else + power = 25 + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if(target:hasStatusEffect(EFFECT_STR_DOWN) == true) then + target:delStatusEffect(EFFECT_STR_DOWN); + else + target:addStatusEffect(EFFECT_STR_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/gain-vit.lua =================================================================== --- scripts/globals/spells/gain-vit.lua (revision 0) +++ scripts/globals/spells/gain-vit.lua (working copy) @@ -0,0 +1,79 @@ +-------------------------------------- +-- Spell: Gain-VIT +-- Boosts targets VIT stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5 + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6 + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7 + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8 + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9 + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10 + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11 + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12 + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13 + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14 + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15 + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16 + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17 + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18 + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19 + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20 + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21 + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22 + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23 + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24 + else + power = 25 + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if(target:hasStatusEffect(EFFECT_VIT_DOWN) == true) then + target:delStatusEffect(EFFECT_VIT_DOWN); + else + target:addStatusEffect(EFFECT_VIT_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/goblin_gavotte.lua =================================================================== --- scripts/globals/spells/goblin_gavotte.lua (revision 0) +++ scripts/globals/spells/goblin_gavotte.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- Spell: Goblin Gavotte +-- Increases Bind Resistance to +-- Party Members within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + + power = power + (caster:getMod(MOD_ALL_SONGS) * 4); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_GAVOTTE); + target:addStatusEffect(EFFECT_GAVOTTE,power,0,duration); + spell:setMsg(230); + return EFFECT_GAVOTTE; +end; \ No newline at end of file Index: scripts/globals/spells/goddesss_hymnus.lua =================================================================== --- scripts/globals/spells/goddesss_hymnus.lua (revision 0) +++ scripts/globals/spells/goddesss_hymnus.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- Spell: Goddess's Hymnus +-- Grants Reraise to Party Members +-- within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local duration = 120; + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_HYMNUS) * 10)/100)); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_HYMNUS); + target:addStatusEffect(EFFECT_HYMNUS,3,0,duration); + spell:setMsg(230); + return EFFECT_HYMNUS; +end; \ No newline at end of file Index: scripts/globals/spells/gold_capriccio.lua =================================================================== --- scripts/globals/spells/gold_capriccio.lua (revision 0) +++ scripts/globals/spells/gold_capriccio.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- Spell: Gold Capriccio +-- Increases Petrification Resistance to +-- Party Members within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + + power = power + (caster:getMod(MOD_ALL_SONGS) * 4); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_CAPRICCIO); + target:addStatusEffect(EFFECT_CAPRICCIO,power,0,duration); + spell:setMsg(230); + return EFFECT_CAPRICCIO; +end; \ No newline at end of file Index: scripts/globals/spells/graviga.lua =================================================================== --- scripts/globals/spells/graviga.lua (revision 0) +++ scripts/globals/spells/graviga.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- Spell: Graviga +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + -- Pull base stats. + dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT)); + bonus = AffinityBonus(caster,spell); + power = 20; -- 20% reduction + + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end + + -- Duration, including resistance. Unconfirmed. + duration = 120 * applyResistance(caster,spell,target,dINT,35,bonus); + + if(100 * math.random() >= target:getMod(MOD_GRAVITYRES)) then + if(duration >= 30) then --Do it! + target:delStatusEffect(EFFECT_WEIGHT); + target:addStatusEffect(EFFECT_WEIGHT,power,0,duration); + spell:setMsg(236); + else +-- if(spell:isAOE() == false) then +-- spell:setMsg(85); +-- else + spell:setMsg(284); +-- end + end + else +-- if(spell:isAOE() == false) then +-- spell:setMsg(85); +-- else + spell:setMsg(284); +-- end + end + return EFFECT_WEIGHT; +end; \ No newline at end of file Index: scripts/globals/spells/gravity.lua =================================================================== --- scripts/globals/spells/gravity.lua (revision 3304) +++ scripts/globals/spells/gravity.lua (working copy) @@ -18,7 +18,12 @@ -- Pull base stats. dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT)); bonus = AffinityBonus(caster,spell); - power = 50; -- 50% reduction + power = 20; -- 20% reduction + + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end -- Duration, including resistance. Unconfirmed. duration = 120 * applyResistance(caster,spell,target,dINT,35,bonus); Index: scripts/globals/spells/gravity_ii.lua =================================================================== --- scripts/globals/spells/gravity_ii.lua (revision 0) +++ scripts/globals/spells/gravity_ii.lua (working copy) @@ -0,0 +1,51 @@ +----------------------------------------- +-- Spell: Gravity II +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + -- Pull base stats. + dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT)); + bonus = AffinityBonus(caster,spell); + power = 40; -- 40% reduction + + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end + + -- Duration, including resistance. Unconfirmed. + duration = 120 * applyResistance(caster,spell,target,dINT,35,bonus); + + if(100 * math.random() >= target:getMod(MOD_GRAVITYRES)) then + if(duration >= 30) then --Do it! + target:delStatusEffect(EFFECT_WEIGHT); + target:addStatusEffect(EFFECT_WEIGHT,power,0,duration); + spell:setMsg(236); + else +-- if(spell:isAOE() == false) then +-- spell:setMsg(85); +-- else + spell:setMsg(284); +-- end + end + else +-- if(spell:isAOE() == false) then +-- spell:setMsg(85); +-- else + spell:setMsg(284); +-- end + end + return EFFECT_WEIGHT; +end; \ No newline at end of file Index: scripts/globals/spells/haste.lua =================================================================== --- scripts/globals/spells/haste.lua (revision 3304) +++ scripts/globals/spells/haste.lua (working copy) @@ -9,10 +9,10 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) duration = 180; @@ -21,6 +21,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + power = 150; if(target:addStatusEffect(EFFECT_HASTE,power,0,duration) == false) then Index: scripts/globals/spells/hastega.lua =================================================================== --- scripts/globals/spells/hastega.lua (revision 0) +++ scripts/globals/spells/hastega.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- Spell: Hastega +-- Composure increases duration 3x +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + duration = 180; + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if (caster:getEquipID(SLOT_FEET) == 11148) then -- Estoqueurs Houseaux +2 + duration = duration * 1.2; + elseif(caster:getEquipID(SLOT_FEET) == 11248) then -- Estoqueurs Houseaux +1 + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_BACK) == 16204) then -- Estoqueurs Cape + duration = duration * 1.1; + end + + power = 150; + + if(target:addStatusEffect(EFFECT_HASTE,power,0,duration) == false) then + spell:setMsg(75); + end + + return EFFECT_HASTE; +end; + + + Index: scripts/globals/spells/herb_pastoral.lua =================================================================== --- scripts/globals/spells/herb_pastoral.lua (revision 0) +++ scripts/globals/spells/herb_pastoral.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- Spell: Herb Pastoral +-- Increases Poison Resistance to +-- Party Members within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + + power = power + (caster:getMod(MOD_ALL_SONGS) * 4); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_PASTORAL); + target:addStatusEffect(EFFECT_PASTORAL,power,0,duration); + spell:setMsg(230); + return EFFECT_PASTORAL; +end; \ No newline at end of file Index: scripts/globals/spells/herculean_etude.lua =================================================================== --- scripts/globals/spells/herculean_etude.lua (revision 0) +++ scripts/globals/spells/herculean_etude.lua (working copy) @@ -0,0 +1,45 @@ +-------------------------------------- +-- Spell: Herculean Etude +-- Boosts targets STR stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + duration = 120; + + if(enchanceSkill <416)then + power = 12 + elseif(enchanceSkill >=417 and enchanceSkill <=445)then + power = 13 + elseif(enchanceSkill >=446 and enchanceSkill <=474)then + power = 14 + elseif(enchanceSkill >=475)then + power = 15 + else + power = 15 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_STR_DOWN) == true) then + target:delStatusEffect(EFFECT_STR_DOWN); + else + target:addStatusEffect(EFFECT_STR_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/hojo_ichi.lua =================================================================== --- scripts/globals/spells/hojo_ichi.lua (revision 3304) +++ scripts/globals/spells/hojo_ichi.lua (working copy) @@ -27,13 +27,29 @@ if(math.random(0,100) >= target:getMod(MOD_SLOWRES)) then -- Spell succeeds if a 1 or 1/2 resist check is achieved if(duration >= 150) then - - if(target:addStatusEffect(EFFECT_SLOW,power,0,duration)) then - spell:setMsg(236); + --Looks for another Slow or Haste effect and replaces it if stronger + slow = target:getStatusEffect(EFFECT_SLOW); + haste = target:getStatusEffect(EFFECT_HASTE); + if(slow ~= nil) then + if(slow:getPower() > power) then + target:delStatusEffect(EFFECT_SLOW); + target:addStatusEffect(EFFECT_SLOW,power,0,duration); + spell:setMsg(237); + else + spell:setMsg(75); + end + elseif(haste ~= nil) then + if(haste:getPower() < (-1 * power)) then + target:delStatusEffect(EFFECT_HASTE); + target:addStatusEffect(EFFECT_SLOW,power,0,duration); + spell:setMsg(237); + else + spell:setMsg(75); + end else - spell:setMsg(75); + target:addStatusEffect(EFFECT_SLOW,power,0,duration); + spell:setMsg(237); end - else spell:setMsg(85); end Index: scripts/globals/spells/hojo_ni.lua =================================================================== --- scripts/globals/spells/hojo_ni.lua (revision 3304) +++ scripts/globals/spells/hojo_ni.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- -- Spell: Hojo:Ni --- Description: Inflicts Slow on target. +-- Description: Inflicts Slow on target. -- Edited from slow.lua ----------------------------------------- @@ -16,7 +16,7 @@ end; function onSpellCast(caster,target,spell) - + dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT)); bonus = AffinityBonus(caster,spell); --Power for Hojo is a flat 19.5% reduction @@ -27,11 +27,28 @@ if(math.random(0,100) >= target:getMod(MOD_SLOWRES)) then -- Spell succeeds if a 1 or 1/2 resist check is achieved if(duration >= 150) then - - if(target:addStatusEffect(EFFECT_SLOW,power,0,duration)) then - spell:setMsg(236); + --Looks for another Slow or Haste effect and replaces it if stronger + slow = target:getStatusEffect(EFFECT_SLOW); + haste = target:getStatusEffect(EFFECT_HASTE); + if(slow ~= nil) then + if(slow:getPower() > power) then + target:delStatusEffect(EFFECT_SLOW); + target:addStatusEffect(EFFECT_SLOW,power,0,duration); + spell:setMsg(237); + else + spell:setMsg(75); + end + elseif(haste ~= nil) then + if(haste:getPower() < (-1 * power)) then + target:delStatusEffect(EFFECT_HASTE); + target:addStatusEffect(EFFECT_SLOW,power,0,duration); + spell:setMsg(237); + else + spell:setMsg(75); + end else - spell:setMsg(75); + target:addStatusEffect(EFFECT_SLOW,power,0,duration); + spell:setMsg(237); end else spell:setMsg(85); Index: scripts/globals/spells/hojo_san.lua =================================================================== --- scripts/globals/spells/hojo_san.lua (revision 3304) +++ scripts/globals/spells/hojo_san.lua (working copy) @@ -27,13 +27,29 @@ if(math.random(0,100) >= target:getMod(MOD_SLOWRES)) then -- Spell succeeds if a 1 or 1/2 resist check is achieved if(duration >= 210) then - - if(target:addStatusEffect(EFFECT_SLOW,power,0,duration)) then - spell:setMsg(236); + --Looks for another Slow or Haste effect and replaces it if stronger + slow = target:getStatusEffect(EFFECT_SLOW); + haste = target:getStatusEffect(EFFECT_HASTE); + if(slow ~= nil) then + if(slow:getPower() > power) then + target:delStatusEffect(EFFECT_SLOW); + target:addStatusEffect(EFFECT_SLOW,power,0,duration); + spell:setMsg(237); + else + spell:setMsg(75); + end + elseif(haste ~= nil) then + if(haste:getPower() < (-1 * power)) then + target:delStatusEffect(EFFECT_HASTE); + target:addStatusEffect(EFFECT_SLOW,power,0,duration); + spell:setMsg(237); + else + spell:setMsg(75); + end else - spell:setMsg(75); + target:addStatusEffect(EFFECT_SLOW,power,0,duration); + spell:setMsg(237); end - else spell:setMsg(85); end Index: scripts/globals/spells/horde_lullaby.lua =================================================================== --- scripts/globals/spells/horde_lullaby.lua (revision 3304) +++ scripts/globals/spells/horde_lullaby.lua (working copy) @@ -28,17 +28,10 @@ spell:setMsg(75); else -- add equipment bonus - local sItem = caster:getEquipID(2); + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_LULLABY) * 10)/100)); - -- Mary's Horn - if(sItem == 17366) then - duration = duration * 1.1; - end - - if(sItem == 17841 or sItem == 17854) then - duration = duration * 1.2; - end - if(target:addStatusEffect(EFFECT_LULLABY,1,0,duration)) then spell:setMsg(237); else Index: scripts/globals/spells/horde_lullaby_ii.lua =================================================================== --- scripts/globals/spells/horde_lullaby_ii.lua (revision 3304) +++ scripts/globals/spells/horde_lullaby_ii.lua (working copy) @@ -28,17 +28,10 @@ spell:setMsg(75); else -- add equipment bonus - local sItem = caster:getEquipID(2); + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_LULLABY) * 10)/100)); - -- Mary's Horn - if(sItem == 17366) then - duration = duration * 1.1; - end - - if(sItem == 17841 or sItem == 17854) then - duration = duration * 1.2; - end - if(target:addStatusEffect(EFFECT_LULLABY,1,0,duration)) then spell:setMsg(237); else Index: scripts/globals/spells/hunters_prelude.lua =================================================================== --- scripts/globals/spells/hunters_prelude.lua (revision 0) +++ scripts/globals/spells/hunters_prelude.lua (working copy) @@ -0,0 +1,30 @@ +----------------------------------------- +-- Spell: Hunter's Prelude +-- Grants Ranged Accuracy bonus to target. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local duration = 120; + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + + duration = duration + (duration * (target:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((target:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((target:getMod(MOD_PRELUDE) * 10)/100)); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_PRELUDE); + target:addStatusEffect(EFFECT_PRELUDE,1,0,duration); + spell:setMsg(230); + return EFFECT_PRELUDE; +end; \ No newline at end of file Index: scripts/globals/spells/huton_ichi.lua =================================================================== --- scripts/globals/spells/huton_ichi.lua (revision 3304) +++ scripts/globals/spells/huton_ichi.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_HUTON_EFFECT); + duration = 30 + caster:getMerit(MERIT_HUTON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_ICERES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_ICERES); return final; Index: scripts/globals/spells/huton_ni.lua =================================================================== --- scripts/globals/spells/huton_ni.lua (revision 3304) +++ scripts/globals/spells/huton_ni.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_HUTON_EFFECT); + duration = 30 + caster:getMerit(MERIT_HUTON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_ICERES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_ICERES); return final; Index: scripts/globals/spells/huton_san.lua =================================================================== --- scripts/globals/spells/huton_san.lua (revision 3304) +++ scripts/globals/spells/huton_san.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_HUTON_EFFECT); + duration = 30 + caster:getMerit(MERIT_HUTON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_ICERES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_ICERES); return final; Index: scripts/globals/spells/hyoton_ichi.lua =================================================================== --- scripts/globals/spells/hyoton_ichi.lua (revision 3304) +++ scripts/globals/spells/hyoton_ichi.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_HYOTON_EFFECT); + duration = 30 + caster:getMerit(MERIT_HYOTON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_FIRERES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_FIRERES); return final; Index: scripts/globals/spells/hyoton_ni.lua =================================================================== --- scripts/globals/spells/hyoton_ni.lua (revision 3304) +++ scripts/globals/spells/hyoton_ni.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_HYOTON_EFFECT); + duration = 30 + caster:getMerit(MERIT_HYOTON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_FIRERES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_FIRERES); return final; Index: scripts/globals/spells/hyoton_san.lua =================================================================== --- scripts/globals/spells/hyoton_san.lua (revision 3304) +++ scripts/globals/spells/hyoton_san.lua (working copy) @@ -23,21 +23,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end - - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_HYOTON_EFFECT); + duration = 30 + caster:getMerit(MERIT_HYOTON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_FIRERES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_FIRERES); return final; Index: scripts/globals/spells/ice_carol.lua =================================================================== --- scripts/globals/spells/ice_carol.lua (revision 0) +++ scripts/globals/spells/ice_carol.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Ice Carol +-- MOD_ICERES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 40, 120, MOD_ICERES); +end; Index: scripts/globals/spells/ice_carol_ii.lua =================================================================== --- scripts/globals/spells/ice_carol_ii.lua (revision 0) +++ scripts/globals/spells/ice_carol_ii.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Ice Carol II +-- MOD_ICERES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 50, 120, MOD_ICERES); +end; Index: scripts/globals/spells/ice_spikes.lua =================================================================== --- scripts/globals/spells/ice_spikes.lua (revision 3304) +++ scripts/globals/spells/ice_spikes.lua (working copy) @@ -8,21 +8,35 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local duration = SPIKE_EFFECT_DURATION; - local typeEffect = EFFECT_ICE_SPIKES; + local typeEffect = EFFECT_ICE_SPIKES; + local legs = caster:getEquipID(SLOT_LEGS); + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + local int = caster:getStat(MOD_INT); local magicAtk = caster:getMod(MOD_MATT); local power = ((int + 10) / 20 + 2) * (1 + (magicAtk / 100)); + -- Equipment Bonus Amount + if (legs == 15622) then -- Mercenarys Trousers + power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)) + (int * (4/256)); + elseif (legs == 15121 or legs == 15584) then -- Duelist Tights & +1 + power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)) + (int * (6/256)); + elseif (legs == 10714) then -- Duelist Tights +2 + power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)) + (int * (8/256)); + end + if(target:addStatusEffect(typeEffect,power,0,duration)) then spell:setMsg(230); else Index: scripts/globals/spells/invisible.lua =================================================================== --- scripts/globals/spells/invisible.lua (revision 3304) +++ scripts/globals/spells/invisible.lua (working copy) @@ -24,13 +24,15 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + if (target:getMainLvl() < 20) then duration = duration * target:getMainLvl() / 20; -- level adjustment end - if (target:getEquipID(15) == 13692) then -- skulker's cape - duration = duration * 1.5; - end - + -- Equip Bonus + duration = duration + (duration * target:getMod(MOD_INVIS_DUR)); + spell:setMsg(230); target:addStatusEffect(EFFECT_INVISIBLE,0,10,(math.floor(duration) * SNEAK_INVIS_DURATION_MULTIPLIER)); else Index: scripts/globals/spells/kakka_ichi.lua =================================================================== --- scripts/globals/spells/kakka_ichi.lua (revision 0) +++ scripts/globals/spells/kakka_ichi.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- Spell: Kakka: Ichi +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + target:delStatusEffect(EFFECT_STORE_TP); + effect = target:getStatusEffect(EFFECT_STORE_TP); + + target:addStatusEffect(EFFECT_STORE_TP,EFFECT_STORE_TP,10,0,180); + spell:setMsg(230); + + return EFFECT_STORE_TP; +end; \ No newline at end of file Index: scripts/globals/spells/katon_ichi.lua =================================================================== --- scripts/globals/spells/katon_ichi.lua (revision 3304) +++ scripts/globals/spells/katon_ichi.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_KATON_EFFECT); + duration = 30 + caster:getMerit(MERIT_KATON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_WATERRES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_WATERRES); return final; Index: scripts/globals/spells/katon_ni.lua =================================================================== --- scripts/globals/spells/katon_ni.lua (revision 3304) +++ scripts/globals/spells/katon_ni.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_KATON_EFFECT); + duration = 30 + caster:getMerit(MERIT_KATON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_WATERRES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_WATERRES); return final; Index: scripts/globals/spells/katon_san.lua =================================================================== --- scripts/globals/spells/katon_san.lua (revision 3304) +++ scripts/globals/spells/katon_san.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_KATON_EFFECT); + duration = 30 + caster:getMerit(MERIT_KATON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_WATERRES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_WATERRES); return final; Index: scripts/globals/spells/kaustra.lua =================================================================== --- scripts/globals/spells/kaustra.lua (revision 0) +++ scripts/globals/spells/kaustra.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------------- +-- Spell: Kaustra +-- Relentless dark damage slowly devours +-- an enemy. +-- Duration: Your current lvl +5 secs +----------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local mpCost = caster:getMaxMP() * .2 + caster:addMP(-mpCost); + --calculate raw damage + dmg = calculateMagicDamage(512,8,caster,spell,target,DARK_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),DARK_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + local doTDMG = dmg * .25; + if (target:hasStatusEffect(EFFECT_KAUSTRA) == false) then + local duration = player:getMainLvl() + 5; + spell:setMsg(230); + target:addStatusEffect(EFFECT_KASUTRA,doTDMG,3,duration); + else + spell:setMsg(75); -- no effect. + end + + return dmg; +end; Index: scripts/globals/spells/knights_minne.lua =================================================================== --- scripts/globals/spells/knights_minne.lua (revision 3304) +++ scripts/globals/spells/knights_minne.lua (working copy) @@ -15,10 +15,14 @@ function onSpellCast(caster,target,spell) - local sItem = caster:getEquipID(2); - local sLvl = caster:getSkillLevel(40); -- Gets skill level of Singing + local duration = 120; + local power = 1; + local sItem = caster:getEquipID(SLOT_RANGED); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); - if (sLvl < 6) then -- If your skill level is below 6 your stuck at the minimum + if (sLvl < 6) then -- If your skill level is below 6 you are stuck at the minimum power = 7; end @@ -31,18 +35,65 @@ power = 14; end - if(sItem == 17373 or sItem == 17354) then -- Maple Harp +1 or Harp will add 3 more - power = power + 3; - end + if(caster:getObjType() == TYPE_PC) then + if (sLvl < 6) then -- If your skill level is below 6 you are stuck at the minimum + power = 7 + caster:getMerit(MERIT_MINNE_EFFECT); + end + + if (sLvl >= 6 and sLvl <= 61) then -- If your above 5 skill then you get the bonus of 1 more defense for every 8 skill + sBoost = math.floor((sLvl - 5)/8); + power = 7 + sBoost + caster:getMerit(MERIT_MINNE_EFFECT); + end - if(sItem == 17374) then -- Harp +1 gives 5 more - power = power + 5; + if(sLvl >= 61) then -- The bonus caps at skill 61 + power = 14 + caster:getMerit(MERIT_MINNE_EFFECT); + end end + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + if(sItem == 18342 or sItem == 18577 or sItem == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + duration = duration + 24; + elseif(sItem == 18579 or sItem == 18580) then -- Gjallarhorn Lvl 90 - 95 + duration = duration + 36; + elseif(sItem == 18840 or sItem == 18572) then -- Gjallarhorn Lvl 99 - 99-2 + duration = duration + 48; + elseif(sItem == 17354 or sItem == 17373) then -- Harp & Maple Harp +1 + duration = duration + 12; + elseif(sItem == 17374) then -- Harp +1 + duration = duration + 24; + elseif(sItem == 17856) then -- Syrnix + duration = duration + 36; + end -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. target:delStatusEffect(EFFECT_MINNE); - target:addStatusEffect(EFFECT_MINNE,power,0,120); + target:addStatusEffect(EFFECT_MINNE,1,0,duration); spell:setMsg(230); return EFFECT_MINNE; Index: scripts/globals/spells/knights_minne_ii.lua =================================================================== --- scripts/globals/spells/knights_minne_ii.lua (revision 3304) +++ scripts/globals/spells/knights_minne_ii.lua (working copy) @@ -15,10 +15,14 @@ function onSpellCast(caster,target,spell) - -- If your skill level is below 65 your stuck at the minimum - local sItem = caster:getEquipID(2); - local sLvl = caster:getSkillLevel(40); -- Gets skill level of Singing - power=0; + local duration = 120; + local power = 0; + local sItem = caster:getEquipID(SLOT_RANGED); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + -- If your skill level is below 65 you are stuck at the minimum -- If your above 64 skill then you get the bonus of 1 more defense for every 4 skill if (sLvl >= 65 and sLvl <= 121) then sBoost = math.floor((sLvl - 61)/4); @@ -28,18 +32,64 @@ if(sLvl >= 125) then power = 28; end - -- Maple Harp +1 or Harp will add 3 more - if(sItem == 17373 or sItem == 17354) then - power = power + 3; + + if(caster:getObjType() == TYPE_PC) then + power=0 + caster:getMerit(MERIT_MINNE_EFFECT); + -- If your above 64 skill then you get the bonus of 1 more defense for every 4 skill + if (sLvl >= 65 and sLvl <= 121) then + sBoost = math.floor((sLvl - 61)/4); + power = power + sBoost + caster:getMerit(MERIT_MINNE_EFFECT); + end + -- The bonus caps at skill 125 + if(sLvl >= 125) then + power = 28 + caster:getMerit(MERIT_MINNE_EFFECT); + end end - -- Harp +1 gives 5 more - if(sItem == 17374) then - power = power + 5; + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + if(sItem == 18342 or sItem == 18577 or sItem == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + duration = duration + 24; + elseif(sItem == 18579 or sItem == 18580) then -- Gjallarhorn Lvl 90 - 95 + duration = duration + 36; + elseif(sItem == 18840 or sItem == 18572) then -- Gjallarhorn Lvl 99 - 99-2 + duration = duration + 48; + elseif(sItem == 17354 or sItem == 17373) then -- Harp & Maple Harp +1 + duration = duration + 12; + elseif(sItem == 17374) then -- Harp +1 + duration = duration + 24; + elseif(sItem == 17856) then -- Syrnix + duration = duration + 36; + end + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. target:delStatusEffect(EFFECT_MINNE); - target:addStatusEffect(EFFECT_MINNE,power,0,120); + target:addStatusEffect(EFFECT_MINNE,2,0,duration); spell:setMsg(230); return EFFECT_MINNE; Index: scripts/globals/spells/knights_minne_iii.lua =================================================================== --- scripts/globals/spells/knights_minne_iii.lua (revision 3304) +++ scripts/globals/spells/knights_minne_iii.lua (working copy) @@ -15,10 +15,14 @@ function onSpellCast(caster,target,spell) - local sItem = caster:getEquipID(2); - local sLvl = caster:getSkillLevel(40); -- Gets skill level of Singing + local duration = 120; + local power = 3; + local sItem = caster:getEquipID(SLOT_RANGED); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); - if (sLvl < 118) then -- If your skill level is below 118 your stuck at the minimum + if (sLvl < 118) then -- If your skill level is below 118 you are stuck at the minimum power = 26; end @@ -30,19 +34,66 @@ if(sLvl >= 187) then -- The bonus caps at skill 187 power = 40; end - - if(sItem == 17373 or sItem == 17354) then -- Maple Harp +1 or Harp will add 3 more - power = power + 3; + + if(caster:getObjType() == TYPE_PC) then + if (sLvl < 118) then -- If your skill level is below 118 you are stuck at the minimum + power = 26 + caster:getMerit(MERIT_MINNE_EFFECT); + end + + if (sLvl >= 118 and sLvl <= 186) then -- If your above 117 skill then you get the bonus of 1 more defense for every 5 skill + sBoost = math.floor((sLvl - 117)/5); + power = 26 + sBoost + caster:getMerit(MERIT_MINNE_EFFECT); + end + + if(sLvl >= 187) then -- The bonus caps at skill 187 + power = 40 + caster:getMerit(MERIT_MINNE_EFFECT); + end end - - if(sItem == 17374) then -- Harp +1 gives 5 more - power = power + 5; + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + if(sItem == 18342 or sItem == 18577 or sItem == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + duration = duration + 24; + elseif(sItem == 18579 or sItem == 18580) then -- Gjallarhorn Lvl 90 - 95 + duration = duration + 36; + elseif(sItem == 18840 or sItem == 18572) then -- Gjallarhorn Lvl 99 - 99-2 + duration = duration + 48; + elseif(sItem == 17354 or sItem == 17373) then -- Harp & Maple Harp +1 + duration = duration + 12; + elseif(sItem == 17374) then -- Harp +1 + duration = duration + 24; + elseif(sItem == 17856) then -- Syrnix + duration = duration + 36; + end -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. target:delStatusEffect(EFFECT_MINNE); - target:addStatusEffect(EFFECT_MINNE,power,0,120); + target:addStatusEffect(EFFECT_MINNE,3,0,duration); spell:setMsg(230); return EFFECT_MINNE; end; \ No newline at end of file Index: scripts/globals/spells/knights_minne_iv.lua =================================================================== --- scripts/globals/spells/knights_minne_iv.lua (revision 3304) +++ scripts/globals/spells/knights_minne_iv.lua (working copy) @@ -15,10 +15,14 @@ function onSpellCast(caster,target,spell) - local sItem = caster:getEquipID(2); - local sLvl = caster:getSkillLevel(40); -- Gets skill level of Singing + local duration = 120; + local power = 0; + local sItem = caster:getEquipID(SLOT_RANGED); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); - if (sLvl < 193) then -- If your skill level is below 193 your stuck at the minimum + if (sLvl < 193) then -- If your skill level is below 193 you are stuck at the minimum power = 38; end @@ -30,19 +34,66 @@ if(sLvl >= 222) then -- The bonus caps at skill 222 power = 48; end - - if(sItem == 17373 or sItem == 17354) then -- Maple Harp +1 or Harp will add 3 more - power = power + 3; + + if(caster:getObjType() == TYPE_PC) then + if (sLvl < 193) then -- If your skill level is below 193 you are stuck at the minimum + power = 38 + caster:getMerit(MERIT_MINNE_EFFECT); + end + + if (sLvl >= 193 and sLvl <= 221) then -- If your above 192 skill then you get the bonus of 1 more defense for every 3 skill + sBoost = math.floor((sLvl - 192)/3); + power = 38 + sBoost + caster:getMerit(MERIT_MINNE_EFFECT); + end + + if(sLvl >= 222) then -- The bonus caps at skill 222 + power = 48 + caster:getMerit(MERIT_MINNE_EFFECT); + end end - if(sItem == 17374) then -- Harp +1 gives 5 more - power = power + 5; + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + if(sItem == 18342 or sItem == 18577 or sItem == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + duration = duration + 24; + elseif(sItem == 18579 or sItem == 18580) then -- Gjallarhorn Lvl 90 - 95 + duration = duration + 36; + elseif(sItem == 18840 or sItem == 18572) then -- Gjallarhorn Lvl 99 - 99-2 + duration = duration + 48; + elseif(sItem == 17354 or sItem == 17373) then -- Harp & Maple Harp +1 + duration = duration + 12; + elseif(sItem == 17374) then -- Harp +1 + duration = duration + 24; + elseif(sItem == 17856) then -- Syrnix + duration = duration + 36; + end -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. target:delStatusEffect(EFFECT_MINNE); - target:addStatusEffect(EFFECT_MINNE,power,0,120); + target:addStatusEffect(EFFECT_MINNE,4,0,duration); spell:setMsg(230); return EFFECT_MINNE; end; \ No newline at end of file Index: scripts/globals/spells/knights_minne_v.lua =================================================================== --- scripts/globals/spells/knights_minne_v.lua (revision 0) +++ scripts/globals/spells/knights_minne_v.lua (working copy) @@ -0,0 +1,98 @@ +----------------------------------------- +-- Spell: Knight's Minne IV +-- Grants Defense bonus to all allies. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + local duration = 120; + local power = 0; + local sItem = caster:getEquipID(SLOT_RANGED); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (sLvl < 228) then -- If your skill level is below 228 you are stuck at the minimum + power = 50; + end + + if (sLvl >= 228 and sLvl <= 290) then -- If your above 227 skill then you get the bonus of 1 more defense for every 3 skill + sBoost = math.floor((sLvl - 228)/3); + power = 50 + sBoost; + end + + if(sLvl >= 291) then -- The bonus caps at skill 222 + power = 62; + end + + if(caster:getObjType() == TYPE_PC) then + if (sLvl < 228) then -- If your skill level is below 228 you are stuck at the minimum + power = 50; + end + + if (sLvl >= 228 and sLvl <= 290) then -- If your above 227 skill then you get the bonus of 1 more defense for every 3 skill + sBoost = math.floor((sLvl - 228)/3); + power = 50 + sBoost; + end + + if(sLvl >= 291) then -- The bonus caps at skill 222 + power = 62; + end + end + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + if(sItem == 18342 or sItem == 18577 or sItem == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + duration = duration + 24; + elseif(sItem == 18579 or sItem == 18580) then -- Gjallarhorn Lvl 90 - 95 + duration = duration + 36; + elseif(sItem == 18840 or sItem == 18572) then -- Gjallarhorn Lvl 99 - 99-2 + duration = duration + 48; + elseif(sItem == 17354 or sItem == 17373) then -- Harp & Maple Harp +1 + duration = duration + 12; + elseif(sItem == 17374) then -- Harp +1 + duration = duration + 24; + elseif(sItem == 17856) then -- Syrnix + duration = duration + 36; + end + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_MINNE); + target:addStatusEffect(EFFECT_MINNE,5,0,duration); + return EFFECT_MINNE; +end; \ No newline at end of file Index: scripts/globals/spells/kurayami_ichi.lua =================================================================== --- scripts/globals/spells/kurayami_ichi.lua (revision 3304) +++ scripts/globals/spells/kurayami_ichi.lua (working copy) @@ -26,11 +26,19 @@ --Calculates resist chance from Reist Blind if(math.random(0,100) >= target:getMod(MOD_BLINDRES)) then if(duration >= 80) then - - if(target:addStatusEffect(EFFECT_BLINDNESS,power,0,duration)) then - spell:setMsg(236); + -- Erases a weaker blind and applies the stronger one + local blindness = target:getStatusEffect(EFFECT_BLINDNESS); + if(blindness ~= nil) then + if(blindness:getPower() < power) then + target:delStatusEffect(EFFECT_BLINDNESS); + target:addStatusEffect(EFFECT_BLINDNESS,power,0,duration); + spell:setMsg(237); + else + spell:setMsg(75); + end else - spell:setMsg(75); + target:addStatusEffect(EFFECT_BLINDNESS,power,0,duration); + spell:setMsg(237); end else spell:setMsg(85); Index: scripts/globals/spells/kurayami_ni.lua =================================================================== --- scripts/globals/spells/kurayami_ni.lua (revision 3304) +++ scripts/globals/spells/kurayami_ni.lua (working copy) @@ -26,11 +26,19 @@ --Calculates resist chanve from Reist Blind if(math.random(0,100) >= target:getMod(MOD_BLINDRES)) then if(duration >= 150) then - - if(target:addStatusEffect(EFFECT_BLINDNESS,power,0,duration)) then - spell:setMsg(236); + -- Erases a weaker blind and applies the stronger one + local blindness = target:getStatusEffect(EFFECT_BLINDNESS); + if(blindness ~= nil) then + if(blindness:getPower() < power) then + target:delStatusEffect(EFFECT_BLINDNESS); + target:addStatusEffect(EFFECT_BLINDNESS,power,0,duration); + spell:setMsg(237); + else + spell:setMsg(75); + end else - spell:setMsg(75); + target:addStatusEffect(EFFECT_BLINDNESS,power,0,duration); + spell:setMsg(237); end else spell:setMsg(85); Index: scripts/globals/spells/kurayami_san.lua =================================================================== --- scripts/globals/spells/kurayami_san.lua (revision 3304) +++ scripts/globals/spells/kurayami_san.lua (working copy) @@ -26,11 +26,19 @@ --Calculates resist chanve from Reist Blind if(math.random(0,100) >= target:getMod(MOD_BLINDRES)) then if(duration >= 210) then - - if(target:addStatusEffect(EFFECT_BLINDNESS,power,0,duration)) then - spell:setMsg(236); + -- Erases a weaker blind and applies the stronger one + local blindness = target:getStatusEffect(EFFECT_BLINDNESS); + if(blindness ~= nil) then + if(blindness:getPower() < power) then + target:delStatusEffect(EFFECT_BLINDNESS); + target:addStatusEffect(EFFECT_BLINDNESS,power,0,duration); + spell:setMsg(237); + else + spell:setMsg(75); + end else - spell:setMsg(75); + target:addStatusEffect(EFFECT_BLINDNESS,power,0,duration); + spell:setMsg(237); end else spell:setMsg(85); Index: scripts/globals/spells/learned_etude.lua =================================================================== --- scripts/globals/spells/learned_etude.lua (revision 0) +++ scripts/globals/spells/learned_etude.lua (working copy) @@ -0,0 +1,51 @@ +-------------------------------------- +-- Spell: Learned Etude +-- Boosts targets INT stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + local duration = 120; + + if(enchanceSkill <180)then + power = 3 + elseif(enchanceSkill >=181 and enchanceSkill <=235)then + power = 4 + elseif(enchanceSkill >=236 and enchanceSkill <=288)then + power = 5 + elseif(enchanceSkill >=289 and enchanceSkill <=342)then + power = 6 + elseif(enchanceSkill >=343 and enchanceSkill <=396)then + power = 7 + elseif(enchanceSkill >=397 and enchanceSkill <=449)then + power = 8 + elseif(enchanceSkill >=450)then + power = 9 + else + power = 10 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_INT_DOWN) == true) then + target:delStatusEffect(EFFECT_INT_DOWN); + else + target:addStatusEffect(EFFECT_INT_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/light_carol.lua =================================================================== --- scripts/globals/spells/light_carol.lua (revision 0) +++ scripts/globals/spells/light_carol.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Light Carol +-- MOD_LIGHTRES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 40, 120, MOD_LIGHTRES); +end; Index: scripts/globals/spells/light_carol_ii.lua =================================================================== --- scripts/globals/spells/light_carol_ii.lua (revision 0) +++ scripts/globals/spells/light_carol_ii.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Light Carol II +-- MOD_LIGHTRES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 50, 120, MOD_LIGHTRES); +end; Index: scripts/globals/spells/lightning_carol.lua =================================================================== --- scripts/globals/spells/lightning_carol.lua (revision 0) +++ scripts/globals/spells/lightning_carol.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Lightning Carol +-- MOD_THUNDERRES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 40, 120, MOD_THUNDERRES); +end; Index: scripts/globals/spells/lightning_carol_ii.lua =================================================================== --- scripts/globals/spells/lightning_carol_ii.lua (revision 0) +++ scripts/globals/spells/lightning_carol_ii.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Lightning Carol II +-- MOD_THUNDERRES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 50, 120, MOD_THUNDERRES); +end; Index: scripts/globals/spells/logical_etude.lua =================================================================== --- scripts/globals/spells/logical_etude.lua (revision 0) +++ scripts/globals/spells/logical_etude.lua (working copy) @@ -0,0 +1,45 @@ +-------------------------------------- +-- Spell: Logical Etude +-- Boosts targets MND stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + local duration = 120; + + if(enchanceSkill <416)then + power = 12 + elseif(enchanceSkill >=417 and enchanceSkill <=445)then + power = 13 + elseif(enchanceSkill >=446 and enchanceSkill <=474)then + power = 14 + elseif(enchanceSkill >=475)then + power = 15 + else + power = 15 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_MND_DOWN) == true) then + target:delStatusEffect(EFFECT_MND_DOWN); + else + target:addStatusEffect(EFFECT_MND_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/mages_ballad.lua =================================================================== --- scripts/globals/spells/mages_ballad.lua (revision 3304) +++ scripts/globals/spells/mages_ballad.lua (working copy) @@ -15,12 +15,55 @@ function onSpellCast(caster,target,spell) - local mp = 1; + local duration = 120; + local ranged = caster:getEquipID(SLOT_RANGED); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + + if (caster:getEquipID(SLOT_LEGS) == 11133) then -- Aoidos' Rhinegrave +2 + duration = duration + 12; + end + if (ranged == 18831) then -- Crooner's Cithara + duration = duration + 12; + elseif (ranged == 18342 or ranged == 18577 or ranged == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + duration = duration + 24; + elseif (ranged == 18579 or ranged == 18580) then -- Gjallarhorn Lvl 90 - 95 + duration = duration + 36; + elseif (ranged == 18572 or ranged == 18840) then -- Gjallarhorn Lvl 99 - 99-2 + duration = duration + 48; + end + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:addStatusEffect(EFFECT_BALLAD,1,3,duration); + spell:setMsg(230); - -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. - -- Since all the tiers use the same effect buff it is hard to delete a specific one. - target:addStatusEffect(EFFECT_BALLAD,mp,3,120); - spell:setMsg(230); - - return EFFECT_BALLAD; + return EFFECT_BALLAD; end; Index: scripts/globals/spells/mages_ballad_ii.lua =================================================================== --- scripts/globals/spells/mages_ballad_ii.lua (revision 3304) +++ scripts/globals/spells/mages_ballad_ii.lua (working copy) @@ -15,12 +15,56 @@ function onSpellCast(caster,target,spell) - local mp = 2; + local duration = 120; + local ranged = caster:getEquipID(SLOT_RANGED); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + + if (caster:getEquipID(SLOT_LEGS) == 11133) then -- Aoidos' Rhinegrave +2 + duration = duration + 12; + end + if (ranged == 18831) then -- Crooner's Cithara + duration = duration + 12; + elseif (ranged == 18342 or ranged == 18577 or ranged == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + duration = duration + 24; + elseif (ranged == 18579 or ranged == 18580) then -- Gjallarhorn Lvl 90 - 95 + duration = duration + 36; + elseif (ranged == 18572 or ranged == 18840) then -- Gjallarhorn Lvl 99 - 99-2 + duration = duration + 48; + end + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:addStatusEffect(EFFECT_BALLAD,2,3,duration); + spell:setMsg(230); - -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. - -- Since all the tiers use the same effect buff it is hard to delete a specific one. - target:addStatusEffect(EFFECT_BALLAD,mp,3,120); + return EFFECT_BALLAD; +end; - spell:setMsg(230); - return EFFECT_BALLAD; -end; Index: scripts/globals/spells/mages_ballad_iii.lua =================================================================== --- scripts/globals/spells/mages_ballad_iii.lua (revision 0) +++ scripts/globals/spells/mages_ballad_iii.lua (working copy) @@ -0,0 +1,70 @@ +----------------------------------------- +-- Spell: Mage's Ballad III +-- Gradually restores target's MP. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + local duration = 120; + local ranged = caster:getEquipID(SLOT_RANGED); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + + if (caster:getEquipID(SLOT_LEGS) == 11133) then -- Aoidos' Rhinegrave +2 + duration = duration + 12; + end + if (ranged == 18831) then -- Crooner's Cithara + duration = duration + 12; + elseif (ranged == 18342 or ranged == 18577 or ranged == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + duration = duration + 24; + elseif (ranged == 18579 or ranged == 18580) then -- Gjallarhorn Lvl 90 - 95 + duration = duration + 36; + elseif (ranged == 18572 or ranged == 18840) then -- Gjallarhorn Lvl 99 - 99-2 + duration = duration + 48; + end + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:addStatusEffect(EFFECT_BALLAD,3,3,duration); + spell:setMsg(230); + + return EFFECT_BALLAD; +end; + Index: scripts/globals/spells/magic_finale.lua =================================================================== --- scripts/globals/spells/magic_finale.lua (revision 3304) +++ scripts/globals/spells/magic_finale.lua (working copy) @@ -14,10 +14,13 @@ function onSpellCast(caster,target,spell) -- Pull base stats. dINT = (caster:getStat(MOD_CHR) - target:getStat(MOD_CHR)); - + SINGING_SKILL = caster:getSkillLevel(SINGING_SKILL); -- apply bonus, flash is hard to fully resist bonus = AffinityBonus(caster,spell) + 300; + bonus = bonus + (caster:getMod(MOD_ALL_SONGS) * 10); + bonus = bonus + (caster:getMod(MOD_FINALE) * 10); + local resist = applyResistance(caster,spell,target,dINT,SINGING_SKILL,bonus); local effect = EFFECT_NONE; Index: scripts/globals/spells/massacre_elegy.lua =================================================================== --- scripts/globals/spells/massacre_elegy.lua (revision 3304) +++ scripts/globals/spells/massacre_elegy.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Battlefield Elegy +-- Spell: Massacre Elegy ----------------------------------------- require("scripts/globals/status"); require("scripts/globals/magic"); @@ -12,8 +12,8 @@ end; function onSpellCast(caster,target,spell) - duration = 240; - power = 1024; + duration = 120; + power = 768; bonus = AffinityBonus(caster, spell); pCHR = caster:getStat(MOD_CHR); @@ -28,34 +28,18 @@ if(100 * math.random() < target:getMod(MOD_SLOWRES)) then spell:setMsg(85); -- resisted spell else - local sItem = caster:getEquipID(2); - - -- horn +1 - if(sItem == 17371) then - power = power + 20; - duration = duration * 1.2; - end - - if(sItem == 17352) then - power = power + 11; - duration = duration * 1.1; - end - - if(sItem == 18342) then - power = power + 20; - duration = duration * 1.2; - end - - if(sItem == 17856) then - power = power + 30; - duration = duration * 1.3; - end - + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ELEGY) * 10)/100)); + + power = power + ((caster:getMod(MOD_ELEGY) + caster:getMod(MOD_ALL_SONGS)) * 5); + if (power > 1024) then + power = 1024; + end + -- Try to overwrite weaker elegy - if(canOverwrite(target, EFFECT_ELEGY, power)) then - -- overwrite them - target:delStatusEffect(EFFECT_ELEGY); - target:addStatusEffect(EFFECT_ELEGY,power,0,duration); + if(target:addStatusEffect(EFFECT_ELEGY,power,0,duration)) then spell:setMsg(237); else spell:setMsg(75); -- no effect Index: scripts/globals/spells/meteor_ii.lua =================================================================== --- scripts/globals/spells/meteor_ii.lua (revision 0) +++ scripts/globals/spells/meteor_ii.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Meteor II +-- Deals non-elemental damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + --Byrthnoth @ Random Facts Thread: Magic @ BG: + --Spell Base Damage = MAB/MDB*floor(Int + Elemental Magic Skill/6)*3.5 + --NOT AFFECTED BY DARK BONUSES (bonus ETC) + --I'll just point this out again. It can't resist, there's no dINT, and the damage is non-elemental. The only terms that affect it for monsters (that we know of) are MDB and MDT. If a --normal monster would take 50k damage from your group, Botulus would take 40k damage. Every. Time. + dmg = ((100+caster:getMod(MOD_MATT))/(100+target:getMod(MOD_MDEF))) * (caster:getStat(MOD_INT) + (caster:getMod(79+ELEMENTAL_MAGIC_SKILL)+caster:getSkillLevel(ELEMENTAL_MAGIC_SKILL))/6) * 5.5; + + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/migawari_ichi.lua =================================================================== --- scripts/globals/spells/migawari_ichi.lua (revision 0) +++ scripts/globals/spells/migawari_ichi.lua (working copy) @@ -0,0 +1,23 @@ +----------------------------------------- +-- Spell: Migawari: Ichi +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + target:delStatusEffect(EFFECT_MIGAWARI); + effect = target:getStatusEffect(EFFECT_MIGAWARI); + + target:addStatusEffect(EFFECT_MIGAWARI,EFFECT_MIGAWARI,0,0,60); + spell:setMsg(230); + + return EFFECT_MIGAWARI; +end; \ No newline at end of file Index: scripts/globals/spells/monomi_ichi.lua =================================================================== --- scripts/globals/spells/monomi_ichi.lua (revision 3304) +++ scripts/globals/spells/monomi_ichi.lua (working copy) @@ -17,7 +17,8 @@ function onSpellCast(caster,target,spell) if (target:hasStatusEffect(EFFECT_SNEAK) == false) then spell:setMsg(230); - target:addStatusEffect(EFFECT_SNEAK,0,10,180); + local duration = 180; + target:addStatusEffect(EFFECT_SNEAK,0,10,duration); else spell:setMsg(75); -- no effect. end Index: scripts/globals/spells/moogle_rhapsody.lua =================================================================== --- scripts/globals/spells/moogle_rhapsody.lua (revision 0) +++ scripts/globals/spells/moogle_rhapsody.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- Spell: Moogle Rhapsody +-- Increases Confusion Resistance to +-- Party Members within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + + power = power + (caster:getMod(MOD_ALL_SONGS) * 4); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_RHAPSODY); + target:addStatusEffect(EFFECT_RHAPSODY,power,0,duration); + spell:setMsg(230); + return EFFECT_RHAPSODY; +end; \ No newline at end of file Index: scripts/globals/spells/myoshui_ichi.lua =================================================================== --- scripts/globals/spells/myoshui_ichi.lua (revision 0) +++ scripts/globals/spells/myoshui_ichi.lua (working copy) @@ -0,0 +1,24 @@ +----------------------------------------- +-- Spell: Myoshui: Ichi +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + target:delStatusEffect(EFFECT_SUBTLE_BLOW_PLUS); + effect = target:getStatusEffect(EFFECT_SUBTLE_BLOW_PLUS); + + -- The power is unknown. + target:addStatusEffect(EFFECT_SUBTLE_BLOW_PLUS,EFFECT_SUBTLE_BLOW_PLUS,10,0,180); + spell:setMsg(230); + + return EFFECT_SUBTLE_BLOW_PLUS; +end; \ No newline at end of file Index: scripts/globals/spells/odin.lua =================================================================== --- scripts/globals/spells/odin.lua (revision 0) +++ scripts/globals/spells/odin.lua (working copy) @@ -0,0 +1,19 @@ +----------------------------------------- +-- Spell: Odin +-- Summons Odin to fight by your side +----------------------------------------- + +require("scripts/globals/pets"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + caster:spawnPet(PET_ODIN); + return 0; +end; \ No newline at end of file Index: scripts/globals/spells/paralyga.lua =================================================================== --- scripts/globals/spells/paralyga.lua (revision 0) +++ scripts/globals/spells/paralyga.lua (working copy) @@ -0,0 +1,69 @@ +----------------------------------------- +-- Spell: Paralyga +-- Spell accuracy is most highly affected by Enfeebling Magic Skill, Magic Accuracy, and MND. +-- Slow's potency is calculated with the formula (150 + dMND*2)/1024, and caps at 300/1024 (~29.3%). +-- And MND of 75 is neccessary to reach the hardcap of Slow. +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + -- Calculate duration. + local double duration = 120; + + -- Grabbing variables for paralyze potency + mLVL = caster:getMainLvl(); + pMND = caster:getStat(MOD_MND); + mMND = target:getStat(MOD_MND); + + dMND = (pMND - mMND); + multiplier = 150 / mLVL; + + -- Calculate potency. + potency = (multiplier * dMND) / 10; + + if potency > 25 then + potency = 25; + end + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + potency = potency * 1.1; + end + --printf("Duration : %u",duration); + --printf("Potency : %u",potency); + if(target:hasStatusEffect(EFFECT_PARALYSIS)) then --effect already on, do nothing + spell:setMsg(75); + elseif(math.random(0,100) >= target:getMod(MOD_PARALYZERES)) then + bonus = AffinityBonus(caster, spell); + resist = applyResistance(caster,spell,target,dMND,35,bonus); + + if(resist >= 0.25) then + if(target:addStatusEffect(EFFECT_PARALYSIS,potency,0,duration*resist)) then + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + -- resist + spell:setMsg(85); + end + + + else -- resist entirely. + + spell:setMsg(85); + end + + return EFFECT_PARALYSIS; +end; Index: scripts/globals/spells/paralyze.lua =================================================================== --- scripts/globals/spells/paralyze.lua (revision 3304) +++ scripts/globals/spells/paralyze.lua (working copy) @@ -35,6 +35,10 @@ if potency > 25 then potency = 25; end + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + potency = potency * 1.1; + end --printf("Duration : %u",duration); --printf("Potency : %u",potency); if(target:hasStatusEffect(EFFECT_PARALYSIS)) then --effect already on, do nothing Index: scripts/globals/spells/paralyze_ii.lua =================================================================== --- scripts/globals/spells/paralyze_ii.lua (revision 3304) +++ scripts/globals/spells/paralyze_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Paralyze +-- Spell: Paralyze II -- Spell accuracy is most highly affected by Enfeebling Magic Skill, Magic Accuracy, and MND. -- Slow's potency is calculated with the formula (150 + dMND*2)/1024, and caps at 300/1024 (~29.3%). -- And MND of 75 is neccessary to reach the hardcap of Slow. @@ -37,6 +37,10 @@ if potency > 30 then potency = 30; end + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + potency = potency * 1.1; + end --printf("Duration : %u",duration); --printf("Potency : %u",potency); if(target:hasStatusEffect(EFFECT_PARALYSIS)) then --effect already on, do nothing Index: scripts/globals/spells/phalanx.lua =================================================================== --- scripts/globals/spells/phalanx.lua (revision 3304) +++ scripts/globals/spells/phalanx.lua (working copy) @@ -9,10 +9,10 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) enhskill = caster:getSkillLevel(ENHANCING_MAGIC_SKILL); final = 0; @@ -21,6 +21,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + if(enhskill<=300) then final = (enhskill/10) -2; if(final<0) then Index: scripts/globals/spells/phalanx_ii.lua =================================================================== --- scripts/globals/spells/phalanx_ii.lua (revision 3304) +++ scripts/globals/spells/phalanx_ii.lua (working copy) @@ -24,6 +24,9 @@ duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + final = (enhskill / 25) + (3 * merits) + 1; if(final>35) then Index: scripts/globals/spells/pining_nocturne.lua =================================================================== --- scripts/globals/spells/pining_nocturne.lua (revision 0) +++ scripts/globals/spells/pining_nocturne.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Pining Nocturne +-- Decreases enemy's MACC and increases +-- spellcasting time. +-- Substituted with Addle +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local power = 20 + local duration = 120; + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + + power = power + (caster:getMod(MOD_ALL_SONGS) * 4); + + -- Temporary solution EFFECT_NOCTURNE not avaliable in core + target:addStatusEffect(EFFECT_ADDLE,power,0,duration); + spell:setMsg(230); + return EFFECT_ADDLE; +end; \ No newline at end of file Index: scripts/globals/spells/poison.lua =================================================================== --- scripts/globals/spells/poison.lua (revision 3304) +++ scripts/globals/spells/poison.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Poison +-- Spell: Poison ----------------------------------------- require("scripts/globals/status"); @@ -25,6 +25,11 @@ if power > 4 then power = 4; end + + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = 5; + end if(math.random(0,100) >= target:getMod(MOD_POISONRES)) then bonus = AffinityBonus(caster, spell); @@ -32,10 +37,20 @@ if(resist == 1 or resist == 0.5) then -- effect taken duration = duration / resist; - if(target:addStatusEffect(effect,power,3,duration)) then + -- Try to erase a weaker poison. + poison = target:getStatusEffect(effect) + if(poison ~= nil) then + if(poison:getPower() < power) then + -- remove weaker poison + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + target:addStatusEffect(effect,power,3,duration); spell:setMsg(236); - else - spell:setMsg(75); end else -- resist entirely. Index: scripts/globals/spells/poison_ii.lua =================================================================== --- scripts/globals/spells/poison_ii.lua (revision 3304) +++ scripts/globals/spells/poison_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Poison +-- Spell: Poison II ----------------------------------------- require("scripts/globals/status"); @@ -25,6 +25,10 @@ if power > 10 then power = 10; end + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end if(math.random(0,100) >= target:getMod(MOD_POISONRES)) then bonus = AffinityBonus(caster, spell); @@ -32,10 +36,21 @@ if(resist == 1 or resist == 0.5) then -- effect taken duration = duration / resist; - if(target:addStatusEffect(effect,power,3,duration)) then + -- Try to erase a weaker poison. + poison = target:getStatusEffect(effect) + if(poison ~= nil) then + if(poison:getPower() < power) then + -- remove weaker poison + target:delStatusEffect(effect); + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + target:addStatusEffect(effect,power,3,duration); spell:setMsg(236); - else - spell:setMsg(75); end else -- resist entirely. Index: scripts/globals/spells/poison_iii.lua =================================================================== --- scripts/globals/spells/poison_iii.lua (revision 3304) +++ scripts/globals/spells/poison_iii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Poison +-- Spell: Poison III ----------------------------------------- require("scripts/globals/status"); @@ -32,10 +32,21 @@ if(resist == 1 or resist == 0.5) then -- effect taken duration = duration / resist; - if(target:addStatusEffect(effect,power,3,duration)) then + -- Try to erase a weaker poison. + poison = target:getStatusEffect(effect) + if(poison ~= nil) then + if(poison:getPower() < power) then + -- remove weaker poison + target:delStatusEffect(effect); + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + target:addStatusEffect(effect,power,3,duration); spell:setMsg(236); - else - spell:setMsg(75); end else -- resist entirely. Index: scripts/globals/spells/poison_iv.lua =================================================================== --- scripts/globals/spells/poison_iv.lua (revision 0) +++ scripts/globals/spells/poison_iv.lua (working copy) @@ -0,0 +1,59 @@ +----------------------------------------- +-- Spell: Poison IV +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local effect = EFFECT_POISON; + local duration = 240; + + pINT = caster:getStat(MOD_INT); + mINT = target:getStat(MOD_INT); + + dINT = (pINT - mINT); + power = caster:getSkillLevel(ENFEEBLING_MAGIC_SKILL) / 8 + 1; + if power > 62 then + power = 62; + end + + if(math.random(0,100) >= target:getMod(MOD_POISONRES)) then + bonus = AffinityBonus(caster, spell); + resist = applyResistance(caster,spell,target,dINT,ENFEEBLING_MAGIC_SKILL,bonus); + if(resist == 1 or resist == 0.5) then -- effect taken + duration = duration / resist; + + -- Try to erase a weaker poison. + poison = target:getStatusEffect(effect) + if(poison ~= nil) then + if(poison:getPower() < power) then + -- remove weaker poison + target:delStatusEffect(effect); + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + end + + else -- resist entirely. + spell:setMsg(85); + end + else + spell:setMsg(284); + end + return effect; +end; \ No newline at end of file Index: scripts/globals/spells/poison_v.lua =================================================================== --- scripts/globals/spells/poison_v.lua (revision 0) +++ scripts/globals/spells/poison_v.lua (working copy) @@ -0,0 +1,59 @@ +----------------------------------------- +-- Spell: Poison V +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local effect = EFFECT_POISON; + local duration = 300; + + pINT = caster:getStat(MOD_INT); + mINT = target:getStat(MOD_INT); + + dINT = (pINT - mINT); + power = caster:getSkillLevel(ENFEEBLING_MAGIC_SKILL) / 3 + 1; + if power > 155 then + power = 155; + end + + if(math.random(0,100) >= target:getMod(MOD_POISONRES)) then + bonus = AffinityBonus(caster, spell); + resist = applyResistance(caster,spell,target,dINT,ENFEEBLING_MAGIC_SKILL,bonus); + if(resist == 1 or resist == 0.5) then -- effect taken + duration = duration / resist; + + -- Try to erase a weaker poison. + poison = target:getStatusEffect(effect) + if(poison ~= nil) then + if(poison:getPower() < power) then + -- remove weaker poison + target:delStatusEffect(effect); + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + end + + else -- resist entirely. + spell:setMsg(85); + end + else + spell:setMsg(284); + end + return effect; +end; \ No newline at end of file Index: scripts/globals/spells/poisonga.lua =================================================================== --- scripts/globals/spells/poisonga.lua (revision 3304) +++ scripts/globals/spells/poisonga.lua (working copy) @@ -32,10 +32,21 @@ if(resist == 1 or resist == 0.5) then -- effect taken duration = duration / resist; - if(target:addStatusEffect(effect,power,3,duration)) then + -- Try to erase a weaker poison. + poison = target:getStatusEffect(effect) + if(poison ~= nil) then + if(poison:getPower() < power) then + -- remove weaker poison + target:delStatusEffect(effect); + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + target:addStatusEffect(effect,power,3,duration); spell:setMsg(236); - else - spell:setMsg(75); end else -- resist entirely. Index: scripts/globals/spells/poisonga_ii.lua =================================================================== --- scripts/globals/spells/poisonga_ii.lua (revision 3304) +++ scripts/globals/spells/poisonga_ii.lua (working copy) @@ -15,7 +15,7 @@ function onSpellCast(caster,target,spell) local effect = EFFECT_POISON; - local duration = 60; + local duration = 90; pINT = caster:getStat(MOD_INT); mINT = target:getStat(MOD_INT); @@ -32,10 +32,21 @@ if(resist == 1 or resist == 0.5) then -- effect taken duration = duration / resist; - if(target:addStatusEffect(effect,power,3,duration)) then + -- Try to erase a weaker poison. + poison = target:getStatusEffect(effect) + if(poison ~= nil) then + if(poison:getPower() < power) then + -- remove weaker poison + target:delStatusEffect(effect); + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + target:addStatusEffect(effect,power,3,duration); spell:setMsg(236); - else - spell:setMsg(75); end else -- resist entirely. Index: scripts/globals/spells/poisonga_iii.lua =================================================================== --- scripts/globals/spells/poisonga_iii.lua (revision 3304) +++ scripts/globals/spells/poisonga_iii.lua (working copy) @@ -15,7 +15,7 @@ function onSpellCast(caster,target,spell) local effect = EFFECT_POISON; - local duration = 60; + local duration = 120; pINT = caster:getStat(MOD_INT); mINT = target:getStat(MOD_INT); @@ -32,10 +32,21 @@ if(resist == 1 or resist == 0.5) then -- effect taken duration = duration / resist; - if(target:addStatusEffect(effect,power,3,duration)) then + -- Try to erase a weaker poison. + poison = target:getStatusEffect(effect) + if(poison ~= nil) then + if(poison:getPower() < power) then + -- remove weaker poison + target:delStatusEffect(effect); + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + target:addStatusEffect(effect,power,3,duration); spell:setMsg(236); - else - spell:setMsg(75); end else -- resist entirely. Index: scripts/globals/spells/poisonga_iv.lua =================================================================== --- scripts/globals/spells/poisonga_iv.lua (revision 0) +++ scripts/globals/spells/poisonga_iv.lua (working copy) @@ -0,0 +1,59 @@ +----------------------------------------- +-- Spell: Poisonga IV +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local effect = EFFECT_POISON; + local duration = 150; + + pINT = caster:getStat(MOD_INT); + mINT = target:getStat(MOD_INT); + + dINT = (pINT - mINT); + local power = caster:getSkillLevel(ENFEEBLING_MAGIC_SKILL) / 10 + 1; + if power > 50 then + power = 50; + end + + if(math.random(0,100) >= target:getMod(MOD_POISONRES)) then + bonus = AffinityBonus(caster, spell); + resist = applyResistance(caster,spell,target,dINT,ENFEEBLING_MAGIC_SKILL,bonus); + if(resist == 1 or resist == 0.5) then -- effect taken + duration = duration / resist; + + -- Try to erase a weaker poison. + poison = target:getStatusEffect(effect) + if(poison ~= nil) then + if(poison:getPower() < power) then + -- remove weaker poison + target:delStatusEffect(effect); + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + end + + else -- resist entirely. + spell:setMsg(85); + end + else + spell:setMsg(284); + end + return effect; +end; \ No newline at end of file Index: scripts/globals/spells/poisonga_v.lua =================================================================== --- scripts/globals/spells/poisonga_v.lua (revision 0) +++ scripts/globals/spells/poisonga_v.lua (working copy) @@ -0,0 +1,59 @@ +----------------------------------------- +-- Spell: Poisonga V +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local effect = EFFECT_POISON; + local duration = 180; + + pINT = caster:getStat(MOD_INT); + mINT = target:getStat(MOD_INT); + + dINT = (pINT - mINT); + local power = caster:getSkillLevel(ENFEEBLING_MAGIC_SKILL) / 6 + 1; + if power > 80 then + power = 80; + end + + if(math.random(0,100) >= target:getMod(MOD_POISONRES)) then + bonus = AffinityBonus(caster, spell); + resist = applyResistance(caster,spell,target,dINT,ENFEEBLING_MAGIC_SKILL,bonus); + if(resist == 1 or resist == 0.5) then -- effect taken + duration = duration / resist; + + -- Try to erase a weaker poison. + poison = target:getStatusEffect(effect) + if(poison ~= nil) then + if(poison:getPower() < power) then + -- remove weaker poison + target:delStatusEffect(effect); + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + else + -- no effect + spell:setMsg(75); + end + else + target:addStatusEffect(effect,power,3,duration); + spell:setMsg(236); + end + + else -- resist entirely. + spell:setMsg(85); + end + else + spell:setMsg(284); + end + return effect; +end; \ No newline at end of file Index: scripts/globals/spells/protect.lua =================================================================== --- scripts/globals/spells/protect.lua (revision 3304) +++ scripts/globals/spells/protect.lua (working copy) @@ -8,14 +8,24 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local power = 15; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 2; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 2; + end + local typeEffect = EFFECT_PROTECT; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/protect_ii.lua =================================================================== --- scripts/globals/spells/protect_ii.lua (revision 3304) +++ scripts/globals/spells/protect_ii.lua (working copy) @@ -8,14 +8,24 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local power = 40; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 4; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 4; + end + local typeEffect = EFFECT_PROTECT; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/protect_iii.lua =================================================================== --- scripts/globals/spells/protect_iii.lua (revision 3304) +++ scripts/globals/spells/protect_iii.lua (working copy) @@ -8,14 +8,24 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local power = 75; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 6; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 6; + end + local typeEffect = EFFECT_PROTECT; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/protect_iv.lua =================================================================== --- scripts/globals/spells/protect_iv.lua (revision 3304) +++ scripts/globals/spells/protect_iv.lua (working copy) @@ -8,14 +8,24 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local power = 120; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 8; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 8; + end + local typeEffect = EFFECT_PROTECT; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/protect_v.lua =================================================================== --- scripts/globals/spells/protect_v.lua (revision 3304) +++ scripts/globals/spells/protect_v.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Protect IV +-- Spell: Protect V ----------------------------------------- require("scripts/globals/status"); @@ -16,6 +16,16 @@ local power = 175; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 10; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 10; + end + local typeEffect = EFFECT_PROTECT; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/protected_aria.lua =================================================================== --- scripts/globals/spells/protected_aria.lua (revision 0) +++ scripts/globals/spells/protected_aria.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- Spell: Protected Aria +-- Increases Charm Resistance to +-- Party Members within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + + power = power + (caster:getMod(MOD_ALL_SONGS) * 4); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_ARIA); + target:addStatusEffect(EFFECT_ARIA,power,0,duration); + spell:setMsg(230); + return EFFECT_ARIA; +end; \ No newline at end of file Index: scripts/globals/spells/protectra.lua =================================================================== --- scripts/globals/spells/protectra.lua (revision 3304) +++ scripts/globals/spells/protectra.lua (working copy) @@ -8,14 +8,24 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local power = 15; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 2; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 2; + end + local typeEffect = EFFECT_PROTECT; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/protectra_ii.lua =================================================================== --- scripts/globals/spells/protectra_ii.lua (revision 3304) +++ scripts/globals/spells/protectra_ii.lua (working copy) @@ -8,14 +8,24 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local power = 40; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 4; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 4; + end + local typeEffect = EFFECT_PROTECT; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/protectra_iii.lua =================================================================== --- scripts/globals/spells/protectra_iii.lua (revision 3304) +++ scripts/globals/spells/protectra_iii.lua (working copy) @@ -16,6 +16,16 @@ local power = 75; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 6; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 6; + end + local typeEffect = EFFECT_PROTECT; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/protectra_iv.lua =================================================================== --- scripts/globals/spells/protectra_iv.lua (revision 3304) +++ scripts/globals/spells/protectra_iv.lua (working copy) @@ -16,6 +16,13 @@ local power = 120; local duration = 1800; + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 8; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 8; + end + local typeEffect = EFFECT_PROTECT; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/protectra_v.lua =================================================================== --- scripts/globals/spells/protectra_v.lua (revision 3304) +++ scripts/globals/spells/protectra_v.lua (working copy) @@ -1,27 +1,44 @@ ----------------------------------------- --- Spell: Protectra V ------------------------------------------ - -require("scripts/globals/status"); - ------------------------------------------ --- OnSpellCast ------------------------------------------ - +-- Spell: Protectra IV +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + function OnMagicCastingCheck(caster,target,spell) return 0; end; -function onSpellCast(caster,target,spell) - local power = 175; - local duration = 1800; +function onSpellCast(caster,target,spell) + local power = 175 + if(caster:getObjType() == TYPE_PC) then + local power = 170 + (target:getMerit(MERIT_PROTECTRA_V)); + end + local duration = 1800; - local typeEffect = EFFECT_PROTECT; - if(target:addStatusEffect(typeEffect, power, 0, duration)) then - spell:setMsg(230); - else - spell:setMsg(75); -- no effect - end - - return typeEffect; -end; + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 10; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 10; + end + + local typeEffect = EFFECT_PROTECT; + if(target:hasStatusEffect(typeEffect) == true) then + local effect = target:getStatusEffect(typeEffect); + local cPower = effect:getPower(); + if(cPower > power) then + spell:setMsg(75); -- no effect + else + target:delStatusEffect(typeEffect); + target:addStatusEffect(typeEffect,power,0,duration); + end + else + target:addStatusEffect(typeEffect,power,0,duration); + end + + return typeEffect; +end; Index: scripts/globals/spells/puppets_operetta.lua =================================================================== --- scripts/globals/spells/puppets_operetta.lua (revision 0) +++ scripts/globals/spells/puppets_operetta.lua (working copy) @@ -0,0 +1,74 @@ +----------------------------------------- +-- Spell: Puppet's Opperetta +-- Increases Silence Resistance to +-- Party Members within target AoE +----------------------------------------- + +-- NOT USED see battleutils SingSong() for tier allotment + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + local sItem = caster:getEquipID(SLOT_RANGED); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + if(sItem == 18342 or sItem == 18577 or sItem == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + power = power + 4; + elseif(sItem == 18579 or sItem == 18580) then -- Gjallarhorn Lvl 90 - 95 + power = power + 6; + elseif(sItem == 18840 or sItem == 18572) then -- Gjallarhorn Lvl 99 - 99-2 + power = power + 8; + end + if (sItem == 18575) then -- Daurdabla Lvl 90 + duration = duration * 1.25; + elseif (sItem == 18576 or sItem == 18839 or sItem == 18571) then -- Daurdabla Lvl 95 - 99 - 99-2 + duration = duration * 1.3; + end + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_OPERETTA); + target:addStatusEffect(EFFECT_OPERETTA,1,0,duration); + spell:setMsg(230); + return EFFECT_OPERETTA; +end; \ No newline at end of file Index: scripts/globals/spells/quick_etude.lua =================================================================== --- scripts/globals/spells/quick_etude.lua (revision 0) +++ scripts/globals/spells/quick_etude.lua (working copy) @@ -0,0 +1,51 @@ +-------------------------------------- +-- Spell: Quick Etude +-- Boosts targets AGI stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + local duration = 120; + + if(enchanceSkill <180)then + power = 3 + elseif(enchanceSkill >=181 and enchanceSkill <=235)then + power = 4 + elseif(enchanceSkill >=236 and enchanceSkill <=288)then + power = 5 + elseif(enchanceSkill >=289 and enchanceSkill <=342)then + power = 6 + elseif(enchanceSkill >=343 and enchanceSkill <=396)then + power = 7 + elseif(enchanceSkill >=397 and enchanceSkill <=449)then + power = 8 + elseif(enchanceSkill >=450)then + power = 9 + else + power = 10 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_AGI_DOWN) == true) then + target:delStatusEffect(EFFECT_AGI_DOWN); + else + target:addStatusEffect(EFFECT_AGI_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/raiton_ichi.lua =================================================================== --- scripts/globals/spells/raiton_ichi.lua (revision 3304) +++ scripts/globals/spells/raiton_ichi.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_RAITON_EFFECT); + duration = 30 + caster:getMerit(MERIT_RAITON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_EARTHRES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_EARTHRES); return final; Index: scripts/globals/spells/raiton_ni.lua =================================================================== --- scripts/globals/spells/raiton_ni.lua (revision 3304) +++ scripts/globals/spells/raiton_ni.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_RAITON_EFFECT); + duration = 30 + caster:getMerit(MERIT_RAITON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_EARTHRES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_EARTHRES); return final; Index: scripts/globals/spells/raiton_san.lua =================================================================== --- scripts/globals/spells/raiton_san.lua (revision 3304) +++ scripts/globals/spells/raiton_san.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_RAITON_EFFECT); + duration = 30 + caster:getMerit(MERIT_RAITON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_EARTHRES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_EARTHRES); return final; Index: scripts/globals/spells/raptor_mazurka.lua =================================================================== --- scripts/globals/spells/raptor_mazurka.lua (revision 3304) +++ scripts/globals/spells/raptor_mazurka.lua (working copy) @@ -14,11 +14,19 @@ end; function onSpellCast(caster,target,spell) + local duration = 120; + local power = 12; - -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_MAZURKA) * 10)/100)); + + power = power + ((target:getMod(MOD_MAZURKA) + target:getMod(MOD_ALL_SONGS)) * 4); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. target:delStatusEffect(EFFECT_MAZURKA); - target:addStatusEffect(EFFECT_MAZURKA,12,0,120); + target:addStatusEffect(EFFECT_MAZURKA,power,0,duration); return EFFECT_MAZURKA; end; Index: scripts/globals/spells/refresh.lua =================================================================== --- scripts/globals/spells/refresh.lua (revision 3304) +++ scripts/globals/spells/refresh.lua (working copy) @@ -10,23 +10,34 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) - - mp = 3; + local back = target:getEquipID(SLOT_BACK); + mp = 3; duration = 150; if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (caster:getEquipID(SLOT_LEGS) == 11128) then -- Estoqueurs Fuseau +2 + mp = mp + 1; + end + if (target:getMainLvl() < 41) then duration = duration * target:getMainLvl() / 41; end + if (back == 11575) then -- Grapevine Cape + duration = duration + 30; + end + target:delStatusEffect(EFFECT_REFRESH); target:addStatusEffect(EFFECT_REFRESH,mp,3,duration); Index: scripts/globals/spells/refresh_ii.lua =================================================================== --- scripts/globals/spells/refresh_ii.lua (revision 0) +++ scripts/globals/spells/refresh_ii.lua (working copy) @@ -0,0 +1,41 @@ +----------------------------------------- +-- Spell: Refresh II +-- Gradually restores target party member's MP +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + local back = target:getEquipID(SLOT_BACK); + mp = 6; + duration = 180; + + + if (target:getMainLvl() < 41) then + duration = duration * target:getMainLvl() / 41; + end + + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (back == 11575) then -- Grapevine Cape + duration = duration + 30; + end + if (caster:getEquipID(SLOT_LEGS) == 11128) then -- Estoqueurs Fuseau +2 + mp = mp + 2; + end + + target:delStatusEffect(EFFECT_REFRESH); + target:addStatusEffect(EFFECT_REFRESH,mp,3,duration); + return 0; + +end; \ No newline at end of file Index: scripts/globals/spells/regen.lua =================================================================== --- scripts/globals/spells/regen.lua (revision 3304) +++ scripts/globals/spells/regen.lua (working copy) @@ -13,24 +13,50 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) hp = 5; - - body = caster:getEquipID(SLOT_BODY); + local body = caster:getEquipID(SLOT_BODY); + local head = caster:getEquipID(SLOT_HEAD); + local hands = caster:getEquipID(SLOT_HANDS); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + merit = caster:getMerit(MERIT_REGEN_EFFECT); + if(job == JOB_WHM or sjob == JOB_WHM) then + if(merit > 0) then + hp = hp + merit; + end + end + + if (body == 15089 or body == 14502) then hp = hp+1; + elseif (body == 10672) then + hp = hp+2; end + if (head == 11083) then + hp = hp+1; + end duration = 75; if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (hands == 11206) then + duration = duration + 10; + elseif (hands == 11106) then + duration = duration + 15; + end + if (target:getMainLvl() < 21) then duration = duration * target:getMainLvl() / 21; end @@ -42,4 +68,5 @@ end return EFFECT_REGEN; + end; end; \ No newline at end of file Index: scripts/globals/spells/regen_ii.lua =================================================================== --- scripts/globals/spells/regen_ii.lua (revision 3304) +++ scripts/globals/spells/regen_ii.lua (working copy) @@ -13,18 +13,35 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) hp = 12; - - body = caster:getEquipID(SLOT_BODY); + local body = caster:getEquipID(SLOT_BODY); + local head = caster:getEquipID(SLOT_HEAD); + local hands = caster:getEquipID(SLOT_HANDS); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + merit = caster:getMerit(MERIT_REGEN_EFFECT); + if(job == JOB_WHM or sjob == JOB_WHM) then + if(merit > 0) then + hp = hp + merit; + end + end + + if (body == 15089 or body == 14502) then hp = hp+2; + elseif (body == 10672) then + hp = hp+3; end + if (head == 11083) then + hp = hp+2; + end duration = 60; @@ -32,6 +49,15 @@ duration = duration * target:getMainLvl() / 66; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (hands == 11206) then + duration = duration + 10; + elseif (hands == 11106) then + duration = duration + 15; + end + if(target:addStatusEffect(EFFECT_REGEN,hp,3,duration)) then spell:setMsg(230); else @@ -39,4 +65,5 @@ end return EFFECT_REGEN; + end; end; \ No newline at end of file Index: scripts/globals/spells/regen_iii.lua =================================================================== --- scripts/globals/spells/regen_iii.lua (revision 3304) +++ scripts/globals/spells/regen_iii.lua (working copy) @@ -20,14 +20,36 @@ function onSpellCast(caster,target,spell) hp = 20; - - body = caster:getEquipID(SLOT_BODY); + local body = caster:getEquipID(SLOT_BODY); + local head = caster:getEquipID(SLOT_HEAD); + local hands = caster:getEquipID(SLOT_HANDS); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + merit = caster:getMerit(MERIT_REGEN_EFFECT); + if(job == JOB_WHM or sjob == JOB_WHM) then + if(merit > 0) then + hp = hp + merit; + end + end + if (body == 15089 or body == 14502) then hp = hp+3; + elseif (body == 10672) then + hp = hp+5; end + if (head == 11083) then + hp = hp+3; + end duration = 60; + if (hands == 11206) then + duration = duration + 10; + elseif (hands == 11106) then + duration = duration + 15; + end + if (target:getMainLvl() < 21) then duration = duration * target:getMainLvl() / 21; end @@ -35,8 +57,9 @@ if(target:addStatusEffect(EFFECT_REGEN,hp,3,duration)) then spell:setMsg(230); else - spell:setMsg(75); -- no effect - end + spell:setMsg(75); -- no effect + end return EFFECT_REGEN; + end; end; \ No newline at end of file Index: scripts/globals/spells/regen_iv.lua =================================================================== --- scripts/globals/spells/regen_iv.lua (revision 0) +++ scripts/globals/spells/regen_iv.lua (working copy) @@ -0,0 +1,65 @@ +----------------------------------------- +-- Spell: Regen IV +-- Gradually restores target's HP. +----------------------------------------- +-- Cleric's Briault enhances the effect +-- Scale down duration based on level +-- Composure increases duration 3x +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + hp = 30; + local body = caster:getEquipID(SLOT_BODY); + local head = caster:getEquipID(SLOT_HEAD); + local hands = caster:getEquipID(SLOT_HANDS); + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + merit = caster:getMerit(MERIT_REGEN_EFFECT); + if(job == JOB_WHM or sjob == JOB_WHM) then + if(merit > 0) then + hp = hp + merit; + end + end + + if (body == 15089 or body == 14502) then + hp = hp+4; + elseif (body == 10672) then + hp = hp+7; + end + if (head == 11083) then + hp = hp+4; + end + + duration = 60; + + if (hands == 11206) then + duration = duration + 10; + elseif (hands == 11106) then + duration = duration + 15; + end + + if (target:getMainLvl() < 21) then + duration = duration * target:getMainLvl() / 21; + end + + if(target:addStatusEffect(EFFECT_REGEN,hp,3,duration)) then + spell:setMsg(230); + else + spell:setMsg(75); -- no effect + end + + return EFFECT_REGEN; + end; +end; \ No newline at end of file Index: scripts/globals/spells/regen_v.lua =================================================================== --- scripts/globals/spells/regen_v.lua (revision 0) +++ scripts/globals/spells/regen_v.lua (working copy) @@ -0,0 +1,59 @@ +----------------------------------------- +-- Spell: Regen V +-- Gradually restores target's HP. +----------------------------------------- +-- Cleric's Briault enhances the effect +-- Scale down duration based on level +-- Composure increases duration 3x +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + hp = 40; + local head = caster:getEquipID(SLOT_HEAD); + local body = caster:getEquipID(SLOT_BODY); + + if(caster:getObjType() == TYPE_PC) then + local job = caster:getMainJob(); + local sjob = caster:getSubJob(); + merit = caster:getMerit(MERIT_REGEN_EFFECT); + if(job == JOB_WHM or sjob == JOB_WHM) then + if(merit > 0) then + hp = hp + merit; + end + end + + if (body == 15089 or body == 14502) then + hp = hp+4; + elseif (body == 10672) then + hp = hp+7; + end + if (head == 11083) then + hp = hp+5; + end + + duration = 60; + + if (target:getMainLvl() < 21) then + duration = duration * target:getMainLvl() / 21; + end + + if(target:addStatusEffect(EFFECT_REGEN,hp,3,duration)) then + spell:setMsg(230); + else + spell:setMsg(75); -- no effect + end + + return EFFECT_REGEN; + end; +end; \ No newline at end of file Index: scripts/globals/spells/reprisal.lua =================================================================== --- scripts/globals/spells/reprisal.lua (revision 3304) +++ scripts/globals/spells/reprisal.lua (working copy) @@ -13,8 +13,10 @@ end; function onSpellCast(caster,target,spell) + + local shield = caster:getEquipID(SLOT_SUB); duration = 60; - local typeEffect = EFFECT_REPRISAL; + local typeEffect = EFFECT_REPRISAL; if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; end @@ -25,11 +27,14 @@ -- totally guessing local power = ((int + 10) / 20 + 2) * (1 + (magicAtk / 100)); - if(target:addStatusEffect(typeEffect,power,0,duration)) then - spell:setMsg(230); - else - spell:setMsg(75); - end + if (shield == 10806) then -- Adamas + power = power * 1.5; + if(target:addStatusEffect(typeEffect,power,0,duration)) then + spell:setMsg(230); + else + spell:setMsg(75); + end + return typeEffect; end; Index: scripts/globals/spells/reraise_iii.lua =================================================================== --- scripts/globals/spells/reraise_iii.lua (revision 3304) +++ scripts/globals/spells/reraise_iii.lua (working copy) @@ -1,5 +1,6 @@ ----------------------------------------- -- Spell: Reraise 3 +-- Durration: 1 Hr ----------------------------------------- require("scripts/globals/status"); @@ -13,9 +14,8 @@ end; function onSpellCast(caster,target,spell) - --duration = 1800; target:delStatusEffect(EFFECT_RERAISE); - target:addStatusEffect(EFFECT_RERAISE,3,0,3600); --reraise 3, 30min duration + target:addStatusEffect(EFFECT_RERAISE,3,0,3600); --reraise 3, 1 hr duration return EFFECT_RERAISE; end; Index: scripts/globals/spells/sage_etude.lua =================================================================== --- scripts/globals/spells/sage_etude.lua (revision 0) +++ scripts/globals/spells/sage_etude.lua (working copy) @@ -0,0 +1,45 @@ +-------------------------------------- +-- Spell: Sage Etude +-- Boosts targets INT stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + local duration = 120; + + if(enchanceSkill <416)then + power = 12 + elseif(enchanceSkill >=417 and enchanceSkill <=445)then + power = 13 + elseif(enchanceSkill >=446 and enchanceSkill <=474)then + power = 14 + elseif(enchanceSkill >=475)then + power = 15 + else + power = 15 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_INT_DOWN) == true) then + target:delStatusEffect(EFFECT_INT_DOWN); + else + target:addStatusEffect(EFFECT_INT_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/scops_operetta.lua =================================================================== --- scripts/globals/spells/scops_operetta.lua (revision 0) +++ scripts/globals/spells/scops_operetta.lua (working copy) @@ -0,0 +1,74 @@ +----------------------------------------- +-- Spell: Jester's Opperetta +-- Increases Silence Resistance to +-- Party Members within target AoE +----------------------------------------- + +-- NOT USED see battleutils SingSong() for tier allotment + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 60; + local sItem = caster:getEquipID(SLOT_RANGED); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + if(sItem == 18342 or sItem == 18577 or sItem == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + power = power + 4; + elseif(sItem == 18579 or sItem == 18580) then -- Gjallarhorn Lvl 90 - 95 + power = power + 6; + elseif(sItem == 18840 or sItem == 18572) then -- Gjallarhorn Lvl 99 - 99-2 + power = power + 8; + end + if (sItem == 18575) then -- Daurdabla Lvl 90 + duration = duration * 1.25; + elseif (sItem == 18576 or sItem == 18839 or sItem == 18571) then -- Daurdabla Lvl 95 - 99 - 99-2 + duration = duration * 1.3; + end + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_OPERETTA); + target:addStatusEffect(EFFECT_OPERETTA,3,0,duration); + spell:setMsg(230); + return EFFECT_OPERETTA; +end; \ No newline at end of file Index: scripts/globals/spells/sentinels_scherzo.lua =================================================================== --- scripts/globals/spells/sentinels_scherzo.lua (revision 0) +++ scripts/globals/spells/sentinels_scherzo.lua (working copy) @@ -0,0 +1,35 @@ +----------------------------------------- +-- Spell: Sentinel's Scherzo +-- Mitigates severly damaging attacks to +-- Party Members within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + duration = duration + (duration * (target:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((target:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((target:getMod(MOD_SCHERZO) * 10)/100)); + + power = power + (target:getMod(MOD_SCHERZO) * 5); + power = power + (target:getMod(MOD_ALL_SONGS) * 5); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_SCHERZO); + target:addStatusEffect(EFFECT_SCHERZO,power,0,duration); + spell:setMsg(230); + return EFFECT_SCHERZO; +end; \ No newline at end of file Index: scripts/globals/spells/sheepfoe_mambo.lua =================================================================== --- scripts/globals/spells/sheepfoe_mambo.lua (revision 3304) +++ scripts/globals/spells/sheepfoe_mambo.lua (working copy) @@ -14,16 +14,43 @@ end; function onSpellCast(caster,target,spell) + local duration = 120; + local sItem = caster:getEquipID(2); + local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end - local sItem = caster:getEquipID(2); - local sLvl = caster:getSkillLevel(SINGING_SKILL); -- Gets skill level of Singing - - -- TODO: mambo bonus - -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. target:delStatusEffect(EFFECT_MAMBO); - target:addStatusEffect(EFFECT_MAMBO,1,0,120); + target:addStatusEffect(EFFECT_MAMBO,1,0,duration); spell:setMsg(230); return EFFECT_MAMBO; end; \ No newline at end of file Index: scripts/globals/spells/shell.lua =================================================================== --- scripts/globals/spells/shell.lua (revision 3304) +++ scripts/globals/spells/shell.lua (working copy) @@ -8,14 +8,24 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local power = 24; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 5; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 5; + end + local typeEffect = EFFECT_SHELL; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/shell_ii.lua =================================================================== --- scripts/globals/spells/shell_ii.lua (revision 3304) +++ scripts/globals/spells/shell_ii.lua (working copy) @@ -8,14 +8,24 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local power = 36; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 4; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 4; + end + local typeEffect = EFFECT_SHELL; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/shell_iii.lua =================================================================== --- scripts/globals/spells/shell_iii.lua (revision 3304) +++ scripts/globals/spells/shell_iii.lua (working copy) @@ -8,14 +8,24 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local power = 48; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 3; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 3; + end + local typeEffect = EFFECT_SHELL; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/shell_iv.lua =================================================================== --- scripts/globals/spells/shell_iv.lua (revision 3304) +++ scripts/globals/spells/shell_iv.lua (working copy) @@ -8,14 +8,24 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local power = 56; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 2; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 2; + end + local typeEffect = EFFECT_SHELL; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/shell_v.lua =================================================================== --- scripts/globals/spells/shell_v.lua (revision 3304) +++ scripts/globals/spells/shell_v.lua (working copy) @@ -16,6 +16,16 @@ local power = 62; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 1; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 1; + end + local typeEffect = EFFECT_SHELL; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/shellra.lua =================================================================== --- scripts/globals/spells/shellra.lua (revision 3304) +++ scripts/globals/spells/shellra.lua (working copy) @@ -8,14 +8,24 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local power = 24; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 5; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 5; + end + local typeEffect = EFFECT_SHELL; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/shellra_ii.lua =================================================================== --- scripts/globals/spells/shellra_ii.lua (revision 3304) +++ scripts/globals/spells/shellra_ii.lua (working copy) @@ -16,6 +16,16 @@ local power = 36; local duration = 1800; + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 4; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 4; + end + local typeEffect = EFFECT_SHELL; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/shellra_iii.lua =================================================================== --- scripts/globals/spells/shellra_iii.lua (revision 3304) +++ scripts/globals/spells/shellra_iii.lua (working copy) @@ -16,6 +16,13 @@ local power = 48; local duration = 1800; + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 3; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 3; + end + local typeEffect = EFFECT_SHELL; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/shellra_iv.lua =================================================================== --- scripts/globals/spells/shellra_iv.lua (revision 3304) +++ scripts/globals/spells/shellra_iv.lua (working copy) @@ -16,6 +16,13 @@ local power = 56; local duration = 1800; + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 2; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 2; + end + local typeEffect = EFFECT_SHELL; if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); Index: scripts/globals/spells/shellra_v.lua =================================================================== --- scripts/globals/spells/shellra_v.lua (revision 3304) +++ scripts/globals/spells/shellra_v.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Shellra +-- Spell: Shellra IV ----------------------------------------- require("scripts/globals/status"); @@ -13,14 +13,24 @@ end; function onSpellCast(caster,target,spell) - local power = 62; - local duration = 1800; + local power = 62; + if(caster:getObjType() == TYPE_PC) then + local power = 62 + (target:getMerit(MERIT_SHELLRA_V)); + end + local duration = 1800; - local typeEffect = EFFECT_SHELL; - if(target:addStatusEffect(typeEffect, power, 0, duration)) then + if (target:getEquipID(SLOT_EAR1) == 11039 or target:getEquipID(SLOT_EAR2) == 11039) then -- Brachyura Earring + power = power + 1; + end + if (target:getEquipID(SLOT_RING1) == 10764 or target:getEquipID(SLOT_RING2) == 10764) then -- Sheltered Ring + power = power + 1; + end + + local typeEffect = EFFECT_SHELL; + if(target:addStatusEffect(typeEffect, power, 0, duration)) then spell:setMsg(230); else spell:setMsg(75); -- no effect end - return typeEffect; + return typeEffect; end; Index: scripts/globals/spells/shining_fantasia.lua =================================================================== --- scripts/globals/spells/shining_fantasia.lua (revision 0) +++ scripts/globals/spells/shining_fantasia.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- Spell: Shining Fantasia +-- Increases Blindness Resistance to +-- Party Members within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + + power = power + (caster:getMod(MOD_ALL_SONGS) * 4); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_FANTASIA); + target:addStatusEffect(EFFECT_FANTASIA,power,0,duration); + spell:setMsg(230); + return EFFECT_FANTASIA; +end; \ No newline at end of file Index: scripts/globals/spells/shock_spikes.lua =================================================================== --- scripts/globals/spells/shock_spikes.lua (revision 3304) +++ scripts/globals/spells/shock_spikes.lua (working copy) @@ -8,22 +8,35 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) local duration = SPIKE_EFFECT_DURATION; - - local typeEffect = EFFECT_SHOCK_SPIKES; + local legs = caster:getEquipID(SLOT_LEGS); + local typeEffect = EFFECT_SHOCK_SPIKES; + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + local int = caster:getStat(MOD_INT); local magicAtk = caster:getMod(MOD_MATT); local power = ((int + 10) / 20 + 2) * (1 + (magicAtk / 100)); + -- Equipment Bonus Amount + if (legs == 15622) then -- Mercenarys Trousers + power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)) + (int * (4/256)); + elseif (legs == 15121 or legs == 15584) then -- Duelist Tights & +1 + power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)) + (int * (6/256)); + elseif (legs == 10714) then -- Duelist Tights +2 + power = ((int + 2) / 12 + 4) * (1 + (magicAtk / 100)) + (int * (8/256)); + end + if(target:addStatusEffect(typeEffect,power,0,duration)) then spell:setMsg(230); else Index: scripts/globals/spells/silence.lua =================================================================== --- scripts/globals/spells/silence.lua (revision 3304) +++ scripts/globals/spells/silence.lua (working copy) @@ -17,6 +17,10 @@ --Pull base stats. dINT = (caster:getStat(MOD_MND) - target:getStat(MOD_MND)); bonus = AffinityBonus(caster,spell); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + bonus = bonus * 1.1; + end --Duration, including resistance. May need more research. duration = 180; Index: scripts/globals/spells/silencega.lua =================================================================== --- scripts/globals/spells/silencega.lua (revision 0) +++ scripts/globals/spells/silencega.lua (working copy) @@ -0,0 +1,50 @@ +----------------------------------------- +-- Spell: Silencega +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local effectType = EFFECT_SILENCE; + + --Pull base stats. + dINT = (caster:getStat(MOD_MND) - target:getStat(MOD_MND)); + bonus = AffinityBonus(caster,spell); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + bonus = bonus * 1.1; + end + + --Duration, including resistance. May need more research. + duration = 180; + + --Resist + resist = applyResistance(caster,spell,target,dINT,35,bonus); + + if(target:hasStatusEffect(effectType)) then + spell:setMsg(75); -- no effect + return effectType; + end + + if(100 * math.random() >= target:getMod(MOD_SILENCERES)) then + if(resist >= 0.5) then --Do it! + target:addStatusEffect(effectType,1,0,duration * resist); + spell:setMsg(236); + else + spell:setMsg(85); + end + else + spell:setMsg(85); -- resist + end + + + return effectType; + +end; \ No newline at end of file Index: scripts/globals/spells/sinewy_etude.lua =================================================================== --- scripts/globals/spells/sinewy_etude.lua (revision 0) +++ scripts/globals/spells/sinewy_etude.lua (working copy) @@ -0,0 +1,51 @@ +-------------------------------------- +-- Spell: Sinewy Etude +-- Boosts targets STR stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + local duration = 120; + + if(enchanceSkill <180)then + power = 3 + elseif(enchanceSkill >=181 and enchanceSkill <=235)then + power = 4 + elseif(enchanceSkill >=236 and enchanceSkill <=288)then + power = 5 + elseif(enchanceSkill >=289 and enchanceSkill <=342)then + power = 6 + elseif(enchanceSkill >=343 and enchanceSkill <=396)then + power = 7 + elseif(enchanceSkill >=397 and enchanceSkill <=449)then + power = 8 + elseif(enchanceSkill >=450)then + power = 9 + else + power = 10 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_STR_DOWN) == true) then + target:delStatusEffect(EFFECT_STR_DOWN); + else + target:addStatusEffect(EFFECT_STR_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/sleep.lua =================================================================== --- scripts/globals/spells/sleep.lua (revision 3304) +++ scripts/globals/spells/sleep.lua (working copy) @@ -14,6 +14,10 @@ function onSpellCast(caster,target,spell) duration = 60; bonus = AffinityBonus(caster, spell); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + bonus = bonus * 1.1; + end pINT = caster:getStat(MOD_INT); mINT = target:getStat(MOD_INT); dINT = (pINT - mINT); Index: scripts/globals/spells/sleep_ii.lua =================================================================== --- scripts/globals/spells/sleep_ii.lua (revision 3304) +++ scripts/globals/spells/sleep_ii.lua (working copy) @@ -15,6 +15,10 @@ duration = 90; local typeEffect = EFFECT_SLEEP_II; bonus = AffinityBonus(caster, spell); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + bonus = bonus * 1.1; + end pINT = caster:getStat(MOD_INT); mINT = target:getStat(MOD_INT); dINT = (pINT - mINT); Index: scripts/globals/spells/sleepga.lua =================================================================== --- scripts/globals/spells/sleepga.lua (revision 3304) +++ scripts/globals/spells/sleepga.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Sleep I +-- Spell: Sleepga ----------------------------------------- require("scripts/globals/status"); require("scripts/globals/magic"); @@ -14,6 +14,10 @@ function onSpellCast(caster,target,spell) duration = 60; bonus = AffinityBonus(caster, spell); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + bonus = bonus * 1.1; + end pINT = caster:getStat(MOD_INT); mINT = target:getStat(MOD_INT); dINT = (pINT - mINT); Index: scripts/globals/spells/sleepga_ii.lua =================================================================== --- scripts/globals/spells/sleepga_ii.lua (revision 3304) +++ scripts/globals/spells/sleepga_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Sleep II +-- Spell: Sleepga II ----------------------------------------- require("scripts/globals/status"); require("scripts/globals/magic"); @@ -15,6 +15,10 @@ duration = 90; local typeEffect = EFFECT_SLEEP_II; bonus = AffinityBonus(caster, spell); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + bonus = bonus * 1.1; + end pINT = caster:getStat(MOD_INT); mINT = target:getStat(MOD_INT); dINT = (pINT - mINT); Index: scripts/globals/spells/slow.lua =================================================================== --- scripts/globals/spells/slow.lua (revision 3304) +++ scripts/globals/spells/slow.lua (working copy) @@ -26,6 +26,10 @@ if(power > 300) then power = 300; end + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end --Duration, including resistance. duration = 120 * applyResistance(caster,spell,target,dMND,35,bonus); Index: scripts/globals/spells/slow_ii.lua =================================================================== --- scripts/globals/spells/slow_ii.lua (revision 3304) +++ scripts/globals/spells/slow_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Slow +-- Spell: Slow II -- Spell accuracy is most highly affected by Enfeebling Magic Skill, Magic Accuracy, and MND. -- Slow's potency is calculated with the formula (150 + dMND*2)/1024, and caps at 300/1024 (~29.3%). -- And MND of 75 is neccessary to reach the hardcap of Slow. @@ -28,6 +28,10 @@ if(potency > 350) then potency = 350; end + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + potency = potency * 1.1; + end local merits = caster:getMerit(MERIT_SLOW_II); --Power. Index: scripts/globals/spells/slowga.lua =================================================================== --- scripts/globals/spells/slowga.lua (revision 0) +++ scripts/globals/spells/slowga.lua (working copy) @@ -0,0 +1,53 @@ +----------------------------------------- +-- Spell: Slowga +-- Spell accuracy is most highly affected by Enfeebling Magic Skill, Magic Accuracy, and MND. +-- Slow's potency is calculated with the formula (150 + dMND*2)/1024, and caps at 300/1024 (~29.3%). +-- And MND of 75 is neccessary to reach the hardcap of Slow. +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + dMND = (caster:getStat(MOD_MND) - target:getStat(MOD_MND)); + bonus = AffinityBonus(caster,spell); + + --Power. + power = 150 + dMND * 2; + if(power > 300) then + power = 300; + end + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end + + --Duration, including resistance. + duration = 120 * applyResistance(caster,spell,target,dMND,35,bonus); + if(100 * math.random() >= target:getMod(MOD_SLOWRES)) then + if(duration >= 60) then --Do it! + + if(target:addStatusEffect(EFFECT_SLOW,power,0,duration)) then + spell:setMsg(236); + else + spell:setMsg(75); + end + + else + spell:setMsg(85); + end + else + spell:setMsg(85); + end + + return EFFECT_SLOW; +end; \ No newline at end of file Index: scripts/globals/spells/sneak.lua =================================================================== --- scripts/globals/spells/sneak.lua (revision 3304) +++ scripts/globals/spells/sneak.lua (working copy) @@ -17,7 +17,6 @@ function onSpellCast(caster,target,spell) if (target:hasStatusEffect(EFFECT_SNEAK) == false) then - local duration = math.random(30, 300); if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; @@ -26,9 +25,12 @@ if (target:getMainLvl() < 20) then duration = duration * target:getMainLvl() / 20; -- level adjustment end - if (target:getEquipID(SLOT_BACK) == 13692) then -- skulker's cape - duration = duration * 1.5; - end + -- Equip Mods + duration = duration + (duration * target:getMod(MOD_SNEAK_DUR)); + + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + spell:setMsg(230); target:addStatusEffect(EFFECT_SNEAK,0,10,(math.floor(duration) * SNEAK_INVIS_DURATION_MULTIPLIER)); else Index: scripts/globals/spells/spirited_etude.lua =================================================================== --- scripts/globals/spells/spirited_etude.lua (revision 0) +++ scripts/globals/spells/spirited_etude.lua (working copy) @@ -0,0 +1,51 @@ +-------------------------------------- +-- Spell: Spirited Etude +-- Boosts targets MND stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + local duration = 120; + + if(enchanceSkill <180)then + power = 3 + elseif(enchanceSkill >=181 and enchanceSkill <=235)then + power = 4 + elseif(enchanceSkill >=236 and enchanceSkill <=288)then + power = 5 + elseif(enchanceSkill >=289 and enchanceSkill <=342)then + power = 6 + elseif(enchanceSkill >=343 and enchanceSkill <=396)then + power = 7 + elseif(enchanceSkill >=397 and enchanceSkill <=449)then + power = 8 + elseif(enchanceSkill >=450)then + power = 9 + else + power = 10 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_MND_DOWN) == true) then + target:delStatusEffect(EFFECT_MND_DOWN); + else + target:addStatusEffect(EFFECT_MND_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/stone.lua =================================================================== --- scripts/globals/spells/stone.lua (revision 3304) +++ scripts/globals/spells/stone.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- --- Spell: Fire --- Deals fire damage to an enemy. +-- Spell: Stone +-- Deals earth damage to an enemy. ----------------------------------------- require("scripts/globals/magic"); Index: scripts/globals/spells/stone_ii.lua =================================================================== --- scripts/globals/spells/stone_ii.lua (revision 3304) +++ scripts/globals/spells/stone_ii.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- --- Spell: Fire --- Deals fire damage to an enemy. +-- Spell: Stone II +-- Deals earth damage to an enemy. ----------------------------------------- require("scripts/globals/magic"); Index: scripts/globals/spells/stone_iii.lua =================================================================== --- scripts/globals/spells/stone_iii.lua (revision 3304) +++ scripts/globals/spells/stone_iii.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- --- Spell: Fire --- Deals fire damage to an enemy. +-- Spell: Stone III +-- Deals earth damage to an enemy. ----------------------------------------- require("scripts/globals/magic"); Index: scripts/globals/spells/stone_iv.lua =================================================================== --- scripts/globals/spells/stone_iv.lua (revision 3304) +++ scripts/globals/spells/stone_iv.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- --- Spell: Fire --- Deals fire damage to an enemy. +-- Spell: Stone IV +-- Deals earth damage to an enemy. ----------------------------------------- require("scripts/globals/magic"); Index: scripts/globals/spells/stone_v.lua =================================================================== --- scripts/globals/spells/stone_v.lua (revision 3304) +++ scripts/globals/spells/stone_v.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- --- Spell: Fire --- Deals fire damage to an enemy. +-- Spell: Stone V +-- Deals earth damage to an enemy. ----------------------------------------- require("scripts/globals/magic"); Index: scripts/globals/spells/stonega_ii.lua =================================================================== --- scripts/globals/spells/stonega_ii.lua (revision 3304) +++ scripts/globals/spells/stonega_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Stonega 2 +-- Spell: Stonega II -- Deals earth damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/stonega_iii.lua =================================================================== --- scripts/globals/spells/stonega_iii.lua (revision 3304) +++ scripts/globals/spells/stonega_iii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Stonega 3 +-- Spell: Stonega III -- Deals earth damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/stonega_iv.lua =================================================================== --- scripts/globals/spells/stonega_iv.lua (revision 0) +++ scripts/globals/spells/stonega_iv.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Stonega IV +-- Deals earth damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(667,2,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/stonega_v.lua =================================================================== --- scripts/globals/spells/stonega_v.lua (revision 0) +++ scripts/globals/spells/stonega_v.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Stonega V +-- Deals earth damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(868,2.3,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/stoneskin.lua =================================================================== --- scripts/globals/spells/stoneskin.lua (revision 3304) +++ scripts/globals/spells/stoneskin.lua (working copy) @@ -11,14 +11,14 @@ -- OnSpellCast ----------------------------------------- -function OnMagicCastingCheck(caster,target,spell) - return 0; -end; - +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + function onSpellCast(caster,target,spell) pMod = (caster:getSkillLevel(ENHANCING_MAGIC_SKILL)/3)+caster:getStat(MOD_MND); pAbs = 0; - pEquipMods = 0; + pEquipMods = caster:getMod(MOD_STONESKIN_HP); duration = 300; if (pMod < 80) then pAbs = pMod; @@ -30,24 +30,13 @@ if (pAbs > STONESKIN_CAP) then -- hard cap of 350 from natural power pAbs = STONESKIN_CAP; end - -- equipment mods - if (caster:getEquipID(SLOT_NECK) == 13177) then -- stone gorget - pEquipMods = pEquipMods + 30; - end - if (caster:getEquipID(SLOT_HANDS) == 15034) then -- stone mufflers - pEquipMods = pEquipMods + 30; - end - if (caster:getEquipID(SLOT_WAIST) == 15960) then -- siegel sash - pEquipMods = pEquipMods + 20; - end - if (caster:getEquipID(SLOT_LEGS) == 11949) then -- haven hose - pEquipMods = pEquipMods + 20; - end if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then duration = duration * 3; end + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); final = pAbs + pEquipMods; if(target:addStatusEffect(EFFECT_STONESKIN,final,0,duration)) then Index: scripts/globals/spells/stun.lua =================================================================== --- scripts/globals/spells/stun.lua (revision 3304) +++ scripts/globals/spells/stun.lua (working copy) @@ -31,5 +31,5 @@ spell:setMsg(236); end - return EFFECT_STUN; + return 0; end; \ No newline at end of file Index: scripts/globals/spells/suiton_ichi.lua =================================================================== --- scripts/globals/spells/suiton_ichi.lua (revision 3304) +++ scripts/globals/spells/suiton_ichi.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_SUITON_EFFECT); + duration = 30 + caster:getMerit(MERIT_SUITON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_THUNDERRES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_THUNDERRES); return final; Index: scripts/globals/spells/suiton_ni.lua =================================================================== --- scripts/globals/spells/suiton_ni.lua (revision 3304) +++ scripts/globals/spells/suiton_ni.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_SUITON_EFFECT); + duration = 30 + caster:getMerit(MERIT_SUITON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_THUNDERRES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_THUNDERRES); return final; Index: scripts/globals/spells/suiton_san.lua =================================================================== --- scripts/globals/spells/suiton_san.lua (revision 3304) +++ scripts/globals/spells/suiton_san.lua (working copy) @@ -22,20 +22,19 @@ --get the resisted damage dmg = dmg*resist; --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) - -- boost ninjitsu damage - -- 5% ninjitsu damage - local head = caster:getEquipID(SLOT_HEAD); - if(head == 15084) then - dmg = math.floor(dmg * 1.05); - end + dmg = addBonuses(caster,spell,target,dmg); - dmg = addBonuses(caster,spell,target,dmg); + duration = 30; + if(caster:getObjType() == TYPE_PC) then + dmg = dmg + caster:getMerit(MERIT_SUITON_EFFECT); + duration = 30 + caster:getMerit(MERIT_SUITON_EFFECT); + end --add in target adjustment dmg = adjustForTarget(target,dmg); --add in final adjustments including the actual damage dealt final = finalMagicAdjustments(caster,target,spell,dmg); - handleNinjutsuDebuff(caster, target, spell, 30, 15, MOD_THUNDERRES); + handleNinjutsuDebuff(caster, target, spell, duration, 15, MOD_THUNDERRES); return final; Index: scripts/globals/spells/swift_etude.lua =================================================================== --- scripts/globals/spells/swift_etude.lua (revision 0) +++ scripts/globals/spells/swift_etude.lua (working copy) @@ -0,0 +1,45 @@ +-------------------------------------- +-- Spell: Swift Etude +-- Boosts targets AGI stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + local duration = 120; + + if(enchanceSkill <416)then + power = 12 + elseif(enchanceSkill >=417 and enchanceSkill <=445)then + power = 13 + elseif(enchanceSkill >=446 and enchanceSkill <=474)then + power = 14 + elseif(enchanceSkill >=475)then + power = 15 + else + power = 15 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_AGI_DOWN) == true) then + target:delStatusEffect(EFFECT_AGI_DOWN); + else + target:addStatusEffect(EFFECT_AGI_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/sword_madrigal.lua =================================================================== --- scripts/globals/spells/sword_madrigal.lua (revision 3304) +++ scripts/globals/spells/sword_madrigal.lua (working copy) @@ -17,20 +17,68 @@ local acc = caster:getSkillLevel(SINGING_SKILL) / 16 + 1; local sItem = caster:getEquipID(2); + local head = caster:getEquipID(SLOT_HEAD); local duration = 120; if(acc > 15) then acc = 15; end - if(sItem == 17348) then - acc = acc + 2; + if(caster:getObjType() == TYPE_PC) then + local merit = caster:getMerit(MERIT_MADRIGAL_EFFECT); + if(merit > 0) then + acc = acc + merit; + end end - -- traversiere + 1 - if(sItem == 17375 or sItem == 17845) then - acc = acc + 4; - end + -- Equipment Mods + local weapon = caster:getEquipID(SLOT_MAIN); + local weapon2 = caster:getEquipID(SLOT_SUB); + + if (caster:getEquipID(SLOT_BODY) == 11093) then -- Aoidos Hongreline +2 + duration = duration * 1.1; + elseif(caster:getEquipID(SLOT_BODY) == 11193) then -- Aoidos Hongreline +1 + duration = duration * 1.05; + end + if (caster:getEquipID(SLOT_NECK) == 11618) then -- Aoidos Matinee + duration = duration * 1.1; + end + if (caster:getEquipID(SLOT_LEGS) == 28074) then -- Marduks Shalwar +1 + duration = duration * 1.1; + end + if (weapon == 19000 or weapon2 == 19000) then -- Carnwenhan Lvl 75 + duration = duration * 1.1; + elseif (weapon == 19069 or weapon2 == 19069) then -- Carnwenhan Lvl 80 + duration = duration * 1.2; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 85 + duration = duration * 1.3; + elseif (weapon == 19089 or weapon2 == 19089) then -- Carnwenhan Lvl 90 + duration = duration * 1.4; + elseif (weapon == 19719 or weapon2 == 19719) then -- Carnwenhan Lvl 95 + duration = duration * 1.4; + elseif (weapon == 19828 or weapon2 == 19828) then -- Carnwenhan Lvl 99 + duration = duration * 1.5; + elseif (weapon == 19957 or weapon2 == 19957) then -- Carnwenhan Lvl 99 - 2 + duration = duration * 1.4; + end + + if(sItem == 18342 or sItem == 18577 or sItem == 18578) then -- Gjallarhorn Lvl 75 - 80 - 85 + acc = acc + 4; + elseif(sItem == 18579 or sItem == 18580) then -- Gjallarhorn Lvl 90 - 95 + acc = acc + 6; + elseif(sItem == 18840 or sItem == 18572) then -- Gjallarhorn Lvl 99 - 99-2 + acc = acc + 8; + elseif(sItem == 17348) then -- Traversiere + acc = acc + 2; + elseif(sItem == 17375 or sItem == 17845) then -- Traversiere +1 & +2 + acc = acc + 4; + elseif(sItem == 18833) then -- Cantabanks Horn + acc = acc + 6; + end + + if(head == 11073) then -- Adidos Calot +2 + acc = acc + 2; + end -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. Index: scripts/globals/spells/temper.lua =================================================================== --- scripts/globals/spells/temper.lua (revision 0) +++ scripts/globals/spells/temper.lua (working copy) @@ -0,0 +1,54 @@ +----------------------------------------- +-- Spell: TEMPER +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enhskill = caster:getSkillLevel(ENHANCING_MAGIC_SKILL); + final = 0; + duration = 180; + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(enhskill<=360) then + final = 5; + elseif(enhskill>360) then + final = math.floor((enhskill - 360)/10) + 5; + else + print("Warning: Unknown enhancing magic skill for Temper."); + end + + if(final>20) then + final = 20; + end + + -- Estoqueurs Bonus + duration = duration + (duration * caster:getMod(MOD_ENHANCING_DUR)); + + if(target:hasStatusEffect(EFFECT_IFRIT_S_FAVOR)) then + oldeffect = target:getStatusEffect(EFFECT_IFRIT_S_FAVOR); + if(oldeffect:getPower()<=final) then --overwrite + target:delStatusEffect(EFFECT_IFIRIT_S_FAVOR); + target:addStatusEffect(EFFECT_IFRIT_S_FAVOR,final,0,duration); + spell:setMsg(0); + else --no effect + spell:setMsg(75); + end + else + target:addStatusEffect(EFFECT_IFRIT_S_FAVOR,final,0,duration); + spell:setMsg(0); + end + + return EFFECT_IFRIT_S_FAVOR; +end; \ No newline at end of file Index: scripts/globals/spells/thundaga_ii.lua =================================================================== --- scripts/globals/spells/thundaga_ii.lua (revision 3304) +++ scripts/globals/spells/thundaga_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Thundaga 2 +-- Spell: Thundaga II -- Deals thunder damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/thundaga_iii.lua =================================================================== --- scripts/globals/spells/thundaga_iii.lua (revision 3304) +++ scripts/globals/spells/thundaga_iii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Thundaga 3 +-- Spell: Thundaga III -- Deals thunder damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/thundaga_iv.lua =================================================================== --- scripts/globals/spells/thundaga_iv.lua (revision 0) +++ scripts/globals/spells/thundaga_iv.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Thundaga IV +-- Deals thunder damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(1002,2,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/thundaga_v.lua =================================================================== --- scripts/globals/spells/thundaga_v.lua (revision 0) +++ scripts/globals/spells/thundaga_v.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Thundaga V +-- Deals thunder damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(1394,2.3,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/thunder.lua =================================================================== --- scripts/globals/spells/thunder.lua (revision 3304) +++ scripts/globals/spells/thunder.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- --- Spell: Fire --- Deals fire damage to an enemy. +-- Spell: Thunder +-- Deals lightning damage to an enemy. ----------------------------------------- require("scripts/globals/magic"); Index: scripts/globals/spells/thunder_ii.lua =================================================================== --- scripts/globals/spells/thunder_ii.lua (revision 3304) +++ scripts/globals/spells/thunder_ii.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- --- Spell: Fire --- Deals fire damage to an enemy. +-- Spell: Thunder II +-- Deals lightning damage to an enemy. ----------------------------------------- require("scripts/globals/magic"); Index: scripts/globals/spells/thunder_iii.lua =================================================================== --- scripts/globals/spells/thunder_iii.lua (revision 3304) +++ scripts/globals/spells/thunder_iii.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- --- Spell: Fire --- Deals fire damage to an enemy. +-- Spell: Thunder III +-- Deals lightning damage to an enemy. ----------------------------------------- require("scripts/globals/magic"); Index: scripts/globals/spells/thunder_iv.lua =================================================================== --- scripts/globals/spells/thunder_iv.lua (revision 3304) +++ scripts/globals/spells/thunder_iv.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------------- --- Spell: Fire --- Deals fire damage to an enemy. +-- Spell: Thunder IV +-- Deals lightning damage to an enemy. ----------------------------------------- require("scripts/globals/magic"); Index: scripts/globals/spells/tonko_ichi.lua =================================================================== --- scripts/globals/spells/tonko_ichi.lua (revision 3304) +++ scripts/globals/spells/tonko_ichi.lua (working copy) @@ -16,7 +16,8 @@ function onSpellCast(caster,target,spell) if (target:hasStatusEffect(EFFECT_INVISIBLE) == false) then - target:addStatusEffect(EFFECT_INVISIBLE,0,10,180); + local duration = 180; + target:addStatusEffect(EFFECT_INVISIBLE,0,10,duration); spell:setMsg(230); else spell:setMsg(75); -- no effect. Index: scripts/globals/spells/tonko_ni.lua =================================================================== --- scripts/globals/spells/tonko_ni.lua (revision 3304) +++ scripts/globals/spells/tonko_ni.lua (working copy) @@ -16,7 +16,8 @@ function onSpellCast(caster,target,spell) if (target:hasStatusEffect(EFFECT_INVISIBLE) == false) then - target:addStatusEffect(EFFECT_INVISIBLE,0,10,300); + local duration = 300; + target:addStatusEffect(EFFECT_INVISIBLE,0,10,duration); spell:setMsg(230); else spell:setMsg(75); -- no effect. Index: scripts/globals/spells/tonko_san.lua =================================================================== --- scripts/globals/spells/tonko_san.lua (revision 3304) +++ scripts/globals/spells/tonko_san.lua (working copy) @@ -16,7 +16,8 @@ function onSpellCast(caster,target,spell) if (target:hasStatusEffect(EFFECT_INVISIBLE) == false) then - target:addStatusEffect(EFFECT_INVISIBLE,0,10,420); + local duration = 420; + target:addStatusEffect(EFFECT_INVISIBLE,0,10,duration); spell:setMsg(230); else spell:setMsg(75); -- no effect. Index: scripts/globals/spells/tractor_ii.lua =================================================================== --- scripts/globals/spells/tractor_ii.lua (revision 0) +++ scripts/globals/spells/tractor_ii.lua (working copy) @@ -0,0 +1,21 @@ +----------------------------------------- +-- Spell: Tractor II +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + -- target:setPos(caster:getXPos(), caster:getYPos(), caster:getZPos()); + + return 0; +end; \ No newline at end of file Index: scripts/globals/spells/uncanny_etude.lua =================================================================== --- scripts/globals/spells/uncanny_etude.lua (revision 0) +++ scripts/globals/spells/uncanny_etude.lua (working copy) @@ -0,0 +1,45 @@ +-------------------------------------- +-- Spell: Uncanny Etude +-- Boosts targets DEX stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + duration = 120; + + if(enchanceSkill <416)then + power = 12 + elseif(enchanceSkill >=417 and enchanceSkill <=445)then + power = 13 + elseif(enchanceSkill >=446 and enchanceSkill <=474)then + power = 14 + elseif(enchanceSkill >=475)then + power = 15 + else + power = 15 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_DEX_DOWN) == true) then + target:delStatusEffect(EFFECT_DEX_DOWN); + else + target:addStatusEffect(EFFECT_DEX_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/utsusemi_ichi.lua =================================================================== --- scripts/globals/spells/utsusemi_ichi.lua (revision 3304) +++ scripts/globals/spells/utsusemi_ichi.lua (working copy) @@ -14,18 +14,34 @@ function onSpellCast(caster,target,spell) effect = target:getStatusEffect(EFFECT_COPY_IMAGE); - if (effect == nil) then - target:addStatusEffectEx(EFFECT_COPY_IMAGE,EFFECT_COPY_IMAGE_3,3,0,900); - target:setMod(MOD_UTSUSEMI, 3); - spell:setMsg(230); - elseif (effect:getPower() <= 3) then - effect:setPower(3); - effect:setIcon(EFFECT_COPY_IMAGE_3); - effect:resetStartTime(); - target:setMod(MOD_UTSUSEMI, 3); - spell:setMsg(230); + if(caster:getEquipID(SLOT_FEET) == 11156) then + if (effect == nil) then + target:addStatusEffectEx(EFFECT_COPY_IMAGE,EFFECT_COPY_IMAGE_4,4,0,900); + target:setMod(MOD_UTSUSEMI, 4); + spell:setMsg(230); + elseif (effect:getPower() <= 4) then + spell:setMsg(230); + effect:setPower(4); + effect:setIcon(EFFECT_COPY_IMAGE_4); + effect:resetStartTime(); + target:setMod(MOD_UTSUSEMI, 4); + else + spell:setMsg(75); + end else - spell:setMsg(75); + if (effect == nil) then + target:addStatusEffectEx(EFFECT_COPY_IMAGE,EFFECT_COPY_IMAGE_3,3,0,900); + target:setMod(MOD_UTSUSEMI, 3); + spell:setMsg(230); + elseif (effect:getPower() <= 3) then + effect:setPower(3); + effect:setIcon(EFFECT_COPY_IMAGE_3); + effect:resetStartTime(); + target:setMod(MOD_UTSUSEMI, 3); + spell:setMsg(230); + else + spell:setMsg(75); + end end return EFFECT_COPY_IMAGE; Index: scripts/globals/spells/utsusemi_ni.lua =================================================================== --- scripts/globals/spells/utsusemi_ni.lua (revision 3304) +++ scripts/globals/spells/utsusemi_ni.lua (working copy) @@ -13,11 +13,15 @@ end; function onSpellCast(caster,target,spell) + local shadows = 4; + if(caster:getEquipID(SLOT_FEET) == 11156) then + shadows = 5; + end effect = target:getStatusEffect(EFFECT_COPY_IMAGE); if (effect == nil) then if caster:getMainJob() == 13 then - target:addStatusEffectEx(EFFECT_COPY_IMAGE,EFFECT_COPY_IMAGE_4,4,0,900); - target:setMod(MOD_UTSUSEMI, 4); + target:addStatusEffectEx(EFFECT_COPY_IMAGE,EFFECT_COPY_IMAGE_4,shadows,0,900); + target:setMod(MOD_UTSUSEMI, shadows); spell:setMsg(230); else target:addStatusEffectEx(EFFECT_COPY_IMAGE,EFFECT_COPY_IMAGE_3,3,0,900); @@ -27,10 +31,10 @@ elseif caster:getMainJob() == 13 then if (effect:getPower() <= 4) then spell:setMsg(230); - effect:setPower(4); + effect:setPower(shadows); effect:setIcon(EFFECT_COPY_IMAGE_4); effect:resetStartTime(); - target:setMod(MOD_UTSUSEMI, 4); + target:setMod(MOD_UTSUSEMI, shadows); else spell:setMsg(75); end Index: scripts/globals/spells/valor_minuet.lua =================================================================== --- scripts/globals/spells/valor_minuet.lua (revision 3304) +++ scripts/globals/spells/valor_minuet.lua (working copy) @@ -18,7 +18,7 @@ local sItem = caster:getEquipID(2); local sLvl = caster:getSkillLevel(40); -- Gets skill level of Singing - if (sLvl < 11) then -- If your skill level is below 11 your stuck at the minimum + if (sLvl < 11) then -- If your skill level is below 11 you are stuck at the minimum power = 8; end @@ -31,6 +31,21 @@ power = 16; end + if(caster:getObjType() == TYPE_PC) then + if (sLvl < 11) then -- If your skill level is below 11 you are stuck at the minimum + power = 8 + caster:getMerit(MERIT_MINUET_EFFECT); + end + + if (sLvl >= 11 and sLvl <= 65) then -- If your above 10 skill then you get the bonus of 1 more attack for every 7 skill + sBoost = math.floor((sLvl - 10)/7); + power = 8 + sBoost + caster:getMerit(MERIT_MINUET_EFFECT); + end + + if(sLvl >= 66) then -- The bonus caps at skill 66 + power = 16 + caster:getMerit(MERIT_MINUET_EFFECT); + end + end + if(sItem == 17344) then -- Cornette will add 3 more power = power + 3; end Index: scripts/globals/spells/valor_minuet_ii.lua =================================================================== --- scripts/globals/spells/valor_minuet_ii.lua (revision 3304) +++ scripts/globals/spells/valor_minuet_ii.lua (working copy) @@ -18,7 +18,7 @@ local sItem = caster:getEquipID(2); local sLvl = caster:getSkillLevel(40); -- Gets skill level of Singing - if (sLvl < 67) then -- If your skill level is below 67 your stuck at the minimum + if (sLvl < 67) then -- If your skill level is below 67 you are stuck at the minimum power = 14; end @@ -30,6 +30,21 @@ if(sLvl >= 120) then -- The bonus caps at skill 120 power = 32; end + + if(caster:getObjType() == TYPE_PC) then + if (sLvl < 67) then -- If your skill level is below 67 you are stuck at the minimum + power = 14 + caster:getMerit(MERIT_MINUET_EFFECT); + end + + if (sLvl >= 67 and sLvl <= 119) then -- If your above 66 skill then you get the bonus of 1 more attack for every 3 skill + sBoost = math.floor((sLvl - 66)/3); + power = 14 + sBoost + caster:getMerit(MERIT_MINUET_EFFECT); + end + + if(sLvl >= 120) then -- The bonus caps at skill 120 + power = 32 + caster:getMerit(MERIT_MINUET_EFFECT); + end + end if(sItem == 17344) then -- Cornette will add 3 more power = power + 3; Index: scripts/globals/spells/valor_minuet_iii.lua =================================================================== --- scripts/globals/spells/valor_minuet_iii.lua (revision 3304) +++ scripts/globals/spells/valor_minuet_iii.lua (working copy) @@ -18,7 +18,7 @@ local sItem = caster:getEquipID(2); local sLvl = caster:getSkillLevel(40); -- Gets skill level of Singing - if (sLvl < 123) then -- If your skill level is below 123 your stuck at the minimum + if (sLvl < 123) then -- If your skill level is below 123 you are stuck at the minimum power = 30; end @@ -30,7 +30,22 @@ if(sLvl >= 194) then -- The bonus caps at skill 194 power = 48; end - + + if(caster:getObjType() == TYPE_PC) then + if (sLvl < 123) then -- If your skill level is below 123 you are stuck at the minimum + power = 30 + caster:getMerit(MERIT_MINUET_EFFECT); + end + + if (sLvl >= 123 and sLvl <= 193) then -- If your above 122 skill then you get the bonus of 1 more attack for every 4 skill + sBoost = math.floor((sLvl - 122)/4); + power = 30 + sBoost + caster:getMerit(MERIT_MINUET_EFFECT); + end + + if(sLvl >= 194) then -- The bonus caps at skill 194 + power = 48 + caster:getMerit(MERIT_MINUET_EFFECT); + end + end + if(sItem == 17344) then -- Cornette will add 3 more power = power + 3; end Index: scripts/globals/spells/valor_minuet_iv.lua =================================================================== --- scripts/globals/spells/valor_minuet_iv.lua (revision 3304) +++ scripts/globals/spells/valor_minuet_iv.lua (working copy) @@ -31,6 +31,21 @@ power = 56; end + if(caster:getObjType() == TYPE_PC) then + if (sLvl < 123) then -- If your skill level is below 123 your stuck at the minimum + power = 30 + caster:getMerit(MERIT_MINUET_EFFECT); + end + + if (sLvl >= 123 and sLvl <= 193) then -- If your above 122 skill then you get the bonus of 1 more attack for every 4 skill + sBoost = math.floor((sLvl - 122)/4); + power = 30 + sBoost + caster:getMerit(MERIT_MINUET_EFFECT); + end + + if(sLvl >= 194) then -- The bonus caps at skill 194 + power = 56 + caster:getMerit(MERIT_MINUET_EFFECT); + end + end + if(sItem == 17344) then -- Cornette will add 3 more power = power + 3; end Index: scripts/globals/spells/valor_minuet_v.lua =================================================================== --- scripts/globals/spells/valor_minuet_v.lua (revision 0) +++ scripts/globals/spells/valor_minuet_v.lua (working copy) @@ -0,0 +1,63 @@ +----------------------------------------- +-- Spell: Valor Minuet IV +-- Grants Attack bonus to all allies. +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + local sItem = caster:getEquipID(2); + local sLvl = caster:getSkillLevel(40); -- Gets skill level of Singing + + if (sLvl < 200) then -- If your skill level is below 200 you are stuck at the minimum + power = 40; + end + + if (sLvl >= 200 and sLvl <= 270) then -- If your above 201 skill then you get the bonus of 1 more attack for every 4 skill + sBoost = math.floor((sLvl - 200)/4); + power = 40 + sBoost; + end + + if(sLvl >= 271) then -- The bonus caps at skill 271 + power = 72; + end + + if(caster:getObjType() == TYPE_PC) then + if (sLvl < 200) then -- If your skill level is below 200 you are stuck at the minimum + power = 40 + caster:getMerit(MERIT_MINUET_EFFECT); + end + + if (sLvl >= 200 and sLvl <= 270) then -- If your above 201 skill then you get the bonus of 1 more attack for every 4 skill + sBoost = math.floor((sLvl - 200)/4); + power = 40 + sBoost + caster:getMerit(MERIT_MINUET_EFFECT); + end + + if(sLvl >= 271) then -- The bonus caps at skill 271 + power = 72 + caster:getMerit(MERIT_MINUET_EFFECT); + end + end + + if(sItem == 17344) then -- Cornette will add 3 more + power = power + 3; + end + + if(sItem == 17369 or sItem == 17846) then -- Cornette +1 and Cornette +2 give 5 more + power = power + 5; + end + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_MINUET); + target:addStatusEffect(EFFECT_MINUET,power,0,120); + + return EFFECT_MINUET; +end; \ No newline at end of file Index: scripts/globals/spells/victory_march.lua =================================================================== --- scripts/globals/spells/victory_march.lua (revision 3304) +++ scripts/globals/spells/victory_march.lua (working copy) @@ -17,27 +17,20 @@ -- NOTE: THIS SCRIPT IS CURRENTLY IGNORED. See battleutils:SingSong() - local haste = 96; - local sItem = caster:getEquipID(2); - local duration = 120; - - local power = caster:getSkillLevel(SINGING_SKILL); - - -- Royal Spearman's Horn, Kingdom Horn, San d'Orian Horn Adds +1 haste - if(sItem == 17367 or sItem == 17836 or sItem == 17835) then - power = power + 16; - end - - -- Faerie Piccolo and Iron Ram Horn Adds +2 haste - if(sItem == 17349 or sItem == 17853) then - power = power + 32; - end - + local duration = 120; + local haste = caster:getSkillLevel(SINGING_SKILL) / 2; + local hasteCap = 96; + if (haste > hasteCap) then + haste = hasteCap; + end + duration = duration + (duration * (target:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((target:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((target:getMod(MOD_MARCH) * 10)/100)); + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. -- Since all the tiers use the same effect buff it is hard to delete a specific one. - haste = power / 2; target:delStatusEffect(EFFECT_MARCH); - target:addStatusEffect(EFFECT_MARCH,haste,0,duration); + target:addStatusEffect(EFFECT_MARCH,2,0,duration); spell:setMsg(230); return EFFECT_MARCH; end; \ No newline at end of file Index: scripts/globals/spells/virus.lua =================================================================== --- scripts/globals/spells/virus.lua (revision 0) +++ scripts/globals/spells/virus.lua (working copy) @@ -0,0 +1,57 @@ +----------------------------------------- +-- Spell: Virus +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + + -- Pull base stats. + dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT)); + bonus = AffinityBonus(caster,spell); + + -- Base power. + power = math.floor((dINT + 60) / 4); + if(power < 5) then + power = 5; + end + if(power > 20) then + power = 20; + end + + -- Duration, including resistance. Unconfirmed. + duration = 120 * applyResistance(caster,spell,target,dINT,35,bonus); + + -- Equipment bonus + local back = caster:getEquipID(SLOT_BACK); + local body = caster:getEquipID(SLOT_BODY); + if (body == 11088) then -- Estoquers Sayon +2 + power = power * 1.1; + end + + if(100 * math.random() >= target:getMod(MOD_VIRUSRES)) then + if(duration >= 90) then --Do it! + + if(target:addStatusEffect(EFFECT_DISEASE,power,3,duration)) then + spell:setMsg(236); + else + + spell:setMsg(75); + end + else + spell:setMsg(85); + end + else + spell:setMsg(284); + end + return EFFECT_DISEASE; +end; \ No newline at end of file Index: scripts/globals/spells/vital_etude.lua =================================================================== --- scripts/globals/spells/vital_etude.lua (revision 0) +++ scripts/globals/spells/vital_etude.lua (working copy) @@ -0,0 +1,45 @@ +-------------------------------------- +-- Spell: Vital Etude +-- Boosts targets VIT stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + local duration = 120; + + if(enchanceSkill <416)then + power = 12 + elseif(enchanceSkill >=417 and enchanceSkill <=445)then + power = 13 + elseif(enchanceSkill >=446 and enchanceSkill <=474)then + power = 14 + elseif(enchanceSkill >=475)then + power = 15 + else + power = 15 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_VIT_DOWN) == true) then + target:delStatusEffect(EFFECT_VIT_DOWN); + else + target:addStatusEffect(EFFECT_VIT_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/vivacious_etude.lua =================================================================== --- scripts/globals/spells/vivacious_etude.lua (revision 0) +++ scripts/globals/spells/vivacious_etude.lua (working copy) @@ -0,0 +1,51 @@ +-------------------------------------- +-- Spell: Vivacious Etude +-- Boosts targets VIT stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + local enchanceSkill = caster:getSkillLevel(40); -- Singing Skill + local duration = 120; + + if(enchanceSkill <180)then + power = 3 + elseif(enchanceSkill >=181 and enchanceSkill <=235)then + power = 4 + elseif(enchanceSkill >=236 and enchanceSkill <=288)then + power = 5 + elseif(enchanceSkill >=289 and enchanceSkill <=342)then + power = 6 + elseif(enchanceSkill >=343 and enchanceSkill <=396)then + power = 7 + elseif(enchanceSkill >=397 and enchanceSkill <=449)then + power = 8 + elseif(enchanceSkill >=450)then + power = 9 + else + power = 10 + end + + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ETUDE) * 10)/100)); + + power = power + target:getMod(MOD_ETUDE) + target:getMod(MOD_ALL_SONGS); + + if(target:hasStatusEffect(EFFECT_VIT_DOWN) == true) then + target:delStatusEffect(EFFECT_VIT_DOWN); + else + target:addStatusEffect(EFFECT_VIT_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/warding_round.lua =================================================================== --- scripts/globals/spells/warding_round.lua (revision 0) +++ scripts/globals/spells/warding_round.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------------- +-- Spell: Warding Round +-- Increases Curse Resistance to +-- Party Members within target AoE +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + -- Mostly Guestimate ?? + local duration = 120; + local power = 20; + duration = duration + (duration * (caster:getMod(MOD_SONG_DURATION)/100)); + duration = duration + (duration * ((caster:getMod(MOD_ALL_SONGS) * 10)/100)); + + power = power + (caster:getMod(MOD_ALL_SONGS) * 4); + + -- Until someone finds a way to delete Effects by tier we should not allow bard spells to stack. + -- Since all the tiers use the same effect buff it is hard to delete a specific one. + target:delStatusEffect(EFFECT_ROUND); + target:addStatusEffect(EFFECT_ROUND,power,0,duration); + spell:setMsg(230); + return EFFECT_ROUND; +end; \ No newline at end of file Index: scripts/globals/spells/water_carol.lua =================================================================== --- scripts/globals/spells/water_carol.lua (revision 0) +++ scripts/globals/spells/water_carol.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Water Carol +-- MOD_WATERRES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 40, 120, MOD_WATERRES); +end; Index: scripts/globals/spells/water_carol_ii.lua =================================================================== --- scripts/globals/spells/water_carol_ii.lua (revision 0) +++ scripts/globals/spells/water_carol_ii.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Water Carol II +-- MOD_WATERRES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 50, 120, MOD_WATERRES); +end; Index: scripts/globals/spells/water_ii.lua =================================================================== --- scripts/globals/spells/water_ii.lua (revision 3304) +++ scripts/globals/spells/water_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Water +-- Spell: Water II -- Deals water damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/water_iii.lua =================================================================== --- scripts/globals/spells/water_iii.lua (revision 3304) +++ scripts/globals/spells/water_iii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Water +-- Spell: Water III -- Deals water damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/water_iv.lua =================================================================== --- scripts/globals/spells/water_iv.lua (revision 3304) +++ scripts/globals/spells/water_iv.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Water +-- Spell: Water IV -- Deals water damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/water_v.lua =================================================================== --- scripts/globals/spells/water_v.lua (revision 3304) +++ scripts/globals/spells/water_v.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Water +-- Spell: Water V -- Deals water damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/waterga.lua =================================================================== --- scripts/globals/spells/waterga.lua (revision 3304) +++ scripts/globals/spells/waterga.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Water +-- Spell: Waterga -- Deals water damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/waterga_ii.lua =================================================================== --- scripts/globals/spells/waterga_ii.lua (revision 3304) +++ scripts/globals/spells/waterga_ii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Water +-- Spell: Waterga II -- Deals water damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/waterga_iii.lua =================================================================== --- scripts/globals/spells/waterga_iii.lua (revision 3304) +++ scripts/globals/spells/waterga_iii.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------------- --- Spell: Water +-- Spell: Waterga III -- Deals water damage to an enemy. ----------------------------------------- Index: scripts/globals/spells/waterga_iv.lua =================================================================== --- scripts/globals/spells/waterga_iv.lua (revision 0) +++ scripts/globals/spells/waterga_iv.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Waterga IV +-- Deals water damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(728,2,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/waterga_v.lua =================================================================== --- scripts/globals/spells/waterga_v.lua (revision 0) +++ scripts/globals/spells/waterga_v.lua (working copy) @@ -0,0 +1,31 @@ +----------------------------------------- +-- Spell: Waterga V +-- Deals water damage to an enemy. +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + --calculate raw damage + dmg = calculateMagicDamage(960,2.3,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + dmg = finalMagicAdjustments(caster,target,spell,dmg); + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/wind_carol.lua =================================================================== --- scripts/globals/spells/wind_carol.lua (revision 0) +++ scripts/globals/spells/wind_carol.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Wind Carol +-- MOD_WINDRES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 40, 120, MOD_WINDRES); +end; Index: scripts/globals/spells/wind_carol_ii.lua =================================================================== --- scripts/globals/spells/wind_carol_ii.lua (revision 0) +++ scripts/globals/spells/wind_carol_ii.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------------- +-- Spell: Wind Carol II +-- MOD_WINDRES +----------------------------------------- +require("scripts/globals/status"); +require("scripts/globals/magic"); +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + return handleCarol(caster, target, spell, 50, 120, MOD_WINDRES); +end; Index: scripts/globals/spells/yurin_ichi.lua =================================================================== --- scripts/globals/spells/yurin_ichi.lua (revision 0) +++ scripts/globals/spells/yurin_ichi.lua (working copy) @@ -0,0 +1,24 @@ +----------------------------------------- +-- Spell: Yurin: Ichi +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function OnMagicCastingCheck(caster,target,spell) + return 0; +end; + +function onSpellCast(caster,target,spell) + target:delStatusEffect(EFFECT_INHIBIT_TP); + effect = target:getStatusEffect(EFFECT_INHIBIT_TP); + + -- The power is unknown. + target:addStatusEffect(EFFECT_INHIBIT_TP,EFFECT_INHIBIT_TP,10,0,180); + spell:setMsg(230); + + return EFFECT_INHIBIT_TP; +end; \ No newline at end of file Index: scripts/globals/status.lua =================================================================== --- scripts/globals/status.lua (revision 3304) +++ scripts/globals/status.lua (working copy) @@ -24,6 +24,8 @@ JOB_PUP = 18; JOB_DNC = 19; JOB_SCH = 20; +JOB_GEO = 21; +JOB_RUN = 22; ----------------------------------- -- These codes represent the actual status effects. -- They are simply for convenience. @@ -51,6 +53,12 @@ EFFECT_SLEEP_II = 19 EFFECT_CURSE_II = 20 EFFECT_ADDLE = 21 +EFFECT_INTIMIDATE = 22 +EFFECT_KAUSTRA = 23 +EFFECT_ST24 = 24 +EFFECT_ST25 = 25 +EFFECT_ST26 = 26 +EFFECT_ST27 = 27 EFFECT_TERROR = 28 EFFECT_MUTE = 29 EFFECT_BANE = 30 @@ -246,7 +254,15 @@ EFFECT_SIRVENTE = 220 EFFECT_DIRGE = 221 EFFECT_SCHERZO = 222 -EFFECT_BARD_SONG_32 = 223 +EFFECT_NOCTURNE = 223 +EFFECT_ST224 = 224 +EFFECT_ST225 = 225 +EFFECT_ST226 = 226 +EFFECT_STORE_TP = 227 +EFFECT_EMBRAVA = 228 +EFFECT_MANAWELL = 229 +EFFECT_SPONTANEITY = 230 +EFFECT_MARCATO = 231 EFFECT_NA = 232 EFFECT_AUTO_REGEN = 233 EFFECT_AUTO_REFRESH = 234 @@ -351,10 +367,10 @@ EFFECT_BLITZERS_ROLL = 333 EFFECT_TACTICIANS_ROLL = 334 EFFECT_ALLIES_ROLL = 335 -EFFECT_NONE_I = 336 -EFFECT_NONE_II = 337 -EFFECT_NONE_III = 338 -EFFECT_NONE_IV = 339 +EFFECT_MISERS_ROLL = 336 +EFFECT_COMPANIONS_ROLL = 337 +EFFECT_AVENGERS_ROLL = 338 +-- EFFECT_NONE = 339 EFFECT_WARRIOR_S_CHARGE = 340 EFFECT_FORMLESS_STRIKES = 341 EFFECT_ASSASSIN_S_CHARGE = 342 @@ -387,6 +403,9 @@ EFFECT_ASPIR_SAMBA = 369 EFFECT_HASTE_SAMBA = 370 EFFECT_VELOCITY_SHOT = 371 +-- . = 372 +-- . = 373 +-- . = 374 EFFECT_BUILDING_FLOURISH = 375 EFFECT_TRANCE = 376 EFFECT_TABULA_RASA = 377 @@ -484,13 +503,106 @@ EFFECT_PERPETUANCE = 469 EFFECT_IMMANENCE = 470 EFFECT_MIGAWARI = 471 -EFFECT_ISSEKIGAN = 484 -EFFECT_AVATAR = 491 -EFFECT_NINJUTSU_ELE_DEBUFF = 510 +EFFECT_TERNARY_FLOURISH = 472 +EFFECT_MUDDLE = 473 +EFFECT_PROWESS = 474 +EFFECT_VOIDWATCHER = 475 +EFFECT_ENSPHERE = 476 +EFFECT_SACROSANCTITY = 477 +EFFECT_PALISADE = 478 +EFFECT_SCARLET_DELIRIUM_I = 479 +EFFECT_SCARLET_DELIRIUM_II = 480 +-- NONE = 481 +EFFECT_DECOY_SHOT = 482 +EFFECT_HAGAKURE = 483 +EFFECT_ISSEKIGAN = 484 +EFFECT_UNBRIDLED_LEARNING = 485 +EFFECT_COUNTER_BOOST = 486 +EFFECT_ENDRAIN = 487 +EFFECT_ENASPIR = 488 +EFFECT_AFTERGLOW = 489 +EFFECT_IMMINENT_STRIKES = 490 +EFFECT_AVATAR = 491 -- EFFECT_MNK_SP2 CONSUMATE_COUNTER +EFFECT_ASYLUM = 492 +EFFECT_SUBTLE_SORCERY = 493 +EFFECT_ENCOMIUM = 494 +EFFECT_BAMBOOZLE = 495 +EFFECT_RIGHTEOUS_GAURD = 496 +EFFECT_SOUL_ENSLAVEMENT = 497 +EFFECT_BST_SP2 = 498 +EFFECT_MALINCONICO = 499 +EFFECT_INSTINCTIVE_AIM = 500 +EFFECT_YAEGASUMI = 501 +EFFECT_TENGEN = 502 +EFFECT_ROUSE_WYVERN = 503 +EFFECT_ASTRAL_CONDUIT = 504 +EFFECT_UNBRIDLED_WISDOM = 505 +EFFECT_THREE_TO_ONE = 506 +EFFECT_GRAND_PAS = 507 +-- EFFECT_NONE = 508 +-- EFFECT_NONE = 509 +EFFECT_NINJUTSU_ELE_DEBUFF = 510 -- EFFECT_ERGON_MIGHT +EFFECT_REIVE_MARK = 511 +EFFECT_HEALING = 512 -- EFFECT_IONIS +EFFECT_LEAVEGAME = 513 -- EFFECT_BOLSTER +EFFECT_SKILLCHAIN = 514 -- EFFECT_NONE +EFFECT_LASTING_EMANATION = 515 +EFFECT_ECLIPTIC_ATTRITION = 516 +EFFECT_COLLIMATED_FERVOR = 517 +EFFECT_DEMATERIALIZE = 518 +EFFECT_THEURGIC_FOCUS = 519 +-- EFFECT_NONE = 520 +-- EFFECT_NONE = 521 +EFFECT_ELEMENTAL_SFORZO = 522 +EFFECT_IGNIS = 523 +EFFECT_GELUS = 524 +EFFECT_FLABRA = 525 +EFFECT_TELLUS = 526 +EFFECT_SULPOR = 527 +EFFECT_UNDA = 528 +EFFECT_LUX = 529 +EFFECT_TENEBRAE = 530 +EFFECT_VALLATION = 531 +EFFECT_SWORDPLAY = 532 +EFFECT_PFLUG = 533 +EFFECT_EMBOLDEN = 534 +EFFECT_VALIANCE = 535 +EFFECT_GAMBIT = 536 +EFFECT_LIEMENT = 537 +EFFECT_ONE_FOR_ALL = 538 +EFFECT_REGEN_II = 539 +EFFECT_POISON_II = 540 +EFFECT_REFRESH_II = 541 +EFFECT_STR_BOOST_III = 542 +EFFECT_DEX_BOOST_III = 543 +EFFECT_VIT_BOOST_III = 544 +EFFECT_AGI_BOOST_III = 545 +EFFECT_INT_BOOST_III = 546 +EFFECT_MND_BOOST_III = 547 +EFFECT_CHR_BOOST_III = 548 +EFFECT_ATTACK_BOOST_II = 549 +EFFECT_DEFENSE_BOOST_II = 550 +EFFECT_MAGIC_ATK_BOOST_II = 551 +EFFECT_MAGIC_DEF_BOOST_II = 552 +EFFECT_ACCURACY_BOOST_II = 553 +EFFECT_EVASION_BOOST_II = 554 +EFFECT_MAGIC_ACC_BOOST_II = 555 +EFFECT_MAGIC_EVASION_BOOST_II = 556 +EFFECT_ATTACK_DOWN_II = 557 +EFFECT_DEFENSE_DOWN_II = 558 +EFFECT_MAGIC_ATK_DOWN_II = 559 +EFFECT_MAGIC_DEF_DOWN_II = 560 +EFFECT_ACCURACY_DOWN_II = 561 +EFFECT_EVASION_DOWN_II = 562 +EFFECT_MAGIC_ACC_DOWN_II = 563 +EFFECT_MAGIC_EVASION_DOWN_II = 564 +EFFECT_SLOW_II = 565 +EFFECT_PARALYSIS_II = 566 +EFFECT_WEIGHT_II = 567 +EFFECT_FOIL = 568 +EFFECT_BLAZE_OF_GLORY = 569 +-- 570 - 639 NONE on POL Utils EFFECT_DYNAMIS = 800 -EFFECT_HEALING = 512 -EFFECT_LEAVEGAME = 513 -EFFECT_SKILLCHAIN = 514 EFFECT_SKILLCHAIN0 = 0x200 EFFECT_SKILLCHAIN1 = 0x400 @@ -530,10 +642,10 @@ MOD_DEF = 0x01 MOD_HP = 0x02 MOD_HPP = 0x03 -MOD_CONVMPTOHP = 0x04 +MOD_CONVMPTOHP = 0x04 MOD_MP = 0x05 MOD_MPP = 0x06 -MOD_CONVHPTOMP = 0x07 +MOD_CONVHPTOMP = 0x07 MOD_STR = 0x08 MOD_DEX = 0x09 MOD_VIT = 0x0A @@ -541,14 +653,16 @@ MOD_INT = 0x0C MOD_MND = 0x0D MOD_CHR = 0x0E + MOD_FIREDEF = 0x0F MOD_ICEDEF = 0x10 MOD_WINDDEF = 0x11 -MOD_EARTHDEF = 0x12 -MOD_THUNDERDEF = 0x13 -MOD_WATERDEF = 0x14 -MOD_LIGHTDEF = 0x15 +MOD_EARTHDEF = 0x12 +MOD_THUNDERDEF = 0x13 +MOD_WATERDEF = 0x14 +MOD_LIGHTDEF = 0x15 MOD_DARKDEF = 0x16 + MOD_ATT = 0x17 MOD_RATT = 0x18 MOD_ACC = 0x19 @@ -558,35 +672,45 @@ MOD_MDEF = 0x1D MOD_MACC = 0x1E MOD_MEVA = 0x1F +MOD_MAG_BURST_DMG = 0x19E +MOD_ELEM_MAG_DMG = 0x1A2 +MOD_ENFB_MAG_DMG = 0x1A3 +MOD_NIN_MAG_DMG = 0x1A4 + MOD_FIREATT = 0x20 MOD_ICEATT = 0x21 MOD_WINDATT = 0x22 -MOD_EARTHATT = 0x23 -MOD_THUNDERATT = 0x24 -MOD_WATERATT = 0x25 -MOD_LIGHTATT = 0x26 +MOD_EARTHATT = 0x23 +MOD_THUNDERATT = 0x24 +MOD_WATERATT = 0x25 +MOD_LIGHTATT = 0x26 MOD_DARKATT = 0x27 MOD_FIREACC = 0x28 MOD_ICEACC = 0x29 MOD_WINDACC = 0x2A -MOD_EARTHACC = 0x2B -MOD_THUNDERACC = 0x2C -MOD_WATERACC = 0x2D -MOD_LIGHTACC = 0x2E +MOD_EARTHACC = 0x2B +MOD_THUNDERACC = 0x2C +MOD_WATERACC = 0x2D +MOD_LIGHTACC = 0x2E MOD_DARKACC = 0x2F + MOD_WSACC = 0x30 -MOD_SLASHRES = 0x31 -MOD_PIERCERES = 0x32 -MOD_IMPACTRES = 0x33 +MOD_WS_DMG = 0x1C9 + +MOD_SLASHRES = 0x31 +MOD_PIERCERES = 0x32 +MOD_IMPACTRES = 0x33 MOD_HTHRES = 0x34 + MOD_FIRERES = 0x36 MOD_ICERES = 0x37 MOD_WINDRES = 0x38 -MOD_EARTHRES = 0x39 -MOD_THUNDERRES = 0x3A -MOD_WATERRES = 0x3B -MOD_LIGHTRES = 0x3C +MOD_EARTHRES = 0x39 +MOD_THUNDERRES = 0x3A +MOD_WATERRES = 0x3B +MOD_LIGHTRES = 0x3C MOD_DARKRES = 0x3D + MOD_ATTP = 0x3E MOD_DEFP = 0x3F MOD_ACCP = 0x40 @@ -599,6 +723,7 @@ MOD_MPHEAL = 0x47 MOD_HPHEAL = 0x48 MOD_STORETP = 0x49 + MOD_HTH = 0x50 MOD_DAGGER = 0x51 MOD_SWORD = 0x52 @@ -612,28 +737,30 @@ MOD_CLUB = 0x5A MOD_STAFF = 0x5B MOD_ARCHERY = 0x68 -MOD_MARKSMAN = 0x69 +MOD_MARKSMAN = 0x69 MOD_THROW = 0x6A MOD_GUARD = 0x6B MOD_EVASION = 0x6C MOD_SHIELD = 0x6D MOD_PARRY = 0x6E + MOD_DIVINE = 0x6F MOD_HEALING = 0x70 MOD_ENHANCE = 0x71 -MOD_ENFEEBLE = 0x72 +MOD_ENFEEBLE = 0x72 MOD_ELEM = 0x73 MOD_DARK = 0x74 -MOD_SUMMONING = 0x75 -MOD_NINJUTSU = 0x76 +MOD_SUMMONING = 0x75 +MOD_NINJUTSU = 0x76 MOD_SINGING = 0x77 MOD_STRING = 0x78 MOD_WIND = 0x79 MOD_BLUE = 0x7A + MOD_FISH = 0x7F MOD_WOOD = 0x80 MOD_SMITH = 0x81 -MOD_GOLDSMITH = 0x82 +MOD_GOLDSMITH = 0x82 MOD_CLOTH = 0x83 MOD_LEATHER = 0x84 MOD_BONE = 0x85 @@ -641,34 +768,39 @@ MOD_COOK = 0x87 MOD_SYNERGY = 0x88 MOD_RIDING = 0x89 -MOD_ANTIHQ_WOOD = 0x90 -MOD_ANTIHQ_SMITH = 0x91 -MOD_ANTIHQ_GOLDSMITH = 0x92 -MOD_ANTIHQ_CLOTH = 0x93 -MOD_ANTIHQ_LEATHER = 0x94 -MOD_ANTIHQ_BONE = 0x95 -MOD_ANTIHQ_ALCHEMY = 0x96 -MOD_ANTIHQ_COOK = 0x97 +MOD_GOLDFISHING = 0x1D1 + +MOD_ANTIHQ_WOOD = 0x90 +MOD_ANTIHQ_SMITH = 0x91 +MOD_ANTIHQ_GOLDSMITH= 0x92 +MOD_ANTIHQ_CLOTH = 0x93 +MOD_ANTIHQ_LEATHER = 0x94 +MOD_ANTIHQ_BONE = 0x95 +MOD_ANTIHQ_ALCHEMY = 0x96 +MOD_ANTIHQ_COOK = 0x97 + MOD_DMG = 0xA0 MOD_DMGPHYS = 0xA1 -MOD_DMGBREATH = 0xA2 -MOD_DMGMAGIC = 0xA3 -MOD_DMGRANGE = 0xA4 -MOD_UDMGPHYS = 0x183 -MOD_UDMGBREATH = 0x184 -MOD_UDMGMAGIC = 0x185 -MOD_UDMGRANGE = 0186 -MOD_CRITHITRATE = 0xA5 -MOD_ENEMYCRITRATE = 0xA6 -MOD_HASTE_MAGIC = 0xA7 -MOD_SPELLINTERRUPT = 0xA8 +MOD_DMGBREATH = 0xA2 +MOD_DMGMAGIC = 0xA3 +MOD_DMGRANGE = 0xA4 +MOD_UDMGPHYS = 0x183 +MOD_UDMGBREATH = 0x184 +MOD_UDMGMAGIC = 0x185 +MOD_UDMGRANGE = 0x186 +MOD_CRITHITRATE = 0xA5 +MOD_ENEMYCRITRATE = 0xA6 +MOD_CRIT_DMG = 0x1CB +MOD_SHIELD_DEF = 0x1CC + +MOD_HASTE_MAGIC = 0xA7 +MOD_SPELLINTERRUPT = 0xA8 MOD_MOVE = 0xA9 -MOD_FASTCAST = 0xAA +MOD_FASTCAST = 0xAA MOD_DELAY = 0xAB -MOD_RANGED_DELAY = 0xAC -MOD_MARTIAL_ARTS = 0xAD -MOD_SKILLCHAINBONUS = 0xAE -MOD_SKILLCHAINDMG = 0xAF +MOD_RANGED_DELAY = 0xAC +MOD_SKILLCHAINBONUS = 0xAE +MOD_SKILLCHAINDMG = 0xAF MOD_FOOD_HPP = 0xB0 MOD_FOOD_HP_CAP = 0xB1 @@ -684,6 +816,7 @@ MOD_FOOD_RATT_CAP = 0xBB MOD_FOOD_RACCP = 0xBC MOD_FOOD_RACC_CAP = 0xBD + MOD_VERMIN_KILLER = 0xE0 MOD_BIRD_KILLER = 0xE1 MOD_AMORPH_KILLER = 0xE2 @@ -697,8 +830,9 @@ MOD_DEMON_KILLER = 0xEA MOD_EMPTY_KILLER = 0xEB MOD_HUMANOID_KILLER = 0xEC -MOD_LUMORIAN_KILLER = 0xED -MOD_LUMINION_KILLER = 0xEE +MOD_LUMORIAN_KILLER = 0xED +MOD_LUMINION_KILLER = 0xEE + MOD_SLEEPRES = 0xF0 MOD_POISONRES = 0xF1 MOD_PARALYZERES = 0xF2 @@ -706,43 +840,140 @@ MOD_SILENCERES = 0xF4 MOD_VIRUSRES = 0xF5 MOD_PETRIFYRES = 0xF6 -MOD_BINDRES = 0xF7 +MOD_BINDRES = 0xF7 MOD_CURSERES = 0xF8 MOD_GRAVITYRES = 0xF9 -MOD_SLOWRES = 0xFA -MOD_STUNRES = 0xFB +MOD_SLOWRES = 0xFA +MOD_STUNRES = 0xFB MOD_CHARMRES = 0xFC -MOD_UNKNOWN = 0xFF +MOD_DEATHRES = 0xFD +MOD_TERRORRES = 0xFE +MOD_AMNESIARES = 0xFF +MOD_DOOMRES = 0x19C + MOD_PARALYZE = 0x101 -MOD_MIJIN_GAKURE = 0x102 -MOD_DUAL_WIELD = 0x103 + +-- Paladin +MOD_SHIELD_BASH = 0x181 +MOD_SHIELD_MASTERY = 0x1CD + +-- Dark Knight +MOD_OCCULT_ACCUMEN = 0x1D0 +MOD_STALWART_SOUL = 0x1D5 +MOD_WEAPON_BASH = 0x1B1 +MOD_DARK_MAG_CAST = 0x1DA + +-- Warrior MOD_DOUBLE_ATTACK = 0x120 +MOD_RETALIATION_DMG = 0x1DB + +-- Monk MOD_SUBTLE_BLOW = 0x121 -MOD_COUNTER = 0x123 +MOD_COUNTER = 0x123 MOD_KICK_ATTACK = 0x124 +MOD_KICK_DMG = 0x182 +MOD_TACTICAL_GUARD = 0x1CE +MOD_MARTIAL_ARTS = 0xAD +MOD_COUNTER_BASE_DMG = 0x1D9 + +-- White Mage MOD_AFFLATUS_SOLACE = 0x125 MOD_AFFLATUS_MISERY = 0x126 +MOD_CURE_CAST = 0x18E +MOD_HEALING_CAST = 0x194 + +-- Black Mage MOD_CLEAR_MIND = 0x127 MOD_CONSERVE_MP = 0x128 -MOD_STEAL = 0x12A -MOD_BLINK = 0x12B +MOD_ELEMENTAL_CAST = 0x193 +MOD_ELEMENTAL_RECAST = 0x188 +MOD_BLACK_CAST = 0x18D + +-- Thief +MOD_STEAL = 0x12A +MOD_TRIPLE_ATTACK = 0x12E +MOD_TREASURE_HUNTER = 0x12F +MOD_SNEAK_ATK_MOD = 0x1CA +MOD_TRICK_ATK_MOD = 0x1D6 +MOD_SATA_DMG = 0x1D7 +MOD_GILFINDER = 0x1D4 + +-- Red Mage +MOD_BLINK = 0x12B MOD_STONESKIN = 0x12C -MOD_PHALANX = 0x12D -MOD_TRIPLE_ATTACK = 0x12E -MOD_TREASURE_HUNTER = 0x12F -MOD_TAME = 0x130 -MOD_RECYCLE = 0x131 -MOD_ZANSHIN = 0x132 +MOD_PHALANX = 0x12D +MOD_STONESKIN_CAST = 0x191 +MOD_ENHANCING_CAST = 0x197 +MOD_ENFEEBLING_CAST = 0x198 + +-- Beastmaster +MOD_TAME = 0x130 +MOD_CHARM_TIME = 0x168 +MOD_CHARM_CHANCE = 0x19B +MOD_REWARD_HP_BONUS = 0x16C +MOD_REWARD_RECAST = 0x18C + +-- Bard +MOD_SONG_RECAST = 0x187 +MOD_SONG_CAST = 0x18F +MOD_SONG_DURATION = 0x1B3 +MOD_SONG_EFFECTS = 0x1C8 +MOD_ALL_SONGS = 0x1B4 +MOD_ETUDE = 0x1B5 +MOD_REQUIEM = 0x1B6 +MOD_VIRELAI = 0x1B7 +MOD_MARCH = 0x1B8 +MOD_HYMNUS = 0x1B9 +MOD_MADRIGAL = 0x1BA +MOD_MINUET = 0x1BB +MOD_CAROL = 0x1BC +MOD_PAEON = 0x1BD +MOD_MAMBO = 0x1BE +MOD_LULLABY = 0x1BF +MOD_BALLAD = 0x1C0 +MOD_MAZURKA = 0x1C1 +MOD_THRENODY = 0x1C2 +MOD_FINALE = 0x1C3 +MOD_MINNE = 0x1C4 +MOD_SCHERZO = 0x1C5 +MOD_ELEGY = 0x1C6 +MOD_PRELUDE = 0x1C7 + +-- Ranger +MOD_RECYCLE = 0x131 +MOD_SHADOWBIND = 0x1D2 +MOD_WIDESCAN = 0x154 +MOD_RAPID_SHOT = 0x167 +MOD_SNAP_SHOT = 0x16D +MOD_BARRAGE = 0x1D3 + +-- Samurai +MOD_ZANSHIN = 0x132 +MOD_MEDITATE_DUR = 0x1B0 + +-- Ninja +MOD_STEALTH = 0x166 MOD_UTSUSEMI = 0x133 MOD_NINJA_TOOL = 0x134 +MOD_MIJIN_GAKURE = 0x102 +MOD_DUAL_WIELD = 0x103 +MOD_NINJUTSU_RECAST = 0x18A +MOD_UTSUSEMI_CAST = 0x195 + +-- Blue Mage MOD_BLUE_POINTS = 0x135 +MOD_BLUE_CAST = 0x196 +MOD_BLUE_RECAST = 0x189 + MOD_DEDICATION = 0x136 MOD_DEDICATION_CAP = 0x137 MOD_PET_MABB = 0x138 MOD_PET_MACC = 0x139 MOD_PET_ATTP = 0x13A -MOD_PET_ACC = 0x13B +MOD_PET_ACC = 0x13B MOD_DMG_REFLECT = 0x13C + +-- Corsair MOD_ROLL_ROGUES = 0x13D MOD_ROLL_GALLANTS = 0x13E MOD_ROLL_CHAOS = 0x13F @@ -758,44 +989,57 @@ MOD_ROLL_PUPPET = 0x149 MOD_ROLL_DANCERS = 0x14A MOD_ROLL_SCHOLARS = 0x14B -MOD_BUST = 0x14C +MOD_BUST = 0x14C + +-- Dancer MOD_FINISHING_MOVES = 0x14D +MOD_JIG_TIME = 0x1A6 +MOD_TACTICAL_PARRY = 0x1CF + +-- Scholar MOD_SUBLIMATION = 0x14E +MOD_SUBLIMATION_POOL = 0x1B2 MOD_STORMSURGE = 0x14F -MOD_LIGHT_ARTS_MPCOST = 0x150 -MOD_LIGHT_ARTS_FASTCAST = 0x151 -MOD_DARK_ARTS_MPCOST = 0x152 -MOD_DARK_ARTS_FASTCAST = 0x153 -MOD_WIDESCAN = 0x154 -MOD_ENSPELL = 0x155 -MOD_SPIKES = 0x156 -MOD_ENSPELL_DMG = 0x157 -MOD_SPIKES_DMG = 0x158 -MOD_AVATAR_PERPETUATION = 0x15A +MOD_LIGHT_ARTS_MPCOST = 0x150 +MOD_LIGHT_ARTS_FASTCAST = 0x151 +MOD_DARK_ARTS_MPCOST = 0x152 +MOD_DARK_ARTS_FASTCAST = 0x153 +MOD_GRIMOIRE_RECAST = 0x19A +MOD_GRIMOIRE_CAST = 0x190 + +MOD_ENSPELL = 0x155 +MOD_SPIKES = 0x156 +MOD_ENSPELL_DMG = 0x157 +MOD_SPIKES_DMG = 0x158 +MOD_ENSPELL_DURATION = 0x19D + +-- Summoner +MOD_AVATAR_PERPETUATION = 0x15A +MOD_ELE_AVATAR_RECAST = 0x18B +MOD_SUMMON_CAST = 0x192 + MOD_FIRE_AFFINITY = 0x15B MOD_EARTH_AFFINITY = 0x15C MOD_WATER_AFFINITY = 0x15D MOD_ICE_AFFINITY = 0x15E -MOD_THUNDER_AFFINITY = 0x15F +MOD_THUNDER_AFFINITY = 0x15F MOD_WIND_AFFINITY = 0x160 MOD_LIGHT_AFFINITY = 0x161 MOD_DARK_AFFINITY = 0x162 -MOD_STEALTH = 0x166 -MOD_RAPID_SHOT = 0x167 -MOD_CHARM_TIME = 0x168 +-- Dragoon MOD_JUMP_TP_BONUS = 0x169 MOD_JUMP_ATT_BONUS = 0x16A MOD_HIGH_JUMP_ENMITY_REDUCTION = 0x16B -MOD_REWARD_HP_BONUS = 0x16C -MOD_SNAP_SHOT = 0x16D +MOD_CRYSTAL_DROP = 0x1D8 + MOD_MAIN_DMG_RATING = 0x16E MOD_SUB_DMG_RATING = 0x16F -MOD_REGAIN = 0x170 -MOD_REFRESH = 0x171 -MOD_REGEN = 0x172 +MOD_REGAIN = 0x170 +MOD_REFRESH = 0x171 +MOD_REGEN = 0x172 MOD_CURE_POTENCY = 0x176 MOD_CURE_POTENCY_RCVD = 0x177 @@ -803,12 +1047,29 @@ MOD_RANGED_DELAYP = 0x17D MOD_EXP_BONUS = 0x17E MOD_HASTE_ABILITY = 0x17F -MOD_HASTE_GEAR = 0x180 -MOD_SHIELD_BASH = 0x181 -MOD_KICK_DMG = 0x182 -MOD_CHARM_CHANCE = 0x187 -MOD_WEAPON_BASH = 0x188 +MOD_HASTE_GEAR = 0x180 + +MOD_QUICK_MAGIC = 0x199 + +MOD_CHOCOBO_TIME = 0x19F +MOD_EAT_RAW_FISH = 0x1A0 +MOD_EAT_RAW_MEAT = 0x1A1 + +MOD_QUADRUPLE_ATTACK = 0x1A5 + +MOD_SNEAK_DUR = 0x1A7 +MOD_INVIS_DUR = 0x1A8 +MOD_ENHANCING_DUR = 0x1A9 +MOD_BARSPELL_DUR = 0x1AB +MOD_BARSPELL_PWR = 0x1AC +MOD_DRAIN_ASPIR = 0x1AD +MOD_CURSNA_EFFECT = 0x1AE +MOD_CURSNA_RCVD = 0x1AF + +MOD_STONESKIN_HP = 0x1AA + + ----------------------------------- -- Merit Definitions ----------------------------------- Index: scripts/globals/teleports.lua =================================================================== --- scripts/globals/teleports.lua (revision 3304) +++ scripts/globals/teleports.lua (working copy) @@ -3,7 +3,10 @@ -- by ReaperX -- coordinates marked {R} have been obtained by packet capture from retail. Don't change them. ----------------------------------- +require("scripts/globals/settings"); +require("scripts/globals/status"); + function toFeiYin(player) player:setPos(280, 20, 543, 192, 0x6F); end; @@ -19,7 +22,7 @@ function toBatalliaDowns(player) player:setPos(180,8,-420,167,0x69); -- to main entrance of the Eldieme Necropolis. end; - + function toThroneRoom(player) player:setPos(72, -4, 0, 128, 0xA5); end; @@ -106,7 +109,7 @@ function toCatBurglarsHideout(player) player:setPos(-5, 0, 21, 128, 0xC0); -- to G-8 in Inner Horutoto Ruins, Beetle's Burrow, in front of Mahagony Door. -end; +end; function toHouseOfTheHero(player) player:setPos(-26, -12, 253, 194, 0xEF); -- to the House of the Hero, G-4 Windurst Walls. @@ -126,8 +129,8 @@ function toPurgonorgoBibiki(player) player:setPos(-382, -2, -428, 190, 0x04) -- to Purgonorgo Isle (bibiki bay) -end; - +end; + function toWindurstMissionOverseer(player) which = player:getVar("firstmissionguard"); if(which == 1) then @@ -138,7 +141,7 @@ end; function toAltep(player) - player:setPos(-61.942,3.949,224.9,0,0x72); -- to Altep Telepoint {R} + player:setPos(-61.942,3.949,224.9,0,0x72); -- to Altep Telepoint {R} end; function toYhoat(player) @@ -172,7 +175,7 @@ function toChateaudOraguille(player) player:setPos(0, 0, 0, 192, 0xE9); end; - + function toGhelsba(player) player:setPos(-156, -10, 80, 119, 0x8C); -- to the BCNM hut in Ghelsba Outpost. end; @@ -182,7 +185,7 @@ end; function toSkyGreenPorterLeft(player) - player:setPos(-134.145, -32.327, -205.947, 215, 0x82); -- {R} + player:setPos(-134.145, -32.327, -205.947, 215, 0x82); -- {R} end; function toHallofTransferenceDem(player) @@ -204,7 +207,7 @@ function toHallofTransferenceMea(player) player:setPos(280.066, -80.63337, -67.096, 192, 0xE); -- {R} end; - + function toPalaceEntrance(player) player:setPos(-25, 0, -615, 200, 0x21); -- to Palace Entrance in Al'Taieu. end; @@ -254,28 +257,28 @@ -- ----------------- function toCampaignDestination(player, option) - if(option == 1) then + if(option == 1) then player:setPos(205.973,-23.5875,-206.606, 167, 0x89); -- Xarcabard [S] {R} elseif(option == 2) then player:setPos(-46.172,-60.1088,-38.487, 16, 0x88); -- Beaucedine Glacier [S] {R} - elseif(option == 3) then + elseif(option == 3) then player:setPos(306.939, -1, -141.567, 173, 0x54); -- Batallia Downs [S] {R} - elseif(option == 4) then + elseif(option == 4) then player:setPos(-4.701, 15.981, 235.996, 160, 0x5B); -- Rolanberry Fields [S] {R} - elseif(option == 5) then + elseif(option == 5) then player:setPos(-64.212, 7.579, -51.292, 192, 0x62); -- Sauromugue Champaign [S] {R} - elseif(option == 6) then + elseif(option == 6) then player:setPos(60.617, -3.952, 56.658, 64, 0x52); -- Jugner Forest [S] {R} - elseif(option == 7) then + elseif(option == 7) then player:setPos(504.088, 24.442, 628.36, 69, 0x5A); -- Pashhow Marshlands [S] {R} - elseif(option == 8) then + elseif(option == 8) then player:setPos(-447.084, 23.433, 586.847, 31, 0x61); -- Meriphataud Mountains [S] {R} - elseif(option == 9) then + elseif(option == 9) then player:setPos(-77.817, -47.234, -302.732, 135, 0x53); -- Vunkerl Inlet [S] {R} - elseif(option == 10) then + elseif(option == 10) then player:setPos(314.335, -36.368, -12.2, 192,0x59); -- Grauberg [S] {R} - elseif(option == 11) then - player:setPos(141.021, -45, 19.543, 0, 0x60); -- Fort Karugo-Narugo [S] {R} + elseif(option == 11) then + player:setPos(141.021, -45, 19.543, 0, 0x60); -- Fort Karugo-Narugo [S] {R} elseif(option == 12) then player:setPos(183.297, -19.9714, -240.895, 2, 0x51); -- East Ronfaure [S] {R} elseif(option == 13) then @@ -286,7 +289,7 @@ player:setPos(-98, 1, -41, 224, 0x50); -- Southern San d'Oria [S] {approximated from memory} elseif(option == 16) then player:setPos(-291, -10, -107, 212, 0x57); -- Bastok Markets [S] {appoximated from memory} - elseif(option == 17) then + elseif(option == 17) then player:setPos(-31.442, -5, 129.202, 128, 0x5E); -- Windurst Waters [S} {R} elseif(option == 18) then player:setPos(-194.095, 0, 30.009, 0, 0xA4); -- Garlaige Citdadel [S] {R} @@ -335,18 +338,68 @@ elseif(option == 18) then -- Meriphataud Mountains player:setPos(597,-32,279,95,0x77); -- Abyessa Maws - --Tahrongi Canyon (H-12) - --Konschtat Highlands (I-12) - --La Theine Plateau (E-4) - --Valkurm Dunes (I-9) - --Jugner Forest (J-8) - --Buburimu Peninsula (F-7) - --South Gustaberg (J-10) - --North Gustaberg (G-6) - --Xarcabard (H-8) + --Tahrongi Canyon (H-12) + --Konschtat Highlands (I-12) + --La Theine Plateau (E-4) + --Valkurm Dunes (I-9) + --Jugner Forest (J-8) + --Buburimu Peninsula (F-7) + --South Gustaberg (J-10) + --North Gustaberg (G-6) + --Xarcabard (H-8) end; end; +function toMaw(player, option) + if (option == 1) then -- Batallia Downs [S] + player:setPos(-48, 0, 437, 52, 0x54); + elseif (option == 2) then -- Batallia Downs + player:setPos(-49, 0, 435, 1, 0x69); + elseif (option == 3) then -- Rolanberry Fields [S] + player:setPos(-190, -8, 363, 11, 0x5b); + elseif (option == 4) then -- Rolanberry Fields + player:setPos(-193, 8, 360, 0, 0x6e); + elseif (option == 5) then -- Sauromugue Champaign [S] + player:setPos(372, 9, -228, 27, 0x62); + elseif (option == 6) then -- Sauromugue Champaign + player:setPos(370, 8, -228, 0, 0x78); + elseif (option == 7) then -- West Sarutabaruta [S] + player:setPos(0, 0, -164, 29, 0x5f); + elseif (option == 8) then -- West Sarutabaruta + player:setPos(0, 0, -164, 29, 0x73); + elseif (option == 9) then -- East Ronfaure [S] + player:setPos(320, -60, 500, 79, 0x51); + elseif (option == 10) then -- East Ronfaure + player:setPos(320, -60, 500, 79, 0x65); + elseif (option == 11) then -- North Gustaberg [S] + player:setPos(469, 0, 479, 254, 0x58); + elseif (option == 12) then -- North Gustaberg + player:setPos(469, 0, 479, 254, 0x6A); + --elseif (option == 13) then -- Jugner Forest [S] + -- player:setPos(); + --elseif (option == 14) then -- Jugner Forest + -- player:setPos(); + --elseif (option == 15) then -- Pashhow Marshlands [S] + -- player:setPos(); + --elseif (option == 16) then -- Pashhow Marshlands + -- player:setPos(); + --elseif (option == 17) then -- Meriphataud Mountains [S] + -- player:setPos(); + --elseif (option == 18) then -- Meriphataud Mountains + -- player:setPos(); + -- Abyessa Maws + --Tahrongi Canyon (H-12) + --Konschtat Highlands (I-12) + --La Theine Plateau (E-4) + --Valkurm Dunes (I-9) + --Jugner Forest (J-8) + --Buburimu Peninsula (F-7) + --South Gustaberg (J-10) + --North Gustaberg (G-6) + --Xarcabard (H-8) + end; +end; + function recallJugner(player) player:setPos(-122.862, 0, -163.154, 192, 0x52); -- {R} end; @@ -387,7 +440,7 @@ if(math.random(1,2) == 1) then player:setPos(133.4, 1.485, 47.427, 96, 0x32); -- Aht Urhgan Whitegate Chamber of Passage Left {R} else - player:setPos(116.67, 1.485, 47.427, 32, 0x32); -- Aht Urhgan Whitegate Chamber of Passage Right {R} + player:setPos(116.67, 1.485, 47.427, 32, 0x32); -- Aht Urhgan Whitegate Chamber of Passage Right {R} end end; @@ -404,7 +457,7 @@ end; function MamoolJaTrainingGround1(player) - player:setPos(-20, -2.271, -405, 63, 0x42); -- Mamool Ja Training Grounds Rank 1 + player:setPos(-20, -2.271, -405, 63, 0x42); -- Mamool Ja Training Grounds Rank 1 end; function MamoolJaTrainingExit(player) @@ -420,15 +473,15 @@ end; function toExplorerMoogle(player,zone) - if(zone == 231) then + if(zone == 231) then player:setPos(39.4, -0.2, 25, 253, zone); -- Northern_San_d'Oria - elseif(zone == 234) then + elseif(zone == 234) then player:setPos(76.82, 0, -66.12, 232, zone); -- Bastok_Mines - elseif(zone == 240) then + elseif(zone == 240) then player:setPos(185.6, -12, 223.5, 96, zone); -- Port_Windurst - elseif(zone == 248) then + elseif(zone == 248) then player:setPos(14.67, -14.56, 66.69, 96, zone); -- Selbina - elseif(zone == 249) then + elseif(zone == 249) then player:setPos(2.87, -4, 71.95, 0, zone); -- Mhaura end end; @@ -441,10 +494,30 @@ player:setPos(0.000, 9.000, -38.670, -67, 243); end; +----------------------------------- +-- debugTeleport +----------------------------------- +function debugTeleport(player,npcid) + if (DEBUG_MODE == 1) then + local npc = GetNPCByID(npcid); + if (npc ~= nil) then + player:setPos(npc:getXPos(), npc:getYPos(), npc:getZPos(), 0, npc:getZone()); + end + end +end; function toWajaomLaypoint(player) -- Wajaom Woodlands Laypoint player:setPos(-200,-10,80,125,0x33); end; +function debugTeleport(player,npcid) + if(DEBUG_MODE == 1) then + local npc = GetNPCByID(npcid); + if(npc ~= nil) then + player:setPos(npc:getXPos(), npc:getYPos(), npc:getZPos(), 0, npc:getZone()); + end + end +end; + ----------------------------------- -- Teleport Items ----------------------------------- @@ -477,28 +550,28 @@ zone = player:getZone(); -- Ronfaure if(zone == 100 or zone == 101 or zone == 139 or zone == 140 or zone == 141 or zone == 142 or zone == 190 or zone == 167 or zone == 230 or zone == 231 or zone == 232 or zone == 233) then - player:setPos(-446, -20 , -220, 0, 100); + player:setPos(-446, -20 , -220, 0, 100); -- Zulkheim elseif(zone == 248 or zone == 102 or zone == 103 or zone == 108 or zone == 193 or zone == 196) then - player:setPos(149, -7 , 94, 154, 103); + player:setPos(149, -7 , 94, 154, 103); -- Norvallen elseif(zone == 104 or zone == 105 or zone == 1 or zone == 2 or zone == 149 or zone == 150 or zone == 195) then - player:setPos(62, 0 , -1, 67, 104); + player:setPos(62, 0 , -1, 67, 104); -- Gustaberg elseif(zone == 234 or zone == 235 or zone == 236 or zone == 237 or zone == 106 or zone == 107 or zone == 172 or zone == 191 or zone == 143 or zone == 173 or zone == 144) then - player:setPos(-579, 39 , 62, 89, 106); + player:setPos(-579, 39 , 62, 89, 106); -- Derfland elseif(zone == 110 or zone == 109 or zone == 197 or zone == 148 or zone == 147) then - player:setPos(465, 24 , 422, 29, 109); + player:setPos(465, 24 , 422, 29, 109); -- Sarutabatura elseif(zone == 238 or zone == 239 or zone == 240 or zone == 241 or zone == 242 or zone == 115 or zone == 116 or zone == 169 or zone == 170 or zone == 192 or zone == 194 or zone == 145 or zone == 146) then - player:setPos(-15, -13 , 318, 128, 115); + player:setPos(-15, -13 , 318, 128, 115); -- Kolshushu elseif(zone == 249 or zone == 4 or zone == 117 or zone == 118 or zone == 198 or zone == 213) then - player:setPos(-480, -30 , 57, 62, 118); + player:setPos(-480, -30 , 57, 62, 118); -- Aragoneu elseif(zone == 7 or zone == 119 or zone == 120 or zone == 200 or zone == 151 or zone == 152 or zone == 8) then - player:setPos(-298, 17 , 418, 98, 119); + player:setPos(-298, 17 , 418, 98, 119); -- Fauregandi elseif(zone == 111 or zone == 166 or zone == 9 or zone == 204 or zone == 10 or zone == 206 or zone == 203) then player:setPos(-18, -59, -108, 100, 111); @@ -507,28 +580,28 @@ player:setPos(210, -23, -206, 160, 112); -- Qufim Island elseif(zone == 127 or zone == 126 or zone == 157 or zone == 158 or zone == 184 or zone == 179) then - player:setPos(-246, -20 , 301, 192, 126); + player:setPos(-246, -20 , 301, 192, 126); -- Lil'Telor elseif(zone == 122 or zone == 121 or zone == 251 or zone == 153 or zone == 154 or zone ==202) then - player:setPos(-38, 0, -140, 69, 121); + player:setPos(-38, 0, -140, 69, 121); -- Kuzotz elseif(zone == 247 or zone == 114 or zone == 125 or zone == 208 or zone == 209 or zone == 168) then - player:setPos(-250, 8, -252, 122, 114); + player:setPos(-250, 8, -252, 122, 114); -- Vollbow elseif(zone == 113 or zone == 128 or zone == 174 or zone == 212 or zone == 201) then - player:setPos(-184, 8, -66, 0, 113); + player:setPos(-184, 8, -66, 0, 113); -- Elshimo Lowlands elseif(zone == 250 or zone == 252 or zone == 176 or zone == 123) then - player:setPos(-243, 0, -400, 192, 123); + player:setPos(-243, 0, -400, 192, 123); -- Elshimo Uplands elseif(zone == 124 or zone == 159 or zone == 160 or zone == 205 or zone == 163 or zone == 211 or zone == 207) then - player:setPos(203, 0, -82, 36, 124); + player:setPos(203, 0, -82, 36, 124); -- Tulia ?! elseif(zone == 130 or zone == 177 or zone == 178 or zone == 180 or zone == 181) then - player:setPos(4, -54, -600, 192, 130); + player:setPos(4, -54, -600, 192, 130); -- Tavnazia elseif(zone == 26 or zone == 25 or zone ==24 or zone == 28 or zone == 29 or zone == 30 or zone == 31 or zone == 32 or zone == 27) then - player:setPos(-535, -6, -53, 122, 24); + player:setPos(-535, -6, -53, 122, 24); end end; @@ -595,28 +668,28 @@ zone = player:getZone(); -- Ronfaure if(zone == 100 or zone == 101 or zone == 139 or zone == 140 or zone == 141 or zone == 142 or zone == 190 or zone == 167 or zone == 230 or zone == 231 or zone == 232 or zone == 233) then - player:setPos(-446, -20 , -220, 0, 100); + player:setPos(-446, -20 , -220, 0, 100); -- Zulkheim elseif(zone == 248 or zone == 102 or zone == 103 or zone == 108 or zone == 193 or zone == 196) then - player:setPos(149, -7 , 94, 154, 103); + player:setPos(149, -7 , 94, 154, 103); -- Norvallen elseif(zone == 104 or zone == 105 or zone == 1 or zone == 2 or zone == 149 or zone == 150 or zone == 195) then - player:setPos(62, 0 , -1, 67, 104); + player:setPos(62, 0 , -1, 67, 104); -- Gustaberg elseif(zone == 234 or zone == 235 or zone == 236 or zone == 237 or zone == 106 or zone == 107 or zone == 172 or zone == 191 or zone == 143 or zone == 173 or zone == 144) then - player:setPos(-579, 39 , 62, 89, 106); + player:setPos(-579, 39 , 62, 89, 106); -- Derfland elseif(zone == 110 or zone == 109 or zone == 197 or zone == 148 or zone == 147) then - player:setPos(465, 24 , 422, 29, 109); + player:setPos(465, 24 , 422, 29, 109); -- Sarutabatura elseif(zone == 238 or zone == 239 or zone == 240 or zone == 241 or zone == 242 or zone == 115 or zone == 116 or zone == 169 or zone == 170 or zone == 192 or zone == 194 or zone == 145 or zone == 146) then - player:setPos(-15, -13 , 318, 128, 115); + player:setPos(-15, -13 , 318, 128, 115); -- Kolshushu elseif(zone == 249 or zone == 4 or zone == 117 or zone == 118 or zone == 198 or zone == 213) then - player:setPos(-480, -30 , 57, 62, 118); + player:setPos(-480, -30 , 57, 62, 118); -- Aragoneu elseif(zone == 7 or zone == 119 or zone == 120 or zone == 200 or zone == 151 or zone == 152 or zone == 8) then - player:setPos(-298, 17 , 418, 98, 119); + player:setPos(-298, 17 , 418, 98, 119); -- Fauregandi elseif(zone == 111 or zone == 166 or zone == 9 or zone == 204 or zone == 10 or zone == 206 or zone == 203) then player:setPos(-18, -59, -108, 100, 111); @@ -625,28 +698,28 @@ player:setPos(210, -23, -206, 160, 112); -- Qufim Island elseif(zone == 127 or zone == 126 or zone == 157 or zone == 158 or zone == 184 or zone == 179) then - player:setPos(-246, -20 , 301, 192, 126); + player:setPos(-246, -20 , 301, 192, 126); -- Lil'Telor elseif(zone == 122 or zone == 121 or zone == 251 or zone == 153 or zone == 154 or zone ==202) then - player:setPos(-38, 0, -140, 69, 121); + player:setPos(-38, 0, -140, 69, 121); -- Kuzotz elseif(zone == 247 or zone == 114 or zone == 125 or zone == 208 or zone == 209 or zone == 168) then - player:setPos(-250, 8, -252, 122, 114); + player:setPos(-250, 8, -252, 122, 114); -- Vollbow elseif(zone == 113 or zone == 128 or zone == 174 or zone == 212 or zone == 201) then - player:setPos(-184, 8, -66, 0, 113); + player:setPos(-184, 8, -66, 0, 113); -- Elshimo Lowlands elseif(zone == 250 or zone == 252 or zone == 176 or zone == 123) then - player:setPos(-243, 0, -400, 192, 123); + player:setPos(-243, 0, -400, 192, 123); -- Elshimo Uplands elseif(zone == 124 or zone == 159 or zone == 160 or zone == 205 or zone == 163 or zone == 211 or zone == 207) then - player:setPos(203, 0, -82, 36, 124); + player:setPos(203, 0, -82, 36, 124); -- Tulia ?! elseif(zone == 130 or zone == 177 or zone == 178 or zone == 180 or zone == 181) then - player:setPos(4, -54, -600, 192, 130); + player:setPos(4, -54, -600, 192, 130); -- Tavnazia elseif(zone == 26 or zone == 25 or zone ==24 or zone == 28 or zone == 29 or zone == 30 or zone == 31 or zone == 32 or zone == 27) then - player:setPos(-535, -6, -53, 122, 24); + player:setPos(-535, -6, -53, 122, 24); end end; @@ -668,4 +741,40 @@ function tavnzanianRing(player) player:setPos(9,-9,11,0,26); +end; + +function bastokMarketsGlyph(player) + player:setPos(-354,-10,-174,231,235); +end; + +function bastokMinesGlyph(player) + player:setPos(-14,-1,-122,194,234); +end; + +function bastokPortGlyph(player) + player:setPos(134,8,-10,92,236); +end; + +function sandoriaEastGlyph(player) + player:setPos(101,1,-46,159,230); +end; + +function sandoriaWestGlyph(player) + player:setPos(-103,1,-48,222,230); +end; + +function sandoriaNorthGlyph(player) + player:setPos(-241,8,45,5,231); +end; + +function windyWatersGlyph(player) + player:setPos(-40,-5,232,64,238); +end; + +function windyPortGlyph(player) + player:setPos(-232,-8,200,252,240); +end; + +function windyWoodsGlyph(player) + player:setPos(113,-5,-39,129,241); end; \ No newline at end of file Index: scripts/globals/utils.lua =================================================================== --- scripts/globals/utils.lua (revision 3304) +++ scripts/globals/utils.lua (working copy) @@ -109,6 +109,57 @@ return dmg * resist; end; +function utils.dmgToMP(target, dmg) + + if(target:getObjType() == TYPE_PC) then + local etherealMP = 0; + local percentMP = 0; + if(target:getEquipID(SLOT_EAR1) == 15965 or target:getEquipID(SLOT_EAR2) == 15965) then -- Ethereal Earring + percentMP = percentMP + .03; + end + if(target:getEquipID(SLOT_HEAD) == 11170) then -- Creed Armet +1 + percentMP = percentMP + .03; + end + if(target:getEquipID(SLOT_HEAD) == 11070) then -- Creed Armet +2 + percentMP = percentMP + .03; + end + etherealMP = math.floor(dmg * percentMP); + target:addMP(etherealMP); + if(etherealMP > 0) then + target:messageBasic(25,0,etherealMP); + end + -- printf("MP Gained %u",etherealMP); + end + +end; + +function utils.dmgToTP(target, dmg) + + if(target:getObjType() == TYPE_PC) then + local dmgTP = 0; + local percentTP = 0; + if(target:getEquipID(SLOT_SUB) == 28671) then -- Butznard Shield + percentTP = percentTP + .005; + end + if(target:getEquipID(SLOT_SUB) == 28669) then -- Butznard Shield +1 + percentTP = percentTP + .006; + end + if(target:getEquipID(SLOT_BODY) == 11868) then -- Mekira Meikogai + percentTP = percentTP + .014; + end + if(target:getEquipID(SLOT_BODY) == 11865) then -- Mekira Toshugai + percentTP = percentTP + .01; + end + if(target:getEquipID(SLOT_BODY) == 11871) then -- Mekira Toshugai +1 + percentTP = percentTP + .012; + end + dmgTP = math.floor(dmg * percentTP); + target:addTP(dmgTP); + -- printf("TP Gained %u",dmgTP); + end + +end; + function utils.breathDmgTaken(target, breathDmg) local resist = 1 + (target:getMod(MOD_UDMGBREATH) / 100); Index: scripts/globals/weaponskills.lua =================================================================== --- scripts/globals/weaponskills.lua (revision 3304) +++ scripts/globals/weaponskills.lua (working copy) @@ -179,11 +179,16 @@ end end finaldmg = finaldmg + souleaterBonus(attacker, (tpHitsLanded+extraHitsLanded)); + if(attacker:getMod(MOD_WS_DMG) > 0) then + finaldmg = finaldmg + (finaldmg * (attacker:getMod(MOD_WS_DMG)/100)); + end -- print("Landed " .. hitslanded .. "/" .. numHits .. " hits with hitrate " .. hitrate .. "!"); if(target:hasStatusEffect(EFFECT_FORMLESS_STRIKES) == false) then utils.dmgTaken(target, finaldmg); utils.physicalDmgTaken(target, finaldmg); + utils.dmgToMP(target, finaldmg); + utils.dmgToTP(target, finaldmg); end return finaldmg, tpHitsLanded, extraHitsLanded; @@ -196,7 +201,7 @@ if attacker:getMainJob() ~= 8 then percent = percent / 2; end - 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 + if attacker:getEquipID(SLOT_HEAD) == 12516 or attacker:getEquipID(SLOT_MAIN) == 18947 or attacker:getEquipID(SLOT_RING1) == 15818 or attacker:getEquipID(SLOT_RING2) == 15818 or attacker:getEquipID(SLOT_HEAD) == 15232 or attacker:getEquipID(SLOT_BODY) == 14409 or attacker:getEquipID(SLOT_LEGS) == 15370 then percent = percent + 0.02; end local hitscounted = 0; @@ -656,6 +661,7 @@ utils.dmgTaken(target, finaldmg); utils.rangedDmgTaken(target, finaldmg); + utils.dmgToMP(target, finaldmg); return finaldmg, tpHitsLanded, extraHitsLanded; end; @@ -663,22 +669,31 @@ function getMultiAttacks(attacker, numHits) local bonusHits = 0; local tripleChances = 1; + local quadrupleChances = 1; local doubleRate = attacker:getMod(MOD_DOUBLE_ATTACK)/100; local tripleRate = attacker:getMod(MOD_TRIPLE_ATTACK)/100; + local quadrupleRate = attacker:getMod(MOD_QUADRUPLE_ATTACK)/100; - --triple only procs on first hit, or first two hits if dual wielding + --triple and quadruple only procs on first hit, or first two hits if dual wielding if(attacker:getOffhandDmg() > 0) then tripleChances = 2; + quadrupleChance = 2; end for i = 1, numHits, 1 do chance = math.random(); - if (chance < tripleRate and i <= tripleChances) then + if (chance < quadrupleRate and i <= quadrupleChances) then + bonusHits = bonusHits + 3; + elseif (chance < tripleRate and i <= tripleChances) then bonusHits = bonusHits + 2; else - --have to check if triples are possible, or else double attack chance + --have to check if triples and quadruples are possible, or else double attack chance -- gets accidentally increased by triple chance (since it can only proc on 1 or 2) - if (i <= tripleChances) then + if (i <= quadrupleChances) then + if (chance < quadrupleRate + tripleRate) then + bonusHits = bonusHits + 2; + end + elseif (i <= tripleChances) then if (chance < tripleRate + doubleRate) then bonusHits = bonusHits + 1; end @@ -695,6 +710,7 @@ -- recalculate mods doubleRate = attacker:getMod(MOD_DOUBLE_ATTACK)/100; tripleRate = attacker:getMod(MOD_TRIPLE_ATTACK)/100; + quadrupleRate = attacker:getMod(MOD_QUADRUPLE_ATTACK)/100; end end if ((numHits + bonusHits ) > 8) then Index: scripts/globals/weaponskills/aeolian_edge.lua =================================================================== --- scripts/globals/weaponskills/aeolian_edge.lua (revision 3304) +++ scripts/globals/weaponskills/aeolian_edge.lua (working copy) @@ -1,14 +1,16 @@ +----------------------------------- -- Aeolian Edge -- Dagger weapon skill --- Delivers an area attack that deals wind elemental damage. Damage varies with TP. --- Skill Level: 290 --- Aligned with the Breeze Gorget, Soil Gorget & Thunder Gorget. --- Aligned with the Breeze Belt, Soil Belt & Thunder Belt. --- Element: Wind --- Skillchain Properties: Impaction / Scission / Detonation --- Modifiers: DEX:28%; INT:28% +-- Skill level: 290 +-- Delivers an area attack that deals wind elemental damage. Damage varies with TP. +-- This weapon skill is ranged and can be used from a distance (Up to 15'). +-- Directly affected by Magic Attack Bonus. +-- Aligned with the Breeze Gorget, Soil Gorget, & Thunder Gorget. +-- Aligned with the Breeze Belt, Soil Belt, & Thunder Belt. +-- Element: Wind +-- Modifiers: DEX:28% ; INT:28% -- 100%TP 200%TP 300%TP --- 2.75 3.50 4 +-- 2.75 3.50 4.00 ----------------------------------- require("scripts/globals/status"); @@ -20,13 +22,13 @@ local params = {}; params.numHits = 1; - params.ftp100 = 2.75; params.ftp200 = 3.50; params.ftp300 = 4; + params.ftp100 = 2.75; params.ftp200 = 3.50; params.ftp300 = 4.00; params.str_wsc = 0.0; params.dex_wsc = 0.28; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.28; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; params.canCrit = false; params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; params.atkmulti = 1; - damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); return tpHits, extraHits, damage; Index: scripts/globals/weaponskills/atonement.lua =================================================================== --- scripts/globals/weaponskills/atonement.lua (revision 0) +++ scripts/globals/weaponskills/atonement.lua (working copy) @@ -0,0 +1,35 @@ +----------------------------------- +-- Atonement +-- Sword weapon skill +-- Skill Level: NA +-- Delivers a twofold attack. Damage varies with TP. Burtgang: Aftermath effect varies with TP. +-- In order to obtain Atonement, the quest Unlocking a Myth must be completed. +-- Will stack with Sneak Attack. +-- Aligned with the Aqua Gorget, Flane Gorget & Light Gorget +-- Aligned with the Aqua Belt, Flame Belt & Light Belt. +-- Element: None +-- Modifiers: Related to accumulated Eminity +-- 100%TP 200%TP 300%TP +-- 1.00 1.75 2.50 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + + local params = {}; + params.numHits = 2; + params.ftp100 = 1; params.ftp200 = 1.75; params.ftp300 = 2.5; + params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.5; params.chr_wsc = 0.0; + params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; + params.canCrit = false; + params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; + params.atkmulti = 1; + local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + + return tpHits, extraHits, damage; + +end Index: scripts/globals/weaponskills/blade_ei.lua =================================================================== --- scripts/globals/weaponskills/blade_ei.lua (revision 0) +++ scripts/globals/weaponskills/blade_ei.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------- +-- Blade Ei +-- Katana weapon skill +-- Skill Level: 175 +-- Delivers a dark elemental attack. Damage varies with TP. +-- Aligned with the Shadow Gorget. +-- Aligned with the Shadow Belt. +-- Element: Dark +-- Modifiers: STR:30% ; INT:30% +-- 100%TP 200%TP 300%TP +-- 1.00 1.50 2.00 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + + local params = {}; + params.numHits = 1; + params.ftp100 = 1; params.ftp200 = 1.5; params.ftp300 = 2; + params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.3; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; + params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; + params.canCrit = false; + params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; + params.atkmulti = 1; + local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + + return tpHits, extraHits, damage; + +end Index: scripts/globals/weaponskills/blade_yu.lua =================================================================== --- scripts/globals/weaponskills/blade_yu.lua (revision 0) +++ scripts/globals/weaponskills/blade_yu.lua (working copy) @@ -0,0 +1,41 @@ +----------------------------------- +-- Blade Yu +-- Katana weapon skill +-- Skill Level: 290 +-- Delivers a water elemental attack. Additional effect Poison. Durration varies with TP. +-- Aligned with the Aqua Gorget & Soil Gorget. +-- Aligned with the Aqua Belt & Soil Belt. +-- Element: Water +-- Modifiers: DEX:50% ; INT:50% +-- 100%TP 200%TP 300%TP +-- 2.25 2.25 2.25 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + + local params = {}; + params.numHits = 1; + params.ftp100 = 2.25; params.ftp200 = 2.25; params.ftp300 = 2.25; + params.str_wsc = 0.0; params.dex_wsc = 0.5; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.5; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; + params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; + params.canCrit = false; + params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; + params.atkmulti = 1; + local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + + if damage > 0 then + local tp = player:getTP(); + local duration = (tp/100 * 15) + 75; + if(target:hasStatusEffect(EFFECT_POISON) == false) then + target:addStatusEffect(EFFECT_POISON, 10, 0, duration); + end + end + + return tpHits, extraHits, damage; + +end Index: scripts/globals/weaponskills/Cataclysm.lua =================================================================== --- scripts/globals/weaponskills/Cataclysm.lua (revision 3304) +++ scripts/globals/weaponskills/Cataclysm.lua (working copy) @@ -1,19 +1,14 @@ ----------------------------------- --- Skill level: 290 --- Delivers light elemental damage. Additional effect: Flash. Chance of effect varies with TP. --- Generates a significant amount of Enmity. --- Does not stack with Sneak Attack --- Aligned with Aqua Gorget. --- Aligned with Aqua Belt. --- Properties: --- Element: Light --- Skillchain Properties:Induration Reverberation --- Modifiers: STR:30% MND:30% --- Damage Multipliers by TP: --- 100%TP 200%TP 300%TP --- 3.00 3.00 3.00 - - +-- Cataclysm +-- Staff weapon skill +-- Skill Level: 290 +-- Deals dark elemental damage to enemy. Damage varies with TP. +-- Aligned with the Shadow Gorget & Aqua Gorget. +-- Aligned with the Shadow Belt & Aqua Belt. +-- Element: Dark +-- Modifiers: STR:30% ; INT:30% +-- 100%TP 200%TP 300%TP +-- 2.75 4.00 5.00 ----------------------------------- require("scripts/globals/status"); @@ -25,8 +20,8 @@ local params = {}; params.numHits = 2; - params.ftp100 = 3; params.ftp200 = 3; params.ftp300 = 3; - params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.3; params.chr_wsc = 0.0; + params.ftp100 = 2.75; params.ftp200 = 4; params.ftp300 = 5; + params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.3; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; params.canCrit = false; params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; Index: scripts/globals/weaponskills/coronach.lua =================================================================== --- scripts/globals/weaponskills/coronach.lua (revision 3304) +++ scripts/globals/weaponskills/coronach.lua (working copy) @@ -1,44 +1,33 @@ ------------------------------------ --- Skill Level: N/A --- Description: Additional effect: temporarily lowers enmity. --- Lowers Enmity for a certain amount of time. (Enmity -20) --- Regardless of the damage, Coronach hate is only 80CE / 240 VE (Enmity- effect included). --- This weapon skill is only available with the stage 5 relic Gun Annihilator, within Dynamis with the stage 4 Ferdinand or under the latent effect of Exequy Gun. --- Aligned with the Breeze Gorget & Thunder Gorget. --- Aligned with the Breeze Belt & Thunder Belt. --- Properties --- Element: None --- Skillchain Properties: Darkness/Fragmentation --- Modifiers: DEX:40% ; AGI:40% --- Damage Multipliers by TP: --- 100%TP 200%TP 300%TP --- 3.00 3.00 3.00 - - - - ------------------------------------ - -require("scripts/globals/status"); -require("scripts/globals/settings"); -require("scripts/globals/weaponskills"); ------------------------------------ - -function OnUseWeaponSkill(player, target, wsID) - +----------------------------------- +-- Coronach +-- Marksmanship weapon skill +-- Skill Level: NA +-- Delivers a ranged attack weaponskill. Additional effect temporarily lowers enmity. +-- Aligned with the Breeze Gorget & Thunder Gorget. +-- Aligned with the Breeze Belt & Thunder Belt. +-- Element: None +-- Modifiers: DEX:40% AGI:40% +-- 100%TP 200%TP 300%TP +-- 3.00 3.00 3.00 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + local params = {}; params.numHits = 1; params.ftp100 = 3; params.ftp200 = 3; params.ftp300 = 3; - params.str_wsc = 0.0; params.dex_wsc = 0.4; params.vit_wsc = 0.0; - params.agi_wsc = 0.4; params.int_wsc = 0.0; params.mnd_wsc = 0.0; - params.chr_wsc = 0.0; + params.str_wsc = 0.0; params.dex_wsc = 0.4; params.vit_wsc = 0.0; params.agi_wsc = 0.4; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; params.canCrit = false; - params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; + params.acc100 = 0.8; params.acc200= 0.9; params.acc300= 1; params.atkmulti = 2; - - damage, tpHits, extraHits = doRangedWeaponskill(player, target, params); - + local damage, tpHits, extraHits = doRangedWeaponskill(player, target, params); + return tpHits, extraHits, damage; - -end; + +end Index: scripts/globals/weaponskills/expiacion.lua =================================================================== --- scripts/globals/weaponskills/expiacion.lua (revision 0) +++ scripts/globals/weaponskills/expiacion.lua (working copy) @@ -0,0 +1,34 @@ +----------------------------------- +-- Expiacion +-- Sword weapon skill +-- Skill level: NA +-- Tizona: Aftermath effect varies with TP. +-- In order to obtain Expiacion, the quest Unlocking a Myth must be completed. +-- Description: Delivers a twofold attack. +-- Aligned with the Aqua Gorget, Snow Gorget & Soil Gorget. +-- Aligned with the Aqua Belt, Snow Belt & Soil Belt. +-- Element: None +-- Modifiers: STR:30% INT:30% +-- 100%TP 200%TP 300%TP +-- 1.5 2.0 2.5 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + + local params = {}; + params.numHits = 2; + params.ftp100 = 1.5; params.ftp200 = 2.0; params.ftp300 = 2.5; + params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.3; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; + params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; + params.canCrit = false; + params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; + params.atkmulti = 1; + local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + + return tpHits, extraHits, damage; +end Index: scripts/globals/weaponskills/Flash_Nova.lua =================================================================== --- scripts/globals/weaponskills/Flash_Nova.lua (revision 3304) +++ scripts/globals/weaponskills/Flash_Nova.lua (working copy) @@ -1,19 +1,14 @@ ----------------------------------- --- Skill level: 290 --- Delivers light elemental damage. Additional effect: Flash. Chance of effect varies with TP. --- Generates a significant amount of Enmity. --- Does not stack with Sneak Attack --- Aligned with Aqua Gorget. --- Aligned with Aqua Belt. --- Properties: +-- Flash Nova +-- Club weapon skill +-- Skill Level: 290 +-- Delivers a light elemental attack. Additional effect Flash. Chance of effect varies with TP. +-- Aligned with the Aqua Gorget. +-- Aligned with the Aqua Belt. -- Element: Light --- Skillchain Properties:Induration Reverberation --- Modifiers: STR:30% MND:30% --- Damage Multipliers by TP: --- 100%TP 200%TP 300%TP --- 3.00 3.00 3.00 - - +-- Modifiers: STR:30% ; MND:30% +-- 100%TP 200%TP 300%TP +-- 3.00 3.00 3.00 ----------------------------------- require("scripts/globals/status"); @@ -25,13 +20,24 @@ local params = {}; params.numHits = 2; - params.ftp100 = 3; params.ftp200 = 3; params.ftp300 = 3; + params.ftp100 = 3.00; params.ftp200 = 3.00; params.ftp300 = 3.00; params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.3; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; params.canCrit = false; params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; params.atkmulti = 1; local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + + if damage > 0 then + local tp = player:getTP(); + local chance = (math.random(80,150)); + if (tp >= chance) then + if(target:hasStatusEffect(EFFECT_FLASH) == false) then + target:addStatusEffect(EFFECT_FLASH, 100, 0, 15); + end + else + end + end return tpHits, extraHits, damage; Index: scripts/globals/weaponskills/glory_slash.lua =================================================================== --- scripts/globals/weaponskills/glory_slash.lua (revision 0) +++ scripts/globals/weaponskills/glory_slash.lua (working copy) @@ -0,0 +1,35 @@ +----------------------------------- +-- Glory Slash +-- Sword weapon skill +-- Skill Level: NA +-- Only avaliable during Campaign Battle while weilding Lex Talionis. +-- Delivers and area attacj that deals triple damage. Damage varies with TP. Additional effect Stun. +-- Will stack with Sneak Attack. +-- Aligned with the Flame Gorget & Light Gorget. +-- Aligned with the Flame Belt & Light Belt. +-- Element: Light +-- Modifiers: STR:30% +-- 100%TP 200%TP 300%TP +-- 3.00 3.50 4.00 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + + local params = {}; + params.numHits = 1; + params.ftp100 = 3; params.ftp200 = 3.5; params.ftp300 = 4; + params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; + params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; + params.canCrit = false; + params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; + params.atkmulti = 1; + local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + + return tpHits, extraHits, damage; + +end Index: scripts/globals/weaponskills/last_stand.lua =================================================================== --- scripts/globals/weaponskills/last_stand.lua (revision 3304) +++ scripts/globals/weaponskills/last_stand.lua (working copy) @@ -1,43 +1,32 @@ ------------------------------------ --- Skill Level: 357 --- Description: Attacks once or twice, depending on remaining ammunition. Damage dealt varies with TP. --- If the first shot of the weapon skill does enough damage to defeat the target, the second shot will not be used. --- To obtain Last Stand, the quest Martial Mastery must be completed. --- This Weapon Skill's first hit fTP is duplicated for all additional hits. --- Aligned with the Flame Gorget, Light Gorget & Aqua Gorget. --- Properties --- Element: N/A --- Skillchain Properties: Fusion/Reverberation --- Modifiers: AGI:100% --- Damage Multipliers by TP: --- 100%TP 200%TP 300%TP --- 2.0 2.125 2.25 - - ------------------------------------ - -require("scripts/globals/status"); -require("scripts/globals/settings"); -require("scripts/globals/weaponskills"); ------------------------------------ - -function OnUseWeaponSkill(player, target, wsID) - +----------------------------------- +-- Last Stand +-- Marksmanship weapon skill +-- Skill level: 357 +-- Delivers a twofold attack. Damage varies with TP. +-- Aligned with the Flame, Aqua & Light Gorgets. +-- Element: None +-- Modifiers: AGI: 100% +-- 100%TP 200%TP 300%TP +-- 2.00 2.125 2.25 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + local params = {}; - params.numHits = 1; + params.numHits = 2; params.ftp100 = 2; params.ftp200 = 2.125; params.ftp300 = 2.25; - params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; - params.agi_wsc = 1.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; - params.chr_wsc = 0.0; + params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 1.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; params.canCrit = false; params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; params.atkmulti = 1; - - -- needs ignore defense. param - - damage, tpHits, extraHits = doRangedWeaponskill(player, target, params); - + local damage, tpHits, extraHits = doRangedWeaponskill(player, target, params); + return tpHits, extraHits, damage; - -end; + +end Index: scripts/globals/weaponskills/leaden_salute.lua =================================================================== --- scripts/globals/weaponskills/leaden_salute.lua (revision 0) +++ scripts/globals/weaponskills/leaden_salute.lua (working copy) @@ -0,0 +1,34 @@ +----------------------------------- +-- Leaden Salute +-- Marksmanship weapon skill +-- Skill Level: NA +-- Deals darkness elemental damage. Damage varies with TP. +-- Death Penalty: Aftermath effect varies with TP. +-- Aligned with the Shadow, Soil, & Light Gorgets. +-- Aligned with the Shadow, Soil, & Light Belts. +-- Element: Darkness +-- Modifiers: AGI:30% +-- 100%TP 200%TP 300%TP +-- 4.00 4.25 4.75 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + + local params = {}; + params.numHits = 1; + params.ftp100 = 4; params.ftp200 = 4.25; params.ftp300 = 4.75; + params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.3; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; + params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; + params.canCrit = false; + params.acc100 = 0.8; params.acc200= 0.9; params.acc300= 1; + params.atkmulti = 1; + local damage, tpHits, extraHits = doRangedWeaponskill(player, target, params); + + return tpHits, extraHits, damage; + +end Index: scripts/globals/weaponskills/namas_arrow.lua =================================================================== --- scripts/globals/weaponskills/namas_arrow.lua (revision 3304) +++ scripts/globals/weaponskills/namas_arrow.lua (working copy) @@ -1,41 +1,35 @@ ------------------------------------ --- Skill Level: 357 --- Description: Attacks once or twice, depending on remaining ammunition. Damage dealt varies with TP. --- If the first shot of the weapon skill does enough damage to defeat the target, the second shot will not be used. --- To obtain Last Stand, the quest Martial Mastery must be completed. --- This Weapon Skill's first hit fTP is duplicated for all additional hits. --- Aligned with the Flame Gorget, Light Gorget & Aqua Gorget. --- Properties --- Element: N/A --- Skillchain Properties: Fusion/Reverberation --- Modifiers: AGI:100% --- Damage Multipliers by TP: --- 100%TP 200%TP 300%TP --- 2.0 2.125 2.25 - - ------------------------------------ - -require("scripts/globals/status"); -require("scripts/globals/settings"); -require("scripts/globals/weaponskills"); ------------------------------------ - -function OnUseWeaponSkill(player, target, wsID) - +----------------------------------- +-- Namas Arrow +-- Archery weapon skill +-- Skill level: NA +-- In order to obtain Namas Arrow, you must have Relic Weapons Futatokoroto or Yoichinoyumi equipped. +-- Delivers a single-hit attack. +-- Temporarily improves Ranged Accuracy. +-- Aligned with the Snow Gorget, Aqua Gorget, & Light Gorget. +-- Aligned with the Snow Belt, Aqua Belt, & Light Belt. +-- Element: None +-- Modifiers: STR:40% ; AGI:40% +-- 100%TP 200%TP 300%TP +-- 2.75 2.75 2.75 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + local params = {}; params.numHits = 1; - params.ftp100 = 2; params.ftp200 = 2.125; params.ftp300 = 2.25; - params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; - params.agi_wsc = 1.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; - params.chr_wsc = 0.0; + params.ftp100 = 2; params.ftp200 = 2.75; params.ftp300 = 3; + params.str_wsc = 0.40; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.40; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; params.canCrit = false; params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; params.atkmulti = 2; - - damage, tpHits, extraHits = doRangedWeaponskill(player, target, params); - + local damage, tpHits, extraHits = doRangedWeaponskill(player, target, params); + return tpHits, extraHits, damage; - -end; + +end Index: scripts/globals/weaponskills/retribution.lua =================================================================== --- scripts/globals/weaponskills/retribution.lua (revision 3304) +++ scripts/globals/weaponskills/retribution.lua (working copy) @@ -31,7 +31,12 @@ params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; params.atkmulti = 1; local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + local grip = player:getEquipID(SLOT_SUB); + local damageMod = damage; - return tpHits, extraHits, damage; + if (grip == 18813) then -- Ultio Grip + damageMod = damage * 1.1; + end + return tpHits, extraHits, damageMod; end Index: scripts/globals/weaponskills/sanguine_blade.lua =================================================================== --- scripts/globals/weaponskills/sanguine_blade.lua (revision 0) +++ scripts/globals/weaponskills/sanguine_blade.lua (working copy) @@ -0,0 +1,44 @@ +----------------------------------- +-- Sanguine Blade +-- Sword weapon skill +-- Skill Level: 300 +-- Drains a percentage of damage dealt to HP varies with TP. +-- Will not stack with Sneak Attack. +-- Not aligned with any "elemental gorgets" or "elemental belts" due to it's absence of Skillchain properties. +-- Element: Dark +-- Modifiers: STR:30% ; MND:50% +-- 100%TP 200%TP 300%TP +-- 2.75 2.75 2.75 +-- HP Drained by TP: +-- 100%TP 200%TP 300%TP +-- 50% 75% 100% +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + local tp = player:getTP(); + local drain = 0; + if(tp >= 100 and tp <=199) then + drain = 50; + elseif(tp >= 200 and tp <= 299) then + drain = 75; + elseif(tp == 300) then + drain = 100; + end + local params = {}; + params.numHits = 1; + params.ftp100 = 2.75; params.ftp200 = 2.75; params.ftp300 = 2.75; + params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.5; params.chr_wsc = 0.0; + params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; + params.canCrit = false; + params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; + params.atkmulti = 1; + local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + player:addHP(damage/drain); + return tpHits, extraHits, damage; + +end Index: scripts/globals/weaponskills/Shattersoul.lua =================================================================== --- scripts/globals/weaponskills/Shattersoul.lua (revision 3304) +++ scripts/globals/weaponskills/Shattersoul.lua (working copy) @@ -1,19 +1,14 @@ ----------------------------------- --- Skill Level: 357 --- Description: Delivers a threefold attack. Decreases target's magic defense. Duration of effect varies with TP. --- To obtain Shattersoul, the quest Martial Mastery must be completed and it must be purchased from the Merit Points menu. --- Target's magic defense is lowered by 10. --- Aligned with the Shadow Gorget, Soil Gorget & Snow Gorget. --- Aligned with the Shadow Belt, Soil Belt & Snow Belt. --- Element: N/A --- Skillchain Properties: Gravitation/Induration ---Shattersoul is only available to Warriors, Monks, White Mages, Black Mages, Paladins, Bards, Dragoons, Summoners and Scholars. --- While some jobs may obtain skill level 357 earlier than level 96, Shattersoul must be unlocked once skill reaches level 357 and job level 96 is reached. --- Staff skill level 357 is obtainable by the following jobs at these corresponding levels: --- Modifiers: INT:20~100%, depending on merit points ugrades. --- Damage Multipliers by TP: +-- Shattersoul +-- Staff weapon skill +-- Skill level: 357 +-- Decreases target's Magic Defense. Duration of effect varies with TP. +-- Aligned with the Shadow, Soil, and Snow Gorgets. +-- Aligned with the Shadow, Soil, and Snow Belts. +-- Element: None +-- Modifiers: INT:20%~100% Depending on Merit Point upgrades. -- 100%TP 200%TP 300%TP --- 1.375 1.375 1.375 +-- 1.375 1.375 1.375 ----------------------------------- require("scripts/globals/status"); @@ -24,14 +19,22 @@ function OnUseWeaponSkill(player, target, wsID) local params = {}; - params.numHits = 2; - params.ftp100 = 1.375; params.ftp200 = 1.375; params.ftp300 = 1.375; + params.numHits = 3; + params.ftp100 = 1; params.ftp200 = 1; params.ftp300 = 1; params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.2; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; params.canCrit = false; params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; params.atkmulti = 1; local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + + if damage > 0 then + local tp = player:getTP(); + local duration = (tp/100 * 60); + if(target:hasStatusEffect(EFFECT_MAGIC_DEF_DOWN) == false) then + target:addStatusEffect(EFFECT_MAGIC_DEF_DOWN, 10, 0, duration); + end + end return tpHits, extraHits, damage; Index: scripts/globals/weaponskills/starlight.lua =================================================================== --- scripts/globals/weaponskills/starlight.lua (revision 3304) +++ scripts/globals/weaponskills/starlight.lua (working copy) @@ -9,5 +9,8 @@ local lvl = attacker:getSkillLevel(11); --get club skill local damage = (lvl-10)/9; local damagemod = damage * (attacker:getTP()/100); + if (attacker:getEquipID(SLOT_MAIN) == 18887 or attacker:getEquipID(SLOT_SUB) == 18887) then + damagemod = damage * (attacker:getTP()/100) * 3; + end return 1, 0, damagemod; end Index: scripts/globals/weaponskills/stringing_pummel.lua =================================================================== --- scripts/globals/weaponskills/stringing_pummel.lua (revision 0) +++ scripts/globals/weaponskills/stringing_pummel.lua (working copy) @@ -0,0 +1,34 @@ +----------------------------------- +-- Stringing Pummel +-- Hand-to-Hand weapon skill +-- Skill Level: NA +-- Delivers an sixfold attack. Chance of critical varies with TP. +-- Kenkonken:Aftermath effect varies with TP. +-- In order to obtain Stringing Pummel, the quest Unlocking a Myth must be completed. +-- Aligned with the Shadow Gorget, Soil Gorget & Flame Gorget. +-- Aligned with the Shadow Belt, Soil Belt & Flame Belt. +-- Element: None +-- Modifiers: STR:32% ; VIT:32% +-- 100%TP 200%TP 300%TP +-- 0.75 0.75 0.75 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + + local params = {}; + params.numHits = 6; + params.ftp100 = 0.75; params.ftp200 = 0.75; params.ftp300 = 0.75; + params.str_wsc = 0.32; params.dex_wsc = 0.0; params.vit_wsc = 0.32; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; + params.crit100 = 0.2; params.crit200 = 0.3; params.crit300 = 0.45; + params.canCrit = false; + params.acc100 = 0.8; params.acc200= 0.9; params.acc300= 1; + params.atkmulti = 1; + local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + return tpHits, extraHits, damage; + +end Index: scripts/globals/weaponskills/tachi_ageha.lua =================================================================== --- scripts/globals/weaponskills/tachi_ageha.lua (revision 3304) +++ scripts/globals/weaponskills/tachi_ageha.lua (working copy) @@ -1,15 +1,12 @@ ----------------------------------- --- Tachi Ageha +-- Tachi:Ageha -- Great Katana weapon skill --- Skill Level: 300 --- Lowers target's defense. Chance of lowering target's defense varies with TP. --- 30% Defense Down --- Duration of effect is exactly 3 minutes. --- Aligned with the Shadow Gorget, Soil Gorget. --- Aligned with the Shadow Belt, Soil Belt. --- Element: None --- Skillchain Properties: Compression/Scission --- Modifiers: CHR:50% +-- Skill level: 300 +-- Lowers targets defense. Chance of lowering target's defense varies with TP. +-- Aligned with the Shadow and Soil Gorgets. +-- Aligned with the Shadow and Soil Belts. +-- Element: None +-- Modifiers: CHR:50% -- 100%TP 200%TP 300%TP -- 2.80 2.80 2.80 ----------------------------------- @@ -23,18 +20,25 @@ local params = {}; params.numHits = 1; - params.ftp100 = 2.80; params.ftp200 = 2.80; params.ftp300 = 2.80; - params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.50; + params.ftp100 = 2.8; params.ftp200 = 2.8; params.ftp300 = 2.8; + params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.5; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; params.canCrit = false; params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; params.atkmulti = 1; - damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + + if damage > 0 then + local tp = player:getTP(); + local chance = (math.random(80,150)); + if (tp >= chance) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN, 27, 0, 180); + end + else + end + end - if damage > 0 and (target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then - target:addStatusEffect(EFFECT_DEFENSE_DOWN, 27, 0, 180); - end - return tpHits, extraHits, damage; end Index: scripts/globals/weaponskills/tachi_goten.lua =================================================================== --- scripts/globals/weaponskills/tachi_goten.lua (revision 0) +++ scripts/globals/weaponskills/tachi_goten.lua (working copy) @@ -0,0 +1,34 @@ +----------------------------------- +-- Tachi Goten +-- Great Katana weapon skill +-- Skill Level: 70 +-- Deals lightning elemental damage to enemy. Damage varies with TP. +-- Will stack with Sneak Attack. +-- Aligned with the Light Gorget / Thunder Gorget. +-- Aligned with the Light Belt / Thunder Belt. +-- Element: Thunder +-- Modifiers: STR:30% +-- 100%TP 200%TP 300%TP +-- 1.00 1.00 1.00 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + + local params = {}; + params.numHits = 1; + params.ftp100 = 1.0; params.ftp200 = 1.0; params.ftp300 = 1.0; + params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; + params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; + params.canCrit = false; + params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; + params.atkmulti = 1; + local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + + return tpHits, extraHits, damage; + +end \ No newline at end of file Index: scripts/globals/weaponskills/tartarus_torpor.lua =================================================================== --- scripts/globals/weaponskills/tartarus_torpor.lua (revision 0) +++ scripts/globals/weaponskills/tartarus_torpor.lua (working copy) @@ -0,0 +1,47 @@ +----------------------------------- +-- Tartarus Torpor +-- Staff weapon skill +-- Skill level: NA +-- Puts to sleep enemies within the area of effect and lowers their magical defense and magical evasion. +-- Duration of effect varies with TP. +-- Only avaliable during Campaign Battles while wielding Samudra +-- Element: None +-- Modifiers: INT:30% STR:30% +-- 100%TP 200%TP 300%TP +-- 2.75 4.00 5.00 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + + local params = {}; + params.numHits = 1; + params.ftp100 = 2.75; params.ftp200 = 4; params.ftp300 = 5; + params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.3; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; + params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; + params.canCrit = false; + params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; + params.atkmulti = 1; + local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + + if damage > 0 then + local tp = player:getTP(); + local duration = (tp/100 * 60); + if(target:hasStatusEffect(EFFECT_MAGIC_DEF_DOWN) == false) then + target:addStatusEffect(EFFECT_MAGIC_DEF_DOWN, 10, 0, duration); + end + if(target:hasStatusEffect(EFFECT_MAGIC_EVASION_DOWN) == false) then + target:addStatusEffect(EFFECT_MAGIC_EVASION_DOWN, 10, 0, duration); + end + if(target:hasStatusEffect(EFFECT_SLEEP) == false) then + target:addStatusEffect(EFFECT_SLEEP, 100, 0, duration); + end + end + + return tpHits, extraHits, damage; + +end Index: scripts/globals/weaponskills/trueflight.lua =================================================================== --- scripts/globals/weaponskills/trueflight.lua (revision 3304) +++ scripts/globals/weaponskills/trueflight.lua (working copy) @@ -1,45 +1,34 @@ ------------------------------------ --- Skill Level: N/A --- Description: Deals light elemental damage. Damage varies with TP. Gastraphetes: Aftermath effect varies with TP. --- Available only after completing the Unlocking a Myth (Ranger) quest. --- Does not work with Flashy Shot. --- Does not work with Stealth Shot. --- Aligned with the Breeze Gorget, Thunder Gorget & Soil Gorget. --- Aligned with the Breeze Belt, Thunder Belt & Soil Belt. --- Properties --- Element: Light --- Skillchain Properties: Fragmentation/Scission --- Modifiers: AGI:30% --- Damage Multipliers by TP: --- 100%TP 200%TP 300%TP --- 4.0 4.25 4.75 - - - ------------------------------------ - -require("scripts/globals/status"); -require("scripts/globals/settings"); -require("scripts/globals/weaponskills"); ------------------------------------ - -function OnUseWeaponSkill(player, target, wsID) - +----------------------------------- +-- Trueflight +-- Marksmanship weapon skill +-- Skill Level: NA +-- Deals light elemental damage. Damage varies with TP. +-- Aftermath effect varies with TP. +-- Aligned with the Breeze, Soil, & Thunder Gorgets. +-- Aligned with the Breeze Belt, Soil, & Thunder Belts. +-- Element: Light +-- Modifiers: AGI:30% +-- 100%TP 200%TP 300%TP +-- 4.00 4.25 4.75 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + local params = {}; params.numHits = 1; params.ftp100 = 4; params.ftp200 = 4.25; params.ftp300 = 4.75; - params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; - params.agi_wsc = 0.3; params.int_wsc = 0.0; params.mnd_wsc = 0.0; - params.chr_wsc = 0.0; + params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.3; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; params.canCrit = false; - params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; + params.acc100 = 0.8; params.acc200= 0.9; params.acc300= 1; params.atkmulti = 1; - - -- needs ignore defense. param - - damage, tpHits, extraHits = doRangedWeaponskill(player, target, params); - + local damage, tpHits, extraHits = doRangedWeaponskill(player, target, params); + return tpHits, extraHits, damage; - -end; + +end Index: scripts/globals/weaponskills/uriel_blade.lua =================================================================== --- scripts/globals/weaponskills/uriel_blade.lua (revision 0) +++ scripts/globals/weaponskills/uriel_blade.lua (working copy) @@ -0,0 +1,38 @@ +----------------------------------- +-- Uriel Blade +-- Sword weapon skill +-- Skill Level: NA +-- Delivers and area attack that deals light elemental damage. Damage varies with TP. Additional effect Flash. +-- Only avaliable durring Campaign Battle while weilding a Griffinclaw +-- Aligned with the Thunder Gorget & Breeze Gorget. +-- Aligned with the Thunder Belt & Breeze Belt. +-- Element: Light +-- Modifiers: STR:32% MND:32% +-- 100%TP 200%TP 300%TP +-- 4.50 6.00 7.50 +----------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + + local params = {}; + params.numHits = 1; + params.ftp100 = 4.5; params.ftp200 = 6.0; params.ftp300 = 7.5; + params.str_wsc = 0.32; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.32; params.chr_wsc = 0.0; + params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; + params.canCrit = false; + params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; + params.atkmulti = 1; + local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, params); + + if(target:hasStatusEffect(EFFECT_FLASH) == false) then + target:addStatusEffect(EFFECT_FLASH, 100, 0, 30); + end + + return tpHits, extraHits, damage; + +end Index: scripts/globals/weaponskills/wildfire.lua =================================================================== --- scripts/globals/weaponskills/wildfire.lua (revision 0) +++ scripts/globals/weaponskills/wildfire.lua (working copy) @@ -0,0 +1,33 @@ +----------------------------------- +-- Wildfire +-- Marksmanship weapon skill +-- Skill level: 357 +-- Empyrean Weapon Skill +-- COR Main Job Required +-- Aligned with the Light Gorget & Flame Gorget. +-- Aligned with the Light Belt & Flame Belt. +-- Element: +-- Modifiers: AGI:60% +-- 100%TP 200%TP 300%TP +-- 5.5 5.5 5.5 +----------------------------------- +require("scripts/globals/status"); +require("scripts/globals/settings"); +require("scripts/globals/weaponskills"); +----------------------------------- + +function OnUseWeaponSkill(player, target, wsID) + + local params = {}; + params.numHits = 1; + params.ftp100 = 5.5; params.ftp200 = 5.5; params.ftp300 = 5.5; + params.str_wsc = 0.16; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.6; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; + params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; + params.canCrit = false; + params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; + params.atkmulti = 1; + damage, tpHits, extraHits = doRangedWeaponskill(player, target, params); + + return tpHits, extraHits, damage; + +end \ No newline at end of file Index: src/common/mmo.h =================================================================== --- src/common/mmo.h (revision 3304) +++ src/common/mmo.h (working copy) @@ -74,8 +74,8 @@ typedef std::string string_t; -// для персонажей в size хранится рост, -// для npc и монстров что-то вроде типа используемой модели +// Size of the characters in the store growth +// Npc and monsters for a bit of product model struct look_t { @@ -112,23 +112,23 @@ // index SkillID 0-63 uint16 skill[64]; }; - // ранг используется только в ремеслах. размер 64 необходим для совместимости ID + // Rank is used only in the arts. size of 64 is required for compatibility ID uint8 rank[64]; }; struct keyitems_t { - uint8 keysList[320]; // таблица ключевых предметов - uint8 seenList[320]; // таблица ключевых предметов, отмеченных как "увиденные" + uint8 keysList[320]; // table of key items + uint8 seenList[320]; // table of key items that are marked as "seen" }; struct position_t { - uint8 rotation; // угол поворота сущности относительно своей позиции (используется 255 система, место 360°) + uint8 rotation; // angle of rotation of the essence with respect to its position (using 255 systems, the 360 °) float x; - float y; // высота расположения сущности относительно "уровня моря" + float y; // height the location of essence relatively "sea level" float z; - uint16 moving; // что-то вроде расстояния перемещения, необходимое для правильной отрисовки в клиенте количества шагов сущности + uint16 moving; // sort of distance traveled, necessary for the proper rendering of the number of steps in the client entity }; struct stats_t @@ -176,10 +176,10 @@ // информация для окна поиска struct search_t { - uint8 language; // предпочтительный язык общения - uint8 messagetype; // тип комментария + uint8 language; // the preferred language of communication + uint8 messagetype; // type of comment - string_t message; // комментарий поиска + string_t message; // comment search }; struct bazaar_t @@ -187,12 +187,12 @@ string_t message; }; -// небольшой комментарий к пакетам ниже, определенным в виде констант -// 1-й байт - размер пакета -// через 4-ре байта начинается заголовк 0x49, 0x58, 0x46, 0x46 - IXFF -// после заголовка идет предположительно тип сообщения: -// 0x03 - положительный результат -// 0x04 - ошибка (в случае ошибки начиная с 33 байта идет код ошибки uint16) +// A comment on the packages below, defined as constants +// 1 byte - packet size +// A 4-D bytes File Title starts 0x49, 0x58, 0x46, 0x46 - IXFF +// After the title is presumably the type of message: +// 0x03 - positive +// 0x04 - error (in the case of error ranging from 33 bytes is an error code uint16) #define LOBBY_A1_RESERVEPACKET(a)\ unsigned char a[] = { \ Index: src/login/lobby.cpp =================================================================== --- src/login/lobby.cpp (revision 3304) +++ src/login/lobby.cpp (working copy) @@ -123,11 +123,11 @@ unsigned char CharList[2500]; memset(CharList,0,sizeof(CharList)); - //запись зарезервированных чисел + //Record numbers of reserved CharList[0] = 0xE0;CharList[1] = 0x08; CharList[4] = 0x49;CharList[5] = 0x58;CharList[6] = 0x46;CharList[7] = 0x46;CharList[8] = 0x20; - CharList[28] = 16; // количество ячеек, доступных для создания персонажей (0-16) + CharList[28] = 16; // the number of cells available for creating characters (0-16) const char *pfmtQuery = "SELECT charid, charname, pos_zone, pos_prevzone, mjob,\ race, face, head, body, hands, legs, feet, main, sub,\ @@ -152,7 +152,7 @@ //server's name that shows in lobby menu memcpy(ReservePacket+60, login_config.servername, dsp_cap(strlen(login_config.servername), 0, 15)); - //Подготовка пространства в пакете для информации о 16 игровых персонажах + //Preparing the space in the packet for information about the 16 game characters for(int j = 0; j<16; ++j) { memcpy(CharList+32+140*j, ReservePacket+32, 140); @@ -168,8 +168,8 @@ int i = 0; - //Считывание информации о конкректном персонаже - //Загрузка всей необходимой информации о персонаже из базы + //Reading information about a specific character + //Download all the information about a character from the database while(Sql_NextRow(SqlHandle) != SQL_NO_DATA) { char* strCharName = NULL; @@ -204,7 +204,7 @@ WBUFW(CharList,68+32+i*140) = (uint16)Sql_GetIntData(SqlHandle,12); // main; WBUFW(CharList,70+32+i*140) = (uint16)Sql_GetIntData(SqlHandle,13); // sub; - WBUFB(CharList,72+32+i*140) = (zone == 0 ? prevzone : zone); // если персонаж в MogHouse + WBUFB(CharList,72+32+i*140) = (zone == 0 ? prevzone : zone); // if a character in MogHouse /////////////////////////////////////////////////// ++i; } @@ -287,7 +287,7 @@ memcpy(MainReservePacket,ReservePacket,RBUFB(ReservePacket,0)); - // необходиму одалять сессию, необработанную игровым сервером + // necessary to remove the session, the raw game server Sql_Query(SqlHandle,"DELETE FROM accounts_sessions WHERE accid = %u and client_port = 0", sd->accid); int8 session_key[sizeof(key3)*2+1]; @@ -297,9 +297,9 @@ if( Sql_Query(SqlHandle, fmtQuery, sd->accid, charid, session_key, ZoneIP, ZonePort, sd->client_addr) == SQL_ERROR ) { - //отправляем клиенту сообщение об ошибке + //send an error message to the client LOBBBY_ERROR_MESSAGE(ReservePacket); - // устанавливаем код ошибки + // set the error code // Unable to connect to world server. Specified operation failed WBUFW(ReservePacket,32) = 305; memcpy(MainReservePacket,ReservePacket,RBUFB(ReservePacket,0)); @@ -319,7 +319,7 @@ RFIFOFLUSH(sd->login_lobbyview_fd); if (SendBuffSize == 0x24){ - // выходим в случае ошибки без разрыва соединения + // leave in case of an error without disconnection return -1; } @@ -426,11 +426,11 @@ LOBBY_026_RESERVEPACKET(ReservPacket); WBUFW(ReservPacket,32) = login_config.expansions; // BitMask for expansions; - //Хеширование пакета, и запись значения Хеш функции в пакет + //Hashing package, and write the value hash functions in a package unsigned char Hash[16]; md5(ReservPacket, Hash, SendBuffSize); memcpy(ReservPacket+12,Hash,16); - //Запись итогового пакета + //Record the final package memcpy(session[fd]->wdata,ReservPacket,SendBuffSize); RFIFOSKIP(fd,session[fd]->rdata_size); @@ -463,8 +463,8 @@ RFIFOSKIP(fd,session[fd]->rdata_size); RFIFOFLUSH(fd); - //Выполнение удаления персонажа из основных таблиц - //Достаточно удалить значение из таблицы chars, все остальное сделает mysql-сервер + // Execute the removal of the character of the main table + // Just remove the value from the table chars, everything else will make mysql-server const char *pfmtQuery = "DELETE FROM chars WHERE charid = %i"; Sql_Query(SqlHandle,pfmtQuery,CharID); @@ -582,10 +582,10 @@ { ShowWarning(CL_WHITE"lobbyview_parse:" CL_RESET" character name " CL_WHITE"<%s>" CL_RESET"already taken\n",CharName); LOBBBY_ERROR_MESSAGE(ReservePacket); - // устанавливаем код ошибки + //set the error code // The character name you entered is unavailable. Please choose another name. - // сообщение отображается на японском + // message is displayed in Japanese WBUFW(ReservePacket,32) = 313; memcpy(MainReservePacket,ReservePacket,sendsize); }else{ @@ -634,7 +634,7 @@ int32 lobby_createchar(login_session_data_t *loginsd, char *buf) { - // инициализируем генератор случайных чисел + // initialize the random number generator srand(clock()); char_mini createchar; Index: src/map/ability.cpp =================================================================== --- src/map/ability.cpp (revision 3304) +++ src/map/ability.cpp (working copy) @@ -193,7 +193,7 @@ /************************************************************************ * * -* Получаем/Устанавливаем сообщение способности * +* Set / get message capacity * * * ************************************************************************/ @@ -261,7 +261,7 @@ /************************************************************************ * * -* Реализация namespase для работы со способностями * +* Implementing namespase ability to work with * * * ************************************************************************/ @@ -353,7 +353,7 @@ /************************************************************************ * * - * Получаем основную способность профессии * + * The ability to obtain the main occupation * * * ************************************************************************/ Index: src/map/ability.h =================================================================== --- src/map/ability.h (revision 3304) +++ src/map/ability.h (working copy) @@ -41,7 +41,7 @@ enum ABILITY { ABILITY_MIGHTY_STRIKES = 0, - ABILITY_HUNDRED_FISTS = 1, + ABILITY_HUNDRED_FISTS = 1, ABILITY_BENEDICTION = 2, ABILITY_MANAFONT = 3, ABILITY_CHAINSPELL = 4, @@ -105,6 +105,7 @@ ABILITY_REWARD = 62, ABILITY_COVER = 63, ABILITY_SPIRIT_LINK = 64, + ABILITY_ENRAGE = 65, ABILITY_CHI_BLAST = 66, ABILITY_CONVERT = 67, ABILITY_ACCOMPLICE = 68, @@ -141,6 +142,11 @@ ABILITY_PUPPET_ROLL = 99, ABILITY_DANCERS_ROLL = 100, ABILITY_SCHOLARS_ROLL = 101, + ABILITY_BOLTERS_ROLL = 102, + ABILITY_CASTERS_ROLL = 103, + ABILITY_COURSERS_ROLL = 104, + ABILITY_BLITZERS_ROLL = 105, + ABILITY_TACTICIANS_ROLL = 106, ABILITY_DOUBLE_UP = 107, ABILITY_QUICK_DRAW = 108, ABILITY_FIRE_SHOT = 109, @@ -152,6 +158,7 @@ ABILITY_LIGHT_SHOT = 115, ABILITY_DARK_SHOT = 116, ABILITY_RANDOM_DEAL = 117, + // . = 118, ABILITY_OVERDRIVE = 119, ABILITY_ACTIVATE = 120, ABILITY_REPAIR = 121, @@ -245,8 +252,10 @@ ABILITY_SNARL = 209, ABILITY_RETALIATION = 210, ABILITY_FOOTWORK = 211, + ABILITY_DESPOIL = 212, ABILITY_PIANISSIMO = 213, ABILITY_SEKKANOKI = 214, + // . = 215, ABILITY_ELEMENTAL_SIPHON = 216, ABILITY_SUBLIMATION = 217, ABILITY_ADDENDUM_WHITE = 218, @@ -265,89 +274,99 @@ ABILITY_COMPOSURE = 231, ABILITY_YONIN = 232, ABILITY_INNIN = 233, - ABILITY_AVATARS_FAVOR = 234, - ABILITY_READY = 235, - ABILITY_RESTRAINT = 236, - ABILITY_PERFECT_COUNTER = 237, - ABILITY_MANA_WALL = 238, - ABILITY_DIVINE_EMBLEM = 239, - ABILITY_NETHER_VOID = 240, - ABILITY_DOUBLE_SHOT = 241, - ABILITY_SENGIKORI = 242, - ABILITY_FUTAE = 243, - ABILITY_SPIRIT_JUMP = 244, - ABILITY_PRESTO = 245, - ABILITY_DIVINE_WALTZ_II = 246, - ABILITY_FLOURISHES_III = 247, - ABILITY_CLIMACTIC_FLOURISH = 248, - ABILITY_LIBRA = 249, - ABILITY_TACTICAL_SWITCH = 250, - ABILITY_BLOOD_RAGE = 251, - ABILITY_IMPETUS = 253, - ABILITY_DIVINE_CARESS = 254, - ABILITY_SANCROSANCTITY = 255, - ABILITY_ENMITY_DOUSE = 256, - ABILITY_MANAWELL = 257, - ABILITY_SABOTEUR = 258, - ABILITY_SPONTANEITY = 259, - ABILITY_CONSPIRATOR = 260, - ABILITY_SEPULCHER = 261, - ABILITY_PALISADE = 262, - ABILITY_ARCANE_CREST = 263, - ABILITY_SCARLET_DELIRIUM = 264, - ABILITY_SPUR = 265, - ABILITY_RUN_WILD = 266, - ABILITY_TENUTO = 267, - ABILITY_MARCATO = 268, - ABILITY_BOUNTY_SHOT = 269, - ABILITY_DECOY_SHOT = 270, - ABILITY_HAMANOHA = 271, - ABILITY_HAGAKURE = 272, - ABILITY_ISSEKIGAN = 275, - ABILITY_DRAGON_BREAKER = 276, - ABILITY_SOUL_JUMP = 277, - ABILITY_STEADY_WING = 279, - ABILITY_MANA_CEDE = 280, - ABILITY_EFFLUX = 281, - ABILITY_UNBRIDLED_LEARNING = 282, - ABILITY_TRIPLE_SHOT = 285, - ABILITY_ALLIES_ROLL = 286, - ABILITY_MISER_S_ROLL = 287, - ABILITY_COMPANION_S_ROLL = 288, - ABILITY_AVENGER_S_ROLL = 289, - ABILITY_COOLDOWN = 293, - ABILITY_DEUX_EX_AUTOMATA = 294, - ABILITY_CURING_WALTZ_V = 295, - ABILITY_FEATHER_STEP = 296, - ABILITY_STRIKING_FLOURISH = 297, - ABILITY_TERNARY_FLOURISH = 298, - ABILITY_PERPETUANCE = 300, - ABILITY_IMMANENCE = 301, - ABILITY_SMITING_BREATH = 302, - ABILITY_RESTORING_BREATH = 303, - ABILITY_KONZEN_ITTAI = 304, - ABILITY_BULLY = 305, - ABILITY_MAINTENANCE = 306, - //ABILITY_WAR_SP2 = 307, - //ABILITY_MNK_SP2 = 308, - //ABILITY_ASYLUM = 309, - //ABILITY_SUBLTE_SORCERY = 310, //yes, subtle is misspelled - //ABILITY_RDM_SP2 = 311, - //ABILITY_THF_SP2 = 312, - //ABILITY_PLD_SP2 = 313, - //ABILITY_SOUL_ENSLAVEMENT = 314, - //ABILITY_BST_SP2 = 315, - //ABILITY_BRD_SP2 = 316, - //ABILITY_RNG_SP2 = 317, - //ABILITY_YAEGASUMI = 318, - //ABILITY_NIN_SP2 = 319, - //ABILITY_DSG_SP2 = 320, - //ABILITY_ASTRAL_CONDUIT = 321, - //ABILITY_UNBRIDLED_WISDOM = 322, - //ABILITY_COR_SP2 = 323, - //ABILITY_HEADY_ARTIFICE = 324, - //ABILITY_GRAND_PAS = 325, - //ABILITY_CAPER_EMISSARIUS = 326, + ABILITY_AVATARS_FAVOR = 234, + ABILITY_READY = 235, + ABILITY_RESTRAINT = 236, + ABILITY_PERFECT_COUNTER = 237, + ABILITY_MANA_WALL = 238, + ABILITY_DIVINE_EMBLEM = 239, + ABILITY_NETHER_VOID = 240, + ABILITY_DOUBLE_SHOT = 241, + ABILITY_SENGIKORI = 242, + ABILITY_FUTAE = 243, + ABILITY_SPIRIT_JUMP = 244, + ABILITY_PRESTO = 245, + ABILITY_DIVINE_WALTZ_II = 246, + ABILITY_FLOURISHES_III = 247, + ABILITY_CLIMACTIC_FLOURISH = 248, + ABILITY_LIBRA = 249, + ABILITY_TACTICAL_SWITCH = 250, + ABILITY_BLOOD_RAGE = 251, + // . = 252, + ABILITY_IMPETUS = 253, + ABILITY_DIVINE_CARESS = 254, + ABILITY_SANCROSANCTITY = 255, + ABILITY_ENMITY_DOUSE = 256, + ABILITY_MANAWELL = 257, + ABILITY_SABOTEUR = 258, + ABILITY_SPONTANEITY = 259, + ABILITY_CONSPIRATOR = 260, + ABILITY_SEPULCHER = 261, + ABILITY_PALISADE = 262, + ABILITY_ARCANE_CREST = 263, + ABILITY_SCARLET_DELIRIUM = 264, + ABILITY_SPUR = 265, + ABILITY_RUN_WILD = 266, + ABILITY_TENUTO = 267, + ABILITY_MARCATO = 268, + ABILITY_BOUNTY_SHOT = 269, + ABILITY_DECOY_SHOT = 270, + ABILITY_HAMANOHA = 271, + ABILITY_HAGAKURE = 272, + // . = 273, + // . = 274, + ABILITY_ISSEKIGAN = 275, + ABILITY_DRAGON_BREAKER = 276, + ABILITY_SOUL_JUMP = 277, + // . = 278, + ABILITY_STEADY_WING = 279, + ABILITY_MANA_CEDE = 280, + ABILITY_EFFLUX = 281, + ABILITY_UNBRIDLED_LEARNING = 282, + // . = 283, + // . = 284, + ABILITY_TRIPLE_SHOT = 285, + ABILITY_ALLIES_ROLL = 286, + ABILITY_MISER_S_ROLL = 287, + ABILITY_COMPANION_S_ROLL = 288, + ABILITY_AVENGER_S_ROLL = 289, + // . = 290, + // . = 291, + // . = 292, + ABILITY_COOLDOWN = 293, + ABILITY_DEUX_EX_AUTOMATA = 294, + ABILITY_CURING_WALTZ_V = 295, + ABILITY_FEATHER_STEP = 296, + ABILITY_STRIKING_FLOURISH = 297, + ABILITY_TERNARY_FLOURISH = 298, + // . = 299, + ABILITY_PERPETUANCE = 300, + ABILITY_IMMANENCE = 301, + ABILITY_SMITING_BREATH = 302, + ABILITY_RESTORING_BREATH = 303, + ABILITY_KONZEN_ITTAI = 304, + ABILITY_BULLY = 305, + ABILITY_MAINTENANCE = 306, + //ABILITY_WAR_SP2 = 307, + //ABILITY_MNK_SP2 = 308, + //ABILITY_ASYLUM = 309, + //ABILITY_SUBLTE_SORCERY = 310, //yes, subtle is misspelled + //ABILITY_RDM_SP2 = 311, + //ABILITY_THF_SP2 = 312, + //ABILITY_PLD_SP2 = 313, + //ABILITY_SOUL_ENSLAVEMENT = 314, + //ABILITY_BST_SP2 = 315, + //ABILITY_BRD_SP2 = 316, + //ABILITY_RNG_SP2 = 317, + //ABILITY_YAEGASUMI = 318, + //ABILITY_NIN_SP2 = 319, + //ABILITY_DSG_SP2 = 320, + //ABILITY_ASTRAL_CONDUIT = 321, + //ABILITY_UNBRIDLED_WISDOM = 322, + //ABILITY_COR_SP2 = 323, + //ABILITY_HEADY_ARTIFICE = 324, + //ABILITY_GRAND_PAS = 325, + //ABILITY_CAPER_EMISSARIUS = 326, ABILITY_BOLSTER = 327, ABILITY_FULL_CIRCLE = 329, ABILITY_LASTING_EMANATION = 330, @@ -379,6 +398,7 @@ ABILITY_ONE_FOR_ALL = 358, ABILITY_WARD = 363, ABILITY_EFFUSION = 364, + ABILITY_HEALING_RUBY = 496, ABILITY_POISON_NAILS = 497, ABILITY_SHINING_RUBY = 498, @@ -529,7 +549,7 @@ /************************************************************************ * * -* namespase для работы со способностями * +* namespase to work with the abilities * * * ************************************************************************/ Index: src/map/ai/ai_char_normal.cpp =================================================================== --- src/map/ai/ai_char_normal.cpp (revision 3304) +++ src/map/ai/ai_char_normal.cpp (working copy) @@ -60,8 +60,8 @@ /************************************************************************ * * -* Инициализируем владельца интеллекта (может добавить проверку на * -* пустой указатель с выводом FatalError ?) * +* Initialize the owner of the intellectual (can add a check on the * +* null pointer with output FatalError ?) * * * ************************************************************************/ @@ -75,7 +75,7 @@ /************************************************************************ * * -* Основная часть интеллекта - главный цикл * +* The bulk of intelligence - the main loop * * * ************************************************************************/ @@ -232,7 +232,7 @@ /************************************************************************ * * -* Персонаж переходит в боевую стойку, включается прежим атаки * +* The character goes into a fighting stance, included attack mode * * * ************************************************************************/ @@ -245,7 +245,7 @@ { if(IsMobOwner(m_PBattleTarget)) { - if (distance(m_PChar->loc.p, m_PBattleTarget->loc.p) <= 30) + if (distance(m_PChar->loc.p, m_PBattleTarget->loc.p) <= 30*map_config.engage_dist_mod) { if ((m_Tick - m_LastMeleeTime) > m_PChar->m_Weapons[SLOT_MAIN]->getDelay()) { @@ -293,7 +293,7 @@ /************************************************************************ * * -* Персонаж меняет основную цель атаки * +* The main character is changing their target of attack * * * ************************************************************************/ @@ -310,7 +310,7 @@ { if (IsMobOwner(PBattleTarget)) { - if (distance(m_PChar->loc.p, PBattleTarget->loc.p) <= 30) + if (distance(m_PChar->loc.p, PBattleTarget->loc.p) <= 30*map_config.engage_dist_mod) { m_LastActionTime = m_Tick; m_PBattleTarget = PBattleTarget; @@ -334,7 +334,7 @@ /************************************************************************ * * -* Персонаж выходит из режима атаки по каким-либо причинам * +* Character exits attack for some reason * * * ************************************************************************/ @@ -352,7 +352,7 @@ /************************************************************************ * * -* Смерть персонажа * +* character death * * * ************************************************************************/ @@ -387,13 +387,13 @@ /************************************************************************ * * -* Удаляем соответствующие эффекты с ожиданием в одну секунду * +* Remove the corresponding effects with the expectation of one second * * * ************************************************************************/ void CAICharNormal::ActionDeath() { - // без задержки удаление эффектов не всегда правильно обрабатывается клиентом + // Immediately remove the effects are not always properly handled by the client if ((m_Tick - m_LastActionTime) >= 1000) { m_PChar->StatusEffectContainer->DelStatusEffectsByFlag(EFFECTFLAG_DEATH); @@ -422,7 +422,7 @@ * * ************************************************************************/ -// TODO: нет проверки на наличие зарядов у предмета (в случае использования экипировки) +// TODO: there is no check for the charges of the object (in the case of equipment) void CAICharNormal::ActionItemStart() { @@ -495,7 +495,7 @@ /************************************************************************ * * -* Процесс использовани предмета * +* The process of using the item * * * ************************************************************************/ @@ -516,7 +516,7 @@ if ((m_Tick - m_LastActionTime) >= m_PItemUsable->getActivationTime()) { - // обновление времени необходимо для правильной работы задержки анимации + // update the time required for proper operation of the delay animation m_LastMeleeTime += (m_Tick - m_LastActionTime); m_LastActionTime = m_Tick; m_ActionType = ACTION_ITEM_FINISH; @@ -550,7 +550,7 @@ } m_PItemUsable = new CItemUsable(*m_PItemUsable); } - else // разблокируем все предметы, кроме экипирвоки + else // unlock all items, except for equipment { m_PItemUsable->setSubType(ITEM_UNLOCKED); m_PItemUsable = new CItemUsable(*m_PItemUsable); @@ -580,8 +580,8 @@ /************************************************************************ * * -* Окончание использования предмета. * -* Сюда попадает копия предмета, которую нужно удалить. * +* Ending the use of the object. * +* Here gets a copy of the object to be deleted. * * * ************************************************************************/ @@ -592,7 +592,7 @@ if ((m_Tick - m_LastActionTime) >= m_PItemUsable->getAnimationTime()) { - if(battleutils::IsParalised(m_PChar)){ + if(battleutils::IsParalyzed(m_PChar)){ m_PChar->loc.zone->PushPacket(m_PChar, CHAR_INRANGE_SELF, new CMessageBasicPacket(m_PChar,m_PBattleSubTarget,0,0,MSGBASIC_IS_PARALYZED)); } else { @@ -665,13 +665,14 @@ /************************************************************************ * * -* Начало дальней атаки. Логика: * -* - если цель мертва, то атака не начинается. никаких сообщений * -* - проверяем видимость цели (если не видим, то не можем определить * -* дистанцию до цели или узнать, в бою ли цель) * -* - определяем в бою ли цель (нет смысла определять дистанцию, если * -* цель атакует другой персонаж) * -* - и наконец определяем дистанцию до цели * +* Start a ranged attack. Logic: * +* - If the target is dead, the attack begins. no reports * +* - Check the visibility of the target (if you do not see, we can not * +* determine distance to the target or to find out whether the * +* purpose in battle) * +* - In a battle to determine the target (not relevant to determine * +* the distance, if purpose of attacking another character) * +* - And finally determine the distance to the target * * * ************************************************************************/ @@ -800,7 +801,7 @@ m_PBattleSubTarget = NULL; return; } - if (distance(m_PChar->loc.p, m_PBattleSubTarget->loc.p) > 25) + if (distance(m_PChar->loc.p, m_PBattleSubTarget->loc.p) > 25*map_config.ranged_dist_mod) { m_PChar->pushPacket(new CMessageBasicPacket(m_PChar,m_PBattleSubTarget,0,0,MSGBASIC_TOO_FAR_AWAY)); @@ -816,7 +817,7 @@ return; } - // TODO: скорее всего m_LastActionTime нужно выставлять лишь при ANIMATION_ATTACK, иначе использовать LastRangedTime для + // TODO: m_LastActionTime likely to exhibit only at ANIMATION_ATTACK, otherwise use for LastRangedTime m_LastActionTime = m_Tick; m_PChar->m_StartActionPos = m_PChar->loc.p; @@ -841,7 +842,7 @@ /************************************************************************ * * -* Окончание дальней атаки * +* Closing ranged attack * * * ************************************************************************/ @@ -1066,8 +1067,8 @@ m_ActionType = (m_PChar->animation == ANIMATION_ATTACK ? ACTION_ATTACK : ACTION_NONE); - // TODO: что это ? .... - // если не ошибаюсь, то TREASURE_HUNTER работает лишь при последнем ударе + // TODO: what is this? .... + // If I am not mistaken, the TREASURE_HUNTER works only when the last stroke CMobEntity* Monster = (CMobEntity*)m_PBattleSubTarget; @@ -1213,7 +1214,7 @@ { if (m_PBattleSubTarget->isDead() && !(m_PSpell->getValidTarget() & TARGET_PLAYER_DEAD)) { - MagicStartError(0); // TODO: узнать сообщение + MagicStartError(0); // TODO: find a message return; } if (m_PBattleSubTarget->objtype == TYPE_MOB && !IsMobOwner(m_PBattleSubTarget)) @@ -1253,12 +1254,12 @@ { float Distance = distance(m_PChar->loc.p, m_PBattleSubTarget->loc.p); - if (Distance > 25) + if (Distance > 25*map_config.magic_dist_mod) { MagicStartError(78); return; } - if (Distance > 21.5) + if (Distance > 21.5*map_config.magic_dist_mod) { MagicStartError(313); return; @@ -1296,7 +1297,7 @@ /************************************************************************ * * -* Невозможно начать читать заклинание * +* Can not start to cast * * * ************************************************************************/ @@ -1323,6 +1324,8 @@ * * ************************************************************************/ +int8 QuickMagicChance = 0; + void CAICharNormal::ActionMagicCasting() { DSP_DEBUG_BREAK_IF(m_PBattleSubTarget == NULL); @@ -1344,6 +1347,173 @@ uint32 totalCastTime = (float)m_PSpell->getCastTime()*((100.0f-(float)dsp_cap(m_PChar->getMod(MOD_FASTCAST),-100,50))/100.0f); + // Casting Time Modifiers + if (m_PSpell->getSpellGroup() == SPELLGROUP_BLACK) // Black Magic Cast Modifier + { + int16 BlackCastMod = m_PChar->getMod(MOD_BLACK_CAST); + totalCastTime = totalCastTime * ((float)(100-BlackCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + + int16 CureCastMod = m_PChar->getMod(MOD_CURE_CAST); + if (m_PSpell->getID() >= 1 && m_PSpell->getID() <= 11) // Cure - Curaga Magic Cast Modifier + { + totalCastTime = totalCastTime * ((float)(100-CureCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + if (m_PSpell->getID() == 93 || m_PSpell->getID() == 474 || m_PSpell->getID() == 475) // Cura Magic Cast Modifier + { + totalCastTime = totalCastTime * ((float)(100-CureCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + + if (m_PSpell->getSpellGroup() == SPELLGROUP_SONG) // Song Cast Modifier + { + int16 SongCastMod = m_PChar->getMod(MOD_SONG_CAST); + totalCastTime = totalCastTime * ((float)(100-SongCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + if (m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_NIGHTINGALE)) + { + totalCastTime = totalCastTime * .5; + int16 NightingaleMerit = (m_PChar->PMeritPoints->GetMeritValue(MERIT_NIGHTINGALE,m_PChar->GetMLevel())) - 25; + int8 NightingaleChance = (rand() % 99) + 1; + if (NightingaleChance <= NightingaleMerit) + { + totalCastTime = 0; + } + } + if (m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_TROUBADOUR)) + { + totalCastTime = totalCastTime * 1.5; + } + if (m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_TROUBADOUR) && m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_NIGHTINGALE)) + { + totalCastTime = totalCastTime * .75; + } + } + + // Grimoire Cast Modifier + if (m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_LIGHT_ARTS) || m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_LIGHT_ARTS)) + { + int16 GrimoireCastMod = m_PChar->getMod(MOD_GRIMOIRE_CAST); + totalCastTime = totalCastTime * ((float)(100-GrimoireCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + + if (m_PSpell->getID() == 54) // Stoneskin Cast Modifier + { + int16 StoneskinCastMod = m_PChar->getMod(MOD_STONESKIN_CAST); + totalCastTime = totalCastTime * ((float)(100-StoneskinCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + + if (m_PSpell->getSpellGroup() == SPELLGROUP_SUMMONING) // Summoning Magic Cast Modifier + { + int16 SummoningCastMod = m_PChar->getMod(MOD_SUMMON_CAST); + totalCastTime = totalCastTime * ((float)(100-SummoningCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + + if (m_PSpell->getSkillType() == 36) // Elemental Magic Cast Modifier + { + int16 ElementalCastMod = m_PChar->getMod(MOD_ELEMENTAL_CAST); + totalCastTime = totalCastTime * ((float)(100-ElementalCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + + if (m_PSpell->getSkillType() == 37) // Dark Magic Cast Modifier + { + int16 DarkCastMod = m_PChar->getMod(MOD_DARK_MAG_CAST); + totalCastTime = totalCastTime * ((float)(100-DarkCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + + if (m_PSpell->getSkillType() == 33) // Healing Magic Cast Modifier + { + int16 HealingCastMod = m_PChar->getMod(MOD_HEALING_CAST); + totalCastTime = totalCastTime * ((float)(100-HealingCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + + if (m_PSpell->getID() >= 338 && m_PSpell->getID() <= 340) // Utsusemi Cast Modifier + { + int16 UtsusemiCastMod = m_PChar->getMod(MOD_UTSUSEMI_CAST); + totalCastTime = totalCastTime * ((float)(100-UtsusemiCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + + if (m_PSpell->getSpellGroup() == SPELLGROUP_BLUE) // Blue Magic Cast Modifier + { + int16 BlueCastMod = m_PChar->getMod(MOD_BLUE_CAST); + totalCastTime = totalCastTime * ((float)(100-BlueCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + + if (m_PSpell->getSkillType() == 34) // Enhancing Magic Cast Modifier + { + int16 EnhancingCastMod = m_PChar->getMod(MOD_ENHANCING_CAST); + totalCastTime = totalCastTime * ((float)(100-EnhancingCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + + if (m_PSpell->getSkillType() == 35) // Enfeebling Magic Cast Modifier + { + int16 EnfeeblingCastMod = m_PChar->getMod(MOD_ENFEEBLING_CAST); + totalCastTime = totalCastTime * ((float)(100-EnfeeblingCastMod)/100); + if (totalCastTime < 1000) + { + totalCastTime = 1000; + } + } + + if (m_PChar->getMod(MOD_QUICK_MAGIC) > 0) + { + QuickMagicChance = (rand() % 99) + 1; + if (QuickMagicChance < m_PChar->getMod(MOD_QUICK_MAGIC)) + { + totalCastTime = 0; + } + } + if (m_Tick - m_LastActionTime >= totalCastTime || m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_CHAINSPELL)) { @@ -1355,7 +1525,7 @@ ActionMagicInterrupt(); return; } - else if (battleutils::IsParalised(m_PChar)) + else if (battleutils::IsParalyzed(m_PChar)) { m_PChar->loc.zone->PushPacket(m_PChar, CHAR_INRANGE_SELF, new CMessageBasicPacket(m_PChar,m_PBattleSubTarget,0,0,MSGBASIC_IS_PARALYZED)); m_ActionType = ACTION_MAGIC_INTERRUPT; @@ -1380,9 +1550,9 @@ } //the check for player position only occurs AFTER the cast time is up, you can move so long as x/z is the same on finish. //furthermore, it's actually quite lenient, hence the rounding to 1 dp - if (floorf(m_PChar->m_StartActionPos.x * 10 + 0.5) / 10 != floorf(m_PChar->loc.p.x * 10 + 0.5) / 10 || + if (map_config.magic_movement == 0 && (floorf(m_PChar->m_StartActionPos.x * 10 + 0.5) / 10 != floorf(m_PChar->loc.p.x * 10 + 0.5) / 10 || floorf(m_PChar->m_StartActionPos.z * 10 + 0.5) / 10 != floorf(m_PChar->loc.p.z * 10 + 0.5) / 10 || - m_PChar->StatusEffectContainer->HasPreventActionEffect()) + m_PChar->StatusEffectContainer->HasPreventActionEffect())) { m_PChar->pushPacket(new CMessageBasicPacket(m_PChar, m_PChar, 0, 0, MSGBASIC_IS_INTERRUPTED)); @@ -1391,7 +1561,7 @@ return; } if ((m_PBattleSubTarget != m_PChar) && - (distance(m_PChar->loc.p,m_PBattleSubTarget->loc.p) > 21.5)) + (distance(m_PChar->loc.p,m_PBattleSubTarget->loc.p) > 21.5*map_config.magic_dist_mod)) { m_PChar->pushPacket(new CMessageBasicPacket(m_PChar,m_PBattleSubTarget,0,0,MSGBASIC_TOO_FAR_AWAY)); @@ -1453,7 +1623,80 @@ // Only haste from spells or equipment is counted; ignore MOD_HASTE_ABILITY and cap at 25% (256/1024) int16 Haste = m_PChar->getMod(MOD_HASTE_MAGIC) + m_PChar->getMod(MOD_HASTE_GEAR); RecastTime = RecastTime * ((float)(1024-dsp_cap(Haste,-1024,256))/1024); + + if (m_PSpell->getSpellGroup() == SPELLGROUP_SONG) // Bard Song Recast Modifier + { + int16 SongRecastMod = m_PChar->getMod(MOD_SONG_RECAST); + RecastTime = RecastTime * ((float)(100-SongRecastMod)/100); + if (m_PSpell->getID() == 376 || m_PSpell->getID() == 377 || m_PSpell->getID() == 463 || m_PSpell->getID() == 471) + { + RecastTime -= (m_PChar->PMeritPoints->GetMeritValue(MERIT_LULLABY_RECAST,m_PChar->GetMLevel()) *1000); // remove x seconds + } + if (m_PSpell->getID() == 462) + { + RecastTime -= (m_PChar->PMeritPoints->GetMeritValue(MERIT_FINALE_RECAST,m_PChar->GetMLevel()) *1000); // remove x seconds + } + if (RecastTime < 100) // Pretty much instacast + { + RecastTime = 100; + } + } + if (m_PSpell->getSkillType() == 36) // Elemental Magic Recast Modifier + { + int16 ElementalRecastMod = m_PChar->getMod(MOD_ELEMENTAL_RECAST); + RecastTime = RecastTime * ((float)(100-ElementalRecastMod)/100); + if (RecastTime < 2000) + { + RecastTime = 2000; + } + } + if (m_PSpell->getSpellGroup() == SPELLGROUP_BLUE) // Blue Magic Recast Modifier + { + int16 BlueRecastMod = m_PChar->getMod(MOD_BLUE_RECAST); + RecastTime = RecastTime * ((float)(100-BlueRecastMod)/100); + if (RecastTime < 2000) + { + RecastTime = 2000; + } + } + if (m_PSpell->getSpellGroup() == SPELLGROUP_NINJUTSU) // Ninjutsu Recast Modifier + { + int16 NinjutsuRecastMod = m_PChar->getMod(MOD_NINJUTSU_RECAST); + RecastTime = RecastTime * ((float)(100-NinjutsuRecastMod)/100); + if (RecastTime < 2000) + { + RecastTime = 2000; + } + } + if (m_PSpell->getID() >= 288 && m_PSpell->getID() <= 295) // Elemental Avatar Recast Modifier + { + int16 EleAvatarRecastMod = m_PChar->getMod(MOD_ELE_AVATAR_RECAST); + RecastTime = RecastTime * ((float)(100-EleAvatarRecastMod)/100); + if (RecastTime < 2000) + { + RecastTime = 2000; + } + } + + // Grimoire Recast Modifier + if (m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_LIGHT_ARTS) || m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_LIGHT_ARTS)) + { + int16 GrimoireRecastMod = m_PChar->getMod(MOD_GRIMOIRE_RECAST); + RecastTime = RecastTime * ((float)(100-GrimoireRecastMod)/100); + if (RecastTime < 2000) + { + RecastTime = 2000; + } + } + if (m_PChar->getMod(MOD_QUICK_MAGIC) > 0) + { + if (QuickMagicChance < m_PChar->getMod(MOD_QUICK_MAGIC)) + { + RecastTime = 0; + } + } + //needed so the client knows of the reduced recast time! m_PSpell->setModifiedRecast(RecastTime); @@ -1583,7 +1826,7 @@ m_PChar->m_ActionList.push_back(Action); } - // если заклинание атакующее, то дополнительно удаляем эффекты с флагом атаки + // If an attacking spell, then remove the additional effects to the flag attack m_PChar->StatusEffectContainer->DelStatusEffectsByFlag(EFFECTFLAG_MAGIC_END | ((m_PSpell->getValidTarget() & TARGET_ENEMY) ? EFFECTFLAG_DETECTABLE : EFFECTFLAG_NONE)); charutils::UpdateHealth(m_PChar); @@ -1842,7 +2085,7 @@ } // check paralysis - if(battleutils::IsParalised(m_PChar)){ + if(battleutils::IsParalyzed(m_PChar)){ // display paralyzed m_PChar->loc.zone->PushPacket(m_PChar, CHAR_INRANGE_SELF, new CMessageBasicPacket(m_PChar,m_PBattleSubTarget,0,0,MSGBASIC_IS_PARALYZED)); } else { @@ -1856,14 +2099,16 @@ m_PChar->StatusEffectContainer->DelStatusEffectsByFlag(EFFECTFLAG_INVISIBLE); } - if(m_PJobAbility->getID() == ABILITY_REWARD){ - CItem* PItem = m_PChar->getStorage(LOC_INVENTORY)->GetItem(m_PChar->equip[SLOT_HEAD]); - if(PItem->getID() == 15157 || PItem->getID() == 16104){ - //TODO: Transform this into an item MOD_REWARD_RECAST perhaps ? - //The Bison Warbonnet & Khimaira Bonnet reduces recast time by 10 seconds. - RecastTime -= (10 *1000); // remove 10 seconds - } + if(m_PJobAbility->getID() == ABILITY_REWARD) + { + int16 RewardRecastMod = m_PChar->getMod(MOD_REWARD_RECAST); + RecastTime -= (RewardRecastMod *1000); // remove x seconds } + + if(m_PJobAbility->getID() == ABILITY_LIGHT_ARTS || m_PJobAbility->getID() == ABILITY_DARK_ARTS) + { + RecastTime -= (m_PChar->PMeritPoints->GetMeritValue(MERIT_GRIMOIRE_RECAST,m_PChar->GetMLevel()) *1000); // remove x seconds + } apAction_t Action; m_PChar->m_ActionList.clear(); @@ -2035,7 +2280,7 @@ } } - // TODO: бардак. тоже выкинуть отсюда + // TODO: mess. also throw away else if (m_PJobAbility->isAvatarAbility()) { if (m_PChar->PPet != NULL) //is a bp - dont display msg and notify pet @@ -2058,7 +2303,7 @@ m_PChar->m_ActionList.push_back(Action); m_PChar->PPet->PBattleAI->SetBattleSubTarget(m_PBattleSubTarget); - ((CAIPetDummy*)m_PChar->PPet->PBattleAI)->m_MasterCommand = m_PJobAbility->getID(); // TODO: не допустимый подход + ((CAIPetDummy*)m_PChar->PPet->PBattleAI)->m_MasterCommand = m_PJobAbility->getID(); // TODO: not a valid approach m_PChar->PPet->PBattleAI->SetCurrentAction(ACTION_MOBABILITY_START); charutils::UpdateHealth(m_PChar); @@ -2216,10 +2461,52 @@ Action.flag = 0; if( m_PJobAbility->getID() == ABILITY_SHADOWBIND ) - { - //Action.flag = 3; - } + { + uint16 damage = 0; + Action.ActionTarget = m_PBattleSubTarget; + Action.reaction = REACTION_HIT; + Action.speceffect = SPECEFFECT_HIT; //0x60 (SPECEFFECT_HIT + SPECEFFECT_RECOIL) + Action.animation = m_PJobAbility->getAnimationID();; + Action.messageID = MSGBASIC_USES_JA; + Action.flag = 3; + if(m_PBattleSubTarget->objtype == TYPE_MOB && ((CMobEntity*)m_PBattleSubTarget)->m_Type != MOBTYPE_NOTORIOUS) + { + uint8 shadowbindDur = 30; + if(m_PChar->getMod(MOD_SHADOWBIND) >= 1) + { + shadowbindDur = 45; + } + m_PBattleSubTarget->StatusEffectContainer->AddStatusEffect(new CStatusEffect(EFFECT_BIND,EFFECT_BIND,1,0,10)); + } + CItemWeapon* PAmmo = (CItemWeapon*)m_PChar->getStorage(LOC_INVENTORY)->GetItem(m_PChar->equip[SLOT_AMMO]); + uint8 recycleChance = m_PChar->getMod(MOD_RECYCLE); + if (charutils::hasTrait(m_PChar,TRAIT_RECYCLE)) + recycleChance += m_PChar->PMeritPoints->GetMeritValue(MERIT_RECYCLE,m_PChar->GetMLevel()); + + if(m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_UNLIMITED_SHOT)) + { + m_PChar->StatusEffectContainer->DelStatusEffect(EFFECT_UNLIMITED_SHOT); + recycleChance = 100; + } + + if(PAmmo != NULL && rand()%100 > recycleChance) + { + if ( (PAmmo->getQuantity()-1) < 1) // ammo will run out after this shot, make sure we remove it from equip + { + uint8 slot = m_PChar->equip[SLOT_AMMO]; + charutils::UnequipItem(m_PChar,SLOT_AMMO); + charutils::UpdateItem(m_PChar, LOC_INVENTORY, slot, -1); + } + else + { + charutils::UpdateItem(m_PChar, LOC_INVENTORY, m_PChar->equip[SLOT_AMMO], -1); + } + } + m_PChar->pushPacket(new CInventoryFinishPacket()); + + } + // handle jump abilities--- // Jump @@ -2326,7 +2613,7 @@ if (m_PJobAbility->getValidTarget() & TARGET_ENEMY) { - // во время pvp целью могут быт персонажи, монстры и их питомцы + // during pvp to life are the characters, monsters and their pets if (m_PBattleSubTarget->objtype == TYPE_MOB && m_PJobAbility->getID() != ABILITY_ASSAULT && m_PJobAbility->getID() != ABILITY_FIGHT && @@ -2341,7 +2628,7 @@ } } - // TODO: все перенести в скрипты, т.к. система позволяет получать указатель на питомца + // TODO: all moved to the script, as system allows you to get a pointer to the pet if(m_PJobAbility->getID() == ABILITY_CALL_BEAST || m_PJobAbility->getID() == ABILITY_REWARD){ charutils::UpdateItem(m_PChar, LOC_INVENTORY, m_PChar->equip[SLOT_AMMO], -1); @@ -2467,7 +2754,7 @@ /************************************************************************ * * -* Невозможно начать weapon skill * +* Can not start weapon skill * * * ************************************************************************/ @@ -2982,7 +3269,7 @@ float Distance = distance(m_PChar->loc.p,m_PBattleTarget->loc.p); - if (Distance > 30) + if (Distance > 30*map_config.engage_dist_mod) { m_PChar->pushPacket(new CMessageBasicPacket(m_PChar,m_PBattleTarget,0,0,MSGBASIC_LOSE_SIGHT)); @@ -3015,7 +3302,7 @@ return; } m_LastMeleeTime = m_Tick; - if (battleutils::IsParalised(m_PChar)) + if (battleutils::IsParalyzed(m_PChar)) { m_PChar->loc.zone->PushPacket(m_PChar, CHAR_INRANGE_SELF, new CMessageBasicPacket(m_PChar,m_PBattleTarget,0,0,MSGBASIC_IS_PARALYZED)); } @@ -3132,8 +3419,8 @@ { hitRate = battleutils::GetHitRate(m_PChar,m_PBattleTarget,2); } - // сначала вычисляем вероятность попадания по монстру - // затем нужно вычислить вероятность нанесения критического удара + // First compute the probability of hitting the monster + // Then need to calculate the critical strike chance if (m_PBattleTarget->StatusEffectContainer->HasStatusEffect(EFFECT_PERFECT_DODGE,0)) { Action.messageID = 32; @@ -3178,6 +3465,11 @@ abs(m_PBattleTarget->loc.p.rotation - m_PChar->loc.p.rotation) < 23) { bonusDMG = m_PChar->DEX(); + if(m_PChar->getMod(MOD_SNEAK_ATK_MOD) > 0) + { + bonusDMG = bonusDMG + (bonusDMG * (m_PChar->getMod(MOD_SNEAK_ATK_MOD)/10)); + } + damage = damage + (damage * (m_PChar->getMod(MOD_SATA_DMG)/100)); if(rand()%100 < 4) Monster->m_THLvl +=1; } @@ -3186,6 +3478,11 @@ if(m_PChar->GetMJob() == JOB_THF && (!ignoreSneakTrickAttack) && taChar != NULL) { bonusDMG += m_PChar->AGI(); + if(m_PChar->getMod(MOD_TRICK_ATK_MOD) > 0) + { + bonusDMG = bonusDMG + (bonusDMG * (m_PChar->getMod(MOD_TRICK_ATK_MOD)/100)); + } + damage = damage + (damage * (m_PChar->getMod(MOD_SATA_DMG)/100)); } if (isHTH) Index: src/map/ai/ai_mob_dummy.cpp =================================================================== --- src/map/ai/ai_mob_dummy.cpp (revision 3304) +++ src/map/ai/ai_mob_dummy.cpp (working copy) @@ -24,8 +24,10 @@ #include "../../common/showmsg.h" #include "../../common/utils.h" +#include "../battleentity.h" #include "../battleutils.h" #include "../blueutils.h" +#include "../charentity.h" #include "../charutils.h" #include "../itemutils.h" #include "../mobskill.h" @@ -51,8 +53,8 @@ /************************************************************************ * * -* Инициализируем владельца интеллекта (может добавить проверку на * -* пустой указатель с выводом FatalError ?) * +* Initialize the owner intelligence (can add a check to * +* Null pointer with output FatalError?) * * * ************************************************************************/ @@ -71,7 +73,7 @@ /************************************************************************ * * -* Основная часть интеллекта - главный цикл * +* The bulk of intelligence - the main loop * * * ************************************************************************/ @@ -108,8 +110,9 @@ /************************************************************************ * * -* Здесь должен быть алгоритм путешествия по зоне, а также переход в * -* режим боевой стойки, если его обладатель (атакующий) не равен нулю. * +* There must be an algorithm travel zone, and the transition to * +* mode of fighting stance, if the holder (the attacker) is not equal * +* to zero. * * * ************************************************************************/ @@ -129,7 +132,7 @@ // try to resolve the person who owns us m_PBattleTarget = (CBattleEntity*)m_PMob->loc.zone->GetEntity(m_PMob->m_OwnerID.targid, TYPE_PC | TYPE_MOB | TYPE_PET); - // TODO: возможно необходимо добавлять цели базовое количество ненависти + // TODO: may be added to basic amount of hate m_ActionType = ACTION_ENGAGE; ActionEngage(); @@ -206,7 +209,7 @@ /************************************************************************ * * -* Монстр переходит в боевую стойку, включается режим атаки * +* Monster goes into a fighting stance, the movie Attack * * * ************************************************************************/ @@ -251,8 +254,8 @@ /************************************************************************ * * -* Монстр выходит из режима атаки по каким-либо причинам. Если при этом * -* он слишком далеко от точки появления, то запускается перерождение. * +* Monster exits attack for some reason. If this it is too far from the * +* point of introduction, is started degeneration. * * * ************************************************************************/ @@ -298,7 +301,7 @@ /************************************************************************ * * -* Монстр падает на землю после получения смертельного удара. * +* Monster falls to the ground after the fatal blow. * * * ************************************************************************/ @@ -320,8 +323,8 @@ /************************************************************************ * * -* Здесь выполняется скрипт после смерти монстра, распределяется опыт * -* и определяются выпавшие предметы * +* This script is executed after the death of the monster, the * +* experience is distributed and are determined by fallen objects * * * ************************************************************************/ @@ -355,16 +358,16 @@ uint8 tries = 0; while(tries < 1+highestTH) { - if(rand()%100 < DropList->at(i).DropRate) + if(rand()%100 < (DropList->at(i).DropRate + map_config.drop_rate_bonus)) { - PChar->PTreasurePool->AddItem(DropList->at(i).ItemID, m_PMob); + PChar->PTreasurePool->AddItem(DropList->at(i).ItemID, m_PMob); break; } tries++; - } + } } //check for gil (beastmen drop gil, some NMs drop gil) - if(m_PMob->m_EcoSystem == SYSTEM_BEASTMEN || m_PMob->m_Type & MOBTYPE_NOTORIOUS) + if(m_PMob->m_EcoSystem == SYSTEM_BEASTMEN || m_PMob->m_Type & MOBTYPE_NOTORIOUS || map_config.all_mobs_drop_gil == 1) { charutils::DistributeGil(PChar, m_PMob); // TODO: REALISATION MUST BE IN TREASUREPOOL } @@ -375,8 +378,8 @@ >= 90 = High Kindred Crests ID=2956 */ uint8 Pzone = PChar->getZone(); - if(charutils::GetRealExp(PChar->GetMLevel(),m_PMob->GetMLevel())>0 && - rand()%100 < 40 && m_PMob->m_Type == MOBTYPE_NORMAL && ((Pzone > 0 && + if((charutils::GetRealExp(PChar->GetMLevel(),m_PMob->GetMLevel())>0 || map_config.always_seal_crest == 1) && + rand()%100 < (40 + map_config.seal_crest_bonus) && m_PMob->m_Type == MOBTYPE_NORMAL && ((Pzone > 0 && Pzone < 39) || (Pzone > 42 && Pzone < 134) || (Pzone > 135 && Pzone < 185) || (Pzone > 188 && Pzone < 255))){ //exp-yielding monster and drop is successful //TODO: The drop is actually based on a 5 minute timer, and not a probability of dropping! @@ -432,7 +435,7 @@ /************************************************************************ * * -* Время ожидания до исчезновения (монстр не обязательно мертв) * +* Waiting time until extinction (the monster does not necessarily dead)* * * ************************************************************************/ @@ -460,10 +463,10 @@ /************************************************************************ * * -* Здесь модель пропадает после постепенного ичезновения, так же * -* решается вопрос, а нужно ли включать процесс возрождения монстра. * -* Если его тип возрождения равен нулю, значит он был вызван и в * -* возрождении не нуждается, иначе запускаем процесс * +* Here, the model after gradually disappears icheznoveniya as well * +* Solved the problem, and whether to include the revival of the monster.* +* If the type of revival is zero, then it is called in * +* Does not need revival, or run processesс * * * ************************************************************************/ @@ -488,11 +491,11 @@ /************************************************************************ * * -* Возрождение монстра * +* revival monster * * * ************************************************************************/ -// TODO: ночные монстры должны появляться только ночью +// TODO: nocturnal monsters appear only at night void CAIMobDummy::ActionSpawn() { @@ -562,7 +565,7 @@ /************************************************************************ * * -* Начало специальной атаки монстра (эффект начала) * +* Start special attack monster (the effect of start) * * * ************************************************************************/ @@ -572,7 +575,7 @@ std::vector MobSkills = battleutils::GetMobSkillsByFamily(m_PMob->m_Family); - // не у всех монстов прописаны способности, так что выходим из процедуры, если способность не найдена + // Not all registered Monster ability, so get out of the procedure, if the ability is not found // We don't have any skills we can use, so let's go back to attacking if (MobSkills.size() == 0) { @@ -681,8 +684,8 @@ Action.messageID = 43; //readies message Action.flag = 0; - m_PMob->m_ActionList.push_back(Action); - m_PMob->loc.zone->PushPacket(m_PMob, CHAR_INRANGE, new CActionPacket(m_PMob)); + m_PMob->m_ActionList.push_back(Action); + m_PMob->loc.zone->PushPacket(m_PMob, CHAR_INRANGE, new CActionPacket(m_PMob)); m_ActionType = ACTION_MOBABILITY_USING; } @@ -730,9 +733,9 @@ /************************************************************************ * * -* Окончание специальной атаки монстра (анимация эффекта). * -* После выполения специальной атаки не обнуляем m_PMobSkill, позднее * -* по этому значению blu будет учить заклинания. * +* Closing special attack monster (animation effect). * +* If this is done the special attack is not zero out m_PMobSkill, later * +* This value blu will teach spells. * * * ************************************************************************/ @@ -855,7 +858,7 @@ /************************************************************************ * * -* Прерывание специальной атаки монстра * +* Interrupting a special monster attacks * * * ************************************************************************/ @@ -1026,7 +1029,7 @@ ActionMagicInterrupt(); return; } - else if (battleutils::IsParalised(m_PMob)) + else if (battleutils::IsParalyzed(m_PMob)) { m_PMob->loc.zone->PushPacket(m_PMob, CHAR_INRANGE, new CMessageBasicPacket(m_PMob,m_PBattleSubTarget,0,0,MSGBASIC_IS_PARALYZED)); m_ActionType = ACTION_MAGIC_INTERRUPT; @@ -1205,7 +1208,7 @@ /************************************************************************ * * -* Обычная физическая атака без нанесения какого-либо урона * +* Normal physical attack without causing any damage * * * ************************************************************************/ @@ -1309,7 +1312,7 @@ if ((m_Tick - m_LastActionTime) > WeaponDelay) { - if (battleutils::IsParalised(m_PMob) && m_AutoAttackEnabled) + if (battleutils::IsParalyzed(m_PMob) && m_AutoAttackEnabled) { m_PMob->loc.zone->PushPacket(m_PMob, CHAR_INRANGE, new CMessageBasicPacket(m_PMob,m_PBattleTarget,0,0, MSGBASIC_IS_PARALYZED)); } @@ -1328,177 +1331,205 @@ } if (m_AutoAttackEnabled) { - apAction_t Action; - m_PMob->m_ActionList.clear(); + apAction_t Action; + m_PMob->m_ActionList.clear(); - Action.ActionTarget = m_PBattleTarget; + Action.ActionTarget = m_PBattleTarget; - uint8 numAttacks = battleutils::CheckMultiHits(m_PMob, m_PMob->m_Weapons[SLOT_MAIN]); + uint8 numAttacks = battleutils::CheckMultiHits(m_PMob, m_PMob->m_Weapons[SLOT_MAIN]); - for(uint8 i=0; iisDead()){ - break; - } + for(uint8 i=0; iisDead()){ + break; + } - uint16 damage = 0; - bool isCountered = false; - bool isParried = false; - bool isGuarded = false; - if (m_PBattleTarget->StatusEffectContainer->HasStatusEffect(EFFECT_PERFECT_DODGE)) + uint16 damage = 0; + bool isCountered = false; + bool isParried = false; + bool isGuarded = false; + if (m_PBattleTarget->StatusEffectContainer->HasStatusEffect(EFFECT_PERFECT_DODGE)) + { + Action.messageID = 32; + } + else if ( rand()%100 < battleutils::GetHitRate(m_PMob, m_PBattleTarget) ) + { + if (battleutils::IsParried(m_PMob, m_PBattleTarget)) { - Action.messageID = 32; + isParried = true; + Action.messageID = 70; + Action.reaction = REACTION_PARRY; + Action.speceffect = SPECEFFECT_NONE; } - else if ( rand()%100 < battleutils::GetHitRate(m_PMob, m_PBattleTarget) ) + else if (battleutils::IsAbsorbByShadow(m_PBattleTarget)) { - if (battleutils::IsParried(m_PMob, m_PBattleTarget)) + Action.messageID = 0; + m_PBattleTarget->loc.zone->PushPacket(m_PBattleTarget,CHAR_INRANGE_SELF, new CMessageBasicPacket(m_PBattleTarget,m_PBattleTarget,0,1, MSGBASIC_SHADOW_ABSORB)); + } + else if (battleutils::IsAnticipated(m_PBattleTarget,false,false)) + { + Action.messageID = 30; + } + else + { + Action.reaction = REACTION_HIT; + Action.speceffect = SPECEFFECT_HIT; + Action.messageID = 1; + + // if victim is a player, get the players counter merits + uint8 meritCounter = 0; + if (m_PBattleTarget->objtype == TYPE_PC && charutils::hasTrait((CCharEntity*)m_PBattleTarget,TRAIT_COUNTER)) { - isParried = true; - Action.messageID = 70; - Action.reaction = REACTION_PARRY; - Action.speceffect = SPECEFFECT_NONE; + if (m_PBattleTarget->GetMJob() == JOB_MNK || m_PBattleTarget->GetMJob() == JOB_PUP) + meritCounter = ((CCharEntity*)m_PBattleTarget)->PMeritPoints->GetMeritValue(MERIT_COUNTER_RATE,m_PBattleTarget->GetMLevel()); } - else if (battleutils::IsAbsorbByShadow(m_PBattleTarget)) + + + //counter check (rate AND your hit rate makes it land, else its just a regular hit) + if (rand()%100 < (m_PBattleTarget->getMod(MOD_COUNTER) + meritCounter) && + rand()%100 < battleutils::GetHitRate(m_PBattleTarget,m_PMob) && + charutils::hasTrait((CCharEntity*)m_PBattleTarget,TRAIT_COUNTER)) { - Action.messageID = 0; - m_PBattleTarget->loc.zone->PushPacket(m_PBattleTarget,CHAR_INRANGE_SELF, new CMessageBasicPacket(m_PBattleTarget,m_PBattleTarget,0,1, MSGBASIC_SHADOW_ABSORB)); + isCountered = true; + Action.messageID = 33; //counter msg 32 + Action.reaction = REACTION_HIT; + Action.speceffect = SPECEFFECT_NONE; + + bool isCritical = ( rand()%100 < battleutils::GetCritHitRate(m_PBattleTarget, m_PMob,false) ); + + float DamageRatio = battleutils::GetDamageRatio(m_PBattleTarget, m_PMob,isCritical, 0); + damage = (uint16)(((m_PBattleTarget->GetMainWeaponDmg() + m_PBattleTarget->getMod(MOD_COUNTER_BASE_DMG))+ battleutils::GetFSTR(m_PBattleTarget, m_PMob,SLOT_MAIN)) * DamageRatio); + + Action.subparam = (damage * 2); + Action.flag = 2; } - else if (battleutils::IsAnticipated(m_PBattleTarget,false,false)) - { - Action.messageID = 30; - } else { - Action.reaction = REACTION_HIT; - Action.speceffect = SPECEFFECT_HIT; - Action.messageID = 1; + bool isCritical = ( rand()%100 < battleutils::GetCritHitRate(m_PMob, m_PBattleTarget,false) ); - // if victim is a player, get the players counter merits - uint8 meritCounter = 0; - if (m_PBattleTarget->objtype == TYPE_PC && charutils::hasTrait((CCharEntity*)m_PBattleTarget,TRAIT_COUNTER)) + if(m_PMob->StatusEffectContainer->HasStatusEffect(EFFECT_MIGHTY_STRIKES,0)) { - if (m_PBattleTarget->GetMJob() == JOB_MNK || m_PBattleTarget->GetMJob() == JOB_PUP) - meritCounter = ((CCharEntity*)m_PBattleTarget)->PMeritPoints->GetMeritValue(MERIT_COUNTER_RATE,m_PBattleTarget->GetMLevel()); + isCritical=true; } + float DamageRatio = battleutils::GetDamageRatio(m_PMob, m_PBattleTarget,isCritical, 0); - //counter check (rate AND your hit rate makes it land, else its just a regular hit) - if (rand()%100 < (m_PBattleTarget->getMod(MOD_COUNTER) + meritCounter) && - rand()%100 < battleutils::GetHitRate(m_PBattleTarget,m_PMob) && - charutils::hasTrait((CCharEntity*)m_PBattleTarget,TRAIT_COUNTER)) + if(isCritical) { - isCountered = true; - Action.messageID = 33; //counter msg 32 - Action.reaction = REACTION_HIT; - Action.speceffect = SPECEFFECT_NONE; - - bool isCritical = ( rand()%100 < battleutils::GetCritHitRate(m_PBattleTarget, m_PMob,false) ); - - float DamageRatio = battleutils::GetDamageRatio(m_PBattleTarget, m_PMob,isCritical, 0); - damage = (uint16)((m_PBattleTarget->GetMainWeaponDmg() + battleutils::GetFSTR(m_PBattleTarget, m_PMob,SLOT_MAIN)) * DamageRatio); - - Action.subparam = (damage * 2); - Action.flag = 2; + Action.speceffect = SPECEFFECT_CRITICAL_HIT; + Action.messageID = 67; } - else - { - bool isCritical = ( rand()%100 < battleutils::GetCritHitRate(m_PMob, m_PBattleTarget,false) ); - if(m_PMob->StatusEffectContainer->HasStatusEffect(EFFECT_MIGHTY_STRIKES,0)) - { - isCritical=true; - } + // Guard + if(battleutils::IsGuarded(m_PMob, m_PBattleTarget)) + { + isGuarded = true; + //Action.messageID = 0; + Action.reaction = REACTION_GUARD; + Action.speceffect = SPECEFFECT_NONE; + DamageRatio -= 1.0f; // Guard lowers pDif by 1.0 + } - float DamageRatio = battleutils::GetDamageRatio(m_PMob, m_PBattleTarget,isCritical, 0); + damage = (uint16)((m_PMob->m_Weapons[SLOT_MAIN]->getDamage() + battleutils::GetFSTR(m_PMob, m_PBattleTarget,SLOT_MAIN)) * DamageRatio); - if(isCritical) - { - Action.speceffect = SPECEFFECT_CRITICAL_HIT; - Action.messageID = 67; - } + // Guard skill up + if(m_PBattleTarget->objtype == TYPE_PC && isGuarded || ((map_config.newstyle_skillups & NEWSTYLE_GUARD) > 0)) + { + m_PBattleTarget->addTP(m_PBattleTarget->getMod(MOD_TACTICAL_GUARD)); + if(battleutils::GetGuardRate(m_PMob, m_PBattleTarget) > 0) + { + charutils::TrySkillUP((CCharEntity*)m_PBattleTarget,SKILL_GRD, m_PBattleTarget->GetMLevel()); + } + } // Guard skill up + } + } - // Guard - if(battleutils::IsGuarded(m_PMob, m_PBattleTarget)) - { - isGuarded = true; - //Action.messageID = 0; - Action.reaction = REACTION_GUARD; - Action.speceffect = SPECEFFECT_NONE; - DamageRatio -= 1.0f; // Guard lowers pDif by 1.0 - } + // Parry skill up + if(m_PBattleTarget->objtype == TYPE_PC && isParried || ((map_config.newstyle_skillups & NEWSTYLE_PARRY) > 0)) + { + m_PBattleTarget->addTP(m_PBattleTarget->getMod(MOD_TACTICAL_PARRY)); + if(battleutils::GetParryRate(m_PMob, m_PBattleTarget) > 0) + { + charutils::TrySkillUP((CCharEntity*)m_PBattleTarget,SKILL_PAR,m_PBattleTarget->GetMLevel()); + } + } // Parry skill up + } + if (m_PBattleTarget->objtype == TYPE_PC && !isCountered && !isParried) + { + charutils::TrySkillUP((CCharEntity*)m_PBattleTarget, SKILL_EVA, m_PMob->GetMLevel()); + } - damage = (uint16)((m_PMob->m_Weapons[SLOT_MAIN]->getDamage() + battleutils::GetFSTR(m_PMob, m_PBattleTarget,SLOT_MAIN)) * DamageRatio); + bool isBlocked = battleutils::IsBlocked(m_PMob, m_PBattleTarget); + if(isBlocked){ Action.reaction = REACTION_BLOCK; } - // Guard skill up - if(m_PBattleTarget->objtype == TYPE_PC && isGuarded || ((map_config.newstyle_skillups & NEWSTYLE_GUARD) > 0)) - { - if(battleutils::GetGuardRate(m_PMob, m_PBattleTarget) > 0) - { - charutils::TrySkillUP((CCharEntity*)m_PBattleTarget,SKILL_GRD, m_PBattleTarget->GetMLevel()); - } - } // Guard skill up - } + if(!isCountered) + { + if (m_PBattleTarget->objtype == TYPE_PC) + { + damage = battleutils::HandleSpecialPhysicalDamageReduction((CCharEntity*)m_PBattleTarget,damage,&Action); + uint16 recoverMP = battleutils::HandleDamageToMP((CCharEntity*)m_PBattleTarget,damage,&Action); + if (recoverMP > 0) + { + // ShowDebug(CL_CYAN"Damage to MP %d", recoverMP); + m_PBattleTarget->addMP(recoverMP); + m_PBattleTarget->loc.zone->PushPacket(m_PBattleTarget,CHAR_INRANGE_SELF, new CMessageBasicPacket(m_PBattleTarget,m_PBattleTarget,0,recoverMP, 276)); + charutils::UpdateHealth((CCharEntity*)m_PBattleTarget); } - - // Parry skill up - if(m_PBattleTarget->objtype == TYPE_PC && isParried || ((map_config.newstyle_skillups & NEWSTYLE_PARRY) > 0)) + uint16 recoverTP = battleutils::HandleDamageToTP((CCharEntity*)m_PBattleTarget,damage,&Action); + if (recoverTP > 0) { - if(battleutils::GetParryRate(m_PMob, m_PBattleTarget) > 0) - { - charutils::TrySkillUP((CCharEntity*)m_PBattleTarget,SKILL_PAR,m_PBattleTarget->GetMLevel()); - } - } // Parry skill up + // ShowDebug(CL_CYAN"Damage to TP %d", recoverTP); + m_PBattleTarget->addTP(recoverTP); + charutils::UpdateHealth((CCharEntity*)m_PBattleTarget); + } + } - if (m_PBattleTarget->objtype == TYPE_PC && !isCountered && !isParried) - { - charutils::TrySkillUP((CCharEntity*)m_PBattleTarget, SKILL_EVA, m_PMob->GetMLevel()); - } - bool isBlocked = battleutils::IsBlocked(m_PMob, m_PBattleTarget); - if(isBlocked){ Action.reaction = REACTION_BLOCK; } - - if(!isCountered) - { - if (m_PBattleTarget->objtype == TYPE_PC) + Action.param = battleutils::TakePhysicalDamage(m_PMob, m_PBattleTarget, damage, isBlocked ,SLOT_MAIN, 1, NULL, true); + m_PMob->PEnmityContainer->UpdateEnmityFromAttack(m_PBattleTarget, Action.param); + + // Block skill up + if(m_PBattleTarget->objtype == TYPE_PC && isBlocked || ((map_config.newstyle_skillups & NEWSTYLE_BLOCK) > 0)) + { + m_PBattleTarget->addTP(m_PBattleTarget->getMod(MOD_SHIELD_MASTERY)); + uint16 blockMP = battleutils::HandleBlockToMP((CCharEntity*)m_PBattleTarget,damage,&Action); + if (blockMP > 0) { - damage = battleutils::HandleSpecialPhysicalDamageReduction((CCharEntity*)m_PBattleTarget,damage,&Action); + // ShowDebug(CL_CYAN"Damage to MP %d", blockMP); + m_PBattleTarget->addMP(blockMP); + m_PBattleTarget->loc.zone->PushPacket(m_PBattleTarget,CHAR_INRANGE_SELF, new CMessageBasicPacket(m_PBattleTarget,m_PBattleTarget,0,blockMP, 276)); + charutils::UpdateHealth((CCharEntity*)m_PBattleTarget); } + if(battleutils::GetBlockRate(m_PMob, m_PBattleTarget) > 0) + { + charutils::TrySkillUP((CCharEntity*)m_PBattleTarget, SKILL_SHL, m_PMob->GetMLevel()); + } + } // Block skill up - Action.param = battleutils::TakePhysicalDamage(m_PMob, m_PBattleTarget, damage, isBlocked ,SLOT_MAIN, 1, NULL, true); - m_PMob->PEnmityContainer->UpdateEnmityFromAttack(m_PBattleTarget, Action.param); - // Block skill up - if(m_PBattleTarget->objtype == TYPE_PC && isBlocked || ((map_config.newstyle_skillups & NEWSTYLE_BLOCK) > 0)) - { - if(battleutils::GetBlockRate(m_PMob, m_PBattleTarget) > 0) - { - charutils::TrySkillUP((CCharEntity*)m_PBattleTarget, SKILL_SHL, m_PMob->GetMLevel()); - } - } // Block skill up - - - // spike effect - if (Action.reaction != REACTION_EVADE && Action.reaction != REACTION_PARRY) - { - // spikes take priority - if(!battleutils::HandleSpikesDamage(m_PMob, m_PBattleTarget, &Action, damage)){ - // no spikes, handle enspell - // TODO: enspell method needs to be refactored to accept just battleentity - // battleutils::HandleEnspell(m_PMob, m_PBattleTarget, &Action, i, WeaponDelay, damage); - } + // spike effect + if (Action.reaction != REACTION_EVADE && Action.reaction != REACTION_PARRY) + { + // spikes take priority + if(!battleutils::HandleSpikesDamage(m_PMob, m_PBattleTarget, &Action, damage)){ + // no spikes, handle enspell + // TODO: enspell method needs to be refactored to accept just battleentity + // battleutils::HandleEnspell(m_PMob, m_PBattleTarget, &Action, i, WeaponDelay, damage); } + battleutils::HandleRetaliation(m_PMob, m_PBattleTarget, &Action, damage); } - else - { - Action.param = battleutils::TakePhysicalDamage(m_PBattleTarget, m_PMob, damage, false, SLOT_MAIN, 1, NULL, true); - } + } + else + { + Action.param = battleutils::TakePhysicalDamage(m_PBattleTarget, m_PMob, damage, false, SLOT_MAIN, 1, NULL, true); + } - m_PMob->m_ActionList.push_back(Action); + m_PMob->m_ActionList.push_back(Action); } battleutils::MoveIntoRange(m_PMob,m_PBattleTarget,25); m_PMob->loc.zone->PushPacket(m_PMob, CHAR_INRANGE, new CActionPacket(m_PMob)); Index: src/map/ai/ai_mob_dummy.h =================================================================== --- src/map/ai/ai_mob_dummy.h (revision 3304) +++ src/map/ai/ai_mob_dummy.h (working copy) @@ -43,9 +43,9 @@ enum AOERANGE { - AOE_PARTY = 0x01, + AOE_PARTY = 0x01, AOE_ALLIANCE = 0x02, - AOE_ZONE = 0x04 + AOE_ZONE = 0x04 }; class CMobEntity; Index: src/map/ai/ai_pet_dummy.cpp =================================================================== --- src/map/ai/ai_pet_dummy.cpp (revision 3304) +++ src/map/ai/ai_pet_dummy.cpp (working copy) @@ -648,7 +648,7 @@ else{ //try to attack if((m_Tick - m_LastActionTime) > m_PPet->m_Weapons[SLOT_MAIN]->getDelay()){ - if (battleutils::IsParalised(m_PPet)) + if (battleutils::IsParalyzed(m_PPet)) { m_PPet->loc.zone->PushPacket(m_PPet, CHAR_INRANGE, new CMessageBasicPacket(m_PPet,m_PBattleTarget,0,0,29)); } Index: src/map/baseentity.cpp =================================================================== --- src/map/baseentity.cpp (revision 3304) +++ src/map/baseentity.cpp (working copy) @@ -51,6 +51,18 @@ return name.c_str(); } +const int8* CBaseEntity::GetSayName() +{ + //Strip out the _ in names + npcSayName = name; + size_t start_pos = npcSayName.find("_"); + if (start_pos < name.size()) + { + npcSayName.replace(start_pos,1," "); + } + return npcSayName.c_str(); +} + uint16 CBaseEntity::getZone() { return loc.zone != NULL ? loc.zone->GetID() : loc.destination; Index: src/map/baseentity.h =================================================================== --- src/map/baseentity.h (revision 3304) +++ src/map/baseentity.h (working copy) @@ -73,7 +73,7 @@ ANIMATION_FISHING_START = 50 }; -// TODO: возможо стоит сделать эту структуру частью класса, взамен нынешних id и targid, но уже без метода clean +// TODO: is possible to make the structure of the class, instead of the current id and targid, but without a clean method struct EntityID_t { @@ -91,17 +91,17 @@ struct location_t { - position_t p; // позиция сущности - uint16 destination; // текущая зона - CZone* zone; // текущая зона - uint16 prevzone; // предыдущая зона (для монстров и npc не используется) - bool zoning; // флаг сбрасывается при каждом входе в новую зону. необходим для реализации логики игровых задач ("quests") - uint16 boundary; // определенная область в зоне, в которой находится сущность (используется персонажами и транспортом) + position_t p; // position essentially + uint16 destination; // current zone + CZone* zone; // current zone + uint16 prevzone; // previous zone (for monsters and npc not used) + bool zoning; // flag is reset every time you access a new area. needed to implement the logic of the game problems ("quests") + uint16 boundary; // specific area in the zone in which the entity (using the characters and vehicles) }; /************************************************************************ * * -* Базовый класс для всех сущностей в игре * +* The base class for all entities in the game * * * ************************************************************************/ @@ -109,28 +109,30 @@ { public: - uint32 id; // глобальный идентификатор, уникальный на сервере - uint16 targid; // локалный идентификатор, уникальный в зоне - ENTITYTYPE objtype; // тип сущности - STATUSTYPE status; // статус сущности (разные сущности - разные статусы) - uint16 m_TargID; // targid объекта, на который смотрит сущность - string_t name; // имя сущности - look_t look; // внешний вид всех сущностей + uint32 id; // global identifier that is unique to the server + uint16 targid; // lokalny identifier that is unique in the area + ENTITYTYPE objtype; // entity Type + STATUSTYPE status; // status of the entity (separate entities - different statuses) + uint16 m_TargID; // targid object that looks the essence + string_t name; // the entity name + string_t npcSayName; // NPC Say name + look_t look; // appearance of all the entities look_t mainlook; // only used if mob use changeSkin() - location_t loc; // местоположение сущности - uint8 animation; // анимация - uint8 animationsub; // дополнительный параметры анимации - uint8 speed; // скорость передвижения - uint8 speedsub; // подолнительный параметр скорости передвижения + location_t loc; // location entities + uint8 animation; // animation + uint8 animationsub; // additional animation options + uint8 speed; // speed + uint8 speedsub; // podolnitelny setting the speed of movement - virtual const int8* GetName(); // имя сущности - uint16 getZone(); // текущая зона - float GetXPos(); // позиция по координате X - float GetYPos(); // позиция по координате Y - float GetZPos(); // позиция по координате Z + virtual const int8* GetName(); // the entity name + virtual const int8* GetSayName(); // the entity name + uint16 getZone(); // current zone + float GetXPos(); // position coordinate X + float GetYPos(); // position coordinate Y + float GetZPos(); // position coordinate Z - CBaseEntity(); // конструктор - virtual ~CBaseEntity(); // деструктор + CBaseEntity(); // designer + virtual ~CBaseEntity(); // destructor private: }; Index: src/map/battleentity.cpp =================================================================== --- src/map/battleentity.cpp (revision 3304) +++ src/map/battleentity.cpp (working copy) @@ -30,7 +30,7 @@ CBattleEntity::CBattleEntity() { m_OwnerID.clean(); - m_ModelSize = 3; // неправильная инициализация, она приведет к тому, что заклинания станут читаться на 3 дальше + m_ModelSize = 3; // this happened, it would lead to the fact that the spell will be read on three further m_mlvl = 0; m_slvl = 0; @@ -108,7 +108,7 @@ /************************************************************************ * * -* Пересчитываем максимальные значения hp и mp с учетом модификаторов * +* Recalculated maximum hp and mp with the modifier * * * ************************************************************************/ @@ -131,7 +131,7 @@ /************************************************************************ * * -* Получаем текущее количество очков жизней * +* Get the current number of hit points * * * ************************************************************************/ @@ -147,7 +147,7 @@ /************************************************************************ * * -* Получаем текущее количество очков маны * +* Get the current amount of mana * * * ************************************************************************/ @@ -342,7 +342,7 @@ /************************************************************************ * * -* Изменяем количество TP сущности * +* Change the nature of TP * * * ************************************************************************/ @@ -371,7 +371,7 @@ /************************************************************************ * * -* Изменяем количество жизней сущности * +* Change the number of lives the essence * * * ************************************************************************/ @@ -387,7 +387,7 @@ hp = health.hp - cap; health.hp = cap; - // если количество жизней достигает нуля, то сущность умирает + // If the number of lives reaches zero, the entity dies if(hp > 0) { @@ -415,7 +415,7 @@ /************************************************************************ * * -* Полные значения характеристик боевой сущности * +* The full value of the characteristics of combat entity * * * ************************************************************************/ @@ -566,14 +566,14 @@ void CBattleEntity::SetMJob(uint8 mjob) { - DSP_DEBUG_BREAK_IF(mjob == 0 || mjob >= MAX_JOBTYPE); // выход за пределы доступных профессий + DSP_DEBUG_BREAK_IF(mjob == 0 || mjob >= MAX_JOBTYPE); // going beyond the available jobs m_mjob = (JOBTYPE)mjob; } void CBattleEntity::SetSJob(uint8 sjob) { - DSP_DEBUG_BREAK_IF(sjob >= MAX_JOBTYPE); // выход за пределы доступных профессий + DSP_DEBUG_BREAK_IF(sjob >= MAX_JOBTYPE); // going beyond the available jobs m_sjob = (JOBTYPE)sjob; } @@ -592,7 +592,7 @@ /************************************************************************ * * -* Добавляем модификатор * +* Add modifier * * * ************************************************************************/ @@ -603,7 +603,7 @@ /************************************************************************ * * -* Добавляем модификаторы * +* Add modifier * * * ************************************************************************/ @@ -617,7 +617,7 @@ /************************************************************************ * * -* Устанавливаем модификатор * +* Set the modifier * * * ************************************************************************/ @@ -628,7 +628,7 @@ /************************************************************************ * * -* Устанавливаем модификаторы * +* Set modifier * * * ************************************************************************/ @@ -642,7 +642,7 @@ /************************************************************************ * * -* Удаляем модификатор * +* Remove the modifier * * * ************************************************************************/ @@ -653,7 +653,7 @@ /************************************************************************ * * -* Удаляем модификаторы * +* Remove the modifier * * * ************************************************************************/ @@ -667,7 +667,7 @@ /************************************************************************ * * -* Получаем текущее значение указанного модификатора * +* Get the current value of the specified modifier * * * ************************************************************************/ @@ -682,7 +682,7 @@ /************************************************************************ * * -* Текущая величина умения (не максимальная, а ограниченная уровнем) * +* The current value of skills (not the maximum, and a limited level) * * * ************************************************************************/ Index: src/map/battleentity.h =================================================================== --- src/map/battleentity.h (revision 3304) +++ src/map/battleentity.h (working copy) @@ -203,7 +203,7 @@ SUBSKILL_TOLOI = 68 }; -// ячейки экипировки. монстры используют лишь первые четыре, персонаж использует все +// cell equipment. Monsters use only the first four, the character uses all enum SLOTTYPE { @@ -226,9 +226,9 @@ SLOT_LINK = 0x10 }; -// CROSSBOW и GUN - это Piercing, разделение сделано из-за одинакового skilltype -// для возможности различить эти орудия при экипировке и избавиться от ошибки -// использования пуль с арбалетом и арбалетных стрел с огнестрельным оружием (только персонажи) +// CROSSBOW and GUN - it Piercing, the division made ​​by the same skilltype +// to be able to distinguish these weapons when equipped and get rid of the error +// use bullets with a crossbow and crossbow bolts with a firearm (only characters) enum DAMAGETYPE { @@ -243,12 +243,12 @@ enum REACTION { - REACTION_NONE = 0x00, // отсутствие реакции - REACTION_MISS = 0x01, // промах - REACTION_PARRY = 0x03, // блокирование оружием (MISS + PARRY) - REACTION_BLOCK = 0x04, // блокирование щитом - REACTION_HIT = 0x08, // попадание - REACTION_EVADE = 0x09, // уклонение (MISS + HIT) + REACTION_NONE = 0x00, // lack of response + REACTION_MISS = 0x01, // slip + REACTION_PARRY = 0x03, // locking arms (MISS + PARRY) + REACTION_BLOCK = 0x04, // block with + REACTION_HIT = 0x08, // hit + REACTION_EVADE = 0x09, // evasion (MISS + HIT) REACTION_GUARD = 0x14, // mnk guard (20 dec) }; @@ -300,6 +300,7 @@ // 9 weight? or evasion down? SUBEFFECT_HP_DRAIN = 10, // 110101 43 SUBEFFECT_TP_DRAIN = 11, + SUBEFFECT_WEAKENS_ATTACKS = 12, //SKILLCHAINS @@ -339,7 +340,7 @@ TARGET_PLAYER_ALLIANCE = 0x08, TARGET_PLAYER = 0x10, TARGET_PLAYER_DEAD = 0x20, - TARGET_NPC = 0x40 // скорее всего подразумевается mob, выглядящий как npc и воюющий на стороне персонажа + TARGET_NPC = 0x40 // likely mean mob, looking like npc and fighting on the side of the character }; enum SKILLCHAIN_ELEMENT @@ -401,16 +402,16 @@ /************************************************************************ * * -* TP хранится то пому же принципу, что и skill, т.е. 6,4% = 64 * +* TP then stored pomu same principle as the skill, ie 6,4% = 64 * * * ************************************************************************/ struct health_t { - float tp; // текущее значение - int32 hp, mp; // текущие значения - int32 maxhp, maxmp; // максимальные значения - int32 modhp, modmp; // модифицированные максимальные значения + float tp; // present value + int32 hp, mp; // current values + int32 maxhp, maxmp; // maximum + int32 modhp, modmp; // modified maximum }; typedef std::vector ActionList_t; @@ -420,8 +421,8 @@ public: health_t health; // hp,mp,tp - stats_t stats; // атрибуты STR,DEX,VIT,AGI,INT,MND,CHR - skills_t WorkingSkills; // структура всех доступных сущности умений, ограниченных уровнем + stats_t stats; // attributes STR,DEX,VIT,AGI,INT,MND,CHR + skills_t WorkingSkills; // structure essentially all available skills, the limited level of IMMUNITY m_Immunity; // Mob immunity uint16 m_magicEvasion; // store this so it can be removed easily @@ -441,27 +442,27 @@ uint32 charmTime; // to hold the time entity is charmed bool isCharmed; // is the battle entity charmed? - bool isDead(); // проверяем, мертва ли сущность + bool isDead(); // check whether the entity is dead bool isInDynamis(); bool hasImmunity(uint32 imID); bool isAsleep(); - JOBTYPE GetMJob(); // главная профессия - JOBTYPE GetSJob(); // дополнительная профессия - uint8 GetMLevel(); // уровень главной профессии - uint8 GetSLevel(); // уровень дополнительной профессии + JOBTYPE GetMJob(); // home Occupation + JOBTYPE GetSJob(); // secondary skill + uint8 GetMLevel(); // level of the main occupations + uint8 GetSLevel(); // additional level of profession - void SetMJob(uint8 mjob); // главная профессия - void SetSJob(uint8 sjob); // дополнительная профессия - void SetMLevel(uint8 mlvl); // уровень главной профессии - void SetSLevel(uint8 slvl); // уровень дополнительной профессии + void SetMJob(uint8 mjob); // home Occupation + void SetSJob(uint8 sjob); // secondary skill + void SetMLevel(uint8 mlvl); // level of the main occupations + void SetSLevel(uint8 slvl); // additional level of profession - uint8 GetHPP(); // количество hp в процентах - int32 GetMaxHP(); // максимальное количество hp - uint8 GetMPP(); // количество mp в процентах - int32 GetMaxMP(); // максимальное количество mp - void UpdateHealth(); // пересчет максимального количества hp и mp, а так же корректировка их текущих значений + uint8 GetHPP(); // Percentage of hp + int32 GetMaxHP(); // the maximum amount of hp + uint8 GetMPP(); // Percentage of mp + int32 GetMaxMP(); // the maximum number of mp + void UpdateHealth(); // counting the maximum number of hp and mp, as well as the adjustment of their current values int16 GetWeaponDelay(bool tp); //returns delay of combined weapons int16 GetRangedWeaponDelay(bool tp); //returns delay of ranged weapon + ammo where applicable @@ -473,13 +474,13 @@ uint16 GetSubWeaponRank(); //returns total sub weapon DMG Rank uint16 GetRangedWeaponRank(); //returns total ranged weapon DMG Rank - uint16 GetSkill(uint16 SkillID); // текущая величина умения (не максимальная, а ограниченная уровнем) + uint16 GetSkill(uint16 SkillID); // current value of skills (not the maximum, and the limited level) - virtual uint16 addTP(float tp); // увеличиваем/уменьшаем количество tp - virtual int32 addHP(int32 hp); // увеличиваем/уменьшаем количество hp - virtual int32 addMP(int32 mp); // увеличиваем/уменьшаем количество mp + virtual uint16 addTP(float tp); // increase / decrease the number of tp + virtual int32 addHP(int32 hp); // increase / decrease the number of hp + virtual int32 addMP(int32 mp); // increase / decrease the number of mp - int16 getMod(uint16 modID); // величина модификатора + int16 getMod(uint16 modID); // value modifier bool Rest(float rate); // heal an amount of hp / mp @@ -490,34 +491,34 @@ void setModifiers(std::vector *modList); void delModifiers(std::vector *modList); - uint8 m_ModelSize; // размер модели сущности, для расчета дальности физической атаки - ECOSYSTEM m_EcoSystem; // эко-система сущности - CItemWeapon* m_Weapons[4]; // четыре основных ячейки, используемыж для хранения оружия (только оружия) + uint8 m_ModelSize; // size model of the entity for the calculation range of physical attack + ECOSYSTEM m_EcoSystem; // eco-system of nature + CItemWeapon* m_Weapons[4]; // four major cell ispolzuemyzh for weapons (only weapon) - TraitList_t TraitList; // список постянно активных способностей в виде указателей + TraitList_t TraitList; // Fasting list active abilities as pointers - EntityID_t m_OwnerID; // ID атакующей сущности (после смерти будет хранить ID сущности, нанесщей последний удар) + EntityID_t m_OwnerID; // ID attacking entity (after death will store ID essentially nanesschey last hit) - ActionList_t m_ActionList; // список совершенных действий за одну атаку (нужно будет написать структуру, включающую ActionList в которой будут категории анимации и т.д.) + ActionList_t m_ActionList; // list of acts committed in one attack (you need to write a framework that includes ActionList category in which to animate and etc.) - CAIGeneral* PBattleAI; // интеллект боевой сущности - CParty* PParty; // описание группы, в которой состоит сущность - CBattleEntity* PPet; // питомец сущности - CBattleEntity* PMaster; // владелец/хозяин сущности (распространяется на все боевые сущности) + CAIGeneral* PBattleAI; // military intelligence entities + CParty* PParty; // description of the group, which is the essence + CBattleEntity* PPet; // pet essence + CBattleEntity* PMaster; // owner / host entity (applies to all military entity) CStatusEffectContainer* StatusEffectContainer; - CBattleEntity(); // конструктор - virtual ~CBattleEntity(); // деструктор + CBattleEntity(); // designer + virtual ~CBattleEntity(); // destructor private: - JOBTYPE m_mjob; // главная профессия - JOBTYPE m_sjob; // дополнительная профессия - uint8 m_mlvl; // ТЕКУЩИЙ уровень главной профессии - uint8 m_slvl; // ТЕКУЩИЙ уровень дополнительной профессии + JOBTYPE m_mjob; // home Occupation + JOBTYPE m_sjob; // secondary skill + uint8 m_mlvl; // The current level of the main occupations + uint8 m_slvl; // The current level of the profession more - int16 m_modStat[MAX_MODIFIER]; // массив модификаторов + int16 m_modStat[MAX_MODIFIER]; // array modifiers }; #endif \ No newline at end of file Index: src/map/battleutils.cpp =================================================================== --- src/map/battleutils.cpp (revision 3304) +++ src/map/battleutils.cpp (working copy) @@ -499,6 +499,199 @@ } +uint32 HandleDamageToMP(CCharEntity* PChar, uint32 damage, apAction_t* Action) +{ + // check for gear + CItemArmor* PEarring1 = (CItemWeapon*)PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_EAR1]); + CItemArmor* PEarring2 = (CItemWeapon*)PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_EAR2]); + CItemArmor* PWaist = (CItemWeapon*)PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_WAIST]); + CItemArmor* PHead = (CItemWeapon*)PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_HEAD]); + CItemArmor* PBody = (CItemWeapon*)PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_BODY]); + + uint32 damageToMP = 0; + if(PEarring1 != NULL) + { + switch(PEarring1->getID()) + { + //Ethereal Earring + case 15965: + damageToMP = damage * .03; + break; + + + default: + break; + } + } + if(PEarring2 != NULL) + { + switch(PEarring2->getID()) + { + //Ethereal Earring + case 15965: + damageToMP = damage * .03; + break; + + + default: + break; + } + } + if(PBody != NULL) + { + switch(PBody->getID()) + { + //Valor Surcoat + case 15093: + //Valor Surcoat +1 + case 14506: + if(PChar->StatusEffectContainer->HasStatusEffect(EFFECT_COVER)) + { + damageToMP = damage * .2; + break; + } + + //Valor Surcoat +2 + case 10676: + if(PChar->StatusEffectContainer->HasStatusEffect(EFFECT_COVER)) + { + damageToMP = damage * .3; + break; + } + + default: + break; + } + } + if(PWaist != NULL) + { + switch(PWaist->getID()) + { + //Flume Belt + case 10819: + damageToMP = damage * .02; + break; + + + default: + break; + } + } + if(PHead != NULL) + { + switch(PHead->getID()) + { + //Creed Armet +1 + case 11170: + damageToMP = damage * .03; + break; + + //Creed Armet +1 + case 11070: + damageToMP = damage * .05; + break; + + default: + break; + } + } + + return damageToMP; + +} + +uint32 HandleDamageToTP(CCharEntity* PChar, uint32 damage, apAction_t* Action) +{ + // check for gear + CItemArmor* PShield = (CItemWeapon*)PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_EAR1]); + CItemArmor* PArmor = (CItemWeapon*)PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_BODY]); + + uint32 damageToTP = 0; + if(PShield != NULL) + { + switch(PShield->getID()) + { + //Butznar Shield + case 28671: + damageToTP = damage * .005; + break; + + //Butznar Shield +1 + case 28669: + damageToTP = damage * .005; + break; + + + default: + break; + } + } + if(PArmor != NULL) + { + switch(PArmor->getID()) + { + //Mekira Toshugai + case 11865: + damageToTP = damage * .01; + break; + + //Mekira Toshugai +1 + case 11871: + damageToTP = damage * .012; + break; + + //Mekira Meikogai + case 11868: + damageToTP = damage * .014; + break; + + + default: + break; + } + } + + return damageToTP; + +} + +uint32 HandleBlockToMP(CCharEntity* PChar, uint32 damage, apAction_t* Action) +{ + // check for gear + CItemArmor* PShield = (CItemWeapon*)PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_SUB]); + + uint32 blockToMP = 0; + if(PShield != NULL) + { + switch(PShield->getID()) + { + //Ochain - 90 + case 16193: + blockToMP = damage * .25; + break; + + //Ochain - 95 + case 16194: + blockToMP = damage * .30; + break; + + //Ochain - 99 + case 16199: + //Ochain - 99 - 2 + case 11926: + blockToMP = damage * .35; + break; + + + default: + break; + } + } + + return blockToMP; + +} + uint16 CalculateSpikeDamage(CBattleEntity* PAttacker, CBattleEntity* PDefender, uint8 spikesType, uint16 damageTaken) { uint16 damage = PDefender->getMod(MOD_SPIKES_DMG); @@ -696,6 +889,16 @@ spikesEffect = (SUBEFFECT)0; switch(PItem->getID()) { + case 11962: // Galvanic Slops + spikesEffect = SUBEFFECT_ICE_SPIKES; + damage = 25; + chance = 25; + break; + case 11948: // Staunch Cuisses + spikesEffect = SUBEFFECT_ICE_SPIKES; + damage = 20; + chance = 25; + break; case 12880: // ogre trousers spikesEffect = SUBEFFECT_ICE_SPIKES; damage = 15; @@ -799,6 +1002,12 @@ spikesEffect = (SUBEFFECT)0; switch(PItem->getID()) { + case 15018: // Ritterhentzes + case 11921: // Magma Gauntlets + spikesEffect = SUBEFFECT_BLAZE_SPIKES; + damage = 20; + chance = 20; + break; case 15042: // gothic gauntlets case 14952: // ice gauntlets spikesEffect = SUBEFFECT_ICE_SPIKES; @@ -844,6 +1053,11 @@ damage = 0; chance = 20; break; + case 11433: // Dornen Schuhs + spikesEffect = SUBEFFECT_SHOCK_SPIKES; + damage = 20; + chance = 25; + break; } if(spikesEffect && HandleSpikesEquip(PAttacker, PDefender, Action, damage, spikesEffect, chance)){ @@ -1046,20 +1260,20 @@ !PDefender->StatusEffectContainer->HasStatusEffect(EFFECT_DRAIN_DAZE) && PAttacker->StatusEffectContainer->HasStatusEffect(EFFECT_DRAIN_SAMBA)) { - PDefender->StatusEffectContainer->DelStatusEffect(EFFECT_ASPIR_DAZE); - PDefender->StatusEffectContainer->DelStatusEffect(EFFECT_HASTE_DAZE); + PDefender->StatusEffectContainer->DelStatusEffect(EFFECT_ASPIR_DAZE); + PDefender->StatusEffectContainer->DelStatusEffect(EFFECT_HASTE_DAZE); PDefender->StatusEffectContainer->AddStatusEffect(new CStatusEffect(EFFECT_DRAIN_DAZE,EFFECT_DRAIN_DAZE,10,0,10)); - } + } break; case ENSPELL_ASPIR_SAMBA: if (hitNumber <= 2 && PDefender->m_EcoSystem != SYSTEM_UNDEAD && !PDefender->StatusEffectContainer->HasStatusEffect(EFFECT_ASPIR_DAZE) && PAttacker->StatusEffectContainer->HasStatusEffect(EFFECT_ASPIR_SAMBA)) { - PDefender->StatusEffectContainer->DelStatusEffect(EFFECT_DRAIN_DAZE); - PDefender->StatusEffectContainer->DelStatusEffect(EFFECT_HASTE_DAZE); + PDefender->StatusEffectContainer->DelStatusEffect(EFFECT_DRAIN_DAZE); + PDefender->StatusEffectContainer->DelStatusEffect(EFFECT_HASTE_DAZE); PDefender->StatusEffectContainer->AddStatusEffect(new CStatusEffect(EFFECT_ASPIR_DAZE,EFFECT_ASPIR_DAZE,10,0,10)); - } + } case ENSPELL_HASTE_SAMBA: if (hitNumber <= 2 && !PDefender->StatusEffectContainer->HasStatusEffect(EFFECT_HASTE_DAZE) && @@ -1093,7 +1307,7 @@ Samba -= lvlDiff; if (Samba > (finaldamage / 2)){ - Samba = finaldamage / 2; + Samba = finaldamage / 2; } if(finaldamage <= 2){ @@ -1138,33 +1352,901 @@ // no enspells active, check weapon additional effects CItemWeapon* PWeapon = (CItemWeapon*)PAttacker->getStorage(LOC_INVENTORY)->GetItem(PAttacker->equip[SLOT_MAIN]); - + CItemWeapon* PAmmo = (CItemWeapon*)PAttacker->getStorage(LOC_INVENTORY)->GetItem(PAttacker->equip[SLOT_AMMO]); + int ammoUse = 0; if (Action->animation == 1) PWeapon = (CItemWeapon*)PAttacker->getStorage(LOC_INVENTORY)->GetItem(PAttacker->equip[SLOT_SUB]); if(PWeapon != NULL) { EFFECT dispelled; + uint8 chance = 0; + uint8 effect = 0; switch(PWeapon->getID()) { - //Additional Effect: HP drain Weapons - case 16827: - case 16528: - case 16824: - case 17651: - case 16556: - case 16609: - case 16580: - case 17646: - case 16777: - case 16791: - case 16846: - case 16881: - case 17561: - case 17562: - case 17778: - case 17779: - case 17576: - case 17510: + // Additional Effect vs. Vermin: HP Drain + case 18428: // Kogitsunemaru + if(PDefender->m_EcoSystem == SYSTEM_VERMIN) + { + effect = 1; + } + return; + //Additional Effect: HP Drain Weapons + case 16827: // Carnage Blade + case 16528: // Bloody Rapier + case 16824: // Carnage Rapier + case 17651: // Dainslaif + case 16556: // Bloody Blade + case 16609: // Bloody Sword + case 16580: // Bloodsword + case 17646: // Carnage Sword + case 16777: // Death Scythe + case 16791: // Death Scythe +1 + case 16846: // Bloody Lance + case 16881: // Carnage Lance + case 17561: // Revenging Staff + case 17562: // Revenging Staff +1 + case 17778: // Muketsu + case 17779: // Muketsu +1 + case 17576: // Grim Staff + case 17510: // Vampiric Claws + case 18810: // Cadushi Grip + case 16582: // Vetala Sword + case 18859: // Kerykeion + case 18785: // Grotesque Cesti + case 18908: // Dhampyr Sword + case 18856: // Deae Gratia + { + effect = 1; + } + break; + + case 18324: // Mjollnir Lvl 75 + case 18325: // Mjollnir Lvl 80 + case 18647: // Mjollnir Lvl 85 + case 18661: // Mjollnir Lvl 90 + case 18675: // Mjollnir Lvl 95 + case 19756: // Mjollnir Lvl 99 + case 19849: // Mjollnir Lvl 99 - 2 + { + effect = 2; + } + break; + + //Additional Effect: TP drain Weapons + case 18904: // Ephemeron + case 19795: // Ereptor Lance + case 19160: // Estramacon + case 18437: // Namikirimaru + case 17823: // Shinsoku + { + effect = 3; + } + break; + + //Additional Effect: MP drain Weapons + case 17574: // Archalaus's Pole + case 16509: // Aspir Knife + case 18948: // Enforcer + case 17430: // Fey Wand + case 18047: // Havoc Scythe + case 17718: // Leech Scimitar + case 17072: // Lilith's Rod + case 18941: // Naigama + case 18942: // Naigama +1 + case 18599: // Pestle + { + effect = 4; + } + break; + + //Additional Effect: HP or MP drain Weapons + case 17745: // Hofud + { + effect = 5; + } + break; + + //Additional Effect: HP, MP, or TP drain Weapons + case 19132: // Twilight Knife + { + if (rand()%100 <= 30) + { + int randomEffect = rand()%3; + if (randomEffect == 0) + { + effect =1; + } + else if (randomEffect == 1) + { + effect = 4; + } + else + { + effect = 3; + } + } + } + break; + // Additional Effect vs. Vermin: Stun + case 18040: // Webcutter + if(PDefender->m_EcoSystem == SYSTEM_VERMIN) + { + effect = 6; + } + break; + //Additional Effect: Stun Weapons (5% chance guestimate) + case 19177: // Etourdissante + case 19178: // Etourdissante +1 + case 16910: // Mamushito + case 17770: // Mamushito +1 + case 19019: // Platinum Grip + case 19020: // Platinum Grip +1 + case 17464: // Purgatory Mace + case 16431: // Stun Claws + case 17486: // Stun Claws +1 + case 16432: // Stun Jamadhars + case 17484: // Stun Jamadhars +1 + case 16503: // Stun Knife + case 17600: // Stun Knife +1 + case 16506: // Stun Kukri + case 17614: // Stun Kukri +1 + { + effect = 6; + } + break; + + // Additional Effect vs. Tigers: Paralysis + case 16672: // Tigerhunter + if(((CMobEntity*)PDefender)->m_Family == 242) + { + effect = 7; + } + break; + //Additional Effect: Paralysis Weapons (5% chance guestimate) + case 17737: // Corsair's Scimitar + case 18762: // Custodes + case 17648: // Dragvandil + case 18211: // Gawain's Axe + case 18312: // Kikoku Lvl 75 + case 18313: // Kikoku Lvl 80 + case 18645: // Kikoku Lvl 85 + case 18659: // Kikoku Lvl 90 + case 18673: // Kikoku Lvl 95 + case 19754: // Kikoku Lvl 99 + case 19847: // Kikoku Lvl 99 - 2 + case 19796: // Rosschinder + case 19797: // Rosschinder +1 + case 17492: // Shiva's Claws + { + effect = 7; + } + break; + + // Additional Effect: Petrify (5% chance guestimate) + case 18454: // Ishikirimaru + { + effect = 8; + } + break; + + // Additional Effect: Terror (5% chance guestimate) + case 19163: // Nightfall + { + effect = 9; + } + break; + + // Additional Effect: Addle (5% chance guestimate) + case 19316: // Fetter Lance + { + effect = 10; + } + break; + + // Additional Effect: Choke (5% chance guestimate) + case 18288: // Guttler Lvl 75 + case 18289: // Guttler Lvl 80 + case 18641: // Guttler Lvl 85 + case 18655: // Guttler Lvl 90 + case 18669: // Guttler Lvl 95 + case 19750: // Guttler Lvl 99 + case 19843: // Guttler Lvl 99 - 2 + { + effect = 11; + } + break; + + // Additional Effect vs. Plantoids: Weight + case 16785: // Harvester + if(PDefender->m_EcoSystem == SYSTEM_PLANTOID) + { + effect = 12; + } + break; + // Additional Effect: Weight (5% chance guestimate) + case 18096: // Heavy Lance + case 18026: // Magnet Knife + case 19140: // Mantodea Harpe + { + effect = 12; + } + break; + + // Additional Effect: Amnesia (5% chance guestimate) + case 18510: // Vermeil Bhuj + { + effect = 13; + } + break; + + // Additional Effect vs. Plantoids: Bind + case 16783: // Plantreaper + if(PDefender->m_EcoSystem == SYSTEM_PLANTOID) + { + effect = 14; + } + break; + // Additional Effect vs. Birds: Bind + case 18044: // Scarecrow Scythe + if(PDefender->m_EcoSystem == SYSTEM_BIRD) + { + effect = 14; + } + break; + // Additional Effect vs. Arcana: Bind + case 17058: // Caduceus + if(PDefender->m_EcoSystem == SYSTEM_ARCANA) + { + effect = 14; + } + break; + // Additional Effect: Bind (5% chance guestimate) + case 16897: // Kageboshi + { + effect = 14; + } + break; + + // Additional Effect: Slow (5% chance guestimate) + case 17083: // Time Hammer + { + effect = 15; + } + break; + + // Additional Effect: Flash (5% chance guestimate) + case 17069: // Moepapa Mace + { + effect = 16; + } + break; + + // Additional Effect: Reduce Enemy TP (2% chance guestimate) + case 19298: // Ikarigiri + { + effect = 17; + } + break; + + // Additional Effect: STR Boost 10% ?? + case 17563: // Power Staff + { + effect = 18; + } + break; + + // Additional Effect: Haste (7% chance guestimate) + case 16504: // Oynos Knife + { + effect = 19; + } + break; + + // Additional Effect: Blink (15% chance guestimate) + case 18830: // Gusterion + { + effect = 20; + } + break; + + //Additional Effect: Poison Weapons (5% chance guestimate) + case 16907: // Busuto + case 16927: // Busuto +1 + case 16525: // Hornet Fleuret + case 16909: // Kororito + case 17769: // Kororito +1 + case 17937: // Leopard Axe + case 18270: // Mandau Lvl 75 + case 18271: // Mandau Lvl 80 + case 18638: // Mandau Lvl 85 + case 18652: // Mandau Lvl 90 + case 18666: // Mandau Lvl 95 + case 19747: // Mandau Lvl 99 + case 19840: // Mandau Lvl 99 - 2 + case 17650: // Nadrs + case 16458: // Poison Baselard + case 16387: // Poison Cesti + case 16700: // Poison Cesti +1 + case 16417: // Poison Claws + case 16439: // Poison Claws +1 + case 16496: // Poison Dagger + case 16741: // Poison Dagger +1 + case 16403: // Poison Katars + case 16693: // Poison Katars +1 + case 16472: // Poison Knife + case 16742: // Poison Knife +1 + case 16478: // Poison Kukri + case 16488: // Poison Kukri +1 + case 16410: // Poison Baghnakhs + case 16692: // Poison Baghnakhs +1 + case 16743: // Python Baselard + case 16507: // Venom Baselard + case 16510: // Venom Baselard +1 + case 16418: // Venom Claws + case 16425: // Venom Claws +1 + case 16404: // Venom Katars + case 17483: // Venom Katars +1 + case 16502: // Venom Knife + case 16762: // Venom Knife +1 + case 16499: // Venom Kris + case 16761: // Venom Kris +1 + case 16505: // Venom Kukri + case 17604: // Venom Kukri +1 + case 17959: // Viperine Pick + case 17634: // Wasp Fleuret + { + effect = 21; + } + break; + + // Additional Effect: Poisone, Paralysis, or Bind (5% chance guestimate) + case 18784: // Metasoma Katars + if (rand()%100 <= 5) + { + int metasomaEffect = rand()%3; + if (metasomaEffect == 0) + { + effect = 21; + } + else if (metasomaEffect == 1) + { + effect = 7; + } + else + { + effect = 14; + } + } + break; + + // Additional Effect: Blind (5% chance guestimate) + case 18306: // Apocalypse Lvl 75 + case 18307: // Apocalypse Lvl 80 + case 18644: // Apocalypse Lvl 85 + case 18658: // Apocalypse Lvl 90 + case 18672: // Apocalypse Lvl 95 + case 19753: // Apocalypse Lvl 99 - 1 + case 19846: // Apocalypse Lvl 99 - 2 + case 16454: // Blind Dagger + case 16493: // Blind Dagger +1 + case 16471: // Blind Knife + case 16490: // Blind Knife +1 + case 16905: // Bokuto + case 16926: // Bokuto +1 + { + effect = 22; + } + break; + + // Additional Effect: Silence (5% chance guestimate) + case 17627: // Garuda's Dagger + case 18355: // Hushed Baghnakhs + case 18008: // Hushed Dagger + case 16906: // Mokuto + case 16925: // Mokuto +1 + case 17797: // Seito + case 16495: // Silence Dagger + case 16508: // Silence Dagger +1 + case 16429: // Silence Baghnakhs + case 16438: // Silence Baghnakhs +1 + { + effect = 23; + } + break; + + // Additional Effect: Curse (5% chance guestimate) + case 16533: // Ancient Sword + case 17116: // Misery Staff + case 18813: // Ultio Grip + { + effect = 24; + } + break; + + // Additional Effect: Death (2% chance guestimate) + case 18916: // Heimdall's Doom + case 18551: // Twilight Scythe + { + effect = 25; + } + break; + + // Additional Effect: Sleep (5% chance guestimate) + case 17117: // Hypno Staff + case 16497: // Sleep Dagger + case 17575: // Somnus Signa + { + effect = 26; + } + break; + + + // Additional Effect: Impairs Evasion (5% chance guestimate) + case 18032: // Adder Jambiya + case 18033: // Adder Jambiya +1 + case 17695: // Bayard's Sword + case 18294: // Bravura Lvl 75 + case 18295: // Bravura Lvl 80 + case 18642: // Bravura Lvl 85 + case 18656: // Bravura Lvl 90 + case 18670: // Bravura Lvl 95 + case 19751: // Bravura Lvl 99 + case 19844: // Bravura Lvl 99 - 2 + case 16773: // Cruel Scythe + case 16863: // Cruel Spear + case 18118: // Dark Mezraq + case 18119: // Dark Mezraq +1 + case 16974: // Dotanuki + case 18110: // Mezraq + case 18111: // Mezraq +1 + case 18123: // Thalassocrat + case 18124: // Thalassocrat +1 + { + effect = 27; + } + break; + + // Additional Effect vs. Dolls: Weakens Defense + case 16674: // Emeth Pick + if((((CMobEntity*)PDefender)->m_Family == 83) || ((CMobEntity*)PDefender)->m_Family == 84 + || ((CMobEntity*)PDefender)->m_Family == 85) + { + effect = 28; + } + break; + + // Additional Effect vs. Arcana Weakens Defense + case 17416: // Arcana Breaker + if(PDefender->m_EcoSystem == SYSTEM_ARCANA) + { + effect = 28; + } + break; + + // Additional Effect Weakens Defense + case 16430: // Acid Claws + case 16459: // Acid Baselard + case 17605: // Acid Dagger + case 16501: // Acid Knife + case 16479: // Acid Kukri + case 18794: // Blutklauen + case 18793: // Blutkrallen + case 17487: // Corrosive Claws + case 17607: // Corrosive Baselard + case 17606: // Corrosive Dagger + case 17608: // Corrosive Knife + case 16494: // Corrosive Kukri + case 17694: // Guespiere + case 18300: // Gungnir Lvl 75 + case 18301: // Gungnir Lvl 80 + case 18643: // Gungnir Lvl 85 + case 18657: // Gungnir Lvl 90 + case 18671: // Gungnir Lvl 95 + case 19752: // Gungnir Lvl 99 + case 19845: // Gungnir Lvl 99 - 2 + case 18357: // Melt Claws + case 18012: // Melt Baselard + case 18010: // Melt Dagger + case 18011: // Melt Knife + case 18013: // Melt Kukri + case 18410: // Melt Katana + case 20639: // Oxidant Baselard + case 20640: // Nitric Baselard + case 21009: // Nakajimarai + case 21010: // Nakajimarai +1 + case 17106: // Rockmasher + case 16908: // Yoto + case 17768: // Yoto +1 + { + effect = 28; + } + break; + + // Additional Effect: Weakens Attacks 5% ?? + case 18318: // Amanomurakumo Lvl 75 + case 18319: // Amanomurakumo Lvl 80 + case 18646: // Amanomurakumo Lvl 85 + case 18660: // Amanomurakumo Lvl 90 + case 18674: // Amanomurakumo Lvl 95 + case 19775: // Amanomurakumo Lvl 99 + case 19848: // Amanomurakumo Lvl 99 - 2 + case 18088: // Dreizack + { + effect = 29; + } + break; + + // Additional Effect vs. Beasts: Darkness Damage + case 18041: // A L'Outrance + if(PDefender->m_EcoSystem == SYSTEM_BEAST) + { + effect = 30; + } + break; + // Additional Effect: Darkness Damage (5% chance guestimate) + case 18961: // Plaga Scythe + case 16515: // Colichemarde + case 17632: // Colichemarde +1 + case 16787: // Demon Slicer + case 17559: // Dark Staff + case 17560: // Pluto's Staff + case 16936: // Demonic Sword + { + effect = 30; + } + break; + + // Additional Effect: Earth Damage (5% chance guestimate) + case 17552: // Terra Staff + case 18501: // Seismic Axe + case 17807: // Gold Musketeers Uchigatana + case 19114: // Galkan Dagger + case 17076: // Earth Wand + case 17551: // Earth Staff + case 17438: // Titan's Cudgel + { + effect = 31; + } + break; + + // Additional Effect vs. Undead: Fire Damage + case 18042: // Ascention + if(PDefender->m_EcoSystem == SYSTEM_UNDEAD) + { + effect = 32; + } + break; + // Additional Effect vs. Plantoids: Fire Damage + case 16720: // Plantbane + if(PDefender->m_EcoSystem == SYSTEM_PLANTOID) + { + effect = 32; + } + break; + // Additional Effect: Fire Damage (5% chance guestimate) + case 18385: // Agol + case 19151: // Bahdur + case 19152: // Bahdur +1 + case 19296: // Ban + case 16398: // Burning Cesti + case 16929: // Burning Claymore + case 16416: // Dragon Claws + case 17485: // Dragon Claws +1 + case 17545: // Fire Staff + case 16543: // Fire Sword + case 16564: // Flame Blade + case 16804: // Flame Blade +1 + case 16588: // Flame Claymore + case 16522: // Flame Degen + case 16823: // Flame Degen +1 + case 16621: // Flame Sword + case 18625: // Gerra's Staff + case 16713: // Hellfire Axe + case 16928: // Hellfire Sword + case 16973: // Homura + case 16986: // Homura +1 + case 17665: // Ifrit's Blade + case 16709: // Inferno Axe + case 16594: // Inferno Sword + case 17828: // Koen + case 18220: // Prominence Axe + case 18381: // Prominence Sword + case 18043: // Suzaku's Scythe + case 17706: // Vulcan Blade + case 18379: // Vulcan Claymore + case 17705: // Vulcan Degen + case 17704: // Vulcan Sword + case 17546: // Vulcan's Staff + { + effect = 32; + } + break; + + // Additional Effect vs. Slimes: Light Damage + case 17981: // Ban Del Sol + if((((CMobEntity*)PDefender)->m_Family == 228) || ((CMobEntity*)PDefender)->m_Family == 229 + || ((CMobEntity*)PDefender)->m_Family == 230) + { + effect = 33; + } + break; + // Additional Effect vs. Orcs: Light Damage + case 16867: // Orc Piercer + if((((CMobEntity*)PDefender)->m_Family == 189) || ((CMobEntity*)PDefender)->m_Family == 190 + || ((CMobEntity*)PDefender)->m_Family == 248 || ((CMobEntity*)PDefender)->m_Family == 334) + { + effect = 33; + } + break; + // Additional Effect vs. Gigas: Light Damage + case 16956: // Skofnung + if(((((CMobEntity*)PDefender)->m_Family >= 126) && (((CMobEntity*)PDefender)->m_Family <= 130)) + || ((CMobEntity*)PDefender)->m_Family == 328) + { + effect = 33; + } + break; + // Additional Effect vs. Dragons: Light Damage + case 16943: // Ascalon + if(PDefender->m_EcoSystem == SYSTEM_DRAGON) + { + effect = 33; + } + break; + // Additional Effect: Light Damage (5% chance guestimate) + case 17558: // Apollo's Staff + case 18882: // Beaivi's Scepter + case 16549: // Divine Sword + case 16826: // Divine Sword +1 + case 16938: // Glorious Sword + case 16550: // Hallowed Sword + case 17738: // Hauteclaire + case 16523: // Holy Degen + case 16817: // Holy Degen +1 + case 16860: // Holy Lance + case 16880: // Holy Lance +1 + case 17041: // Holy Mace + case 17411: // Holy Mace +1 + case 17080: // Holy Maul + case 17114: // Holy Maul +1 + case 16581: // Holy Sword + case 16816: // Holy Sword +1 + case 17085: // Holy Wand + case 17434: // Holy Wand +1 + case 17557: // Light Staff + case 17414: // Pixie Mace + case 17683: // Sacred Degen + case 16858: // Sacred Lance + case 18391: // Sacred Mace + case 18392: // Sacred Maul + case 17682: // Sacred Sword + case 18393: // Sacred Wand + case 17774: // Shiranui + case 18853: // Spirit Maul + case 16613: // Spirit Sword + { + effect = 33; + } + break; + + // Additional Effect vs. Undead: Water Damage + case 16884: // Narval + if(PDefender->m_EcoSystem == SYSTEM_UNDEAD) + { + effect = 34; + } + break; + // Additional Effect: Water Damage with Pump + case 17512: // Hydro Baghnakhs + case 17513: // Hydro Baghnakhs +1 + case 18200: // Hydro Axe + case 18201: // Hydro Baghnakhs +1 + case 18204: // Hydro Chopper + case 18205: // Hydro Chopper +1 + case 17514: // Hydro Claws + case 17515: // Hydro Claws +1 + case 18202: // Hydro Cutter + case 18203: // Hydro Cutter +1 + case 17516: // Hydro Patas + case 17517: // Hydro Patas +1 + if (PAmmo->getID() == 18232 || PAmmo->getID() == 18233 || PAmmo->getID() == 18234) + { + ammoUse = 1; + effect = 36; + } + break; + + // Additional Effect: Water Damage (5% chance guestimate) + case 17750: // Anthos Xiphos + case 16945: // Arondight + case 18953: // Beluga + case 17623: // Bmt. Knife + case 16548: // Coral Sword + case 17134: // Dolphin Staff + case 18109: // Leviathan's Couse + case 17439: // Leviathan's Rod + case 16620: // Merman's Sword + case 16961: // Murasame + case 17556: // Neptune's Staff + case 17659: // Seiryu's Sword + case 17555: // Water Staff + case 17533: // Whale Staff + case 17534: // Whale Staff +1 + { + effect = 34; + } + break; + + // Additional Effect vs. Lizards: Ice Damage + case 16853: // Lizard Piercer + if(PDefender->m_EcoSystem == SYSTEM_LIZARD) + { + effect = 35; + } + break; + // Additional Effect vs. Hounds + case 18199: // Ulfhedinn Axe + if(((CMobEntity*)PDefender)->m_Family == 142 || ((CMobEntity*)PDefender)->m_Family == 143) + { + effect = 35; + } + break; + // Additional Effect: Ice Damage (5% chance guestimate) + case 17548: // Aquilo's Staff + case 16702: // Cougar Baghnakhs + case 16784: // Frostreaper + case 16937: // Ice Brand + case 16861: // Ice Lance + case 16895: // Ice Lance +1 + case 17547: // Ice Staff + case 18503: // Mammut + case 17711: // Shiva's Shotel + case 17135: // Walrus Staff + { + effect = 35; + } + break; + + // Additional Effect: Lightning Damage with Battery + case 17986: // Spark Baselard + case 17987: // Spark Baselard +1 + case 17686: // Spark Bilbo + case 17687: // Spark Bilbo +1 + case 17984: // Spark Dagger + case 17985: // Spark Dagger +1 + case 17688: // Spark Degen + case 17689: // Spark Degen +1 + case 18080: // Spark Fork + case 18081: // Spark Fork +1 + case 17988: // Spark Kris + case 17989: // Spark Kris +1 + case 18078: // Spark Lance + case 18079: // Spark Lance +1 + case 17690: // Spark Rapier + case 17691: // Spark Rapier +1 + case 18076: // Spark Spear + case 18077: // Spark Spear +1 + if (PAmmo->getID() == 18228 || PAmmo->getID() == 18229 || PAmmo->getID() == 18230) + { + ammoUse = 1; + effect = 36; + } + break; + + // Additional Effect vs. Quadav: Lightning Damage + case 17415: // Shellbuster + if((((CMobEntity*)PDefender)->m_Family == 200) || ((CMobEntity*)PDefender)->m_Family == 201 + || ((CMobEntity*)PDefender)->m_Family == 202 || ((CMobEntity*)PDefender)->m_Family == 249 + || ((CMobEntity*)PDefender)->m_Family == 337) + { + effect = 36; + } + break; + // Additional Effect: Lightning Damage (5% chance guestimate) + case 16888: // Battle Fork + case 16889: // Battle Fork +1 + case 18129: // Dabo + case 18130: // Dabo +1 + case 18104: // Fuscina + case 17071: // Heat Rod + case 17511: // Indra Katars + case 17554: // Jupiter's Staff + case 18210: // Raifu + case 18404: // Ramuh's Mace + case 17531: // Ramuh's Staff + case 17553: // Thunder Staff + case 16869: // Thundercloud + case 16837: // Trident + { + effect = 36; + } + break; + + // Additional Effect: Wind Damage with Fan + case 18366: // Gust Claymore + case 18367: // Gust Claymore +1 + case 18368: // Gust Sword + case 18369: // Gust Sword +1 + case 18370: // Gust Tongue + case 18371: // Gust Tongue +1 + case 17784: // Keppu + case 17785: // Keppu +1 + case 17780: // Kyofu + case 17781: // Kyofu +1 + case 17782: // Reppu + case 17783: // Reppu +1 + if (PAmmo->getID() == 18236 || PAmmo->getID() == 18238 || PAmmo->getID() == 18237) + { + ammoUse = 1; + effect = 37; + } + break; + // Additional Effect: Wind Damage (5% chance guestimate) + case 17550: // Auster's Staff + case 18359: // Boreas Cesti + case 18198: // Byakko's Axe + case 16726: // Forseti's Axe + case 18451: // Mokusa + case 18027: // Palladium Dagger + case 18598: // Prester + case 17965: // Sirocco Axe + case 18018: // Sirocco Kukri + case 16434: // Sonic Knuckles + case 16675: // Storm Axe + case 16857: // Wind Spear + case 17549: // Wind Staff + case 16542: // Wing Sword + case 17637: // Wing Sword +1 + { + effect = 37; + } + break; + + // Additional Effect: Flee (0-75% chance guestimate) + case 17615: // Chicken Knife + { + effect = 38; + } + break; + + //Additional Effect: Dispel Weapons (10% chance needs verifying) + case 16942: // Balmung + case 16944: // Lockheart + case 16950: // Mithril Heart + case 16951: // Mithril Heart +1 + case 18330: // Claustrum - 75 + case 18331: // Claustrum - 80 + case 18648: // Claustrum - 85 + case 18662: // Claustrum - 90 + case 18676: // Claustrum - 95 + case 19757: // Claustrum - 99 + case 19850: // Claustrum - 99 - 2 + { + effect = 39; + } + break; + + // Additional Effect Regen (7% Guestimate) + case 18887: // Dukkha + case 18525: // Himthige + { + effect = 40; + } + break; + + // Additional Effect: Ice Spikes (7% chance guestimate) + case 17564: // Cocytus Pole + { + effect = 41; + } + break; + + default: + break; + } + switch(effect) + { + case 1: // HP Drain //30 % chance to drain, will heal 30% of damage done if (rand()%100 >= 30 || PWeapon==NULL) return; @@ -1174,18 +2256,675 @@ Action->subparam = (float)(Action->param * 0.3f); PAttacker->addHP(Action->subparam); + if(PAttacker->objtype == TYPE_PC) + { + charutils::UpdateHealth(PAttacker); + } + return; + case 2: // MP Recover + //30 % chance to Recover MP, 4-16 MP + if (rand()%100 <= 30) + { + Action->submessageID = 152; + Action->flag = 3; + int mpRecover = 4; + mpRecover = dsp_cap(mpRecover,4,16); + mpRecover += rand()%13; //4~16 randomised + Action->subparam = mpRecover; + PAttacker->addMP(Action->subparam); + + if(PAttacker->objtype == TYPE_PC){ + charutils::UpdateHealth(PAttacker); + } + } + return; + case 3: // TP Drain + //10 % chance to drain, will restore TP 10% of damage done + if (rand()%100 <= 10 || PWeapon==NULL) return; + + Action->subeffect = SUBEFFECT_TP_DRAIN; + Action->submessageID = 165; + Action->flag = 3; + Action->subparam = (float)(Action->param * 0.1f); + PAttacker->addTP(Action->subparam); + if(PAttacker->objtype == TYPE_PC){ charutils::UpdateHealth(PAttacker); } return; + case 4: // MP Drain + //10 % chance to drain, will restor MP 10% of damage done + if (rand()%100 <= 10 || PWeapon==NULL) return; + Action->subeffect = SUBEFFECT_MP_DRAIN; + Action->submessageID = 162; + Action->flag = 3; + Action->subparam = (float)(Action->param * 0.1f); + PAttacker->addMP(Action->subparam); - //Additional Effect: Dispel Weapons (10% chance needs verifying) - case 16942: - case 16944: - case 16950: - case 16951: - case 18330: + if(PAttacker->objtype == TYPE_PC){ + charutils::UpdateHealth(PAttacker); + } + return; + case 5: // HP or MP Drain + //15 % chance to drain, will heal 7.5% of dmg done or restore mp 7.5% of dmg done + if (rand()%100 <= 15 || PWeapon==NULL) return; + if (rand()%2 == 1) + Action->subeffect = SUBEFFECT_HP_DRAIN; + Action->submessageID = 161; + Action->flag = 3; + Action->subparam = (float)(Action->param * 0.075f); + PAttacker->addHP(Action->subparam); + + + if(PAttacker->objtype == TYPE_PC){ + charutils::UpdateHealth(PAttacker); + } + else + Action->subeffect = SUBEFFECT_MP_DRAIN; + Action->submessageID = 162; + Action->flag = 3; + Action->subparam = (float)(Action->param * 0.075f); + PAttacker->addMP(Action->subparam); + + if(PAttacker->objtype == TYPE_PC){ + charutils::UpdateHealth(PAttacker); + } + return; + case 6: // Stun + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_STUNRES)) + { + if(PDefender->hasImmunity(8) == false) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_STUN,EFFECT_STUN,1,0,4))) + { + Action->subeffect = SUBEFFECT_STUN; + Action->subparam = EFFECT_STUN; + Action->submessageID = 160; + Action->flag = 3; + } + } + } + } + return; + case 7: // Paralyze + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_PARALYZERES)) + { + if(PDefender->hasImmunity(32) == false) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_PARALYSIS,EFFECT_PARALYSIS,20,0,10))) + { + Action->subeffect = SUBEFFECT_PARALYSIS; + Action->subparam = EFFECT_PARALYSIS; + Action->submessageID = 160; + Action->flag = 1; + } + } + } + } + return; + case 8: // Petrify + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_PETRIFYRES)) + { + // if(PDefender->hasImmunity(?) == false) // Petrify immunity unknown + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_PETRIFICATION,EFFECT_PETRIFICATION,1,0,30))) + { + Action->subeffect = SUBEFFECT_PETRIFY; + Action->subparam = EFFECT_PETRIFICATION; + Action->submessageID = 160; + Action->flag = 1; + } + } + } + return; + case 9: // Terror + if (rand()%100 <= 5) + { + // if(PDefender->hasImmunity(?) == false) // Terror immunity unknown + if(rand()%100 >= PDefender->getMod(MOD_TERRORRES)) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_TERROR,EFFECT_TERROR,1,0,10))) + { + Action->subparam = EFFECT_TERROR; + Action->submessageID = 160; + Action->flag = 3; + } + } + + } + return; + case 10: // Addle + if (rand()%100 <= 5) + { + // if(PDefender->hasImmunity(?) == false) // Addle immunity unknown + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_ADDLE,EFFECT_ADDLE,1,0,10))) + { + Action->subparam = EFFECT_ADDLE; + Action->submessageID = 160; + Action->flag = 1; + } + } + return; + case 11: // Choke + if (rand()%100 <= 5) + { + // if(PDefender->hasImmunity(?) == false) // Choke immunity unknown + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_CHOKE,EFFECT_CHOKE,5,3,10))) + { + Action->subparam = EFFECT_ADDLE; + Action->submessageID = 160; + Action->flag = 1; + } + } + return; + case 12: // Weight + if (rand()%100 <= 5) + { + if(PDefender->hasImmunity(2) == false) + { + if(rand()%100 >= PDefender->getMod(MOD_GRAVITYRES)) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_WEIGHT,EFFECT_WEIGHT,50,0,30))) + { + Action->subeffect = SUBEFFECT_WEIGHT; + Action->subparam = EFFECT_WEIGHT; + Action->submessageID = 160; + Action->flag = 1; + } + } + } + } + return; + case 13: // Amnesia + if (rand()%100 <= 5) + { + // if(PDefender->hasImmunity(?) == false) // Amnesia immunity unknown + if(rand()%100 >= PDefender->getMod(MOD_AMNESIARES)) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_AMNESIA,EFFECT_AMNESIA,1,0,10))) + { + Action->subparam = EFFECT_AMNESIA; + Action->submessageID = 160; + Action->flag = 1; + } + } + + } + return; + case 14: // Bind + if (rand()%100 <= 5) + { + if(PDefender->hasImmunity(4) == false) + { + if(rand()%100 >= PDefender->getMod(MOD_BINDRES)) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_BIND,EFFECT_BIND,1,0,10))) + { + Action->subeffect = SUBEFFECT_BIND; + Action->subparam = EFFECT_BIND; + Action->submessageID = 160; + Action->flag = 1; + } + } + } + } + return; + case 15: // Slow + if (rand()%100 <= 5) + { + if(PDefender->hasImmunity(128) == false) + { + if(rand()%100 >= PDefender->getMod(MOD_SLOWRES)) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_HASTE,EFFECT_HASTE,-51,0,30))) + { + Action->subparam = EFFECT_HASTE; + Action->submessageID = 160; + Action->flag = 1; + } + } + } + } + return; + case 16: // Flash + if (rand()%100 <= 5) + { + if(PDefender->hasImmunity(64) == false) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_FLASH,EFFECT_FLASH,100,0,30))) + { + Action->subeffect = SUBEFFECT_BLIND; + Action->subparam = EFFECT_FLASH; + Action->submessageID = 160; + Action->flag = 1; + } + } + } + return; + case 17: // TP Removal + if (rand()%100 <= 2) + { + Action->submessageID = 363; + Action->flag = 3; + int tpRemove = 5; + tpRemove = dsp_cap(tpRemove,5,50); + tpRemove += rand()%46; //Random 5-50 + PDefender->addTP(-tpRemove); + + } + return; + case 18: // STR Boost + if (rand()%100 <= 10) + { + int strBoost = 5; + strBoost = dsp_cap(strBoost,5,7); + strBoost += rand()%3; //5~7 randomised + if(PAttacker->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_STR_BOOST,EFFECT_STR_BOOST,strBoost,0,30))) + { + Action->subparam = EFFECT_STR_BOOST; + Action->submessageID = 166; + Action->flag = 1; + } + } + return; + case 19: // Haste + if (rand()%100 <= 7) + { + if(PAttacker->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_HASTE,EFFECT_HASTE,307,0,30))) + { + Action->subparam = EFFECT_HASTE; + Action->submessageID = 166; + Action->flag = 1; + } + } + return; + case 20: // Blink + if (rand()%100 <= 15) + { + if(PAttacker->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_BLINK,EFFECT_BLINK,1,0,5))) + { + Action->subparam = EFFECT_BLINK; + Action->submessageID = 166; + Action->flag = 1; + } + } + return; + case 21: // Poison + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_POISONRES)) + { + if(PDefender->hasImmunity(256) == false) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_POISON,EFFECT_POISON,1,3,30))) + { + Action->subeffect = SUBEFFECT_POISON; + Action->subparam = EFFECT_POISON; + Action->submessageID = 160; + Action->flag = 1; + } + } + } + } + return; + case 22: // Blind + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_BLINDRES)) + { + if(PDefender->hasImmunity(64) == false) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_BLINDNESS,EFFECT_BLINDNESS,10,0,10))) + { + Action->subeffect = SUBEFFECT_BLIND; + Action->subparam = EFFECT_BLINDNESS; + Action->submessageID = 160; + Action->flag = 1; + } + } + } + } + return; + case 23: // Silence + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_SILENCERES)) + { + if(PDefender->hasImmunity(16) == false) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_SILENCE,EFFECT_SILENCE,1,0,10))) + { + Action->subeffect = SUBEFFECT_SILENCE; + Action->subparam = EFFECT_SILENCE; + Action->submessageID = 160; + Action->flag = 1; + } + } + } + } + return; + case 24: // Curse + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_CURSERES)) + { + // if(PDefender->hasImmunity(?) == false) // Curse immunity unknown + + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_CURSE,EFFECT_CURSE,1,0,10))) + { + Action->subeffect = SUBEFFECT_CURSE; + Action->subparam = EFFECT_CURSE; + Action->submessageID = 160; + Action->flag = 3; + } + + } + } + return; + case 25: // Death + if (rand()%100 <= 2) + { + if(rand()%100 >= PDefender->getMod(MOD_DEATHRES)) + { + // if(PDefender->hasImmunity(?) == false) // Death immunity unknown + + Action->subparam = SUBEFFECT_NONE; + Action->submessageID = 160; + Action->flag = 3; + PDefender->addHP(-999999); + } + } + return; + case 26: // Sleep + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_SLEEPRES)) + { + if(!PDefender->isDead() && PDefender->hasImmunity(1) == false) + { + int duration = 25 - (PDefender->GetMLevel() - PAttacker->GetMLevel())*5 - ((float)PDefender->getMod(MOD_SLEEPRES)/5); + + if(duration <= 1) + { + duration = 1; + } + else + { + //randomize sleep duration + duration -= rand()%(duration/2); + } + + duration = dsp_cap(duration,1,25); + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_SLEEP,EFFECT_SLEEP,1,0,duration))) + { + Action->subeffect = SUBEFFECT_SLEEP; + Action->subparam = EFFECT_SLEEP; + Action->submessageID = 160; + Action->flag = 3; + } + } + } + } + return; + case 27: // Evasion Down + if (rand()%100 <= 5) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_EVASION_DOWN,EFFECT_EVASION_DOWN,10,0,10))) + { + Action->subeffect = SUBEFFECT_IMPAIRS_EVASION; + Action->subparam = EFFECT_EVASION_DOWN; + Action->submessageID = 160; + Action->flag = 3; + } + } + return; + case 28: // Defense Down + if (rand()%100 <= 5) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_DEFENSE_DOWN,EFFECT_DEFENSE_DOWN,50,0,10))) + { + Action->subeffect = SUBEFFECT_DEFENSE_DOWN; + Action->subparam = EFFECT_DEFENSE_DOWN; + Action->submessageID = 160; + Action->flag = 1; + } + } + return; + case 29: // Weaken Attack + if (rand()%100 <= 5) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_ATTACK_DOWN,EFFECT_ATTACK_DOWN,50,0,10))) + { + Action->subeffect = SUBEFFECT_WEAKENS_ATTACKS; + Action->subparam = EFFECT_ATTACK_DOWN; + Action->submessageID = 160; + Action->flag = 1; + } + } + return; + case 30: // Darkness Dmg + if(rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_DARKRES)) + { + Action->subeffect = SUBEFFECT_DARKNESS_DAMAGE; + Action->submessageID = 163; + Action->flag = 3; + int damage = (PAttacker->INT() - PDefender->INT())/2; + damage += (PAttacker->GetMLevel() - PDefender->GetMLevel()); + damage = dsp_cap(damage,0,50); + damage += PAttacker->GetMLevel()/2; + damage += rand()%20; //At 75 -> 37~56 low or 87~106 high + + damage += (float)damage * ((float)PDefender->getMod(MOD_DARKRES)/-100); + + Action->subparam = damage; + PDefender->addHP(-damage); + } + } + return; + case 31: // Earth Dmg + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_EARTHRES)) + { + Action->subeffect = SUBEFFECT_EARTH_DAMAGE; + Action->submessageID = 163; + Action->flag = 1; + //calculate damage + uint8 damage = (PAttacker->VIT() - PDefender->VIT())/2; + damage = dsp_cap(damage,0,50); + damage += 10; //10~60 + damage += rand()%8; //10~67 randomised + //set damage TODO: handle resist/staff/day + + damage += (float)damage * ((float)PDefender->getMod(MOD_EARTHRES)/-100); + Action->subparam = damage; + PDefender->addHP(-damage); + } + } + return; + case 32: // Fire Dmg + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_FIRERES)) + { + Action->subeffect = SUBEFFECT_FIRE_DAMAGE; + Action->submessageID = 163; + Action->flag = 3; + //calculate damage + uint8 damage = (PAttacker->INT() - PDefender->INT())/2; + damage = dsp_cap(damage,0,50); + + damage += 10; //10~60 + damage += rand()%8; //10~67 randomised + //set damage TODO: handle resist/staff/day + damage += (float)damage * ((float)PDefender->getMod(MOD_FIRERES)/-100); + + Action->subparam = damage; + PDefender->addHP(-damage); + } + } + return; + case 33: // Light Dmg + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_LIGHTRES)) + { + Action->subeffect = SUBEFFECT_LIGHT_DAMAGE; + Action->submessageID = 163; + Action->flag = 3; + //calculate damage + uint8 damage = (PAttacker->MND() - PDefender->MND())/2; + damage = dsp_cap(damage,0,50); + damage += 10; //10~60 + damage += rand()%8; //10~67 randomised + //set damage TODO: handle resist/staff/day + damage += (float)damage * ((float)PDefender->getMod(MOD_LIGHTRES)/-100); + Action->subparam = damage; + PDefender->addHP(-damage); + } + } + return; + case 34: // Water Dmg + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_WATERRES)) + { + Action->subeffect = SUBEFFECT_WATER_DAMAGE; + Action->submessageID = 163; + Action->flag = 1; + //calculate damage + uint8 damage = (PAttacker->MND() - PDefender->MND())/2; + damage = dsp_cap(damage,0,50); + damage += 10; //10~60 + damage += rand()%8; //10~67 randomised + //set damage TODO: handle resist/staff/day + damage += (float)damage * ((float)PDefender->getMod(MOD_WATERRES)/-100); + Action->subparam = damage; + PDefender->addHP(-damage); + if(ammoUse == 1) + { + // TODO - remove ammo + } + } + } + return; + case 35: // Ice Dmg + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_ICERES)) + { + Action->subeffect = SUBEFFECT_ICE_DAMAGE; + Action->submessageID = 163; + Action->flag = 1; + //calculate damage + uint8 damage = (PAttacker->INT() - PDefender->INT())/2; + damage = dsp_cap(damage,0,50); + damage += 10; //10~60 + damage += rand()%8; //10~67 randomised + //set damage TODO: handle resist/staff/day + damage += (float)damage * ((float)PDefender->getMod(MOD_ICERES)/-100); + Action->subparam = damage; + PDefender->addHP(-damage); + } + } + return; + case 36: // Lightning Dmg + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_THUNDERRES)) + { + Action->subeffect = SUBEFFECT_LIGHTNING_DAMAGE; + Action->submessageID = 163; + Action->flag = 3; + //calculate damage + uint8 damage = (PAttacker->DEX() - PDefender->DEX())/2; + damage = dsp_cap(damage,0,50); + damage += 10; //10~60 + damage += rand()%8; //10~67 randomised + //set damage TODO: handle resist/staff/day + damage += (float)damage * ((float)PDefender->getMod(MOD_THUNDERRES)/-100); + Action->subparam = damage; + PDefender->addHP(-damage); + if(ammoUse == 1) + { + // TODO - remove ammo + } + } + } + return; + case 37: // Wind Dmg + if (rand()%100 <= 5) + { + if(rand()%100 >= PDefender->getMod(MOD_WINDRES)) + { + Action->subeffect = SUBEFFECT_WIND_DAMAGE; + Action->submessageID = 163; + Action->flag = 3; + //calculate damage + uint8 damage = (PAttacker->AGI() - PDefender->AGI())/2; + damage = dsp_cap(damage,0,50); + damage += 10; //10~60 + damage += rand()%8; //10~67 randomised + damage += (float)damage * ((float)PDefender->getMod(MOD_WINDRES)/-100); + //set damage TODO: handle resi st/staff/day + Action->subparam = damage; + PDefender->addHP(-damage); + if(ammoUse == 1) + { + // TODO - remove ammo + } + } + } + return; + case 38: // Flee + chance = 0; + if(PDefender->GetMLevel() > PAttacker->GetMLevel()) + { + chance += 5*(PDefender->GetMLevel() - PAttacker->GetMLevel()); + chance = dsp_cap(chance,0,75); + } + if(rand()%100 <= chance) + { + if(PAttacker->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_FLEE,EFFECT_FLEE,100,0,30))) + { + Action->subparam = EFFECT_FLEE; + Action->submessageID = 160; + Action->flag = 3; + } + } + return; + case 39: // Dispel if (rand()%100 > 10) return; dispelled = PDefender->StatusEffectContainer->DispelStatusEffect(); // if(dispelled > 0){ @@ -1195,6 +2934,30 @@ // Action->subparam = dispelled; // } return; + case 40: // Regen + if (rand()%100 <= 7) + { + if(PAttacker->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_REGEN,EFFECT_REGEN,30,3,180))) + { + Action->subparam = EFFECT_REGEN; + Action->submessageID = 166; + Action->flag = 1; + } + } + return; + case 41: // Ice Spikes + if (rand()%100 <= 7) + { + if(PAttacker->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_ICE_SPIKES,EFFECT_ICE_SPIKES,20,0,90))) + { + Action->subparam = EFFECT_ICE_SPIKES; + Action->submessageID = 166; + Action->flag = 1; + } + } + return; default: return; } @@ -1210,6 +2973,7 @@ void HandleRangedAdditionalEffect(CCharEntity* PAttacker, CBattleEntity* PDefender,apAction_t* Action){ CItemWeapon* PAmmo = (CItemWeapon*)PAttacker->getStorage(LOC_INVENTORY)->GetItem(PAttacker->equip[SLOT_AMMO]); + CItemWeapon* PRanged = (CItemWeapon*)PAttacker->getStorage(LOC_INVENTORY)->GetItem(PAttacker->equip[SLOT_RANGED]); //add effects dont have 100% proc, presume level dependant. 95% chance but -5% for each level diff. //capped at 5% proc when mob is 18 (!!!) levels higher than you. uint8 chance = 95; @@ -1217,9 +2981,113 @@ chance -= 5*(PDefender->GetMLevel() - PAttacker->GetMLevel()); chance = dsp_cap(chance,5,95); } - if(rand()%100 >= chance || PAmmo==NULL){return;} + + if(rand()%100 >= chance) + { + if(PAmmo->getID() == 18168 || PAmmo->getID() == 18168) + { + } + else + { + return; + } + } + if(PRanged==NULL && PAmmo==NULL){return;} + + switch(PRanged->getID()){ + case 19261:{ // Jinx Discus + + //check curse resistance + if(rand()%100 >= PDefender->getMod(MOD_CURSERES)){return;} + { + // if(PDefender->hasImmunity(?) == false) // Curse immunity unknown + + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_CURSE,EFFECT_CURSE,1,0,20))) + { + Action->subeffect = SUBEFFECT_CURSE; + Action->subparam = EFFECT_CURSE; + Action->submessageID = 160; + Action->flag = 3; + } + + } + } + break; + case 18708: // Snakeeye + case 18709: // Snakeeye +1 + { + if(PAttacker->StatusEffectContainer->HasStatusEffect(EFFECT_POISON)) + { + if(rand()%100 >= PDefender->getMod(MOD_POISONRES)) + { + if(PDefender->hasImmunity(256) == false) + { + if(PDefender->StatusEffectContainer->AddStatusEffect( + new CStatusEffect(EFFECT_POISON,EFFECT_POISON,1,3,30))) + { + Action->subeffect = SUBEFFECT_POISON; + Action->subparam = EFFECT_POISON; + Action->submessageID = 160; + Action->flag = 1; + } + } + } + } + } + break; + case 17293:{ // Yagudo Freezer + + if((((CMobEntity*)PDefender)->m_Family == 250) || ((CMobEntity*)PDefender)->m_Family == 270) + { + //check ice resistance + Action->subeffect = SUBEFFECT_ICE_DAMAGE; + Action->submessageID = 163; + Action->flag = 1; + //calculate damage + uint8 damage = (PAttacker->INT() - PDefender->INT())/2; + damage = dsp_cap(damage,0,50); + damage += 10; //10~60 + damage += rand()%8; //10~67 randomised + //set damage TODO: handle resist/staff/day + damage += (float)damage * ((float)PDefender->getMod(MOD_ICERES)/-100); + Action->subparam = damage; + PDefender->addHP(-damage); + } + } + break; + case 17291:{ // Flame Boomberang + + //check Fire resistance + Action->subeffect = SUBEFFECT_FIRE_DAMAGE; + Action->submessageID = 163; + Action->flag = 3; + //calculate damage + uint8 damage = (PAttacker->INT() - PDefender->INT())/2; + damage = dsp_cap(damage,0,50); + damage += 10; //10~60 + damage += rand()%8; //10~67 randomised + //set damage TODO: handle resist/staff/day + damage += (float)damage * ((float)PDefender->getMod(MOD_FIRERES)/-100); + Action->subparam = damage; + PDefender->addHP(-damage); + } + break; + } + + if(PAmmo==NULL){return;} + switch(PAmmo->getID()){ + case 18168: // Imperial Egg + case 18169:{ // Tzar's Egg + ((CMobEntity*)PDefender)->PEnmityContainer->UpdateEnmity(PAttacker, 1800, 1); + Action->subeffect = SUBEFFECT_NONE; + Action->subparam = EFFECT_PROVOKE; + Action->submessageID = 164; + Action->flag = 3; + } + break; case 17325:{ // kabura_arrow //check wind resistance @@ -1262,7 +3130,8 @@ } } break; - case 17329: // patriarch_protectors_arrow + case 18740: // Combat Caster Arrow + case 17329: // Patriarch Protectors Arrow case 18696:{ // Paralysis Arrow //check ice resistance if(rand()%100 <= PDefender->getMod(MOD_ICERES)){return;} @@ -1321,6 +3190,26 @@ PDefender->addHP(-damage); } break; + case 18729: // Djinn Arm + case 19196:{ //Darkling Bolt + //damage doesn't exceed ~67 unless wearing light staff/iceday/weather + //there isn't a formula, but INT affects damage, so this is guesstimated. It seems to be level + //invarient since its used on harder monsters for damage occasionally. Assuming the modifier + //is simply INT with a degree of randomisation + Action->subeffect = SUBEFFECT_DARKNESS_DAMAGE; + Action->submessageID = 163; + Action->flag = 1; + //calculate damage + uint8 damage = (PAttacker->INT() - PDefender->INT())/2; + damage = dsp_cap(damage,0,50); + damage += 10; //10~60 + damage += rand()%8; //10~67 randomised + //set damage TODO: handle resist/staff/day + damage += (float)damage * ((float)PDefender->getMod(MOD_DARKRES)/-100); + Action->subparam = damage; + PDefender->addHP(-damage); + } + break; case 18698:{ //Water Arrow //damage doesn't exceed ~67 unless wearing light staff/iceday/weather //there isn't a formula, but INT affects damage, so this is guesstimated. It seems to be level @@ -1423,6 +3312,27 @@ charutils::UpdateHealth(PAttacker); } break; + case 18140:{ // Phantom Tathlum + //10 % chance to drain, will restore MP 10% of damage done + if (rand()%100 <= PDefender->getMod(MOD_DARKRES)){return;} + + Action->subeffect = SUBEFFECT_MP_DRAIN; + Action->submessageID = 162; + Action->flag = 3; + int damage = (PAttacker->INT() - PDefender->INT())/2; + damage += (PAttacker->GetMLevel() - PDefender->GetMLevel()); + damage = dsp_cap(damage,0,50); + damage += PAttacker->GetMLevel()/2; + damage += rand()%20; //At 75 -> 37~56 low or 87~106 high + + damage += (float)damage * ((float)PDefender->getMod(MOD_DARKRES)/-100); + + Action->subparam = damage; + PDefender->addMP(-damage); + PAttacker->addMP(damage); + charutils::UpdateHealth(PAttacker); + } + break; case 18152:{ //Venom Bolt if(PDefender->hasImmunity(256) == false){ //check water resistance @@ -1479,6 +3389,7 @@ } } break; + case 21323: // Oxidant Bolt case 18148:{ //Acid Bolt //check wind resistance @@ -1494,6 +3405,7 @@ } break; + case 17315: // Riot Grenade case 17324:{ //Lightning Arrow //damage doesn't exceed ~67 //there isn't a formula. It seems to be level @@ -1513,6 +3425,7 @@ PDefender->addHP(-damage); } break; + case 17306: // Snoll Arm case 17323:{ //Ice Arrow //damage doesn't exceed ~67 unless wearing ice staff/iceday/weather //there isn't a formula, but INT affects damage, so this is guesstimated. It seems to be level @@ -1532,6 +3445,11 @@ PDefender->addHP(-damage); } break; + case 19202: // Smart Grenade + case 17314: // Quake Grenade + case 17313: // Grenade + case 17305: // Cluster Arm + case 17316: // Bomb Arm case 17327: // Grand knights Arrow case 17322:{ //Fire Arrow //damage doesn't exceed ~67 unless wearing ice staff/iceday/weather @@ -1561,6 +3479,36 @@ } } +void HandleRetaliation(CBattleEntity* PAttacker, CBattleEntity* PDefender,apAction_t* Action, uint16 damage) +{ + //retaliation check (rate AND your hit rate makes it land, else its just a regular hit) + if (rand()%100 < battleutils::GetRetaliationRate(PAttacker, PDefender) && + rand()%100 < battleutils::GetHitRate(PDefender,PAttacker) && + PDefender->StatusEffectContainer->HasStatusEffect(EFFECT_RETALIATION)) + { + Action->subeffect = SUBEFFECT_NONE; + Action->submessageID = 536; + Action->flag = 3; + bool isCritical = ( rand()%100 < battleutils::GetCritHitRate(PDefender, PAttacker,false) ); + float DamageRatio = battleutils::GetDamageRatio(PDefender, PAttacker,isCritical, 0); + damage = (uint16)((PDefender->GetMainWeaponDmg() + battleutils::GetFSTR(PDefender, PAttacker,SLOT_MAIN)) * DamageRatio); + + damage = damage + (damage * (PDefender->getMod(MOD_RETALIATION_DMG)/100)); + Action->subparam = damage; + if (battleutils::IsAbsorbByShadow(PAttacker)) + { + Action->submessageID = 535; + Action->subparam = 1; + } + else + { + Action->reaction = REACTION_HIT; + // ShowDebug(CL_CYAN"Retaliation Damage %d", damage); + PAttacker->addHP(-damage); + } + } +} + uint8 GetRangedHitRate(CBattleEntity* PAttacker, CBattleEntity* PDefender){ int acc = 0; int hitrate = 75; @@ -1708,6 +3656,16 @@ return false; } +bool IsRetaliated(CBattleEntity* PAttacker, CBattleEntity* PDefender) +{ + if(isFaceing(PDefender->loc.p, PAttacker->loc.p, 40) && !PDefender->isAsleep()) + { + return(rand() % 100 < battleutils::GetRetaliationRate(PAttacker, PDefender)); + } + + return false; +} + bool TryInterruptSpell(CBattleEntity* PAttacker, CBattleEntity* PDefender){ //Reasonable assumption for the time being. @@ -1814,7 +3772,9 @@ if( PDefender->GetMJob() == JOB_NIN || PDefender->GetMJob() == JOB_SAM || PDefender->GetMJob() == JOB_THF || PDefender->GetMJob() == JOB_BST || PDefender->GetMJob() == JOB_DRG || PDefender->GetMJob() == JOB_PLD || PDefender->GetMJob() == JOB_WAR || PDefender->GetMJob() == JOB_BRD || - PDefender->GetMJob() == JOB_DRK || PDefender->GetMJob() == JOB_RDM || PDefender->GetMJob() == JOB_COR) + PDefender->GetMJob() == JOB_DRK || PDefender->GetMJob() == JOB_RDM || PDefender->GetMJob() == JOB_COR || + PDefender->GetMJob() == JOB_GEO || PDefender->GetMJob() == JOB_RUN || PDefender->GetMJob() == JOB_DNC || + PDefender->GetMJob() == JOB_BLU || PDefender->GetMJob() == JOB_SCH || PDefender->GetMJob() == JOB_PUP) { int skill = PDefender->GetSkill(SKILL_PAR) + PDefender->getMod(MOD_PARRY); //max A-, so need gear+ for 20% parry int max = GetMaxSkill(SKILL_SHL, JOB_PLD, PDefender->GetMLevel()); //A+ skill @@ -1843,6 +3803,22 @@ return 0; } +uint8 GetRetaliationRate(CBattleEntity* PAttacker, CBattleEntity* PDefender) +{ + CItemWeapon* PWeapon = GetEntityWeapon(PDefender, SLOT_MAIN); + + if(PWeapon != NULL && battleutils::IsEngauged(PDefender)) + { + if( PDefender->GetMJob() == JOB_WAR || PDefender->GetSJob() == JOB_WAR) + { + int chance = 20 + rand()%31; + return dsp_cap(chance, 20, 50);//50% max retaliation rate + } + } + + return 0; +} + /************************************************************************ * * * Calculates damage based on damage and resistance to damage type * @@ -1887,6 +3863,7 @@ if (isBlocked && PDefender->m_Weapons[SLOT_SUB]->IsShield()) { damage = (damage * PDefender->m_Weapons[SLOT_SUB]->getShieldAbsorption()) / 100; + damage = damage - (damage * (PDefender->getMod(MOD_SHIELD_DEF)/100)); } } damage = dsp_max(damage - PDefender->getMod(MOD_PHALANX),0); @@ -1905,7 +3882,7 @@ } PDefender->addHP(-damage); - + if (PAttacker->PMaster != NULL) { PDefender->m_OwnerID.id = PAttacker->PMaster->id; @@ -1942,7 +3919,7 @@ PDefender->addTP(TP); } if(taChar == NULL){ - ((CMobEntity*)PDefender)->PEnmityContainer->UpdateEnmityFromDamage(PAttacker, damage); + ((CMobEntity*)PDefender)->PEnmityContainer->UpdateEnmityFromDamage(PAttacker, damage); }else{ ((CMobEntity*)PDefender)->PEnmityContainer->UpdateEnmityFromDamage(taChar, damage); } @@ -2215,8 +4192,8 @@ cRatioMin = (cRatioMin < 0 ? 0 : cRatioMin); if(isCritical){ - cRatioMin += 1; - cRatioMax += 1; + cRatioMin += 1 + (PAttacker->getMod(MOD_CRIT_DMG)/100); + cRatioMax += 1 + (PAttacker->getMod(MOD_CRIT_DMG)/100); } cRatioMax = (cRatioMax > 3 ? 3 : cRatioMax); @@ -2299,6 +4276,7 @@ uint8 tripleAttack = PEntity->getMod(MOD_TRIPLE_ATTACK); uint8 doubleAttack = PEntity->getMod(MOD_DOUBLE_ATTACK); + uint8 quadrupleAttack = PEntity->getMod(MOD_QUADRUPLE_ATTACK); //check for merit upgrades if (PEntity->objtype == TYPE_PC) @@ -2334,8 +4312,12 @@ } - if (rand()%100 < tripleAttack) + if (rand()%100 < quadrupleAttack) { + num +=3; + } + else if (rand()%100 < tripleAttack) + { num +=2; } else if (rand()%100 < doubleAttack) @@ -2373,47 +4355,64 @@ EFFECT effect = EFFECT_NONE; uint8 tick = 0; + uint16 songDuration = 120; + songDuration = songDuration * (PCaster->getMod(MOD_SONG_DURATION) / 100); + //calculate strengths. Need to know TIER and EFFECTTYPE (Minuet, Paeon, etc) for icon if(PSpell->getID() >= 394 && PSpell->getID() <= 398){ effect = EFFECT_MINUET; tier = PSpell->getID()-393; + songDuration = songDuration + (songDuration * ((PCaster->getMod(MOD_MINUET) * 10) / 100)); } else if(PSpell->getID() >= 389 && PSpell->getID() <= 393){ effect = EFFECT_MINNE; tier = PSpell->getID()-388; + songDuration = songDuration + (songDuration * ((PCaster->getMod(MOD_MINNE) * 10) / 100)); } else if(PSpell->getID() >= 399 && PSpell->getID() <= 400){ effect = EFFECT_MADRIGAL; tier = PSpell->getID()-398; + songDuration = songDuration + (songDuration * ((PCaster->getMod(MOD_MADRIGAL) * 10) / 100)); } else if(PSpell->getID() >= 403 && PSpell->getID() <= 404){ effect = EFFECT_MAMBO; tier = PSpell->getID()-382; + songDuration = songDuration + (songDuration * ((PCaster->getMod(MOD_MAMBO) * 10) / 100)); } else if(PSpell->getID() >= 386 && PSpell->getID() <= 388){ effect = EFFECT_BALLAD; tier = PSpell->getID()-385; tick = 3; + songDuration = songDuration + (songDuration * ((PCaster->getMod(MOD_BALLAD) * 10) / 100)); } else if(PSpell->getID() >= 419 && PSpell->getID() <= 420){ effect = EFFECT_MARCH; tier = PSpell->getID()-418; + songDuration = songDuration + (songDuration * ((PCaster->getMod(MOD_MARCH) * 10) / 100)); } else if(PSpell->getID() >= 378 && PSpell->getID() <= 385){ effect = EFFECT_PAEON; tier = PSpell->getID()-377; tick = 3; } + else if(PSpell->getID() >= 409 && PSpell->getID() <= 411){ + effect = EFFECT_OPERETTA; + tier = PSpell->getID()-408; + songDuration = songDuration + (songDuration * ((PCaster->getMod(MOD_ALL_SONGS) * 10) / 100)); + } if(effect==EFFECT_NONE){ return effect; } - //TODO: Handle instruments! - - CStatusEffect* PStatus = new CStatusEffect(effect,effect,tier,tick,120,PCaster->targid); + + + + + CStatusEffect* PStatus = new CStatusEffect(effect,effect,tier,tick,songDuration,PCaster->targid); PStatus->SetFlag(EFFECTFLAG_ON_ZONE);//wears on zone uint8 maxSongs = 2; + maxSongs = maxSongs + PCaster->getMod(MOD_SONG_EFFECTS); if(PCaster->objtype==TYPE_PC){ CCharEntity* PChar = (CCharEntity*)PCaster; CItemWeapon* PItem = (CItemWeapon*)PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_RANGED]); @@ -2446,7 +4445,7 @@ * * ************************************************************************/ -bool IsParalised(CBattleEntity* PAttacker) +bool IsParalyzed(CBattleEntity* PAttacker) { return (rand()%100 < dsp_cap(PAttacker->getMod(MOD_PARALYZE) - PAttacker->getMod(MOD_PARALYZERES), 0, 100)); } @@ -3060,7 +5059,7 @@ /************************************************************************ * * -* Для всех сущностей, за исключением персонажей, по умолчанию true * +* For all entities, except the characters, the default is true * * * ************************************************************************/ @@ -3352,16 +5351,27 @@ CItem* PItemHead = ((CCharEntity*)m_PChar)->getStorage(LOC_INVENTORY)->GetItem(((CCharEntity*)m_PChar)->equip[SLOT_HEAD]); CItem* PItemBody = ((CCharEntity*)m_PChar)->getStorage(LOC_INVENTORY)->GetItem(((CCharEntity*)m_PChar)->equip[SLOT_BODY]); CItem* PItemLegs = ((CCharEntity*)m_PChar)->getStorage(LOC_INVENTORY)->GetItem(((CCharEntity*)m_PChar)->equip[SLOT_LEGS]); - if(PItemHead->getID() == 12516 || PItemHead->getID() == 15232 || PItemBody->getID() == 14409 || PItemLegs->getID() == 15370){ - drainPercent = 0.12; - } + CItem* PItemRing1 = ((CCharEntity*)m_PChar)->getStorage(LOC_INVENTORY)->GetItem(((CCharEntity*)m_PChar)->equip[SLOT_RING1]); + CItem* PItemRing2 = ((CCharEntity*)m_PChar)->getStorage(LOC_INVENTORY)->GetItem(((CCharEntity*)m_PChar)->equip[SLOT_RING2]); + CItem* PItemMain = ((CCharEntity*)m_PChar)->getStorage(LOC_INVENTORY)->GetItem(((CCharEntity*)m_PChar)->equip[SLOT_MAIN]); + if(PItemHead->getID() == 12516 || PItemHead->getID() == 15232 || PItemBody->getID() == 14409 || PItemLegs->getID() == 15370) + { + drainPercent = 0.12; + } + if((PItemRing1->getID() == 15818 && PItemMain->getID() == 18947) || (PItemRing2->getID() == 15818 && PItemMain->getID() == 18947)) + { + drainPercent = 0.12; + } damage = damage + m_PChar->health.hp*drainPercent; m_PChar->addHP(-drainPercent*m_PChar->health.hp); } - else if(m_PChar->GetSJob()==JOB_DRK &&m_PChar->health.hp>=10 && m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_SOULEATER)){ + else if(m_PChar->GetSJob()==JOB_DRK &&m_PChar->health.hp>=10 && m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_SOULEATER)) + { //lose 10% Current HP, only HALF (5%) converted to damage damage = damage + m_PChar->health.hp*0.05; - m_PChar->addHP(-0.1*m_PChar->health.hp); + float stalwartSoulHP = 0.1; + stalwartSoulHP = stalwartSoulHP - (m_PChar->getMod(MOD_STALWART_SOUL)/1000); + m_PChar->addHP((-1 * stalwartSoulHP) * m_PChar->health.hp); } return damage; } @@ -3460,9 +5470,9 @@ if (lvl < 30) return 0; else if (lvl < 50) shotCount += 3; else if (lvl < 75) shotCount += 4; - else if (lvl < 90) shotCount += 5; - else if (lvl < 99) shotCount += 6; - else if (lvl >= 99) shotCount += 7; + else if (lvl < 90) shotCount += (5 + PChar->getMod(MOD_BARRAGE)); + else if (lvl < 99) shotCount += (6 + PChar->getMod(MOD_BARRAGE)); + else if (lvl >= 99) shotCount += (7 + PChar->getMod(MOD_BARRAGE)); // make sure we have enough ammo for all these shots @@ -3604,6 +5614,9 @@ ((CMobEntity*)PVictim)->PEnmityContainer->LowerEnmityByPercent(PAttacker , enmityReduction, NULL); } + // Under Spirit Surge, High Jump lowers the target's TP proportionately to the amount of damage dealt (TP is reduced by damage * 2) + if (tier == 2 && PAttacker->StatusEffectContainer->HasStatusEffect(EFFECT_SPIRIT_SURGE)) + PVictim->addTP(-(totalDamage * 2)); // try skill up (CharEntity only) if (PAttacker->objtype == TYPE_PC) @@ -3656,11 +5669,11 @@ return; } - // cannot charm NM - if (((CMobEntity*)PVictim)->m_Type & MOBTYPE_NOTORIOUS){ - ((CMobEntity*)PVictim)->PEnmityContainer->UpdateEnmity(PCharmer, 0, 0); - return; - } + // cannot charm NM unless they are Taifun or Trombe + if (((CMobEntity*)PVictim)->m_Type & MOBTYPE_NOTORIOUS & PVictim->m_OwnerID.id != 17576269 & PVictim->m_OwnerID.id != 17576270){ + ((CMobEntity*)PVictim)->PEnmityContainer->UpdateEnmity(PCharmer, 0, 0); + return; + } else { // mob is charmable @@ -3808,7 +5821,7 @@ } if(check < rand()%100) { return true; - } + } return false; } @@ -4000,5 +6013,4 @@ } - }; Index: src/map/battleutils.h =================================================================== --- src/map/battleutils.h (revision 3304) +++ src/map/battleutils.h (working copy) @@ -102,10 +102,10 @@ uint8 GetSkillchainSubeffect(SKILLCHAIN_ELEMENT skillchain); uint16 GetSkillchainMinimumResistance(SKILLCHAIN_ELEMENT element, CBattleEntity* PDefender); - bool IsParalised(CBattleEntity* PAttacker); - bool IsAbsorbByShadow(CBattleEntity* PDefender); - bool IsIntimidated(CBattleEntity* PAttacker, CBattleEntity* PDefender); - bool IsAnticipated(CBattleEntity* PDefender, bool forceRemove, bool ignore); + bool IsParalyzed(CBattleEntity* PAttacker); + bool IsAbsorbByShadow(CBattleEntity* PDefender); + bool IsIntimidated(CBattleEntity* PAttacker, CBattleEntity* PDefender); + bool IsAnticipated(CBattleEntity* PDefender, bool forceRemove, bool ignore); int32 GetFSTR(CBattleEntity* PAttacker, CBattleEntity* PDefender, uint8 SlotID); uint8 GetHitRateEx(CBattleEntity* PAttacker, CBattleEntity* PDefender, uint8 attackNumber, uint8 offsetAccuracy); @@ -117,6 +117,7 @@ uint8 GetBlockRate(CBattleEntity* PAttacker, CBattleEntity* PDefender); uint8 GetParryRate(CBattleEntity* PAttacker, CBattleEntity* PDefender); uint8 GetGuardRate(CBattleEntity* PAttacker, CBattleEntity* PDefender); + uint8 GetRetaliationRate(CBattleEntity* PAttacker, CBattleEntity* PDefender); float GetDamageRatio(CBattleEntity* PAttacker, CBattleEntity* PDefender, bool isCritical, uint16 bonusAttPercent); uint16 TakePhysicalDamage(CBattleEntity* PAttacker, CBattleEntity* PDefender, int16 damage, bool isBlocked, uint8 slot, uint16 tpMultiplier, CBattleEntity* taChar, bool giveTPtoVictim); @@ -127,9 +128,11 @@ bool IsParried(CBattleEntity* PAttacker, CBattleEntity* PDefender); bool IsGuarded(CBattleEntity* PAttacker, CBattleEntity* PDefender); bool IsBlocked(CBattleEntity* PAttacker, CBattleEntity* PDefender); + bool IsRetaliated(CBattleEntity* PAttacker, CBattleEntity* PDefender); float GetRangedPDIF(CBattleEntity* PAttacker, CBattleEntity* PDefender); void HandleRangedAdditionalEffect(CCharEntity* PAttacker, CBattleEntity* PDefender,apAction_t* Action); + void HandleRetaliation(CBattleEntity* PAttacker, CBattleEntity* PDefender,apAction_t* Action, uint16 damage); uint16 CalculateSpikeDamage(CBattleEntity* PAttacker, CBattleEntity* PDefender, uint8 spikesType); bool HandleSpikesDamage(CBattleEntity* PAttacker, CBattleEntity* PDefender,apAction_t* Action, uint16 damage); bool HandleSpikesEquip(CBattleEntity* PAttacker, CBattleEntity* PDefender, apAction_t* Action, uint8 damage, SUBEFFECT spikesType, uint8 chance); @@ -151,6 +154,9 @@ CItemArmor* GetEntityArmor(CBattleEntity* PEntity, SLOTTYPE Slot); uint32 HandleSpecialPhysicalDamageReduction(CCharEntity* PAttacker, uint32 damage, apAction_t* Action); + uint32 HandleDamageToMP(CCharEntity* PAttacker, uint32 damage, apAction_t* Action); + uint32 HandleDamageToTP(CCharEntity* PAttacker, uint32 damage, apAction_t* Action); + uint32 HandleBlockToMP(CCharEntity* PAttacker, uint32 damage, apAction_t* Action); void MakeEntityStandUp(CBattleEntity* PEntity); bool IsEngauged(CBattleEntity* PEntity); CBattleEntity* getAvailableTrickAttackChar(CBattleEntity* taUser, CBattleEntity* PMob); Index: src/map/charentity.cpp =================================================================== --- src/map/charentity.cpp (revision 3304) +++ src/map/charentity.cpp (working copy) @@ -101,6 +101,8 @@ m_lastBcnmTimePrompt = 0; m_AHHistoryTimestamp = 0; m_DeathTimestamp = 0; + m_PlayTime = 0; + m_ZoneTimer = 0; m_EquipFlag = 0; m_EquipBlock = 0; @@ -235,11 +237,10 @@ /************************************************************************ * * -* Возвращаем контейнер с указанным ID. Если ID выходит за рамки, то * -* защищаем сервер от падения использованием контейнера временных * -* предметов в качестве заглушки (из этого контейнера предметы нельзя * -* перемещать, надевать, передавать, продавать и т.д.). Отображаем * -* сообщение о фатальной ошибке. * +* Return the container with the specified ID. If the ID is out of * +* range, then Protects the server from falling container using the * +* time- Items as caps (of the container objects can not Move, put, * +* transfer, sell, etc.). Display a fatal error. * * * ************************************************************************/ @@ -256,7 +257,7 @@ case LOC_MOGSACK: return m_Mogsack; } - DSP_DEBUG_BREAK_IF(LocationID >= MAX_CONTAINER_ID); // неразрешенный ID хранилища + DSP_DEBUG_BREAK_IF(LocationID >= MAX_CONTAINER_ID); // unresolved ID vault return 0; } @@ -305,4 +306,17 @@ //PLatentEffectContainer->CheckLatentsHP(health.mp); return abs(mp); -} \ No newline at end of file +} + + +void CCharEntity::SetPlayTime(uint32 setTime) +{ + m_PlayTime = setTime; +} + +void CCharEntity::AddPlayTime() +{ + m_ZoneTimer++; + if((m_ZoneTimer % 2) == 0) + m_PlayTime++; +} Index: src/map/charentity.h =================================================================== --- src/map/charentity.h (revision 3304) +++ src/map/charentity.h (working copy) @@ -68,22 +68,22 @@ struct jobs_t { - uint32 unlocked; // битовая маска профессий, доступных персонажу (первый бит - дополнительная профессия) - uint8 job[MAX_JOBTYPE]; // текущий уровень для каждой из профессий - uint16 exp[MAX_JOBTYPE]; // текущее количество опыта для каждой из профессий - uint8 genkai; // максимальный уровень профессий персонажа + uint32 unlocked; // bitmask of professions available characters (the first bit - additional job) + uint8 job[MAX_JOBTYPE]; // current level for each of the professions + uint16 exp[MAX_JOBTYPE]; // current amount of experience for each profession + uint8 genkai; // maximum character professions }; struct event_t { - int32 EventID; // номер события - int32 Option; // фиктивный возвращаемый результат + int32 EventID; // number of event + int32 Option; // dummy return value - CBaseEntity* Target; // инициатор события + CBaseEntity* Target; // initiator of the event - string_t Script; // путь к файлу, отвечающему за обработку события - string_t Function; // не используется + string_t Script; // path to the file is responsible for handling events + string_t Function; // not used void reset() { @@ -97,13 +97,13 @@ struct profile_t { - uint8 nation; // принадлежность к государству - uint8 mhflag; // флаг выхода из MogHouse - uint16 title; // звание - uint16 fame[4]; // известность - uint8 rank[3]; // рагн в трех государствах - uint32 rankpoints; // очки ранга в трех государствах - location_t home_point; // точка возрождения персонажа + uint8 nation; // belongs to the state + uint8 mhflag; // flag out of MogHouse + uint16 title; // title + uint16 fame[4]; // fame + uint8 rank[3]; // Rank in three states + uint32 rankpoints; // rank points in three states + location_t home_point; // dot character revival }; @@ -159,32 +159,32 @@ { public: - jobs_t jobs; // доступрые профессии персонажа - keyitems_t keys; // таблица ключевых предметов - event_t m_event; // структура для запуска событый - skills_t RealSkills; // структура всех реальных умений персонажа, с точностью до 0.1 и не ограниченных уровнем - nameflags_t nameflags; // флаги перед именем персонажа - profile_t profile; // профиль персонажа (все, что связывает города и персонажа) + jobs_t jobs; // occupation character + keyitems_t keys; // table of key items + event_t m_event; // structure to trigger events + skills_t RealSkills; // structure of the real skills of the character, up to 0.1, and not limited to the level of + nameflags_t nameflags; // flags in front of the name of the character + profile_t profile; // character profile (everything that connects the city and the character) expChain_t expChain; // Exp Chains - search_t search; // данные и комментарий, отображаемые в окне поиска - bazaar_t bazaar; // все данные, необходимые для таботы bazaar - uint16 m_EquipFlag; // текущие события, обрабатываемые экипировкой (потом упакую в структуру, вместе с equip[]) - uint16 m_EquipBlock; // заблокированные ячейки экипировки + search_t search; // data and comments are displayed in the search box + bazaar_t bazaar; // all the data necessary for bazaar + uint16 m_EquipFlag; // current events that are handled gear (then pack them in a structure with equip []) + uint16 m_EquipBlock; // locked cells outfit bool m_EquipSwap; // true if equipment was recently changed - uint8 equip[17]; // экипировка персонажа + uint8 equip[17]; // character equipment - uint8 m_ZonesList[36]; // список посещенных персонажем зон - uint8 m_SpellList[128]; // список изученных заклинаний - uint8 m_TitleList[94]; // список заслуженных завний - uint8 m_Abilities[46]; // список текущих способностей + uint8 m_ZonesList[36]; // list of visited character zones + uint8 m_SpellList[128]; // list studied spells + uint8 m_TitleList[94]; // list of honored titles + uint8 m_Abilities[46]; // list of current abilities uint8 m_LearnedAbilities[46]; // learnable abilities (corsair rolls) - uint8 m_TraitList[16]; // список постянно активных способностей в виде битовой маски - uint8 m_PetCommands[32]; // список доступных команд питомцу + uint8 m_TraitList[16]; // list Fasting active abilities in the form of a bit mask + uint8 m_PetCommands[32]; // list of available commands pet uint8 m_WeaponSkills[32]; - questlog_t m_questLog[MAX_QUESTAREA]; // список всех квестов - missionlog_t m_missionLog[MAX_MISSIONAREA];// список миссий - assaultlog_t m_assaultLog; // список assault миссий - campaignlog_t m_campaignLog; // список campaing миссий + questlog_t m_questLog[MAX_QUESTAREA]; // list of all quests + missionlog_t m_missionLog[MAX_MISSIONAREA];// mission list + assaultlog_t m_assaultLog; // list of assault missions + campaignlog_t m_campaignLog; // list of campaign missions uint32 m_rangedDelay; // ranged attack delay (with timestamp for repeat attacks, hence 32bit)for items, abilities and magic bool m_insideBCNM; // true if user is inside a bcnm uint32 m_lastBcnmTimePrompt; // the last message prompt in seconds @@ -192,67 +192,68 @@ void resetPetZoningInfo(); // reset pet zoning info (when changing job ect) uint8 m_SetBlueSpells[20]; // The 0x200 offsetted blue magic spell IDs which the user has set. (1 byte per spell) - // Эти миссии не нуждаются в списке пройденных, т.к. клиент автоматически - // отображает более ранние миссии выплненными + // These missions do not need a list passed as client automatically + // Displays the earlier mission - uint16 m_copCurrent; // текущая миссия Chains of Promathia - uint16 m_acpCurrent; // текущая миссия A Crystalline Prophecy - uint16 m_mkeCurrent; // текущая миссия A Moogle Kupo d'Etat - uint16 m_asaCurrent; // текущая миссия A Shantotto Ascension + uint16 m_copCurrent; // current mission Chains of Promathia + uint16 m_acpCurrent; // current mission A Crystalline Prophecy + uint16 m_mkeCurrent; // current mission A Moogle Kupo d'Etat + uint16 m_asaCurrent; // current mission A Shantotto Ascension - // TODO: половина этого массива должна храниться в char_vars, а не здесь, т.к. эта информация не отображается в интерфейсе клиента и сервер не проводит с ними никаких операций + // TODO: half of the array should be stored in char_vars, and not here, because This information is not displayed in the interface of the client and the server does not perform any operations with them uint32 RegionPoints[15]; // conquest points, imperial standing points etc NationTP_t nationtp; // supply tp, runic portal, campaign tp,... - uint8 GetGender(); // узнаем пол персонажа + uint8 GetGender(); // find out the sex of the character - int32 firstPacketSize(); // размер первого пакета в PacketList - void clearPacketList(); // отчистка PacketList - void pushPacket(CBasicPacket*); // добавление копии пакета в PacketList - bool isPacketListEmpty(); // проверка размера PacketList - CBasicPacket* popPacket(); // получение первого пакета из PacketList + int32 firstPacketSize(); // size of the first packet in PacketList + void clearPacketList(); // cleanup PacketList + void pushPacket(CBasicPacket*); // add up package PacketList + bool isPacketListEmpty(); // size check PacketList + CBasicPacket* popPacket(); // get the first package of PacketList - CLinkshell* PLinkshell; // linkshell, в которой общается персонаж - CTreasurePool* PTreasurePool; // сокровища, добытые с монстров + + CLinkshell* PLinkshell; // linkshell, in which a character talks + CTreasurePool* PTreasurePool; // treasure, obtained from monsters CMeritPoints* PMeritPoints; // - bool MeritMode; //If true then player is meriting + bool MeritMode; // If true then player is meriting CRecastContainer* PRecastContainer; // CLatentEffectContainer* PLatentEffectContainer; - CItemContainer* PGuildShop; // текущий магазин гильдии, в котором персонаж производит закупки - CItemContainer* getStorage(uint8 LocationID); // получение указателя на соответствующее хранилище + CItemContainer* PGuildShop; // Store the current guilds, in which the characters make purchases + CItemContainer* getStorage(uint8 LocationID); // Get a pointer to the appropriate storage - CTradeContainer* Container; // универсальный контейнер для обмена, синтеза, магазина и т.д. - CUContainer* UContainer; // новый универсальный контейнер для обмена, синтеза, магазина и т.д. + CTradeContainer* Container; // universal container for the exchange, synthesis, shop etc. + CUContainer* UContainer; // new universal container for the exchange, synthesis, shop etc. - CBaseEntity* PWideScanTarget; // wide scane цель + CBaseEntity* PWideScanTarget; // wide scane goal - SpawnIDList_t SpawnPCList; // список видимых персонажей - SpawnIDList_t SpawnMOBList; // список видимых монстров - SpawnIDList_t SpawnPETList; // список видимых питомцев - SpawnIDList_t SpawnNPCList; // список видимых npc + SpawnIDList_t SpawnPCList; // list of visible characters + SpawnIDList_t SpawnMOBList; // list of visible MOBs + SpawnIDList_t SpawnPETList; // list of visible PETs + SpawnIDList_t SpawnNPCList; // list of visible NPCs - void SetName(int8* name); // устанавливаем имя персонажа (имя ограничивается 15-ю символами) + void SetName(int8* name); // set the character's name (the name is limited to 15-th character) - EntityID_t TradePending; // ID персонажа, предлагающего обмен - EntityID_t InvitePending; // ID персонажа, отправившего приглашение в группу + EntityID_t TradePending; // ID character's Swap + EntityID_t InvitePending; // ID of the character who sent the invitation to the group EntityID_t BazaarID; // Pointer to the bazaar we are browsing. BazaarList_t BazaarCustomers; // Array holding the IDs of the current customers - uint32 m_InsideRegionID; // номер региона, в котором сейчас находится персонаж (??? может засунуть в m_event ???) - uint8 m_LevelRestriction; // ограничение уровня персонажа - uint16 m_Costum; // карнавальный костюм персонажа (модель) + uint32 m_InsideRegionID; // number of the region, which now houses the character (? can shove m_event???) + uint8 m_LevelRestriction; // limit the level of character + uint16 m_Costum; // carnival costume character (model) uint32 m_AHHistoryTimestamp; // Timestamp when last asked to view history uint32 m_DeathTimestamp; // Timestamp when you last died. This is set when you first login. uint8 m_PVPFlag; // pvp uint8 m_hasTractor; // checks if player has tractor already uint8 m_hasRaise; // checks if player has raise already - uint8 m_hasAutoTarget; // возможность использования AutoTarget функции - position_t m_StartActionPos; // позиция начала действия (использование предмета, начало стрельбы, позиция tractor) + uint8 m_hasAutoTarget; // the use of the function AutoTarget + position_t m_StartActionPos; // start position of the (use of the subject, the shooting started, the position of tractor) int8 getShieldSize(); @@ -264,11 +265,15 @@ int32 addHP(int32 hp); int32 addMP(int32 mp); - std::vector m_ah_history; // AH history list (в будущем нужно использовать UContainer) + std::vector m_ah_history; // AH history list (in the future to use UContainer) - CCharEntity(); // конструктор - ~CCharEntity(); // деструктор + void SetPlayTime(uint32); // Set playtime from database + void AddPlayTime(); // Add playtime every second + uint32 __inline const& GetPlayTime() { return m_PlayTime; }; + CCharEntity(); // Designer + ~CCharEntity(); // Destructor + private: CItemContainer* m_Inventory; @@ -279,7 +284,10 @@ CItemContainer* m_Mogsatchel; CItemContainer* m_Mogsack; - PacketList_t PacketList; // в этом списке хранятся все пакеты, предназначенные для отправки персонажу + PacketList_t PacketList; // This list contains all of the packages to be sent character + + uint32 m_ZoneTimer; + uint32 m_PlayTime; }; #endif Index: src/map/charutils.cpp =================================================================== --- src/map/charutils.cpp (revision 3304) +++ src/map/charutils.cpp (working copy) @@ -78,7 +78,7 @@ /************************************************************************ * * -* Таблицы получаемого опыта * +* Experience Gain Table * * * ************************************************************************/ @@ -96,26 +96,26 @@ /************************************************************************ * * -* Расчет характеристик персонажей * +* Calculation of characters * * * ************************************************************************/ void CalculateStats(CCharEntity* PChar) { - // Объявление переменных, нужных для рассчета. + // Declare variables needed for the calculation. - float raceStat = 0; // конечное число HP для уровня на основе расы. - float jobStat = 0; // конечное число HP для уровня на основе первичной профессии. - float sJobStat = 0; // коенчное число HP для уровня на основе вторичной профессии. - int32 bonusStat = 0; // бонусное число HP которое добавляется при соблюдении некоторых условий. + float raceStat = 0; // Finite number of HP for the level on the basis of race. + float jobStat = 0; // Finite number of HP for a level based on primary occupation. + float sJobStat = 0; // Number of HP for a level based on secondary profession. + int32 bonusStat = 0; // HP bonus number is added under certain conditions. - int32 baseValueColumn = 0; // номер колонки с базовым количеством HP - int32 scaleTo60Column = 1; // номер колонки с модификатором до 60 уровня - int32 scaleOver30Column = 2; // номер колонки с модификатором после 30 уровня - int32 scaleOver60Column = 3; // номер колонки с модификатором после 60 уровня - int32 scaleOver75Column = 4; // номер колонки с модификатором после 75 уровня - int32 scaleOver60 = 2; // номер колонки с модификатором для расчета MP после 60 уровня - int32 scaleOver75 = 3; // номер колонки с модификатором для расчета Статов после 75-го уровня + int32 baseValueColumn = 0; // Column number to the base of HP + int32 scaleTo60Column = 1; // Column number with the modifier level 60 + int32 scaleOver30Column = 2; // Column number modifier after level 30 + int32 scaleOver60Column = 3; // Column number modifier after level 60 + int32 scaleOver75Column = 4; // Column number modifier after level 75 + int32 scaleOver60 = 2; // Column number modifier to calculate the MP after level 60 + int32 scaleOver75 = 3; // Column number modifier to calculate the article after level 75 uint8 grade; @@ -136,23 +136,23 @@ case 8: race = 4; break; //Galka } - // Расчет прироста HP от main job + // The calculation of the gain HP main job - int32 mainLevelOver30 = dsp_cap(mlvl - 30, 0, 30); // Расчет условия +1HP каждый лвл после 30 уровня - int32 mainLevelUpTo60 = (mlvl < 60 ? mlvl - 1 : 59 ); // Первый режим рассчета до 60 уровня (Используется так же и для MP) - int32 mainLevelOver60To75 = dsp_cap(mlvl - 60, 0, 15); // Второй режим расчета после 60 уровня - int32 mainLevelOver75 = (mlvl < 75 ? 0 : mlvl - 75); // Третий режим расчета после 75 уровня + int32 mainLevelOver30 = dsp_cap(mlvl - 30, 0, 30); // Calculation conditions +1 HP each lvl after level 30 + int32 mainLevelUpTo60 = (mlvl < 60 ? mlvl - 1 : 59 ); // The first mode calculation level 60 (used also for MP) + int32 mainLevelOver60To75 = dsp_cap(mlvl - 60, 0, 15); // The second mode of calculation after level 60 + int32 mainLevelOver75 = (mlvl < 75 ? 0 : mlvl - 75); // The third mode of calculation after level 75 - //Расчет бонусного количества HP + //Calculation of bonus HP - int32 mainLevelOver10 = (mlvl < 10 ? 0 : mlvl - 10); // +2HP на каждом уровне после 10 - int32 mainLevelOver50andUnder60 = dsp_cap(mlvl - 50, 0, 10); // +2HP на каждом уровне в промежутке от 50 до 60 уровня + int32 mainLevelOver10 = (mlvl < 10 ? 0 : mlvl - 10); // +2HP at every level after 10 + int32 mainLevelOver50andUnder60 = dsp_cap(mlvl - 50, 0, 10); // +2HP at every level in the range from 50 to 60 levels int32 mainLevelOver60 = (mlvl < 60 ? 0 : mlvl - 60); - // Расчет прироста HP от дополнительной профессии + // The calculation of the additional HP gain profession - int32 subLevelOver10 = dsp_cap(slvl - 10, 0, 20); // +1HP на каждый уровень после 10 (/2) - int32 subLevelOver30 = (slvl < 30 ? 0 : slvl - 30); // +1HP на каждый уровень после 30 + int32 subLevelOver10 = dsp_cap(slvl - 10, 0, 20); // +1HP for each level after 10 (/2) + int32 subLevelOver30 = (slvl < 30 ? 0 : slvl - 30); // +1HP for each level after 30 // Расчет raceStat jobStat bonusStat sJobStat // Расчет по расе @@ -167,7 +167,7 @@ // raceStat = (int32)(statScale[grade][baseValueColumn] + statScale[grade][scaleTo60Column] * (mlvl - 1)); - // Расчет по main job + // Раcket main job grade = grade::GetJobGrade(mjob,0); jobStat = grade::GetHPScale(grade,baseValueColumn) + @@ -176,10 +176,10 @@ (grade::GetHPScale(grade,scaleOver60Column) * mainLevelOver60To75) + (grade::GetHPScale(grade,scaleOver75Column) * mainLevelOver75); - // Расчет бонусных HP + // Расket bonus HP bonusStat = (mainLevelOver10 + mainLevelOver50andUnder60) * 2; - // Расчет по support job + // Раcket support job if (slvl > 0) { grade = grade::GetJobGrade(sjob,0); @@ -195,30 +195,30 @@ uint16 MeritBonus = PChar->PMeritPoints->GetMeritValue(MERIT_MAX_HP, PChar->GetMLevel()); PChar->health.maxhp = (int16)(raceStat + jobStat + bonusStat + sJobStat + MeritBonus); - //Начало расчера MP + //Home raschera MP raceStat = 0; jobStat = 0; sJobStat = 0; - // Расчет MP расе. + // Раcket MP расе. grade = grade::GetRaceGrades(race,1); - //Если у main job нет МП рейтинга, расчитиваем расовый бонус на основе уровня subjob уровня(при условии, что у него есть МП рейтинг) + // If there is no main job megapixel rating raschitivaem racial bonus based on the level subjob level (provided that it has a megapixel rating) if (grade::GetJobGrade(mjob,1) == 0) { - if (grade::GetJobGrade(sjob,1) != 0 && slvl > 0) // В этом выражении ошибка + if (grade::GetJobGrade(sjob,1) != 0 && slvl > 0) // In this expression, the error { raceStat = (grade::GetMPScale(grade,0) + grade::GetMPScale(grade,scaleTo60Column) * (slvl - 1)) / 2; // Вот здесь ошибка } }else{ - //Расчет нормального расового бонуса + //Calculation of normal racial bonus raceStat = grade::GetMPScale(grade,0) + grade::GetMPScale(grade,scaleTo60Column) * mainLevelUpTo60 + grade::GetMPScale(grade,scaleOver60) * mainLevelOver60; } - //Для главной профессии + //For the main occupation grade = grade::GetJobGrade(mjob,1); if (grade > 0) { @@ -227,7 +227,7 @@ grade::GetMPScale(grade,scaleOver60) * mainLevelOver60; } - //Для дополнительной профессии + //For more professions if (slvl > 0) { grade = grade::GetJobGrade(sjob,1); @@ -248,13 +248,13 @@ PChar->setModifier(MOD_EVA,eva); - //Начало расчета характеристик + //Start calculating the characteristics uint8 counter = 0; for (uint8 StatIndex = 2; StatIndex <=8; ++StatIndex) { - // расчет по расе + // Calculated by reference to race grade = grade::GetRaceGrades(race,StatIndex); raceStat = grade::GetStatScale(grade,0) + grade::GetStatScale(grade,scaleTo60Column) * mainLevelUpTo60; @@ -268,7 +268,7 @@ } } - // расчет по профессии + // Calculation of the profession grade = grade::GetJobGrade(mjob,StatIndex); jobStat = grade::GetStatScale(grade,0) + grade::GetStatScale(grade,scaleTo60Column) * mainLevelUpTo60; @@ -282,7 +282,7 @@ } } - // расчет по дополнительной профессии + // Payment on the additional trade if (slvl > 0) { grade = grade::GetJobGrade(sjob,StatIndex); @@ -294,7 +294,7 @@ // get each merit bonus stat, str,dex,vit and so on... MeritBonus = PChar->PMeritPoints->GetMeritValue((Merit_t*)PChar->PMeritPoints->GetMeritByIndex(StatIndex), PChar->GetMLevel()); - // Вывод значения + // Printing a WBUFW(&PChar->stats,counter) = (uint16)(raceStat + jobStat + sJobStat + MeritBonus); counter += 2; } @@ -302,8 +302,8 @@ /************************************************************************ * * -* Предварительная версия загрузки персонажа. Функция будет * -* оптимизирована после определения всех необходимых данных и таблиц * +* Pre-download version of the character. The function will be * +* optimized after determining all the necessary data and tables * * * ************************************************************************/ @@ -366,6 +366,8 @@ PChar->profile.nation = (uint8)Sql_GetIntData(SqlHandle,13); + PChar->SetPlayTime(Sql_GetUIntData(SqlHandle, 21)); + size_t length = 0; int8* quests = NULL; Sql_GetData(SqlHandle,14,&quests,&length); @@ -678,7 +680,7 @@ /************************************************************************ * * -* Загружаем инвентарь персонажа * +* Load the character's inventory * * * ************************************************************************/ @@ -743,7 +745,7 @@ } if (PItem->getType() & ITEM_FURNISHING && PItem->getLocationID() == LOC_MOGSAFE) { - if (Sql_GetIntData(SqlHandle,10) != 0) // способ узнать, что предмет действительно установлен + if (Sql_GetIntData(SqlHandle,10) != 0) // Way to know that the object is indeed installed { ((CItemFurnishing*)PItem)->setSubType(ITEM_LOCKED); @@ -812,21 +814,21 @@ /************************************************************************ * * -* Отправляем список текущих/завершенных квестов и миссий * +* Send the list of current / completed quests and mission * * * ************************************************************************/ void SendQuestMissionLog(CCharEntity* PChar) { - // в нижележащем цикле загружаются все квесты, текущие и выполненные - // в одном пакете с текущими квестами Aht Urhgan отправляется информация о текущих миссиях + // In the underlying cycle is loaded all the quests, current and completed + // In the same package with the current quest Aht Urhgan will receive information about the current missions // Treasures of Aht Urhgan // Wings of the Goddess Missions // Assault Missions // Campaign Operations - // пакет с завершенными квестами Aht Urhgan содержит завершенные миссии Assault Missions + // Package to complete the quest has completed Aht Urhgan Mission Assault Missions - for (uint8 status = 0x01; status <= 0x02; ++status) + for (uint8 status = 0x01; status <= 0x02; ++status) { for (uint8 areaID = 0; areaID <= QUESTS_CRYSTALWAR ; ++areaID) { @@ -851,12 +853,12 @@ } } - // обновляем статус миссий + // Update the status of the mission // National Missions // Rise of the Zilart and Chains of Promathia Missions // Add-on Scenarios - // так как все эти миссии обновляются вместе, - // то достаточно выполнить обновление для MISSION_ZILART + // For all these missions are updated together + // It is sufficient to perform the updates MISSION_ZILART PChar->pushPacket(new CQuestMissionLogPacket(PChar, MISSION_ZILART, 0x01)); @@ -865,7 +867,7 @@ /************************************************************************ * * -* Отправляем списки ключевых предметов персонажа * +* Send the list of key items of the character * * * ************************************************************************/ @@ -879,7 +881,7 @@ /************************************************************************ * * -* Отправляем персонажу весь его инвентарь * +* Send a character all its inventory * * * ************************************************************************/ @@ -928,11 +930,11 @@ /************************************************************************ * * -* Добавляем новый предмет персонажу в выбранный контейнер * +* Add a new item to the character selected container * * * ************************************************************************/ -// TODO: мне не нравится параметр silens, нужно придумать что-нибудь более элегантное +// TODO: I do not like setting silens, to come up with something more elegant uint8 AddItem(CCharEntity* PChar, uint8 LocationID, uint16 ItemID, uint32 quantity, bool silence) { @@ -954,7 +956,7 @@ /************************************************************************ * * -* Добавляем новый предмет персонажу в выбранный контейнер * +* Add a new item to the character selected container * * * ************************************************************************/ @@ -1005,7 +1007,7 @@ /************************************************************************ * * -* Проверяем наличие предмета у персонажа * +* Check the presence of the subject of the character * * * ************************************************************************/ @@ -1051,7 +1053,7 @@ /************************************************************************ * * -* Перемещаем предмет в указанную ячейки или первую пустую * +* Move the objects in the specified cell or the first empty * * * ************************************************************************/ @@ -1085,7 +1087,7 @@ PChar->pushPacket(new CInventoryItemPacket(PItemContainer->GetItem(NewSlotID), LocationID, NewSlotID)); return NewSlotID; } - PItemContainer->InsertItem(NULL, NewSlotID); // отменяем все изменения контейнера + PItemContainer->InsertItem(NULL, NewSlotID); // container, the changes } } ShowError(CL_RED"charutils::MoveItem: item can't be moved\n" CL_RESET); @@ -1094,7 +1096,7 @@ /************************************************************************ * * -* Обновляем количество предметов в указанных контейнере и ячейке * +* Update the number of items in the specified container and cell * * * ************************************************************************/ @@ -1148,7 +1150,7 @@ /************************************************************************ * * -* Проверяем возможность обмена между персонажами * +* Check the possibility of exchange between the characters * * * ************************************************************************/ @@ -1175,7 +1177,7 @@ /************************************************************************ * * -* Совершаем обмен между персонажами * +* Make an exchange between characters * * * ************************************************************************/ @@ -1200,8 +1202,8 @@ /************************************************************************ * * -* Снимаем с персонажа экипированный предмет без обновления внешного * -* вида. Используется как вспомогательная функция в связке с другими * +* Removes Equipped object without updating the External * +* species. Used as an auxiliary function in conjunction with other * * * ************************************************************************/ @@ -1343,7 +1345,7 @@ /************************************************************************ * * -* Пытаемся экипировать предмет с соблюдением всех условий * +* We are trying to equip the item in compliance with all conditions * * * ************************************************************************/ @@ -1392,13 +1394,13 @@ CItemArmor* armor = (CItemArmor*)PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_SUB]); if ((armor != NULL) && (armor->getType() & ITEM_ARMOR)) { - UnequipItem(PChar,SLOT_SUB); - } + UnequipItem(PChar,SLOT_SUB); + } if (((CItemWeapon*)PItem)->getSkillType() == SKILL_H2H) - { + { PChar->look.sub = PItem->getModelId() + 0x1000; + } } - } break; } if (PChar->PBattleAI->GetCurrentAction() == ACTION_ATTACK) @@ -1608,7 +1610,7 @@ PItem->setAssignTime(CVanaTime::getInstance()->getVanaTime()); PChar->PRecastContainer->Add(RECAST_ITEM, slotID, PItem->getReuseTime()); - // не забываем обновить таймер при экипировке предмета + // Do not forget to update the timer object when equipped PChar->pushPacket(new CInventoryItemPacket(PItem, LOC_INVENTORY, slotID)); PChar->pushPacket(new CInventoryFinishPacket()); @@ -1657,7 +1659,7 @@ if (!(PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_MAIN])->getType() & ITEM_ARMOR) || PChar->m_Weapons[SLOT_MAIN] == itemutils::GetUnarmedH2HItem()) { CheckUnarmedWeapon(PChar); - } + } BuildingCharWeaponSkills(PChar); } @@ -1667,7 +1669,7 @@ /************************************************************************ * * -* Проверяем возможность персонажа носить экипированные на нем предметы * +* Check the possibility of the character wearing equipped gear * * * ************************************************************************/ @@ -1726,13 +1728,13 @@ /************************************************************************ * * -* Проверяем логику всей экипировки персонажа * +* Check the logic of the entire equipment of the character * * * ************************************************************************/ -// позднее нужно будет сделать экипировку в структуре, -// куда добавить битовое поле, указывающее, в какой ячейке находится экипировка с условием -// для начала это поле избавит нас от проверки ячеек у персонажей без экипировки с условием +// Later need to make equipment in the structure, +// To add a bit field indicating which cell is equipment with a condition +// To the beginning of this field will save us from checking the cells in the characters without equipment with the condition void CheckEquipLogic(CCharEntity* PChar, SCRIPTTYPE ScriptType, uint32 param) { @@ -1805,9 +1807,9 @@ || PSkill->getID() == wsIDs[SLOT_MAIN] || PSkill->getID() == wsIDs[SLOT_SUB] || isInDynamis && (PSkill->getID() == wsDynIDs[SLOT_MAIN] || PSkill->getID() == wsDynIDs[SLOT_SUB])) { - addWeaponSkill(PChar, PSkill->getID()); - } - } + addWeaponSkill(PChar, PSkill->getID()); + } + } //add in ranged ws PItem = (CItemWeapon*)PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_RANGED]); @@ -1822,10 +1824,10 @@ || PSkill->getID() == wsIDs[SLOT_RANGED] || isInDynamis && (PSkill->getID() == wsDynIDs[SLOT_RANGED])) { - addWeaponSkill(PChar, PSkill->getID()); - } - } - } + addWeaponSkill(PChar, PSkill->getID()); + } + } + } PChar->pushPacket(new CCharAbilitiesPacket(PChar)); } @@ -1861,8 +1863,8 @@ /************************************************************************ * * -* Собираем рабочую таблицу способностей персонажа. С нулевым уровнем * -* должны быть 2h способности. По этому условию отсеиваем их для sjob * +* Collect worksheet Abilities. With zero- * +* should be 2h abilities. Under this condition sift them for sjob * * * ************************************************************************/ @@ -1918,8 +1920,8 @@ /************************************************************************ * * -* Собираем рабочую таблицу умений персонажа на основе реальной. * -* Добавляем ограничения, отмечаем умения основной профессии (rank != 0)* +* Collect worksheet skills of the character based on the real. * +* Add restrictions to note basic trade skills (rank != 0) * * * ************************************************************************/ @@ -2024,13 +2026,13 @@ /************************************************************************ * * -* Пытаемся увеличить значение умения * +* We are trying to increase the skills * * * ************************************************************************/ void TrySkillUP(CCharEntity* PChar, SKILLTYPE SkillID, uint8 lvl) { - DSP_DEBUG_BREAK_IF(SkillID >= MAX_SKILLTYPE); // выход за пределы допустимых умений + DSP_DEBUG_BREAK_IF(SkillID >= MAX_SKILLTYPE); // out of range of skills if ((PChar->WorkingSkills.rank[SkillID] != 0) && !(PChar->WorkingSkills.skill[SkillID] & 0x8000)) { @@ -2048,7 +2050,7 @@ uint8 SkillAmount = 1; uint8 tier = dsp_min(1 + (Diff/5), 5); - for(uint8 i = 0; i < 4; ++i) // 1 + 4 возможных дополнительных (максимум 5) + for(uint8 i = 0; i < 4; ++i) // 1 + 4 possible additional (maximum of 5) { random = rand() / ((double)RAND_MAX); @@ -2131,7 +2133,7 @@ /************************************************************************ * * -* Методы для работы с ключевыми предметами * +* Methods for working with key items * * * ************************************************************************/ @@ -2162,7 +2164,7 @@ /************************************************************************ * * -* Методы для работы с заклинаниями * +* Methods for working with spells * * * ************************************************************************/ @@ -2204,7 +2206,7 @@ /************************************************************************ * * -* Методы для работы со званиями * +* Methods for working with ranks * * * ************************************************************************/ @@ -2225,7 +2227,7 @@ /************************************************************************ * * -* Методы для работы с основными способностями * +* Methods for basic skills * * * ************************************************************************/ @@ -2308,7 +2310,7 @@ /************************************************************************ * * -* Обновляем MP, HP и TP персонажа * +* Update the MP, HP and TP character * * * ************************************************************************/ @@ -2338,7 +2340,7 @@ /************************************************************************ * * -* Инициализируем таблицу опыта * +* Initialize the table experience * * * ************************************************************************/ @@ -2381,15 +2383,15 @@ } } -/************************************************************************ -* * -* Узнаем реальное количество опыта, который персонаж получит с цели * -* * -************************************************************************/ +/******************************************************************************************** +* * +* Find out the real number of experiences that the character will receive from the target * +* * +********************************************************************************************/ uint32 GetRealExp(uint8 charlvl, uint8 moblvl) { - int32 levelDif = moblvl - charlvl + 34; + int32 levelDif = moblvl - charlvl + 34; if ((charlvl > 0) && (charlvl < 100)) { @@ -2400,7 +2402,7 @@ /************************************************************************ * * -* Узнаем количество опыта, необходимое для получения следующего уровня * +* Know the amount of experience needed to get the next level * * * ************************************************************************/ @@ -2425,12 +2427,14 @@ { //work out the amount of gil to give (guessed; replace with testing) uint32 gil = PMob->GetRandomGil(); + + gil = gil + (gil * (.5 * PChar->getMod(MOD_GILFINDER))); //distribute to said members (perhaps store pointers to each member in first loop?) if (PChar->PParty != NULL) { - // TODO: плохая реализация - два раза проверяем дистанцию, два раза проверяем один и тот же массив + // TODO: poor implementation - double check the distance, double check the same array uint8 count = 0; //work out how many pt members should get the gil @@ -2545,6 +2549,7 @@ else if (PMob->m_Family == 266 && PMob->getZone() == 174) monsterbonus = 1.23f; else if (PMob->m_Family == 206 && PMob->getZone() == 5) monsterbonus = 1.10f; else if (PMob->m_Family == 208 && PMob->getZone() == 24) monsterbonus = 1.23f; + else if (PMob->m_Type & MOBTYPE_NOTORIOUS && PMob->GetMLevel() > 75) monsterbonus = 5.00f; if (monsterbonus > 1.00f) exp *= monsterbonus; permonstercap = ((PMember->PParty != NULL && pcinzone > 1) ? 1.35f : 1.15f); if (PMember->GetMLevel() <= 50) @@ -2554,8 +2559,8 @@ else if (PMember->GetMLevel() <= 60) { if (exp > (250*permonstercap)) exp = 250*permonstercap; - } - else if (exp > (300*permonstercap)) + } + else if (exp > (300*permonstercap) && PMob->m_Type != MOBTYPE_NOTORIOUS && PMob->GetMLevel() <= 75) { exp = 300*permonstercap; } @@ -2575,13 +2580,13 @@ } else { - if (PMember->GetMLevel() <=10) PMember->expChain.chainTime = gettick()+50000; - else if (PMember->GetMLevel() <=20) PMember->expChain.chainTime = gettick()+100000; - else if (PMember->GetMLevel() <=30) PMember->expChain.chainTime = gettick()+150000; - else if (PMember->GetMLevel() <=40) PMember->expChain.chainTime = gettick()+200000; - else if (PMember->GetMLevel() <=50) PMember->expChain.chainTime = gettick()+250000; - else if (PMember->GetMLevel() <=60) PMember->expChain.chainTime = gettick()+300000; - else PMember->expChain.chainTime = gettick()+360000; + if (PMember->GetMLevel() <=10) PMember->expChain.chainTime = gettick()+50000*map_config.chain_bonus; + else if (PMember->GetMLevel() <=20) PMember->expChain.chainTime = gettick()+100000*map_config.chain_bonus; + else if (PMember->GetMLevel() <=30) PMember->expChain.chainTime = gettick()+150000*map_config.chain_bonus; + else if (PMember->GetMLevel() <=40) PMember->expChain.chainTime = gettick()+200000*map_config.chain_bonus; + else if (PMember->GetMLevel() <=50) PMember->expChain.chainTime = gettick()+250000*map_config.chain_bonus; + else if (PMember->GetMLevel() <=60) PMember->expChain.chainTime = gettick()+300000*map_config.chain_bonus; + else PMember->expChain.chainTime = gettick()+360000*map_config.chain_bonus; chainactive = false; PMember->expChain.chainNumber = 1; } @@ -2589,85 +2594,85 @@ { switch(PMember->expChain.chainNumber) { - case 0: PMember->expChain.chainTime = gettick()+50000; break; - case 1: PMember->expChain.chainTime = gettick()+40000; break; - case 2: PMember->expChain.chainTime = gettick()+30000; break; - case 3: PMember->expChain.chainTime = gettick()+20000; break; - case 4: PMember->expChain.chainTime = gettick()+10000; break; - case 5: PMember->expChain.chainTime = gettick()+6000; break; - default: PMember->expChain.chainTime = gettick()+2000; break; + case 0: PMember->expChain.chainTime = gettick()+50000*map_config.chain_bonus; break; + case 1: PMember->expChain.chainTime = gettick()+40000*map_config.chain_bonus; break; + case 2: PMember->expChain.chainTime = gettick()+30000*map_config.chain_bonus; break; + case 3: PMember->expChain.chainTime = gettick()+20000*map_config.chain_bonus; break; + case 4: PMember->expChain.chainTime = gettick()+10000*map_config.chain_bonus; break; + case 5: PMember->expChain.chainTime = gettick()+6000*map_config.chain_bonus; break; + default: PMember->expChain.chainTime = gettick()+2000*map_config.chain_bonus; break; } } else if(chainactive && PMember->GetMLevel() <= 20) { switch(PMember->expChain.chainNumber) { - case 0: PMember->expChain.chainTime = gettick()+100000; break; - case 1: PMember->expChain.chainTime = gettick()+80000; break; - case 2: PMember->expChain.chainTime = gettick()+60000; break; - case 3: PMember->expChain.chainTime = gettick()+40000; break; - case 4: PMember->expChain.chainTime = gettick()+20000; break; - case 5: PMember->expChain.chainTime = gettick()+8000; break; - default: PMember->expChain.chainTime = gettick()+4000; break; + case 0: PMember->expChain.chainTime = gettick()+100000*map_config.chain_bonus; break; + case 1: PMember->expChain.chainTime = gettick()+80000*map_config.chain_bonus; break; + case 2: PMember->expChain.chainTime = gettick()+60000*map_config.chain_bonus; break; + case 3: PMember->expChain.chainTime = gettick()+40000*map_config.chain_bonus; break; + case 4: PMember->expChain.chainTime = gettick()+20000*map_config.chain_bonus; break; + case 5: PMember->expChain.chainTime = gettick()+8000*map_config.chain_bonus; break; + default: PMember->expChain.chainTime = gettick()+4000*map_config.chain_bonus; break; } } else if(chainactive && PMember->GetMLevel() <= 30) { switch(PMember->expChain.chainNumber) { - case 0: PMember->expChain.chainTime = gettick()+150000; break; - case 1: PMember->expChain.chainTime = gettick()+120000; break; - case 2: PMember->expChain.chainTime = gettick()+90000; break; - case 3: PMember->expChain.chainTime = gettick()+60000; break; - case 4: PMember->expChain.chainTime = gettick()+30000; break; - case 5: PMember->expChain.chainTime = gettick()+10000; break; - default: PMember->expChain.chainTime = gettick()+5000; break; + case 0: PMember->expChain.chainTime = gettick()+150000*map_config.chain_bonus; break; + case 1: PMember->expChain.chainTime = gettick()+120000*map_config.chain_bonus; break; + case 2: PMember->expChain.chainTime = gettick()+90000*map_config.chain_bonus; break; + case 3: PMember->expChain.chainTime = gettick()+60000*map_config.chain_bonus; break; + case 4: PMember->expChain.chainTime = gettick()+30000*map_config.chain_bonus; break; + case 5: PMember->expChain.chainTime = gettick()+10000*map_config.chain_bonus; break; + default: PMember->expChain.chainTime = gettick()+5000*map_config.chain_bonus; break; } } else if(chainactive && PMember->GetMLevel() <= 40) { switch(PMember->expChain.chainNumber) { - case 0: PMember->expChain.chainTime = gettick()+200000; break; - case 1: PMember->expChain.chainTime = gettick()+160000; break; - case 2: PMember->expChain.chainTime = gettick()+120000; break; - case 3: PMember->expChain.chainTime = gettick()+80000; break; - case 4: PMember->expChain.chainTime = gettick()+40000; break; - case 5: PMember->expChain.chainTime = gettick()+40000; break; - default: PMember->expChain.chainTime = gettick()+30000; break; + case 0: PMember->expChain.chainTime = gettick()+200000*map_config.chain_bonus; break; + case 1: PMember->expChain.chainTime = gettick()+160000*map_config.chain_bonus; break; + case 2: PMember->expChain.chainTime = gettick()+120000*map_config.chain_bonus; break; + case 3: PMember->expChain.chainTime = gettick()+80000*map_config.chain_bonus; break; + case 4: PMember->expChain.chainTime = gettick()+40000*map_config.chain_bonus; break; + case 5: PMember->expChain.chainTime = gettick()+40000*map_config.chain_bonus; break; + default: PMember->expChain.chainTime = gettick()+30000*map_config.chain_bonus; break; } } else if(chainactive && PMember->GetMLevel() <= 50) { switch(PMember->expChain.chainNumber) { - case 0: PMember->expChain.chainTime = gettick()+250000; break; - case 1: PMember->expChain.chainTime = gettick()+200000; break; - case 2: PMember->expChain.chainTime = gettick()+150000; break; - case 3: PMember->expChain.chainTime = gettick()+100000; break; - case 4: PMember->expChain.chainTime = gettick()+50000; break; - case 5: PMember->expChain.chainTime = gettick()+50000; break; - default: PMember->expChain.chainTime = gettick()+50000; break; + case 0: PMember->expChain.chainTime = gettick()+250000*map_config.chain_bonus; break; + case 1: PMember->expChain.chainTime = gettick()+200000*map_config.chain_bonus; break; + case 2: PMember->expChain.chainTime = gettick()+150000*map_config.chain_bonus; break; + case 3: PMember->expChain.chainTime = gettick()+100000*map_config.chain_bonus; break; + case 4: PMember->expChain.chainTime = gettick()+50000*map_config.chain_bonus; break; + case 5: PMember->expChain.chainTime = gettick()+50000*map_config.chain_bonus; break; + default: PMember->expChain.chainTime = gettick()+50000*map_config.chain_bonus; break; } } else if(chainactive && PMember->GetMLevel() <= 60) { switch(PMember->expChain.chainNumber) { - case 0: PMember->expChain.chainTime = gettick()+300000; break; - case 1: PMember->expChain.chainTime = gettick()+240000; break; - case 2: PMember->expChain.chainTime = gettick()+180000; break; - case 3: PMember->expChain.chainTime = gettick()+120000; break; - case 4: PMember->expChain.chainTime = gettick()+90000; break; - case 5: PMember->expChain.chainTime = gettick()+60000; break; - default: PMember->expChain.chainTime = gettick()+60000; break; + case 0: PMember->expChain.chainTime = gettick()+300000*map_config.chain_bonus; break; + case 1: PMember->expChain.chainTime = gettick()+240000*map_config.chain_bonus; break; + case 2: PMember->expChain.chainTime = gettick()+180000*map_config.chain_bonus; break; + case 3: PMember->expChain.chainTime = gettick()+120000*map_config.chain_bonus; break; + case 4: PMember->expChain.chainTime = gettick()+90000*map_config.chain_bonus; break; + case 5: PMember->expChain.chainTime = gettick()+60000*map_config.chain_bonus; break; + default: PMember->expChain.chainTime = gettick()+60000*map_config.chain_bonus; break; } } else if (chainactive) { switch(PMember->expChain.chainNumber) { - case 0: PMember->expChain.chainTime = gettick()+360000; break; - case 1: PMember->expChain.chainTime = gettick()+300000; break; - case 2: PMember->expChain.chainTime = gettick()+240000; break; - case 3: PMember->expChain.chainTime = gettick()+165000; break; - case 4: PMember->expChain.chainTime = gettick()+105000; break; - case 5: PMember->expChain.chainTime = gettick()+60000; break; - default: PMember->expChain.chainTime = gettick()+60000; break; + case 0: PMember->expChain.chainTime = gettick()+360000*map_config.chain_bonus; break; + case 1: PMember->expChain.chainTime = gettick()+300000*map_config.chain_bonus; break; + case 2: PMember->expChain.chainTime = gettick()+240000*map_config.chain_bonus; break; + case 3: PMember->expChain.chainTime = gettick()+165000*map_config.chain_bonus; break; + case 4: PMember->expChain.chainTime = gettick()+105000*map_config.chain_bonus; break; + case 5: PMember->expChain.chainTime = gettick()+60000*map_config.chain_bonus; break; + default: PMember->expChain.chainTime = gettick()+60000*map_config.chain_bonus; break; } } exp = charutils::AddExpBonus(PMember, exp); @@ -2682,8 +2687,8 @@ uint8 Pzone = PMember->getZone(); if (PMob->m_Type == MOBTYPE_NORMAL && ((Pzone > 0 && Pzone < 39) || (Pzone > 42 && Pzone < 134) || (Pzone > 135 && Pzone < 185) || (Pzone > 188 && Pzone < 255))) { - if (PMember->StatusEffectContainer->HasStatusEffect(EFFECT_SIGNET) && PMob->m_Element > 0 && rand()%100 < 20 && - PMember->loc.zone == PMob->loc.zone) // Need to move to SIGNET_CHANCE constant + if ((PMember->StatusEffectContainer->HasStatusEffect(EFFECT_SIGNET) || PMember->StatusEffectContainer->HasStatusEffect(EFFECT_SANCTION)) && PMob->m_Element > 0 && + rand()%100 < (20 - PMember->getMod(MOD_CRYSTAL_DROP)) && PMember->loc.zone == PMob->loc.zone) // Need to move to SIGNET_CHANCE constant { PMember->PTreasurePool->AddItem(4095 + PMob->m_Element, PMob); } @@ -2711,6 +2716,7 @@ else if (PMob->m_Family == 266 && PMob->getZone() == 174) monsterbonus = 1.23f; else if (PMob->m_Family == 206 && PMob->getZone() == 5) monsterbonus = 1.10f; else if (PMob->m_Family == 208 && PMob->getZone() == 24) monsterbonus = 1.23f; + else if (PMob->m_Type & MOBTYPE_NOTORIOUS && PMob->GetMLevel() > 75) monsterbonus = 5.00f; if (monsterbonus > 1.00f) exp *= monsterbonus; if (PChar->GetMLevel() <= 50) { @@ -2719,8 +2725,8 @@ else if (PChar->GetMLevel() <= 60) { if (exp > (250*permonstercap)) exp = 250*permonstercap; - } - else if (exp > (300*permonstercap)) + } + else if (exp > (300*permonstercap) && PMob->m_Type != MOBTYPE_NOTORIOUS && PMob->GetMLevel() <= 75) { exp = 300*permonstercap; } @@ -2740,13 +2746,13 @@ } else { - if (PChar->GetMLevel() <=10) PChar->expChain.chainTime = gettick()+50000; - else if (PChar->GetMLevel() <=20) PChar->expChain.chainTime = gettick()+100000; - else if (PChar->GetMLevel() <=30) PChar->expChain.chainTime = gettick()+150000; - else if (PChar->GetMLevel() <=40) PChar->expChain.chainTime = gettick()+200000; - else if (PChar->GetMLevel() <=50) PChar->expChain.chainTime = gettick()+250000; - else if (PChar->GetMLevel() <=60) PChar->expChain.chainTime = gettick()+300000; - else PChar->expChain.chainTime = gettick()+360000; + if (PChar->GetMLevel() <=10) PChar->expChain.chainTime = gettick()+50000*map_config.chain_bonus; + else if (PChar->GetMLevel() <=20) PChar->expChain.chainTime = gettick()+100000*map_config.chain_bonus; + else if (PChar->GetMLevel() <=30) PChar->expChain.chainTime = gettick()+150000*map_config.chain_bonus; + else if (PChar->GetMLevel() <=40) PChar->expChain.chainTime = gettick()+200000*map_config.chain_bonus; + else if (PChar->GetMLevel() <=50) PChar->expChain.chainTime = gettick()+250000*map_config.chain_bonus; + else if (PChar->GetMLevel() <=60) PChar->expChain.chainTime = gettick()+300000*map_config.chain_bonus; + else PChar->expChain.chainTime = gettick()+360000*map_config.chain_bonus; chainactive = false; PChar->expChain.chainNumber = 1; } @@ -2754,85 +2760,85 @@ { switch(PChar->expChain.chainNumber) { - case 0: PChar->expChain.chainTime = gettick()+50000; break; - case 1: PChar->expChain.chainTime = gettick()+40000; break; - case 2: PChar->expChain.chainTime = gettick()+30000; break; - case 3: PChar->expChain.chainTime = gettick()+20000; break; - case 4: PChar->expChain.chainTime = gettick()+10000; break; - case 5: PChar->expChain.chainTime = gettick()+6000; break; - default: PChar->expChain.chainTime = gettick()+2000; break; + case 0: PChar->expChain.chainTime = gettick()+50000*map_config.chain_bonus; break; + case 1: PChar->expChain.chainTime = gettick()+40000*map_config.chain_bonus; break; + case 2: PChar->expChain.chainTime = gettick()+30000*map_config.chain_bonus; break; + case 3: PChar->expChain.chainTime = gettick()+20000*map_config.chain_bonus; break; + case 4: PChar->expChain.chainTime = gettick()+10000*map_config.chain_bonus; break; + case 5: PChar->expChain.chainTime = gettick()+6000*map_config.chain_bonus; break; + default: PChar->expChain.chainTime = gettick()+2000*map_config.chain_bonus; break; } } else if(chainactive && PChar->GetMLevel() <= 20) { switch(PChar->expChain.chainNumber) { - case 0: PChar->expChain.chainTime = gettick()+100000; break; - case 1: PChar->expChain.chainTime = gettick()+80000; break; - case 2: PChar->expChain.chainTime = gettick()+60000; break; - case 3: PChar->expChain.chainTime = gettick()+40000; break; - case 4: PChar->expChain.chainTime = gettick()+20000; break; - case 5: PChar->expChain.chainTime = gettick()+8000; break; - default: PChar->expChain.chainTime = gettick()+4000; break; + case 0: PChar->expChain.chainTime = gettick()+100000*map_config.chain_bonus; break; + case 1: PChar->expChain.chainTime = gettick()+80000*map_config.chain_bonus; break; + case 2: PChar->expChain.chainTime = gettick()+60000*map_config.chain_bonus; break; + case 3: PChar->expChain.chainTime = gettick()+40000*map_config.chain_bonus; break; + case 4: PChar->expChain.chainTime = gettick()+20000*map_config.chain_bonus; break; + case 5: PChar->expChain.chainTime = gettick()+8000*map_config.chain_bonus; break; + default: PChar->expChain.chainTime = gettick()+4000*map_config.chain_bonus; break; } } else if(chainactive && PChar->GetMLevel() <= 30) { switch(PChar->expChain.chainNumber) { - case 0: PChar->expChain.chainTime = gettick()+150000; break; - case 1: PChar->expChain.chainTime = gettick()+120000; break; - case 2: PChar->expChain.chainTime = gettick()+90000; break; - case 3: PChar->expChain.chainTime = gettick()+60000; break; - case 4: PChar->expChain.chainTime = gettick()+30000; break; - case 5: PChar->expChain.chainTime = gettick()+10000; break; - default: PChar->expChain.chainTime = gettick()+5000; break; + case 0: PChar->expChain.chainTime = gettick()+150000*map_config.chain_bonus; break; + case 1: PChar->expChain.chainTime = gettick()+120000*map_config.chain_bonus; break; + case 2: PChar->expChain.chainTime = gettick()+90000*map_config.chain_bonus; break; + case 3: PChar->expChain.chainTime = gettick()+60000*map_config.chain_bonus; break; + case 4: PChar->expChain.chainTime = gettick()+30000*map_config.chain_bonus; break; + case 5: PChar->expChain.chainTime = gettick()+10000*map_config.chain_bonus; break; + default: PChar->expChain.chainTime = gettick()+5000*map_config.chain_bonus; break; } } else if(chainactive && PChar->GetMLevel() <= 40) { switch(PChar->expChain.chainNumber) { - case 0: PChar->expChain.chainTime = gettick()+200000; break; - case 1: PChar->expChain.chainTime = gettick()+160000; break; - case 2: PChar->expChain.chainTime = gettick()+120000; break; - case 3: PChar->expChain.chainTime = gettick()+80000; break; - case 4: PChar->expChain.chainTime = gettick()+40000; break; - case 5: PChar->expChain.chainTime = gettick()+40000; break; - default: PChar->expChain.chainTime = gettick()+30000; break; + case 0: PChar->expChain.chainTime = gettick()+200000*map_config.chain_bonus; break; + case 1: PChar->expChain.chainTime = gettick()+160000*map_config.chain_bonus; break; + case 2: PChar->expChain.chainTime = gettick()+120000*map_config.chain_bonus; break; + case 3: PChar->expChain.chainTime = gettick()+80000*map_config.chain_bonus; break; + case 4: PChar->expChain.chainTime = gettick()+40000*map_config.chain_bonus; break; + case 5: PChar->expChain.chainTime = gettick()+40000*map_config.chain_bonus; break; + default: PChar->expChain.chainTime = gettick()+30000*map_config.chain_bonus; break; } } else if(chainactive && PChar->GetMLevel() <= 50) { switch(PChar->expChain.chainNumber) { - case 0: PChar->expChain.chainTime = gettick()+250000; break; - case 1: PChar->expChain.chainTime = gettick()+200000; break; - case 2: PChar->expChain.chainTime = gettick()+150000; break; - case 3: PChar->expChain.chainTime = gettick()+100000; break; - case 4: PChar->expChain.chainTime = gettick()+50000; break; - case 5: PChar->expChain.chainTime = gettick()+50000; break; - default: PChar->expChain.chainTime = gettick()+50000; break; + case 0: PChar->expChain.chainTime = gettick()+250000*map_config.chain_bonus; break; + case 1: PChar->expChain.chainTime = gettick()+200000*map_config.chain_bonus; break; + case 2: PChar->expChain.chainTime = gettick()+150000*map_config.chain_bonus; break; + case 3: PChar->expChain.chainTime = gettick()+100000*map_config.chain_bonus; break; + case 4: PChar->expChain.chainTime = gettick()+50000*map_config.chain_bonus; break; + case 5: PChar->expChain.chainTime = gettick()+50000*map_config.chain_bonus; break; + default: PChar->expChain.chainTime = gettick()+50000*map_config.chain_bonus; break; } } else if(chainactive && PChar->GetMLevel() <= 60) { switch(PChar->expChain.chainNumber) { - case 0: PChar->expChain.chainTime = gettick()+300000; break; - case 1: PChar->expChain.chainTime = gettick()+240000; break; - case 2: PChar->expChain.chainTime = gettick()+180000; break; - case 3: PChar->expChain.chainTime = gettick()+120000; break; - case 4: PChar->expChain.chainTime = gettick()+90000; break; - case 5: PChar->expChain.chainTime = gettick()+60000; break; - default: PChar->expChain.chainTime = gettick()+60000; break; + case 0: PChar->expChain.chainTime = gettick()+300000*map_config.chain_bonus; break; + case 1: PChar->expChain.chainTime = gettick()+240000*map_config.chain_bonus; break; + case 2: PChar->expChain.chainTime = gettick()+180000*map_config.chain_bonus; break; + case 3: PChar->expChain.chainTime = gettick()+120000*map_config.chain_bonus; break; + case 4: PChar->expChain.chainTime = gettick()+90000*map_config.chain_bonus; break; + case 5: PChar->expChain.chainTime = gettick()+60000*map_config.chain_bonus; break; + default: PChar->expChain.chainTime = gettick()+60000*map_config.chain_bonus; break; } } else if (chainactive) { switch(PChar->expChain.chainNumber) { - case 0: PChar->expChain.chainTime = gettick()+360000; break; - case 1: PChar->expChain.chainTime = gettick()+300000; break; - case 2: PChar->expChain.chainTime = gettick()+240000; break; - case 3: PChar->expChain.chainTime = gettick()+165000; break; - case 4: PChar->expChain.chainTime = gettick()+105000; break; - case 5: PChar->expChain.chainTime = gettick()+60000; break; - default: PChar->expChain.chainTime = gettick()+60000; break; + case 0: PChar->expChain.chainTime = gettick()+360000*map_config.chain_bonus; break; + case 1: PChar->expChain.chainTime = gettick()+300000*map_config.chain_bonus; break; + case 2: PChar->expChain.chainTime = gettick()+240000*map_config.chain_bonus; break; + case 3: PChar->expChain.chainTime = gettick()+165000*map_config.chain_bonus; break; + case 4: PChar->expChain.chainTime = gettick()+105000*map_config.chain_bonus; break; + case 5: PChar->expChain.chainTime = gettick()+60000*map_config.chain_bonus; break; + default: PChar->expChain.chainTime = gettick()+60000*map_config.chain_bonus; break; } } exp = charutils::AddExpBonus(PChar, exp); @@ -2847,7 +2853,8 @@ uint8 Pzone = PChar->getZone(); if (PMob->m_Type == MOBTYPE_NORMAL && ((Pzone > 0 && Pzone < 39) || (Pzone > 42 && Pzone < 134) || (Pzone > 135 && Pzone < 185) || (Pzone > 188 && Pzone < 255))) { - if (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_SIGNET) && PMob->m_Element > 0 && rand()%100 < 20) // Need to move to SIGNET_CHANCE constant + if (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_SIGNET) && PMob->m_Element > 0 && + rand()%100 < (20 - PChar->getMod(MOD_CRYSTAL_DROP))) // Need to move to SIGNET_CHANCE constant { PChar->PTreasurePool->AddItem(4095 + PMob->m_Element, PMob); } @@ -2892,8 +2899,8 @@ if (PChar->m_LevelRestriction == 0 || PChar->jobs.job[PChar->GetMJob()] < PChar->m_LevelRestriction) { - PChar->SetMLevel(PChar->jobs.job[PChar->GetMJob()]); - PChar->SetSLevel(PChar->jobs.job[PChar->GetSJob()]); + PChar->SetMLevel(PChar->jobs.job[PChar->GetMJob()]); + PChar->SetSLevel(PChar->jobs.job[PChar->GetSJob()]); } BuildingCharSkillsTable(PChar); @@ -2974,7 +2981,7 @@ /************************************************************************ * * -* Добавляем очки опытка указанному персонажу * +* Adding Points opytka chosen character * * * ************************************************************************/ @@ -3044,13 +3051,13 @@ //TODO: Only add IS if player has Saction //TODO: Killing mobs != gaining Zeni - if(PChar->getZone() >= 48 && PChar->getZone() <= 79) - { + if(PChar->getZone() >= 48 && PChar->getZone() <= 79) + { PChar->RegionPoints[3] += (exp*0.1f); // 10% // PChar->RegionPoints[10] += (exp*0.1f); // 10% - PChar->pushPacket(new CConquestPacket(PChar)); - } + PChar->pushPacket(new CConquestPacket(PChar)); } + } //player levels up @@ -3116,7 +3123,7 @@ /************************************************************************ * * -* Устанавливаем ограничение уровня персонажа * +* Set the level of the character limit * * * ************************************************************************/ @@ -3185,7 +3192,7 @@ /************************************************************************ * * -* Сохраняем позицию * +* Reserve position * * * ************************************************************************/ @@ -3216,7 +3223,7 @@ /************************************************************************ * * -* Сохраняем список квестов * +* Save the list of quests * * * ************************************************************************/ @@ -3279,7 +3286,7 @@ /************************************************************************ * * -* Cохраняем список колючевых предметов * +* Maintains a list of items kolyuchevyh * * * ************************************************************************/ @@ -3306,7 +3313,7 @@ /************************************************************************ * * -* Cохраняем список колючевых предметов * +* Maintains a list of items kolyuchevyh * * * ************************************************************************/ @@ -3322,7 +3329,7 @@ /************************************************************************ * * -* Сохраняем список выученных заклинаний * +* Store a list of memorized spells * * * ************************************************************************/ @@ -3344,7 +3351,7 @@ /************************************************************************ * * -* Сохраняем список выученных заклинаний * +* Store a list of memorized abilities * * * ************************************************************************/ @@ -3365,7 +3372,7 @@ /************************************************************************ * * -* Сохраняем список званий * +* Store a list of titles * * * ************************************************************************/ @@ -3390,7 +3397,7 @@ /************************************************************************ * * -* Сохраняем список посещенных зон * +* Save the list of visited zones * * * ************************************************************************/ @@ -3406,7 +3413,7 @@ /************************************************************************ * * -* Сохраняем экипировку и внешний вид персонажа. * +* Store equipment and appearance of the character. * * * ************************************************************************/ @@ -3458,7 +3465,7 @@ /************************************************************************ * * -* Сохраняем часть текущих характеристик персонажа * +* Save the part of the current characteristics of the character * * * ************************************************************************/ @@ -3500,7 +3507,7 @@ /************************************************************************ * * -* Сохраняем текущие уровни профессий персонажа * +* Retain the current levels of occupational character * * * ************************************************************************/ @@ -3540,7 +3547,7 @@ /************************************************************************ * * -* Сохраняем текущий опыт персонажа * +* Save the current experience of the character * * * ************************************************************************/ @@ -3584,7 +3591,7 @@ /************************************************************************ * * -* Сохраняем значение выбранного умения персонажа * +* Save the value of the selected character's abilities * * * ************************************************************************/ @@ -3798,6 +3805,11 @@ Sql_Query(SqlHandle, fmtQuery, (uint32)time(NULL), PChar->id); } +void SavePlayTime(CCharEntity* PChar) +{ + Sql_Query(SqlHandle, "UPDATE chars SET playtime = '%u' WHERE charid = '%u' LIMIT 1;", PChar->GetPlayTime(), PChar->id); +} + /************************************************************************ * * * Checks which UnarmedItem to grant when SLOT_MAIN is empty. * Index: src/map/charutils.h =================================================================== --- src/map/charutils.h (revision 3304) +++ src/map/charutils.h (working copy) @@ -83,29 +83,29 @@ void UpdateHealth(CCharEntity* PChar); - int32 hasKeyItem(CCharEntity* PChar, uint16 KeyItemID); // проверяем наличие ключевого предмета - int32 seenKeyItem(CCharEntity* PChar, uint16 KeyItemID); // проверяем, было ли описание ключевого предмета прочитано + int32 hasKeyItem(CCharEntity* PChar, uint16 KeyItemID); // check for a key item + int32 seenKeyItem(CCharEntity* PChar, uint16 KeyItemID); // check to see if there was a description of the key subject read int32 unseenKeyItem(CCharEntity* PChar, uint16 KeyItemID); // Attempt to remove keyitem from seen list - int32 addKeyItem(CCharEntity* PChar, uint16 KeyItemID); // добавляем ключевой предмет - int32 delKeyItem(CCharEntity* PChar, uint16 KeyItemID); // улаляем ключевой предмет + int32 addKeyItem(CCharEntity* PChar, uint16 KeyItemID); // add key item + int32 delKeyItem(CCharEntity* PChar, uint16 KeyItemID); // delete key item - int32 hasSpell(CCharEntity* PChar, uint16 SpellID); // проверяем наличие заклинания - int32 addSpell(CCharEntity* PChar, uint16 SpellID); // добавляем заклинание - int32 delSpell(CCharEntity* PChar, uint16 SpellID); // улаляем заклинание + int32 hasSpell(CCharEntity* PChar, uint16 SpellID); // check for spell + int32 addSpell(CCharEntity* PChar, uint16 SpellID); // add spell + int32 delSpell(CCharEntity* PChar, uint16 SpellID); // delete spell - int32 hasLearnedAbility(CCharEntity* PChar, uint16 AbilityID); // проверяем наличие заклинания - int32 addLearnedAbility(CCharEntity* PChar, uint16 AbilityID); // добавляем заклинание - int32 delLearnedAbility(CCharEntity* PChar, uint16 AbilityID); // улаляем заклинание + int32 hasLearnedAbility(CCharEntity* PChar, uint16 AbilityID); // check for an ability + int32 addLearnedAbility(CCharEntity* PChar, uint16 AbilityID); // add ability + int32 delLearnedAbility(CCharEntity* PChar, uint16 AbilityID); // delete ability - int32 hasAbility(CCharEntity* PChar, uint16 AbilityID); // проверяем наличие ключевого предмета - int32 addAbility(CCharEntity* PChar, uint16 AbilityID); // добавляем ключевой предмет - int32 delAbility(CCharEntity* PChar, uint16 AbilityID); // улаляем ключевой предмет + int32 hasAbility(CCharEntity* PChar, uint16 AbilityID); // check for an ability + int32 addAbility(CCharEntity* PChar, uint16 AbilityID); // add ability + int32 delAbility(CCharEntity* PChar, uint16 AbilityID); // delete ability int32 hasTitle(CCharEntity* PChar, uint16 Title); int32 addTitle(CCharEntity* PChar, uint16 Title); int32 delTitle(CCharEntity* PChar, uint16 Title); - int32 hasPetAbility(CCharEntity* PChar, uint16 AbilityID); //same as Ability but for pet commands (e.g. Healing Ruby) + int32 hasPetAbility(CCharEntity* PChar, uint16 AbilityID); // same as Ability but for pet commands (e.g. Healing Ruby) int32 addPetAbility(CCharEntity* PChar, uint16 AbilityID); int32 delPetAbility(CCharEntity* PChar, uint16 AbilityID); @@ -117,23 +117,24 @@ int32 hasWeaponSkill(CCharEntity* PChar, uint16 WeaponSkillID); // declaration of function to check for weapon skill int32 delWeaponSkill(CCharEntity* PChar, uint16 WeaponSkillID); // declaration of function to delete weapon skill - void SaveCharJob(CCharEntity* PChar, JOBTYPE job); // сохраняем уровень для выбранной профессий персонажа - void SaveCharExp(CCharEntity* PChar, JOBTYPE job); // сохраняем опыт для выбранной профессии персонажа - void SaveCharEquip(CCharEntity* PChar); // сохраняем экипировку и внешний вид персонажа - void SaveCharPosition(CCharEntity* PChar); // сохраняем позицию персонажа + void SaveCharJob(CCharEntity* PChar, JOBTYPE job); // Holds the level of the selected character's profession + void SaveCharExp(CCharEntity* PChar, JOBTYPE job); // store experience for their chosen profession character + void SaveCharEquip(CCharEntity* PChar); // store the equipment and the appearance of the character + void SaveCharPosition(CCharEntity* PChar); // save the position of the character void SaveMissionsList(CCharEntity* PChar); // Save the missions list - void SaveQuestsList(CCharEntity* PChar); // сохраняем список ксевтов - void SaveZonesVisited(CCharEntity* PChar); // сохраняем посещенные зоны - void SaveKeyItems(CCharEntity* PChar); // сохраняем ключевые предметы + void SaveQuestsList(CCharEntity* PChar); // save the quest list + void SaveZonesVisited(CCharEntity* PChar); // save the visited area + void SaveKeyItems(CCharEntity* PChar); // save the key items void SaveCharInventoryCapacity(CCharEntity* PChar); // Save Character inventory capacity - void SaveSpells(CCharEntity* PChar); // сохраняем выученные заклинания + void SaveSpells(CCharEntity* PChar); // store memorized spells void SaveLearnedAbilities(CCharEntity* PChar); // saved learned abilities (corsair rolls) - void SaveTitles(CCharEntity* PChar); // сохраняем заслуженные звания - void SaveCharStats(CCharEntity* PChar); // сохраняем флаги, текущие значения жихней, маны и профессий - void SaveCharNation(CCharEntity* PChar); // Sace the character's nation of allegiance. - void SaveCharSkills(CCharEntity* PChar, uint8 skillID); // сохраняем указанный skill персонажа + void SaveTitles(CCharEntity* PChar); // save the honored title + void SaveCharStats(CCharEntity* PChar); // store the flags, the current values ​​zhihney, mana and professions + void SaveCharNation(CCharEntity* PChar); // Save the character's nation of allegiance. + void SaveCharSkills(CCharEntity* PChar, uint8 skillID); // Saves the character's skill void SaveCharPoints(CCharEntity* PChar); // Conquest point, Nation TP void SaveDeathTime(CCharEntity* PChar); // Saves when this character last died. + void SavePlayTime(CCharEntity* PChar); // Saves this characters total play time. bool hasMogLockerAccess(CCharEntity* PChar); // true if have access, false otherwise. uint32 AddExpBonus(CCharEntity* PChar, uint32 exp); Index: src/map/commandhandler.cpp =================================================================== --- src/map/commandhandler.cpp (revision 3304) +++ src/map/commandhandler.cpp (working copy) @@ -156,7 +156,7 @@ return -1; } - //Загрузка файла команды. + // Load the file command. if( luaL_loadfile(m_LState,std::string(CmdHandler->CmdPath+"/"+CmdHandler->CmdName+".lua").c_str()) || lua_pcall(m_LState,0,0,0) ) { @@ -165,7 +165,7 @@ return -1; } - //Загрузка адреса функции в стек. + // Load the address of the function to the stack. lua_pushstring(m_LState, "onTrigger"); lua_gettable(m_LState,LUA_GLOBALSINDEX); @@ -176,7 +176,7 @@ return -1; } - //Добавление самого первого параметра + // Add the first parameter of the CLuaBaseEntity LuaCmdCaller(PChar); int32 cntparam = 0; if( PChar != NULL ) @@ -185,7 +185,7 @@ cntparam += 1; } - /* цикл просмотра строки передаваемых значений*/ + /* Loop transmission line view of values */ std::string::const_iterator param_iter = CmdHandler->CmdParameters.begin(); std::string param; @@ -221,7 +221,7 @@ ++param_iter; } - //Вызов функции. + // Call the function. int32 status = lua_pcall(m_LState,cntparam,0,0); if( status ) { Index: src/map/commandhandler.h =================================================================== --- src/map/commandhandler.h (revision 3304) +++ src/map/commandhandler.h (working copy) @@ -40,8 +40,8 @@ /************************************************************************ * * -* Структура инициализирующего файла CmdHandler, представлена * -* записями следующего типа. * +* The structure of the initialization file CmdHandler, presented * +* Records the following type. * * * ************************************************************************/ @@ -85,10 +85,10 @@ //m_CmdInIPath += InitCmdInIPath; }; - bool init(const int8* InitCmdInIPath, lua_State* InitLState); // Инициализация списка команд. - bool free(); // Освобождение занятых заранее ресурсов + bool init(const int8* InitCmdInIPath, lua_State* InitLState); // Initialize the list of commands. + bool free(); // pre-release employment resources - int32 call(CCharEntity* PChar, const int8* commandline); // Вызов сценария. + int32 call(CCharEntity* PChar, const int8* commandline); // Call the script. ~CCommandHandler() {} }; Index: src/map/conquest_system.cpp =================================================================== --- src/map/conquest_system.cpp (revision 3304) +++ src/map/conquest_system.cpp (working copy) @@ -31,7 +31,7 @@ /************************************************************************ * * -* Реализация namespace conquest * +* Implementation namespace conquest * * * ************************************************************************/ @@ -340,7 +340,7 @@ /************************************************************************ * * - * Оставшееся количество дней до подсчета conquest * + * Remaining number of days to count conquest * * * ************************************************************************/ @@ -352,7 +352,7 @@ /************************************************************************ * * - * Узнаем страну, владеющую данной зоной * + * Know the country that owns this area * * * ************************************************************************/ @@ -385,16 +385,16 @@ /************************************************************************ * * - * Добавляем персонажу conquest points, основываясь на полученном опыте * + * Add the character conquest points, based on experience * * * ************************************************************************/ - // TODO: необходимо учитывать добавленные очки для еженедельного подсчета conquest + // TODO: need to consider the added points for the weekly count conquest uint32 AddConquestPoints(CCharEntity* PChar, uint32 exp) { - // ВНИМЕНИЕ: не нужно отправлять персонажу CConquestPacket, - // т.к. клиент сам запрашивает этот пакет через фиксированный промежуток времени + // ATTENTION: no need to send a character CConquestPacket, + // As the client requests this package after a fixed period REGIONTYPE region = PChar->loc.zone->GetRegionID(); @@ -405,7 +405,7 @@ PChar->RegionPoints[PChar->profile.nation] += exp * (PChar->profile.nation == GetRegionOwner(region) ? 0.1 : 0.15); } - return 0; // added conquest points (пока не вижу в этом определенного смысла) + return 0; // added conquest points (do not see in this a sense) } Index: src/map/enmity_container.cpp =================================================================== --- src/map/enmity_container.cpp (revision 3304) +++ src/map/enmity_container.cpp (working copy) @@ -80,7 +80,7 @@ /************************************************************************ * * -* Минимальное (базовое) значение ненависти * +* Minimum (base) value hate * * * ************************************************************************/ @@ -169,7 +169,7 @@ void CEnmityContainer::AddPartyEnmity(CCharEntity* PChar) { - // TODO: добавляемые персонажи уже могут быть в списке enmity, я не уверен, что добавление базового значения здесь актуально + // TODO: add characters may already be in the list of enmity, I'm not sure that adding a base value is true if (PChar->PParty != NULL) { Index: src/map/fishingutils.cpp =================================================================== --- src/map/fishingutils.cpp (revision 3304) +++ src/map/fishingutils.cpp (working copy) @@ -49,7 +49,7 @@ /************************************************************************ * * -* Массив смещений для сообщений рыбалки * +* An array of offsets for fishing reports * * * ************************************************************************/ @@ -65,7 +65,7 @@ /************************************************************************ * * -* Получение смещения для сообщений рыбалки * +* Get the offset for the posts of fishing * * * ************************************************************************/ @@ -76,7 +76,7 @@ /************************************************************************ * * -* Проверяем наличие удочки, наживки и возможности ловли * +* Check if the rods, bait and fishing opportunities * * * ************************************************************************/ @@ -106,7 +106,7 @@ !(WeaponItem->getType() & ITEM_WEAPON) || (WeaponItem->getSkillType() != SKILL_FSH)) { - // сообщение: "You can't fish without a rod in your hands" + // The message: "You can't fish without a rod in your hands" PChar->pushPacket(new CMessageTextPacket(PChar, MessageOffset + 0x01)); PChar->pushPacket(new CReleasePacket(PChar,RELEASE_FISHING)); @@ -119,7 +119,7 @@ !(WeaponItem->getType() & ITEM_WEAPON) || (WeaponItem->getSkillType() != SKILL_FSH)) { - // сообщение: "You can't fish without bait on the hook" + // The message: "You can't fish without bait on the hook" PChar->pushPacket(new CMessageTextPacket(PChar, MessageOffset + 0x02)); PChar->pushPacket(new CReleasePacket(PChar,RELEASE_FISHING)); @@ -135,7 +135,7 @@ /************************************************************************ * * -* Персонаж ломает удочку * +* Character breaks bait * * * ************************************************************************/ @@ -192,7 +192,7 @@ { while(Sql_NextRow(SqlHandle) == SQL_SUCCESS) { - // ловля предметов, необходимых для поисков + // Fishing items needed for searches uint8 logid = (uint8)Sql_GetIntData(SqlHandle,5); uint8 quest = (uint8)Sql_GetIntData(SqlHandle,6); @@ -211,7 +211,7 @@ break; } } - // TODO: ловля простых предметов + // TODO: Fishing simple objects } } } @@ -262,7 +262,7 @@ /************************************************************************ * * -* Персонаж теряет наживку (теряет блесну лишь при условии RemoveFly) * +* A character loses bait (minnow loses only if RemoveFly) * * * ************************************************************************/ @@ -291,7 +291,7 @@ /************************************************************************ * * -* Персонаж ломает удочку * +* Character breaks bait * * * ************************************************************************/ @@ -345,7 +345,7 @@ { if (CheckFisherLuck(PChar)) { - // сообщение: "Something caught the hook!" + // The message: "Something caught the hook!" PChar->animation = ANIMATION_FISHING_FISH; PChar->pushPacket(new CMessageTextPacket(PChar, MessageOffset + 0x08)); @@ -353,7 +353,7 @@ } else { - // сообщение: "You didn't catch anything." + // The message: "You didn't catch anything." PChar->animation = ANIMATION_FISHING_STOP; PChar->pushPacket(new CMessageTextPacket(PChar, MessageOffset + 0x04)); @@ -364,7 +364,7 @@ { if (stamina == 0) { - // сообщение: "You caught fish!" + // The message: "You caught fish!" DSP_DEBUG_BREAK_IF(PChar->UContainer->GetType() != UCONTAINER_FISHING); DSP_DEBUG_BREAK_IF(PChar->UContainer->GetItem(0) == NULL); @@ -373,7 +373,7 @@ CItem* PFish = PChar->UContainer->GetItem(0); - // TODO: анализируем RodFlag + // TODO: analyze RodFlag charutils::AddItem(PChar, LOC_INVENTORY, PFish->getID(), 1); PChar->loc.zone->PushPacket(PChar, CHAR_INRANGE_SELF, new CCaughtFishPacket(PChar, PFish->getID(), MessageOffset + 0x27)); @@ -386,7 +386,7 @@ } else if (stamina <= 0x64) { - // сообщение: "Your line breaks!" + // The message: "Your line breaks!" PChar->animation = ANIMATION_FISHING_LINE_BREAK; LureLoss(PChar, true); @@ -394,7 +394,7 @@ } else if (stamina <= 0x100) { - // сообщение: "You give up!" + // The message: "You give up!" PChar->animation = ANIMATION_FISHING_STOP; @@ -408,7 +408,7 @@ } else { - // сообщение: "You lost your catch!" + // The message: "You lost your catch!" PChar->animation = ANIMATION_FISHING_STOP; LureLoss(PChar, false); @@ -419,7 +419,7 @@ break; case FISHACTION_WARNING: { - // сообщение: "You don't know how much longer you can keep this one on the line..." + // The message: "You don't know how much longer you can keep this one on the line..." PChar->pushPacket(new CMessageTextPacket(PChar, MessageOffset + 0x28)); return; Index: src/map/fishingutils.h =================================================================== --- src/map/fishingutils.h (revision 3304) +++ src/map/fishingutils.h (working copy) @@ -36,7 +36,7 @@ /************************************************************************ * * -* Все методы, необходимые для реализации рыбалки * +* All of the techniques required to implement fishing * * * ************************************************************************/ Index: src/map/grades.cpp =================================================================== --- src/map/grades.cpp (revision 3304) +++ src/map/grades.cpp (working copy) @@ -25,13 +25,13 @@ /************************************************************************ * * -* Таблицы расчета характеристик сушностей * +* Tables for calculating the characteristics sushnostey * * * ************************************************************************/ /************************************************************************ * * -* Массив с уровнями характеристик по профессиям * +* An array of performance levels by occupation * * * ************************************************************************/ @@ -151,7 +151,7 @@ uint8 GetJobGrade(JOBTYPE job, uint8 stat) { - //DSP_DEBUG_BREAK_IF(job >= MAX_JOBTYPE || stat > 8); // выход за пределы массива + //DSP_DEBUG_BREAK_IF(job >= MAX_JOBTYPE || stat > 8); // Out of bounds return JobGrades[job][stat]; } @@ -164,7 +164,7 @@ uint8 GetRaceGrades(uint8 race, uint8 stat) { - //DSP_DEBUG_BREAK_IF(race > 4 || stat > 8); // выход за пределы массива + //DSP_DEBUG_BREAK_IF(race > 4 || stat > 8); // Out of bounds return RaceGrades[race][stat]; } @@ -177,7 +177,7 @@ float GetHPScale(uint8 rank, uint8 scale) { - //DSP_DEBUG_BREAK_IF(rank > 7 || scale > 4); // выход за пределы массива + //DSP_DEBUG_BREAK_IF(rank > 7 || scale > 4); // Out of bounds return HPScale[rank][scale]; } @@ -190,7 +190,7 @@ float GetMPScale(uint8 rank, uint8 scale) { - //DSP_DEBUG_BREAK_IF(rank > 7 || scale > 3); // выход за пределы массива + //DSP_DEBUG_BREAK_IF(rank > 7 || scale > 3); // Out of bounds return MPScale[rank][scale]; } @@ -203,7 +203,7 @@ float GetStatScale(uint8 rank, uint8 scale) { - //DSP_DEBUG_BREAK_IF(rank > 7 || scale > 3); // выход за пределы массива + //DSP_DEBUG_BREAK_IF(rank > 7 || scale > 3); // Out of bounds return StatScale[rank][scale]; } Index: src/map/guildutils.cpp =================================================================== --- src/map/guildutils.cpp (revision 3304) +++ src/map/guildutils.cpp (working copy) @@ -29,13 +29,13 @@ #include "item_container.h" #include "map.h" -// TODO: во время закрытия гильдии всем просматривающим список товаров отправляется пакет 0x86 с информацией о закрытии гильдии +// TODO: when you close the guild all watched items list goes 0x86 package with information about the closing of the guild -//#define количество обновляемых предметов при restock (в процентах от максимального количества) +//#Define the number of items updated by restock (as a percentage of the maximum amount) /************************************************************************ * * -* Список гильдий * +* A list of guilds * * * ************************************************************************/ @@ -52,7 +52,7 @@ /************************************************************************ * * -* Инициализация гильдий * +* Initialize the guild * * * ************************************************************************/ @@ -110,7 +110,7 @@ /************************************************************************ * * -* Обновляем запас гильдий * +* Update reserve guilds * * * ************************************************************************/ @@ -123,7 +123,7 @@ { CItemShop* PItem = (CItemShop*)PGuild->GetItem(slotid); - // TODO: сначала, анализируя текущее количество предметов, обновляем их стоимость + // TODO: first, by analyzing the current number of items, update the cost if (PItem->IsDailyIncrease()) { @@ -145,7 +145,7 @@ /************************************************************************ * * -* Получаем указатель на магазин гильдии с указанным ID * +* Get a pointer to store the guild with the specified ID * * * ************************************************************************/ Index: src/map/item_container.cpp =================================================================== --- src/map/item_container.cpp (revision 3304) +++ src/map/item_container.cpp (working copy) @@ -69,7 +69,7 @@ /************************************************************************ * * -* Установка размера контейнера * +* Set the size of the container * * * ************************************************************************/ @@ -81,16 +81,16 @@ uint8 CItemContainer::AddBuff(int8 buff) { m_buff += buff; - return SetSize(dsp_min(m_buff, 80)); // ограничение в 80 ячеек для персонажа + return SetSize(dsp_min(m_buff, 80)); // limit of 80 cells for a character } /************************************************************************ * * -* Установка размера контейнера * +* Set the size of the container * * * ************************************************************************/ -// контейнер не несет ответственности за то, что предметы могут остаться за пределами размера +// Container is not responsible for the fact that things may go beyond the size of uint8 CItemContainer::SetSize(uint8 size) { @@ -108,11 +108,11 @@ /************************************************************************ * * -* Увеличиваем/уменьшаем размер контейнера * +* Increase / decrease the size of the container * * * ************************************************************************/ -// контейнер не несет ответственности за то, что предметы могут остаться за пределами размера +// Container is not responsible for the fact that things may go beyond the size of uint8 CItemContainer::AddSize(int8 size) { @@ -161,7 +161,7 @@ /************************************************************************ * * -* Добавляем предмет в указанную ячейку. NULL удаляет предмет * +* Add the item to the specified cell. NULL removes the item * * * ************************************************************************/ Index: src/map/item_container.h =================================================================== --- src/map/item_container.h (revision 3304) +++ src/map/item_container.h (working copy) @@ -57,22 +57,22 @@ ~CItemContainer(); uint16 GetID(); - uint16 GetBuff(); // планируемый размер хранилища (размер без ограничений) + uint16 GetBuff(); // the planned amount of storage (unlimited size) uint8 GetSize(); - uint8 GetFreeSlotsCount(); // количество свободных ячеек в хранилище - uint8 AddBuff(int8 buff); // планируемый размер хранилища (размер без ограничений) - uint8 AddSize(int8 size); // увеличиваем/уменьшаем размер контейнера + uint8 GetFreeSlotsCount(); // amount of free space in storage + uint8 AddBuff(int8 buff); // the planned amount of storage (unlimited size) + uint8 AddSize(int8 size); // increase / decrease the size of the container uint8 SetSize(uint8 size); - uint8 SearchItem(uint16 ItemID); // поиск предмета в хранилище + uint8 SearchItem(uint16 ItemID); // Find the items in the store uint8 SearchItemWithSpace(uint16 ItemID, uint32 quantity); //search for item that has space to accomodate x items added - uint8 InsertItem(CItem* PItem); // добавляем заранее созданный предмет в свободную ячейку - uint8 InsertItem(CItem* PItem, uint8 slotID); // добавляем заранее созданный предмет в выбранную ячейку + uint8 InsertItem(CItem* PItem); // add a previously created object in free cell + uint8 InsertItem(CItem* PItem, uint8 slotID); // add a previously created object to the selected cell - uint32 SortingPacket; // количество запросов на сортировку за такт - uint32 LastSortingTime; // время последней сортировки контейнера + uint32 SortingPacket; // number of requests for sorting per cycle + uint32 LastSortingTime; // the last sorting container - CItem* GetItem(uint8 slotID); // получаем указатель на предмет, находящийся в указанной ячейка. + CItem* GetItem(uint8 slotID); // get a pointer to the object at the specified cell. private: Index: src/map/itemutils.cpp =================================================================== --- src/map/itemutils.cpp (revision 3304) +++ src/map/itemutils.cpp (working copy) @@ -36,7 +36,7 @@ /************************************************************************ * * -* Собственно методы работы с глобальной коллекцией предметов * +* Own work from a global collection of objects * * * ************************************************************************/ @@ -45,7 +45,7 @@ /************************************************************************ * * - * Создаем пустой экземпляр предмета по ID (private метод) * + * Creates an empty instance of the object by ID (private method) * * * ************************************************************************/ @@ -85,7 +85,7 @@ /************************************************************************ * * - * Создаем новый экземпляр предмета по ID * + * Create a new instance of the object by ID * * * ************************************************************************/ @@ -131,7 +131,7 @@ /************************************************************************ * * - * Создаем копию предмета * + * Make a copy of the subject * * * ************************************************************************/ @@ -176,7 +176,7 @@ /************************************************************************ * * - * Получаем указатель на предмет из коллекции (только для чтения) * + * Get a pointer to the object from the collection (read-only) * * * ************************************************************************/ @@ -208,7 +208,7 @@ /************************************************************************ * * - * Список выпадаемых из монстров предметов * + * The list of objects to fall out of the monsters * * * ************************************************************************/ @@ -240,7 +240,7 @@ /************************************************************************ * * - * Загружаем базу предметов * + * Load the base objects * * * ************************************************************************/ @@ -408,7 +408,7 @@ /************************************************************************ * * - * Загружаем списки предметов, выпадающих из монстров * + * Load the list of items that pop out of monsters * * * ************************************************************************/ @@ -474,7 +474,7 @@ /************************************************************************ * * - * Инициализация системы игровых предметов * + * System Initialization game items * * * ************************************************************************/ @@ -497,7 +497,7 @@ /************************************************************************ * * - * Освобождаем базу предметов (метод только для "галочки") * + * Free the database objects (method only for "show") * * * ************************************************************************/ Index: src/map/itemutils.h =================================================================== --- src/map/itemutils.h (revision 3304) +++ src/map/itemutils.h (working copy) @@ -81,7 +81,7 @@ /************************************************************************ * * -* Пространстов имен дла работы с глобальными списками предметов * +* Space names to Fight with a global list of items * * * ************************************************************************/ Index: src/map/latent_effect.h =================================================================== --- src/map/latent_effect.h (revision 3304) +++ src/map/latent_effect.h (working copy) @@ -35,8 +35,10 @@ LATENT_HP_OVER_TP_UNDER_100 = 3, //hp more than %, tp over 100 - PARAM: HP PERCENT LATENT_HP_OVER_VISIBLE_GEAR = 46, //hp more than or equal to %, calculated using HP bonuses from visible gear only LATENT_MP_UNDER_PERCENT = 4, //mp less than or equal to % - PARAM: MP PERCENT + LATENT_MP_OVER_PERCENT = 12, //mp more than % - PARAM: MP PERCENT LATENT_MP_UNDER = 5, //mp less than # - PARAM: MP # LATENT_MP_UNDER_VISIBLE_GEAR = 45, //mp less than or equal to %, calculated using MP bonuses from visible gear only + LATENT_MP_OVER = 15, //mp greater than # - PARAM: MP # LATENT_TP_UNDER_100 = 6, //tp under 100 and during WS - PARAM: NONE LATENT_TP_OVER_100 = 7, //tp over 100 - PARAM: NONE LATENT_SUBJOB = 8, //subjob - PARAM: JOBTYPE @@ -59,6 +61,7 @@ LATENT_ICEDAY = 34, LATENT_LIGHTNINGSDAY = 35, LATENT_LIGHTSDAY = 36, + LATENT_DARKSDAY = 15, LATENT_MOON_FIRST_QUARTER = 37, LATENT_JOB_MULTIPLE_5 = 38, LATENT_JOB_MULTIPLE_10 = 39, @@ -74,10 +77,10 @@ /************************************************************************ * * -* Нерешенные задачи: * +* Pending problem: * * * -* - сохранение ID сущности, добавившей эффект * -* - обновление эффекта (например перезапись protect 1 на protect 2) * +* - Save ID essence, add effects * +* - Update effect (eg overwrite protect 1 to protect 2) * * * ************************************************************************/ Index: src/map/latent_effect_container.cpp =================================================================== --- src/map/latent_effect_container.cpp (revision 3304) +++ src/map/latent_effect_container.cpp (working copy) @@ -254,6 +254,16 @@ { switch(m_LatentEffectList.at(i)->GetConditionsID()) { + case LATENT_MP_OVER_PERCENT: + if (((float)mp / m_POwner->health.maxmp ) >= m_LatentEffectList.at(i)->GetConditionsValue()) + { + m_LatentEffectList.at(i)->Activate(); + } + else + { + m_LatentEffectList.at(i)->Deactivate(); + } + break; case LATENT_MP_UNDER_PERCENT: if ((float)(mp / m_POwner->health.maxmp ) <= m_LatentEffectList.at(i)->GetConditionsValue()) { @@ -274,6 +284,16 @@ m_LatentEffectList.at(i)->Deactivate(); } break; + case LATENT_MP_OVER: + if (mp >= m_LatentEffectList.at(i)->GetConditionsValue()) + { + m_LatentEffectList.at(i)->Activate(); + } + else + { + m_LatentEffectList.at(i)->Deactivate(); + } + break; //case LATENT_MP_UNDER_VISIBLE_GEAR: // { // //TODO: figure out if this is actually right Index: src/map/linkshell.cpp =================================================================== --- src/map/linkshell.cpp (revision 3304) +++ src/map/linkshell.cpp (working copy) @@ -42,7 +42,7 @@ /************************************************************************ * * -* Реализация класса CLinkshell * +* Implementation class CLinkshell * * * ************************************************************************/ @@ -111,7 +111,7 @@ /************************************************************************ * * -* Добавляем персонажа в список активных участников Linkshells * +* Add the character to the list of active participants Linkshells * * * ************************************************************************/ @@ -124,7 +124,7 @@ /************************************************************************ * * -* Удаляем персонажа из списка активных участников Linkshells * +* Delete a character from a list of active participants Linkshells * * * ************************************************************************/ @@ -200,7 +200,7 @@ /************************************************************************ * * -* Удаление персонажа из Linkshell по имени (ломаем все его Linkshells) * +* Removing a character from Linkshell by name (break his Linkshells) * * * ************************************************************************/ @@ -260,7 +260,7 @@ /************************************************************************ * * -* Отправляем пакет всем членам Linkshells, за исключением PChar * +* Send the package to all members Linkshells, except PChar * * * ************************************************************************/ @@ -280,7 +280,7 @@ /************************************************************************ * * -* Реализация namespase для работы с Linkshells * +* Implementing namespase to work with Linkshells * * * ************************************************************************/ @@ -292,7 +292,7 @@ /************************************************************************ * * - * Загружаем список зарегистрированных Linkshells * + * Load the list of registered Linkshells * * * ************************************************************************/ @@ -319,7 +319,7 @@ /************************************************************************ * * - * Добавляем персонажа в список Linkshell * + * Add character to your Linkshell * * * ************************************************************************/ @@ -340,7 +340,7 @@ /************************************************************************ * * - * Удаляем персонажа из списка Lilkshell * + * Remove the character from the list Lilkshell * * * ************************************************************************/ @@ -362,7 +362,7 @@ /************************************************************************ * * - * Проверяем строку на возможность использования в качестве имени LS * + * Check string could be used as the name of LS * * * ************************************************************************/ @@ -377,7 +377,7 @@ /************************************************************************ * * - * Регистрируем новую linkshell * + * Register a new linkshell * * * ************************************************************************/ Index: src/map/linkshell.h =================================================================== --- src/map/linkshell.h (revision 3304) +++ src/map/linkshell.h (working copy) @@ -67,7 +67,7 @@ void PushPacket(CCharEntity* PChar, CBasicPacket* packet); - std::vector members; // список участников linkshell + std::vector members; // list of participants linkshell private: @@ -82,7 +82,7 @@ /************************************************************************ * * -* namespase для работы с Linkshells * +* Namespase to work with Linkshells * * * ************************************************************************/ Index: src/map/lua/lua_baseentity.cpp =================================================================== --- src/map/lua/lua_baseentity.cpp (revision 3304) +++ src/map/lua/lua_baseentity.cpp (working copy) @@ -45,6 +45,7 @@ #include "../packets/char_stats.h" #include "../packets/char_sync.h" #include "../packets/char_update.h" +#include "../packets/chat_message.h" #include "../packets/send_box.h" #include "../packets/entity_update.h" #include "../packets/event.h" @@ -453,6 +454,19 @@ //======================================================// +inline int32 CLuaBaseEntity::updateHealth(lua_State *L) +{ + DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL); + DSP_DEBUG_BREAK_IF(m_PBaseEntity->objtype == TYPE_NPC); + + if(m_PBaseEntity->objtype == TYPE_PC && m_PBaseEntity->status != STATUS_DISAPPEAR) + { + charutils::UpdateHealth((CCharEntity*)m_PBaseEntity); + } + return 0; +} + +//======================================================// inline int32 CLuaBaseEntity::getMaxHP(lua_State *L) { DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL); @@ -516,7 +530,7 @@ /************************************************************************ * * -* Мгновенное перемещение сущности * +* Essentially instantaneous movement * * * ************************************************************************/ @@ -786,7 +800,7 @@ /************************************************************************ * * -* Получаем имя зоны, в которой находится персонаж * +* Get the name of the area in which the character is * * * ************************************************************************/ @@ -821,7 +835,7 @@ /************************************************************************ * * -* Узнаем континент, на котором находится сущность * +* Know the continent on which the entity * * * ************************************************************************/ @@ -835,7 +849,7 @@ /************************************************************************ * * -* Проверяем, посещалась ли указанная зона персонажем ранее * +* Check whether a specific area visited earlier character * * * ************************************************************************/ @@ -1002,9 +1016,9 @@ CCharEntity * PChar = (CCharEntity*)m_PBaseEntity; uint16 rank = 1; - rank = PChar->profile.rank[PChar->profile.nation]; - lua_pushinteger( L, rank); - return 1; + rank = PChar->profile.rank[PChar->profile.nation]; + lua_pushinteger( L, rank); + return 1; } } lua_pushnil(L); @@ -1172,7 +1186,7 @@ /************************************************************************ * * -* Проверяем, завершил ли персонаж задачу (quest) * +* Check whether the person has completed the task (quest) * * * ************************************************************************/ @@ -1201,7 +1215,7 @@ /************************************************************************ * * -* Добавляем выбранную миссию * +* Adds the selected mission * * * ************************************************************************/ @@ -1239,7 +1253,7 @@ /************************************************************************ * * -* Удаляем выбранную миссию * +* Removes the selected mission * * * ************************************************************************/ @@ -1282,7 +1296,7 @@ /************************************************************************ * * -* Проверяем, завершил ли персонаж выбранную миссию * +* Check whether the person has completed the selected mission * * * ************************************************************************/ @@ -1313,7 +1327,7 @@ /************************************************************************ * * -* Узнаем текущую миссию * +* View the current mission * * * ************************************************************************/ @@ -1341,7 +1355,7 @@ /************************************************************************ * * -* Завершаем выбранную миссию * +* Finish the selected mission * * * ************************************************************************/ @@ -1449,7 +1463,7 @@ /************************************************************************ * * -* Проверяем, было ли описание ключевого предмета прочитано * +* Test whether a key item description was read * * * ************************************************************************/ @@ -1496,7 +1510,7 @@ /************************************************************************ * * -* получить текущий уровень мастерства * +* Get the current level of skill * * * ************************************************************************/ @@ -1543,7 +1557,7 @@ /************************************************************************ * * -* Добавляем персонажу заклинание с отображением сообщения * +* Add character to a spell with a displayed message * * * ************************************************************************/ @@ -1597,7 +1611,7 @@ /************************************************************************ * * -* Проверяем у персонажа наличие заклинания в списке заклинаний * +* Check the availability of a character spells in the spellbook * * * ************************************************************************/ @@ -1820,7 +1834,7 @@ /************************************************************************ * * -* Делаем доступной персонажу указанную профессию. 0 - subjob * +* Make available characters specified profession. 0 - subjob * * * ************************************************************************/ @@ -1850,7 +1864,7 @@ /************************************************************************ * * -* Изменяем ограничение максимального уровня персонажа (genkai) * +* Change the limit on the maximum level of character (genkai) * * * ************************************************************************/ @@ -1879,11 +1893,11 @@ /************************************************************************ * * -* Устанавливаем/узнаем временное ограничение уровня. Параметр функции * -* является новый ограничением уровня, 0 - отмена ограничения уровня. * -* Функция всегда возвращается значение текущего/нового ограниченя. * +* Set / learn time limit level. function parameter * +* is a new restriction level, 0 - cancellation level constraints. * +* The function always returns the current / new constraint. * * * -* Нужно будет вынести код установки уровня в отдельную функцию * +* It will be necessary to make the install code level in a function * * * ************************************************************************/ @@ -2010,7 +2024,7 @@ /************************************************************************ * * -* Запускаем событие с указанными параметрами * +* Start the event with the specified parameters * * * ************************************************************************/ @@ -2147,7 +2161,7 @@ /************************************************************************ * * -* Получаем указатель на персонажа, начавшего событие * +* Get a pointer to the character that started the event * * * ************************************************************************/ @@ -2189,7 +2203,7 @@ /************************************************************************ * * -* Отображаем статичный текст от лица NPC * +* Display static text on behalf of the NPC * * * ************************************************************************/ @@ -2282,7 +2296,7 @@ /************************************************************************ * * -* Отправляем персонажу меню магазина гильдии * +* Send the character to store menu Guild * * * ************************************************************************/ @@ -2329,7 +2343,7 @@ /************************************************************************ * * -* Получаем временные переменные, необходимые для логики поисков * +* Obtain temporary variables needed to search logic * * * ************************************************************************/ @@ -2360,7 +2374,7 @@ /************************************************************************ * * -* Сохраняем временные переменные, необходимые для логики поисков * +* Save the temporary variables needed to search logic * * * ************************************************************************/ @@ -2391,7 +2405,7 @@ /************************************************************************ * * -* Увеличиваем/уменьшаем значение временной переменной * +* Increase / decrease the value of the time variable * * * ************************************************************************/ @@ -2649,7 +2663,7 @@ /************************************************************************ * * -* Добавляем персонажу новое звание * +* Add character to a new rank * * * ************************************************************************/ @@ -2674,7 +2688,7 @@ /************************************************************************ * * -* Удаляем у персонажа звание (DEBUG ONLY) * +* Delete the character title (DEBUG ONLY) * * * ************************************************************************/ @@ -2879,7 +2893,7 @@ /************************************************************************ * * -* Отправляем базовое сообщение персонажу * +* Send a basic message character * * * ************************************************************************/ @@ -3119,7 +3133,7 @@ /************************************************************************ * * -* Узнаем текущее значение известности персонажа * +* Find out the current value of the known character * * * ************************************************************************/ @@ -3158,7 +3172,7 @@ /************************************************************************ * * -* Узнаем текущий уровень известности персонажа * +* Know the current level of well-known characters * * * ************************************************************************/ @@ -3195,7 +3209,7 @@ /************************************************************************ * * -* Устанавливаем известность персонажу * +* Known character set * * * ************************************************************************/ @@ -3235,7 +3249,7 @@ /************************************************************************ * * -* Добавляем известность персонажу * +* Add the well-known character * * * ************************************************************************/ @@ -3313,7 +3327,7 @@ /************************************************************************ * * -* Получаем/устанавливаем скорость передвижения сущности * +* Set / get the essence of speed * * * ************************************************************************/ @@ -3344,7 +3358,7 @@ /************************************************************************ * * -* Получаем/устанавливаем значение дополнительной анимации * +* Set / get the value of additional animation * * * ************************************************************************/ @@ -3375,7 +3389,7 @@ /************************************************************************ * * -* Получаем/устанавливаем костюм персонажу * +* Set / get character costumes * * * ************************************************************************/ @@ -3406,7 +3420,7 @@ /************************************************************************ * * -* Проверяем, может ли персонаж использовать костюм * +* Check whether a character costume to use * * * ************************************************************************/ @@ -3426,7 +3440,7 @@ /************************************************************************ * * -* Проверяем, может ли персонаж использовать chocobo * +* Check whether a character use chocobo * * * ************************************************************************/ @@ -3463,7 +3477,7 @@ /************************************************************************ * * -* Разрещение атаковать этого персонажа другим персонажам * +* Permission to attack the character to other characters * * * ************************************************************************/ @@ -3513,7 +3527,7 @@ /************************************************************************ * * -* Отправляем персонажу Raise меню * +* Send the character menu Raise * * * ************************************************************************/ inline int32 CLuaBaseEntity::sendReraise(lua_State *L) @@ -3563,7 +3577,7 @@ /************************************************************************ * * -* Добавляем боевой сущности StatusEffect * +* Add the essence of combat StatusEffect * * * ************************************************************************/ @@ -3596,7 +3610,7 @@ /************************************************************************ * * -* Добавляем боевой сущности StatusEffect * +* Add the essence of combat StatusEffect * * * ************************************************************************/ @@ -3760,7 +3774,7 @@ /************************************************************************ * * -* Получаем указатель на эффект по имени * +* Get a pointer to the effect named * * * ************************************************************************/ @@ -3801,7 +3815,7 @@ /************************************************************************ * * -* Проверяем наличие статус-эффекта в контейнере * +* Check the presence of the status effect in the container * * * ************************************************************************/ @@ -3862,8 +3876,8 @@ /************************************************************************ * * -* Удаляем статус-эффект по его основному и дополнительному типам. * -* Возвращаем результат выполнения операции. * +* Remove the status effect on its main and additional types. * +* Return the result of the operation. * * * ************************************************************************/ @@ -4016,7 +4030,7 @@ /************************************************************************ * * -* Удаляем первый отрицательный эффект * +* Remove the first negative effect * * * ************************************************************************/ @@ -4108,7 +4122,7 @@ /************************************************************************ * * -* Удаляем первый положительный эффект * +* Remove the first positive effect * * * ************************************************************************/ @@ -4184,7 +4198,7 @@ /************************************************************************ * * -* Добавляем очки опыта персонажу * +* Add experience points the character * * * ************************************************************************/ @@ -4432,7 +4446,7 @@ /************************************************************************ * * -* Устанавливаем персонажу указанный флаг * +* Character set specified flag * * * ************************************************************************/ @@ -4450,7 +4464,7 @@ /************************************************************************ * * -* Устанавливаем/запрашиваем флаг выхода из MogHouse * +* Set / Query the flag out of the MogHouse * * * ************************************************************************/ @@ -4586,7 +4600,7 @@ /************************************************************************ * * -* блокируем ячейку экипировки * +* block cell equipment * * * ************************************************************************/ @@ -4616,7 +4630,7 @@ /************************************************************************ * * -* Cнимаем блокировку с ячейки экипировки * +* Unlocks the cell equipment * * * ************************************************************************/ @@ -4724,7 +4738,7 @@ /************************************************************************ * * -* Сущность призывает питомца * +* Essence encourages pet * * * ************************************************************************/ @@ -4814,7 +4828,7 @@ /************************************************************************ * * -* Сущность освобождает питомца * +* The essence of free pet * * * ************************************************************************/ @@ -4834,7 +4848,7 @@ /************************************************************************ * * -* Обновляем ненависть монстров к указанной цели * +* Updating hate monsters to that purpose * * * ************************************************************************/ @@ -4980,7 +4994,7 @@ { DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL); DSP_DEBUG_BREAK_IF(lua_isnil(L,1) || !lua_isnumber(L,1)); - DSP_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_MOB); + DSP_DEBUG_BREAK_IF(m_PBaseEntity->objtype == TYPE_MOB); CMobEntity* PMob = (CMobEntity*)m_PBaseEntity; @@ -5068,9 +5082,9 @@ /************************************************************************ * * -* Проверяем, покидал ли персонаж зону после поднятия флага * -* необходимости ее покинуть. С параметром устанавливаем флаг, без * -* параметра узнаем результат. * +* Check if the character left the area after the flag-raising * +* The need to leave. With a parameter set the flag without * +* Parameter to know the results. * * * ************************************************************************/ @@ -5496,6 +5510,28 @@ } /*************************************************************** + Resets the caller's ability recast time for the specified RecastID + INPUT: + The RecastID of the ability to make available +****************************************************************/ +inline int32 CLuaBaseEntity::resetAbilityRecast(lua_State *L) +{ + DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL); + DSP_DEBUG_BREAK_IF(lua_isnil(L,-1) || !lua_isnumber(L,-1)); + + // Only reset for players + if(m_PBaseEntity->objtype == TYPE_PC){ + CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; + + PChar->PRecastContainer->Del(RECAST_ABILITY, lua_tointeger(L,-1)); + + PChar->pushPacket(new CCharSkillsPacket(PChar)); + } + return 0; +} + + +/*************************************************************** Attempts to register a BCNM or Dynamis instance. INPUT: The BCNM ID to register. OUTPUT: The instance number assigned, or -1 if it's all full. @@ -5767,7 +5803,7 @@ /************************************************************************ * * -* Открываем дверь и автоматически закрываем через 7 секунд * +* Open the door and close automatically after 7 seconds * * * ************************************************************************/ @@ -6669,6 +6705,133 @@ lua_pushnil(L); return 1; } + +inline int32 CLuaBaseEntity::GotoMob(lua_State* L) +{ + CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; + if(m_PBaseEntity == NULL) + { + + ShowNotice(CL_RED"TRACER:COMMAND: spawnmob Error\n" CL_RESET); + return false; + } + if(m_PBaseEntity->objtype != TYPE_PC) + { + + ShowNotice(CL_RED"TRACER:COMMAND: spawnmob Error1\n" CL_RESET); + return false; + } + if(lua_isnil(L,-1) || !lua_isnumber(L,-1)) + { + PChar->pushPacket(new CChatMessagePacket(PChar, MESSAGE_TELL, "Command Error1")); + PChar->pushPacket(new CChatMessagePacket(PChar, MESSAGE_TELL, "Command Example: .spawnmob 1")); + ShowNotice(CL_RED"TRACER:COMMAND: spawnmob Error2\n" CL_RESET); + return false; + } + uint32 mobid = (uint32)lua_tointeger(L,1); + uint32 groupid =0; + float pos_x =0; + float pos_y =0; + float pos_z =0; + uint32 pos_rot =0; + uint32 zoneid = 0; + CMobEntity* PMob = (CMobEntity*)zoneutils::GetEntity(mobid, TYPE_MOB); + if (PMob != NULL) + { + //BE FUN TO ADD A APPEAR TO MOB AT LOCATION ALSO + const int8* Query = "SELECT groupid,pos_x,pos_y,pos_z,pos_rot FROM mob_spawn_points WHERE mobid = '%u';"; + int32 ret = Sql_Query(SqlHandle,Query,mobid); + if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0 && Sql_NextRow(SqlHandle) == SQL_SUCCESS) + { + PMob->PBattleAI->SetCurrentAction(ACTION_SPAWN); + ShowNotice(CL_RED"TRACER:COMMAND: Player %s Is Appearing To Mob ID %u\n" CL_RESET ,PChar->GetName(),mobid); + groupid = Sql_GetUIntData(SqlHandle,0); + ShowNotice(CL_RED"TRACER:COMMAND: GET GROUP ID %u\n" CL_RESET ,groupid); + pos_x = Sql_GetFloatData(SqlHandle,1); + ShowNotice(CL_RED"TRACER:COMMAND: GET POS_X ID %f\n" CL_RESET ,pos_x); + pos_y = Sql_GetFloatData(SqlHandle,2); + ShowNotice(CL_RED"TRACER:COMMAND: GET POS_Y ID %f\n" CL_RESET ,pos_y); + pos_z = Sql_GetFloatData(SqlHandle,3); + ShowNotice(CL_RED"TRACER:COMMAND: GET POS_Z ID %f\n" CL_RESET ,pos_z); + pos_rot = Sql_GetUIntData(SqlHandle,4); + ShowNotice(CL_RED"TRACER:COMMAND: GET POS_ROT ID %u\n" CL_RESET ,pos_rot); + PChar->status = STATUS_DISAPPEAR; + PChar->loc.p.x=pos_x; + PChar->loc.p.y=pos_y; + PChar->loc.p.z=pos_z; + PChar->loc.p.rotation=pos_rot; + PChar->loc.boundary = 0; + const int8* Query = "SELECT zoneid FROM mob_groups WHERE groupid = '%u';"; + int32 ret = Sql_Query(SqlHandle,Query,groupid); + if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0 && Sql_NextRow(SqlHandle) == SQL_SUCCESS) + { + zoneid = Sql_GetUIntData(SqlHandle,0); + ShowNotice(CL_RED"TRACER:COMMAND: GET ZONE ID %u\n" CL_RESET ,zoneid); + PChar->loc.destination=zoneid ; + PChar->clearPacketList(); + PChar->pushPacket(new CServerIPPacket(PChar,2)); + PChar->pushPacket(new CCharUpdatePacket(PChar)); + PChar->loc.zone->PushPacket(PChar, CHAR_INRANGE, new CEntityUpdatePacket(PChar, ENTITY_SPAWN)); + return false; + } + lua_pushnil(L); + return false; + } + lua_pushnil(L); + return false; + } + lua_pushnil(L); + return false; +} + +inline int32 CLuaBaseEntity::Kill_Target(lua_State *L) +{ + CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; + if(m_PBaseEntity == NULL) + { + //PChar->pushPacket(new CChatMessagePacket(PChar, MESSAGE_TELL, "setPos Error")); + ShowNotice(CL_RED"TRACER:COMMAND: killtarget Error\n" CL_RESET); + return false; + } + + if(m_PBaseEntity->objtype != TYPE_PC) + { + //PChar->pushPacket(new CChatMessagePacket(PChar, MESSAGE_TELL, "getRace Error1")); + ShowNotice(CL_RED"TRACER:COMMAND: killtarget Error1\n" CL_RESET); + return false; + } + + if(PChar->loc.zone->GetEntity(PChar->m_TargID, TYPE_PC)) + { + CCharEntity* PCharTarget = (CCharEntity*)PChar->loc.zone->GetEntity(PChar->m_TargID, TYPE_PC); + PCharTarget->PBattleAI->SetCurrentAction(ACTION_FALL); + PCharTarget->nameflags.flags = 0; + PCharTarget->health.hp=0; + charutils::UpdateHealth(PCharTarget); + PCharTarget->animation = ANIMATION_DEATH; + PCharTarget->isDead(); + PCharTarget->pushPacket(new CCharUpdatePacket(PCharTarget)); + return false; + } + if(PChar->loc.zone->GetEntity(PChar->m_TargID, TYPE_MOB)) + { + CMobEntity * PMob = (CMobEntity*)PChar->loc.zone->GetEntity(PChar->m_TargID, TYPE_MOB); + PMob->health.hp=0; + PMob->PBattleAI->SetCurrentAction(ACTION_FALL); + PMob->animation = ANIMATION_DEATH; + PMob->isDead(); + PMob->loc.zone->PushPacket(PMob, CHAR_INRANGE, new CEntityUpdatePacket(PMob,ENTITY_UPDATE)); + PChar->pushPacket(new CCharUpdatePacket(PChar)); + return false; + } + + PChar->pushPacket(new CChatMessagePacket(PChar, MESSAGE_TELL, "kill Error1")); + PChar->pushPacket(new CChatMessagePacket(PChar, MESSAGE_TELL, "Command Example .kill")); + PChar->pushPacket(new CChatMessagePacket(PChar, MESSAGE_TELL, "Note: Mob Or Player Target Must Be Selected")); + ShowNotice(CL_RED"TRACER:COMMAND: killtarget\n" CL_RESET); + return false; +} + //==========================================================// const int8 CLuaBaseEntity::className[] = "CBaseEntity"; @@ -6694,6 +6857,7 @@ LUNAR_DECLARE_METHOD(CLuaBaseEntity,addTP), LUNAR_DECLARE_METHOD(CLuaBaseEntity,delTP), LUNAR_DECLARE_METHOD(CLuaBaseEntity,setTP), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,updateHealth), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getStat), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getMaxHP), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getMaxMP), @@ -6884,6 +7048,7 @@ LUNAR_DECLARE_METHOD(CLuaBaseEntity,addAllSpells), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getMeleeHitDamage), LUNAR_DECLARE_METHOD(CLuaBaseEntity,resetRecasts), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,resetAbilityRecast), LUNAR_DECLARE_METHOD(CLuaBaseEntity,bcnmRegister), LUNAR_DECLARE_METHOD(CLuaBaseEntity,bcnmEnter), LUNAR_DECLARE_METHOD(CLuaBaseEntity,bcnmLeave), @@ -6947,5 +7112,7 @@ LUNAR_DECLARE_METHOD(CLuaBaseEntity,setBattleSubTarget), LUNAR_DECLARE_METHOD(CLuaBaseEntity,hasTPMoves), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getMaster), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,GotoMob), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,Kill_Target), {NULL,NULL} }; \ No newline at end of file Index: src/map/lua/lua_baseentity.h =================================================================== --- src/map/lua/lua_baseentity.h (revision 3304) +++ src/map/lua/lua_baseentity.h (working copy) @@ -109,9 +109,10 @@ int32 addTP(lua_State*); // Modify tp of Entity +/- int32 delTP(lua_State*); // Subtract tp of Entity int32 setTP(lua_State*); // Set tp of Entity to value - int32 getRangedDmg(lua_State*); // Get ranged weapon DMG rating - int32 getRangedDmgForRank(lua_State*); // Get ranged weapond DMG rating used for calculating rank - int32 getAmmoDmg(lua_State*); // Get ammo DMG rating + int32 updateHealth(lua_State*); // Used to ensure the player stats are updated in real time + int32 getRangedDmg(lua_State*); // Get ranged weapon DMG rating + int32 getRangedDmgForRank(lua_State*); // Get ranged weapond DMG rating used for calculating rank + int32 getAmmoDmg(lua_State*); // Get ammo DMG rating int32 getRATT(lua_State*); // Get total r.attack int32 getRACC(lua_State*); // Get total r.acc int32 getACC(lua_State*); // Get total ACC @@ -186,10 +187,10 @@ int32 canLearnSpell(lua_State*); // Check to see if character can learn spell, 0 if so int32 delSpell(lua_State*); // Remove spell from Entity spell list - int32 addLearnedAbility(lua_State*); // Add spell to Entity spell list - int32 hasLearnedAbility(lua_State*); // Check to see if character has item in spell list + int32 addLearnedAbility(lua_State*); // Add spell to Entity spell list + int32 hasLearnedAbility(lua_State*); // Check to see if character has item in spell list int32 canLearnAbility(lua_State*); // Check to see if character can learn spell, 0 if so - int32 delLearnedAbility(lua_State*); // Remove spell from Entity spell list + int32 delLearnedAbility(lua_State*); // Remove spell from Entity spell list int32 addWeaponSkill(lua_State*); // int32 delWeaponSkill(lua_State*); // @@ -368,6 +369,7 @@ int32 openDoor(lua_State*); // открываем дверь int32 hideNPC(lua_State*); // hide an NPC int32 resetRecasts(lua_State*); // Reset recasts for the caller + int32 resetAbilityRecast(lua_State*); // Resets the caller's ability recast time for the specified RecastID int32 addCP(lua_State*); // Add CP int32 getCP(lua_State*); // Get CP @@ -415,6 +417,9 @@ int32 setBattleSubTarget(lua_State*); int32 hasTPMoves(lua_State*); int32 getMaster(lua_State*); + + int32 GotoMob(lua_State*); + int32 Kill_Target(lua_State*); }; #endif Index: src/map/lua/lua_spell.cpp =================================================================== --- src/map/lua/lua_spell.cpp (revision 3304) +++ src/map/lua/lua_spell.cpp (working copy) @@ -28,7 +28,7 @@ /************************************************************************ * * -* Конструктор * +* Designer * * * ************************************************************************/ @@ -45,7 +45,7 @@ /************************************************************************ * * -* Конструктор * +* Designer * * * ************************************************************************/ @@ -56,7 +56,7 @@ /************************************************************************ * * -* Устанавливаем сообщение заклинания * +* Set the message spells * * * ************************************************************************/ @@ -118,9 +118,16 @@ return 1; } +inline int32 CLuaSpell::getSkillType(lua_State *L) +{ + DSP_DEBUG_BREAK_IF(m_PLuaSpell == NULL); + lua_pushinteger(L,m_PLuaSpell->getSkillType()); + return 1; +} + /************************************************************************ * * -* Инициализация методов в lua * +* Initialization methods in lua * * * ************************************************************************/ @@ -134,5 +141,6 @@ LUNAR_DECLARE_METHOD(CLuaSpell,getElement), LUNAR_DECLARE_METHOD(CLuaSpell,getTotalTargets), LUNAR_DECLARE_METHOD(CLuaSpell, getID), + LUNAR_DECLARE_METHOD(CLuaSpell, getSkillType), {NULL,NULL} }; \ No newline at end of file Index: src/map/lua/lua_spell.h =================================================================== --- src/map/lua/lua_spell.h (revision 3304) +++ src/map/lua/lua_spell.h (working copy) @@ -54,6 +54,7 @@ int32 getMagicBurstMessage(lua_State*); int32 getElement(lua_State*); int32 getID(lua_State*); + int32 getSkillType(lua_State*); }; #endif \ No newline at end of file Index: src/map/lua/luautils.cpp =================================================================== --- src/map/lua/luautils.cpp (revision 3304) +++ src/map/lua/luautils.cpp (working copy) @@ -56,9 +56,10 @@ #include "../packets/char_sync.h" #include "../packets/char_update.h" #include "../packets/char.h" +#include "../packets/chat_message.h" #include "../packets/menu_raisetractor.h" #include "../packets/message_basic.h" -#include "../packets/uncnown_39.h" +#include "../packets/unknown_39.h" namespace luautils { @@ -98,17 +99,19 @@ lua_register(LuaHandle,"VanadielMoonPhase",luautils::VanadielMoonPhase); lua_register(LuaHandle,"VanadielMoonDirection", luautils::VanadielMoonDirection); lua_register(LuaHandle,"SetVanadielTimeOffset",luautils::SetVanadielTimeOffset); + lua_register(LuaHandle,"IsMoonNew",luautils::IsMoonNew); lua_register(LuaHandle,"IsMoonFull",luautils::IsMoonFull); lua_register(LuaHandle,"RunElevator",luautils::StartElevator); lua_register(LuaHandle,"GetServerVariable",luautils::GetServerVariable); lua_register(LuaHandle,"SetServerVariable",luautils::SetServerVariable); - lua_register(LuaHandle,"SendUncnown0x39Packet",luautils::SendUncnown0x39Packet); + lua_register(LuaHandle,"SendUnknown0x39Packet",luautils::SendUnknown0x39Packet); lua_register(LuaHandle,"GetMobRespawnTime",luautils::GetMobRespawnTime); lua_register(LuaHandle,"DeterMob",luautils::DeterMob); lua_register(LuaHandle,"UpdateNMSpawnPoint",luautils::UpdateNMSpawnPoint); lua_register(LuaHandle,"getCorsairRollEffect",luautils::getCorsairRollEffect); + lua_register(LuaHandle,"SendMobMessage",luautils::SendMobMessage); Lunar::Register(LuaHandle); Lunar::Register(LuaHandle); @@ -159,7 +162,7 @@ * * ************************************************************************/ -int32 SendUncnown0x39Packet(lua_State* L) +int32 SendUnknown0x39Packet(lua_State* L) { if((!lua_isnil(L,1) && lua_isnumber(L,1)) && (!lua_isnil(L,2) && lua_isnumber(L,2)) ) @@ -171,7 +174,7 @@ if (PNpc != NULL) { - PNpc->loc.zone->PushPacket(PNpc, CHAR_INRANGE, new CUncnown0x39Packet(PNpc, param)); + PNpc->loc.zone->PushPacket(PNpc, CHAR_INRANGE, new CUnknown0x39Packet(PNpc, param)); } return 0; } @@ -431,8 +434,44 @@ return 1; } + /************************************************************************ * * +* is new moon? * +* * +************************************************************************/ + +int32 IsMoonNew(lua_State* L) +{ + // New moon occurs when: + // Waning (decreasing) from 10% to 0%, + // Waxing (increasing) from 0% to 5%. + + uint8 phase = CVanaTime::getInstance()->getMoonPhase(); + + switch (CVanaTime::getInstance()->getMoonDirection()) + { + case 0: // None + lua_pushboolean(L, false); + return 0; + + case 1: // Waning (decending) + if (phase <= 10 && phase >= 0) { + lua_pushboolean(L, true); + return 1; + } + + case 2: // Waxing (increasing) + if (phase >= 0 && phase <= 5) { + lua_pushboolean(L, true); + return 1; + } + } + lua_pushboolean(L, false); + return 0; +} +/************************************************************************ +* * * Return Moon Phase * * * ************************************************************************/ @@ -584,6 +623,7 @@ if(!lua_isnil(L,2) && lua_isnumber(L,2)) { PMob->SetDespawnTimer((uint32)lua_tointeger(L,2)); + PMob->m_ForceDespawn = false; } else { @@ -632,8 +672,8 @@ { ShowDebug(CL_CYAN"setMobPos: <%s> is currently in battle, will not warp it!\n" CL_RESET, PMob->GetName()); return 1; - } } + } lua_pushnil(L); return 0; } @@ -697,6 +737,31 @@ return 1; } +int32 SendMobMessage(lua_State* L) +{ + uint32 mobid = (uint32)lua_tointeger(L,1); + uint32 CharID = (uint32)lua_tointeger(L,2); + CBaseEntity* PNPC = (CBaseEntity*)zoneutils::GetEntity(mobid, TYPE_MOB | TYPE_NPC); + if (PNPC != NULL) + { + const int8* Query = "SELECT targid, pos_zone FROM chars INNER JOIN accounts_sessions USING(charid) WHERE charid = %u LIMIT 1"; + int32 ret = Sql_Query(SqlHandle, Query, CharID); + if (ret != SQL_ERROR && + Sql_NumRows(SqlHandle) != 0 && + Sql_NextRow(SqlHandle) == SQL_SUCCESS) + { + uint16 TargID = (uint16)Sql_GetUIntData(SqlHandle,0); + uint8 ZoneID = (uint8) Sql_GetUIntData(SqlHandle,1); + CCharEntity* PTellRecipient = (CCharEntity*)zoneutils::GetZone(ZoneID)->GetEntity(TargID, TYPE_PC); + int8* data = (int8*)lua_tolstring(L,3,NULL); + int8* name = (int8*)PNPC->GetSayName(); + uint8 size = (uint8)PNPC->name.size(); + PTellRecipient->pushPacket(new CNPCMessagePacket(name,ZoneID,data,size)); + } + } + return 1; +} + /************************************************************************ * * * Загружаем значение переменной TextID указанной зоны * @@ -778,7 +843,7 @@ * * ************************************************************************/ -int32 OnZoneInitialise(uint8 ZoneID) +int32 OnZoneInitialize(uint8 ZoneID) { CZone* PZone = zoneutils::GetZone(ZoneID); @@ -1098,7 +1163,7 @@ ShowError("luautils::OnEventUpdate: %s\n", lua_tostring(LuaHandle, -1)); lua_pop(LuaHandle, 1); return -1; - } + } return (!lua_isnil(LuaHandle,-1) && lua_isnumber(LuaHandle,-1) ? (int32)lua_tonumber(LuaHandle,-1) : 0); } @@ -1121,8 +1186,8 @@ if( luaL_loadfile(LuaHandle,File) || lua_pcall(LuaHandle,0,0,0) ) { - ShowError("luautils::OnEventFinish %s\n", lua_tostring(LuaHandle, -1)); - lua_pop(LuaHandle, 1); + ShowError("luautils::OnEventFinish %s\n", lua_tostring(LuaHandle, -1)); + lua_pop(LuaHandle, 1); return -1; } } @@ -1495,7 +1560,7 @@ EFFECT effectId = (EFFECT)battleutils::SingSong(PCaster,PTarget,PCaster->PBattleAI->GetCurrentSpell()); if(effectId != EFFECT_NONE){ return effectId; - } + } } int8 File[255]; memset(File,0,sizeof(File)); Index: src/map/lua/luautils.h =================================================================== --- src/map/lua/luautils.h (revision 3304) +++ src/map/lua/luautils.h (working copy) @@ -51,7 +51,7 @@ int32 free(); int32 print(lua_State*); - int32 SendUncnown0x39Packet(lua_State*); // временное решение для работы гейзеров в Dangruf_Wadi + int32 SendUnknown0x39Packet(lua_State*); // временное решение для работы гейзеров в Dangruf_Wadi int32 GetNPCByID(lua_State*); // Returns NPC By Id int32 GetMobByID(lua_State*); // Returns Mob By Id @@ -65,6 +65,7 @@ int32 SpawnMob(lua_State*); // Spawn Mob By Mob Id - NMs, BCNM... int32 DespawnMob(lua_State*); // Despawn (Fade Out) Mob By Id + int32 SpawnNPC(lua_State*); // Spawn Mob By NPC Id - NMs, BCNM... int32 GetPlayerByName(lua_State*); // Gets Player ref from a name supplied int32 GetMobAction(lua_State*); // Get Mobs current action int32 VanadielTOTD(lua_State*); // текущее игровое время суток @@ -78,6 +79,7 @@ int32 VanadielMoonPhase(lua_State*); // Gets the current Vanadiel Moon Phase int32 VanadielMoonDirection(lua_State* L); // Gets the current Vanadiel Moon Phasing direction (waxing, waning, neither) int32 SetVanadielTimeOffset(lua_State* L); + int32 IsMoonNew(lua_State* L); // Returns true if the moon is new int32 IsMoonFull(lua_State* L); // Returns true if the moon is full int32 StartElevator(lua_State*); int32 GetServerVariable(lua_State*); @@ -91,7 +93,7 @@ int32 OnGameIn(CCharEntity* PChar); // int32 OnZoneIn(CCharEntity* PChar); // triggers when a player zones into a zone - int32 OnZoneInitialise(uint8 ZoneID); // triggers when zone is loaded + int32 OnZoneInitialize(uint8 ZoneID); // triggers when zone is loaded int32 OnRegionEnter(CCharEntity* PChar, CRegion* PRegion); // when player enters a region of a zone int32 OnRegionLeave(CCharEntity* PChar, CRegion* Pregion); // when player leaves a region of a zone int32 OnTransportEvent(CCharEntity* PChar, uint32 TransportID); @@ -137,6 +139,7 @@ int32 GetMobRespawnTime(lua_State* L); // get the respawn time of a mob int32 DeterMob(lua_State* L); // Allow or prevent a mob from spawning int32 UpdateNMSpawnPoint(lua_State* L); // Update the spawn point of an NM + int32 SendMobMessage(lua_State* L); }; #endif //- _LUAUTILS_H - Index: src/map/Makefile.in =================================================================== --- src/map/Makefile.in (revision 3304) +++ src/map/Makefile.in (working copy) @@ -44,7 +44,7 @@ obj_map/packets/fishing.o obj_map/packets/guild_menu.o obj_map/packets/guild_menu_buy.o obj_map/packets/guild_menu_sell.o \ obj_map/packets/merit_points_categories.o obj_map/packets/party_define.o obj_map/packets/party_invite.o obj_map/packets/party_map.o \ obj_map/packets/party_member_update.o obj_map/packets/party_search.o obj_map/packets/pet_sync.o obj_map/packets/treasure_find_item.o \ - obj_map/packets/treasure_lot_item.o obj_map/packets/uncnown_39.o obj_map/packets/world_pass.o obj_map/packets/linkshell_equip.o \ + obj_map/packets/treasure_lot_item.o obj_map/packets/unknown_39.o obj_map/packets/world_pass.o obj_map/packets/linkshell_equip.o \ obj_map/packets/linkshell_message.o obj_map/packets/bazaar_confirmation.o obj_map/packets/bazaar_purchase.o \ obj_map/items/item.o obj_map/items/item_armor.o obj_map/items/item_furnishing.o obj_map/items/item_general.o \ obj_map/items/item_linkshell.o obj_map/items/item_currency.o \ @@ -83,7 +83,7 @@ packets/char_spells.h packets/delivery_box.h packets/fishing.h packets/guild_menu.h packets/guild_menu_buy.h \ packets/guild_menu_sell.h packets/merit_points_categories.h packets/party_define.h packets/party_invite.h \ packets/party_map.h packets/party_member_update.h packets/party_search.h packets/pet_sync.h packets/treasure_find_item.h \ - packets/treasure_lot_item.h packets/uncnown_39.h packets/world_pass.h packets/bazaar_confirmation.h packets/bazaar_purchase.h \ + packets/treasure_lot_item.h packets/unknown_39.h packets/world_pass.h packets/bazaar_confirmation.h packets/bazaar_purchase.h \ packets/trade_action.h packets/trade_item.h packets/trade_request.h packets/trade_update.h \ items/item.h items/item_armor.h items/item_furnishing.h items/item_general.h \ items/item_linkshell.h items/item_puppet.h items/item_usable.h items/item_weapon.h \ Index: src/map/map.cpp =================================================================== --- src/map/map.cpp (revision 3304) +++ src/map/map.cpp (working copy) @@ -66,8 +66,8 @@ const int8* MAP_CONF_FILENAME = NULL; -int8* g_PBuff = NULL; // глобальный буфер обмена пакетами -int8* PTempBuff = NULL; // временный буфер обмена пакетами +int8* g_PBuff = NULL; // global buffer packet exchange +int8* PTempBuff = NULL; // temporary buffer packet exchange Sql_t* SqlHandle = NULL; // SQL descriptor int32 map_fd = 0; // main socket @@ -154,7 +154,7 @@ } Sql_Keepalive(SqlHandle); - // отчищаем таблицу сессий при старте сервера (временное решение, т.к. в кластере это не будет работать) + // Cleans the session table when the server starts (a temporary solution, because in the cluster, this will not work) Sql_Query(SqlHandle, "TRUNCATE TABLE accounts_sessions"); ShowMessage("\t\t - " CL_GREEN"[OK]" CL_RESET"\n"); @@ -166,8 +166,8 @@ itemutils::Initialize(); ShowMessage("\t\t\t - " CL_GREEN"[OK]" CL_RESET"\n"); - // нужно будет написать один метод для инициализации всех данных в battleutils - // и один метод для освобождения этих данных + // Need to write a single method to initialize all data battleutils + // And a method to release the data ShowStatus("do_init: loading spells"); spell::LoadSpellList(); @@ -206,6 +206,7 @@ CTaskMgr::getInstance()->AddTask("time_server", gettick(), NULL, CTaskMgr::TASK_INTERVAL, time_server, 2400); CTaskMgr::getInstance()->AddTask("map_cleanup", gettick(), NULL, CTaskMgr::TASK_INTERVAL, map_cleanup, 5000); + CTaskMgr::getInstance()->AddTask("save_playtime", gettick(), NULL, CTaskMgr::TASK_INTERVAL, save_playtime, 600000); // Update this every 10 minutes. CREATE(g_PBuff, int8, map_config.buffer_size + 20); CREATE(PTempBuff, int8, map_config.buffer_size + 20); @@ -331,8 +332,8 @@ if( recv_parse(g_PBuff,&size,&from,map_session_data) != -1 ) { - // если предыдущий пакет был потерян, то мы не собираем новый, - // а отправляем предыдущий пакет повторно + // If the previous packet was lost, we do not collect new + // And re-send the previous package if (!parse(g_PBuff,&size,&from,map_session_data)) { send_parse(g_PBuff,&size,&from,map_session_data); @@ -436,7 +437,7 @@ memcpy(map_session_data->blowfish.key,strSessionKey,20); } - // наверное создание персонажа лучше вынести в метод charutils::LoadChar() и загрузку инвентаря туда же сунуть + // Create a character must make a better method charutils :: LoadChar () and loading equipment to the same stick CCharEntity* PChar = new CCharEntity(); @@ -495,7 +496,7 @@ int32 parse(int8* buff, size_t* buffsize, sockaddr_in* from, map_session_data_t* map_session_data) { - // начало обработки входящего пакета + // Start processing the incoming packet int8* PacketData_Begin = &buff[FFXI_HEADER_SIZE]; int8* PacketData_End = &buff[*buffsize]; @@ -515,8 +516,8 @@ if(PacketSize[SmallPD_Type] == SmallPD_Size || PacketSize[SmallPD_Type] == 0) // Tests incoming packets for the correct size prior to processing { - // если код текущего пакета меньше либо равен последнему полученному - // или больше глобального то игнорируем пакет + // If the code of the current package is less than or equal to the last received + // Or more global then ignore package if ((RBUFW(SmallPD_ptr,2) <= map_session_data->client_packet_id) || (RBUFW(SmallPD_ptr,2) > SmallPD_Code)) @@ -543,8 +544,8 @@ } map_session_data->client_packet_id = SmallPD_Code; - // здесь мы проверяем, получил ли клиент предыдущий пакет - // если не получил, то мы не создаем новый, а отправляем предыдущий + // Here we check to see whether the client the previous package + // If not, then we do not create a new one and send the previous if (RBUFW(buff,2) != map_session_data->server_packet_id) { @@ -558,11 +559,11 @@ return -1; } - // увеличиваем номер отправленного пакета только в случае отправки новых данных + //Increase the number of sent packet only when sending new data map_session_data->server_packet_id += 1; - // собираем большой пакет, состоящий из нескольких маленьких + // Collect a large package, consisting of a few small CBasicPacket* PSmallPacket; @@ -590,26 +591,26 @@ int32 send_parse(int8 *buff, size_t* buffsize, sockaddr_in* from, map_session_data_t* map_session_data) { - // Модификация заголовка исходящего пакета - // Суть преобразований: - // - отправить клиенту номер последнего полученного от него пакета - // - присвоить исходящему пакету номер последнего отправленного клиенту пакета +1 - // - записать текущее время отправки пакета + // Modification of the outgoing packet header + // The point transformations: + // - Send to the client number of the last packet received from him + // - Set the number of the last outgoing packet is sent to the client package +1 + // - Write the current time a packet is sent WBUFW(buff,0) = map_session_data->server_packet_id; WBUFW(buff,2) = map_session_data->client_packet_id; - // сохранение текущего времени (32 BIT!) + // Save the current time (32 BIT!) WBUFL(buff,8) = (uint32)time(NULL); - //Сжимаем данные без учета заголовка - //Возвращаемый размер в 8 раз больше реальных данных + // Compress data without header + // Return the size is 8 times the actual data uint32 PacketSize = zlib_compress(buff+FFXI_HEADER_SIZE, *buffsize-FFXI_HEADER_SIZE, PTempBuff, *buffsize, zlib_compress_table); - //Запись размера данных без учета заголовка + // Write data size without header WBUFL(PTempBuff,(PacketSize+7)/8) = PacketSize; - //Расчет hash'a также без учета заголовка, но с учетом записанного выше размера данных + // Calculate the hash'a also without title, but with the size of the data recorded above PacketSize = (PacketSize+7)/8+4; uint8 hash[16]; md5((uint8*)PTempBuff, hash, PacketSize); @@ -621,7 +622,7 @@ ShowFatalError(CL_RED"%Memory manager: PTempBuff is overflowed (%u)\n" CL_RESET, PacketSize); } - //making total packet + // making total packet memcpy(buff+FFXI_HEADER_SIZE, PTempBuff, PacketSize); uint32 CypherSize = (PacketSize/4)&-2; @@ -633,12 +634,12 @@ blowfish_encipher((uint32*)(buff)+j+7, (uint32*)(buff)+j+8, pbfkey->P, pbfkey->S[0]); } - // контролируем размер отправляемого пакета. в случае, - // если его размер превышает 1400 байт (размер данных + 42 байта IP заголовок), - // то клиент игнорирует пакет и возвращает сообщение о его потере + // Control the size of the packet sent. in case + // If it exceeds 1400 bytes (the size of data + 42 bytes of IP header) + // The client ignores the packet and returns a message about his loss - // в случае возникновения подобной ситуации выводим предупреждующее сообщение и - // уменьшаем размер BuffMaxSize с шагом в 4 байта до ее устранения (вручную) + // In case of a situation like this we deduce ADVISED message and + // Decrease the size BuffMaxSize increments of 4 bytes to fix it (by hand) *buffsize = PacketSize+FFXI_HEADER_SIZE; @@ -651,8 +652,8 @@ /************************************************************************ * * -* Таймер для завершения сессии (без таймера мы этого сделать не можем, * -* т.к. сессия продолжает использоваться в do_sockets) * +* Timer to end the session (without the timer, we can not do that, * +* As session continues to be used do_sockets) * * * ************************************************************************/ @@ -666,6 +667,8 @@ { Sql_Query(SqlHandle,"DELETE FROM accounts_sessions WHERE charid = %u",map_session_data->PChar->id); + charutils::SavePlayTime(map_session_data->PChar); + uint64 port64 = map_session_data->client_port; uint64 ipp = map_session_data->client_addr; ipp |= port64<<32; @@ -821,6 +824,7 @@ map_config.server_message = ""; map_config.buffer_size = 1800; map_config.exp_rate = 1.0f; + map_config.exp_loss_rate = 1.0f; map_config.exp_retain = 0.0f; map_config.exp_loss_level = 4; map_config.speed_mod = 0; @@ -832,6 +836,24 @@ map_config.lightluggage_block = 4; map_config.max_time_lastupdate = 60000; map_config.newstyle_skillups = 7; + map_config.engage_dist_mod = 1.0f; + map_config.magic_dist_mod = 1.0f; + map_config.ranged_dist_mod = 1.0f; + map_config.remove_engage_delay = 0; + map_config.magic_movement = 0; + map_config.seal_crest_bonus = 0; + map_config.always_seal_crest = 0; + map_config.drop_rate_bonus = 0; + map_config.all_mobs_drop_gil = 0; + map_config.gil_bonus = 1; + map_config.chain_on_easy = 0; + map_config.chain_bonus = 1; + map_config.craft_skill_onfail = 0; + map_config.craft_skillamt = 0; + map_config.conquest_bonus = 1; + map_config.craft_success = 1; + map_config.notorious_hp_mod = 2.5f; + map_config.notorious_hp_mod = 2.5f; map_config.max_merit_points = 30; return 0; } @@ -890,6 +912,78 @@ { map_config.buffer_size = atoi(w2); } + else if (strcmp(w1,"engage_dist_mod") == 0) + { + map_config.engage_dist_mod = atoi(w2); + } + else if (strcmp(w1,"magic_dist_mod") == 0) + { + map_config.magic_dist_mod = atoi(w2); + } + else if (strcmp(w1,"ranged_dist_mod") == 0) + { + map_config.ranged_dist_mod = atoi(w2); + } + else if (strcmp(w1,"remove_engage_delay") == 0) + { + map_config.remove_engage_delay = atoi(w2); + } + else if (strcmp(w1,"magic_movement") == 0) + { + map_config.magic_movement = atoi(w2); + } + else if (strcmp(w1,"seal_crest_bonus") == 0) + { + map_config.seal_crest_bonus = atoi(w2); + } + else if (strcmp(w1,"always_seal_crest") == 0) + { + map_config.always_seal_crest = atoi(w2); + } + else if (strcmp(w1,"drop_rate_bonus") == 0) + { + map_config.drop_rate_bonus = atoi(w2); + } + else if (strcmp(w1,"all_mobs_drop_gil") == 0) + { + map_config.all_mobs_drop_gil = atoi(w2); + } + else if (strcmp(w1,"gil_bonus") == 0) + { + map_config.gil_bonus = atoi(w2); + } + else if (strcmp(w1,"chain_on_easy") == 0) + { + map_config.chain_on_easy = atoi(w2); + } + else if (strcmp(w1,"chain_bonus") == 0) + { + map_config.chain_bonus = atoi(w2); + } + else if (strcmp(w1,"craft_skill_onfail") == 0) + { + map_config.craft_skill_onfail = atoi(w2); + } + else if (strcmp(w1,"craft_skillamt") == 0) + { + map_config.craft_skillamt = atoi(w2); + } + else if (strcmp(w1,"conquest_bonus") == 0) + { + map_config.conquest_bonus = atoi(w2); + } + else if (strcmp(w1,"craft_success") == 0) + { + map_config.craft_success = atoi(w2); + } + else if (strcmp(w1,"notorious_hp_mod") == 0) + { + map_config.notorious_hp_mod = atoi(w2); + } + else if (strcmp(w1,"notorious_mp_mod") == 0) + { + map_config.notorious_mp_mod = atoi(w2); + } else if (strcmp(w1,"max_time_lastupdate") == 0) { map_config.max_time_lastupdate = atoi(w2); Index: src/map/map.h =================================================================== --- src/map/map.h (revision 3304) +++ src/map/map.h (working copy) @@ -87,6 +87,24 @@ float mob_tp_multiplier; // Multiplies the amount of TP mobs gain on any effect that would grant TP float player_tp_multiplier; // Multiplies the amount of TP players gain on any effect that would grant TP uint8 newstyle_skillups; // Allows failed parries and blocks to trigger skill up chance. + float engage_dist_mod; // Default is 1. Multiplies the distance that you can engage a target. Change to 3 for 3x the distance. + float magic_dist_mod; // Default is 1. Multiplies the distance that you can cast magic on a target. Change to 3 for 3x the distance. + float ranged_dist_mod; // Default is 1. Multiplies the distance that you can used ranged attack on a target. Change to 3 for 3x the distance. + int8 remove_engage_delay; // Default is 0. This removes the engegement delay that happens just after killing a target, or after equipping a weapon. + float magic_movement; // Default is 0. Allows movement while magic casting. + int16 seal_crest_bonus; // Increases chance of exp mobs dropping seals or crests. Set from 0 - 60. + int8 always_seal_crest; // Allows non exp beastman mobs to drop seals and crests. Default is 0. Set to 1 for non exp beastman mobs to drop seals and crests. + int8 drop_rate_bonus; // Adds to the drop rate percentate. Set to 20 to add additional %20 drop rate on all drops. + int8 all_mobs_drop_gil; // Set to 1 to allow all mobs to drop gil. Currently does not display ingame messages for these gil drops. Default is 0. + int16 gil_bonus; // Multiplies the amount of gil dropped + int8 chain_on_easy; // Allows exp chain on any exp mob + int8 chain_bonus; // Increases the time frame allowed to get an exp chain. Default is 1. + int8 craft_skill_onfail; // Allows same skillup on chance for failures as crafting successes have. Default is 0. + int8 craft_skillamt; // Increases the chance of getting larger skillups while crafting. Set 0 to 100. Default 0. + int8 conquest_bonus; // Multiplies the amount of conquest points earned on an exp mob kill. Default is 1 + int16 craft_success; // Increases the chance of succeding at crafting. Default 1. + float notorious_hp_mod; // Multiplier to NM HP. + float notorious_mp_mod; // Multiplier to NM HP. uint8 max_merit_points; // global variable, amount of merit points players are allowed }; @@ -100,10 +118,10 @@ { uint32 client_addr; uint16 client_port; - uint16 client_packet_id; // id последнего пакета, пришедшего от клиента - uint16 server_packet_id; // id последнего пакета, отправленного сервером - int8* server_packet_data; // указатель на собранный пакет, который был ранее отправлен клиенту - size_t server_packet_size; // размер пакета, который был ранее отправлен клиенту + uint16 client_packet_id; // id of the last packet passed to the client + uint16 server_packet_id; // id of the last packet sent by the server + int8* server_packet_data; // pointer to the assembled package that was previously sent to the client + size_t server_packet_size; // size of the package that was previously sent to the client time_t last_update; // time of last packet recv blowfish_t blowfish; // unique decypher keys CCharEntity *PChar; // game char @@ -134,7 +152,7 @@ int32 map_config_default(); int32 map_cleanup(uint32 tick,CTaskMgr::CTask *PTask); // Clean up timed out players -int32 map_close_session(uint32 tick,CTaskMgr::CTask *PTask); // завершение сессии +int32 map_close_session(uint32 tick,CTaskMgr::CTask *PTask); // End of session #endif //_MAP_H Index: src/map/merit.cpp =================================================================== --- src/map/merit.cpp (revision 3304) +++ src/map/merit.cpp (working copy) @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (c) 2010-2012 Darkstar Dev Teams @@ -29,11 +29,11 @@ /************************************************************************ * * -* Две версии значений - до abyssea и после * +* Two versions of the values - up to and after abyssea * * * ************************************************************************/ -// массив больше на одно значение, заполняемое нулем +// greater array to the same value, filled zero #ifdef ABYSSEA_EXPANSION static uint8 upgrade[9][16] = @@ -41,58 +41,58 @@ {1,2,3,4,5,5,5,5,5,7,7,7,9,9,9}, // HP-MP {3,6,9,9,9,12,12,12,12,15,15,15}, // Attributes {1,2,3,3,3,3,3,3}, // Combat Skills - {1,2,3,3}, // Defensive Skills + {1,2,3,3}, // Defensive Skills {1,2,3,3,3,3,3,3}, // Magic Skills {1,2,3,4,5}, // Others {1,2,3,4,5}, // Job Group 1 {3,4,5,5,5}, // Job Group 2 {10,15,20,25,30}, // Weapon Skills }; -#define MAX_LIMIT_POINTS 10000 // количество опыта для получения одного merit -//#define MAX_MERIT_POINTS 30 // максимальное количество неиспользованных merit +#define MAX_LIMIT_POINTS 10000 // amount of experience to get one merit +//#define MAX_MERIT_POINTS 30 // the maximum number of unused merits // option to change max points, kept the original above -#define MAX_MERIT_POINTS map_config.max_merit_points +#define MAX_MERIT_POINTS map_config.max_merit_points #else static uint8 upgrade[9][9] = { {1,2,3,4,5,5,5,5}, //0 HP-MP {3,6,9,9,9}, //1 Attributes - {1,2,3,3,3,3,3,3}, //2 Combat Skills - {1,2,3,3}, //3 Defensive Skills - {1,2,3,3,3,3,3,3}, //4 Magic Skills + {1,2,3,3,3,3,3,3}, //2 Combat Skills + {1,2,3,3}, //3 Defensive Skills + {1,2,3,3,3,3,3,3}, //4 Magic Skills {1,2,3,4,5}, //5 Others {1,2,3,4,5}, //6 Job Group 1 {3,4,5,5,5}, //7 Job Group 2 {0}, //8 Weapon Skills }; -#define MAX_LIMIT_POINTS 10000 // количество опыта для получения одного merit -//#define MAX_MERIT_POINTS 100 // максимальное количество неиспользованных merit +#define MAX_LIMIT_POINTS 10000 // amount of experience to get a merit +//#define MAX_MERIT_POINTS 100 // the maximum number of unused merits // option to change max points, kept the original above -#define MAX_MERIT_POINTS map_config.max_merit_points +#define MAX_MERIT_POINTS map_config.max_merit_points -#endif +#endif -// TODO: скорее всего придется все это перенести в базу +// TODO: most likely will have to move it to the database /************************************************************************ * * -* Ограничение количества усилений metir * +* Limit the number of maximum merit * * * ************************************************************************/ static uint8 cap[100] = -{ - 0,0,0,0,0,0,0,0,0,0, // 0-9 0 - 1,1,1,1,1,1,1,1,1,1, // 10-19 1 - 2,2,2,2,2,2,2,2,2,2, // 20-29 2 - 3,3,3,3,3,3,3,3,3,3, // 30-39 3 - 4,4,4,4,4,4,4,4,4,4, // 40-49 4 - 5,5,5,5,5, // 50-54 5 - 6,6,6,6,6, // 55-59 6 - 7,7,7,7,7, // 60-64 7 +{ + 0,0,0,0,0,0,0,0,0,0, // 0-9 0 + 1,1,1,1,1,1,1,1,1,1, // 10-19 1 + 2,2,2,2,2,2,2,2,2,2, // 20-29 2 + 3,3,3,3,3,3,3,3,3,3, // 30-39 3 + 4,4,4,4,4,4,4,4,4,4, // 40-49 4 + 5,5,5,5,5, // 50-54 5 + 6,6,6,6,6, // 55-59 6 + 7,7,7,7,7, // 60-64 7 8,8,8,8,8, // 65-69 8 8,8,8,8,8,8,8,8,8,8, // 70-79 8 8,8,8,8,8,8,8,8,8,8, // 80-89 8 @@ -101,78 +101,78 @@ /************************************************************************ * * -* Количество элементов в каждой из категорий * +* The number of items in each category * * * ************************************************************************/ struct MeritCategoryInfo_t { - int8 MeritsInCat; // количество элементов в группе - uint8 MaxPoints; // максимальное количество points, которые можно вложить в группу - uint8 UpgradeID; // индекс группы в массиве upgrade + int8 MeritsInCat; // the number of elements in the group + uint8 MaxPoints; // the maximum number of points, which can be embedded in a group + uint8 UpgradeID; // group index in the array of upgrade }; static const MeritCategoryInfo_t meritCatInfo[] = { - {2,15,0}, //MCATEGORY_HP_MP - {7,12,1}, //MCATEGORY_ATTRIBUTES - {19,32,2}, //MCATEGORY_COMBAT - {12,24,4}, //MCATEGORY_MAGIC - {5,10,5}, //MCATEGORY_OTHERS + {2,15,0}, //MCATEGORY_HP_MP + {7,12,1}, //MCATEGORY_ATTRIBUTES + {19,32,2}, //MCATEGORY_COMBAT + {12,24,4}, //MCATEGORY_MAGIC + {5,10,5}, //MCATEGORY_OTHERS - {5,10,6}, //MCATEGORY_WAR_1 - {5,10,6}, //MCATEGORY_MNK_1 - {5,10,6}, //MCATEGORY_WHM_1 - {7,10,6}, //MCATEGORY_BLM_1 - {7,10,6}, //MCATEGORY_RDM_1 - {5,10,6}, //MCATEGORY_THF_1 - {5,10,6}, //MCATEGORY_PLD_1 - {5,10,6}, //MCATEGORY_DRK_1 - {5,10,6}, //MCATEGORY_BST_1 - {5,10,6}, //MCATEGORY_BRD_1 - {5,10,6}, //MCATEGORY_RNG_1 - {5,10,6}, //MCATEGORY_SAM_1 - {7,10,6}, //MCATEGORY_NIN_1 - {5,10,6}, //MCATEGORY_DRG_1 - {5,10,6}, //MCATEGORY_SMN_1 - {5,10,6}, //MCATEGORY_BLU_1 - {5,10,6}, //MCATEGORY_COR_1 - {5,10,6}, //MCATEGORY_PUP_1 - {4,10,6}, //MCATEGORY_DNC_1 - {4,10,6}, //MCATEGORY_SCH_1 + {5,10,6}, //MCATEGORY_WAR_1 + {5,10,6}, //MCATEGORY_MNK_1 + {5,10,6}, //MCATEGORY_WHM_1 + {7,10,6}, //MCATEGORY_BLM_1 + {7,10,6}, //MCATEGORY_RDM_1 + {5,10,6}, //MCATEGORY_THF_1 + {5,10,6}, //MCATEGORY_PLD_1 + {5,10,6}, //MCATEGORY_DRK_1 + {5,10,6}, //MCATEGORY_BST_1 + {5,10,6}, //MCATEGORY_BRD_1 + {5,10,6}, //MCATEGORY_RNG_1 + {5,10,6}, //MCATEGORY_SAM_1 + {7,10,6}, //MCATEGORY_NIN_1 + {5,10,6}, //MCATEGORY_DRG_1 + {5,10,6}, //MCATEGORY_SMN_1 + {5,10,6}, //MCATEGORY_BLU_1 + {5,10,6}, //MCATEGORY_COR_1 + {5,10,6}, //MCATEGORY_PUP_1 + {4,10,6}, //MCATEGORY_DNC_1 + {4,10,6}, //MCATEGORY_SCH_1 {14,15,8}, //MCATEGORY_WS {0,0,8}, //MCATEGORY_UNK_0 26 - {0,0,8}, //MCATEGORY_UNK_1 - {0,0,8}, //MCATEGORY_UNK_2 - {0,0,8}, //MCATEGORY_UNK_3 + {0,0,8}, //MCATEGORY_UNK_1 + {0,0,8}, //MCATEGORY_UNK_2 + {0,0,8}, //MCATEGORY_UNK_3 {0,0,8}, //MCATEGORY_UNK_4 30 - {4,10,7}, //MCATEGORY_WAR_2 - {4,10,7}, //MCATEGORY_MNK_2 - {4,10,7}, //MCATEGORY_WHM_2 - {6,10,7}, //MCATEGORY_BLM_2 - {6,10,7}, //MCATEGORY_RDM_2 - {4,10,7}, //MCATEGORY_THF_2 - {4,10,7}, //MCATEGORY_PLD_2 - {4,10,7}, //MCATEGORY_DRK_2 - {4,10,7}, //MCATEGORY_BST_2 - {4,10,7}, //MCATEGORY_BRD_2 - {4,10,7}, //MCATEGORY_RNG_2 - {4,10,7}, //MCATEGORY_SAM_2 - {8,10,7}, //MCATEGORY_NIN_2 - {4,10,7}, //MCATEGORY_DRG_2 - {6,10,7}, //MCATEGORY_SMN_2 - {4,10,7}, //MCATEGORY_BLU_2 - {4,10,7}, //MCATEGORY_COR_2 - {4,10,7}, //MCATEGORY_PUP_2 - {4,10,7}, //MCATEGORY_DNC_2 - {6,10,7}, //MCATEGORY_SHC_2 + {4,10,7}, //MCATEGORY_WAR_2 + {4,10,7}, //MCATEGORY_MNK_2 + {4,10,7}, //MCATEGORY_WHM_2 + {6,10,7}, //MCATEGORY_BLM_2 + {6,10,7}, //MCATEGORY_RDM_2 + {4,10,7}, //MCATEGORY_THF_2 + {4,10,7}, //MCATEGORY_PLD_2 + {4,10,7}, //MCATEGORY_DRK_2 + {4,10,7}, //MCATEGORY_BST_2 + {4,10,7}, //MCATEGORY_BRD_2 + {4,10,7}, //MCATEGORY_RNG_2 + {4,10,7}, //MCATEGORY_SAM_2 + {8,10,7}, //MCATEGORY_NIN_2 + {4,10,7}, //MCATEGORY_DRG_2 + {6,10,7}, //MCATEGORY_SMN_2 + {4,10,7}, //MCATEGORY_BLU_2 + {4,10,7}, //MCATEGORY_COR_2 + {4,10,7}, //MCATEGORY_PUP_2 + {4,10,7}, //MCATEGORY_DNC_2 + {6,10,7}, //MCATEGORY_SHC_2 }; -#define GetMeritCategory(merit) ((merit >> 6) - 1) // получаем категорию из merit -#define GetMeritID(merit) ((merit & 0x3F) >> 1) // получаем смещение в категории из merit +#define GetMeritCategory(merit) ((merit >> 6) - 1) // obtain the category of merit +#define GetMeritID(merit) ((merit & 0x3F) >> 1) // get the offset in the category of merit /************************************************************************ * * @@ -186,7 +186,7 @@ DSP_DEBUG_BREAK_IF(sizeof(merits) != sizeof(merits::GMeritsTemplate)); memcpy(merits, merits::GMeritsTemplate, sizeof(merits)); - + for (uint8 m = 0, i = 0; i < sizeof(Categories)/sizeof(Merit_t*); ++i) { Categories[i] = &merits[m]; @@ -239,11 +239,11 @@ { if (catNumber > 25 && catNumber < 31) // point these to valid merits to prevent crash - Categories[catNumber] = &merits[163]; + Categories[catNumber] = &merits[163]; else Categories[catNumber] = &merits[i]; - - catNumber++; + + catNumber++; } merits[i].count = points[i]; @@ -297,7 +297,7 @@ /************************************************************************ * * -* Получаем текущие limit points * +* Get the current limit points * * * ************************************************************************/ @@ -308,7 +308,7 @@ /************************************************************************ * * -* Получаем текущие merit points * +* Get the current merit points * * * ************************************************************************/ @@ -320,7 +320,7 @@ /************************************************************************ * * -* Получаем указател на массив merits * +* Gets a pointer to an array of merits * * * ************************************************************************/ @@ -332,11 +332,11 @@ /************************************************************************ * * -* Добавляем персонажу limit points * +* add character limit points * * * ************************************************************************/ -// true - если merit был добавлен +// true - if merit was added bool CMeritPoints::AddLimitPoints(uint16 points) { @@ -388,8 +388,8 @@ /************************************************************************ * * -* Проверяем наличие merit. Необходимо использовать лишь в случае * -* получения meritid от персонажа * +* Check the presence of merit. Should be used only in the case * +* receipt of a character meritid * * * ************************************************************************/ @@ -405,7 +405,7 @@ /************************************************************************ * * -* Получаем указатель на искомый const merit * +* Get a pointer of the desired const merit * * * ************************************************************************/ @@ -416,7 +416,7 @@ /************************************************************************ * * -* Получаем указатель на искомый const merit по индексу * +* Get a pointer of the desired const merit index * * * ************************************************************************/ @@ -430,7 +430,7 @@ /************************************************************************ * * -* Получаем указатель на искомый merit * +* Get a pointer of the desired merit * * * ************************************************************************/ @@ -489,13 +489,13 @@ /************************************************************************ * * -* Получаем текущее значение указанного merit * +* Get the current value of the specified merit * * * ************************************************************************/ int32 CMeritPoints::GetMeritValue(MERIT_TYPE merit, uint8 lvl) { - uint8 meritValue = dsp_min(GetMeritPointer(merit)->count, cap[lvl]); + uint8 meritValue = dsp_min(GetMeritPointer(merit)->count, cap[lvl]); meritValue *= GetMeritPointer(merit)->value; @@ -504,7 +504,7 @@ int32 CMeritPoints::GetMeritValue(Merit_t* merit, uint8 lvl) { - uint8 meritValue = dsp_min(merit->count, cap[lvl]); + uint8 meritValue = dsp_min(merit->count, cap[lvl]); meritValue *= merit->value; @@ -513,21 +513,21 @@ /************************************************************************ * * -* Реализация namespase для работы с Linkshells * +* Implementing namespase to work with Linkshells * * * ************************************************************************/ namespace meritNameSpace { - Merit_t GMeritsTemplate[MERITS_COUNT] = {0}; // global list of merits and their properties + Merit_t GMeritsTemplate[MERITS_COUNT] = {0}; // global list of merits and their properties int16 groupOffset[MCATEGORY_COUNT/64-1] = {0}; // the first merit offset of each catagory - /************************************************************************ - * * - * Загружаем шаблон массива merits / Load pattern array merits * - * * - ************************************************************************/ + /*********************************** + * * + * Load pattern array merits * + * * + ************************************/ void LoadMeritsList() { @@ -545,7 +545,7 @@ int8 catMeritIndex = 0; // counts number of merits in a catagory - while( Sql_NextRow(SqlHandle) == SQL_SUCCESS ) + while( Sql_NextRow(SqlHandle) == SQL_SUCCESS ) { Merit_t Merit = {0}; // creat a new merit template. @@ -554,14 +554,14 @@ Merit.jobs = Sql_GetUIntData(SqlHandle,2); Merit.upgrade = Sql_GetUIntData(SqlHandle,3); Merit.upgradeid = Sql_GetUIntData(SqlHandle,4); - Merit.catid = Sql_GetUIntData(SqlHandle,5); + Merit.catid = Sql_GetUIntData(SqlHandle,5); Merit.next = upgrade[Merit.upgradeid][0]; GMeritsTemplate[index] = Merit; // add the merit to the array previousCatIndex = Merit.catid; // previousCatIndex is set on everyloop to detect a catogory change. - + if (previousCatIndex != catIndex) // check for catagory change. { groupOffset[catIndex] = index - catMeritIndex; // set index offset, first merit of each group. @@ -575,7 +575,7 @@ catMeritIndex++; // next index within catagory. index++; // next global template index. } - + groupOffset[catIndex] = index - catMeritIndex; // add the last offset manually since loop finishes before hand. Index: src/map/merit.h =================================================================== --- src/map/merit.h (revision 3304) +++ src/map/merit.h (working copy) @@ -460,7 +460,7 @@ MERIT_STORMSURGE = MCATEGORY_SCH_2 + 0x0A, }; -#define MERITS_COUNT 305 // 5 полных пакетов по 61 элементу +#define MERITS_COUNT 305 // 5 complete package for 61 elements @@ -478,16 +478,16 @@ { struct { - uint16 id; // id мерита - uint8 next; // необходимое количество меритов для следующего усиления - uint8 count; // текущее количество усилений + uint16 id; // id Merit + uint8 next; // required number of Merits for the next increase + uint8 count; // the current number of exacerbations }; - uint32 data; // информация для отправки персонажу + uint32 data; // information to send to character }; - uint32 value; // коэффициент изменения параметра, привязанного к merit - uint8 upgrade; // максимальное количество усилений для данного merit - uint32 jobs; // маска профессий, для которых merit работает + uint32 value; // coefficient of variation of the parameter that is bound to merit + uint8 upgrade; // the maximum amount of gain for the merit + uint32 jobs; // Mask jobs for which the merit works uint8 upgradeid; // which set of upgrade values the merit will use uint8 catid; // cat which merit belongs to }; @@ -511,7 +511,7 @@ int32 GetMeritValue(Merit_t* merit, uint8 lvl); bool AddLimitPoints(uint16 points); // automatically adds merit points > 10000 - bool IsMeritExist(MERIT_TYPE merit); // проверяем существование merit + bool IsMeritExist(MERIT_TYPE merit); // check the existence of merit void RaiseMerit(MERIT_TYPE merit); // add upgrade void LowerMerit(MERIT_TYPE merit); // del upgrade Index: src/map/mob_spell_list.cpp =================================================================== --- src/map/mob_spell_list.cpp (revision 3304) +++ src/map/mob_spell_list.cpp (working copy) @@ -41,7 +41,7 @@ /************************************************************************ * * -* Реализация namespase для работы с заклинаниями * +* Implementing namespase to work with spells * * * ************************************************************************/ @@ -51,7 +51,7 @@ /************************************************************************ * * - * Загружаем список заклинаний * + * Load a list of spells * * * ************************************************************************/ Index: src/map/mob_spell_list.h =================================================================== --- src/map/mob_spell_list.h (revision 3304) +++ src/map/mob_spell_list.h (working copy) @@ -57,7 +57,7 @@ /************************************************************************ * * -* namespase для работы с заклинаниями * +* Namespase to work with spells * * * ************************************************************************/ Index: src/map/mobentity.cpp =================================================================== --- src/map/mobentity.cpp (revision 3304) +++ src/map/mobentity.cpp (working copy) @@ -41,6 +41,7 @@ MPscale = 1.0; m_AllowRespawn = 0; + m_ForceDespawn = false; m_CallForHelp = 0; m_DespawnTimer = 0; m_DropItemTime = 0; @@ -86,7 +87,7 @@ /************************************************************************ * * -* Время исчезновения монстра в секундах * +* Fade time monster in seconds * * * ************************************************************************/ Index: src/map/mobentity.h =================================================================== --- src/map/mobentity.h (revision 3304) +++ src/map/mobentity.h (working copy) @@ -43,7 +43,7 @@ SPAWNTYPE_FOG = 0x08, // 02:00-07:00 SPAWNTYPE_MOONPHASE = 0x10, SPAWNTYPE_LOTTERY = 0x20, - SPAWNTYPE_WINDOWED = 0x40, // понятия не имею, что это ^^ + SPAWNTYPE_WINDOWED = 0x40, // ​​I have no idea what it is ^ ^ SPAWNTYPE_SCRIPTED = 0x80 }; @@ -82,23 +82,24 @@ { public: - bool m_AllowRespawn; // монстру разрешено возрождаться - uint32 m_RespawnTime; // отрезок времени, через который монстр возрождается после смерти - uint32 m_DropItemTime; // время анимации смерти монстра + bool m_AllowRespawn; // monster is allowed to revive + bool m_ForceDespawn; + uint32 m_RespawnTime; // length of time over which the monster reborn after death + uint32 m_DropItemTime; // animation time of death monster uint32 m_MagicRecastTime; // Amount of time between casts. uint32 m_SpecialCoolDown; // Cool down time between uses. - uint16 m_SpecialSkill; // mobskill id to use + uint16 m_SpecialSkill; // mobskill id to use - uint32 m_DropID; // номер группы оставляемых монстром предметов после смерти + uint32 m_DropID; // number of items left by the death of a monster - uint8 m_minLevel; // минимально-возможный уровень монстра - uint8 m_maxLevel; // максимально-возможный уровень монстра + uint8 m_minLevel; // lowest possible level monster + uint8 m_maxLevel; // maximum possible level monster uint32 HPmodifier; // HP in Database (mob_groups) uint32 MPmodifier; // MP in Database (mob_groups) - float HPscale; // HP boost percentage - float MPscale; // MP boost percentage + float HPscale; // HP boost percentage + float MPscale; // MP boost percentage uint8 linkRadius; // mobs have different link radiuses // stat ranks @@ -116,28 +117,28 @@ // not used uint8 evaRank; - uint8 m_Type; // тип монстра - uint8 m_Link; // взаимопомощь монстрам своего семейства - uint16 m_Behaviour; // поведение монстра в различных ситуациях - SPAWNTYPE m_SpawnType; // условие появления монстра + uint8 m_Type; // type of monster + uint8 m_Link; // mutual monsters of his family + uint16 m_Behaviour; // monster behavior in different situations + SPAWNTYPE m_SpawnType; // condition for the appearance of a monster uint32 m_extraVar; // extra variable to store combat related variables from scripts - uint8 m_CallForHelp; // в перспективе желательно объединить эту переменную с CNpc->unknown + uint8 m_CallForHelp; // in the long term it is desirable to combine this variable CNpc-> unknown - position_t m_SpawnPoint; // точка возрождения монстра + position_t m_SpawnPoint; // point of the revival of the monster uint8 m_Element; uint8 m_HiPCLvl; // Highest Level of Player Character that hit the Monster uint8 m_THLvl; // Highest Level of Treasure Hunter that apply to drops uint32 m_THPCID; // ID of last PC that hit the NPC and apply TH onto the NPC uint16 m_Family; uint8 m_SkillStatus; // status of skills (used 2h/used epic tp move/etc) - CMobSpellList* m_SpellListContainer; // The spells list container for this mob + CMobSpellList* m_SpellListContainer; // The spells list container for this mob std::map m_UsedSkillIds; // mob skill ids used (key) along with mob level (value) uint32 m_unknown; // includes the CFH flag and whether the HP bar should be shown or not (e.g. Yilgeban doesnt) uint8 m_name_prefix; // The ding bats VS Ding bats - CEnmityContainer* PEnmityContainer; // система ненависти монстров + CEnmityContainer* PEnmityContainer; // system hate monsters bool hasRageMode(); // If the mob has the rage mode: true void addRageMode(); // Rage mode ON: stat x10 Index: src/map/mobskill.h =================================================================== --- src/map/mobskill.h (revision 3304) +++ src/map/mobskill.h (working copy) @@ -86,23 +86,23 @@ const int8* getName(); void setName(int8* name); - uint16 m_SkillCondition; //the condition of the skill, used for special tp moves, e.g. used sub 50% HP - uint16 m_SkillConditionValue; //the condition value, e.g. SkillCondition=BELOW_PCT SkillConditionValue=50 - // so TP move can only be used below 50% HP + uint16 m_SkillCondition; // the condition of the skill, used for special tp moves, e.g. used sub 50% HP + uint16 m_SkillConditionValue; // the condition value, e.g. SkillCondition=BELOW_PCT SkillConditionValue=50 + // so TP move can only be used below 50% HP private: uint16 m_ID; uint16 m_TotalTargets; uint16 m_FamilyID; - uint16 m_AnimID; //animation id - uint8 m_Aoe; // не используется - float m_Distance; // не используется - uint8 m_Flag; // не используется - uint8 m_ValidTarget; //same as - uint16 m_AnimationTime; //how long the tp animation lasts for in ms - uint16 m_ActivationTime; //how long the mob prepares the tp move for - uint16 m_Message; //message param, scripters can edit this depending on self/resist/etc. - float m_TP; //the tp at the time of finish readying (for scripts) + uint16 m_AnimID; // animation id + uint8 m_Aoe; // not used + float m_Distance; // not used + uint8 m_Flag; // not used + uint8 m_ValidTarget; // same as + uint16 m_AnimationTime; // how long the tp animation lasts for in ms + uint16 m_ActivationTime; // how long the mob prepares the tp move for + uint16 m_Message; // message param, scripters can edit this depending on self/resist/etc. + float m_TP; // the tp at the time of finish readying (for scripts) string_t m_name; }; Index: src/map/mobutils.cpp =================================================================== --- src/map/mobutils.cpp (revision 3304) +++ src/map/mobutils.cpp (working copy) @@ -37,7 +37,7 @@ /************************************************************************ * * -* Расчет базовой величины оружия монстров * +* The calculation of basic quantities of monsters weapons * * * ************************************************************************/ @@ -49,8 +49,8 @@ /************************************************************************ * * -* Базовое значение для расчера характеристик * -* (на название не хватило фантазии) * +* The base value for raschera characteristics * +* (the name did not have the imagination) * * * ************************************************************************/ @@ -71,8 +71,8 @@ /************************************************************************ * * -* Базовое значение для расчерта защиты и уклонения * -* (на название не хватило фантазии) * +* The base value for rascherta Def * +* (the name did not have the imagination) * * * ************************************************************************/ @@ -119,7 +119,7 @@ /************************************************************************ * * -* Расчет атрибутов (характеристик) монстра * +* The calculation of the attributes (characteristics) of a monster * * * ************************************************************************/ @@ -161,9 +161,9 @@ if(isNM) { - PMob->health.maxhp *= 2.0; + PMob->health.maxhp *= 5.0; if(PMob->GetMLevel() > 75){ - PMob->health.maxhp *= 2.5; + PMob->health.maxhp *= 7.5; } } @@ -184,9 +184,9 @@ if(PMob->MPmodifier == 0){ PMob->health.maxmp = (int16)(18.2 * pow(PMob->GetMLevel(),1.1075) * PMob->MPscale); if(isNM){ - PMob->health.maxmp *= 2.5; + PMob->health.maxmp *= 5.0; if(PMob->GetMLevel()>75){ - PMob->health.maxmp *= 2.5; + PMob->health.maxmp *= 7.5; } } } else { Index: src/map/modifier.h =================================================================== --- src/map/modifier.h (revision 3304) +++ src/map/modifier.h (working copy) @@ -69,6 +69,10 @@ MOD_MDEF = 0x1D, // Magic Defense MOD_MACC = 0x1E, // Magic Accuracy MOD_MEVA = 0x1F, // Magic Evasion + MOD_MAG_BURST_DMG = 0x19E, // Magic Burst Dmg % Bonus + MOD_ELEM_MAG_DMG = 0x1A2, // Elemental Magic Dmg % Bonus + MOD_ENFB_MAG_DMG = 0x1A3, // Enfeebling Magic Dmg % Bonus + MOD_NIN_MAG_DMG = 0x1A4, // Ninjutsu Magic Dmg % Bonus // Magic Accuracy and Elemental Attacks @@ -90,6 +94,7 @@ MOD_DARKACC = 0x2F, // Dark Accuracy MOD_WSACC = 0x30, // Weaponskill Accuracy + MOD_WS_DMG = 0x1C9, // Weaponskill Damage % // Resistance to damage type // Value is stored as a percentage of damage reduction (to within 1000) @@ -178,6 +183,8 @@ MOD_COOK = 0x87, MOD_SYNERGY = 0x88, MOD_RIDING = 0x89, + + MOD_GOLDFISHING = 0x1D1, // Chance you will not make an hq synth (Impossibility of HQ synth) @@ -198,13 +205,16 @@ MOD_DMGMAGIC = 0xA3, // Magic Damage Multiplier - 256 base! (value of -24 means -24/256 magic damage taken) MOD_DMGRANGE = 0xA4, // Range Damage Multiplier - MOD_UDMGPHYS = 0x183, // Uncapped Damage Multipliers + MOD_UDMGPHYS = 0x183, // Uncapped Damage Multipliers MOD_UDMGBREATH = 0x184, // Used in sentinal, invincible, physical shield etc MOD_UDMGMAGIC = 0x185, MOD_UDMGRANGE = 0x186, MOD_CRITHITRATE = 0xA5, // Raises chance to crit MOD_ENEMYCRITRATE = 0xA6, // Raises chance enemy will crit + MOD_CRIT_DMG = 0x1CB, // Raises Crit Hit Dmg % divided by 100 + + MOD_SHIELD_DEF = 0x1CC, // Shield Dmg Reduction % Bonus MOD_HASTE_MAGIC = 0xA7, // Haste (and Slow) from magic - 1024 base! (448 cap) MOD_HASTE_ABILITY = 0x17F, // Haste (and Slow) from abilities - 1024 base! (256 cap?) @@ -268,20 +278,29 @@ MOD_SLOWRES = 0xFA, MOD_STUNRES = 0xFB, MOD_CHARMRES = 0xFC, + MOD_DEATHRES = 0xFD, // Not sure if I can just fill in a blank + MOD_TERRORRES = 0xFE, // empty inbetween on POL Utils + MOD_AMNESIARES = 0xFF, + MOD_DOOMRES = 0x19C, - MOD_UNKNOWN = 0xFF, - MOD_PARALYZE = 0x101, // Paralyze -- percent chance to proc MOD_MIJIN_GAKURE = 0x102, // Tracks whether or not you used this ability to die. MOD_DUAL_WIELD = 0x103, // Percent reduction in dual wield delay. + MOD_SHIELD_MASTERY = 0x1CD, // Extra TP Gained from a Block + MOD_TACTICAL_GUARD = 0x1CE, // Extra TP Gained from a Guard + MOD_TACTICAL_PARRY = 0x1CF, // Extra TP Gained from a Parry + MOD_OCCULT_ACCUMEN = 0x1D0, // TP Gained from Elemental or Dark Magic Casts divided by 1000 // Warrior MOD_DOUBLE_ATTACK = 0x120, // Percent chance to proc + MOD_RETALIATION_DMG = 0x1DB, // % increase to Retaliation Dmg // Monk MOD_SUBTLE_BLOW = 0x121, // How much TP to reduce. MOD_COUNTER = 0x123, // Percent chance to counter MOD_KICK_ATTACK = 0x124, // Percent chance to kick + MOD_KICK_DMG = 0x182, // increases kick attack damage + MOD_COUNTER_BASE_DMG = 0x1D9, // Increase Weapon Base DMG on Counters // White Mage MOD_AFFLATUS_SOLACE = 0x125, // Pool of HP accumulated during Afflatus Solace @@ -300,30 +319,71 @@ MOD_STEAL = 0x12A, // Increase/Decrease THF Steal chance MOD_TRIPLE_ATTACK = 0x12E, // Percent chance MOD_TREASURE_HUNTER = 0x12F, // Percent chance + MOD_SNEAK_ATK_MOD = 0x1CA, // Modifier for DEX Divided by 10 (1 = .01) + MOD_TRICK_ATK_MOD = 0x1D6, // Modifier for AGI % + MOD_SATA_DMG = 0x1D7, // SA TA Dmg Modifier % + MOD_GILFINDER = 0x1D4, // Gil dropped from mob +50% per mod // Paladin + MOD_SHIELD_BASH = 0x181, // Shield Bash Dmg Increase + // Dark Knight + MOD_WEAPON_BASH = 0x1B1, // Increase Weapon Bash Damage + MOD_STALWART_SOUL = 0x1D5, // HP reduction from Souleater divided by 1000 + MOD_DARK_MAG_CAST = 0x1DA, // % Reduction to Dark Magic Cast Time + // Beastmaster MOD_TAME = 0x130, // Additional percent chance to charm MOD_CHARM_TIME = 0x168, // extends the charm time only, no effect of charm chance MOD_REWARD_HP_BONUS = 0x16C, // Percent to add to reward HP healed. (364) - MOD_CHARM_CHANCE = 0x187, // extra chance to charm (light+apollo staff ect) + MOD_CHARM_CHANCE = 0x19B, // extra chance to charm (light&apollo staff etc) + MOD_REWARD_RECAST = 0x18C, // Time reduction to Reward recast // Bard + MOD_SONG_RECAST = 0x187, // Percent decrease to Bard Song Recast + MOD_SONG_CAST = 0x18F, // Percent decrease to Song Cast Time + MOD_SONG_DURATION = 0x1B3, // Song Duration % Modifier + MOD_SONG_EFFECTS = 0x1C8, // Additional # of Song Effects (Daurdabla) + MOD_ALL_SONGS = 0x1B4, // Increase to all songs + MOD_ETUDE = 0x1B5, + MOD_REQUIEM = 0x1B6, + MOD_VIRELAI = 0x1B7, + MOD_MARCH = 0x1B8, + MOD_HYMNUS = 0x1B9, + MOD_MADRIGAL = 0x1BA, + MOD_MINUET = 0x1BB, + MOD_CAROL = 0x1BC, + MOD_PAEON = 0x1BD, + MOD_MAMBO = 0x1BE, + MOD_LULLABY = 0x1BF, + MOD_BALLAD = 0x1C0, + MOD_MAZURKA = 0x1C1, + MOD_THRENODY = 0x1C2, + MOD_FINALE = 0x1C3, + MOD_MINNE = 0x1C4, + MOD_SCHERZO = 0x1C5, + MOD_ELEGY = 0x1C6, + MOD_PRELUDE = 0x1C7, // Ranger MOD_RECYCLE = 0x131, // Percent chance to recycle MOD_SNAP_SHOT = 0x16D, // Percent reduction to range attack delay MOD_RAPID_SHOT = 0x167, // Percent chance to proc rapid shot MOD_WIDESCAN = 0x154, + MOD_SHADOWBIND = 0x1D2, // Enables Shadowbind on next RA + MOD_BARRAGE = 0x1D3, // Barrage Shot Count Increase // Samurai MOD_ZANSHIN = 0x132, // Percent chance to counter + MOD_MEDITATE_DUR = 0x1B0, // Extends Meditate duration in secs // Ninja MOD_UTSUSEMI = 0x133, // Everyone's favorite --tracks shadows. MOD_NINJA_TOOL = 0x134, // Percent chance to not use a tool. - + MOD_STEALTH = 0x166, // Chance to remain undetected ?? + MOD_UTSUSEMI_CAST = 0x195, // Percent decrease to Utsusemi Cast Time + MOD_NINJUTSU_RECAST = 0x18A, // Percent decrease to Ninjutsu Spell Recast + // Dragoon MOD_JUMP_TP_BONUS = 0x169, // bonus tp player receives when using jump (must be divided by 10) MOD_JUMP_ATT_BONUS = 0x16A, // ATT% bonus for jump + high jump @@ -332,12 +392,16 @@ // Summoner MOD_AVATAR_PERPETUATION = 0x173, //stores base cost of current avatar MOD_WEATHER_REDUCTION = 0x174, //stores perpetuation reduction depending on weather - MOD_DAY_REDUCTION = 0x175, //stores perpetuation reduction depending on day + MOD_DAY_REDUCTION = 0x175, //stores perpetuation reduction depending on day MOD_PERPETUATION_REDUCTION = 0x15A, //stores the MP/tick reduction from gear - MOD_BP_DELAY = 0x165, //stores blood pact delay reduction + MOD_BP_DELAY = 0x165, //stores blood pact delay reduction + MOD_SUMMON_CAST = 0x192, // Percent decrease to Summoning Magic Cast Time + MOD_ELE_AVATAR_RECAST = 0x18B, // Percent decrease to Elemental Avatar Recast // Blue Mage MOD_BLUE_POINTS = 0x135, // Tracks extra blue points + MOD_BLUE_RECAST = 0x189, // Percent decrease to Blue Spell Recast + MOD_BLUE_CAST = 0x196, // Percent decrease to Blue Magic Cast Time // Corsair MOD_DEDICATION = 0x136, // % exp gain @@ -367,22 +431,27 @@ MOD_BUST = 0x14C, // # of busts // Puppetmaster + // Dancer MOD_FINISHING_MOVES = 0x14D, // Tracks # of finishing moves + MOD_JIG_TIME = 0x1A6, // Additional duration of Jigs in secs // Scholar - MOD_SUBLIMATION = 0x14E, // Pool of MP to draw from after Sublimation charge is complete. + MOD_SUBLIMATION = 0x14E, // MP drain Mod for Sublimation charge. + MOD_SUBLIMATION_POOL = 0x1B2, // Pool of MP to draw from after Sublimation charge is complete. MOD_STORMSURGE = 0x14F, // Tracks which element storm it is MOD_LIGHT_ARTS_MPCOST = 0x150, MOD_LIGHT_ARTS_FASTCAST = 0x151, MOD_DARK_ARTS_MPCOST = 0x152, MOD_DARK_ARTS_FASTCAST = 0x153, + MOD_GRIMOIRE_RECAST = 0x19A, // Percent decrease to Spell Recasts under Light Arts and Dark Arts + MOD_GRIMOIRE_CAST = 0x190, // Percent decrease to Grimoire Cast Time - MOD_ENSPELL = 0x155, //stores the type of enspell active (0 if nothing) MOD_SPIKES = 0x156, //store the type of spike spell active (0 if nothing) MOD_ENSPELL_DMG = 0x157, //stores the base damage of the enspell before reductions MOD_SPIKES_DMG = 0x158, //stores the base damage of the spikes before reductions + MOD_ENSPELL_DURATION = 0x19D, //stores the additional duration time for enspell MOD_TP_BONUS = 0x159, @@ -401,8 +470,8 @@ MOD_ADDS_WEAPONSKILL = 0x163, MOD_ADDS_WEAPONSKILL_DYN = 0x164, - MOD_STEALTH = 0x166, - + MOD_CRYSTAL_DROP = 0x1D8, // Increase drop rate of Crystals (20 Max) + MOD_MAIN_DMG_RATING = 0x16E, //adds damage rating to main hand weapon (maneater/blau dolch etc hidden effects) MOD_SUB_DMG_RATING = 0x16F, //adds damage rating to off hand weapon MOD_REGAIN = 0x170, //auto regain TP (from items) | this is multiplied by 10 e.g. 20 is 2% TP @@ -417,21 +486,51 @@ MOD_DELAYP = 0x17C, //delay addition percent (does not affect tp gain) MOD_RANGED_DELAYP = 0x17D, //ranged delay addition percent (does not affect tp gain) - MOD_SHIELD_BASH = 0x181, - MOD_KICK_DMG = 0x182, // increases kick attack damage - MOD_WEAPON_BASH = 0x188 + MOD_ELEMENTAL_RECAST = 0x188, // Percent decrease to Elemental Spell Recast + + MOD_BLACK_CAST = 0x18D, // Percent decrease to Black Magic Cast Time + MOD_CURE_CAST = 0x18E, // Percent decrease to Cure Magic Cast Time + MOD_STONESKIN_CAST = 0x191, // Percent decrease to Stoneskin Cast Time + MOD_ELEMENTAL_CAST = 0x193, // Percent decrease to Elemental Magic Cast Time + MOD_HEALING_CAST = 0x194, // Percent decrease to Healing Magic Cast Time + MOD_ENHANCING_CAST = 0x197, // Percent decrease to Enhancing Magic Cast Time + MOD_ENFEEBLING_CAST = 0x198, // Percent decrease to Enfeebling Magic Cast Time + MOD_QUICK_MAGIC = 0x199, // Occasionally causes spells to cast instantly and 0 recast + + MOD_CHOCOBO_TIME = 0x19F, // Chocobo Riding Time Increase in Mins + + MOD_EAT_RAW_FISH = 0x1A0, // Allows the User to eat Raw Fish like a Mithra + MOD_EAT_RAW_MEAT = 0x1A1, // Allows the User to eat Raw Meat like a Galka + + MOD_QUADRUPLE_ATTACK = 0x1A5, // Percent chance + + MOD_SNEAK_DUR = 0x1A7, // Percent Increase + MOD_INVIS_DUR = 0x1A8, // Percent Increase + MOD_ENHANCING_DUR = 0x1A9, // Percent Increase + MOD_BARSPELL_DUR = 0x1AB, // Percent Increase duration Elemental Resistance Spells + MOD_BARSPELL_PWR = 0x1AC, // Power Increase Elemental Resistance Spells + MOD_DRAIN_ASPIR = 0x1AD, // Percent Increase + MOD_CURSNA_EFFECT = 0x1AE, // Percent Increase chance to remove DooM + MOD_CURSNA_RCVD = 0x1AF, // Percent Increase chance to remove DooM + + MOD_STONESKIN_HP = 0x1AA // Stoneskin + + + - // To save time finding the next mod to use.. - //MOD_SPARE = 0x189, - //MOD_SPARE = 0x18A, - //MOD_SPARE = 0x18B, - //MOD_SPARE = 0x18C, - //MOD_SPARE = 0x18D, + //MOD_SPARE = 0x1DC; + //MOD_SPARE = 0x1DE; + //MOD_SPARE = 0x1DF; + //MOD_SPARE = 0x1E0; + //MOD_SPARE = 0x1E1; + //MOD_SPARE = 0x1E2; + //MOD_SPARE = 0x1E3; + }; -#define MAX_MODIFIER 0x189 +#define MAX_MODIFIER 0x1DC Index: src/map/npcentity.cpp =================================================================== --- src/map/npcentity.cpp (revision 3304) +++ src/map/npcentity.cpp (working copy) @@ -31,10 +31,10 @@ /************************************************************************ * * -* Таймер для закрывания дверей. * +* Timer to close the doors. * * * -* Вообще можно подумать о реализации универсального таймера для * -* изменения анимации NPC, а не только закрытия дверей. * +* In general, you can think about the implementation of the universal * +* timer changes animation NPC, and not just close the door. * * * ************************************************************************/ Index: src/map/npcentity.h =================================================================== --- src/map/npcentity.h (revision 3304) +++ src/map/npcentity.h (working copy) @@ -28,7 +28,7 @@ #include "../common/taskmgr.h" #include "baseentity.h" -int32 close_door(uint32 tick,CTaskMgr::CTask *PTask); // закрываем дверь +int32 close_door(uint32 tick,CTaskMgr::CTask *PTask); // close the door int32 reappear_npc(uint32 tick,CTaskMgr::CTask *PTask); // used for hideNPC lua function class CNpcEntity : public CBaseEntity @@ -39,8 +39,8 @@ uint32 unknown; uint8 name_prefix; - CNpcEntity(); // конструктор - ~CNpcEntity(); // деструктор + CNpcEntity(); // Designer + ~CNpcEntity(); // Destructor private: }; Index: src/map/packet_system.cpp =================================================================== --- src/map/packet_system.cpp (revision 3304) +++ src/map/packet_system.cpp (working copy) @@ -134,7 +134,7 @@ /************************************************************************ * * -* Отображения содержимого входящего пакета в консоли * +* Display the contents of the incoming packet to the console * * * ************************************************************************/ @@ -162,7 +162,7 @@ /************************************************************************ * * -* Неизвестный пакет * +* Unknown package * * * ************************************************************************/ @@ -174,7 +174,7 @@ /************************************************************************ * * -* Нереализованный пакет * +* unrealized package * * * ************************************************************************/ @@ -186,10 +186,10 @@ /************************************************************************ * * -* Вход в зону * +* Log into the zone * * * -* Обновляем sessionkey и порт клиента при каждом переходе между зонами * -* Мы должны оставлять правильный ключ при переходе с сервера на сервер * +* Update sessionkey and client port at each transition between zones * +* We need to keep the correct key when moving from server to server * * * ************************************************************************/ @@ -197,7 +197,7 @@ { WBUFL(data,(0x5C)) = 0; - bool firstlogin = false; // временное решение, до появления PlayTime + bool firstlogin = false; // temporary solution until PlayTime PChar->clearPacketList(); @@ -244,7 +244,7 @@ const int8* fmtQuery = "UPDATE accounts_sessions SET targid = %u, session_key = x'%s', server_addr = %u, client_port = %u WHERE charid = %u"; - Sql_Query(SqlHandle,fmtQuery, + Sql_Query(SqlHandle,fmtQuery, PChar->targid, session_key, PChar->loc.zone->GetIP(), @@ -282,6 +282,8 @@ charutils::SaveCharPosition(PChar); charutils::SaveZonesVisited(PChar); + charutils::SavePlayTime(PChar); + PChar->pushPacket(new CDownloadingDataPacket()); PChar->pushPacket(new CZoneInPacket(PChar,EventID)); PChar->pushPacket(new CZoneVisitedPacket(PChar)); @@ -291,12 +293,12 @@ return; }; -/************************************************************************ -* * -* Пакет-запрос информации о персонаже. Приходит только во время * -* перехода между зонами / входа в игру (что почти одно и то же) * -* * -************************************************************************/ +/**************************************************************************** +* * +* Package request for information about a character. Comes only when * +* transition between zones / entry into the game (which is almost the same)* +* * +****************************************************************************/ void SmallPacket0x00C(map_session_data_t* session, CCharEntity* PChar, int8* data) { @@ -348,10 +350,10 @@ /************************************************************************ * * -* Персонаж покидает зону каким-либо из возможных способов. В случае * -* выхода из игры, текущая зона находится в переменной zone, во всех * -* остальных случаех в prevzone. Делаем соответствующую проверку для * -* правильного удаления персонажа их списка зоны. * +* Character leaves the area in any way possible. In the case of * +* exit the game, the current zone is in your zone, in all * +* in other sluchaeh prevzone. Making the appropriate test for * +* proper disposal of the character of the zone list. * * * ************************************************************************/ @@ -413,17 +415,17 @@ } if (PChar->PLinkshell != NULL) { - // удаляем персонажа из linkshell + // remove the character from the linkshell PChar->PLinkshell->DelMember(PChar); } CTaskMgr::getInstance()->AddTask(new CTaskMgr::CTask("close_session", gettick()+2500, session, CTaskMgr::TASK_ONCE, map_close_session)); } - else // проверка именно при покидании зоны, чтобы не делать двойную проверку при входе в игру + else // check it when leaving the area to do a double check at the entrance to the game { charutils::CheckEquipLogic(PChar, SCRIPT_CHANGEZONE, PChar->getZone()); } - // персонаж может отвалиться во время перехода между зонами, - // map_cleanup вызовет этот метод и zone персонажа будет NULL + // character can fall off during the transition between zones, + // map_cleanup calls this method and zone character will NULL if (PChar->loc.zone != NULL) { PChar->loc.zone->DecreaseZoneCounter(PChar); @@ -436,7 +438,7 @@ /************************************************************************ * * -* Запрос на список квестов и миссий, предметов и ключевых предметов * +* Request for a list of quests and missions, items and key items * * * ************************************************************************/ @@ -458,9 +460,9 @@ /************************************************************************ * * -* Первый пакет после входа в игру / перехода между зонами, является * -* подтверждением завершения перехода персонажа. * -* Привязываем экипированные предметы * +* The first packet after entering the game / transition between zones * +* is proof of completion of the transition of the character. * +* Tie items equipped, * * * ************************************************************************/ @@ -482,10 +484,10 @@ /************************************************************************ * * -* Перемещение персонажа (обновление позиции в зоне) * -* Обновление цели, выбранной персонажем, для правильного отображения * -* поворота головы. Из-за блуждания монстров необходимо проверять их * -* видимость постоянно, так же как и видимость питомцев * +* Move character (updated position in the area) * +* Update, in choosing a character to display correctly * +* head rotation. Because of the wandering monsters to check their * +* visibility of the time, as well as the appearance of pets * * * ************************************************************************/ @@ -531,11 +533,11 @@ return; } -/************************************************************************ -* * -* Клиент запрашивает информацию об NPC, для отображения их в событиях * -* * -************************************************************************/ +/**************************************************************************** +* * +* The client requests information about NPC, to display them in the events * +* * +****************************************************************************/ void SmallPacket0x016(map_session_data_t* session, CCharEntity* PChar, int8* data) { @@ -559,7 +561,7 @@ /************************************************************************ * * -* Kлиент сообщает серверу об ошибочном типе npc * +* Clients tells the server to the wrong type of npc * * * ************************************************************************/ @@ -575,8 +577,8 @@ /************************************************************************ * * -* Различные действия персонажа в игре: рыбалка, команды боя, общение * -* с npc и подобные * +* The various actions of the character in the game fishing, team * +* battle, communication and similar to the npc * * * ************************************************************************/ @@ -710,18 +712,18 @@ PChar->m_hasRaise = 0; } break; - case 0x0E: // рыбалка + case 0x0E: // fishing { fishingutils::StartFishing(PChar); } break; - case 0x0F: // смена цели во время боя + case 0x0F: // change targets in combat { PChar->PBattleAI->SetCurrentAction(ACTION_CHANGE_TARGET, TargID); PChar->PBattleAI->CheckCurrentAction(gettick()); } break; - case 0x10: // rangedattack + case 0x10: // ranged attack { PChar->PBattleAI->SetCurrentAction(ACTION_RANGED_START, TargID); PChar->PBattleAI->CheckCurrentAction(gettick()); @@ -754,7 +756,7 @@ break; case 0x13: // tractor menu { - // по любому, это работает неправильно. проблемный код в комментарии + // for anyone, it is not working properly. problem code in a comment //PChar->PBattleAI->SetCurrentAction(ACTION_RAISE_MENU_SELECTION); //PChar->PBattleAI->CheckCurrentAction(gettick()); @@ -774,7 +776,7 @@ */ } break; - case 0x14: // окончание обновления данных персонажа + case 0x14: // end update character { if (PChar->getZone() == 0) { @@ -807,7 +809,7 @@ /************************************************************************ * * -* Генерация World Pass * +* Generation World Pass * * * ************************************************************************/ @@ -821,9 +823,9 @@ /************************************************************************ * * -* Назначение пакета неизвестно, но начинает появляться при * -* использовании способностей, если у персонажа есть питомец. Возможно * -* клиент требует недостающие пакеты. * +* Purpose of the package is not known, but it is beginning to appear * +* in using the abilities, if a character has a pet. perhaps * +* client requires the missing packages. * * * ************************************************************************/ @@ -835,7 +837,7 @@ /************************************************************************ * * -* Удаление предметов из хранилищ * +* Removing items from storage * * * ************************************************************************/ @@ -865,7 +867,7 @@ /************************************************************************ * * -* Перемещение предметов между хранилищами * +* Moving objects between repositories * * * ************************************************************************/ @@ -913,18 +915,18 @@ uint32 NewQuantity = PItem->getQuantity() - quantity; - if(NewQuantity != 0) // делим пачку + if(NewQuantity != 0) // divide the pack { if (charutils::AddItem(PChar, ToLocationID, PItem->getID(), quantity) != ERROR_SLOTID) { charutils::UpdateItem(PChar, FromLocationID, FromSlotID, -(int32)quantity); } } - else // переносим всю пачку, или пытаемся объединить одинаковые предметы + else // transfer the entire stack, or trying to combine the same subjects { if (ToSlotID < 82) // 80 + 1 { - // объединение еще не реализовано + // the guild is not yet implemented ShowDebug("SmallPacket0x29: Trying to unite items\n", FromLocationID, FromSlotID); return; } @@ -942,19 +944,19 @@ { PChar->getStorage(FromLocationID)->InsertItem(NULL, FromSlotID); - PChar->pushPacket(new CInventoryItemPacket(NULL, FromLocationID, FromSlotID)); // убираем предмет из FormLocationID - PChar->pushPacket(new CInventoryItemPacket(PItem, ToLocationID, NewSlotID)); // добавляем предмет в ToLocationID + PChar->pushPacket(new CInventoryItemPacket(NULL, FromLocationID, FromSlotID)); // remove the item from the FormLocationID + PChar->pushPacket(new CInventoryItemPacket(PItem, ToLocationID, NewSlotID)); // add the item to the ToLocationID } - else // в случае ошибки отменяем перемещение предмета + else // in case of error cancel moving object { - PChar->getStorage(ToLocationID)->InsertItem(NULL, NewSlotID); // убираем предмет - PChar->getStorage(FromLocationID)->InsertItem(PItem, FromSlotID); // возвращаем предмет (для обновления Location и Slot предмета) + PChar->getStorage(ToLocationID)->InsertItem(NULL, NewSlotID); // remove item + PChar->getStorage(FromLocationID)->InsertItem(PItem, FromSlotID); // Returned items (to update the Location and Slot item) } } else { - // клиент не позволяет перемещать предмет в полный контейнер. - // если мы видим это сообщение, значит данные клиента и сервера различаются + // the client does not allow you to move the object in a full container. + // If we see this message, it means the data server and client are different // Client thinks that ToLocationID is NOT full, so lets send those packets again and tell them it is! uint8 size = PChar->getStorage(ToLocationID)->GetSize(); for(uint8 slotID = 0; slotID <= size; ++slotID) @@ -977,7 +979,7 @@ /************************************************************************ * * -* Запрос начала обмена между персонажами (trade) * +* Request early exchange between characters (trade) * * * ************************************************************************/ @@ -1019,7 +1021,7 @@ /************************************************************************ * * -* Запрос начала обмена между персонажами (trade) * +* Request early exchange between characters (trade) * * * ************************************************************************/ @@ -1035,13 +1037,13 @@ { case 0x00: // request accepted { - // цели обмена у персонажей соответствующие + // purpose of exchange of the characters corresponding if (PChar->TradePending.id == PTarget->id && PTarget->TradePending.id == PChar->id) { - // контейнеры у персонажей свободны + // containers of the characters are free if (PChar->UContainer->IsContainerEmpty() && PTarget->UContainer->IsContainerEmpty()) { - // между персонажами соответствующая дистанция + // corresponding to the distance between the characters if (distance(PChar->loc.p, PTarget->loc.p) < 6) { PChar->UContainer->SetType(UCONTAINER_TRADE); @@ -1061,10 +1063,10 @@ break; case 0x01: // trade cancelled { - // цели обмена у персонажей соответствующие + // purpose of exchange of the characters corresponding if (PChar->TradePending.id == PTarget->id && PTarget->TradePending.id == PChar->id) { - // контейнер у цели зарезервирован для обмена + // the target container is reserved for exchange if (PTarget->UContainer->GetType() == UCONTAINER_TRADE) { PTarget->TradePending.clean(); @@ -1082,13 +1084,13 @@ break; case 0x02: // trade accepted { - // цели обмена у персонажей соответствующие + // purpose of exchange of the characters corresponding if (PChar->TradePending.id == PTarget->id && PTarget->TradePending.id == PChar->id) { PChar->UContainer->SetLock(); PTarget->pushPacket(new CTradeActionPacket(PChar, action)); - // совершаем обмен предметами в контейнерах персонажей + // make an exchange items in containers characters if (PTarget->UContainer->IsLocked()) { if (charutils::CanTrade(PChar, PTarget) && charutils::CanTrade(PTarget, PChar)) @@ -1101,8 +1103,8 @@ } else { - // обмен не состоялся: - // недостаточно места в контейнере одного или обоих персонажей + // exchange did not take place: + // not enough space in the container of one or both characters // or // rare item in the exchange is owned by the recipient @@ -1125,7 +1127,7 @@ /************************************************************************ * * -* Заполняем ячейки окошка trade (обмен между персонажами) * +* Fill the cell window trade (the exchange between the characters) * * * ************************************************************************/ @@ -1145,7 +1147,7 @@ // We used to disable Rare/Ex items being added to the container, but that is handled properly else where now if (PItem != NULL && PItem->getID() == itemID) { - // если количество предметов равно нулю, то удаляем предмет из контейнера + // if the number of items is equal to zero, then remove the object from the container PItem->setReserve(quantity); PChar->UContainer->SetItem(tradeSlotID, quantity > 0 ? PItem : NULL); @@ -1158,7 +1160,7 @@ /************************************************************************ * * -* Передача предметов NPC (команда обмен - "trade") * +* Item History NPC (team sharing - "trade") * * * ************************************************************************/ @@ -1208,7 +1210,7 @@ /************************************************************************ * * -* Использование предметов * +* use of items * * * ************************************************************************/ @@ -1224,7 +1226,7 @@ { if (PItem->getType() & ITEM_ARMOR) { - //TODO: если ITEM_LOCKED, то должна быть проверка на то, что предмет экипирован + //TODO: if ITEM_LOCKED, it should be to check that the item equipped } else if (PItem->getSubType() & ITEM_LOCKED) { @@ -1250,9 +1252,9 @@ /************************************************************************ * * -* Сортировка инвентаря * -* Жестокий алгоритм, но лучшего для неупорядоченного массива не найдем * -* 80 - ячеек. Минимальное количество проверок - 80, максимальное 3240 * +* sorting equipment * +* Brutal algorithm, but better for the disordered array will not find * +* 80 - cells. The minimum number of inspections - 80, 3240 the maximum * * * ************************************************************************/ @@ -1318,8 +1320,8 @@ /************************************************************************ * * -* Вероятно сообщение о недополучении каких-либо инициализирующих * -* пакетов для монстров, npc или других игроков. всегда пустое. * +* Probably reported shortfall of any initialization * +* packages for the monsters, npc or other players. always empty. * * * ************************************************************************/ @@ -1331,7 +1333,7 @@ /************************************************************************ * * -* Персонаж голосует за предмет в TreasurePool * +* Character vote for the subject in TreasurePool * * * ************************************************************************/ @@ -1347,7 +1349,7 @@ /************************************************************************ * * -* Персонаж отказывается от предмета в TreasurePool * +* Character of the subject refuses to TreasurePool * * * ************************************************************************/ @@ -1363,9 +1365,9 @@ /************************************************************************ * * -* Отправляем приветственное сообщение сервера. * -* По умолчанию появится сообщение <<< Welcome to "server name" >>> + * -* можно отправить дополнительные строки информации в размере 230 байт * +* We send a welcome message server. * +* By default, the message <<< Welcome to "server name" >>> + * +* You can send additional information line at a rate of 230 bytes * * * ************************************************************************/ @@ -1377,7 +1379,7 @@ /************************************************************************ * * -* Все действия с Delivery Box * +* All actions with Delivery Box * * * ************************************************************************/ @@ -1390,28 +1392,28 @@ ShowDebug(CL_CYAN"DeliveryBox Action (%02hx)\n" CL_RESET, RBUFB(data,(0x04))); PrintPacket(data); - // 0x01 - отправка клиенту старых предметов - // 0x02 - добавление предметов в список отправляемых (подготовка к отправке) - // 0x03 - подтверждение отправки (отправляем предметы) - // 0x04 - возврат неправильно отправленного предмета (отмена выполненной отправки) - // 0x05 - отправка клиенту количества новых предметов - // 0x06 - отправка клиенту новых предметов + // 0x01 - sending client older subjects + // 0x02 - adding items to the list sent by (preparing to send) + // 0x03 - send confirmation (sent items) + // 0x04 - return wrong item sent (cancellation made ​​sending) + // 0x05 - sending the client the number of new items + // 0x06 - sending customers new items // 0x07 - removes a delivered item from sending box - // 0x08 - обновление предмета в ячейке перед удалением - // 0x09 - вернуть предмет отправителю - // 0x0a - взять предмет из ячейки - // 0x0b - удаление предмета из ячейки - // 0x0c - подтверждение введенного имени в окне отправки - // 0x0d - открытие окна отправки почты - // 0x0e - открытие окна приема почты - // 0x0f - закрытие окна почты + // 0x08 - Update item in the cell before removing + // 0x09 - return the item to the sender + // 0x0a - take an object from a cell + // 0x0b - remove the item from the cell + // 0x0c - confirmation of the name entered in the Send window + // 0x0d - opening a window to send mail + // 0x0e - opening a window to receive mail + // 0x0f - closing windows mail switch (action) { case 0x01: { - // отправляем персонажу старые предметы (предметы, которые персонаж уже видел в delivery box) - // все старые предметы расположены в ячейках 0-7 + // Send character to old items (items that characters already seen in delivery box) + // All items are located in the old cells 0-7 if (boxtype == 0x01) @@ -1619,9 +1621,9 @@ } case 0x05: { - // отправляем персонажу количество новых предметов (предметы, которые персонаж еще не видел в delivery box) - // все новые предметы помещаются в контейнет начиная со значения 8 - // перемещаем новые предметы в свободные ячейки delivery box + // Send the character of the new items (items that the character has not seen in a delivery box) + // All new items are placed in konteynet starting at 8 + // Move the new items free cell delivery box if (PChar->UContainer->GetType() != UCONTAINER_DELIVERYBOX) return; @@ -1678,17 +1680,17 @@ case 0x06: case 0x08: { - // 0x08 и 0x06 идентичны + // 0x08 and 0x06 are identical // - // 0х06 - добавляем предмет в определенную ячейку - // 0х08 - обновляем предмет в определенной ячейке + // 0х06 - adds an item to a specific cell + // 0х08 - Updates item in a particular cell - // отправляем персонажу все новые предметы (предметы, которые персонаж еще не видел в delivery box) - // клиент отправляет запрос серверу для каждого нового предмета, при этом указывая, какая ячейка его интересует + // Send a character all new items (items that the character has not seen in a delivery box) + // The client sends a request to the server for each new object, in this case indicating which cell he is interested // - // сервер должен отправлять два пакета с действием 0х06 - // у первого пакета data[0x0c] равняется 0x02, у второго 0x01, в остальном заголовок идентичен - // возможно это связано с тем, что я сам отправлял себе предметы + // Server is to send two packages to the action 0x06 + // In the first packet data [0x0c] is equal to 0x02, the second 0x01, otherwise identical to the title + // Perhaps this is due to the fact that I did send yourself items // // 0x4b 0x2c 0x00 0x00 0x06 0x01 0x01 0x01 0xff 0xff 0xff 0xff 0x02 0x01 0xff 0xff // 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 @@ -1696,8 +1698,8 @@ // 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 // 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 // - // зачем нужен этот пустой пакет я не знаю, но и без него все отлично работает - // предположительно он отчищает целевую ячейку от предметов, на всякий случай + // Why do I need this empty package I do not know, but without it everything works fine + // Presumably it cleans the target cell from the objects, just in case if (PChar->UContainer->GetType() == UCONTAINER_DELIVERYBOX && !PChar->UContainer->IsSlotEmpty(slotID)) @@ -1876,7 +1878,7 @@ } case 0x0B: // Option: Drop { - // удаление предмета из ячейки + // Remove the object from memory if (PChar->UContainer->GetType() == UCONTAINER_DELIVERYBOX && !PChar->UContainer->IsSlotEmpty(slotID)) @@ -1987,7 +1989,7 @@ break; } - // отправка простых действий - открыть окно почты, закрыть окно почты + // Send simple steps - open the email, close the mail PChar->pushPacket(new CDeliveryBoxPacket(action, 0)); return; @@ -1995,7 +1997,7 @@ /************************************************************************ * * -* Все действия с Auction House * +* All the action from the Auction House * * * ************************************************************************/ void SmallPacket0x04E(map_session_data_t* session, CCharEntity* PChar, int8* data) @@ -2009,14 +2011,15 @@ ShowDebug(CL_CYAN"AH Action (%02hx)\n" CL_RESET, RBUFB(data,(0x04))); - // 0x04 - продажа предмета - // 0x05 - похоже, что в ответ на этот пакет мы можем открыть список продаж или предложить персонажу подождать немного - // 0x0A - получение списка продаваемых персонажем предметов - // 0x0B - подтверждение покупки - // 0x0E - покупка предмета - // 0x0С - отмена продажи - // 0x0D - обновление списка продаваемых персонажем предметов + // 0x04 - Sale of + // 0x05 - it seems that the answer to this package, we can open a list of sales or offer to wait a little character + // 0x0A - get a list of items sold by character + // 0x0B - proof of purchase + // 0x0E - Item Purchase + // 0x0С - cancellation of sale + // 0x0D - updating the list of items sold by character + switch(action) { case 0x04: @@ -2251,7 +2254,7 @@ /************************************************************************ * * -* Смена экипировки * +* Change of equipment * * * ************************************************************************/ @@ -2274,7 +2277,7 @@ /************************************************************************ * * -* Завершение синтеза * +* Completion of the synthesis * * * ************************************************************************/ @@ -2286,17 +2289,18 @@ /************************************************************************ * * -* Обновляем карты conquest, besieged, compaing * +* Update map conquest, besieged, compaing * * * ************************************************************************/ void SmallPacket0x05A(map_session_data_t* session, CCharEntity* PChar, int8* data) { + // Refresh the amount of conquest points the player has to correctly reflect on the map. PChar->pushPacket(new CConquestPacket(PChar)); PChar->pushPacket(new CCampaingPacket(PChar,0)); PChar->pushPacket(new CCampaingPacket(PChar,1)); - // пакет не на своем месте, возможно 0x0F + // the package is not in place, may 0x0F PChar->pushPacket(new CStopDownloadingPacket(PChar)); // luautils::CheckForGearSet(PChar); // also check for gear set return; @@ -2304,7 +2308,7 @@ /************************************************************************ * * -* Завершаем или обновляем текущее событие * +* Finish or update event * * * ************************************************************************/ @@ -2328,8 +2332,8 @@ /************************************************************************ * * -* Завершаем или обновляем текущее событие * -* Так же требуется обновить позицию персонажа * +* Finish or update event * +* Just want to update the position of the character * * * ************************************************************************/ @@ -2357,7 +2361,7 @@ /************************************************************************ * * -* Эмоции персонажей, включая специфические (/jobemote [job]) * +* Emotions of characters, including specific (/jobemote [job]) * * * ************************************************************************/ @@ -2375,7 +2379,7 @@ /************************************************************************ * * -* Перемещение персонажа между зонами (zoneline) * +* Move your character between areas (zoneline) * * * ************************************************************************/ @@ -2418,13 +2422,13 @@ uint32 zoneLineID = RBUFL(data,(0x04)); //TODO: verify packet in adoulin expansion - uint8 town = RBUFB(data,(0x16)); // используются при выходе из mog house - uint8 zone = RBUFB(data,(0x17)); // используются при выходе из mog house + uint8 town = RBUFB(data,(0x16)); // used when exiting the mog house + uint8 zone = RBUFB(data,(0x17)); // used when exiting the mog house - // переход между зонами с использованием таблицы zoneline + // transition between areas with tables zoneline // - // игнорируем все zoneline пакеты, - // пока не завершен текущий переход + // ignore all packets zoneline, + // not yet completed the current transition if (PChar->status == STATUS_NORMAL || PChar->status == STATUS_UPDATE) @@ -2434,9 +2438,9 @@ zoneLine_t* PZoneLine = PChar->loc.zone->GetZoneLine(zoneLineID); - if (PZoneLine == NULL) // разворачиваем персонажа на 180° и отправляем туда, откуда пришел + if (PZoneLine == NULL) // we develop the character by 180 ° and send back where you came from { - ShowError(CL_RED"SmallPacket0x5E: Zone line %u not found\n" CL_RESET, zoneLineID); // в идеале нужно добавить зону и координаты + ShowError(CL_RED"SmallPacket0x5E: Zone line %u not found\n" CL_RESET, zoneLineID); // Ideally, you want to add a zone and coordinates PChar->loc.p.rotation += 128; @@ -2446,7 +2450,7 @@ PChar->status = STATUS_UPDATE; return; }else{ - if (zoneutils::GetZone(PZoneLine->m_toZone)->GetIP() == 0) // разворачиваем персонажа на 180° и отправляем туда, откуда пришел + if (zoneutils::GetZone(PZoneLine->m_toZone)->GetIP() == 0) // we develop the character by 180 ° and send back where you came from { ShowDebug(CL_CYAN"SmallPacket0x5E: Zone %u closed to chars\n" CL_RESET, PZoneLine->m_toZone); @@ -2463,7 +2467,7 @@ { uint16 prevzone = PChar->loc.prevzone; - if (zone != 0) // 0 - выход в предыдущую зону, остальные значения - выбор зоны по имени + if (zone != 0) // 0 - return to the previous area, the other values ​​- Select a named { switch (town) { @@ -2490,7 +2494,7 @@ /************************************************************************ * * -* Персонаж присылает текстовую информацию для продолжения события * +* Character sends text information to continue the event * * * ************************************************************************/ @@ -2526,7 +2530,7 @@ /************************************************************************ * * -* Завершение раскопок chocobo (chocobo gigging) * +* Completion of excavation chocobo (chocobo digging) * * * ************************************************************************/ @@ -2537,7 +2541,7 @@ /************************************************************************ * * -* Помечаем KeyItem как "увиденный" * +* KeyItem mark as "seen" * * * ************************************************************************/ @@ -2552,7 +2556,7 @@ /************************************************************************ * * -* Окончание рыбалки * +* End of fishing * * * ************************************************************************/ @@ -2569,7 +2573,7 @@ /************************************************************************ * * -* Персонаж приглашает другого персонажа в группу * +* Character invites another character in the group * * * ************************************************************************/ @@ -2578,7 +2582,7 @@ uint32 charid = RBUFL(data,0x04); uint16 targid = RBUFW(data,0x08); - // Персонаж не должен приглашать сам себя. + // Character should not invite himself. if (PChar->id == charid) return; @@ -2591,7 +2595,7 @@ if (PChar->PParty == NULL || PChar->PParty->GetLeader() == PChar) { - // если targid персонажа клиенту не известен, то получаем его из таблицы активных сессий + // if targid character client is not known, then we get it from the table of active sessions if (targid == 0) { int32 ret = Sql_Query(SqlHandle, "SELECT targid FROM accounts_sessions WHERE charid = %u LIMIT 1", charid); @@ -2656,7 +2660,7 @@ /************************************************************************ * * -* Персонаж покидает группу * +* Character leaves the group * * * ************************************************************************/ @@ -2697,7 +2701,7 @@ /************************************************************************ * * -* Лидер распускает группу * +* The leader of the group disbands * * * ************************************************************************/ @@ -2722,7 +2726,7 @@ /************************************************************************ * * -* Удаляем члена группы или linckshell * +* Remove a group member or linkshell * * * ************************************************************************/ @@ -2765,7 +2769,7 @@ /************************************************************************ * * -* Персонаж отвечает на приглашение в группу * +* Characters respond to an invitation to the group * * * ************************************************************************/ @@ -2846,7 +2850,7 @@ /************************************************************************ * * -* Персонаж запрашивает информацию о членах группы * +* A character asks for information about the members of the group * * * ************************************************************************/ @@ -2917,7 +2921,7 @@ /************************************************************************ * * -* Запрос перед поиском членов группы * +* Ask before finding members * * * ************************************************************************/ @@ -2929,7 +2933,7 @@ /************************************************************************ * * -* Покупка предмета в магазине * +* Purchase items in the store * * * ************************************************************************/ @@ -2939,7 +2943,7 @@ uint8 shopSlotID = RBUFB(data,(0x0A)); uint16 itemID = PChar->Container->getItemID(shopSlotID); - uint32 price = PChar->Container->getQuantity(shopSlotID); // здесь мы сохранили стоимость предмета + uint32 price = PChar->Container->getQuantity(shopSlotID); // Here we have kept the value of the subject CItem* gil = PChar->getStorage(LOC_INVENTORY)->GetItem(0); @@ -2963,9 +2967,9 @@ /************************************************************************ * * -* Оценка стоимости предмета перед продажей в магазин * -* Помещаем информацию о продаваемом предмете в последнюю ячейку * -* контейнера * +* Evaluation value of the subject prior to the sale in the shop * +* Put the information on to sell items to the last cell * +* container * * * ************************************************************************/ @@ -2980,7 +2984,7 @@ (PItem->getID() == itemID) && !(PItem->getFlag() & ITEM_FLAG_NOSALE) ) { - // подготавливаем предмет для продажи + // prepare the item for sale PChar->Container->setItem(16, itemID, slotID, quantity); PChar->pushPacket(new CShopAppraisePacket(slotID, PItem->getBasePrice())); } @@ -2989,9 +2993,9 @@ /************************************************************************ * * -* Продажа предмета в магазин * -* Информация о продаваемом предмете была предварительно сохранена в * -* последней (16-ой) ячейке контейнера в 0x084-ом пакете * +* Sale of the store * +* Information of valuables was previously stored in the * +* the last (16th) in the cell container 0x084-th package * * * ************************************************************************/ @@ -3012,15 +3016,15 @@ PChar->pushPacket(new CMessageStandardPacket(0, itemID, quantity, 232)); PChar->pushPacket(new CInventoryFinishPacket()); } - // очищаем ячейку для безопасности (защита от группы 0x085-ых пакетов) + // clear the box for security (protection from the group's 0x085-packages) PChar->Container->setItem(16,0,-1,0); return; } /************************************************************************ * * -* Начало синтеза * -* В нулевой ячейке будет храниться кристалл * +* Home synthesis * +* In the zero cell is stored crystal * * * ************************************************************************/ @@ -3090,7 +3094,7 @@ /************************************************************************ * * -* Генерация случайного числа (команда /diceroll) * +* Generate a random number (command / diceroll) * * * ************************************************************************/ @@ -3104,10 +3108,17 @@ /************************************************************************ * * -* Отправляем персонажу список продаваемых гильдией предметов * +* Buy an item from a guild * * * ************************************************************************/ + +/************************************************************************ +* * +* Send the character to the list of items sold by the guild * +* * +************************************************************************/ + void SmallPacket0x0AB(map_session_data_t* session, CCharEntity* PChar, int8* data) { if (PChar->PGuildShop != NULL) @@ -3153,7 +3164,7 @@ /************************************************************************ * * -* Отправляем персонажу список покупаемых гильдией предметов * +* Send the character to the list of items purchased by the guild * * * ************************************************************************/ @@ -3168,7 +3179,7 @@ /************************************************************************ * * -* Текстовое общение между персонажами (chat) * +* Text communication between characters (chat) * * * ************************************************************************/ @@ -3243,69 +3254,81 @@ /************************************************************************ * * -* Текстовое общение между персонажами /tell * +* Text communication between characters /tell * * * ************************************************************************/ void SmallPacket0x0B6(map_session_data_t* session, CCharEntity* PChar, int8* data) { - if(jailutils::InPrison(PChar)) + string_t RecipientName = data+5; + string_t message = data+20; + ShowNotice(CL_RED"SENDING MESSAGE %s TO PLAYER %s FROM PLAYER %s\n" CL_RESET,message.c_str(),RecipientName.c_str(),PChar->GetName()); + if(jailutils::InPrison(PChar)) { + ShowNotice(CL_GREEN"SENDING MESSAGE: TO SENDER JAIL\n" CL_RESET); PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 316)); return; } + CCharEntity* PTargetChar = zoneutils::GetCharByName(data+5); + if(PTargetChar != NULL ) + { + ShowNotice(CL_GREEN"SENDING MESSAGE IS NOT NULL OK TO SEND\n" CL_RESET); + if (PTargetChar->nameflags.flags == FLAG_AWAY) + { + ShowNotice(CL_GREEN"SENDING MESSAGE: RECEIVER HAS AWAY FLAG SET TELL SENDER\n" CL_RESET); + PChar->pushPacket(new CMessageStandardPacket(PChar, 0, 0, 181)); + return; + } + if( PTargetChar->status != STATUS_DISAPPEAR) + { + ShowNotice(CL_GREEN"SENDING MESSAGE: RECEIVER IS NOT ZONING SEND MESSAGE OK\n" CL_RESET); + PTargetChar->pushPacket(new CChatMessagePacket(PChar, MESSAGE_TELL,data+20 )); + return; + } + else + { + ShowNotice(CL_GREEN"SENDING MESSAGE: RECEIVER IS ZONEING TELL SENDER\n" CL_RESET); + PChar->pushPacket(new CMessageStandardPacket(PChar, 0, 0, 125)); + return; + } + return; + } + else + { - string_t RecipientName = data+5; + ShowNotice(CL_GREEN"SENDING MESSAGE: DO A FULL SWEEP\n" CL_RESET); + map_session_list_t::iterator it = map_session_list.begin(); + while(it != map_session_list.end()) + { + map_session_data_t* map_session_data = it->second; + CCharEntity* PCharInMog = map_session_data->PChar; + if(PCharInMog!=NULL) + { + ShowNotice(CL_GREEN"SENDING MESSAGE: PLAYER IS NOT NULL\n" CL_RESET); + PTargetChar = PCharInMog; + PCharInMog->pushPacket(new CChatMessagePacket(PChar, MESSAGE_TELL,data+20 )); + break; + } + else + { + ShowNotice(CL_GREEN"SENDING MESSAGE: RECEIVER IS NOT ONLINE TELL SENDER\n" CL_RESET); + PChar->pushPacket(new CMessageStandardPacket(PChar, 0, 0, 125)); + break; + } + ++it; + } + + + return; + } + - const int8* Query = "SELECT charid, targid, pos_zone FROM chars INNER JOIN accounts_sessions USING(charid) WHERE charname = '%s' LIMIT 1"; - - int32 ret = Sql_Query(SqlHandle, Query, RecipientName.c_str()); - - if (ret != SQL_ERROR && - Sql_NumRows(SqlHandle) != 0 && - Sql_NextRow(SqlHandle) == SQL_SUCCESS) - { - uint32 CharID = (uint32)Sql_GetUIntData(SqlHandle,0); - uint16 TargID = (uint16)Sql_GetUIntData(SqlHandle,1); - uint16 ZoneID = (uint16) Sql_GetUIntData(SqlHandle,2); - - CCharEntity* PTellRecipient = (CCharEntity*)zoneutils::GetZone(ZoneID)->GetEntity(TargID, TYPE_PC); - - if(PTellRecipient==NULL && ZoneID==0){//in a moghouse, do a full sweep - map_session_list_t::iterator it = map_session_list.begin(); - while(it != map_session_list.end()) - { - map_session_data_t* map_session_data = it->second; - CCharEntity* PChar = map_session_data->PChar; - if(PChar!=NULL && PChar->id == CharID){ - PTellRecipient = PChar; - break; - } - ++it; - } - } - - if (PTellRecipient != NULL && - PTellRecipient->id == CharID && - PTellRecipient->status != STATUS_DISAPPEAR && - !jailutils::InPrison(PTellRecipient)) - { - if (PTellRecipient->nameflags.flags & FLAG_AWAY) - { - PChar->pushPacket(new CMessageStandardPacket(PChar, 0, 0, 181)); - return; - } - PTellRecipient->pushPacket(new CChatMessagePacket(PChar, MESSAGE_TELL, data+20)); - return; - } - } - PChar->pushPacket(new CMessageStandardPacket(PChar, 0, 0, 125)); - return; + return; } /************************************************************************ * * -* Меняем режим получения опыта и усиливаем/ослабляем merits * +* Change the mode to gain experience and strengthen / weaken merits * * * ************************************************************************/ @@ -3316,7 +3339,7 @@ switch(RBUFB(data,(0x04))) { - case 2: // изменение mode + case 2: // change mode { // TODO: you can switch mode anywhere except in besieged & under level restriction if (Sql_Query(SqlHandle, "UPDATE char_exp SET mode = %u WHERE charid = %u", operation, PChar->id) != SQL_ERROR) @@ -3328,11 +3351,11 @@ break; case 3: // изменение merit { - if (PChar->getZone() == 0) // все операции обрабатываются только в moghouse + if (PChar->getZone() == 0) // All transactions are processed only moghouse { MERIT_TYPE merit = (MERIT_TYPE)(RBUFW(data,(0x06)) << 1); - if (PChar->PMeritPoints->IsMeritExist(merit)) // проверяем присланный персонажем id + if (PChar->PMeritPoints->IsMeritExist(merit)) // check sent to the character id { switch (operation) { @@ -3374,7 +3397,7 @@ /************************************************************************ * * -* Создание жемчужины (Pearl) экипированной LinkShell * +* Creating Pearl (Pearl) Equipped LinkShell * * * ************************************************************************/ @@ -3400,7 +3423,7 @@ /************************************************************************ * * -* Создание и экипировка LinkShell * +* Creating and equipping LinkShell * * * ************************************************************************/ @@ -3413,13 +3436,13 @@ if (PItemLinkshell != NULL && (PItemLinkshell->getType() & ITEM_LINKSHELL)) { - if (PItemLinkshell->getID() == 512) // создание новой linkshell + if (PItemLinkshell->getID() == 512) // creation of a new linkshell { uint32 LinkshellID = 0; uint16 LinkshellColor = RBUFW(data,(0x04)); string_t LinkshellName = data+8; - // TODO: проверить имя на необходимость добавления окончания строки + // TODO: check the name of the need to add a line break if (LinkshellID = linkshell::RegisterNewLinkshell(LinkshellName.c_str(), LinkshellColor)) // здесь дейтсвительно присваивание { @@ -3507,7 +3530,7 @@ /************************************************************************ * * -* Отображаем членов группы на карте * +* Display the members of the group on the map * * * ************************************************************************/ @@ -3551,7 +3574,7 @@ /************************************************************************ * * -* Отправляем жалобу GM'y * +* Send the complaint to GM * * help desk -> i want to report -> yes -> yes -> execute * * * ************************************************************************/ @@ -3563,8 +3586,8 @@ /************************************************************************ * * -* Установка разных nameFlags: party, away, autogroup, * -* флаги в help desk и т.д. * +* installation of all nameFlags: party, away, autogroup, * +* flags help desk etc. * * * ************************************************************************/ @@ -3605,7 +3628,7 @@ /************************************************************************ * * -* Устанавливаем предпочтительный язык общения * +* Set the preferred language of communication * * * ************************************************************************/ @@ -3617,7 +3640,7 @@ /************************************************************************ * * -* Проверяем монстров или персонажей * +* Check monsters or characters * * * * 170 - seems It seems to have high evasion and defense. * * 171 - seems It seems to have high evasion. * @@ -3668,9 +3691,9 @@ uint8 MessageValue = 0; - // TODO: Логическая ошибка использовать exp для определения сложности боя - // необходимы условия, основанные на разницах уровня - // не стоит забывать, что эта разница увеличивается с ростом уровня персонажа + // TODO: The logical fallacy to use for determining the complexity exp battle + // necessary conditions, based on the level difference + // do not forget that this difference increases with the level of character if (baseExp >= 400) MessageValue = 0x46; else if (baseExp >= 240) MessageValue = 0x45; @@ -3716,8 +3739,8 @@ /************************************************************************ * * -* Устанавливаем сообщене bazaar * -* Буфера в 256 байт вполне достаточно для преобразования 120 байт * +* Sets the message bazaar * +* Buffer of 256 bytes is sufficient to convert the 120 bytes * * * ************************************************************************/ @@ -3735,9 +3758,9 @@ /************************************************************************ * * -* Комментарий, отображаемый в списке поиска * -* Не уверен насчет необходимости удаления пробелов в конце строки, * -* об их назначении мы узнаем лишь после реализации поиска * +* Comment to be displayed in the search list * +* Not sure about the need to remove trailing spaces, * +* Their appointment we learn only after the implementation of search * * * ************************************************************************/ @@ -3748,8 +3771,8 @@ PChar->search.messagetype = RBUFB(data,(0xA4)); - // в ответ на этот пакет не нужно посылать что-либо клиенту - // эта информация используется лишь при поиске персонажа + // in response to this package does not need to send anything to the client + // This information is only used when searching for a character // s a l u t //e0 4c c2 00 73 61 6c 75 74 20 20 20 20 20 20 20 @@ -3763,8 +3786,8 @@ //00 00 00 00 2f 15 4c 4b 57 49 4e 08 3f 00 00 00 //ff 00 00 00 11 00 00 00 - // сообщение максимум 120, 3 строки по 40 символов, идущие подряд, начиная с 5-го байта - // тип сообщения - 4й байт с конца + // Post a maximum of 120, 3 lines of 40 characters, consecutive, starting from the 5th byte + // type of message - 4th byte from the end //EXP party //0x11 - seek party @@ -3797,7 +3820,7 @@ /************************************************************************ * * -* Отправляем персонажу приветственное сообщение LinkShell (/lsmes) * +* Send the character to the welcome message LinkShell (/lsmes) * * * ************************************************************************/ @@ -3812,7 +3835,7 @@ /************************************************************************ * * -* Обновление преветственного cообщения LinkShell * +* Update prevetstvennogo Ups LinkShell * * * ************************************************************************/ @@ -3822,14 +3845,14 @@ if (PChar->PLinkshell != NULL && (PItemLinkshell != NULL && (PItemLinkshell->getType() & ITEM_LINKSHELL))) { - switch (RBUFB(data,(0x04)) & 0xF0) // назначение первых бит пока неизвестно + switch (RBUFB(data,(0x04)) & 0xF0) // assignment of the first bit is unknown { - case 0x20: // устанавливаем права на изменение сообщения + case 0x20: // establish the right to change the message { // TODO: .... } break; - case 0x40: // изменяем сообщение + case 0x40: // Variable Message { if (PItemLinkshell->GetLSType() == LSTYPE_LINKSHELL || PItemLinkshell->GetLSType() == LSTYPE_PEARLSACK) @@ -3862,9 +3885,9 @@ /************************************************************************ * * -* Запрос на выход из игры. Shutdown и Logout отправляют одинаковые * -* запросы. В MogHouse персонаж выходит сразу, без задержки в 30 секунд * -* * +* Request to exit from the game. Shutdown and Logout send the same * +* requests. In MogHouse character goes at once, without delay of 30 * +* seconds * * ExitType: 1 - logout; 3 - shutdown * * * ************************************************************************/ @@ -3910,8 +3933,8 @@ /************************************************************************ * * -* Отдых персонажа (восстановление жизней, выход из игры, прерывание * -* чтения заклинаний, повышенная агрессия монстров и т.д.) * +* Rest of the character (recovery of lives out of the game, the * +* interrupt reading spells, increased aggression monsters, etc.) * * * ************************************************************************/ @@ -3953,7 +3976,7 @@ /************************************************************************ * * -* Команда /sit (персонаж садится и наслаждается окружением) * +* Team / sit (character sits down and enjoys the environment) * * * ************************************************************************/ @@ -3970,7 +3993,7 @@ /************************************************************************ * * -* Удаление статус эффекта щелчком по его иконке * +* Removing the effect of the status by clicking on its icon * * * ************************************************************************/ @@ -3987,9 +4010,9 @@ /************************************************************************ * * -* Клиент сообщает серверу, что входит в подобласть зоны * -* (в простонародье - boundary). Во избежание всяких казусов мы должны * -* сразу сохранять эту переменную. * +* The client tells the server that is a subdomain of the zone * +* (in common - boundary). To prevent any incidents we have * +* immediately to keep this variable. * * * ************************************************************************/ @@ -4003,7 +4026,7 @@ /************************************************************************ * * -* Сканирование местности (Wide Scan) * +* scanning area (Wide Scan) * * * ************************************************************************/ @@ -4015,7 +4038,7 @@ /************************************************************************ * * -* Следим за выбранной целью в Wide Scan * +* We scan the selected target in Wide Scan * * * ************************************************************************/ @@ -4029,7 +4052,7 @@ /************************************************************************ * * -* Отмена слежения за целью, выбранной в Wide Scan * +* Cancel target tracking is selected in the Wide Scan * * * ************************************************************************/ @@ -4041,7 +4064,7 @@ /************************************************************************ * * -* Установка мебели в MogHouse * +* Installation of furniture in MogHouse * * * ************************************************************************/ @@ -4051,8 +4074,8 @@ if (ItemID == 0) { - // выход из режима установки мебели - // здесь мы считаем ауру и добавляем необходимый keyitem + // Exit from the installation of furniture + // Here we consider the aura and adds the necessary keyitem return; } @@ -4103,7 +4126,7 @@ /************************************************************************ * * -* Удаление мебели в MogHouse * +* Removal of furniture MogHouse * * * ************************************************************************/ @@ -4126,7 +4149,7 @@ PItem->getID() == ItemID && PItem->getType() & ITEM_FURNISHING) { - // TODO: удаление мебели может никак не повлиять на размер хранилища, если сумма Storage превышала 80 ячеек + // TODO: removal of furniture can not change the size of the repository, if the amount of more than 80 cells Storage PItemContainer = PChar->getStorage(LOC_STORAGE); @@ -4179,12 +4202,12 @@ return; } -/************************************************************************ -* * -* Смена профессии. Разрешена только в зоне с флагом MISC_MOGMENU. * -* При смене профессии с персонажа снимаются все положительные эффекты * -* * -************************************************************************/ +/******************************************************************************** +* * +* Change of profession. Permitted only in the area of ​​the flag MISC_MOGMENU. * +* When switching jobs with character removed all the positive effects * +* * +********************************************************************************/ void SmallPacket0x100(map_session_data_t* session, CCharEntity* PChar, int8* data) { @@ -4245,7 +4268,7 @@ /************************************************************************ * * -* Устанавливаем активные заклинания синего мага, модифицируем автомат * +* Set the active blue mage spells, modify machine * * * ************************************************************************/ @@ -4302,7 +4325,7 @@ if (PTarget != NULL && PTarget->id == PChar->BazaarID.id) { - // надеюсь, что персонаж прописался в массиве однажны, но на всякий случай пробегаем по всему + // I hope that person is registered in the array odnazhny, but just in case, looping around for (uint32 i = 0; i < PTarget->BazaarCustomers.size(); ++i) { if (PTarget->BazaarCustomers[i].id == PChar->targid) @@ -4394,7 +4417,7 @@ if (charutils::AddItem(PChar, LOC_INVENTORY, PItem) == ERROR_SLOTID) return; - // TODO: мне так лень делать проверки на текущее количество gil, на первое время понадеемся на клиента + // TODO: I'm so lazy to do checks on the current amount of gil, for the first time cleave to the client uint32 Price1 = (PBazaarItem->getCharPrice() * Quantity); // цена uint32 Price2 = (PChar->loc.zone->GetTax() * Price1) / 10000 + Price1; // цена + налог @@ -4455,7 +4478,7 @@ /************************************************************************ * * -* Выходим из режима установки цен bazaar * +* Exit the setting of prices bazaar * * * ************************************************************************/ @@ -4480,7 +4503,7 @@ /************************************************************************ * * -* Устанавливаем цены bazaar на предметы * +* Set prices for items bazaar * * * ************************************************************************/ @@ -4531,7 +4554,7 @@ /************************************************************************ * * -* Инициализация массива процедур * +* Array initialization procedures * * * ************************************************************************/ Index: src/map/packet_system.h =================================================================== --- src/map/packet_system.h (revision 3304) +++ src/map/packet_system.h (working copy) @@ -30,7 +30,7 @@ struct map_session_data_t; -extern uint8 PacketSize[512]; // массив размеров входящих пакетов +extern uint8 PacketSize[512]; // array size of incoming packets extern void (*PacketParser[512])(map_session_data_t*, CCharEntity*, int8*); Index: src/map/packets/action.cpp =================================================================== --- src/map/packets/action.cpp (revision 3304) +++ src/map/packets/action.cpp (working copy) @@ -38,10 +38,10 @@ /************************************************************************ * * -* ActionTargetID содержит ID цели, над которой производится действие, * -* Если над целью необходимо произвести несколько действий, то в * -* последующих структурах это поле оставляется пустым (равным нулю), * -* это говорит о том, что это действие над ранее указанной целью * +* ActionTargetID ID contains objectives on which the action is, * +* If the purpose of the need to make a few steps, then * +* subsequent structures leave this field empty (zero), * +* this suggests that this action of the previously stated purpose * * * ************************************************************************/ @@ -371,21 +371,21 @@ { TargetNum++; - bitOffset = packBitsBE(data, Action.ActionTarget->id, bitOffset, 32); // тип совершаемого действия - bitOffset = packBitsBE(data, 1, bitOffset, 4); // количество действий над целью, в данном случае одно + bitOffset = packBitsBE(data, Action.ActionTarget->id, bitOffset, 32); // type performs actions + bitOffset = packBitsBE(data, 1, bitOffset, 4); // the number of actions over the target, in this case one ActionNum = 0; } - bitOffset = packBitsBE(data, Action.reaction, bitOffset, 5); // физическая реакция на урон - bitOffset = packBitsBE(data, Action.animation+animOffset, bitOffset, 11); // анимация специальных эффектов (monster TP animations are 1800+) + bitOffset = packBitsBE(data, Action.reaction, bitOffset, 5); // physical reaction to loss + bitOffset = packBitsBE(data, Action.animation+animOffset, bitOffset, 11); // Animation Special Effects (monster TP animations are 1800+) bitOffset += 1; bitOffset = packBitsBE(data, Action.speceffect, bitOffset, 9); // specialEffect bitOffset += 1; - bitOffset = packBitsBE(data, Action.param, bitOffset, 17); // параметр сообщения (урон) - bitOffset = packBitsBE(data, Action.messageID, bitOffset, 10); // сообщение + bitOffset = packBitsBE(data, Action.param, bitOffset, 17); // Customize message (Done) + bitOffset = packBitsBE(data, Action.messageID, bitOffset, 10); // message bitOffset += 31; - bitOffset = packBitsBE(data, Action.flag, bitOffset, 2); // флаг, ??? наличие дополнительного эффекта ??? + bitOffset = packBitsBE(data, Action.flag, bitOffset, 2); // flag ??? that an additional effect ??? if (Action.flag != 0) { @@ -404,10 +404,10 @@ } bitOffset = packBitsBE(data, Action.subeffect, bitOffset, subeffectLength); - // анимация эффекта, точный размер не известен (эффектов не так уж и много, около десяти) - bitOffset = packBitsBE(data, Action.subparam, bitOffset, subparamLength); // параметр сообщения (урон) + // animation effect, the exact size is not known (effects not too much, about ten) + bitOffset = packBitsBE(data, Action.subparam, bitOffset, subparamLength); // Customize message (Done) bitOffset += 1; - bitOffset = packBitsBE(data, Action.submessageID, bitOffset, 10); // сообщение + bitOffset = packBitsBE(data, Action.submessageID, bitOffset, 10); // message bitOffset += subOffset; // extra off set needed for multiple hits } @@ -419,8 +419,8 @@ this->size = ((((WorkSize + 7) >> 1) + 1) & -2); - WBUFB(data,(0x04)-4) = WorkSize; // Workload Size - 0x23 с дополнительным эффектом - 0x29 два удара монаха - WBUFB(data,(0x09)-4) = TargetNum; // количество атакуемых целей + WBUFB(data,(0x04)-4) = WorkSize; // Workload Size - 0x23 with the additional effect - 0x29 two hits monk + WBUFB(data,(0x09)-4) = TargetNum; // number of attacked targets } // 0xE0 0x58 0xD8 0x1D 0x1A - White Magic Start Index: src/map/packets/char_stats.cpp =================================================================== --- src/map/packets/char_stats.cpp (revision 3304) +++ src/map/packets/char_stats.cpp (working copy) @@ -49,7 +49,7 @@ WBUFW(data,(0x10)-4) = PChar->jobs.exp[PChar->GetMJob()]; WBUFW(data,(0x12)-4) = charutils::GetExpNEXTLevel(PChar->jobs.job[PChar->GetMJob()]); - memcpy(data+(0x14)-4, &PChar->stats, 14); // TODO: с merits это не прокатит + memcpy(data+(0x14)-4, &PChar->stats, 14); // TODO: with the merits is not a ride WBUFW(data,(0x22)-4) = PChar->getMod(MOD_STR); WBUFW(data,(0x24)-4) = PChar->getMod(MOD_DEX); Index: src/map/packets/chat_message.cpp =================================================================== --- src/map/packets/chat_message.cpp (revision 3304) +++ src/map/packets/chat_message.cpp (working copy) @@ -44,4 +44,14 @@ memcpy(data+(0x08)-4, PChar->GetName(), PChar->name.size()); memcpy(data+(0x18)-4, buff, strlen(buff)); +} + +CNPCMessagePacket::CNPCMessagePacket(int8* name, uint8 zone, int8* dat, uint8 size) +{ + this->type = 0x17; + this->size = 32 + strlen(dat) + strlen(dat)%2; + WBUFB(data,(0x04)-4) = 0x03; + WBUFB(data,(0x06)-4) = zone; + memcpy(data+(0x08)-4, name,size); + memcpy(data+(0x18)-4, dat, strlen(dat)); } \ No newline at end of file Index: src/map/packets/chat_message.h =================================================================== --- src/map/packets/chat_message.h (revision 3304) +++ src/map/packets/chat_message.h (working copy) @@ -57,4 +57,9 @@ CChatMessagePacket(CCharEntity* PChar, CHAT_MESSAGE_TYPE MessageType, int8* buff); }; +class CNPCMessagePacket : public CBasicPacket +{ +public: + CNPCMessagePacket(int8* name, uint8 zone, int8* dat,uint8 size); +}; #endif \ No newline at end of file Index: src/map/packets/event.cpp =================================================================== --- src/map/packets/event.cpp (revision 3304) +++ src/map/packets/event.cpp (working copy) @@ -67,7 +67,7 @@ WBUFW(data,(0x30)-4) = (PChar->getZone() != 0 ? PChar->getZone() : PChar->loc.prevzone); WBUFW(data,(0x2C)-4) = EventID; - WBUFB(data,(0x2E)-4) = 8; // если патаметров меньше, чем 8, то после завершения события камера "прыгнет" за спину персонажу + WBUFB(data,(0x2E)-4) = 8; // patametrov if less than 8, then after the event camera "jump" behind the character } else { Index: src/map/packets/menu_merit.cpp =================================================================== --- src/map/packets/menu_merit.cpp (revision 3304) +++ src/map/packets/menu_merit.cpp (working copy) @@ -24,16 +24,19 @@ #include "../../common/socket.h" #include "menu_merit.h" +#include "char_spells.h" +#include "message_basic.h" #include "../charentity.h" #include "../charutils.h" +#include "../spell.h" -CMenuMeritPacket::CMenuMeritPacket(CCharEntity* PChar) +CMenuMeritPacket::CMenuMeritPacket(CCharEntity* PChar) { this->type = 0x63; this->size = 0x06; - + WBUFB(data,(0x04)-4) = 0x02; WBUFB(data,(0x06)-4) = 0x08; @@ -42,9 +45,252 @@ if (PChar->jobs.job[PChar->GetMJob()] >= 75 && charutils::hasKeyItem(PChar, 606)) // keyitem Limit Breaker { - WBUFB(data,(0x0B)-4) = PChar->MeritMode ? 0xE0 : 0x20; // режим (0xE0 limit pints, 0x20 exp points) + WBUFB(data,(0x0B)-4) = PChar->MeritMode ? 0xE0 : 0x20; // mode (0xE0 limit pints, 0x20 exp points) } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_PROTECTRA_V, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 129) == 0 && spell::CanUseSpell(PChar, 129) == 1) + { + charutils::addSpell(PChar, 129); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_SHELLRA_V, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 134) == 0 && spell::CanUseSpell(PChar, 134) == 1) + { + charutils::addSpell(PChar, 134); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_FLARE_II, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 205) == 0 && spell::CanUseSpell(PChar, 205) == 1) + { + charutils::addSpell(PChar, 205); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_FREEZE_II, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 207) == 0 && spell::CanUseSpell(PChar, 207) == 1) + { + charutils::addSpell(PChar, 207); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_TORNADO_II, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 209) == 0 && spell::CanUseSpell(PChar, 209) == 1) + { + charutils::addSpell(PChar, 209); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_QUAKE_II, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 211) == 0 && spell::CanUseSpell(PChar, 211) == 1) + { + charutils::addSpell(PChar, 211); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_BURST_II, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 213) == 0 && spell::CanUseSpell(PChar, 213) == 1) + { + charutils::addSpell(PChar, 213); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_FLOOD_II, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 215) == 0 && spell::CanUseSpell(PChar, 215) == 1) + { + charutils::addSpell(PChar, 215); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_DIA_III, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 25) == 0 && spell::CanUseSpell(PChar, 25) == 1) + { + charutils::addSpell(PChar, 25); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_SLOW_II, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 79) == 0 && spell::CanUseSpell(PChar, 79) == 1) + { + charutils::addSpell(PChar, 79); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_PARALYZE_II, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 80) == 0 && spell::CanUseSpell(PChar, 80) == 1) + { + charutils::addSpell(PChar, 80); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_PHALANX_II, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 107) == 0 && spell::CanUseSpell(PChar, 107) == 1) + { + charutils::addSpell(PChar, 107); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_BIO_III, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 232) == 0 && spell::CanUseSpell(PChar, 232) == 1) + { + charutils::addSpell(PChar, 232); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_BLIND_II, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 276) == 0 && spell::CanUseSpell(PChar, 276) == 1) + { + charutils::addSpell(PChar, 276); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_KATON_SAN, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 322) == 0 && spell::CanUseSpell(PChar, 322) == 1) + { + charutils::addSpell(PChar, 322); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_HYOTON_SAN, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 325) == 0 && spell::CanUseSpell(PChar, 325) == 1) + { + charutils::addSpell(PChar, 325); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_HUTON_SAN, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 328) == 0 && spell::CanUseSpell(PChar, 328) == 1) + { + charutils::addSpell(PChar, 328); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_DOTON_SAN, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 331) == 0 && spell::CanUseSpell(PChar, 331) == 1) + { + charutils::addSpell(PChar, 331); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_RAITON_SAN, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 334) == 0 && spell::CanUseSpell(PChar, 334) == 1) + { + charutils::addSpell(PChar, 334); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_SUITON_SAN, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 337) == 0 && spell::CanUseSpell(PChar, 337) == 1) + { + charutils::addSpell(PChar, 337); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_FOE_SIRVENTE, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 468) == 0 && spell::CanUseSpell(PChar, 468) == 1) + { + charutils::addSpell(PChar, 468); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + + if (PChar->PMeritPoints->GetMeritValue(MERIT_ADVENTURERS_DIRGE, PChar->GetMLevel()) > 0) + { + if (charutils::hasSpell(PChar, 469) == 0 && spell::CanUseSpell(PChar, 469) == 1) + { + charutils::addSpell(PChar, 469); + charutils::SaveSpells(PChar); + PChar->pushPacket(new CCharSpellsPacket(PChar)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 23)); + } + } + PChar->pushPacket(new CBasicPacket(*this)); // ver 30121205_4 second packet @@ -72,6 +318,7 @@ 0x04, 0x00, 0x84 }; memcpy(data+(0x04)-4, &packet2, sizeof(packet2)); + } Index: src/map/packets/merit_points_categories.cpp =================================================================== --- src/map/packets/merit_points_categories.cpp (revision 3304) +++ src/map/packets/merit_points_categories.cpp (working copy) @@ -32,33 +32,33 @@ /************************************************************************ * * -* Примечание * +* Note * * * ************************************************************************/ /* -пакет, содержащий информацию об примененных меритах и количестве, необходимом для следующего усиления -информации много, отправляется в трех пакетах. начало у всех стандартное: +package containing information about the applied MERIT and the quantity required for the following enhanced +a lot of information is sent in three packages. top of all the standard: 0x8c 0x80 0x05 0x00 0x3D 0x00 0x00 0x00 -далее идут данные в виде структур +followed by data in the form of structures struct { - unsigned sort // id мерита - unsigned char // необходимое количество меритов для следующего усиления (0 - усиление этого мерита невозможно) - unsigned char // количестов усилений, сделанных персонажем + unsigned sort // id Merit + unsigned char // required number of Merit for the next gain (0 - strengthening this Merit impossible) + unsigned char // MAX gains made ​​character }; -начало категории кратно 0x40 далее идет прибавление id значения. все id кратны двум +top categories on multiple 0x40 id is adding value. id all the multiples of two -количество необходимых меритов для следующего усиления передаются персонажу только при входе в moghouse +amount needed for the next Merit gain character transmitted only when entering moghouse */ /************************************************************************ * * -* Отправляем персонажу информацию о всех merit (5 пакетов) * +* Send character information about merit (5 Packs) * * * ************************************************************************/ @@ -82,7 +82,7 @@ /************************************************************************ * * -* Отправляем персонажу информуцию об одном merit * +* Send the character of one information merit * * * ************************************************************************/ @@ -114,7 +114,7 @@ { for (uint8 i = 0; i < MAX_MERITS_IN_PACKET; ++i) { - (*(Merit_t*)(data+(0x08)-4 + sizeof(uint32) * i)).next = 0; // обнуляем значение next у всех merit + (*(Merit_t*)(data+(0x08)-4 + sizeof(uint32) * i)).next = 0; // zero out the value of all the next merit } } } @@ -126,7 +126,7 @@ * * ************************************************************************/ -// TODO: не помню, зачем я сунул это сюда (( +// TODO: I do not remember why I put it here (( /* Index: src/map/packets/quest_mission_log.cpp =================================================================== --- src/map/packets/quest_mission_log.cpp (revision 3304) +++ src/map/packets/quest_mission_log.cpp (working copy) @@ -34,9 +34,9 @@ this->type = 0x56; this->size = 0x14; - // настоятельно советую в switch(logID) ничего не менять, - // если вы НЕ УВЕРЕНЫ в том, что делаете - // даже простая перестановка case местами может привести к логическим ошибкам + // urge to switch (logID) change nothing, + // If you're not sure what you are doing + // even a simple rearrangement of case sometimes can lead to logical errors uint16 logType = 0x0000; switch(logID) { @@ -238,7 +238,7 @@ WBUFW(data,(0x0C)-4) = PChar->m_missionLog[MISSION_ZILART-11].current; // Rise of the Zilart WBUFL(data,(0x10)-4) = chains; // Chains of Promathia Missions - //WBUFB(data,(0x16)-4) = 0x30; // назначение неизвестно + //WBUFB(data,(0x16)-4) = 0x30; // destination unknown WBUFW(data,(0x18)-4) = add_on_scenarios; // A Crystalline Prophecy ,A Moogle Kupo d'Etat,A Shantotto Ascension WBUFW(data,(0x1C)-4) = PChar->m_missionLog[MISSION_ADOULIN-11].current; } Index: src/map/packets/quest_mission_log.h =================================================================== --- src/map/packets/quest_mission_log.h (revision 3304) +++ src/map/packets/quest_mission_log.h (working copy) @@ -57,7 +57,7 @@ #define MISS_COMPLETE 0xD0 #define MISS_CURRENT 0xFFFF -// MISS_CURRENT 0xFF исключая Add-on Scenarios +// MISS_CURRENT 0xFF excluding Add-on Scenarios #define EXP_MISS_COMPLETE 0xD8 #define EXP_MISS_CURRENT 0x80 @@ -100,8 +100,8 @@ CQuestMissionLogPacket(CCharEntity* PChar, uint8 logID, uint8 status); private: - // формирование пакетов вынес в отдельные функции, специально для тех, - // кто захочет понять, что же на самом деле происходит в switch(logID) + // encapsulation is in a separate function, especially for those + // who wants to understand what is really going on in switch(logID) void generateQuestPacket(CCharEntity* PChar, uint8 logID, uint8 status); void generateCurrentMissionPacket(CCharEntity* PChar); Index: src/map/packets/unknown_39.cpp =================================================================== --- src/map/packets/unknown_39.cpp (revision 0) +++ src/map/packets/unknown_39.cpp (working copy) @@ -0,0 +1,46 @@ +/* +=========================================================================== + + Copyright (c) 2010-2012 Darkstar Dev Teams + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see http://www.gnu.org/licenses/ + + This file is part of DarkStar-server source code. + +=========================================================================== +*/ + +#include "../../common/socket.h" + +#include "../baseentity.h" + +#include "unknown_39.h" + + +CUnknown0x39Packet::CUnknown0x39Packet(CBaseEntity* PEntity, uint8 param) +{ + this->type = 0x39; + this->size = 0x0A; + + WBUFL(data,(0x04)-4) = PEntity->id; + WBUFL(data,(0x08)-4) = PEntity->id; + + WBUFL(data,(0x0C)-4) = 0x6B; + WBUFL(data,(0x0D)-4) = 0x6B; + WBUFL(data,(0x0E)-4) = 0x6A; + WBUFL(data,(0x0F)-4) = param; + + WBUFW(data,(0x10)-4) = PEntity->targid; + WBUFW(data,(0x12)-4) = PEntity->targid; +} \ No newline at end of file Index: src/map/packets/unknown_39.h =================================================================== --- src/map/packets/unknown_39.h (revision 0) +++ src/map/packets/unknown_39.h (working copy) @@ -0,0 +1,46 @@ +/* +=========================================================================== + + Copyright (c) 2010-2012 Darkstar Dev Teams + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see http://www.gnu.org/licenses/ + + This file is part of DarkStar-server source code. + +=========================================================================== +*/ + +#ifndef _CUNKNOWN39PACKET_H +#define _CUNKNOWN39PACKET_H + +#include "../../common/cbasetypes.h" + +#include "basic.h" + +/************************************************************************ +* * +* * +* * +************************************************************************/ + +class CBaseEntity; + +class CUnknown0x39Packet : public CBasicPacket +{ +public: + + CUnknown0x39Packet(CBaseEntity* PEntity, uint8 param); +}; + +#endif \ No newline at end of file Index: src/map/packets/zone_in.cpp =================================================================== --- src/map/packets/zone_in.cpp (revision 3304) +++ src/map/packets/zone_in.cpp (working copy) @@ -34,8 +34,8 @@ /************************************************************************ * * -* Кривое решение для вычисления ID MogHouse * -* Возможно необходим переход на uint16 формат зоны * +* Hacks for computing ID MogHouse * +* May be a shift in the format uint16 zone * * * ************************************************************************/ @@ -106,14 +106,14 @@ this->type = 0x0A; this->size = 0x82; - // необходимо для работы manaklipper - // последние 8 байт похожи на время + // Need to work Manaclipper + // Last 8 bytes are like time //unsigned char packet [] = { //0x0D, 0x3A, 0x0C, 0x00, 0x11, 0x00, 0x19, 0x00, 0x02, 0xE4, 0x93, 0x10, 0x91, 0xE5, 0x93, 0x10}; // 0x2a = 0x10 //0x89, 0x39, 0x0C, 0x00, 0x19, 0x00, 0x07, 0x00, 0x5C, 0xE1, 0x93, 0x10, 0x81, 0xE3, 0x93, 0x10}; // 0x2a = 0x08 //memcpy(data + 0x70-4, &packet, 16); - //data[0x2A-4] = 0x08;//data[0x2A-4] = 0x80; // в зоне 3 управляет путями следования транспорта 0x10 и 0x08 + //data[0x2A-4] = 0x08;//data[0x2A-4] = 0x80; // Zone 3 controls transport routes following 0x10 and 0x08 WBUFL(data,(0x04)-4) = PChar->id; WBUFW(data,(0x08)-4) = PChar->targid; @@ -157,7 +157,7 @@ if(csid != -1) { - //WBUFB(data,(0x1F)-4) = 4; // предположительно animation + //WBUFB(data,(0x1F)-4) = 4; // presumably animation //WBUFB(data,(0x20)-4) = 2; WBUFB(data,(0x40)-4) = PChar->getZone(); @@ -174,14 +174,14 @@ WBUFB(data,(0xAE)-4) = GetMosHouseFlag(PChar); // Mog House leaving flag } else { WBUFB(data,(0x80)-4) = 2; - WBUFW(data,(0x30)-4) = PChar->getZone(); // to zone - WBUFW(data,(0x42)-4) = PChar->getZone(); // to zone + WBUFW(data,(0x30)-4) = PChar->getZone(); // to zone + WBUFW(data,(0x42)-4) = PChar->getZone(); // to zone WBUFW(data,(0xAA)-4) = 0x01FF; - WBUFB(data,(0xAC)-4) = csid > 0 ? 0x01 : 0x00; //if 0x01 then pause between zone - WBUFB(data,(0xAF)-4) = PChar->loc.zone->CanUseMisc(MISC_MOGMENU); // флаг, позволяет использовать mog menu за пределами mog house + WBUFB(data,(0xAC)-4) = csid > 0 ? 0x01 : 0x00; //if 0x01 then pause between zone + WBUFB(data,(0xAF)-4) = PChar->loc.zone->CanUseMisc(MISC_MOGMENU); // flag allows mog menu outside mog house } - WBUFL(data,(0xA0)-4) = 0x00000000; // время, проведенное персонажем в игре с момента создания + WBUFL(data,(0xA0)-4) = PChar->GetPlayTime(); // time spent by a character in a game since the // current death timestamp is less than an hour ago and the player is dead. if (PChar->m_DeathTimestamp > 0 && ((time(NULL)-PChar->m_DeathTimestamp) < (60*60)) && PChar->isDead()) Index: src/map/party.cpp =================================================================== --- src/map/party.cpp (revision 3304) +++ src/map/party.cpp (working copy) @@ -43,7 +43,7 @@ /************************************************************************ * * -* Конструктор * +* Designer * * * ************************************************************************/ @@ -68,7 +68,7 @@ /************************************************************************ * * -* Распускаем группу * +* Dissolve the group * * * ************************************************************************/ @@ -109,7 +109,7 @@ /************************************************************************ * * -* Назначаем роли участникам группы (только для персонажей) * +* Assign the role of members of the group (for the characters) * * * ************************************************************************/ @@ -139,7 +139,7 @@ /************************************************************************ * * -* Узнаем количество участников группы в указанной зоне * +* Get the number of group members in the zone * * * ************************************************************************/ @@ -159,7 +159,7 @@ /************************************************************************ * * -* Удаление персонажа из группы по имени (только для персонажей) * +* Removal of the character of the group named (for characters) * * * ************************************************************************/ @@ -180,7 +180,7 @@ /************************************************************************ * * -* Удаляем персонажа из группы * +* Delete the character of the group * * * ************************************************************************/ @@ -240,7 +240,7 @@ /************************************************************************ * * -* Лидер покидает группу * +* The leader leaves the group * * * ************************************************************************/ @@ -270,7 +270,7 @@ /************************************************************************ * * -* Добавляем персонажа в группу * +* Add the character to the group * * * ************************************************************************/ @@ -310,7 +310,7 @@ /************************************************************************ * * -* Получаем уникальный ID группы * +* Get the unique ID of * * * ************************************************************************/ @@ -321,7 +321,7 @@ /************************************************************************ * * -* Получаем указатель на лидера группы * +* Get a pointer to the group leader * * * ************************************************************************/ @@ -332,7 +332,7 @@ /************************************************************************ * * -* Получаем указатель на цель синхронизации уровней * +* Get a pointer to the target synchronization levels * * * ************************************************************************/ @@ -343,7 +343,7 @@ /************************************************************************ * * -* Получаем указатель на владельца сокровищ * +* Get a pointer to the owner of the treasure * * * ************************************************************************/ @@ -356,7 +356,7 @@ /************************************************************************ * * -* Получаем список флагов персонажа * +* Get a list of flags of the character * * * ************************************************************************/ @@ -390,7 +390,7 @@ /************************************************************************ * * -* Обновляем карту группы для всех членов группы * +* Update the map of all members of the group * * * ************************************************************************/ @@ -436,8 +436,8 @@ /************************************************************************ * * -* Обновляем статусы членов группы для выбранного персонажа * -* Возвращаем номер персонажа в группе * +* Update the status of the group for the selected character * +* Return the number of characters in * * * ************************************************************************/ @@ -473,7 +473,7 @@ /************************************************************************ * * -* Обновляем TreasurePool для указанного персонажа * +* Update TreasurePool for the specified character * * * ************************************************************************/ @@ -539,7 +539,7 @@ /************************************************************************ * * -* Устанавливаем лидера группы * +* Set the group leader * * * ************************************************************************/ @@ -559,7 +559,7 @@ /************************************************************************ * * -* Устанавливаем цель синхронизации уровней * +* Set the target synchronization levels * * * ************************************************************************/ @@ -570,7 +570,7 @@ /************************************************************************ * * -* Усранавливаем владельца сокровищ * +* Usranavlivaem owner treasure * * * ************************************************************************/ @@ -581,9 +581,9 @@ /************************************************************************ * * -* Отправляем пакет всем членам группы, если зона указана как 0 или * -* членам группы в указанной зоне. * -* Пакет для PPartyMember не отправляется в обоих случаях. * +* Send the package to all members of the group, if the zone is * +* specified as 0 or Members of the group in this area. * +* Package for PPartyMember not sent in both cases. * * * ************************************************************************/ Index: src/map/party.h =================================================================== --- src/map/party.h (revision 3304) +++ src/map/party.h (working copy) @@ -61,48 +61,48 @@ CParty(CBattleEntity* PEntity); - uint32 GetPartyID(); // узнаем уникальный ID группы - uint16 GetMemberFlags(CBattleEntity* PEntity); // получаем список флагов персонажа - uint8 MemberCount(uint8 ZoneID); // узнаем количество участников группы в указанной зоне + uint32 GetPartyID(); // find out the unique ID of + uint16 GetMemberFlags(CBattleEntity* PEntity); // get a list of character flags + uint8 MemberCount(uint8 ZoneID); // get the number of party members in the zone - CBattleEntity* GetLeader(); // узнаем лидера группы - CBattleEntity* GetSyncTarget(); // узнаем цель синхронизации - CBattleEntity* GetQuaterMaster(); // узнаем владельца сокровищ + CBattleEntity* GetLeader(); // find out the group leader + CBattleEntity* GetSyncTarget(); // learn the purpose of synchronization + CBattleEntity* GetQuaterMaster(); // find out the owner of the treasure - void DisbandParty(); // распускаем группу - void ReloadParty(); // перезагружаем карту группы для всех участников группы - void ReloadPartyMembers(CCharEntity* PChar); // oбновляем статусы участников группы для выбранного персонажа + void DisbandParty(); // group disbands + void ReloadParty(); // reload the card group for all members of the group + void ReloadPartyMembers(CCharEntity* PChar); // reload party status for the selected character void ReloadTreasurePool(CCharEntity* PChar); - void AddMember(CBattleEntity* PEntity); // добавляем персонажа в группу - void RemoveMember(CBattleEntity* PEntity); // удаление персонажа из группы - void RemoveMemberByName(int8* MemberName); // удаление персонажа из группы по имени - void AssignPartyRole(int8* MemberName, uint8 role); // назначаем роли участникам группы + void AddMember(CBattleEntity* PEntity); // add character to the group + void RemoveMember(CBattleEntity* PEntity); // remove the character from the group + void RemoveMemberByName(int8* MemberName); // remove a character from a group called + void AssignPartyRole(int8* MemberName, uint8 role); // assign roles to team members - void PushPacket(CCharEntity* PPartyMember, uint8 ZoneID, CBasicPacket* packet); // отправляем пакет всем членам группы, за исключением PPartyMember - + void PushPacket(CCharEntity* PPartyMember, uint8 ZoneID, CBasicPacket* packet); // send the packet to all members of the group, except PPartyMember + CAlliance* m_PAlliance; - // ВНИМАНИЕ: НЕ ИЗМЕНЯТЬ ЗНАЧЕНИЯ СПИСКА ВНЕ КЛАССА ГРУППЫ + // NOTE: Do not change the outside of the class LIST GROUPS - std::vector members; // список участников группы + std::vector members; // list of group members private: - uint32 m_PartyID; // уникальный ID группы - PARTYTYPE m_PartyType; // тип существ, составляющих группу + uint32 m_PartyID; // unique ID of + PARTYTYPE m_PartyType; // type of creatures that make up the group - CBattleEntity* m_PLeader; // лидер группы - CBattleEntity* m_PSyncTarget; // цель синхронизации уровней - CBattleEntity* m_PQuaterMaster; // владелец сокровищ + CBattleEntity* m_PLeader; // group leader + CBattleEntity* m_PSyncTarget; // target synchronization levels + CBattleEntity* m_PQuaterMaster; // owner of the treasure - void SetLeader(CBattleEntity* PEntity); // устанавливаем лидера группы - void SetSyncTarget(CBattleEntity* PEntity); // устанавливаем цель синхронизации уровней - void SetQuaterMaster(CBattleEntity* PEntity); // устанавливаем владельца сокровищ + void SetLeader(CBattleEntity* PEntity); // set the group leader + void SetSyncTarget(CBattleEntity* PEntity); // set the target levels of synchronization + void SetQuaterMaster(CBattleEntity* PEntity); // Set the owner of treasures - void RemovePartyLeader(CBattleEntity* PEntity); // лидер покидает группу + void RemovePartyLeader(CBattleEntity* PEntity); // leaves the group leader }; #endif \ No newline at end of file Index: src/map/petentity.h =================================================================== --- src/map/petentity.h (revision 3304) +++ src/map/petentity.h (working copy) @@ -46,8 +46,8 @@ class CPetEntity : public CBattleEntity { public: - CPetEntity(PETTYPE petType); // конструктор - ~CPetEntity(); // деструктор + CPetEntity(PETTYPE petType); // Designer + ~CPetEntity(); // Destructor PETTYPE getPetType(); bool isBstPet(); uint16 m_Family; Index: src/map/petutils.cpp =================================================================== --- src/map/petutils.cpp (revision 3304) +++ src/map/petutils.cpp (working copy) @@ -47,21 +47,21 @@ struct Pet_t { - look_t look; // внешний вид - string_t name; // имя - ECOSYSTEM EcoSystem; // эко-система + look_t look; // appearance + string_t name; // name + ECOSYSTEM EcoSystem; // eco-system - uint8 minLevel; // минимально-возможный уровень - uint8 maxLevel; // максимально-возможный уровень + uint8 minLevel; // lowest possible level + uint8 maxLevel; // maximum possible level - uint8 size; // размер модели + uint8 size; // size of the model uint16 m_Family; - uint32 time; // время существования (будет использоваться для задания длительности статус эффекта) + uint32 time; // lifetime (to be used to set the duration of the status effect) uint8 mJob; uint8 m_Element; - float HPscale; // HP boost percentage - float MPscale; // MP boost percentage + float HPscale; // HP boost percentage + float MPscale; // MP boost percentage uint8 speed; // stat ranks @@ -113,7 +113,7 @@ /************************************************************************ * * -* Загружаем список прототипов питомцев * +* Load the list of prototypes pets * * * ************************************************************************/ @@ -221,7 +221,7 @@ /************************************************************************ * * -* Освобождаем список прототипов питомцев * +* Free the list of prototypes pets * * * ************************************************************************/ @@ -398,18 +398,18 @@ void LoadAvatarStats(CPetEntity* PChar) { - // Объявление переменных, нужных для рассчета. - float raceStat = 0; // конечное число HP для уровня на основе расы. - float jobStat = 0; // конечное число HP для уровня на основе первичной профессии. - float sJobStat = 0; // коенчное число HP для уровня на основе вторичной профессии. - int32 bonusStat = 0; // бонусное число HP которое добавляется при соблюдении некоторых условий. - int32 baseValueColumn = 0; // номер колонки с базовым количеством HP - int32 scaleTo60Column = 1; // номер колонки с модификатором до 60 уровня - int32 scaleOver30Column = 2; // номер колонки с модификатором после 30 уровня - int32 scaleOver60Column = 3; // номер колонки с модификатором после 60 уровня - int32 scaleOver75Column = 4; // номер колонки с модификатором после 75 уровня - int32 scaleOver60 = 2; // номер колонки с модификатором для расчета MP после 60 уровня - int32 scaleOver75 = 3; // номер колонки с модификатором для расчета Статов после 75-го уровня + // Declare the variables needed for the calculation. + float raceStat = 0; // HP for a finite number of levels on the basis of race. + float jobStat = 0; // ​​HP for a finite number of levels based on primary profession. + float sJobStat = 0; // number HP for a level based on a secondary profession. + int32 bonusStat = 0; // ​​number of HP bonus is added, subject to certain conditions. + int32 baseValueColumn = 0; // ​​number of the column to the base of HP + int32 scaleTo60Column = 1; // number of columns with the modifier level 60 + int32 scaleOver30Column = 2; // number of columns with the modifier after level 30 + int32 scaleOver60Column = 3; // number of columns with the modifier after level 60 + int32 scaleOver75Column = 4; // number of columns with the modifier after level 75 + int32 scaleOver60 = 2; // number of columns with the modifier to calculate MP after level 60 + int32 scaleOver75 = 3; // number of columns with the modifier for the calculation of the article after level 75 uint8 grade; @@ -417,19 +417,19 @@ JOBTYPE mjob = PChar->GetMJob(); uint8 race = 3; //Tarutaru - // Расчет прироста HP от main job - int32 mainLevelOver30 = dsp_cap(mlvl - 30, 0, 30); // Расчет условия +1HP каждый лвл после 30 уровня - int32 mainLevelUpTo60 = (mlvl < 60 ? mlvl - 1 : 59 ); // Первый режим рассчета до 60 уровня (Используется так же и для MP) - int32 mainLevelOver60To75 = dsp_cap(mlvl - 60, 0, 15); // Второй режим расчета после 60 уровня - int32 mainLevelOver75 = (mlvl < 75 ? 0 : mlvl - 75); // Третий режим расчета после 75 уровня + // Calculate the increase HP from main job + int32 mainLevelOver30 = dsp_cap(mlvl - 30, 0, 30); // Calculate the conditions +1 HP each lvl after level 30 + int32 mainLevelUpTo60 = (mlvl < 60 ? mlvl - 1 : 59 ); // The first mode calculation level 60 (used also for MP) + int32 mainLevelOver60To75 = dsp_cap(mlvl - 60, 0, 15); // The second calculation mode after level 60 + int32 mainLevelOver75 = (mlvl < 75 ? 0 : mlvl - 75); // The third mode of calculation after level 75 - //Расчет бонусного количества HP - int32 mainLevelOver10 = (mlvl < 10 ? 0 : mlvl - 10); // +2HP на каждом уровне после 10 - int32 mainLevelOver50andUnder60 = dsp_cap(mlvl - 50, 0, 10); // +2HP на каждом уровне в промежутке от 50 до 60 уровня + // Calculate the amount of bonus HP + int32 mainLevelOver10 = (mlvl < 10 ? 0 : mlvl - 10); // +2 HP on every level after 10 + int32 mainLevelOver50andUnder60 = dsp_cap(mlvl - 50, 0, 10); // +2 HP on every level in the range from 50 to 60 levels int32 mainLevelOver60 = (mlvl < 60 ? 0 : mlvl - 60); - // Расчет raceStat jobStat bonusStat sJobStat - // Расчет по расе + // Calculate the raceStat jobStat bonusStat sJobStat + // Calculation for race grade = grade::GetRaceGrades(race,0); @@ -441,7 +441,7 @@ // raceStat = (int32)(statScale[grade][baseValueColumn] + statScale[grade][scaleTo60Column] * (mlvl - 1)); - // Расчет по main job + // Calculation of main job grade = grade::GetJobGrade(mjob,0); jobStat = grade::GetHPScale(grade,baseValueColumn) + @@ -450,30 +450,30 @@ (grade::GetHPScale(grade,scaleOver60Column) * mainLevelOver60To75) + (grade::GetHPScale(grade,scaleOver75Column) * mainLevelOver75); - // Расчет бонусных HP + // Calculate the bonus HP bonusStat = (mainLevelOver10 + mainLevelOver50andUnder60) * 2; PChar->health.maxhp = (int16)(raceStat + jobStat + bonusStat + sJobStat); PChar->health.hp = PChar->health.maxhp; - //Начало расчера MP + // Start raschera MP raceStat = 0; jobStat = 0; sJobStat = 0; - // Расчет MP расе. + // Calculate the MP race. grade = grade::GetRaceGrades(race,1); - //Если у main job нет МП рейтинга, расчитиваем расовый бонус на основе уровня subjob уровня(при условии, что у него есть МП рейтинг) + // If there is no main job megapixel rating raschitivaem racial bonus based on the level subjob level (provided that it has a megapixel rating) if (grade::GetJobGrade(mjob,1) == 0) { }else{ - //Расчет нормального расового бонуса + // Calculate the normal racial bonus raceStat = grade::GetMPScale(grade,0) + grade::GetMPScale(grade,scaleTo60Column) * mainLevelUpTo60 + grade::GetMPScale(grade,scaleOver60) * mainLevelOver60; } - //Для главной профессии + // For the main occupation grade = grade::GetJobGrade(mjob,1); if (grade > 0) { @@ -482,7 +482,7 @@ grade::GetMPScale(grade,scaleOver60) * mainLevelOver60; } - PChar->health.maxmp = (int16)(raceStat + jobStat + sJobStat); // результат расчета MP + PChar->health.maxmp = (int16)(raceStat + jobStat + sJobStat); // calculation result MP //add in evasion from skill int16 evaskill = PChar->GetSkill(SKILL_EVA); int16 eva = evaskill; @@ -491,11 +491,11 @@ } PChar->setModifier(MOD_EVA,eva); - //Начало расчета характеристик + // Start the calculation of the characteristics uint8 counter = 0; for (uint8 StatIndex = 2; StatIndex <=8; ++StatIndex) { - // расчет по расе + // Calculation for race grade = grade::GetRaceGrades(race,StatIndex); raceStat = grade::GetStatScale(grade,0) + grade::GetStatScale(grade,scaleTo60Column) * mainLevelUpTo60; @@ -508,7 +508,7 @@ } } - // расчет по профессии + // Calculation of the profession grade = grade::GetJobGrade(mjob,StatIndex); jobStat = grade::GetStatScale(grade,0) + grade::GetStatScale(grade,scaleTo60Column) * mainLevelUpTo60; @@ -524,7 +524,7 @@ jobStat = jobStat * 1.5; //stats from subjob (assuming BLM/BLM for avatars) - // Вывод значения + // Output values WBUFW(&PChar->stats,counter) = (uint16)(raceStat + jobStat); counter += 2; } @@ -847,7 +847,7 @@ break; case TYPE_PC: { - // освобождаем персонажа из под контроля + // Set the character of control } break; } Index: src/map/recast_container.cpp =================================================================== --- src/map/recast_container.cpp (revision 3304) +++ src/map/recast_container.cpp (working copy) @@ -57,7 +57,7 @@ /************************************************************************ * * -* Получаем указатель на указанный RecastList * +* Get a pointer to the specified RecastList * * * ************************************************************************/ @@ -78,7 +78,7 @@ /************************************************************************ * * -* Добавляем запись в контейнер * +* Add an entry in the container * * * ************************************************************************/ @@ -95,7 +95,7 @@ /************************************************************************ * * -* Удаляем все элементы указанного типа * +* Remove all elements of the specified type * * * ************************************************************************/ @@ -112,7 +112,7 @@ /************************************************************************ * * -* Удаляем указанный элемент указанного типа * +* Removes the specified element of this type * * * ************************************************************************/ @@ -133,7 +133,7 @@ /************************************************************************ * * -* Проверяем наличие элемента с указанным ID * +* Check if the element with the specified ID * * * ************************************************************************/ @@ -153,7 +153,7 @@ /************************************************************************ * * -* Проверяем список на устаревшие записи * +* Check the list on the outdated entries * * * ************************************************************************/ Index: src/map/region.cpp =================================================================== --- src/map/region.cpp (revision 3304) +++ src/map/region.cpp (working copy) @@ -28,8 +28,8 @@ /************************************************************************ * * -* При инициализации области задаем уникальный номер в пределах зоны. * -* При попытке установить 0 в качестве номера выдаем предупреждение. * +* Initialization of the specified unique number within the zone. * +* If you try to set 0 as the number is issued a warning. * * * ************************************************************************/ @@ -45,7 +45,7 @@ /************************************************************************ * * -* Узнаем уникальный номер активной области * +* Know the unique number of the active region * * * ************************************************************************/ @@ -91,7 +91,7 @@ /************************************************************************ * * -* Устанавливаем верхний левый угол области * +* Set the upper left corner of the area * * * ************************************************************************/ @@ -104,7 +104,7 @@ /************************************************************************ * * -* Устанавливаем нижний правый угол области * +* Set the lower right corner of the area * * * ************************************************************************/ @@ -117,7 +117,7 @@ /************************************************************************ * * -* Проверяем, находится ли позиция внутри области * +* Check to see if the position is within the area * * * ************************************************************************/ Index: src/map/region.h =================================================================== --- src/map/region.h (revision 3304) +++ src/map/region.h (working copy) @@ -41,22 +41,22 @@ uint32 GetRegionID(); - int16 GetCount(); + int16 GetCount(); int16 AddCount(int16 count); int16 DelCount(int16 count); - void SetULCorner(float x, float y, float z); // верхний левый угол (Upper Left) - void SetLRCorner(float x, float y, float z); // нижний правый угол (Lower Right) + void SetULCorner(float x, float y, float z); // upper left corner (Upper Left) + void SetLRCorner(float x, float y, float z); // bottom-right corner (Lower Right) bool isPointInside(position_t pos); private: - uint32 m_RegionID; // номер региона - int16 m_Count; // количество персонажей в регионе + uint32 m_RegionID; // Region number + int16 m_Count; // number of characters in the region - float x1, y1, z1; // верхний левый угол - float x2, y2, z2; // лижний правый угол + float x1, y1, z1; // upper left corner + float x2, y2, z2; // lower right corner bool circle; }; Index: src/map/spell.cpp =================================================================== --- src/map/spell.cpp (revision 3304) +++ src/map/spell.cpp (working copy) @@ -31,7 +31,7 @@ { m_ID = id; - m_radius = 0; + m_radius = 0; m_mpCost = 0; m_castTime = 0; m_recastTime = 0; @@ -368,18 +368,18 @@ /************************************************************************ * * -* Реализация namespase для работы с заклинаниями * +* Implementing namespase to work with spells * * * ************************************************************************/ namespace spell { - CSpell* PSpellList[MAX_SPELL_ID]; // список заклинаний + CSpell* PSpellList[MAX_SPELL_ID]; // Spell list std::map PMobSkillToBlueSpell[256]; // maps the skill id (key) to spell id (value). /************************************************************************ * * - * Загружаем список заклинаний * + * Load the list of spells * * * ************************************************************************/ Index: src/map/spell.h =================================================================== --- src/map/spell.h (revision 3304) +++ src/map/spell.h (working copy) @@ -157,7 +157,7 @@ /************************************************************************ * * -* namespase для работы с заклинаниями * +* Namespase to work with spells * * * ************************************************************************/ Index: src/map/status_effect.h =================================================================== --- src/map/status_effect.h (revision 3304) +++ src/map/status_effect.h (working copy) @@ -45,16 +45,16 @@ EFFECTFLAG_NONE = 0x0000, EFFECTFLAG_DISPELABLE = 0x0001, EFFECTFLAG_ERASABLE = 0x0002, - EFFECTFLAG_ATTACK = 0x0004, // исчезает при нанесении урона + EFFECTFLAG_ATTACK = 0x0004, // ​​disappears on damage - EFFECTFLAG_DAMAGE = 0x0010, // исчезает при получении урона - EFFECTFLAG_DEATH = 0x0020, // исчезает при смерти - EFFECTFLAG_MAGIC_BEGIN = 0x0040, // исчезает перед началом чтения заклинания - EFFECTFLAG_MAGIC_END = 0x0080, // исчезает после прочтения заклинания + EFFECTFLAG_DAMAGE = 0x0010, // disappears when damaged + EFFECTFLAG_DEATH = 0x0020, // disappears at death + EFFECTFLAG_MAGIC_BEGIN = 0x0040, // ​​disappears before reading spells + EFFECTFLAG_MAGIC_END = 0x0080, // ​​disappears after reading spells EFFECTFLAG_ON_ZONE = 0x0100, EFFECTFLAG_NO_LOSS_MESSAGE = 0x0200, // Suppress effect worn off message. - EFFECTFLAG_INVISIBLE = 1024, // invisible effect - EFFECTFLAG_DETECTABLE = 2048 // invisible, sneak, deo + EFFECTFLAG_INVISIBLE = 1024, // invisible effect + EFFECTFLAG_DETECTABLE = 2048 // invisible, sneak, deo }; enum EFFECT @@ -83,6 +83,10 @@ EFFECT_ADDLE = 21, EFFECT_INTIMIDATE = 22, EFFECT_KAUSTRA = 23, + EFFECT_ST24 = 24, + EFFECT_ST25 = 25, + EFFECT_ST26 = 26, + EFFECT_ST27 = 27, EFFECT_TERROR = 28, EFFECT_MUTE = 29, EFFECT_BANE = 30, @@ -280,6 +284,9 @@ EFFECT_DIRGE = 221, EFFECT_SCHERZO = 222, EFFECT_NOCTURNE = 223, + EFFECT_ST224 = 224, + EFFECT_ST225 = 225, + EFFECT_ST226 = 226, EFFECT_STORE_TP = 227, EFFECT_EMBRAVA = 228, EFFECT_MANAWELL = 229, @@ -425,6 +432,9 @@ EFFECT_ASPIR_SAMBA = 369, EFFECT_HASTE_SAMBA = 370, EFFECT_VELOCITY_SHOT = 371, + // . = 372, + // . = 373, + // . = 374, EFFECT_BUILDING_FLOURISH = 375, EFFECT_TRANCE = 376, EFFECT_TABULA_RASA = 377, @@ -522,13 +532,106 @@ EFFECT_PERPETUANCE = 469, EFFECT_IMMANENCE = 470, EFFECT_MIGAWARI = 471, - EFFECT_AVATAR = 491, - - EFFECT_NINJUTSU_ELE_DEBUFF = 510, - EFFECT_HEALING = 512, // TODO: > 768 - EFFECT_LEAVEGAME = 513, // TODO: > 768 - EFFECT_SKILLCHAIN = 514, // TODO: > 768 - + EFFECT_TERNARY_FLOURISH = 472, + EFFECT_MUDDLE = 473, + EFFECT_PROWESS = 474, + EFFECT_VOIDWATCHER = 475, + EFFECT_ENSPHERE = 476, + EFFECT_SACROSANCTITY = 477, + EFFECT_PALISADE = 478, + EFFECT_SCARLET_DELIRIUM = 479, + // EFFECT_SCARLET_DELIRIUM = 480, + // NONE = 481, + EFFECT_DECOY_SHOT = 482, + EFFECT_HAGAKURE = 483, + EFFECT_ISSEKIGAN = 484, + EFFECT_UNBRIDLED_LEARNING = 485, + EFFECT_COUNTER_BOOST = 486, + EFFECT_ENDRAIN = 487, + EFFECT_ENASPIR = 488, + EFFECT_AFTERGLOW = 489, + EFFECT_IMMINENT_STRIKES = 490, + EFFECT_AVATAR = 491, // CONSUMMATE_COUNTER in POLutils + EFFECT_ASYLUM = 492, + EFFECT_SUBTLE_SORCERY = 493, + EFFECT_ENCOMIUM = 494, + EFFECT_BAMBOOZLE = 495, + EFFECT_RIGHTEOUS_GAURD = 496, + EFFECT_SOUL_ENSLAVEMENT = 497, + EFFECT_BST_SP2 = 498, + EFFECT_MALINCONICO = 499, + EFFECT_INSTINCTIVE_AIM = 500, + EFFECT_YAEGASUMI = 501, + EFFECT_TENGEN = 502, + EFFECT_ROUSE_WYVERN = 503, + EFFECT_ASTRAL_CONDUIT = 504, + EFFECT_UNBRIDLED_WISDOM = 505, + EFFECT_THREE_TO_ONE = 506, + EFFECT_GRAND_PAS = 507, + // EFFECT_NONE = 508, + // EFFECT_NONE = 509, + EFFECT_NINJUTSU_ELE_DEBUFF = 510, // EFFECT_ERGON_MIGHT + EFFECT_REIVE_MARK = 511, + EFFECT_HEALING = 512, // EFFECT_IONIS + EFFECT_LEAVEGAME = 513, // EFFECT_BOLSTER + EFFECT_SKILLCHAIN = 514, // EFFECT_NONE + EFFECT_LASTING_EMANATION = 515, + EFFECT_ECLIPTIC_ATTRITION = 516, + EFFECT_COLLIMATED_FERVOR = 517, + EFFECT_DEMATERIALIZE = 518, + EFFECT_THEURGIC_FOCUS = 519, + // EFFECT_NONE = 520, + // EFFECT_NONE = 521, + EFFECT_ELEMENTAL_SFORZO = 522, + EFFECT_IGNIS = 523, + EFFECT_GELUS = 524, + EFFECT_FLABRA = 525, + EFFECT_TELLUS = 526, + EFFECT_SULPOR = 527, + EFFECT_UNDA = 528, + EFFECT_LUX = 529, + EFFECT_TENEBRAE = 530, + EFFECT_VALLATION = 531, + EFFECT_SWORDPLAY = 532, + EFFECT_PFLUG = 533, + EFFECT_EMBOLDEN = 534, + EFFECT_VALIANCE = 535, + EFFECT_GAMBIT = 536, + EFFECT_LIEMENT = 537, + EFFECT_ONE_FOR_ALL = 538, + EFFECT_REGEN_II = 539, + EFFECT_POISON_II = 540, + EFFECT_REFRESH_II = 541, + EFFECT_STR_BOOST_III = 542, + EFFECT_DEX_BOOST_III = 543, + EFFECT_VIT_BOOST_III = 544, + EFFECT_AGI_BOOST_III = 545, + EFFECT_INT_BOOST_III = 546, + EFFECT_MND_BOOST_III = 547, + EFFECT_CHR_BOOST_III = 548, + EFFECT_ATTACK_BOOST_II = 549, + EFFECT_DEFENSE_BOOST_II = 550, + EFFECT_MAGIC_ATK_BOOST_II = 551, + EFFECT_MAGIC_DEF_BOOST_II = 552, + EFFECT_ACCURACY_BOOST_II = 553, + EFFECT_EVASION_BOOST_II = 554, + EFFECT_MAGIC_ACC_BOOST_II = 555, + EFFECT_MAGIC_EVASION_BOOST_II = 556, + EFFECT_ATTACK_DOWN_II = 557, + EFFECT_DEFENSE_DOWN_II = 558, + EFFECT_MAGIC_ATK_DOWN_II = 559, + EFFECT_MAGIC_DEF_DOWN_II = 560, + EFFECT_ACCURACY_DOWN_II = 561, + EFFECT_EVASION_DOWN_II = 562, + EFFECT_MAGIC_ACC_DOWN_II = 563, + EFFECT_MAGIC_EVASION_DOWN_II = 564, + EFFECT_SLOW_II = 565, + EFFECT_PARALYSIS_II = 566, + EFFECT_WEIGHT_II = 567, + EFFECT_FOIL = 568, + EFFECT_BLAZE_OF_GLORY = 569, + // 570 - 639 NONE on POL Utils + EFFECT_DYNAMIS = 800 }; @@ -536,10 +639,10 @@ /************************************************************************ * * -* Нерешенные задачи: * +* Pending problem: * * * -* - сохранение ID сущности, добавившей эффект * -* - обновление эффекта (например перезапись protect 1 на protect 2) * +* - Save ID essence, add effects * +* - Update effect (eg overwrite protect 1 to protect 2) * * * ************************************************************************/ @@ -583,7 +686,7 @@ const int8* GetName(); - std::vector modList; // список модификаторов + std::vector modList; // list of modifiers CStatusEffect( EFFECT id, @@ -599,23 +702,23 @@ private: - CBattleEntity* m_POwner; // владелец + CBattleEntity* m_POwner; // owner - EFFECT m_StatusID; // основной тип эффекта - uint16 m_SubID; // дополнительный тип эффекта - uint16 m_Icon; // иконка эффекта - uint16 m_Power; // сила эффекта + EFFECT m_StatusID; // main type of effect + uint16 m_SubID; // additional effect type + uint16 m_Icon; // Icon effect + uint16 m_Power; // force effect uint16 m_SubPower; // Secondary power of the effect uint16 m_Tier; // Tier of the effect - uint16 m_Flag; // флаг эффекта (условия его исчезновения) - uint16 m_Type; // used to enforce only one + uint16 m_Flag; // flag effect (the conditions of his disappearance) + uint16 m_Type; // used to enforce only one - uint32 m_TickTime; // время повторения эффекта (млс) - uint32 m_Duration; // продолжительность эффекта (млс) - uint32 m_StartTime; // время получения эффекта (млс) - uint32 m_LastTick; // премя последнего выполнения эффекта (млс) + uint32 m_TickTime; // the repetition effect (MLS) + uint32 m_Duration; // duration of effect (MLS) + uint32 m_StartTime; // obtain the effect of time (msec) + uint32 m_LastTick; // Prem last run effect (MLS) - string_t m_Name; // имя эффекта для скриптов + string_t m_Name; // effect name for scripts }; #endif Index: src/map/status_effect_container.cpp =================================================================== --- src/map/status_effect_container.cpp (revision 3304) +++ src/map/status_effect_container.cpp (working copy) @@ -62,7 +62,7 @@ { /************************************************************************ * * - * Контейнер параметров эффектов * + * Container effect parameters * * * ************************************************************************/ @@ -160,7 +160,7 @@ /************************************************************************ * * -* Получаем количество эффектов с указанным subid * +* Get the number of effects with this subid * * * ************************************************************************/ @@ -292,8 +292,8 @@ /************************************************************************ * * -* Добавляем статус-эффект в контейнер * -* Если не ошибаюсь, то максимально-возможное количество эффектов 32 * +* Add a status effect in the container * +* If I'm not mistaken, the maximum possible number of effects 32 * * * ************************************************************************/ @@ -361,8 +361,8 @@ /************************************************************************ * * -* Эффекты во всех методах удаляются одинаково, вынес этот код в * -* отдельную функцию. Удаляем иконки только у CharEntity. * +* The effects of all the methods are removed the same way, made this * +* code a function. Remove icons only CharEntity. * * * ************************************************************************/ @@ -406,8 +406,8 @@ /************************************************************************ * * -* Удаляем статус-эффект по его основному и дополнительному типам. * -* Возвращаем результат выполнения операции. * +* Removes status effect on its main and additional types. * +* Return the result of the operation. * * * ************************************************************************/ @@ -492,7 +492,7 @@ /************************************************************************ * * -* Удаляем все эффекты с указанными иконками * +* Remove all effects with these icons * * * ************************************************************************/ @@ -522,7 +522,7 @@ /************************************************************************ * * -* Удаляем все эффекты с указанными флагами * +* Remove all effects with the specified flag * * * ************************************************************************/ @@ -539,8 +539,8 @@ /************************************************************************ * * -* Удаляем первый добавленный отрицательный эффект с флагом erase. * -* Возвращаем результат выполнения операции. * +* Removes the first addition to the negative effect of the flag erase. * +* Return the result of the operation. * * * ************************************************************************/ @@ -586,8 +586,8 @@ /************************************************************************ * * -* Удаляем первый добавленный положительный эффект с флагом dispel. * -* Возвращаем результат выполнения операции. * +* Removes the first addition to the positive effect of the flag dispel.* +* Return the result of the operation. * * * ************************************************************************/ @@ -633,7 +633,7 @@ /************************************************************************ * * -* Проверяем наличие статус-эффекта в контейнере * +* Check if the status effect in the container * * * ************************************************************************/ @@ -794,7 +794,7 @@ /************************************************************************ * * -* Проверяем наличие статус-эффекта в контейнере с уникальным subid * +* Check if the status effect in a container with a unique subid * * * ************************************************************************/ @@ -879,7 +879,7 @@ /************************************************************************ * * -* Пересчитываем иконки всех эфффектов * +* Will recalculate all effects * * * ************************************************************************/ @@ -916,7 +916,7 @@ /************************************************************************ * * -* Устанавливаем имя эффекта для работы со скриптами * +* Set the name of the effect to work with scripts * * * ************************************************************************/ @@ -964,7 +964,7 @@ /************************************************************************ * * -* Загружаем эффекты персонажа * +* Load effects of the character * * * ************************************************************************/ @@ -1011,12 +1011,12 @@ } } } - m_POwner->UpdateHealth(); // после загрузки эффектов пересчитываем максимальное количество HP/MP + m_POwner->UpdateHealth(); // after loading effects recalculate the maximum amount of HP / MP } /************************************************************************ * * -* Сохраняем временные эффекты персонажа * +* Save time effects of the character * * * ************************************************************************/ @@ -1056,8 +1056,8 @@ /************************************************************************ * * -* Проверяем все эффекты на необходимость удаление, если их срок * -* действия истек. * +* Check all the effects of the need for removal if their duration * +* expired. * * * ************************************************************************/ Index: src/map/status_effect_container.h =================================================================== --- src/map/status_effect_container.h (revision 3304) +++ src/map/status_effect_container.h (working copy) @@ -41,8 +41,8 @@ { public: - uint64 m_Flags; // биты переполнения байтов m_StatusIcons (по два бита на каждый эффект) - uint8 m_StatusIcons[32]; // иконки статус-эффектов + uint64 m_Flags; // overflow bits bytes m_StatusIcons (two bits for each effect) + uint8 m_StatusIcons[32]; // icon status effects bool ApplyBardEffect(CStatusEffect* PStatusEffect, uint8 maxSongs); bool ApplyCorsairEffect(CStatusEffect* PStatusEffect, uint8 maxRolls, uint8 bustDuration); @@ -51,33 +51,33 @@ bool DelStatusEffect(EFFECT StatusID); bool DelStatusEffectSilent(EFFECT StatusID); bool DelStatusEffect(EFFECT StatusID, uint16 SubID); - void DelStatusEffectsByFlag(uint16 flag); // удаляем все эффекты с указанным типом - void DelStatusEffectsByIcon(uint16 IconID); // удаляем все эффекты с указанной иконкой + void DelStatusEffectsByFlag(uint16 flag); // remove all the effects of a specified type + void DelStatusEffectsByIcon(uint16 IconID); // remove all the effects of a specified icon void DelStatusEffectsByType(uint16 Type); bool DelStatusEffectWithPower(EFFECT StatusID, uint16 power); void KillAllStatusEffect(); - bool HasStatusEffect(EFFECT StatusID); // проверяем наличие эффекта - bool HasStatusEffect(EFFECT StatusID, uint16 SubID); // проверяем наличие эффекта с уникальным subid + bool HasStatusEffect(EFFECT StatusID); // check for the effect of + bool HasStatusEffect(EFFECT StatusID, uint16 SubID); // check for the effect of a unique subid bool HasStatusEffectByFlag(uint16 flag); - EFFECT EraseStatusEffect(); // удаляем первый отрицательный эффект - uint8 EraseAllStatusEffect(); // erases all status effects - EFFECT DispelStatusEffect(); // удаляем первый положительный эффект - uint8 DispelAllStatusEffect(); // dispels all status effects - CStatusEffect* StealStatusEffect(); // dispels one effect and returns it + EFFECT EraseStatusEffect(); // Removes the first negative effect + uint8 EraseAllStatusEffect(); // erases all status effects + EFFECT DispelStatusEffect(); // Removes the first positive effect + uint8 DispelAllStatusEffect(); // dispels all status effects + CStatusEffect* StealStatusEffect(); // dispels one effect and returns it CStatusEffect* GetStatusEffect(EFFECT StatusID); CStatusEffect* GetStatusEffect(EFFECT StatusID, uint16 SubID); - void UpdateStatusIcons(); // пересчитываем иконки эффектов + void UpdateStatusIcons(); // recalculate the effects will void CheckEffects(uint32 tick); void CheckRegen(uint32 tick); - void LoadStatusEffects(); // загружаем эффекты персонажа - void SaveStatusEffects(); // сохраняем эффекты персонажа + void LoadStatusEffects(); // load the effects of the character + void SaveStatusEffects(); // save the character effects - uint8 GetEffectsCount(uint16 SubID); // получаем количество эффектов с указанным subid + uint8 GetEffectsCount(uint16 SubID); // get the number of effects with this subid bool CheckForElevenRoll(); bool HasBustEffect(uint16 id); @@ -91,8 +91,8 @@ CBattleEntity* m_POwner; // void ReplaceStatusEffect(EFFECT effect); //this needs to be implemented - void RemoveStatusEffect(uint32 id, bool silent = false); // удаляем эффект по его номеру в контейнере - void SetEffectParams(CStatusEffect* StatusEffect); // устанавливаем имя эффекта + void RemoveStatusEffect(uint32 id, bool silent = false); // remove the effect on its number in the container + void SetEffectParams(CStatusEffect* StatusEffect); // Set the name of the effect void OverwriteStatusEffect(CStatusEffect* StatusEffect); Index: src/map/synthutils.cpp =================================================================== --- src/map/synthutils.cpp (revision 3304) +++ src/map/synthutils.cpp (working copy) @@ -44,7 +44,7 @@ #include "vana_time.h" #include "zoneutils.h" -//#define _DSP_SYNTH_DEBUG_MESSAGES_ // включаем отладочные сообщения +//#define _DSP_SYNTH_DEBUG_MESSAGES_ // turn on debug messages enum SYNTHESIS_ELEMENT { @@ -71,19 +71,20 @@ namespace synthutils { -/************************************************************************ -* * -* Проверяем наличие рецепта и возможности его синтеза (если его * -* сложность выше на 15 уровней, чем умение персонажа, то рецепт * -* считается сверх трудным и синтех отменяется). Так же собираем всю * -* необходимую информацию о рецепте, чтобы не обращаться к базе * -* несколько раз * -* * -* в поля itemID девятой ячейки сохраняем ID рецепта * -* в поля quantity 9-16 ячеек записываем требуемые значения skills * -* в поля itemID и slotID 10-14 ячеек записываем результаты синтеза * -* * -************************************************************************/ +/************************************************************************** +* * +* Check the presence of the counter and the possibility of its synthesis * +* (if it difficulty to 15 levels than the ability of the character, the * +* recipe is super difficult and sinteh canceled). Just collect all the * +* necessary information about the recipe, not to apply to the database * +* repeatedly * +* * +* In the field itemID ninth cells retain ID recipe * +* In the field of cell quantity 9-16 record the required values ​​of skills * +* In the field itemID slotID 10-14 cells and recorded the results of the * +* synthesis * +* * +**************************************************************************/ bool isRightRecipe(CCharEntity* PChar) { @@ -117,7 +118,7 @@ PChar->Container->getItemID(7), PChar->Container->getItemID(8)); - if (ret != SQL_ERROR && + if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0 && Sql_NextRow(SqlHandle) == SQL_SUCCESS) { @@ -125,7 +126,7 @@ if ((KeyItemID == 0) || (charutils::hasKeyItem(PChar,KeyItemID))) { - // в девятую ячейку записываем id рецепта + // in the ninth cell id write a prescription PChar->Container->setItem(9, Sql_GetUIntData(SqlHandle,0),0xFF,0); #ifdef _DSP_SYNTH_DEBUG_MESSAGES_ ShowDebug(CL_CYAN"Recipe matches ID %u.\n" CL_RESET, PChar->Container->getItemID(9)); @@ -137,16 +138,16 @@ PChar->Container->setItem(10 + 4, (uint16)Sql_GetUIntData(SqlHandle,13), (uint8)Sql_GetUIntData(SqlHandle,17), 0); // RESULT_HQ3 uint16 skillValue = 0; - uint16 currentSkill = 0; + uint16 currentSkill = 0; for (uint8 skillID = 49; skillID < 57; ++skillID) { skillValue = (uint16)Sql_GetUIntData(SqlHandle,(skillID-49+2)); currentSkill = PChar->RealSkills.skill[skillID]; - // skill записываем в поле quantity ячеек 9-16 + // skill recorded in the quantity of cells 9-16 PChar->Container->setQuantity(skillID-40, skillValue); - + #ifdef _DSP_SYNTH_DEBUG_MESSAGES_ ShowDebug(CL_CYAN"Current skill = %u, Recipe skill = %u\n" CL_RESET, currentSkill, skillValue*10); #endif @@ -180,8 +181,8 @@ /************************************************************************ * * -* Расчитываем сложность синтеза для конкретного умения. Хорошо бы * -* сохранять результат в какой-нибудь ячейке контейнера (тип dooble) * +* Computes the complexity of the synthesis of a specific skill. It * +* would be nice store the result in some cell container (type double) * * * ************************************************************************/ @@ -237,7 +238,7 @@ }else if (WeekDay == LIGHTSDAY){ difficult -= 1; }else if (WeekDay == DARKSDAY){ - difficult += 1; + difficult += 1; } #ifdef _DSP_SYNTH_DEBUG_MESSAGES_ @@ -246,20 +247,20 @@ ShowDebug(CL_CYAN"Moon = %g\n" CL_RESET, MoonPhase); ShowDebug(CL_CYAN"Difficulty = %g\n" CL_RESET, difficult); #endif - + return difficult; } /************************************************************************ * * -* Проверяем возможность создания предметов высокого качества * -* Это сделано из-за наличия в игре специфических колец. * +* Check the possibility of creating high quality items * +* This is done because of the game-specific ring. * * * ************************************************************************/ bool canSynthesizeHQ(CCharEntity* PChar, uint8 skillID) { - uint16 ModID = 0; + uint16 ModID = 0; switch (skillID) { @@ -278,8 +279,8 @@ /************************************************************************ * * -* Получаем ID главного умения в рецепте. Именно от него зависит * -* возможность создания предметов высокого качества * +* Obtain the ID of the main skills in the recipe. That depends on it * +* The ability to create high quality items * * * ************************************************************************/ @@ -287,8 +288,8 @@ { uint8 skillValue = 0; uint8 generalCraft = 0; - - for(uint8 skillID = 49; skillID < 57; skillID ++) + + for(uint8 skillID = 49; skillID < 57; skillID ++) { if (PChar->Container->getQuantity(skillID-40) > skillValue) { @@ -300,17 +301,16 @@ return generalCraft; } -/************************************************************************ -* * -* Расчет результата синтеза. * -* * -* результат синтеза записываем в поле quantity ячейки кристалла. * -* сохраняем в slotID ячейки кристалла ID умения, из-за котороги синтез * -* провалился. * -* * -************************************************************************/ +/************************************************************************** +* * +* The calculation results of synthesis. * +* * +* The result of the synthesis is recorded in the quantity of the crystal * +* cell. Store in slotID crystal cell ID skills, because synthesis Failed. * * +* * +**************************************************************************/ -uint8 calcSynthResult(CCharEntity* PChar) +uint8 calcSynthResult(CCharEntity* PChar) { uint8 count = 0; uint8 result = 0; @@ -319,18 +319,19 @@ double success = 0; double chance = 0; - for(uint8 skillID = 49; skillID < 57; ++skillID) + for(uint8 skillID = 49; skillID < 57; ++skillID) { uint8 checkSkill = PChar->Container->getQuantity(skillID-40); - if(checkSkill != 0) + if(checkSkill != 0) { double synthDiff = getSynthDifficulty(PChar, skillID); hqtier = 0; count++; - if(synthDiff <= 0) + if(synthDiff <= 0) { success = 0.95; + synthDiff -= map_config.craft_success; if((synthDiff <= 0) && (synthDiff >= -10)){ success -= (double)(PChar->Container->getType() == ELEMENT_LIGHTNING) * 0.2; @@ -344,7 +345,7 @@ }else if (synthDiff <= -71) hqtier = 5; }else{ - success = 0.95 - (synthDiff / 10) - (double)(PChar->Container->getType() == ELEMENT_LIGHTNING) * 0.2; + success = 0.95 - (synthDiff / 10) - (double)(PChar->Container->getType() == ELEMENT_LIGHTNING) * 0.2; if(success < 0.05) success = 0.05; } @@ -354,16 +355,16 @@ ShowDebug(CL_CYAN"Success: %g Random: %g\n" CL_RESET, success, random); #endif - if(random < success) + if(random < (success + map_config.craft_success*.01)) { - for(int32 i = 0; i < 3; ++i) + for(int32 i = 0; i < 3; ++i) { random = rand() / ((double) RAND_MAX); #ifdef _DSP_SYNTH_DEBUG_MESSAGES_ ShowDebug(CL_CYAN"HQ Tier: %i Random: %g\n" CL_RESET, hqtier, random); #endif - - switch(hqtier) + + switch(hqtier) { case 5: chance = 0.700; break; case 4: chance = 0.500; break; @@ -372,14 +373,14 @@ case 1: chance = 0.015; break; default: chance = 0.000; break; } - if(chance < random) + if((chance + map_config.craft_success*.01) < random) break; result += 1; hqtier -= 1; } }else{ - // сохраняем умение, из-за которого синтез провалился. - // используем slotID ячейки кристалла, т.к. он был удален еще в начале синтеза + // Save the ability, because of which the synthesis failed. + // Use slotID crystal cell, as it was removed at the beginning of the synthesis PChar->Container->setInvSlotID(0,skillID); result = -1; break; @@ -394,7 +395,7 @@ result = SYNTHESIS_SUCCESS; } - // результат синтеза записываем в поле quantity ячейки кристалла. + // result of synthesis is recorded in the quantity of the crystal cell. PChar->Container->setQuantity(0, result); switch(result) @@ -435,15 +436,16 @@ /************************************************************************ * * -* Пытаемся увеличить умение персонажа. * -* Desynthesis (разбор предметов на запчасть) не увеличивает умение. * +* Trying to increase the ability of the character. * +* Desynthesis (analysis of objects on spare part) does not increase * +* the skill. * * * -* Ломать не строить. Ломание столов и стульев не сделает из нас * -* плотника, значит умение в данном случае не повышается. * +* Break down than to build. Breaking tables and chairs will not make us* +* Carpenter, so in this case the ability to not rise. * * * ************************************************************************/ -int32 doSynthSkillUp(CCharEntity* PChar) +int32 doSynthSkillUp(CCharEntity* PChar) { if (PChar->Container->getType() == ELEMENT_LIGHTNING) { @@ -453,21 +455,21 @@ double MoonPhase = (double)CVanaTime::getInstance()->getMoonPhase(); double MoonCorrection = MoonPhase / 500; - for(uint8 skillID = 49; skillID < 57; ++skillID) + for(uint8 skillID = 49; skillID < 57; ++skillID) { - if (PChar->Container->getQuantity(skillID-40) == 0) // получаем необходимый уровень умения рецепта + if (PChar->Container->getQuantity(skillID-40) == 0) // ability to obtain the necessary level of prescription { continue; } - uint8 skillRank = 9; //PChar->RealSkills.rank[skillID]; - uint16 maxSkill = (skillRank+1)*100; + uint8 skillRank = PChar->RealSkills.rank[skillID]; // 9 + uint16 maxSkill = 1100; int32 charSkill = PChar->RealSkills.skill[skillID]; int32 basDiff = PChar->Container->getQuantity(skillID-40) - charSkill/10; double synthDiff = getSynthDifficulty(PChar, skillID); - if ((basDiff <= 0) || ((basDiff > 5) && (PChar->Container->getQuantity(0) == SYNTHESIS_FAIL))) // результат синтеза хранится в quantity нулевой ячейки + if (map_config.craft_skill_onfail == 0 && ((basDiff <= 0) || ((basDiff > 5) && (PChar->Container->getQuantity(0) == SYNTHESIS_FAIL)))) // the result is stored in the synthesis quantity zero cell { return 0; } @@ -475,19 +477,24 @@ if (charSkill < maxSkill) { double skillUpChance = (synthDiff*(map_config.craft_multiplier - (log(1.2 + charSkill/100) + MoonCorrection)))/10; - skillUpChance = skillUpChance/(1 + (PChar->Container->getQuantity(0) == SYNTHESIS_FAIL)); // результат синтеза хранится в quantity нулевой ячейки + if (map_config.craft_skill_onfail == 0) + { + skillUpChance = skillUpChance/(1 + (PChar->Container->getQuantity(0) == SYNTHESIS_FAIL)); // the result is stored in the synthesis quantity zero cell + } double random = rand() / ((double)RAND_MAX); #ifdef _DSP_SYNTH_DEBUG_MESSAGES_ ShowDebug(CL_CYAN"Skill up chance: %g Random: %g\n" CL_RESET, skillUpChance, random); #endif - if (random < skillUpChance) + if (random < (skillUpChance + map_config.craft_skillamt*.01)) { int32 satier = 0; int32 skillAmount = 1; double chance = 0; + synthDiff += (map_config.craft_skillamt*.1); + if((synthDiff >= 1) && (synthDiff < 3)){ satier = 1; }else if((synthDiff >= 3) && (synthDiff < 5)){ @@ -500,15 +507,15 @@ satier = 5; //if (skillRank > 5) // satier--; - - for(uint8 i = 0; i < 4; i ++) + + for(uint8 i = 0; i < 4; i ++) { random = rand() / ((double)RAND_MAX); #ifdef _DSP_SYNTH_DEBUG_MESSAGES_ ShowDebug(CL_CYAN"SkillAmount Tier: %i Random: %g\n" CL_RESET, satier, random); #endif - - switch(satier) + + switch(satier) { case 5: chance = 0.900; break; case 4: chance = 0.700; break; @@ -517,7 +524,7 @@ case 1: chance = 0.100; break; default: chance = 0.000; break; } - if(chance < random) + if((chance + map_config.craft_skillamt*.01) < random) break; skillAmount += 1; satier -= 1; @@ -528,15 +535,15 @@ skillAmount = maxSkill - charSkill; } - PChar->RealSkills.skill[skillID] += skillAmount; + PChar->RealSkills.skill[skillID] += skillAmount; PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, skillID, skillAmount, 38)); - if((charSkill/10) < (charSkill + skillAmount)/10) + if((charSkill/10) < (charSkill + skillAmount)/10) { PChar->WorkingSkills.skill[skillID] += 0x20; PChar->pushPacket(new CCharSkillsPacket(PChar)); - PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, skillID, (charSkill + skillAmount)/10, 53)); + PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, skillID, (charSkill + skillAmount)/10, 53)); } charutils::SaveCharSkills(PChar, skillID); @@ -548,22 +555,22 @@ /************************************************************************ * * -* Синтез завершился неудачей. Решаем вопрос, сколько ингредиентов * -* потеряет персонаж. Вероятность потери зависить от умения, из-за * -* которого синтез провалился. ID умения сохранен в slotID ячейки * -* кристалла. * +* Synthesis failed. Solve the question of how many ingredients * +* lose character. The probability of loss depends on the ability, * +* because of the which is the synthesis failed. ID stored in the * +* ability of the cell slotID Crystal. * * * ************************************************************************/ -int32 doSynthFail(CCharEntity* PChar) +int32 doSynthFail(CCharEntity* PChar) { uint8 carrentCraft = PChar->Container->getInvSlotID(0); double synthDiff = getSynthDifficulty(PChar, carrentCraft); double moghouseAura = 0; - if (PChar->getZone() == 0) // неправильное условие, т.к. аура действует лишь в собственном доме + if (PChar->getZone() == 0) // abnormal condition, because Aura acts only in his own home { - // Проверяем элемент синтеза + // Check item synthesis switch (PChar->Container->getType()) { case ELEMENT_FIRE: moghouseAura = 0.05 * charutils::hasKeyItem(PChar,MOGHANCEMENT_FIRE); break; @@ -610,17 +617,17 @@ uint8 invSlotID = 0; uint8 nextSlotID = 0; uint8 lostCount = 0; - + double random = 0; double lostItem = 0.15 - moghouseAura + (synthDiff > 0 ? synthDiff/20 : 0); invSlotID = PChar->Container->getInvSlotID(1); - for(uint8 slotID = 1; slotID <= 8; ++slotID) + for(uint8 slotID = 1; slotID <= 8; ++slotID) { if (slotID != 8) nextSlotID = PChar->Container->getInvSlotID(slotID+1); - + random = rand() / ((double) RAND_MAX); #ifdef _DSP_SYNTH_DEBUG_MESSAGES_ ShowDebug(CL_CYAN"Lost Item: %g Random: %g\n" CL_RESET, lostItem, random); @@ -631,7 +638,7 @@ lostCount++; } - if(invSlotID != nextSlotID) + if(invSlotID != nextSlotID) { CItem* PItem = PChar->getStorage(LOC_INVENTORY)->GetItem(invSlotID); @@ -639,22 +646,22 @@ { PItem->setSubType(ITEM_UNLOCKED); - if(lostCount > 0) + if(lostCount > 0) { #ifdef _DSP_SYNTH_DEBUG_MESSAGES_ ShowDebug(CL_CYAN"Removing quantity %u from inventory slot %u\n" CL_RESET, lostCount, invSlotID); #endif - + charutils::UpdateItem(PChar, LOC_INVENTORY, invSlotID, -(int32)lostCount); lostCount = 0; - }else{ + }else{ PChar->pushPacket(new CInventoryAssignPacket(PItem, INV_NORMAL)); } } invSlotID = nextSlotID; nextSlotID = 0; } - if(invSlotID == 0xFF) + if(invSlotID == 0xFF) break; } @@ -675,8 +682,8 @@ /************************************************************************ * * -* Начало синтеза. * -* в поле type контейнера записываем элемент синтеза * +* Home synthesis. * +* In the container type recording element synthesis * * * ************************************************************************/ @@ -687,7 +694,7 @@ uint16 crystalType = PChar->Container->getItemID(0); - switch(crystalType) + switch(crystalType) { case 0x1000: case 0x108E: @@ -733,12 +740,12 @@ PChar->Container->setType(element); - if (!isRightRecipe(PChar)) + if (!isRightRecipe(PChar)) { return 0; } - // удаляем кристалл + // remove the crystal charutils::UpdateItem(PChar, LOC_INVENTORY, PChar->Container->getInvSlotID(0), -1); uint8 result = calcSynthResult(PChar); @@ -746,12 +753,12 @@ uint8 invSlotID = 0; uint8 tempSlotID = 0; uint16 itemID = 0; - uint32 quantity = 0; + uint32 quantity = 0; - for(uint8 slotID = 1; slotID <= 8; ++slotID) + for(uint8 slotID = 1; slotID <= 8; ++slotID) { tempSlotID = PChar->Container->getInvSlotID(slotID); - if ((tempSlotID != 0xFF) && (tempSlotID != invSlotID)) + if ((tempSlotID != 0xFF) && (tempSlotID != invSlotID)) { invSlotID = tempSlotID; @@ -770,23 +777,23 @@ if(PChar->loc.zone->GetID() != 255 && PChar->loc.zone->GetID() != 0) { - PChar->loc.zone->PushPacket(PChar, CHAR_INRANGE_SELF, new CSynthAnimationPacket(PChar,effect,result)); + PChar->loc.zone->PushPacket(PChar, CHAR_INRANGE_SELF, new CSynthAnimationPacket(PChar,effect,result)); } else { PChar->pushPacket(new CSynthAnimationPacket(PChar, effect, result)); } - + return 0; } /************************************************************************ * * -* Отправляем результат синтеза персонажу * +* Send the result of synthesis of character * * * ************************************************************************/ -int32 doSynthResult(CCharEntity* PChar) +int32 doSynthResult(CCharEntity* PChar) { uint8 m_synthResult = PChar->Container->getQuantity(0); @@ -795,19 +802,19 @@ doSynthFail(PChar); }else{ uint16 itemID = PChar->Container->getItemID(10 + m_synthResult); - uint8 quantity = PChar->Container->getInvSlotID(10 + m_synthResult); // к сожалению поле quantity занято + uint8 quantity = PChar->Container->getInvSlotID(10 + m_synthResult); // Unfortunately field quantity employed uint8 invSlotID = 0; uint8 nextSlotID = 0; uint8 removeCount = 0; invSlotID = PChar->Container->getInvSlotID(1); - - for(uint8 slotID = 1; slotID <= 8; ++slotID) + + for(uint8 slotID = 1; slotID <= 8; ++slotID) { nextSlotID = (slotID != 8 ? PChar->Container->getInvSlotID(slotID+1) : 0); removeCount++; - + if (invSlotID != nextSlotID) { if (invSlotID != 0xFF) @@ -816,7 +823,7 @@ ShowDebug(CL_CYAN"Removing quantity %u from inventory slot %u\n" CL_RESET,removeCount,invSlotID); #endif PChar->getStorage(LOC_INVENTORY)->GetItem(invSlotID)->setSubType(ITEM_UNLOCKED); - charutils::UpdateItem(PChar, LOC_INVENTORY, invSlotID, -(int32)removeCount); + charutils::UpdateItem(PChar, LOC_INVENTORY, invSlotID, -(int32)removeCount); } invSlotID = nextSlotID; nextSlotID = 0; @@ -824,7 +831,7 @@ } } - // TODO: перейти на новую функцию AddItem, чтобы не обновлять signature ручками + // TODO: move to a new function AddItem, not to update the signature pens invSlotID = charutils::AddItem(PChar, LOC_INVENTORY, itemID, quantity); @@ -834,7 +841,7 @@ { if ((PItem->getFlag() & ITEM_FLAG_INSCRIBABLE) && (PChar->Container->getItemID(0) > 0x1080)) { - // TODO: вынести метод в uitls (добавить метод обратного действия) + // TODO: render method uitls (add a method reverse acting) uint8 signature[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; for(uint8 currChar = 0; currChar < PChar->name.size(); ++currChar) @@ -882,12 +889,12 @@ /************************************************************************ * * -* Завершаем синтез * +* complete the synthesis * * * ************************************************************************/ -int32 sendSynthDone(CCharEntity* PChar) -{ +int32 sendSynthDone(CCharEntity* PChar) +{ doSynthResult(PChar); PChar->animation = ANIMATION_NONE; Index: src/map/synthutils.h =================================================================== --- src/map/synthutils.h (revision 3304) +++ src/map/synthutils.h (working copy) @@ -28,7 +28,7 @@ /************************************************************************ * * -* Все методы, необходимые для работы синтеза * +* All methods required for the synthesis * * * ************************************************************************/ Index: src/map/time_server.cpp =================================================================== --- src/map/time_server.cpp (revision 3304) +++ src/map/time_server.cpp (working copy) @@ -30,6 +30,7 @@ #include "zoneutils.h" #include "conquest_system.h" #include "lua/luautils.h" +#include "charutils.h" int32 time_server(uint32 tick,CTaskMgr::CTask* PTask) @@ -64,4 +65,10 @@ CTransportHandler::getInstance()->TransportTimer(); return 0; -} \ No newline at end of file +} + +int32 save_playtime(uint32 tick, CTaskMgr::CTask* PTask) +{ + zoneutils::SavePlayTime(); + return 0; +} Index: src/map/time_server.h =================================================================== --- src/map/time_server.h (revision 3304) +++ src/map/time_server.h (working copy) @@ -29,5 +29,6 @@ int32 time_server(uint32 tick,CTaskMgr::CTask*); +int32 save_playtime(uint32 tick, CTaskMgr::CTask*); #endif Index: src/map/trade_container.h =================================================================== --- src/map/trade_container.h (revision 3304) +++ src/map/trade_container.h (working copy) @@ -45,13 +45,13 @@ uint8 getType(); uint8 getItemsCount(); - uint8 getSlotCount(); // количество занятых ячеек - uint32 getTotalQuantity(); // общее количество предметов (gil считаются за 1) + uint8 getSlotCount(); // number of occupied cells + uint32 getTotalQuantity(); // total number of subjects (gil count as 1) CItem* getItem(uint8 slotID); uint16 getItemID(uint8 slotID); uint8 getInvSlotID(uint8 slotID); - uint32 getQuantity(uint8 slotID); // количество предметов в ячейке - uint32 getItemQuantity(uint16 itemID); // количество предметов одного типа + uint32 getQuantity(uint8 slotID); // number of items in the cell + uint32 getItemQuantity(uint16 itemID); // number of items of the same type void setType(uint8 type); void setItemsCount(uint8 count); @@ -61,12 +61,12 @@ void setQuantity(uint8 slotID, uint32 quantity); void setItem(uint8 slotID, uint16 itemID, uint8 invSlotID, uint32 quantity, CItem* item = NULL); - void Clean(); // отчищаем контейнер + void Clean(); // scrap container private: - uint8 m_type; // тип контейнера (тип кристалла, нация магазина и т.д.) - uint8 m_ItemsCount; // количество предметов в контейнере (устанавливаем самостоятельно) + uint8 m_type; // container type (type of crystal, Nation magazine, etc.) + uint8 m_ItemsCount; // number of items in a container (set your own) CItem* m_PItem[CONTAINER_SIZE]; uint8 m_slotID[CONTAINER_SIZE]; Index: src/map/trait.cpp =================================================================== --- src/map/trait.cpp (revision 3304) +++ src/map/trait.cpp (working copy) @@ -116,17 +116,17 @@ /************************************************************************ * * -* Реализация namespase для работы с traits * +* Implementing namespase to work with traits * * * ************************************************************************/ namespace traits { - TraitList_t PTraitsList[MAX_JOBTYPE]; // список traits, сгруппированный по профессиям + TraitList_t PTraitsList[MAX_JOBTYPE]; // list of traits, grouped by occupation /************************************************************************ * * - * Загружаем список traits * + * Load a list of traits * * * ************************************************************************/ @@ -176,6 +176,6 @@ void FreeTraitsList() { - // список освобождается операционной системой автоматически при завершении работы сервера + // List is released by the operating system automatically when the server } }; \ No newline at end of file Index: src/map/trait.h =================================================================== --- src/map/trait.h (revision 3304) +++ src/map/trait.h (working copy) @@ -79,6 +79,7 @@ TRAIT_RESIST_GRAVITY = 58, TRAIT_RESIST_SLOW = 59, TRAIT_RESIST_CHARM = 60, + TRAIT_RESIST_AMNESIA = 61, TRAIT_TREASURE_HUNTER_II = 64, TRAIT_GILFINDER_II = 65, TRAIT_KICK_ATTACKS = 66, @@ -113,9 +114,27 @@ TRAIT_OPTIMIZATION = 95, TRAIT_CLOSED_POSITION = 96, TRAIT_STORMSURGE = 97, + TRAIT_CRIT_ATK_BONUS = 98, + TRAIT_CRIT_DEF_BONUS = 99, + TRAIT_TACTICAL_PARRY = 100, + TRAIT_TACTICAL_GUARD = 101, + TRAIT_SHIELD_DEF_BONUS = 102, + TRAIT_STOUT_SERVANT = 103, + TRAIT_TRUE_SHOT = 104, + TRAIT_BLOOD_BOON = 105, + TRAIT_SKILLCHAIN_BONUS = 106, + TRAIT_FENCER = 107, + TRAIT_CONSERVE_TP = 108, + TRAIT_OCCULT_ACUMEN = 109, + TRAIT_MAGIC_BURST_BONUS = 110, + TRAIT_DIVINE_BENISON = 111, + TRAIT_ELEMENTAL_CELERITY = 112, + TRAIT_DEAD_AIM = 113, + TRAIT_TRANQUIL_HEART = 114, + TRAIT_STALWART_SOUL = 115, }; -#define MAX_TRAIT_ID 100 +#define MAX_TRAIT_ID 118 /************************************************************************ * * @@ -151,7 +170,7 @@ /************************************************************************ * * -* namespase для работы с traits * +* Namespase to work with traits * * * ************************************************************************/ Index: src/map/transport.cpp =================================================================== --- src/map/transport.cpp (revision 3304) +++ src/map/transport.cpp (working copy) @@ -31,7 +31,7 @@ /************************************************************************ * * -* Создание глобальной ссылки на объект класса * +* Create a global reference to the class object * * * ************************************************************************/ @@ -47,7 +47,7 @@ /************************************************************************ * * -* В конструкторе инициализируем всю транспортную систему * +* In the constructor, initialize the whole transport system * * * ************************************************************************/ @@ -59,7 +59,7 @@ /************************************************************************ * * -* Инициализация транспорта (корабли и самолеты) * +* Initializing transport (ships and aircraft) * * * ************************************************************************/ @@ -125,7 +125,7 @@ /************************************************************************ * * -* Инициализация лифтов и автоматических дверей * +* Initialization elevators and automatic doors * * * ************************************************************************/ @@ -168,7 +168,7 @@ /************************************************************************ * * -* Все логика передвижения транспорта * +* All logic movement of transport * * * ************************************************************************/ @@ -176,8 +176,8 @@ { uint32 VanaTime = CVanaTime::getInstance()->getDate(); - // в портовых зонах необходимо написать макросы на случай, если персонаж вышел из игры в корабле. - // при входе в игру он должен оказаться на пристани + // To the port areas to write macros in case the person got out of the ship. + // When entering the game, he should be in the dock for(uint32 i = 0; i < TransportList.size(); ++i) { @@ -196,22 +196,22 @@ PTransport->Dock.zone->PushPacket(NULL, CHAR_INZONE, new CEntityUpdatePacket(PTransport->PTransportNPC, ENTITY_SPAWN)); } - // персонажи видят корабль, иначе ждем следующего прибытия + // Characters see the ship, or wait for the next arrival else if (PTransport->PTransportNPC->status == STATUS_NORMAL) { - // пора подтягивать пассажиров к выходу + // it's time to pull the passengers to exit if (ShipTimerOffset == PTransport->TimeAnimationArrive - 10) { PTransport->PTransportNPC->loc.boundary = 0; zoneutils::GetZone(PTransport->Dock.prevzone)->TransportDepart(PTransport->PTransportNPC); } - // корабль причалил, открываем двери пассажирам + // the ship docked, open the passenger door else if (ShipTimerOffset == PTransport->TimeAnimationArrive) { PTransport->PDoorNPC->animation = ANIMATION_OPEN_DOOR; PTransport->Dock.zone->PushPacket(PTransport->PDoorNPC, CHAR_INRANGE, new CEntityUpdatePacket(PTransport->PDoorNPC, ENTITY_UPDATE)); } - //корабль отчаливает + //ship cast off else if (ShipTimerOffset == PTransport->TimeAnimationArrive + PTransport->TimeWaiting) { PTransport->PDoorNPC->animation = ANIMATION_CLOSE_DOOR; @@ -224,7 +224,7 @@ PTransport->Dock.zone->PushPacket(PTransport->PDoorNPC, CHAR_INRANGE, new CEntityUpdatePacket(PTransport->PDoorNPC, ENTITY_UPDATE)); PTransport->Dock.zone->PushPacket(NULL, CHAR_INZONE, new CEntityUpdatePacket(PTransport->PTransportNPC, ENTITY_UPDATE)); } - //корабль исчезает + //ship disappears else if (ShipTimerOffset == PTransport->TimeAnimationArrive + PTransport->TimeWaiting + PTransport->TimeAnimationDepart) { PTransport->PTransportNPC->status = STATUS_DISAPPEAR; Index: src/map/treasure_pool.cpp =================================================================== --- src/map/treasure_pool.cpp (revision 3304) +++ src/map/treasure_pool.cpp (working copy) @@ -35,12 +35,12 @@ #include "treasure_pool.h" -#define TREASURE_CHECKTIME 2500 // частота проверки контейнера - 2.5 секунд -#define TREASURE_LIVETIME 300000 // время жизни предметов в контейнере - 5 минут +#define TREASURE_CHECKTIME 2500 // frequency test container - 2.5 seconds +#define TREASURE_LIVETIME 300000 // lifetime of objects in the container - 5 minutes /************************************************************************ * * -* Инициализация TreasurePool * +* Initialize TreasurePool * * * ************************************************************************/ @@ -60,7 +60,7 @@ /************************************************************************ * * -* Узнаем текущий тип контейнера * +* Know the current type of container * * * ************************************************************************/ @@ -135,7 +135,7 @@ /************************************************************************ * * -* Добавляем предмет в хранилище * +* Add the item to the store * * * ************************************************************************/ @@ -187,7 +187,7 @@ /************************************************************************ * * -* Добавляем предмет в хранилище * +* Add the item to the store * * * ************************************************************************/ @@ -260,7 +260,7 @@ /************************************************************************ * * -* Персонаж отказывается/голосует за предмет в хранилище * +* Character refuses / vote for the subject in store * * * ************************************************************************/ Index: src/map/treasure_pool.h =================================================================== --- src/map/treasure_pool.h (revision 3304) +++ src/map/treasure_pool.h (working copy) @@ -40,8 +40,8 @@ /************************************************************************ * * -* Для совместимости с кластерной системой, персонаж получает новый * -* TreasurePool при переходе между зонами * +* For compatibility with the cluster system, the character gains new * +* TreasurePool transition between zones * * * ************************************************************************/ Index: src/map/universal_container.cpp =================================================================== --- src/map/universal_container.cpp (revision 3304) +++ src/map/universal_container.cpp (working copy) @@ -30,7 +30,7 @@ /************************************************************************ * * -* Конструктор * +* Designer * * * ************************************************************************/ @@ -41,7 +41,7 @@ /************************************************************************ * * -* Отчищаем контейнер * +* Cleans container * * * ************************************************************************/ @@ -65,7 +65,7 @@ /************************************************************************ * * -* Узнаем цель обмена * +* Know the purpose of sharing * * * ************************************************************************/ @@ -76,7 +76,7 @@ /************************************************************************ * * -* Устанавливаем цель обмена * +* Set the target Exchange * * * ************************************************************************/ @@ -87,7 +87,7 @@ /************************************************************************ * * -* Узнаем текущий тип контейнера * +* Know the current type of container * * * ************************************************************************/ @@ -98,7 +98,7 @@ /************************************************************************ * * -* Устанавливаем текущий тип контейнера * +* Set the current type of container * * * ************************************************************************/ @@ -111,7 +111,7 @@ /************************************************************************ * * -* Запрещаем изменение содержимого контейнера * +* Do not modify the contents of the container * * * ************************************************************************/ @@ -122,7 +122,7 @@ /************************************************************************ * * -* Проверяем, заблокирован ли контейнер * +* Check whether the container is locked * * * ************************************************************************/ @@ -133,7 +133,7 @@ /************************************************************************ * * -* Проверяем, пуст ли контейнер * +* Check whether the container is empty * * * ************************************************************************/ @@ -144,7 +144,7 @@ /************************************************************************ * * -* Проверяем, пуста ли ячейка * +* Check whether the cell is empty * * * ************************************************************************/ @@ -159,7 +159,7 @@ /************************************************************************ * * -* Добавляем предмет в указанныю ячейку контейнера * +* Add item to ukazannyyu cell container * * * ************************************************************************/ @@ -178,7 +178,7 @@ /************************************************************************ * * -* Узнаем количество предметов, находящихся в контейнере * +* Get the number of objects in the container * * * ************************************************************************/ @@ -189,7 +189,7 @@ /************************************************************************ * * -* Получаем предмет из указанной ячейки контейнера * +* Get an object from a specified cell container * * * ************************************************************************/ Index: src/map/universal_container.h =================================================================== --- src/map/universal_container.h (revision 3304) +++ src/map/universal_container.h (working copy) @@ -43,11 +43,11 @@ /************************************************************************ * * -* Универсальный контейнер общего назначения * +* General purpose container * * * ************************************************************************/ -// главный предмет (gil, кристалл, используемый предмет ...) +// The main subject (gil, crystal, used items ...) class CItem; class CBaseEntity; Index: src/map/vana_time.cpp =================================================================== --- src/map/vana_time.cpp (revision 3304) +++ src/map/vana_time.cpp (working copy) @@ -221,7 +221,7 @@ { switch (m_vHour) { - // FOG и MIDNIGHT являются TIME_NIGHT (это не ошибка) + // FOG and MIDNIGHT are TIME_NIGHT (this is not an error) case 0: m_TimeType = TIME_NIGHT; return TIME_MIDNIGHT; case 2: m_TimeType = TIME_NIGHT; return TIME_FOG; Index: src/map/vana_time.h =================================================================== --- src/map/vana_time.h (revision 3304) +++ src/map/vana_time.h (working copy) @@ -95,9 +95,9 @@ uint32 m_vDay; // Vanadiel Day (Day of the week, fire,earth,wind) uint32 m_vanaDate; // Vanadiel time in integer format - TIMETYPE m_TimeType; // текущий тип времени + TIMETYPE m_TimeType; // current time type - int32 m_customOffset; // Смещение игрового времени в игровых минутах + int32 m_customOffset; // offset of playing time in the game short }; #endif \ No newline at end of file Index: src/map/zone.cpp =================================================================== --- src/map/zone.cpp (revision 3304) +++ src/map/zone.cpp (working copy) @@ -22,8 +22,8 @@ */ // TODO: -// нужно разделить класс czone на базовый и наследников. уже нарисовались: Standard, Rezident, Instance и Dinamis -// у каждой из указанных зон особое поведение +// We have to divide the class czone the base and heirs. already drawn: Standard, Rezident, Instance and Dynamis +// In each of the areas of particular behavior #include "../common/showmsg.h" #include "../common/timer.h" @@ -63,8 +63,8 @@ /************************************************************************ * * -* Cервер для обработки активности сущностей (по серверу на зону) без * -* активных областей * +* Server for processing active entities (the server for the zone) * +* without active regions * * * ************************************************************************/ @@ -76,8 +76,8 @@ /************************************************************************ * * -* Cервер для обработки активности сущностей (по серверу на зону) c * -* активными областями * +* Server for processing active entities (the server for the zone) c * +* Active regions * * * ************************************************************************/ @@ -97,7 +97,7 @@ /************************************************************************ * * -* Класс CZone * +* Class CZone * * * ************************************************************************/ @@ -123,7 +123,7 @@ /************************************************************************ * * -* Функции доступа к полям класса * +* Access functions to class fields * * * ************************************************************************/ @@ -224,8 +224,8 @@ /************************************************************************ * * -* Загружаем ZoneLines, необходимые для правильного перемещения между * -* зонами. * +* Load ZoneLines, necessary for proper movement between * +* Zones. * * * ************************************************************************/ @@ -255,7 +255,7 @@ /************************************************************************ * * -* Загружаем параметры погоды * +* Load parameters weather * * * ************************************************************************/ @@ -318,7 +318,7 @@ /************************************************************************ * * -* Загружаем настройки зоны из базы * +* Load zone settings from the database * * * ************************************************************************/ @@ -355,7 +355,7 @@ m_tax = (uint16)(Sql_GetFloatData(SqlHandle,6) * 100); // tax for bazaar m_miscMask = (uint16)Sql_GetUIntData(SqlHandle,7); - if (Sql_GetData(SqlHandle,8) != NULL) // сейчас нельзя использовать bcnmid, т.к. они начинаются с нуля + if (Sql_GetData(SqlHandle,8) != NULL) // now we can not use bcnmid, because they start from scratch { m_InstanceHandler = new CInstanceHandler(m_zoneID); } @@ -372,7 +372,7 @@ /************************************************************************ * * -* Добавляем в зону MOB * +* Add the zone MOB * * * ************************************************************************/ @@ -389,7 +389,7 @@ /************************************************************************ * * -* Добавляем в зону NPC * +* Add the zone NPC * * * ************************************************************************/ @@ -418,7 +418,7 @@ /************************************************************************ * * -* Добавляем в зону PET (свободные targid 0x700-0x7FF) * +* Add the zone PET (free targid 0x700-0x7FF) * * * ************************************************************************/ @@ -463,7 +463,7 @@ /************************************************************************ * * -* Добавляем в зону активную область * +* Add the zone active area * * * ************************************************************************/ @@ -477,8 +477,8 @@ /************************************************************************ * * -* Ищем группу для монстра. Для монстров, объединенных в группу * -* работает система взаимопомощи (link) * +* We are looking for a group of monsters. For monsters, united in a * +* group mutual aid system works (link) * * * ************************************************************************/ @@ -511,7 +511,7 @@ /************************************************************************ * * -* Транспотр отправляется, необходимо собрать пассажиров * +* Transport sent, collect passengers * * * ************************************************************************/ @@ -593,8 +593,8 @@ /************************************************************************ * * -* Удаляем персонажа из зоны. Если запущен ZoneServer и персонажей * -* в зоне больше не осталось, то останавливаем ZoneServer * +* Delete the character of the zone. If you are running ZoneServer and * +* characters in the area there are no more, then stop ZoneServer * * * ************************************************************************/ @@ -691,7 +691,7 @@ } } - // TODO: могут возникать проблемы с переходом между одной и той же зоной (zone == prevzone) + // TODO: there can be problems with the transition between one and the same zone (zone == prevzone) m_charList.erase(PChar->targid); @@ -747,9 +747,9 @@ /************************************************************************ * * -* Добавляем персонажа в зону. Если ZoneServer не запущен то запускам. * -* Обязательно проверяем количество персонажей в зоне. * -* Максимальное число персонажей в одной зоне - 768 * +* Add the character to the zone. If it is not running ZoneServer * +* startups. Be sure to check the number of characters in the zone. * +* The maximum number of characters in the same area - 768 * * * ************************************************************************/ @@ -828,10 +828,10 @@ /************************************************************************ * * -* Проверка видимости монстров персонажем. Дистанцию лучше вынести в * -* глобальную переменную (настройки сервера) * -* Именно в этой функции будем проверять агрессию мостров, чтобы не * -* вычислять distance несколько раз (например в ZoneServer) * +* Check the sight of monsters character. Distance to make better * +* Global variable (server configuration) * +* It is in this function will check the Mostra aggression, not to * +* Calculate the distance several times (eg in ZoneServer) * * * ************************************************************************/ @@ -859,7 +859,7 @@ PChar->nameflags.flags & FLAG_GM) continue; - // проверка ночного/дневного сна монстров уже учтена в проверке CurrentAction, т.к. во сне монстры не ходят ^^ + // Check for a night / day sleep monsters already included in the verification CurrentAction, because dream monsters do not go ^ ^ CurrentDistance += PChar->getMod(MOD_STEALTH); @@ -962,8 +962,8 @@ /************************************************************************ * * -* Проверка видимости питомцев персонажем. Для появления питомцев * -* используем UPDATE вместо SPAWN. SPAWN используется лишь при вызове * +* Check visibility pets character. For the appearance of pets * +* Use UPDATE instead of SPAWN. SPAWN is only used when calling * * * ************************************************************************/ @@ -996,7 +996,7 @@ /************************************************************************ * * -* Проверка видимости NPCs персонажем. * +* Check the visibility of NPCs character. * * * ************************************************************************/ @@ -1031,10 +1031,10 @@ /************************************************************************ * * -* Проверка видимости персонажей. Смысл действий в том, что персонажи * -* сами себя обновляют и добавляются в списки других персонажей. * -* В оригинальной версии размер списка ограничен и изменяется в * -* пределах 25-50 видимых персонажей. * +* Check the visibility of characters. Meaning of actions that the * +* characters themselves updated and added to the lists of the other * +* characters. The original version of the list size is limited and * +* varies within 25-50 visible characters. * * * ************************************************************************/ @@ -1075,7 +1075,7 @@ /************************************************************************ * * -* Отображаем Moogle в MogHouse * +* Display the Moogle in MogHouse * * * ************************************************************************/ @@ -1098,7 +1098,7 @@ /************************************************************************ * * -* Отображаем транспотр в зоне (не хранится в основном списке) * +* Displays transport at (not stored in the main list) * * * ************************************************************************/ @@ -1113,7 +1113,7 @@ /************************************************************************ * * -* Получаем указатель на любую сущность в зоне по ее targid * +* Get a pointer to any entity in the area for its targid * * * ************************************************************************/ @@ -1174,7 +1174,7 @@ /************************************************************************ * * -* Oбработка реакции мира на смену времени суток * +* Machining World reaction to change the time of day * * * ************************************************************************/ @@ -1292,6 +1292,18 @@ } } +void CZone::SavePlayTime() +{ + if(!m_charList.empty()) + { + for(EntityList_t::const_iterator it = m_charList.begin(); it != m_charList.end(); ++it) + { + CCharEntity* PChar = (CCharEntity*)it->second; + charutils::SavePlayTime(PChar); + } + } +} + /************************************************************************ * * * * @@ -1316,7 +1328,7 @@ /************************************************************************ * * -* Отправляем глобальные пакеты * +* Send the global package * * * ************************************************************************/ @@ -1416,8 +1428,8 @@ /************************************************************************ * * -* Cервер для обработки активности и статус-эффектов сущностей в зоне. * -* При любом раскладе последними должны обрабатываться персонажи * +* Server for processing activities and the status of entities in the * +* area of ​​effect. In any case the latter should be handled characters * * * ************************************************************************/ @@ -1470,10 +1482,10 @@ /************************************************************************ * * -* Cервер для обработки активности и статус-эффектов сущностей в зоне. * -* Дополнительно обрабатывается проверка на вход и выход персонажей из * -* активных областей (пока реализован только вход в область). * -* При любом раскладе последними должны обрабатываться персонажи * +* Server for processing activities and the status of entities in the * +* area of ​​effect. Additionally, processed check in and out of * +* characters active regions (yet realized only entrance to the area). * +* In any case the latter should be handled characters * * * ************************************************************************/ Index: src/map/zone.h =================================================================== --- src/map/zone.h (revision 3304) +++ src/map/zone.h (working copy) @@ -400,16 +400,16 @@ enum ZONEMISC { - MISC_NONE = 0x0000, // 0x0000, // возможность использовать в любой зоне - MISC_ESCAPE = 0x0001, // 0x0001, // возможность использования заклинания escape; - MISC_TRACTOR = 0x0010, // 0x0002, // возможность использования заклинания tractor; - MISC_MAZURKA = 0x0008, // 0x0004, // возможность использования заклинания mazurka; - MISC_FELLOW = 0x0002, // 0x0008, // возможность призыва напарника npc - MISC_PET = 0x0080, // 0x0010, // возможность призыва питомца - MISC_CHOCOBO = 0x0004, // 0x0020, // возможность использования chocobo - MISC_MOGMENU = 0x0020, // 0x0040, // возможность общения с Nomad Moogle (доступ к меню mog house) - MISC_COSTUME = 0x0040, // 0x0080, // возможность использовать маскарадный костюм (costume) - MISC_TREASURE = 0x0100, // 0x0100, // наличие в зоне глобального TreasurePool + MISC_NONE = 0x0000, // 0x0000, // to use in any zone + MISC_ESCAPE = 0x0001, // 0x0001, // ability to use spells escape; + MISC_TRACTOR = 0x0010, // 0x0002, // ability to use spells tractor; + MISC_MAZURKA = 0x0008, // 0x0004, // ability to use spells mazurka; + MISC_FELLOW = 0x0002, // 0x0008, // possible recruitment partner npc + MISC_PET = 0x0080, // 0x0010, // opportunity to call your pet + MISC_CHOCOBO = 0x0004, // 0x0020, // the possibility of using chocobo + MISC_MOGMENU = 0x0020, // 0x0040, // the ability to communicate with the Nomad Moogle (menu access mog house) + MISC_COSTUME = 0x0040, // 0x0080, // the ability to use a costume (costume) + MISC_TREASURE = 0x0100, // 0x0100, // presence in the area of global TreasurePool }; /************************************************************************ @@ -420,17 +420,17 @@ struct zoneMusic_t { - uint8 m_song; // фоновая музыка - uint8 m_bSongS; // музыка в одиночном бою - uint8 m_bSongM; // музыка в групповом бою + uint8 m_song; // background music + uint8 m_bSongS; // Music in single combat + uint8 m_bSongM; // music group fight }; /************************************************************************ * * -* zoneLine - уникальный идентификатор пути из одной точки какой-либо * -* зоны в другую точку какой-либо зоны. Зоной отправления является зона,* -* хранящая данный zoneLineID. Зона прибытия и точное местоназначение * -* определены в структуре. * +* zoneLine - unique identifier of the way from a single point * +* area to another point of any area. Zone is the zone of origin, * +* stores this zoneLineID. Zone and the exact target of the arrival * +* defined in the structure. * * * ************************************************************************/ @@ -480,39 +480,40 @@ void HealAllMobs(); CCharEntity* GetCharByName(int8* name); // finds the player if exists in zone - CBaseEntity* GetEntity(uint16 targid, uint8 filter = -1); // получаем указатель на любую сущность в зоне + CBaseEntity* GetEntity(uint16 targid, uint8 filter = -1); // get a pointer to any entity in the area - bool IsWeatherStatic(); // погода в зоне не требует изменения (никогда не меняется) + bool IsWeatherStatic(); // Weather in the area does not require a change (never change) bool CanUseMisc(uint16 misc); void SetWeather(WEATHER weatherCondition); - void SpawnPCs(CCharEntity* PChar); // отображаем персонажей в зоне - void SpawnMOBs(CCharEntity* PChar); // отображаем MOBs в зоне - void SpawnPETs(CCharEntity* PChar); // отображаем PETs в зоне - void SpawnNPCs(CCharEntity* PChar); // отображаем NPCs в зоне - void SpawnMoogle(CCharEntity* PChar); // отображаем Moogle в MogHouse - void SpawnTransport(CCharEntity* PChar); // отображаем транспорт + void SpawnPCs(CCharEntity* PChar); // display the characters in the zone + void SpawnMOBs(CCharEntity* PChar); // display the MOBs in the zone + void SpawnPETs(CCharEntity* PChar); // display the PETs in the zone + void SpawnNPCs(CCharEntity* PChar); // display the NPCs in the zone + void SpawnMoogle(CCharEntity* PChar); // display the Moogle in MogHouse + void SpawnTransport(CCharEntity* PChar); // display Transport + void SavePlayTime(); - void WideScan(CCharEntity* PChar, uint16 radius); // сканирование местности с заданным радиусом + void WideScan(CCharEntity* PChar, uint16 radius); // scan area with a specified radius - void DecreaseZoneCounter(CCharEntity* PChar); // добавляем персонажа в зону - void IncreaseZoneCounter(CCharEntity* PChar); // удаляем персонажа из зоны + void DecreaseZoneCounter(CCharEntity* PChar); // add character to the area + void IncreaseZoneCounter(CCharEntity* PChar); // remove the character from a zone - void InsertNPC(CBaseEntity* PNpc); // добавляем в зону npc - void InsertMOB(CBaseEntity* PMob); // добавляем в зону mob - void InsertPET(CBaseEntity* PPet); // добавляем в зону pet + void InsertNPC(CBaseEntity* PNpc); // add to the zone npc + void InsertMOB(CBaseEntity* PMob); // add to the zone mob + void InsertPET(CBaseEntity* PPet); // add to the zone pet void DeletePET(CBaseEntity* PPet); // derefs the pet's ID from this zone - void FindPartyForMob(CBaseEntity* PEntity); // ищем группу для монстра - void TransportDepart(CBaseEntity* PTransportNPC); // транспотр отправляется, необходимо собрать пассажиров + void FindPartyForMob(CBaseEntity* PEntity); // group looking for a monster + void TransportDepart(CBaseEntity* PTransportNPC); // transport sent, collect passengers - void InsertRegion(CRegion* Region); // добавляем в зону активную область + void InsertRegion(CRegion* Region); // add to the zone of the active region - void TOTDChange(TIMETYPE TOTD); // обработка реакции мира на смену времени суток - void PushPacket(CBaseEntity*, GLOBAL_MESSAGE_TYPE, CBasicPacket*); // отправляем глобальный пакет в пределах зоны + void TOTDChange(TIMETYPE TOTD); // processing reaction of the world to change the time of day + void PushPacket(CBaseEntity*, GLOBAL_MESSAGE_TYPE, CBasicPacket*); // send the package within the global zone - uint32 m_RegionCheckTime; // время последней проверки регионов - uint8 m_WeatherFrequency[MAX_WEATHER_ID]; // вероятность появления каждого типа погоды + uint32 m_RegionCheckTime; // time of last check Regions + uint8 m_WeatherFrequency[MAX_WEATHER_ID]; // probability of occurrence of each type of weather void ZoneServer(uint32 tick); void ZoneServerRegion(uint32 tick); @@ -523,38 +524,38 @@ private: - ZONEID m_zoneID; // ID зоны - REGIONTYPE m_regionID; // ID области - CONTINENTTYPE m_continentID; // ID континента - string_t m_zoneName; // имя зоны - uint16 m_zonePort; // порт зоны - uint32 m_zoneIP; // IP зоны + ZONEID m_zoneID; // ID area + REGIONTYPE m_regionID; // ID field + CONTINENTTYPE m_continentID; // ID of the continent + string_t m_zoneName; // area name + uint16 m_zonePort; // port area + uint32 m_zoneIP; // IP zone - WEATHER m_Weather; // текущая погода - uint32 m_WeatherChangeTime; // время начала текущей погоды - bool m_IsWeatherStatic; // погода в зоне никогда не меняется + WEATHER m_Weather; // current weather + uint32 m_WeatherChangeTime; // start time of current weather + bool m_IsWeatherStatic; // the weather in the area has never changed - uint16 m_tax; // налог в bazaar - uint16 m_miscMask; // битовое поле, описывающее возможности использования в зоне определенных умений + uint16 m_tax; // tax bazaar + uint16 m_miscMask; // bit field that describes the possibility of using certain skills in the area - zoneMusic_t m_zoneMusic; // информация о мелодиях, используемых в зоне + zoneMusic_t m_zoneMusic; // information about the tunes used in the area - EntityList_t m_mobList; // список всех MOBs в зоне - EntityList_t m_petList; // список всех PETs в зоне - EntityList_t m_npcList; // список всех NPCs в зоне - EntityList_t m_charList; // список всех PCs в зоне + EntityList_t m_mobList; // list of all the MOBs in the zone + EntityList_t m_petList; // list of all the PETs in the zone + EntityList_t m_npcList; // list of all the NPCs in the zone + EntityList_t m_charList; // list of all the PCs in the zone - regionList_t m_regionList; // список активных областей зоны - zoneLineList_t m_zoneLineList; // список всех доступных zonelines для зоны + regionList_t m_regionList; // list of active zone areas + zoneLineList_t m_zoneLineList; // list of all zonelines zone - CBaseEntity* m_Transport; // указатель на транспорт в зоне - CTreasurePool* m_TreasurePool; // глобальный TreasuerPool + CBaseEntity* m_Transport; // pointer to the transport in the area + CTreasurePool* m_TreasurePool; // global TreasurePool - CTaskMgr::CTask* ZoneTimer; // указатель на созданный таймер - ZoneServer. необходим для возможности его остановки + CTaskMgr::CTask* ZoneTimer; // pointer to the created timer - ZoneServer. needs to be able to stop it - void LoadZoneLines(); // список zonelines (можно было бы заменить этот метод методом InsertZoneLine) - void LoadZoneWeather(); // погода - void LoadZoneSettings(); // настройки зоны + void LoadZoneLines(); // list zonelines (could be replaced by this method InsertZoneLine) + void LoadZoneWeather(); // weather + void LoadZoneSettings(); // zone configuration }; #endif \ No newline at end of file Index: src/map/zoneutils.cpp =================================================================== --- src/map/zoneutils.cpp (revision 3304) +++ src/map/zoneutils.cpp (working copy) @@ -37,8 +37,8 @@ #include "mob_spell_list.h" -CZone* g_PZoneList[MAX_ZONEID]; // глобальный массив указателей на игровые зоны -CNpcEntity* g_PTrigger; // триггер для запуска событий +CZone* g_PZoneList[MAX_ZONEID]; // global array of pointers to the play areas +CNpcEntity* g_PTrigger; // trigger to start the event namespace zoneutils @@ -46,7 +46,7 @@ /************************************************************************ * * -* Реакция зон на смену времени суток * +* Reaction zones to replace the time of day * * * ************************************************************************/ @@ -65,7 +65,7 @@ * * ************************************************************************/ -// TOTO: общая погода для нескольких зон +// TOTO: general weather for multiple zones void UpdateWeather() { @@ -94,9 +94,18 @@ ShowDebug(CL_CYAN"UpdateWeather Finished\n" CL_RESET); } +void SavePlayTime() +{ + for(int32 ZoneID = 0; ZoneID < MAX_ZONEID; ZoneID++) + { + g_PZoneList[ZoneID]->SavePlayTime(); + } + ShowDebug(CL_CYAN"Player playtime saving finished\n" CL_RESET); +} + /************************************************************************ * * -* Возвращаем указатель на класс зоны с указанным ID. * +* Return a pointer to the specified zone ID. * * * ************************************************************************/ @@ -117,7 +126,7 @@ /************************************************************************ * * -* Получаем указатель на любую сущность по ID * +* Get a pointer to any entity by ID * * * ************************************************************************/ @@ -128,7 +137,7 @@ /************************************************************************ * * -* Получаем указатель на персонажа по имени * +* Get a pointer to a character named * * * ************************************************************************/ @@ -148,7 +157,7 @@ /************************************************************************ * * -* Получаем указатель на CCharEntity по id и targid * +* Get a pointer to CCharEntity of id and target * * * ************************************************************************/ @@ -171,7 +180,7 @@ /************************************************************************ * * -* Загружаем список NPC в указанную зону * +* Load the list of NPC in the target area * * * ************************************************************************/ @@ -239,7 +248,7 @@ /************************************************************************ * * -* Загружаем список монстров в указанную зону * +* Load the list of monsters in the target area * * * ************************************************************************/ @@ -274,7 +283,7 @@ PMob->id = (uint32)Sql_GetUIntData(SqlHandle,1); PMob->targid = (uint16)PMob->id & 0x0FFF; - PMob->m_SpawnPoint.rotation = (uint8)Sql_GetIntData(SqlHandle,2); + PMob->m_SpawnPoint.rotation = (uint8)Sql_GetIntData(SqlHandle,2); PMob->m_SpawnPoint.x = Sql_GetFloatData(SqlHandle,3); PMob->m_SpawnPoint.y = Sql_GetFloatData(SqlHandle,4); PMob->m_SpawnPoint.z = Sql_GetFloatData(SqlHandle,5); @@ -394,7 +403,7 @@ case SYSTEM_PLANTOID: PMob->addModifier(MOD_BEAST_KILLER, 5); break; case SYSTEM_UNDEAD: PMob->addModifier(MOD_ARCANA_KILLER, 5); break; case SYSTEM_VERMIN: PMob->addModifier(MOD_PLANTOID_KILLER, 5); break; - } + } PZone->InsertMOB(PMob); luautils::OnMobInitialise(PMob); @@ -447,13 +456,13 @@ /************************************************************************ * * -* Инициализация зон. Возрождаем всех монстров при старте сервера. * +* Initialization zones. Rethink all monsters at server startup. * * * ************************************************************************/ void LoadZoneList() { - g_PTrigger = new CNpcEntity(); // нужно в конструкторе CNpcEntity задавать модель по умолчанию + g_PTrigger = new CNpcEntity(); // CNpcEntity set to the default model for(int32 ZoneID = 0; ZoneID < MAX_ZONEID; ZoneID++) { @@ -467,7 +476,7 @@ if (PZone->GetIP() != 0) { - luautils::OnZoneInitialise(PZone->GetID()); + luautils::OnZoneInitialize(PZone->GetID()); } } UpdateWeather(); @@ -475,7 +484,7 @@ /************************************************************************ * * -* Узнаем текущий регион по номеру зоны * +* View the current region is the zone number * * * ************************************************************************/ @@ -786,7 +795,7 @@ /************************************************************************ * * -* Освобождаем список зон * +* Free the list of zones * * * ************************************************************************/ Index: src/map/zoneutils.h =================================================================== --- src/map/zoneutils.h (revision 3304) +++ src/map/zoneutils.h (working copy) @@ -30,7 +30,7 @@ /************************************************************************ * * -* Задумывалось, как что-то вроде контролера зон * +* Conceived as something like the controller area * * * ************************************************************************/ @@ -40,20 +40,21 @@ namespace zoneutils { - void LoadZoneList(); // загружаем список зон - void FreeZoneList(); // освобождаем список зон + void LoadZoneList(); // load the list of zones + void FreeZoneList(); // release the list of zones - void UpdateWeather(); // обновляем погоду в зонах - void TOTDCharnge(TIMETYPE TOTD); // реакция мира на смену времени суток + void UpdateWeather(); // update the weather in areas + void TOTDCharnge(TIMETYPE TOTD); // the reaction of the world to change the time of day + void SavePlayTime(); REGIONTYPE GetCurrentRegion(uint8 ZoneID); CONTINENTTYPE GetCurrentContinent(uint8 ZoneID); - CZone* GetZone(uint16 ZoneID); // получаем указатель на зону - CNpcEntity* GetTrigger(uint16 TargID, uint16 ZoneID); // триггер для старта событий (как побочный эффект - вероятность появления прозрачного орка) - CBaseEntity* GetEntity(uint32 ID, uint8 filter = -1); // получаем указатель на любую сущность - CCharEntity* GetCharByName(int8* name); // получаем указатель на персонажа по имени - CCharEntity* GetCharFromRegion(uint32 charid, uint16 targid, uint8 RegionID); // получаем указатель на персонажа в указанном регионе + CZone* GetZone(uint16 ZoneID); // get a pointer to the zone + CNpcEntity* GetTrigger(uint16 TargID, uint16 ZoneID); // trigger for the start of the event (as a side effect - the probability of a transparent orc) + CBaseEntity* GetEntity(uint32 ID, uint8 filter = -1); // get a pointer to any entity + CCharEntity* GetCharByName(int8* name); // get a pointer to a character named + CCharEntity* GetCharFromRegion(uint32 charid, uint16 targid, uint8 RegionID); // get a pointer to the character in that region }; Index: src/search/data_loader.cpp =================================================================== --- src/search/data_loader.cpp (revision 3304) +++ src/search/data_loader.cpp (working copy) @@ -53,7 +53,7 @@ /************************************************************************ * * -* История продаж предмета * +* Sales history subject * * * ************************************************************************/ @@ -90,7 +90,7 @@ /************************************************************************ * * -* Список продаваемых предметов в указанной категории * +* List of sold items in this category * * The list of items sold in this category * ************************************************************************/ @@ -135,7 +135,7 @@ /************************************************************************ * * -* Количество активных игроков в мире * +* The number of active players in the world * * * ************************************************************************/ @@ -166,7 +166,7 @@ /************************************************************************ * * -* Список найденных персонажей в игровом мире * +* List of characters found in the game world * * Job ID is 0 for none specified. * ************************************************************************/ @@ -290,7 +290,7 @@ /************************************************************************ * * -* Список персонажей, состоящих в одной группе * +* List of characters who are in the same group * * * ************************************************************************/ @@ -352,7 +352,7 @@ /************************************************************************ * * -* Список персонажей, состоящих в одной linkshell * +* List of characters from more than one linkshell * * * ************************************************************************/ Index: src/search/packets/linkshell_list.cpp =================================================================== --- src/search/packets/linkshell_list.cpp (revision 3304) +++ src/search/packets/linkshell_list.cpp (working copy) @@ -50,7 +50,7 @@ WBUFB(m_data,(0x0A)) = 0x80; WBUFB(m_data,(0x0B)) = 0x82; // packet type - // WBUFB(m_data,(0x0E)) = 0x00; // количество персонажей в пакете + // WBUFB(m_data,(0x0E)) = 0x00; // the number of characters in a packet WBUFB(m_data,(0x0E)) = Total; } @@ -126,10 +126,10 @@ m_offset = packBitsLE(m_data, SEARCH_LANGUAGE, m_offset, 5); m_offset = packBitsLE(m_data, PPlayer->languages, m_offset,16); - if (m_offset%8 > 0) m_offset += 8 - m_offset%8; // побайтное выравнивание данных + if (m_offset%8 > 0) m_offset += 8 - m_offset%8; // byte to byte data alignment - WBUFB(m_data, size_offset) = m_offset/8 - size_offset - 1; // размер данных сущности - WBUFW(m_data,(0x08)) = m_offset / 8; // размер отправляемых данных + WBUFB(m_data, size_offset) = m_offset/8 - size_offset - 1; // the size of the entity data + WBUFW(m_data,(0x08)) = m_offset / 8; // the size of the data being sent delete PPlayer; } Index: src/search/search.cpp =================================================================== --- src/search/search.cpp (revision 3304) +++ src/search/search.cpp (working copy) @@ -79,7 +79,7 @@ /************************************************************************ * * -* Отображения содержимого входящего пакета в консоли * +* Display the contents of the incoming packet to the console * * * ************************************************************************/ @@ -361,7 +361,7 @@ /************************************************************************ * * -* Запрос списка персонажей (party/linkshell) * +* Request a list of characters (party/linkshell) * * * ************************************************************************/ @@ -478,14 +478,14 @@ uint8* data = (uint8*)PTCPRequest->GetData(); uint8 AHCatID = RBUFB(data,(0x16)); - //2 - уровень -- level - //3 - раса -- race - //4 - профессия -- job - //5 - урон -- damage - //6 - задержка -- delay - //7 - защита -- defense - //8 - сопротивление -- resistance - //9 - название -- name + //2 - level + //3 - race + //4 - job + //5 - damage + //6 - delay + //7 - defense + //8 - resistance + //9 - name string_t OrderByString = "ORDER BY"; uint8 paramCount = RBUFB(data,0x12); for (uint8 i = 0; i < paramCount; ++i) // параметры сортировки предметов @@ -501,8 +501,8 @@ OrderByString.append(" item_weapon.delay DESC,"); case 9: OrderByString.append(" item_basic.sortname,"); - } } + } OrderByString.append(" item_basic.itemid"); int8* OrderByArray = (int8*)OrderByString.data(); @@ -565,8 +565,8 @@ search_req _HandleSearchRequest(CTCPRequestPacket* PTCPRequest, SOCKET socket) { - // суть в том, чтобы заполнить некоторую структуру, на основании которой будет создан запрос к базе - // результат поиска в базе отправляется клиенту + // The point is to fill a structure, based on which will create a query to the database + // Result of the search in the database is sent to the client uint32 bitOffset = 0; @@ -800,5 +800,5 @@ } return sr; - // не обрабатываем последние биты, что мешает в одну кучу например "/blacklist delete Name" и "/sea all Name" + // do not handle the last bits that interfere in one pile for example "/ blacklist delete Name" and "/ sea all Name" } \ No newline at end of file Index: win32/DSGame-server/DSGame-server.vcxproj =================================================================== --- win32/DSGame-server/DSGame-server.vcxproj (revision 3304) +++ win32/DSGame-server/DSGame-server.vcxproj (working copy) @@ -1,4 +1,4 @@ - + @@ -262,7 +262,7 @@ - + @@ -452,7 +452,7 @@ - + Index: win32/DSGame-server/DSGame-server.vcxproj.filters =================================================================== --- win32/DSGame-server/DSGame-server.vcxproj.filters (revision 3304) +++ win32/DSGame-server/DSGame-server.vcxproj.filters (working copy) @@ -1,4 +1,4 @@ - + @@ -542,7 +542,7 @@ Header Files\lua - + Header Files\packets @@ -1105,7 +1105,7 @@ Source Files\lua - + Source Files\packets