//Таблица слухов, и их состояние. "active" - слух включен в поле случаного выбора слуха, "passive" - слух исключен из поля
// NK -->
int MAX_RUMOURS = 0;
#define TOTAL_RUMOURS	256

object	Rumour[256]; //temp


void SetRumourDefaults(bool isreinit)
{
	//int tmpLangFileID = LanguageOpenFile("rumour_strings.txt");
	// NK 04-08-30
	//save old states
	object oldstates;
	int i,j;
	string tmp;
	if(isreinit)
	{
		i = 0;
		for(j = 0; j < TOTAL_RUMOURS; j++)
		{
			if(CheckAttribute(&Rumour[j],"id"))
			{
				tmp = "r"+i;
				//GetAttribute method (unworking ATM): oldstates.savestates.(tmp) = Rumour[j].state;
				oldstates.(tmp).id = Rumour[j].id;
				oldstates.(tmp).state = Rumour[j].state;
				//trace(i + ": rumor " + Rumour[j].id + " has state " + Rumour[j].state);
				i++;
			}
		}
		oldstates.max = i;
	}
	//trace("total stated rumors: " + GetAttributesNum(oldstates));
	for(j = 0; j < TOTAL_RUMOURS; j++)
	{
		DeleteAttribute(&Rumour[j],"id"); // NK
		Rumour[j].text="";
		Rumour[j].state="inactive";
		Rumour[j].loc="";
		Rumour[j].chance = 0;
		Rumour[j].given = false;
	}

	//note most default chance are at 100. If you add a new rumor, you can experiment with a
	//chance of less than 100, for an uncommon rumor.
	//(trade rumors are 25)

	//if you give a rumor an ID it then counts as a quest rumor. If there are any quest rumors
	//available, and frnd() < QUESTRUM_CHANCE, POTC will be forced to choose one (even
	//if frnd()>, it may choose one normally...
	//if the qr hasn't been given yet, it's vs. QUESTRUM_UNGIVEN_CHANCE
	//also, if the rumor has an ID, you can set it active or inactive.
	//
	i = 0;
	//DEFAULT RUMOR:
	Rumour[i].text = TranslateString("","Nothing interesting happens lately. Life goes on smoothly. I wonder how long that'll last!");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].text = TranslateString("","Come to think of it, I didn't really have any gossip.  I'm just so terribly, terribly lonely...");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].text = TranslateString("","People say that some kind of aboriginal cemetery was found inside the Oxbay mine. A lot of bones, crockery, spikes and clay plates were found... but not a grain of gold!");
	Rumour[i].state = "active";
	Rumour[i].loc = "England";
	Rumour[i].chance = 100;
	i++;


	Rumour[i].id = "Silehard_nasty";
	Rumour[i].text = TranslateString("","I heard that the governor of Redmond ordered some merchant brought up on trumped up charges and sent to jail, just to seize the poor fellow's assets!");
	Rumour[i].state = "active";
	Rumour[i].loc = "England";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].id = "Brin_here";
	Rumour[i].text = TranslateString("","I heard there's a new governor on Redmond... came all the way from Britain, on express orders of the king! And he's got orders to send back Silehard in chains!");
	Rumour[i].state = "inactive";
	Rumour[i].loc = "all";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].id = "Smuggle_TOR_start";
	Rumour[i].text = TranslateString("","I hear tell our shopkeeper, Mr. O'Reilly... Well, he's fallen on hard times and he takes a few more chances than he used to with the law. But for you, that might be a plus. I'm sure he'd be happy to meet a captain.");
	Rumour[i].state = "active";
	Rumour[i].loc = "Redmond";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].text = TranslateString("","I tell you friend, piracy is a menace. They don't just steal your goods now, they steal your ship and sell their prisoners into slavery! If they don't kill them all first, of course. Why, I've heard they even use their prisoners for wagers! Gambling and piracy will be the death of our society, I tell you! Uh... you're not a pirate, are you?");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].id = "Toff";
	Rumour[i].text = TranslateString("","Oh, did you hear about poor Toff Oremans and his daughter? She took up with a pirate, which is bad enough... but now she's disappeared! Her father's inconsolable... you'll probably find him at the Douwesen tavern, drowning his sorrows away...");
	Rumour[i].state = "active";
	Rumour[i].loc = "Douwesen";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].text = TranslateString("","Shh... well, friend, you looking for some good men or a good time? I hear there's an island to the south of here where the rum is cheap and the morals are cheaper... and there's always a few lads who'll sail through anything for a price.");
	Rumour[i].state = "active";
	Rumour[i].loc = "Oxbay";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].text = TranslateString("","Why, I hear there are pirates on this very island, under our esteemed governor's very nose! Or under his chin, that is, or should I say chins. Anyhow, if you're looking for some things that... can't be bought in stores... or some lads who know better than to ask questions, that's where to look. But don't say I told you about it.");
	Rumour[i].state = "active";
	Rumour[i].loc = "Douwesen";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].text = TranslateString("","Our governor is a fine gentleman, sir. Do you know he's already had three officials sent to prison for corruption? Used to be you'd run whenever you heard the soldiers coming... but now justice is a thing to be applauded, not feared. I hear he's already working on plans to clear out the vermin who live on the other end of the island...");
	Rumour[i].state = "active";
	Rumour[i].loc = "Conceicao";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].id = "Clair_start";
	Rumour[i].text = TranslateString("","I hear tell Claire Larrouse arrived in the town recently. They say she is making up a crew for her new expedition. She's a famous captain and I'm sure anything she's involved in, gold is not far behind.");
	Rumour[i].state = "active";
	Rumour[i].loc = "IslaMuelle";
	Rumour[i].chance = 100;
	i++;


	Rumour[i].id = "Ship_off_FDF";
	Rumour[i].text = TranslateString("","Oh, it is terrible! There's a commerce raider sitting right off our shores, just waiting for a juicy merchantman to snatch. The governor's been trying to find someone to deal with her once and for all... Perhaps you could help?");
	Rumour[i].state = "active";
	Rumour[i].loc = "FalaiseDeFleur";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].id = "BP_Start";
	Rumour[i].text = TranslateString("","Well, I'm not one for superstition... but it's like this: you hear something once, and you ignore it; twice, and it's coincidence... but three times, and I'm beginning to believe. So I'm beginning to believe there is a ghost ship out there, after all... and I'm staying on land until she's dealt with, that's for sure!");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].text = TranslateString("","We live in a lawless age, captain. The jungles are swarming with villains, the seas are rife with pirates... What's an honest merchant to do? Hire an escort, I guess... And many are. Ask around in the tavern -- there's usually someone waiting for a brave captain to keep him safe.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].text = TranslateString("","Oh, business as usual, captain. Which means piracy is rife as always. I hear our shopkeeper's looking for someone with a fast ship and plenty of grapeshot to carry his cargo.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].text = TranslateString("","Oh, lord! Will our governor not do something about those gutless savages in the jungle whose only pastime is chasing down poor girls and having their way with them, and robbing travelers blind?! If I were younger I might do something myself... You learn a lot about swordfighting, beating up the refuse of humanity...");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].id = "Children_start";
	Rumour[i].text = TranslateString("","The latest news? Why, everyone in the archipelago is talking about it! Children snatched from their cradles, a giant black ship more terrible than the devil himself sinking everything it meets... and even the priests in Redmond have heard about it! I hear it all started on Douwesen...");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].id = "Children_GreenChurch"
	Rumour[i].text = TranslateString("","Oh, I hear the vicar's very worried about things over in Greenford... You look like a captain, perhaps you could help him?");
	Rumour[i].state = "active";
	Rumour[i].loc = "Redmond";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].id = "Church_woman_FDF";
	Rumour[i].text = TranslateString("","Oh, did you hear about that poor woman who lost her husband, and now is like to lose her son? The priest is very worried about her...");
	Rumour[i].state = "active";
	Rumour[i].loc = "FalaiseDeFleur";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].id = "Hitman_start";
	Rumour[i].text = TranslateString("","We live in lawless times, captain. Not only are there pirates on the seas and raiders in the jungles, but also assassins in our very towns! It must stop, captain! Why, just the other day, at the tavern...");
	Rumour[i].state = "inactive";
	Rumour[i].loc = "Conceicao";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].text = TranslateString("","Oh, have you heard about poor Admiral da Saldanha? He comes all the way from Old Spain to the New World to be with his son... and he arrives to find his son missing! I am sure you would earn his undying gratitude, and that of the governor, if you could but help him.");
	Rumour[i].state = "active";
	Rumour[i].loc = "IslaMuelle";
	Rumour[i].chance = 100;
	i++;

	Rumour[i].text = TranslateString("","Have you heard about the latest form of pirate? This one walks on land, you see: he's called a loanshark, and he's worse than a leech. If you need quick money, great -- but God help you if you don't pay on time. My own brother, he once...");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 100;
	i++;

	//start Donalbane
	Rumour[i].text = TranslateString("","I once talked to a drunk who said he found a hidden cave in the Port there.");
	Rumour[i].state = "active";
	Rumour[i].loc = "Oxbay";
	Rumour[i].chance = 100;
	i++;

if(ENABLE_BROTHEL == 1)
{
	Rumour[i].text = TranslateString("","I heard tell of a house of ill repute on Quebradas Costillas, owned by a fellow named Verruckt. It is also said an apothecary moved into Greenford. And if you like opium, there should be an opium den somewhere in Redmond...");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 100;
	i++;
}
else
{
	Rumour[i].text = TranslateString("","It is said an apothecary moved into Greenford. And if you like opium, there should be an opium den somewhere in Redmond..."); // KK
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 100;
	i++;
}

	//start trade rumors, from Donalbane
	Rumour[i].text = TranslateString("","You can always make a pretty penny taking Rum from Oxbay to either Falaise de Fleur or Conceicao, provided you don't drink it all on the way there!");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;

	Rumour[i].text = TranslateString("","I've heard old pirates say that the only things worth bringin' to Quebradas Costillas is Coffee from Douwesen and Clothing from Redmond.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;
	
	Rumour[i].text = TranslateString("","I hear a man can make money moving Fruit from Conceicao to Douwesen.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;

	Rumour[i].text = TranslateString("","I hear there's money to be made in ferrying Leather and Fruit from Conceicao to Oxbay.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;

	Rumour[i].text = TranslateString("","I hear there's profit to be made in shipping Cinnamon from Conceicao to Redmond.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;

	Rumour[i].text = TranslateString("","I hear you can make a fortune shipping Sandal and Tobacco from Oxbay to Redmond.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;

	Rumour[i].text = TranslateString("","I've seen men make fortunes in running Sandal and Cinnamon from Isla Muelle to Redmond.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;

	Rumour[i].text = TranslateString("","I have an uncle who got rich running Clothing from Redmond to Falaise de Fleur.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;

	Rumour[i].text = TranslateString("","Shrewd businessmen take Silk from Falaise de Fleur to Redmond.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;

	Rumour[i].text = TranslateString("","My brother, a merchant, says you can't go wrong ferrying Chocolate from Falaise de Fleur to Conceicao.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;

	Rumour[i].text = TranslateString("","Don't let anyone tell you can't make money from carrying Coffee from Douwesen to Conceicao.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;

	Rumour[i].text = TranslateString("","I hear moving Coppera from Douwesen to Redmond is a sure path to profit.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;

	Rumour[i].text = TranslateString("","I've heard it said that ferrying Ebony from Isla Muelle to Falaise de Fleur is always a wise decision.");
	Rumour[i].state = "active";
	Rumour[i].loc = "all";
	Rumour[i].chance = 25;
	i++;

	//end defined rumors
	MAX_RUMOURS = i;

	// Restore old states
	if(isreinit)
	{
		/*GetAttribute method, unworking ATM:
		aref tmpattr;
		makearef(tmpattr, oldstates.savestates);
		for(j=0; j < GetAttributesNum(tmpattr); j++)
		{
			Rumour[GetRumourIndex(GetAttributeName(GetAttributeN(tmpattr, j)))].state = GetAttributeValue(GetAttributeN(tmpattr, j));
			trace("rumor " + GetAttributeName(GetAttributeN(oldstates, j)) + " with state " + GetAttributeValue(GetAttributeN(tmpattr, j)) + "restored");
		}*/
		for(i = 0; i < sti(oldstates.max); i++)
		{
			tmp = "r" + i;
			Rumour[GetRumourIndex(oldstates.(tmp).id)].state = oldstates.(tmp).state;
			//trace("Restore " + i + ": rumor " + oldstates.(tmp).id + " had state " + oldstates.(tmp).state);
		}
	}
}
// NK <--
