• 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!

Included in Build Challenging to Steal from Item Traders and Town Guards

Be careful if you alter what happens with a throwing knife. One of the missions in the "Assassin" storyline requires you to kill a target sneakily using a throwing knife. He's not a trader, he's a military officer, so provided the reaction is only changed if you throw a knife at a trader, it shouldn't affect that mission.

Why does throwing a stone cost me reputation, but throwing a knife doesn't? This is consistent, I tried it several times, and against two different traders, saving game first so I could repeat the experiment and so that I was standing on the same spot for each throw. If anything, the knife ought to cost more reputation than the stone as it's a lethal attack - murder is a more serious offence than vandalism.
 
I think the idea whit the trowing knife is people dont know who commit the murder , a secret attack.
Thats why you succeed whitout any alarm. Wish it will be like that further on. Dont touch it!:cheeky
 
Last edited:
PROGRAM\Loc_ai\LAi_events.c add:
Code:
    if( CheckAttribute(weapon, "poison" ) )    // if weapon poisonous
     {
       if(GetAttribute(enemy, "id") == "Blackbeard")   LAi_SetImmortal(enemy, false);   // PB: Blackbeard can be killed only using a Borgiablade
       Log_SetStringToLog(TranslateString("","Victim poisoned!"));
       enemy.chr_ai.poison =  300 ;     // initial targetchr poisoned
       LAi_CharacterPlaySound(enemy, "OBJECTS\Voices\dead\male\dead4.wav");
       effects_to_play += " poison";

       if(CheckAttribute(enemy,"itemtrade")) MerchantGuildAttack(enemy, true);   // PB: For streetmerchants only  <--------------------- THAT LINE ----------------
     }
It would be possible to add the difficulty for poisoning soldiers as well. That probably wouldn't mess up any quests because a lo of safeguards are already in place for that.
So now the question is: How much harder should traders be to rob compared to soldiers?

Why does throwing a stone cost me reputation, but throwing a knife doesn't? This is consistent, I tried it several times, and against two different traders, saving game first so I could repeat the experiment and so that I was standing on the same spot for each throw. If anything, the knife ought to cost more reputation than the stone as it's a lethal attack - murder is a more serious offence than vandalism.
Do you get the "firing on undrawn blade" message to go with it? The game isn't very appreciative of that.

Strange though; I can't find any LAi_ChangeReputation lines for "stun" in either LAi_events.c, LAi_fightparams.c or CCCFunctions.c which are the only three files I think might be related. :confused:
 
Yes, that's how I know I'm losing reputation. ;) Throwing a stone gets the message about firing on undrawn blade. Throwing a knife from the same location does not. Repeating the process by saving game first, throwing, reloading, throwing etc., all from the same location, shows it to be consistent - stones get the message, knives don't.

I agree that knives need to be a sneaky way of attacking someone, mainly because of the "Assassin" storyline. So, for consistency, stones ought perhaps to work the same way. It might be dangerous to change what happens if you throw a knife at a soldier because your target in "Assassin" is a soldier, though it may not be a problem if you can distinguish between random guards and quest NPC's. The merchants' guild is vigilant; perhaps have them jump on you if you throw either a knife or a stone at a trader, even before you've moved in to grab the loot. Traders should be harder because the potential gain is much greater - all you'll get from a soldier is a sword, a gun and probably some ammo, whereas a trader can yield a whole mass of stuff. (The one in San Juan had battle armour and superior spyglasses, which he wouldn't sell to me even though I was high enough level to get them, making it very tempting to mug him permanently rather than as a temporary experiment...)
 
It might be dangerous to change what happens if you throw a knife at a soldier because your target in "Assassin" is a soldier, though it may not be a problem if you can distinguish between random guards and quest NPC's.
The code does indeed attempt to distinguish between those two and the Fort Commander Reinforcements should happen ONLY for fixed town guards.

Yes, that's how I know I'm losing reputation. ;) Throwing a stone gets the message about firing on undrawn blade. Throwing a knife from the same location does not. Repeating the process by saving game first, throwing, reloading, throwing etc., all from the same location, shows it to be consistent - stones get the message, knives don't.
Can you check those items' entries in initItems.c? I thought they both were ranged and sneaky, but one is stun (cobblestone) and the other is poison.
 
Both have:
itm.throw = 1
itm.stealth = 0.75
itm.skipequip = NO_SPECIALWEAPONED_NPC (which is odd, I'm sure I've taken cobblestones from dead enemies)
itm.sneaky = true (along with a comment by you that this refers to a sneaky trader, presumably the random citizen type who tries to sell you special items)

The poisoned throwing knife also has:
itm.accuracy = 60

The cobblestone has accuracy 80. Presumably that affects the range at which you can hope to hit targets?
 
So they're both defined almost the same way? But the Throwing Knife also has .poison . So the item with LESS code applied does MORE things, as in: It does the reputation loss too.

As for NO_SPECIALWEAPONED_NPC, have you ever seen an NPC with such an item equipped instead of a pistol?
They might carry it as random loot, but they shouldn't use it.

itm.sneaky is indeed used as flag for the random traders in town that sell you special weapons.
They used to sell high level items instead, but I changed them to sell these instead. More fun! :wp
 
The throwing knife has poison and the cobblestone has stun. But the throwing knife does indeed have one more line which the cobblestone does not, though I can't imagine how it would affect reputation:
Code:
itm.skipsell  = true;
In addition, the throwing knife has "itm.skiptrade = false" while the cobblestone has "itm.skiptrade = true". Apparently "skipsell" determinese whether you can buy an item and "skiptrade" determines if you can sell it, so you can sell a throwing knife but can't buy it, and you can't sell a cobblestone.
 
It shouldn't affect reputation. Bit mysterious, this one.

You indeed have the difference between skiptrade and skipsell figured out right there.
Items with skiptrade aren't even shown in the interface at all.
 
Well you can sell cobblestones, but only to a sneaky trader who already has cobblestones. Otherwise I would have hundreds of them.
 
This here has been a relatively large change compared to previous modpack updates.
So what's the verdict? Good? Not good? Needs more work to be considered finished?
If I don't hear any further comments, I'll consider this change accepted.
 
As I mentioned earlier, there is a HUGE penalty for attacking and/or looting any street merchants because of the potential reward and the fact that they can't defend themselves.
I asked before if that penalty might not be TOO huge (reputation immediately drops to mimimum and so does your relation to the merchant's nation).

Today it occurred to me that it probably makes much more sense to just call UpdateRMRelation there, similar to when you capture/sink any ship at sea.
This can be called with a "traitor attribute" which will give you a suitably nasty penalty.
However, it would then be part of a general game system rather than being yet another separate thing. :facepalm
 
Looks like I pretty much already did that! I forgot.
Anyway, I'm now making it more fun:
Code:
    // TIH --> bug fix... this now works right Jul23'06
     ChangeCharacterReputation(PChar, -100);         // TIH MUST BE INT Nov17'06
     pchar.traitor = true;                 // PB: Trigger massive penalties
     UpdateRMRelation(PChar, iNation, REPCH_FRIENDLY);   // PB: Straight function call
     // TIH <--
The number doesn't matter as all traitorous acts are treated the same.
This shouldn't drop you down to the minimum relation anymore, but DOES affect ALL nations and loses you all your LoMs and commissions too.
And it will probably get you marked as a pirate too.
 
Probably have to think of a clever way to merge this into the UpdateRMRelation function:
Code:
//run this whenever friendly or neutral thing of iNation is /attacked/ by char.
float AttackRMRelation(ref char, int iNation)
{
   //get current rel
   float rel;
   rel = GetRMRelation(char, iNation);
   bool bad = false;

   //set rmrel for iNation to afterattack.
   //note that REPCH_FRIENDLY is in /addition/ to RCH_neut.
   if(rel > REL_NEUTRAL)
   {
     bad = true;
     ChangeCharacterReputation(char, REPCH_FRIENDLY);
   }
   if(rel > REL_AFTERATTACK)
   {
     SetRMRelation(char, iNation, REL_AFTERATTACK);
     ChangeCharacterReputation(char, REPCH_NEUTRAL);
   }
   if (IsMainCharacter(char)) LeaveService(char, iNation, bad);
   return GetRMRelation(char, iNation); // NK 04-09-20 func must return something, it's a float. Oops!
}
Will be nice to have one function handling both the relation changes to ALL nations, the losing of LoMs and reputation hits.
 
You normally get a reputation hit when attacking the "wrong" characters ashore and now you get a relation hit if you attack the "wrong" ships at sea.
Do you guys reckon that should remain separated with reputation ashore and relations on land or should they be tied together?

For example, the severity of an "act of piracy" at sea is measured in points.
Should the same number of points be subtracted from your reputation at the same time then?
So a minor act of piracy (capturing/sinking a non-pirate ship without a LoM/navy commission) would give you -1 reputation too?
And a large act of piracy would probably make you the Terror of All Terrors* in one go.... :wp

* = I know it's not called that. I can just never remember the correct name.... :oops:
 
Besides the fort now sending an ambush all guards in a specific radius should also come to the aid of this merchant, so this should also help.
 
Besides the fort now sending an ambush all guards in a specific radius should also come to the aid of this merchant, so this should also help.
But the Ambush function already used to do that. :confused:
Code:
       LAi_group_SetHearRadius(group, 40000000.0);
       LAi_group_SetSayRadius(group, 40000000.0);
Do we have two systems for the same thing? I know some stuff could do with cleaning up there, but I was hoping we could postpone that a bit longer...
 
But the Ambush function already used to do that. :confused:
Code:
       LAi_group_SetHearRadius(group, 40000000.0);
       LAi_group_SetSayRadius(group, 40000000.0);
Do we have two systems for the same thing? I know some stuff could do with cleaning up there, but I was hoping we could postpone that a bit longer...
Oh right in this it did that indeed :p.

Hmmm...maybe I made a system which actually does this too XD. I still need it to find the closest guard tough.
 
Back
Top