CTP2 Bureau
The Modding
Knowledgebase
Apolyton CTP2 section
Apolyton CTP2 files
Apolyton CTP2 forums
Source Code Project SVN

Actions

Pages

Recent Changes Search

Create a new page:

AE Modding Wiki : Functions : CreateWonder

New SLIC-function: CreateWonder(city, wonder)

The difference with the same event is that the function doesn't effect stored production in a city. And doesn't trigger the wonder movie.

//----------------------------------------------------------------------------
//
// Authored   : Maq
//
// Name       : Slic_CreateWonder
//
// Description: Function to create a wonder in a city.
//
// Parameters : SlicArg 0: city
//		SlicArg 1: wonderdb index
//
// Globals    : -
//
// Returns    : SFN_ERROR		: execution result
//
//----------------------------------------------------------------------------
SFN_ERROR Slic_CreateWonder::Call(SlicArgList *args)
{
	if (args->Count() != 2) {
		return SFN_ERROR_NUM_ARGS;
	}

	Unit city;
	sint32 type;
	if(!args->GetCity(0, city)) {
		return SFN_ERROR_TYPE_BUILTIN;
	}

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

	if(!g_theUnitPool->IsValid(city)) {
		return SFN_ERROR_OK;
	}

	if(type < 0 || type >= g_theWonderDB->NumRecords())
		return SFN_ERROR_OUT_OF_RANGE;

	city.CD()->AddWonder(type);
	return SFN_ERROR_OK;

}
Page last modified on July 17, 2009, at 06:17 PM
  Administration
AE Modding Wiki built with PmWiki Design: BureauBert
Share this page:  VK Facebook Twitter LiveJournal OK MR Google+ LinkedIn tumblr Pinterest Blogger Digg Evernote