Files
source/Strategic/LuaInitNPCs.h
T
Wanne ab02106512 - New Externalization: Externalized the used music to an OPTIONAL "Scripts\Music.lua" file (by Jazz)
o This file is OPTIONAL and if not available, the game uses the default music tracks
o With the user of the Music.lua script file, you can play different musics and types for each sector (*.WAV or *.OGG)
o An example of the usage has been added to "Docs\Externalized Music Example.zip"
o See comments from the Music.lua scripts below

--[[
AddMusic(SectorX,SectorY,SectorZ,MusicType,MusicID)

MusicType :
1 - standard music, sector no enemy (NOTHING_xxx.wav or NOTHING_xxx.ogg)
2 - enemy in sector  (TENSOR_xxx.wav or TENSOR_xxx.ogg)
3 - start battle  (BATTLE_xxx.wav or BATTLE_xxx.ogg)
4 - victory  (TRIUMPH_xxx.wav or TRIUMPH_xxx.ogg)
5 - death merc  (DEATH_xxx.wav or DEATH_xxx.ogg)

xxx - number file

MusicID - id of music

Put to "Music" folder ogg or wav file. We number the names of files NOTHING_0.wav... NOTHING_10.wav ... etc

Example :
AddMusic(1,10,0,1,0) -- add to sector A10, music type "1" and file NOTHING_0.wav or NOTHING_0.ogg.
AddMusic(1,10,1,1,0) -- add to sector A10_B1, music type "1" and file NOTHING_0.wav or NOTHING_0.ogg.
AddMusic(1,9,0,2,10) -- add to sector A9, music type "2" and file TENSOR_10.wav or TENSOR_10.ogg.

for x = 1,16 do
        for y = 1,16 do
		AddMusic(x,y,0,1,10) -- add to all sector, music type "1" and file NOTHING_10.wav or NOTHING_10.ogg.
	end
end

]]

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6295 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-08-20 07:15:30 +00:00

87 lines
3.2 KiB
C

#ifndef _LUAINITNPCS_H
#define _LUAINITNPCS_H
#include "Types.h"
typedef struct
{
BOOLEAN fGlobalLuaBool;
UINT32 iGlobalLuaVal;
} LUA_GLOBAL;
extern LUA_GLOBAL gLuaGlobal[1000];
#define MAX_ACTION_NAMES_CHARS 30
typedef struct
{
UINT16 uiIndex;
UINT8 ActionID;
UINT32 BombItem;
CHAR16 szName[MAX_ACTION_NAMES_CHARS];
UINT8 BlowUp;
} ACTION_ITEM_VALUES;
extern ACTION_ITEM_VALUES ActionItemsValues[500];
extern UINT32 uiHourLua;
extern UINT32 uiDayLua;
extern UINT32 uiMinLua;
extern UINT16 PROFILLUA_sSectorX;
extern UINT16 PROFILLUA_sSectorY;
extern UINT8 PROFILLUA_bSectorZ;
extern UINT8 PROFILLUA_Level;
extern UINT8 PROFILLUA_ubID;
extern UINT32 PROFILLUA_sGridNo;
extern UINT8 PROFILLUA_ubDirectiono;
extern UINT8 PROFILLUA_bTeam;
extern UINT8 PROFILLUA2_ubProfile;
extern UINT16 PROFILLUA2_sSectorX;
extern UINT16 PROFILLUA2_sSectorY;
extern UINT8 PROFILLUA2_bSectorZ;
extern UINT8 PROFILLUA2_ubID;
extern UINT32 PROFILLUA2_sGridNo;
extern BOOLEAN LetHandleLoyaltyChangeForNPCAction(UINT8 ubNPCProfileId , UINT8 Init);
extern BOOLEAN LuaHandleGlobalLoyaltyEvent( UINT8 ubEventType, INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ , UINT8 Init);
extern BOOLEAN LetLuaHandleEarlyMorningEvents(UINT8 Init);
extern BOOLEAN LetLuaHourlyQuestUpdate(UINT8 Init);
extern BOOLEAN LetLuaMyCustomHandleAtNewGridNo(UINT8 bNewSide, UINT8 ProfileId, UINT8 Init);
extern BOOLEAN LetLuaPerformItemAction(UINT32 Action, INT32 sGridNo, UINT8 InitFunction);
extern BOOLEAN LetLuaGameInit(UINT8 Init);
extern BOOLEAN LetLuaInterfaceDialogue( UINT8 ubNPC, UINT8 InitFunction);
extern BOOLEAN LuaHandlePlayerTeamMemberDeath(UINT8 ProfileId, UINT8 Init);
extern BOOLEAN LuaHandleNPCTeamMemberDeath(UINT8 ProfileId, UINT8 Init);
extern BOOLEAN LuaCheckForKingpinsMoneyMissing( BOOLEAN fFirstCheck, UINT8 Init);
extern BOOLEAN LuaHandleQuestCodeOnSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 Init);
//extern BOOLEAN LuaHandleQuestCodeOnSectorEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 Init);
extern BOOLEAN LuaHandleDelayedItemsArrival( UINT32 uiReason, UINT8 Init);
extern BOOLEAN LetLuaHandleNPCSystemEvent( UINT32 uiEvent, UINT8 Init);
extern BOOLEAN LuaCheckFact ( UINT16 usFact, UINT8 ubProfileID , UINT32 Init);
extern BOOLEAN LuaHandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum , UINT8 InitFunction);
extern BOOLEAN LuaInternalQuest( UINT8 ubQuest, INT16 sSectorX, INT16 sSectorY, BOOLEAN fUpdateHistory, UINT32 Init );
extern BOOLEAN LuaExecuteStrategicEvent( UINT8 EventCallbackID, UINT32 uiTimeStamp, UINT32 uiTimeOffset, UINT8 ubEventType, UINT8 ubFlags, UINT32 EventParam, UINT32 Init);
extern void IniLuaGlobal();
extern BOOLEAN LoadLuaGlobalFromLoadGameFile( HWFILE hFile );
extern BOOLEAN SaveLuaGlobalToSaveGameFile( HWFILE hFile );
#ifdef JA2UB
extern BOOLEAN LuaInitStrategicLayer(UINT8 Init);
extern BOOLEAN LetLuaMakeBadSectorListFromMapsOnHardDrive(UINT8 Init);
#endif
//Intro
extern BOOLEAN LuaIntro(UINT8 Init, UINT32 uiCurrentVideo, INT8 bIntroType, UINT32 iStringToUse);
extern BOOLEAN LuaIDScripts(UINT8 Init, UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum);
extern BOOLEAN LetLuaMusicControl(UINT8 Init);
#endif