Index: scripts/globals/magic.lua =================================================================== --- scripts/globals/magic.lua (revision 4193) +++ scripts/globals/magic.lua (working copy) @@ -107,17 +107,17 @@ duration = duration * 3; end --calculate potency - local magicskill = target:getSkillLevel(ENHANCING_MAGIC_SKILL) + target:getMod(79 + ENHANCING_MAGIC_SKILL); + local magicskill = target:getSkillLevel(ENHANCING_MAGIC_SKILL); - local potency = 3 + ((6*magicskill)/100); + local potency = 3 + math.floor((6*magicskill)/100); if(magicskill>200) then - potency = 5 + ((5*magicskill)/100); + potency = 5 + math.floor((5*magicskill)/100); end - -- enhancing sword - if(target:getEquipID(SLOT_MAIN) == 16605 or target:getEquipID(SLOT_SUB) == 16605) then - potency = potency + 5; - end + -- enhancing sword MOVED to battleutils +-- if(target:getEquipID(SLOT_MAIN) == 16605 or target:getEquipID(SLOT_SUB) == 16605) then +-- potency = potency + 5; +-- end if(target:addStatusEffect(effect,potency,0,duration)) then spell:setMsg(230); Index: sql/item_latents.sql =================================================================== --- sql/item_latents.sql (revision 4193) +++ sql/item_latents.sql (working copy) @@ -14,14 +14,14 @@ `modId` smallint(5) unsigned NOT NULL, `value` smallint(5) NOT NULL DEFAULT '0', `latentId` smallint(5) NOT NULL, - `latentParam` smallint(5) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AVG_ROW_LENGTH=13 PACK_KEYS=1; - - - - --- INSERT INTO `item_latents` VALUES(itemID, modId, modValue, latentId, latentParam); + `latentParam` smallint(5) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AVG_ROW_LENGTH=13 PACK_KEYS=1; + + + +-- INSERT INTO `item_latents` VALUES(itemID, modId, modValue, latentId, latentParam); + INSERT INTO `item_latents` VALUES(13870, 14, 14, 49, 4468); INSERT INTO `item_latents` VALUES(13870, 12, 1, 49, 4468); INSERT INTO `item_latents` VALUES(13870, 11, -3, 49, 4468); -- Opo-opo Crown, AGI+1 to AGI-2 @@ -35,21 +35,21 @@ INSERT INTO `item_latents` VALUES(13870, 5, 50, 49, 4596); INSERT INTO `item_latents` VALUES(13870, 2, 50, 49, 4596); INSERT INTO `item_latents` VALUES(17073, 406, 3, 7, 2); -- Mistilteinn drains 3TP if TP >= 3 -INSERT INTO `item_latents` VALUES(17073, 369, 1, 7, 2); -- Mistilteinn adds Refresh 1MP per tick -INSERT INTO `item_latents` VALUES(13145, 28, 8, 4, 51); -INSERT INTO `item_latents` VALUES(13289, 28, 10, 2, 76); -INSERT INTO `item_latents` VALUES(14008, 23, 8, 0, 75); -INSERT INTO `item_latents` VALUES(14008, 1, 16, 0, 75); -INSERT INTO `item_latents` VALUES(14009, 23, 9, 0, 75); -INSERT INTO `item_latents` VALUES(14009, 1, 17, 0, 75); -INSERT INTO `item_latents` VALUES(14055, 23, 7, 46, 75); -INSERT INTO `item_latents` VALUES(14448, 10, 6, 46, 71); -INSERT INTO `item_latents` VALUES(15209, 8, 3, 46, 75); -INSERT INTO `item_latents` VALUES(15345, 384, 3, 46, 75); -INSERT INTO `item_latents` VALUES(15406, 31, 4, 46, 75); -INSERT INTO `item_latents` VALUES(15530, 368, 10, 10, 50); -INSERT INTO `item_latents` VALUES(16355, 25, 25, 0, 25); -INSERT INTO `item_latents` VALUES(16355, 23, 25, 0, 25); +INSERT INTO `item_latents` VALUES(17073, 369, 1, 7, 2); -- Mistilteinn adds Refresh 1MP per tick +INSERT INTO `item_latents` VALUES(13145, 28, 8, 4, 51); +INSERT INTO `item_latents` VALUES(13289, 28, 10, 2, 76); +INSERT INTO `item_latents` VALUES(14008, 23, 8, 0, 75); +INSERT INTO `item_latents` VALUES(14008, 1, 16, 0, 75); +INSERT INTO `item_latents` VALUES(14009, 23, 9, 0, 75); +INSERT INTO `item_latents` VALUES(14009, 1, 17, 0, 75); +INSERT INTO `item_latents` VALUES(14055, 23, 7, 46, 75); +INSERT INTO `item_latents` VALUES(14448, 10, 6, 46, 71); +INSERT INTO `item_latents` VALUES(15209, 8, 3, 46, 75); +INSERT INTO `item_latents` VALUES(15345, 384, 3, 46, 75); +INSERT INTO `item_latents` VALUES(15406, 31, 4, 46, 75); +INSERT INTO `item_latents` VALUES(15530, 368, 10, 10, 50); +INSERT INTO `item_latents` VALUES(16355, 25, 25, 0, 25); +INSERT INTO `item_latents` VALUES(16355, 23, 25, 0, 25); INSERT INTO `item_latents` VALUES(16426, 25, 2, 0, 92); INSERT INTO `item_latents` VALUES(16426, 25, 2, 0, 82); INSERT INTO `item_latents` VALUES(16426, 25, 2, 0, 73); @@ -560,4 +560,29 @@ INSERT INTO `item_latents` VALUES(18346, 59, 9, 48, 0); INSERT INTO `item_latents` VALUES(15067, 1, 21, 48, 0); INSERT INTO `item_latents` VALUES(15068, 1, 6, 48, 0); -INSERT INTO `item_latents` VALUES(15069, 385, 200, 48, 0); \ No newline at end of file +INSERT INTO `item_latents` VALUES(15069, 385, 200, 48, 0); +-- Enhancing Sword +INSERT INTO `item_latents` VALUES(16605, 23, 16, 13, 94); +INSERT INTO `item_latents` VALUES(16605, 23, 16, 13, 95); +INSERT INTO `item_latents` VALUES(16605, 23, 16, 13, 96); +INSERT INTO `item_latents` VALUES(16605, 23, 16, 13, 97); +INSERT INTO `item_latents` VALUES(16605, 23, 16, 13, 98); +INSERT INTO `item_latents` VALUES(16605, 23, 16, 13, 99); +INSERT INTO `item_latents` VALUES(16605, 23, 16, 13, 277); +INSERT INTO `item_latents` VALUES(16605, 23, 16, 13, 278); +INSERT INTO `item_latents` VALUES(16605, 23, 16, 13, 279); +INSERT INTO `item_latents` VALUES(16605, 23, 16, 13, 280); +INSERT INTO `item_latents` VALUES(16605, 23, 16, 13, 281); +INSERT INTO `item_latents` VALUES(16605, 23, 16, 13, 282); +INSERT INTO `item_latents` VALUES(16605, 25, 8, 13, 94); +INSERT INTO `item_latents` VALUES(16605, 25, 8, 13, 95); +INSERT INTO `item_latents` VALUES(16605, 25, 8, 13, 96); +INSERT INTO `item_latents` VALUES(16605, 25, 8, 13, 97); +INSERT INTO `item_latents` VALUES(16605, 25, 8, 13, 98); +INSERT INTO `item_latents` VALUES(16605, 25, 8, 13, 99); +INSERT INTO `item_latents` VALUES(16605, 25, 8, 13, 277); +INSERT INTO `item_latents` VALUES(16605, 25, 8, 13, 278); +INSERT INTO `item_latents` VALUES(16605, 25, 8, 13, 279); +INSERT INTO `item_latents` VALUES(16605, 25, 8, 13, 280); +INSERT INTO `item_latents` VALUES(16605, 25, 8, 13, 281); +INSERT INTO `item_latents` VALUES(16605, 25, 8, 13, 282); \ No newline at end of file Index: src/map/utils/battleutils.cpp =================================================================== --- src/map/utils/battleutils.cpp (revision 4193) +++ src/map/utils/battleutils.cpp (working copy) @@ -399,7 +399,7 @@ { //Tier 2 enspells calculate the damage on each hit and increment the potency in MOD_ENSPELL_DMG per hit - uint16 skill = PAttacker->GetSkill(SKILL_ENH) + PAttacker->getMod(MOD_ENHANCE); + uint16 skill = PAttacker->GetSkill(SKILL_ENH); uint16 cap = 3 + ((6*skill)/100); if(skill>200){ cap = 5 + ((5*skill)/100); @@ -421,6 +421,91 @@ damage = PAttacker->getMod(MOD_ENSPELL_DMG)-1; } } + + //enhancing sword adds 5 dmg to all enspells + if(PAttacker->objtype == TYPE_PC){ + CCharEntity* PCharAtk = (CCharEntity*)PAttacker; + CItem* PMain = PCharAtk->getStorage(LOC_INVENTORY)->GetItem(PCharAtk->equip[SLOT_MAIN]); + if(PMain){ + if(PMain->getID() == 16605){ + damage += 5; + } + else{ + CItem* PSub = PCharAtk->getStorage(LOC_INVENTORY)->GetItem(PCharAtk->equip[SLOT_SUB]); + if(PSub){ + if(PSub->getID() == 16605){ + damage += 5; + } + } + } + } + } + + //matching day 10% bonus, matching weather 10% or 25% for double weather + float dBonus = 1.0; + if(CVanaTime::getInstance()->getWeekday() == element) + dBonus += 0.1; + WEATHER weather = GetWeather(PAttacker, false); + switch(element){ + + case FIRE: + if(weather == WEATHER_HOT_SPELL) + dBonus += 0.1; + else if(weather == WEATHER_HEAT_WAVE) + dBonus += 0.25; + break; + + case EARTH: + if(weather == WEATHER_DUST_STORM) + dBonus += 0.1; + else if(weather == WEATHER_SAND_STORM) + dBonus += 0.25; + break; + + case WATER: + if(weather == WEATHER_RAIN) + dBonus += 0.1; + else if(weather == WEATHER_SQUALL) + dBonus += 0.25; + break; + + case WIND: + if(weather == WEATHER_WIND) + dBonus += 0.1; + else if(weather == WEATHER_GALES) + dBonus += 0.25; + break; + + case ICE: + if(weather == WEATHER_SNOW) + dBonus += 0.1; + else if(weather == WEATHER_BLIZZARDS) + dBonus += 0.25; + break; + + case THUNDER: + if(weather == WEATHER_THUNDER) + dBonus += 0.1; + else if(weather == WEATHER_THUNDERSTORMS) + dBonus += 0.25; + break; + + case LIGHT: + if(weather == WEATHER_AURORAS) + dBonus += 0.1; + else if(weather == WEATHER_STELLAR_GLARE) + dBonus += 0.25; + break; + + case DARK: + if(weather == WEATHER_GLOOM) + dBonus += 0.1; + else if(weather == WEATHER_DARKNESS) + dBonus += 0.25; + break; + + } + damage = (damage * (float)dBonus); return HandleStoneskin(PDefender, damage); }