Re: attack power
Posted: Sat Jun 28, 2014 11:08 am
well works fine! thanksIsaac wrote:You're right (afaik), but it is possible to make a copy of a weapon with a different attackpower bonus; not one that you would ever place in the dungeon, but instead, you would equip it via script, and ensure that only those fighters with sufficient skill for the bonus ever get to use it.Grimfan wrote:Unfortunately, a bonus to the character's attackPower is not something that can be added to the game through normal means (attackPower is only used for the weapons themselves). You cannot even create an item that directly adds to a character's attackPower since this is a statistic that cannot be directly modified (it's not like energy or protection in that way).
I wondered that myself; I think it likely is hard coded. The check would be to rename a pair of pants "loincloth", but I haven't tried.I believe items like the loincloth have been hardcoded to provide their attackPower bonus. There are several hardcoded features like this in LoG1 that will be rectified or addressed in LoG2 (hopefully making it easier to get around these problems).
@ Bongobeat:
Try this:
DAT File: https://www.dropbox.com/s/hj8hojxvuh8r1 ... gobeat.datSpoilerShowParty Hook: (in Objects.lua)Item Definitions:Code: Select all
defineObject{ name = "party", class = "Party", editorIcon = 32, onDrawSkills = function(gui_context) if gui_context.mouseDown(0) then superAxeSkill.check() end end, }Script object on map: Name the script "superAxeSkill" (no quotes)Code: Select all
defineObject{ name = "super_axe", class = "Item", uiName = "Axe of Might", model = "assets/models/items/ancient_axe.fbx", description = "It's a super axe!", skill = "axes", gfxIndex = 158, attackPower = 36, accuracy = 0, coolDownTime = 6.3, attackMethod = "meleeAttack", attackSwipe = "horizontal", attackSound = "swipe_heavy", impactSound = "impact_blade", weight = 7.3, gameEffect = "Additional +30 to Attack Power for Figters proficient with Axe level 40.", onEquipItem = function(champion, slot) superAxeSkill.bonus(champion, slot) end } cloneObject{ name = "super_axe_with_bonus", baseObject = "super_axe", uiName = "Axe of Might (+30!)", attackPower = 66, onEquipItem = function(champion, slot)end, onUnequipItem = function(champion, slot) setMouseItem() setMouseItem(spawn("super_axe")) end, }Code: Select all
-- This script applies the bonus as soon as the weapon skill is sufficient. alreadyQualified = {false,false,false,false} function check() for x = 1,4 do if not alreadyQualified[x] then local champion = party:getChampion(x) print(champion:getName()) local weapon = champion:getItem(7) print(weapon) local weapon2 = champion:getItem(8) print(weapon) if weapon ~= nil and weapon.name == "super_axe" then bonus(champion, 7) elseif weapon2 ~= nil and weapon2.name == "super_axe" then bonus(champion, 8) end end end end function bonus(champion, slot) if champion:getSkillLevel("axes") > 39 then alreadyQualified[1] = true champion:removeItem(slot) champion:insertItem(slot, spawn("super_axe_with_bonus")) end end
But I ve got this printing on the screen:

could it be avoided?