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

SLIC-Reference : : StealRandomAdvance  

Type: void

A spy steals a random advance from a city

Can only be used from a message box with a city in context.


SFN_ERROR Slic_StealRandomAdvance::Call(SlicArgList *args)
	if (args->Count() != 0)

	SlicObject *context = g_slicEngine->GetContext();
	Unit u = context->GetUnit(0);
	sint32 owner = u.GetOwner();

	if(g_network.IsClient()) {
		if(owner == g_selected_item->GetVisiblePlayer()) {
			g_network.SendAction(new NetAction(NET_ACTION_STEAL_TECHNOLOGY,
										   u.m_id, context->GetCity(0).m_id,

	ORDER_RESULT res = u.StealTechnology(context->GetCity(0), (sint32)-1);
		sint32 index = g_orderInfoMap[UNIT_ORDER_STEAL_TECHNOLOGY];
		OrderInfo *oi = NULL;
		if(index >= 0 && index < g_numOrderInfo) {
			oi = &g_orderInfo[index];

		if(oi && oi->m_goldCost > 0) {

		if(g_theUnitPool->IsValid(u)) {
			if(oi && oi->m_moveCost > 0) {
				bool out_of_fuel;
				u.DeductMoveCost(oi->m_moveCost, out_of_fuel);
	return SFN_ERROR_OK;

Information last updated by BureauBert on 23.11.2010

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*:
(A maximum of characters left)
Your name:*
Your website (URL):

*) Required fields

Error including libraries: Can't locate config.cfg in @INC (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /home/www/ line 4. Make sure they exist, permissions are set properly, and paths are set correctly.
This site is currently maintained by: BureauBert (Webmaster)  Maquiladora (Manager)  Legal Notice: Legal Notice Statistics: 81832 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