Page 1 of 1

Need help cloning Lightning Blade

Posted: Sun Oct 26, 2014 11:39 pm
by sps999
I am trying to make a custom sword that is similar to the Lightning Blade, but has no level requirement, a different attack power, and a different charge attack.

I am using the following code in my items.lua script:

Code: Select all

defineObject{
   name = "hero_blade",
   baseObject = "lightning_blade",
   components = {
      {
         class = "Item",
         uiName = "Hero's Blade",
         gfxIndex = 85,
         description = "The power to expel evil lies within this sword. Its great strength is only granted to true heroes.",
	 weight = 3.2,
	 attackPower = 32,
      }
   },
}

However, when I start the game it says "warning! invalid component property item.attackPower" in the HUD.
I imagine this is because the name for what controls the attack power is not "attackPower", but I have tried various different names and none have worked. If anyone knows the name for changing the attack power it would be much appreciated. Same thing applies for the level requirement, as I would like to lower the requirement from Light Weapons 1 to none.

In addition to the previous problem, there appears to be no charge attack for the cloned sword. I imagine there is some sort of component I have to set to put a charge attack on the weapon, and this component was lost when defining the new object. If anyone knows how to add charge attacks that would be useful. I imagine there are a set of values you would need to set, like the spell it uses, mana cost, number of charges, and the level requirement, but I have no idea what these values would be.

tl;dr I would like to know what values need to be set on an item to change attack power, level requirements, and charge attacks. A full list of values that could be set would also be useful as a reference if one exists.

Re: Need help cloning Lightning Blade

Posted: Mon Oct 27, 2014 3:58 am
by Jgwman
We don't really know until we have the scripting ref but I would say try adding a "weapon" or "melee_weapon" component in which you specify the attack power. Dunno about the charge attack.

Re: Need help cloning Lightning Blade

Posted: Tue Oct 28, 2014 3:38 am
by sps999
Well, thanks to the work of viewtopic.php?f=22&t=7882 I have been able to bring back the Lightning Bolt ability on the sword with 'secondaryAction = "lightningBolt",'

So far the only way I have been able to edit the values for the attack damage and charge attack was by using Lua Scripts to make the changes in a function. This should be good to hold me over until the reference is realeased.

Re: Need help cloning Lightning Blade

Posted: Tue Jan 20, 2015 10:31 am
by Drakkan
bernard02 wrote:
sps999 wrote:Well, thanks to the work of viewtopic.php?f=22&t=7882 I have been able to bring back the Lightning Bolt ability on the sword with 'secondaryAction = "lightningBolt",'

So far the only way I have been able to edit the values for the attack damage and charge attack was by using Lua Scripts to make the changes in a function. This should be good to hold me over until the reference is realeased.
That would be exciting. I can't wait for it.
it was already released. here original script for lighting blade, feel free to edit as you wish

Code: Select all

defineObject{
	name = "lightning_blade",
	baseObject = "base_item",
	components = {
		{
			class = "Model",
			model = "assets/models/items/long_sword.fbx",
		},
		{
			class = "Item",
			uiName = "Lightning Blade",
			description = "A rolling thunder can be heard every time the blade of this sword moves through the air.",
			gfxIndex = 210,
			gfxIndexPowerAttack = 431,
			impactSound = "impact_blade",
			weight = 3.2,
			secondaryAction = "lightningBolt",
			traits = { "light_weapon", "sword" },
		},
		{
			class = "MeleeAttack",
			attackPower = 16,
			accuracy = 0,
			damageType = "shock",
			cooldown = 3.7,
			swipe = "vertical",
			attackSound = "swipe",
			requirements = { "light_weapons", 1 },
		},
		{
			class = "CastSpell",
			uiName = "Lightning Bolt",
			name = "lightningBolt",
			cooldown = 5,
			spell = "lightning_bolt",
			energyCost = 25,
			power = 4,
			charges = 9,
			fullGfxIndex = 210,
			emptyGfxIndex = 308,
			requirements = { "concentration", 1 },
		},
	},
	tags = { "weapon" },
}