New feature: We can now create non-profile-based merchants via lua.scripts.

Requires GameDir >= r2320.

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23061&goto=345526&#msg_345526

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8212 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-05-15 17:11:29 +00:00
parent d594ba0e67
commit 7bb401b1fb
27 changed files with 295 additions and 296 deletions
+15 -2
View File
@@ -3397,7 +3397,9 @@ SOLDIERTYPE* TacticalCreateArmedCivilian( UINT8 usSoldierClass )
return(pSoldier);
}
SOLDIERTYPE* TacticalCreateCivilian( INT32 sGridNo, UINT8 usCivilianGroup, INT8 sBodyType, INT8 aVest, INT8 aPants, INT8 aHair, INT8 aSkin, INT16 sItem1, INT16 sItem2, INT16 sItem3, INT16 sItem4 )
SOLDIERTYPE* TacticalCreateCivilian( INT32 sGridNo, UINT8 usCivilianGroup, INT8 usTraderID,
INT8 sBodyType, INT8 aVest, INT8 aPants, INT8 aHair, INT8 aSkin,
INT16 sItem1, INT16 sItem2, INT16 sItem3, INT16 sItem4 )
{
// not in autoresolve!
if ( guiCurrentScreen == AUTORESOLVE_SCREEN )
@@ -3416,7 +3418,7 @@ SOLDIERTYPE* TacticalCreateCivilian( INT32 sGridNo, UINT8 usCivilianGroup, INT8
MercCreateStruct.sInsertionGridNo = sGridNo;
MercCreateStruct.ubDirection = Random( NUM_WORLD_DIRECTIONS );
while ( sBodyType < 0 || sBodyType >= CRIPPLECIV || (sBodyType >= ADULTFEMALEMONSTER && sBodyType <= QUEENMONSTER) )
while ( sBodyType < 0 || sBodyType > CRIPPLECIV || (sBodyType >= ADULTFEMALEMONSTER && sBodyType <= QUEENMONSTER) )
{
sBodyType = Random( CRIPPLECIV + 1 );
}
@@ -3458,6 +3460,17 @@ SOLDIERTYPE* TacticalCreateCivilian( INT32 sGridNo, UINT8 usCivilianGroup, INT8
// set correct civ group
pSoldier->ubCivilianGroup = usCivilianGroup;
pSoldier->sNonNPCTraderID = -1;
if ( gGameExternalOptions.bExtraMerchants )
{
pSoldier->sNonNPCTraderID = usTraderID;
// if we're a dealer, don't walk around that much
if ( pSoldier->sNonNPCTraderID > 0 )
pSoldier->aiData.bOrders = ONGUARD;
}
// make him wear administrator uniform
UINT16 usPaletteAnimSurface = LoadSoldierAnimationSurface( pSoldier, pSoldier->usAnimState );