• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Swords decreasing in quality

Pieter Boelen

Navigation Officer
Administrator
Storm Modder
Hearts of Oak Donator
With the blacksmith mod, you can increase a blade's quality. Now I was thinking, would it be fun if a blade's quality would decrease over time as well? Or, more accurately: Decrease in quality due to extensive use. So that you will need to sharpen your blade every now and then. I think I may have a general idea of how it could work:
Every time you use your blade against an opponent, a number is increased by one. If the number has increased to 100 (=you used your blade 100 times), the blade will be decreased in quality. This would basically be the blacksmith mod in reverse.
If I'll make this mod, I would at least add a toggle on it, for people that don't like it. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/whistling.gif" style="vertical-align:middle" emoid=":wp" border="0" alt="whistling.gif" />

Maybe this might also be a nice "replacement" for the badly-working disarming mod? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />

Please tell me whether you would like such a mod or not. And also if you might have any ideas for it.
 
Great idea, Pieter. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" /> I was recently thinking the same thing. RPG's such as Morrowind have this feature. It'd be great to give our blacksmiths a bit more work.

As a further thought would it be possible to implement sword breakage as an incentive to keep your weapons well maintained.
E.g. Say weapons with average or below quality have a very small but increasing chance of breakage in combat as quality decreases. The resulting "broken sword" would then have minimal melee qualities, minimal resale value and further increased repair costs (which would take a fair amount of time too). Could do a similar thing with pistols as well, with an increased chance of miss fires due to poor quality.

Just a thought.

Cheers matey <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
That's my idea, yes. Unfortunately, I won't be able to store the number of times a sword is used for each sword seperately. So I think my mod would just "assume" you keep using the same blade. Which is not really accurate; but would be the easiest to acchieve. Or I could make it so that you can "reset" the mod every time you equip a new blade, but then you could use it to "cheat".
I think, if you keep using a badly worn blade, eventually it should break and you'd end up with no blade at all in your hands. So that would be a good reason to fix your badly worn blade. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
 
I downloaded BUILD MOD 12, and i really hate it <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/diomed.gif" style="vertical-align:middle" emoid=":dio" border="0" alt="diomed.gif" />
So now i'll have to restart my game, and continue the hard work!
I dont like mods, but for thoose who like em' i think it would be a Greeat idea matey! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/razz.gif" style="vertical-align:middle" emoid=":razz" border="0" alt="razz.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
 
I am going to work on this mod tomorrow. I have had the idea for many months and now I am finally wanting to code it. I am fed up with compiling at the moment and I would like to mod something of my own for a change. So far, I have hardly contributed anything to the mods in the modpack, because I have been busy only with compiling and not with modding. With a bit of luck, this mod can replace the previous disarming mod that I made and that didn't work all too great.

Please post your comments and suggestions about this mod here.

General idea for this mod:
If you use a blade a lot, the blade can break. For each stroke with your blade, the breaking chance will increase. Good quality blades have got a low chance of breaking while badly worn blades could break at any moment. If a good quality breaks, it will become an avage blade. However, if a badly worn blade breaks, you will be left with no blade at all in your hands, which is rather dangerous. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
So if you keep using the same good blade, eventually it will decrease in quality and break. So that is a good reason to visit a blacksmith every now and then.

Something I recently though of to implement in this mod as well: It is possible to find very good blades at the beginning of the game, which is not really making the game any harder. So what if good blades break quickly if you have a low level because you don't know how to use such a good blade yet? That would balance the game some better, wouldn't it? Also: Blacksmiths are paid out of personal wealth, but if you just start the game, you hardly have any personal wealth, so your blade will keep breaking and you'll need to buy new ones. And you can't afford to pay a blacksmith either, especially if you're using a Solingen Rapier early in the game. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

All this should also apply to all other characters in the game.

I hope you have some comments on my ideas and I hope that you will enjoy this mod once it's done. Of course, there <i>will</i> be a toggle on it for those who don't like it. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" />
 
I have begun coding this mod, but after the first part of making the code, I am already running into a problem! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />
So far, this is all I have coded in LAi_events.c:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->        // PB: Blade Damage mod
        if(!CheckAttribute(attack,"bladedamage.counter")) {attack.bladedamage.counter = 0;}
        attack.bladedamage.counter = attack.bladedamage.counter + 1;
        Log_SetStringToLog("Bladedamage counter is " + attack.bladedamage.counter + " for character " + attack.name + " " + attack.lastname);<!--c2--></div><!--ec2-->What this code is supposed to do:
If a character doesn't yet have the bladedamage.counter attribute, add the attribute and set it to 0. Then every time this code is executed, bladedamage.counter should be increased with 1. The last line will display the results of the code on the screen. The code does exactly what it should, but it uses attack.bladedamage.counter as string instead of as int. Result: Instead of bladedamage.counter being increased by one like 0,1,2,3,4 it is now being done as 0,01,011,0111,01111. So how am I supposed to get the code counting? If I can't get it counting, the rest of the mod is never going to work either! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" />
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> PLEASE HELP! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />
 
I have a counter that counts.

a new attribute called itm.use is defined in init_items

Code in LAi_events
under
void LAi_CharacterFireExecute(aref attack, aref enemy, float kDist, int isFindedEnemy)




use2 = weapon.use;
use2++;
weapon.use = use2;
weapon.misfunction13 = 1.145^use2;
//an exponential (?) function that gives: 34 shots = 100%, in average 20 shots to misfunction




this counts the number of shots, & adds 1 each time
(misfunction13 is what´s going to happen after a while...)

may it be of any help? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/mellow.gif" style="vertical-align:middle" emoid=":|" border="0" alt="mellow.gif" />
 
Sounds like a good addon <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
what about something to, like, augment blades? in SLiB you can augment your ship, I don't know how they code it, but you can increase crew capacity, hull strength, speed and other stats by a percentage, if you hand in some money and the building materials. This'd be great for swords too, since I like how some swords look but I have to toss them away as soon as I find something stronger; I'd like to be able to increase the hit, block or pierce, make sort of a customizable sword, maybe even starting with any base sword that I like. Of course it'd take a deal of wealth and maybe some raw materials, like those little bits of metal we come across all over the place...

Being able to combine a sword with a skill+ item would also be cool, I'm sure someone's suggested this before. Setting a stone in the hilt or something... In other RPGs this usually gives the weapon some sort of power, though of course being able to blast fire or ice is out of the question here... maybe just a hit point bonus, blade break or disarm increase...?

Anyway I like your idea Pieter, good luck.
 
An attribute (like attack.bladedamage.counter) is always stored as TEXT (letters, like a string type variable). Therefore attack.bladedamage.counter + 1 doesn't add an amount of 1 to a stored amount but it adds the letter "1" to a stored text.

If you want to calculate with attributes you must always convert their text into a number. Either with stf(attribute) (meaning convert STring to Float number), or with sti() (meaning convert STring to Integer number). You'll find examples of those everywhere where PotC calculates with attribute

attack.bladedamage.counter = sti(attack.bladedamage.counter) + 1;

should work
 
Ah. Thanks CCC.

To Alan Smithee: nice ideas. I don't know how to code it though. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" />
 
Thank you EVER SO MUCH, CCC! It's counting now!!! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/danse1.gif" style="vertical-align:middle" emoid=":dance" border="0" alt="danse1.gif" />
 
Thanks to CCC, I have been able to continue with this mod. I made the basics now and am trying to translate some of my additional ideas into the code. However, at the moment I am a bit confused about how to actually code it in. I tried some things in below part of code, but I think I must think of something better than this. If you have any comments, please say so.
Please note: This code is not ready for use in the game yet; I don't know what would happen using this code gameplay-wise, but it won't be right. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/no.gif" style="vertical-align:middle" emoid=":no" border="0" alt="no.gif" />

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->        // PB: Blade Damage mod
        if(!CheckAttribute(attack,"bladedamage.counter")) {attack.bladedamage.counter = 0;}
        attack.bladedamage.counter = sti(attack.bladedamage.counter) + 1;
        // Counts the amount of strokes you performed with your blade

        string BladeID = attack.equip.blade;
        string BladeBaseID;
        if (findSubStr(&BladeID, "+", 0) > -1 || findSubStr(&BladeID, "-", 0) > -1)
            BladeBaseID = strcut(&BladeID, 0, strlen(BladeID) - 3);
        else
            BladeBaseID = BladeID;

        bool DecreaseQuality = false;

        int breakchance_quality_scalar;

        switch(GetItemQualityByID(BladeID))
        // Better quality blades have lower chances of breaking
        // IMPORTANT: settings need to be finetuned for gamebalancing
        {
            case 0:    breakchance_quality_scalar = 1.00;    break;
            case 1:    breakchance_quality_scalar = 0.90;    break;
            case 2:    breakchance_quality_scalar = 0.75;    break;
            case 3:    breakchance_quality_scalar = 0.50;    break;
            case 4:    breakchance_quality_scalar = 0.30;    break;
            case 5:    breakchance_quality_scalar = 0.10;    break;
        }

        int breakchance_level_scalar;
        // If a blade is too good for your level, the breaking chance will increase
        // Note: weapon.minlevel ranges from 0 (dagger and saber) to 25 (bosun's choice)

        breakchance_level_scalar = weapon.minlevel / 100;

        int breakchance = breakchance_quality_scalar + breakchance_level_scalar;

        if(sti(attack.bladedamage.counter) > breakchance)
        {DecreaseQuality = true;}

        if(attack.equip.blade != "bladeX4") DecreaseQuality = false;
        // If attack is fighting with fists, the blade quality should not be decreased

        if(DecreaseQuality)
        {
            RemoveCharacterEquip(attack, BLADE_ITEM_TYPE);
            TakeItemFromCharacter(attack, BladeID);

            attack.bladedamage.counter = 0;

            switch(GetItemQualityByID(BladeID))
            {
                case 0:
                    PlaySound("OBJECTS\duel\sword_broken.wav");
                    if(FindCharacterItemByGroup(attack, BLADE_ITEM_TYPE) == "")
                    {GiveItem2Character(attack, "bladeX4");}
                    EquipCharacterByItem(attack, "bladeX4");
                break;

                case 1:
                    GiveItem2Character(attack, BladeBaseID + "-2");
                    EquipCharacterByItem(attack, BladeBaseID + "-2");
                break;

                case 2:
                    GiveItem2Character(attack, BladeBaseID + "-1");
                    EquipCharacterByItem(attack, BladeBaseID + "-1");
                break;

                case 3:
                    GiveItem2Character(attack, BladeBaseID);
                    EquipCharacterByItem(attack, BladeBaseID);
                break;

                case 4:
                    GiveItem2Character(attack, BladeBaseID + "+1");
                    EquipCharacterByItem(attack, BladeBaseID + "+1");
                break;

                case 5:
                    GiveItem2Character(attack, BladeBaseID + "+2");
                    EquipCharacterByItem(attack, BladeBaseID + "+2");
                break;
            }
        }<!--c2--></div><!--ec2-->
If you want to give an early version of this mod a try, add the following code to LAi_events.c:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->        // PB: Blade Damage mod
        if(!CheckAttribute(attack,"bladedamage.counter")) {attack.bladedamage.counter = 0;}
        attack.bladedamage.counter = sti(attack.bladedamage.counter) + 1;
        // Counts the amount of strokes you performed with your blade

        string BladeID = attack.equip.blade;
        string BladeBaseID;
        if (findSubStr(&BladeID, "+", 0) > -1 || findSubStr(&BladeID, "-", 0) > -1)
            BladeBaseID = strcut(&BladeID, 0, strlen(BladeID) - 3);
        else
            BladeBaseID = BladeID;

        bool DecreaseQuality = false;

        if(sti(attack.bladedamage.counter) > 5)
        {DecreaseQuality = true;}

        if(DecreaseQuality)
        {
            RemoveCharacterEquip(attack, BLADE_ITEM_TYPE);
            TakeItemFromCharacter(attack, BladeID);

            attack.bladedamage.counter = 0;

            switch(GetItemQualityByID(BladeID))
            {
                case 0:
                    PlaySound("OBJECTS\duel\sword_broken.wav");
                    if(FindCharacterItemByGroup(attack, BLADE_ITEM_TYPE) == "")
                    {GiveItem2Character(attack, "bladeX4");}
                    EquipCharacterByItem(attack, "bladeX4");
                break;

                case 1:
                    GiveItem2Character(attack, BladeBaseID + "-2");
                    EquipCharacterByItem(attack, BladeBaseID + "-2");
                break;

                case 2:
                    GiveItem2Character(attack, BladeBaseID + "-1");
                    EquipCharacterByItem(attack, BladeBaseID + "-1");
                break;

                case 3:
                    GiveItem2Character(attack, BladeBaseID);
                    EquipCharacterByItem(attack, BladeBaseID);
                break;

                case 4:
                    GiveItem2Character(attack, BladeBaseID + "+1");
                    EquipCharacterByItem(attack, BladeBaseID + "+1");
                break;

                case 5:
                    GiveItem2Character(attack, BladeBaseID + "+2");
                    EquipCharacterByItem(attack, BladeBaseID + "+2");
                break;
            }
        }<!--c2--></div><!--ec2-->
This code will decrease the quality of anyone's blade after five strokes with the blade. Eventually it will break.

I will be continuing work on this mod later. I hope to think of a better way to add the influence of character level, blade quality and some randomness as well.
 
Hello all,
I have been continuing work on this mod again and it was working reasonably well previously, but not anymore. For some reason, the line in red is being added up as string AGAIN and I don't - know - why! Result: Your blade will ALWAYS decrease in quality <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />

I am also having some difficulty in figuring out how to balance this mod properly. After all: Your blade shouldn't break all the time, but it shouldn't happen never either. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" />
<!--QuoteBegin-"LAi_events.c"+--><div class='quotetop'>QUOTE("LAi_events.c")</div><div class='quotemain'><!--QuoteEBegin-->// PB: Blade Damage mod
if(!CheckAttribute(attack,"bladedamage.counter")) {attack.bladedamage.counter = 0;}
attack.bladedamage.counter = sti(attack.bladedamage.counter) + 1;
// Counts the amount of strokes you performed with your blade

string BladeID = attack.equip.blade;
string BladeBaseID;
if (findSubStr(&BladeID, "+", 0) > -1 || findSubStr(&BladeID, "-", 0) > -1)
BladeBaseID = strcut(&BladeID, 0, strlen(BladeID) - 3);
else
BladeBaseID = BladeID;

LogIt("BladeQuality = " + GetItemQualityByID(BladeID))

bool DecreaseQuality = false;

// Bladamage based on the usage of your blade
// ------------------------------------------------------
int bladedamage_usage
bladedamage_usage = sti(attack.bladedamage.counter);
LogIt("Bladedamage Usage = " + bladedamage_usage);

// Bladamage based on your level vs the blade's minlevel
// ------------------------------------------------------
int bladedamage_level;
bladedamage_level = sti(weapon.minlevel - attack.rank);
if(bladedamage_level < 0) bladedamage_level = 0;
LogIt("Bladedamage Level = " + bladedamage_level);

// Bladamage based on the enemy's fencing skill
// ------------------------------------------------------
int bladedamage_enemy;
bladedamage_enemy = sti(enemy.skill.Fencing);
LogIt("Bladedamage Enemy = " + bladedamage_enemy);

<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro--> if(sti(bladedamage_usage) + sti(bladedamage_level) + sti(bladedamage_enemy) > rand(50) + 50);<!--colorc--></span><!--/colorc-->
{DecreaseQuality = true;}

LogIt("Total chance points = " + sti(sti(bladedamage_usage) + sti(bladedamage_level) + sti(bladedamage_enemy)));

if(DecreaseQuality)
{
RemoveCharacterEquip(attack, BLADE_ITEM_TYPE);
TakeItemFromCharacter(attack, BladeID);

attack.bladedamage.counter = 0;

switch(GetItemQualityByID(BladeID))
{
case 0:
PlaySound("OBJECTS\duel\sword_broken.wav");
if(FindCharacterItemByGroup(attack, BLADE_ITEM_TYPE) == "")
{GiveItem2Character(attack, "bladeX4");}
EquipCharacterByItem(attack, "bladeX4");
break;

case 1:
GiveItem2Character(attack, BladeBaseID + "-2");
EquipCharacterByItem(attack, BladeBaseID + "-2");
break;

case 2:
GiveItem2Character(attack, BladeBaseID + "-1");
EquipCharacterByItem(attack, BladeBaseID + "-1");
break;

case 3:
GiveItem2Character(attack, BladeBaseID);
EquipCharacterByItem(attack, BladeBaseID);
break;

case 4:
GiveItem2Character(attack, BladeBaseID + "+1");
EquipCharacterByItem(attack, BladeBaseID + "+1");
break;

case 5:
GiveItem2Character(attack, BladeBaseID + "+2");
EquipCharacterByItem(attack, BladeBaseID + "+2");
break;
}
}<!--QuoteEnd--></div><!--QuoteEEnd-->Any help would be more than welcome. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/bow.gif" style="vertical-align:middle" emoid=":bow" border="0" alt="bow.gif" />
 
<!--quoteo(post=140129:date=Feb 19 2006, 03:36 PM:name=Pieter Boelen)--><div class='quotetop'>QUOTE(Pieter Boelen @ Feb 19 2006, 03:36 PM) [snapback]140129[/snapback]</div><div class='quotemain'><!--quotec-->if(sti(bladedamage_usage) + sti(bladedamage_level) + sti(bladedamage_enemy) > rand(50) + 50)<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->;<!--colorc--></span><!--/colorc-->
{DecreaseQuality = true;}<!--QuoteEnd--></div><!--QuoteEEnd-->

The ';' after condition and before start of block ('{') is something very bad. With it, the empty instruction is executed, and statement in brackets - always, as you noticed.

Happy programming/modding!

pirate_kk
 
WOOPS! That was pretty stupid! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
Thanks, Pirate_KK! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/bow.gif" style="vertical-align:middle" emoid=":bow" border="0" alt="bow.gif" />
 
Now it is AGAIN not working properly! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />
It was almost working right previously, but not anymore. It is again adding up with strings instead of ints and I do - not - know - why. Also: The line in red is simply refusing to substract. I can get it to add up, but I don't want that. I want it to actually use that "-" sign! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />
Request: can somebody please slightly rewrite my code so that it actually does what it should? I can't continue work with this mod if it keeps acting insane! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/diomed.gif" style="vertical-align:middle" emoid=":dio" border="0" alt="diomed.gif" />

<!--QuoteBegin-"LAi_events.c"+--><div class='quotetop'>QUOTE("LAi_events.c")</div><div class='quotemain'><!--QuoteEBegin-->// PB: Blade Damage mod
if(!CheckAttribute(attack,"bladedamage.counter")) {attack.bladedamage.counter = 0;}
attack.bladedamage.counter = sti(attack.bladedamage.counter) + 1;
// Counts the amount of strokes you performed with your blade

string BladeID = attack.equip.blade;
string BladeBaseID;
if (findSubStr(&BladeID, "+", 0) > -1 || findSubStr(&BladeID, "-", 0) > -1)
BladeBaseID = strcut(&BladeID, 0, strlen(BladeID) - 3);
else
BladeBaseID = BladeID;

LogIt("BladeQuality = " + GetItemQualityByID(BladeID))

bool DecreaseQuality = false;

// Bladedamage based on the usage of your blade
// -------------------------------------------------------
int bladedamage_usage
bladedamage_usage = attack.bladedamage.counter;
LogIt("Bladedamage Usage = " + bladedamage_usage);

// Bladedamage based on your level vs the blade's minlevel
// -------------------------------------------------------
int bladedamage_level;
<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro--> bladedamage_level = weapon.minlevel - attack.rank;<!--colorc--></span><!--/colorc-->
if(bladedamage_level < 0) bladedamage_level = 0;
LogIt("Bladedamage Level = " + bladedamage_level);

// Bladamage based on the enemy's fencing skill
// -------------------------------------------------------
int bladedamage_enemy;
bladedamage_enemy = enemy.skill.Fencing;
LogIt("Bladedamage Enemy = " + bladedamage_enemy);

if(bladedamage_usage + bladedamage_level + bladedamage_enemy > rand(50) + 50)
{DecreaseQuality = true;}

LogIt("Total chance points = " + bladedamage_usage + bladedamage_level + bladedamage_enemy);

if(DecreaseQuality)
{
RemoveCharacterEquip(attack, BLADE_ITEM_TYPE);
TakeItemFromCharacter(attack, BladeID);

attack.bladedamage.counter = 0;

switch(GetItemQualityByID(BladeID))
{
case 0:
PlaySound("OBJECTS\duel\sword_broken.wav");
if(FindCharacterItemByGroup(attack, BLADE_ITEM_TYPE) == "")
{GiveItem2Character(attack, "bladeX4");}
EquipCharacterByItem(attack, "bladeX4");
break;

case 1:
GiveItem2Character(attack, BladeBaseID + "-2");
EquipCharacterByItem(attack, BladeBaseID + "-2");
break;

case 2:
GiveItem2Character(attack, BladeBaseID + "-1");
EquipCharacterByItem(attack, BladeBaseID + "-1");
break;

case 3:
GiveItem2Character(attack, BladeBaseID);
EquipCharacterByItem(attack, BladeBaseID);
break;

case 4:
GiveItem2Character(attack, BladeBaseID + "+1");
EquipCharacterByItem(attack, BladeBaseID + "+1");
break;

case 5:
GiveItem2Character(attack, BladeBaseID + "+2");
EquipCharacterByItem(attack, BladeBaseID + "+2");
break;
}
}<!--QuoteEnd--></div><!--QuoteEEnd-->
 
On line 19: missing ';'

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> int bladedamage_usage;<!--c2--></div><!--ec2-->

Unfortunately, I don't have more time to look into the code because I'm currently busy improving boardingparty mod by CCC.

pirate_kk
 
Back
Top