SLIC-Reference : AddSlaves
CTP2 Bureau
The Modding
Knowledgebase
Apolyton CTP2 forums
Apolyton CTP2 archives
Source Code Project SVN

SLIC-Reference : : AddSlaves  

Arguments: city, number, player_victim Type: void

Takes number citizens from player_vitim's cities and gives them as slaves to city?

Source:

SFN_ERROR Slic_AddSlaves::Call(SlicArgList *args)
{
	if(args->Count() != 3)
		return SFN_ERROR_NUM_ARGS;

	Unit city;
	if(!args->GetCity(0, city))
		return SFN_ERROR_TYPE_ARGS;

	sint32 count;
	if(!args->GetInt(1, count))
		return SFN_ERROR_TYPE_ARGS;

	sint32 victim;
	if(!args->GetPlayer(2, victim))
		return SFN_ERROR_TYPE_ARGS;

	MapPoint pos; 
	city.GetPos(pos);
	
	sint32 i;
	if(count > 0) {
		for (i=0;  iAddEvent(GEV_INSERT_Tail, GEV_MakePop,
						   GEA_City, city.m_id,
						   GEA_Player, victim,
						   GEA_End);
			
		}
	} else {
		// Add code to convert count slaves to normal pops here later.
		for(i = count; i < 0; i++) {
			// Add pop remove code here later (KillPop event).
		}
	}

	
	sint32 delta_martial_law;
	CityData *cd = city.GetData()->GetCityData();
	cd->GetHappy()->CalcHappiness(*cd, FALSE, delta_martial_law, TRUE);

	return SFN_ERROR_OK;
}

Information last updated by BureauBert on 27.06.2009

User Comments:

Using this form you may add your own observations concerning the above item, e.g. additional hints for usage, limitations, oddities etc. Please note this is not the place for asking questions or carrying out discussions about modding - please refer to the Apolyton CTP2 Modification Forum on that purpose.

Subject / Title*:
Text:*
(A maximum of characters left)
Your name:*
Your website (URL):

*) Required fields

No user comments yet.

  Administration
This site is currently maintained by: BureauBert (Webmaster)  Maquiladora (Manager)  Legal Notice: Legal Notice Statistics: 123761 unique users since 02.05.2004 (» Site Statistics) Hosted by: WebhostOne
Share this page:  VK Facebook Twitter LiveJournal OK MR Google+ LinkedIn tumblr Pinterest Blogger Digg Evernote