Closed jkorsak closed 9 years ago
Not usable is thrown when the item is out of charges. Did you create an item, get one, and then add charges to the item? Anyone holding the old item would have zero charges on it. If you sell the item and buy it back it should have charges reset.
I originally acquired it by setting the price to 1 and buying it in the store so it should have 5 charges. I tried selling and rebuying just in case and I still get the same error in combat and I can use it outside of combat (effectively killing my entire party) so I know the one in my inventory has charges. I'm working on getting the source code but I don't have all of the dependencies installed (yet) so I can't test the code. I think this is the line causing the error while in combat:
combat.c line 1494: if ((!b.getPc()->item[b.getPc()->combat.object].charges == 0) || (spellCast == BTITEMCAST_NONE))
Fix checked in. Thanks for finding the bug. Surprised it happened to work consistently under linux. Code should be:
if ((b.getPc()->item[select->select].charges == 0) || (spellCast == BTITEMCAST_NONE))
I wasn't sure if you wanted issues here, sent to the mailing list or sent directly by email. So far it looks and works great! I have been playing around with the sample2 module and I've added a handful of items, spells (definitions at least for all of the BT1 and 2 spells) and monsters. I have a new subarea on the builder map that adds a second shop, a thug hideout with forced encounters, secret doors, traps, chests and global flags. All working pretty much as expected.
I was trying to recreate the fire horn from BT1 but it is not useable in combat. I can create an instrument that is useable outside of combat. It throws a "not useable error" in combat. Here is the definition of the fire horn that is not working:
<item><name>Fire Horn</name><timesUsable>5</timesUsable><damage><n>10</n><d>6</d><m>0</m></damage><armorPlus>0</armorPlus><hitPlus>0</hitPlus><xSpecial>Nothing special</xSpecial><chanceXSpecial>100</chanceXSpecial><type>instrument</type><spellCast>116</spellCast><allowedJob>Bard</allowedJob><price>1</price><cause>sounds</cause><effect>burns</effect><consume>true</consume></item>
The spell definition is:
<spell><name>Fire Horn</name><code>FRHN</code><caster>Conjurer spell</caster><level>8</level><sp>1</sp><range>8</range><effectiveRange>8</effectiveRange><area>Group Target</area><duration>One Turn</duration><effect>Incinerates</effect><attackManifest><type>Damage</type><range>8</range><effectiveRange>8</effectiveRange><damage><n>10</n><d>6</d><m>10</m></damage><xSpecial>Nothing special</xSpecial><level>0</level><maximum>0</maximum><tagOnly></tagOnly></attackManifest></spell>
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited.
Awesome work so far!
John