but I ve done something wrong with the skills. I wanted that at 3rd level and at 5th level there is a bonus in accuracy of 25 only with a special weapon. Now when the champion equip the weapon, even if he don't have the skill, he got the accuracy bonus (50)
what is wrong?
the skill:
SpoilerShow
Code: Select all
defineSkill{
name = "modernweapon",
uiName = "Ancient Weapons",
priority = 170,
icon = 90,
description = "Allow the use of ancient weapons that are based or were found in ancient civilisation sites.",
traits = { [3] = "mweapon_expert", [5] = "mweapon_mastery" },
}
SpoilerShow
defineTrait{
name = "mweapon_expert",
uiName = "Ancient Weapons Expert",
icon = 43,
description = "You are expert in ancient weapons and can now shoot with an additional 25% accuracy with any ancient weapons.",
onComputeAccuracy = function(champion, weapon, attack, attackType, level)
if weapon and weapon:hasTrait("modern") then return 25 end
end,
}
name = "mweapon_expert",
uiName = "Ancient Weapons Expert",
icon = 43,
description = "You are expert in ancient weapons and can now shoot with an additional 25% accuracy with any ancient weapons.",
onComputeAccuracy = function(champion, weapon, attack, attackType, level)
if weapon and weapon:hasTrait("modern") then return 25 end
end,
}
SpoilerShow
defineTrait{
name = "mweapon_mastery",
uiName = "Ancient Weapons Master",
icon = 43,
description = "You are master in ancient weapons and can now shoot with an additional 50% accuracy with any ancient weapons.",
onComputeAccuracy = function(champion, weapon, attack, attackType, level)
if weapon and weapon:hasTrait("modern") then return 50 end
end,
}
name = "mweapon_mastery",
uiName = "Ancient Weapons Master",
icon = 43,
description = "You are master in ancient weapons and can now shoot with an additional 50% accuracy with any ancient weapons.",
onComputeAccuracy = function(champion, weapon, attack, attackType, level)
if weapon and weapon:hasTrait("modern") then return 50 end
end,
}
SpoilerShow
Code: Select all
defineObject{
name = "grenade_launcher",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/repeater.fbx",
},
{
class = "Item",
uiName = "Drakonic Shooter",
description = "A powerful Dwarvish weapon based on ancient technology. Also known as the \"Dragon Mooth\" for its ability to throw fast explosive projectiles.",
gfxIndex = 337,
gfxIndexPowerAttack = 97,
impactSound = "impact_blunt",
weight = 4.4,
secondaryAction = "grenade",
traits = { "modern" },
},
{
class = "FirearmAttack",
attackPower = 150,
cooldown = 6,
attackSound = "gun_shot_small",
ammo = "pellet",
requirements = { "modernweapon", 2 },
range = 20,
repeatCount = 4,
repeatDelay = 0.12,
jamChance = 0,
backfireChance = 0,
},
{
name = "grenade",
uiName = "Explosive Projectile",
class = "FirearmAttack",
range = 30,
attackPower = 450,
cooldown = 6,
attackSound = "gun_shot_cannon",
ammo = "grenade",
requirements = { "modernweapon", 3 },
jamChance = 0,
backfireChance = 0,
gameEffect = "Fires A Rapid Explosive Projectile.",
onAttack = function(self)
party.party:shakeCamera(0.7, 0.3)
local dust = party:spawn("particle_system")
dust.particle:setParticleSystem("wall_fire_impact")
dust:setWorldPositionY(dust:getWorldPositionY() + 1.3)
end,
},
},
}