mirror of
https://github.com/1dot13/gamedir.git
synced 2026-08-12 14:10:30 +02:00
Fix: missing lua functions for UB
git-svn-id: https://ja2svn.mooo.com/source/ja2_v1.13_data@2538 4f8fa57e-7814-0410-bad4-adc449f26b7c
This commit is contained in:
@@ -161,6 +161,84 @@ SectorY =
|
||||
MAP_ROW_P = 16,
|
||||
}
|
||||
|
||||
-- text colours
|
||||
FontColour =
|
||||
{
|
||||
FONT_MCOLOR_DKWHITE = 134,
|
||||
FONT_MCOLOR_LTYELLOW = 144,
|
||||
FONT_MCOLOR_RED = 163,
|
||||
FONT_MCOLOR_DKRED = 164,
|
||||
FONT_MCOLOR_LTGREEN = 184,
|
||||
}
|
||||
|
||||
-- these numbers aren't used in the code - we only use them in LUA
|
||||
Languages =
|
||||
{
|
||||
LANGUAGE_ENGLISH = 0,
|
||||
LANGUAGE_GERMAN = 1,
|
||||
LANGUAGE_RUSSIAN = 2,
|
||||
LANGUAGE_DUTCH = 3,
|
||||
LANGUAGE_POLISH = 4,
|
||||
LANGUAGE_FRENCH = 5,
|
||||
LANGUAGE_ITALIAN = 6,
|
||||
LANGUAGE_CHINESE = 7,
|
||||
}
|
||||
|
||||
-- numbers for addressing which stat should get more experience
|
||||
StatTypes =
|
||||
{
|
||||
HEALTHAMT = 1,
|
||||
AGILAMT = 2,
|
||||
DEXTAMT = 3,
|
||||
WISDOMAMT = 4,
|
||||
MEDICALAMT = 5,
|
||||
EXPLODEAMT = 6,
|
||||
MECHANAMT = 7,
|
||||
MARKAMT = 8,
|
||||
EXPERAMT = 9,
|
||||
STRAMT = 10,
|
||||
LDRAMT = 11,
|
||||
}
|
||||
|
||||
-- different teams
|
||||
Teams =
|
||||
{
|
||||
ENEMY_TEAM = 1,
|
||||
CREATURE_TEAM = 2,
|
||||
MILITIA_TEAM = 3,
|
||||
CIV_TEAM = 4,
|
||||
}
|
||||
|
||||
local iLoop
|
||||
local aimLoop
|
||||
|
||||
local HEARD_3_TURNS_AGO = -4
|
||||
local HEARD_2_TURNS_AGO = -3
|
||||
local HEARD_LAST_TURN = -2
|
||||
local HEARD_THIS_TURN = -1
|
||||
local NOT_HEARD_OR_SEEN = 0
|
||||
local SEEN_CURRENTLY = 1
|
||||
local SEEN_THIS_TURN = 2
|
||||
local SEEN_LAST_TURN = 3
|
||||
local SEEN_2_TURNS_AGO =4
|
||||
local SEEN_3_TURNS_AGO = 5
|
||||
|
||||
-- local function
|
||||
local function HandleJohnArrival( ID )
|
||||
|
||||
|
||||
|
||||
end
|
||||
-- end local function
|
||||
|
||||
-- local function
|
||||
local function HandleMaryArrival( ID )
|
||||
|
||||
|
||||
|
||||
end
|
||||
-- end local function
|
||||
|
||||
function HandleAtNewGridNo( ProfileId )
|
||||
|
||||
if ( FindSoldierByProfileID (UB_GetTexID()) == UB_GetTexID() ) then
|
||||
@@ -180,4 +258,219 @@ function HandleAtNewGridNo( ProfileId )
|
||||
|
||||
end -- End team
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
ActionTypes =
|
||||
{
|
||||
ACTIONTYPE_INVALID = 0,
|
||||
ACTIONTYPE_HACKING = 1,
|
||||
ACTIONTYPE_READFILE = 2,
|
||||
ACTIONTYPE_WATERTAP = 3,
|
||||
ACTIONTYPE_SODAMACHINE = 4,
|
||||
ACTIONTYPE_MINIGAME = 5,
|
||||
}
|
||||
|
||||
InfoTypes =
|
||||
{
|
||||
INFO_TYPE_NORMAL = 0,
|
||||
INFO_TYPE_VIP = 1,
|
||||
}
|
||||
|
||||
ScreenTypes =
|
||||
{
|
||||
MINIGAME = 30,
|
||||
}
|
||||
|
||||
MiniGames =
|
||||
{
|
||||
TETRIS = 0,
|
||||
PONG = 1,
|
||||
}
|
||||
|
||||
-- We have an array of 1000 signed integers that a modder can use to set whatever data he wants.
|
||||
-- We simply set up some enums here to make it easier for us to remember what is what
|
||||
ModSpecificActions =
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
-- General defines for various states
|
||||
ActionState =
|
||||
{
|
||||
-- hacking
|
||||
STATE_OK = 0, -- starting state, we can hack this
|
||||
STATE_END = 1, -- computer is shut down and cannot be used
|
||||
STATE_GAVEREWARD_OK = 2, -- computer is still useable, we already got whatever reward there was
|
||||
STATE_GAVEREWARD_END = 3, -- computer is shut down and cannot be used, we already got whatever reward there was
|
||||
}
|
||||
|
||||
-- handle the result of an interactive action that has a special id set for lua
|
||||
-- for more info, see InteractiveActions.xml
|
||||
function HandleInteractiveActionResult(sSectorX, sSectorY, bSectorZ, sGridNo, bLevel, ubID, usActionType, sLuaactionid, difficulty, skill )
|
||||
|
||||
if ( usActionType == ActionTypes.ACTIONTYPE_HACKING ) then
|
||||
|
||||
elseif ( usActionType == ActionTypes.ACTIONTYPE_READFILE ) then
|
||||
|
||||
elseif ( usActionType == ActionTypes.ACTIONTYPE_MINIGAME ) then
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- states of a photo fact
|
||||
PhotoFlag =
|
||||
{
|
||||
NONE = 0,
|
||||
TAKEN = 1,
|
||||
UPLOADED = 2,
|
||||
VERIFIED = 3, -- the code only has one value for verification, but we use several ones for different results
|
||||
VERIFIED_RESULT_2 = 4,
|
||||
}
|
||||
|
||||
-- In this function we can define what and how many items a intel-based dealer should trade with, and how much an item is worth in intel
|
||||
-- AddArmsDealerAdditionalIntelData takes 4 arguments:
|
||||
-- usDealer: shopkeeper this is intended for
|
||||
-- usItem: number of item
|
||||
-- sIntelPrice: price of item in intel
|
||||
-- sOptimalNumber: how many items the trader should have at maximum
|
||||
function AddArmsDealerAdditionalIntelData()
|
||||
|
||||
end
|
||||
|
||||
function SetPhotoState( aIndex, aState )
|
||||
|
||||
end
|
||||
|
||||
-- sSectorX, sSectorY, bSectorZ: sector coordinates
|
||||
-- sGridNo: tile that we photographed. When we take a photo this function is run on all tiles we see in a 2-tile radius around where we clicked
|
||||
-- bLevel: height level (floor or roof)
|
||||
-- ubPhotographerProfile: profile of the merc taking the photo
|
||||
-- room: if > 0, this tile is inside this room
|
||||
-- usTargetProfile: if we photographed a NPC, this will be their profile number, otherwise NO_PROFILE
|
||||
function AddPhotoData( sSectorX, sSectorY, bSectorZ, sGridNo, bLevel, ubPhotographerProfile, room, usTargetProfile )
|
||||
|
||||
end
|
||||
|
||||
function GetPhotoData( aType )
|
||||
|
||||
end
|
||||
|
||||
function VerifyPhotoState(aIndex)
|
||||
|
||||
end
|
||||
|
||||
-- types of weather
|
||||
Weather =
|
||||
{
|
||||
WEATHER_FORECAST_NORMAL = 0,
|
||||
WEATHER_FORECAST_RAIN = 1,
|
||||
WEATHER_FORECAST_THUNDERSHOWERS = 2,
|
||||
WEATHER_FORECAST_SANDSTORM = 3,
|
||||
WEATHER_FORECAST_SNOW = 4,
|
||||
};
|
||||
|
||||
-- skills
|
||||
Skill =
|
||||
{
|
||||
-- radio operator
|
||||
SKILLS_RADIO_ARTILLERY = 0,
|
||||
SKILLS_RADIO_JAM = 1,
|
||||
SKILLS_RADIO_SCAN_FOR_JAM = 2,
|
||||
SKILLS_RADIO_LISTEN = 3,
|
||||
SKILLS_RADIO_CALLREINFORCEMENTS = 4,
|
||||
SKILLS_RADIO_TURNOFF = 5,
|
||||
|
||||
SKILLS_INTEL_CONCEAL = 6,
|
||||
SKILLS_INTEL_GATHERINTEL = 7,
|
||||
|
||||
-- various
|
||||
SKILLS_SPOTTER = 8,
|
||||
SKILLS_FOCUS = 9,
|
||||
SKILLS_DRAG = 10,
|
||||
};
|
||||
|
||||
-- different dialogue action events
|
||||
DialogueActionEvent =
|
||||
{
|
||||
ADE_DISCOVER_ROOM = 0, -- merc is the 1st one to explore this room, aData1 indicates the room in this event
|
||||
ADE_DIALOGUE_REACTION = 1, -- someone else used a line, and we might answer to that, aData1 indicates the profile number in this event, aData2 indicates the specific voice line we react to, aData3 indicates whether this person has been recruited (1) or not(0)
|
||||
ADE_MERC_ARRIVES = 2, -- a mercenary arrives in Arulco. aData1 is the profile of the arriving merc, aData2 is 1 if the player hasn't made contact with the rebels yet
|
||||
ADE_SECTOR_COMMENTARY = 3, -- similar to the rebel's quotes, this is called upon visiting a sector for the first time (if no rebel does their quote first)
|
||||
ADE_MERCHANT_CHAT = 4, -- we greet a merchant (used with non-profile merchants, in order to be a bit more lively), aData1 is the id of the merchant
|
||||
ADE_DIALOGUE_NPC_FRIENDLY = 5, -- in a conversation, we can say something when clicking on a button
|
||||
ADE_DIALOGUE_NPC_DIRECT = 6,
|
||||
ADE_DIALOGUE_NPC_THREATEN = 7,
|
||||
ADE_DIALOGUE_NPC_RECRUIT = 8,
|
||||
ADE_DIALOGUE_NPC_REPEAT = 9,
|
||||
ADE_DIALOGUE_RPC_RECRUIT_SUCCESS = 10, -- we've successfully recruited an RPC, and might comment on that
|
||||
ADE_SEX = 11, -- does exactly what you think it does
|
||||
ADE_WEATHERCHANGE = 12, -- the weather has changed in the current sector, and we can warn the player about that, aData1 is type of Weather
|
||||
ADE_SKILL_RESULT = 13, -- we used a skill, and comment on the result, aData1 is of Skill, aData2 indicates whether it was a success (1) or failure (0)
|
||||
ADE_GRENADEWARNING = 14, -- a delayed enemy grenade was dropped nearby, and we can shout a warning, aData1 is the itemnumber of the grenade
|
||||
ADE_CONSUMEITEM = 15, -- we consumed an item, aData1 is the item index
|
||||
ADE_NPC_DEATH = 16, -- someone died, aData1 is the profile of the dead NPC, aData2 the profile of the killer, aData3 the bodytype of the dead
|
||||
ADE_WITNESS_GOOD = 17, -- similar to comment upon buddy doing good. aData1 is the profile of person, aData2 is 0 if we saw a kill, 1 if they passed a skill check (and we're less than 15 tiles away)
|
||||
ADE_BANDAGE_PERFORM_BEGIN = 18, -- we bandage someone, aData1 is the profile of person
|
||||
ADE_BANDAGE_PERFORM_END = 19, -- we finished bandaging someone, aData1 is the profile of person
|
||||
ADE_BANDAGE_RECEIVE_BEGIN = 20, -- someone bandages us, aData1 is the profile of person
|
||||
ADE_BANDAGE_RECEIVE_END = 21, -- someone finished bandaging us, aData1 is the profile of person
|
||||
ADE_ZOMBIESRISE = 22, -- a new wave of zombies is spawned from corpses
|
||||
ADE_SEXUALHARASSMENT = 23, -- the player wants to take the 'strip' command further than we are comfortable with
|
||||
ADE_LOCKBOMB = 24, -- merc uses a shaped charge to blow the locks of a door, aData1 indicates whether it was a success (1) or failure (0)
|
||||
ADE_SNIPERWARNING = 25, -- merc warns of sniper presence in this sector
|
||||
}
|
||||
|
||||
-- functions used here:
|
||||
-- ubProfile: profile number of merc (don't change that unless you know what to do)
|
||||
-- iFaceIndex: index (don't change that unless you know what to do)
|
||||
-- path: path and name of soundfile we want to play (in .wav, .ogg or .mp3 format)
|
||||
-- text: "Text that should appear"
|
||||
-- SetAdditionalDialogue(ubProfile, iFaceIndex, path, text)
|
||||
-- Do not use this function in any lua calls outside of HandleAdditionalDialogue(..)!
|
||||
--
|
||||
-- path: path and name of soundfile we want to play (in .wav or .ogg format)
|
||||
-- volume: optional sound volume (65: medium volume, 127: loud), default 65
|
||||
-- PlaySound(path, volume)
|
||||
|
||||
-- handle
|
||||
-- sSectorX, sSectorY and bSectorZ indicate the sector coordinates
|
||||
-- ubProfile is the merc for whom this is called
|
||||
-- iFaceIndex is the face of the merc. DON'T CHANGE THIS UNLESS YOU KNOW WHAT YOU ARE DOING!
|
||||
-- usEventNr indicates which event from DialogueActionEvent is used here
|
||||
-- aData1, aData2, aData3 are additional data, see event description on what they do in each event
|
||||
function HandleAdditionalDialogue(sSectorX, sSectorY, bSectorZ, ubProfile, iFaceIndex, usEventNr, aData1, aData2, aData3 )
|
||||
|
||||
end
|
||||
|
||||
-- Look up voicelines in Dialogue Control.h, only listing notable ones often used here
|
||||
Voiceline =
|
||||
{
|
||||
QUOTE_SEE_ENEMY = 0,
|
||||
QUOTE_KILLED_AN_ENEMY = 27,
|
||||
|
||||
-- these three lines are played at random when we talk to one of our mercs. Despite the name they don't have any special meaning
|
||||
QUOTE_NEGATIVE_COMPANY = 41,
|
||||
QUOTE_SOCIAL_TRAIT = 44,
|
||||
QUOTE_PASSING_DISLIKE = 45,
|
||||
|
||||
QUOTE_ENEMY_PRESENCE = 59,
|
||||
QUOTE_WARNING_OUTSTANDING_ENEMY_AFTER_RT = 60,
|
||||
QUOTE_SECTOR_SAFE = 65,
|
||||
}
|
||||
|
||||
-- This function is used to replace dialogue quotes with new ones. This way we can have more variety - a merc doesn't always use the same lines when something happens.
|
||||
-- If a line isn't replaced, it plays normally, so it is a good idea to not always replace lines.
|
||||
--
|
||||
-- functions used here:
|
||||
-- path: path and name of soundfile we want to play (in .wav, .ogg or .mp3 format)
|
||||
-- text: "Text that should appear"
|
||||
-- SetReplaceDialogue(path, text)
|
||||
-- Do not use this function in any lua calls outside of HandleReplaceQuote(..)!
|
||||
--
|
||||
-- handle
|
||||
-- ubProfile is the merc for whom this is called
|
||||
-- usQuoteNum is the quote that the game wants to play
|
||||
function HandleReplaceQuote( ubProfile, usQuoteNum )
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user