attack power
Posted: Fri Jun 27, 2014 6:32 pm
Hello,
does anyone knows if it is possible that script a weapon which give +20 to attack power?
does anyone knows if it is possible that script a weapon which give +20 to attack power?
Code: Select all
defineObject{
name = "machete",
class = "Item",
uiName = "Machete of Might",
model = "assets/models/items/machete.fbx",
skill = "swords",
gfxIndex = 23,
attackPower = 29,
accuracy = 0,
coolDownTime = 3.2,
attackMethod = "meleeAttack",
attackSwipe = "horizontal",
attackSound = "swipe",
impactSound = "impact_blade",
weight = 2.2,
gameEffect = "Enchanted +20 Attack power"
}
No problem I know, thanksDoridion wrote:bongobeat, as Isaac shown you, you must add a "clone" the object on the "mod_assets\scripts\object.lua" file in your mod folder, not by the editor
Sorry my request is not clear !Isaac wrote:Do you mean differently than this?Code: Select all
defineObject{ name = "machete", class = "Item", uiName = "Machete of Might", model = "assets/models/items/machete.fbx", skill = "swords", gfxIndex = 23, attackPower = 29, accuracy = 0, coolDownTime = 3.2, attackMethod = "meleeAttack", attackSwipe = "horizontal", attackSound = "swipe", impactSound = "impact_blade", weight = 2.2, gameEffect = "Enchanted +20 Attack power" }
Code: Select all
gameEffect = "Attack Power +1",Code: Select all
defineObject{
name = "super_axe",
class = "Item",
uiName = "Axe of Might",
model = "assets/models/items/axe.fbx",
skill = "axe",
gfxIndex = 23,
attackPower = 29,
accuracy = 0,
coolDownTime = 3.2,
attackMethod = "meleeAttack",
attackSwipe = "horizontal",
attackSound = "swipe",
impactSound = "impact_blade",
weight = 2.2,
gameEffect = "Additional +30 to Attack Power for Figters proficient with Axe level 40.",
onEquipItem = function(champion, slot)
if champion:getClass() == "Fighter" and champion:getSkillLevel("axe") >39 then
if ( slot == 7 ) or ( slot == 8 ) then
...
}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).
Code: Select all
defineObject{
name = "party",
class = "Party",
editorIcon = 32,
onDrawSkills = function(gui_context)
if gui_context.mouseDown(0) then
superAxeSkill.check()
end
end,
}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)
local weapon = champion:getItem(7)
local weapon2 = champion:getItem(8)
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[champion:getOrdinal()] = true
champion:removeItem(slot)
champion:insertItem(slot, spawn("super_axe_with_bonus"))
end
end
There is a third file: a party hook for Object.lua, I forgot to include it first time around; I noticed when I was making the Dat.Grimfan wrote:And this is why I mentioned Isaac.![]()
I thought Isaac might be able to come up with a nifty weapon script on the fly, however if you have the axe equipped when you level up it won't register the addition to attack power until you take the axe off and reequip it. Also be aware that this script doesn't affect the character's overall attackPower, so it won't add to the attack rating of the weapon in the character's other hand.