From 68c1de68c76d65f7b1b65d89808140a79a61140f Mon Sep 17 00:00:00 2001 From: Flugente Date: Wed, 28 Feb 2018 20:33:00 +0000 Subject: [PATCH] Additional dialogue can be used for consuming specific items git-svn-id: https://ja2svn.mooo.com/source/ja2_v1.13_data@2408 4f8fa57e-7814-0410-bad4-adc449f26b7c --- gamedir/Data-1.13/Scripts/Overhead.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gamedir/Data-1.13/Scripts/Overhead.lua b/gamedir/Data-1.13/Scripts/Overhead.lua index ccc0f998d..7af161134 100644 --- a/gamedir/Data-1.13/Scripts/Overhead.lua +++ b/gamedir/Data-1.13/Scripts/Overhead.lua @@ -1626,7 +1626,7 @@ function AddArmsDealerAdditionalIntelData() -- price is affected by player progress - on higher progress items get cheaper (as they are less useful at that point) progress = CurrentPlayerProgressPercentage() - ratio = (200 - progress) / 100.0 + ratio = (200.0 - progress) / 100.0 -- black market: -- guns @@ -1687,7 +1687,7 @@ function AddArmsDealerAdditionalIntelData() AddArmsDealerAdditionalIntelDataItem(68, 1025, 20 * ratio, 2) -- NVG Gen IV -- Misc - AddArmsDealerAdditionalIntelDataItem(68, 216, 10 * ratio, 3) -- Compound 18 + AddArmsDealerAdditionalIntelDataItem(68, 216, 6 * ratio, 3) -- Compound 18 AddArmsDealerAdditionalIntelDataItem(68, 235, 2 * ratio, 4) -- Regeneration Booster AddArmsDealerAdditionalIntelDataItem(68, 324, 50 * ratio, 1) -- X-Ray Detector AddArmsDealerAdditionalIntelDataItem(68, 327, 11 * ratio, 2) -- Tank of gas @@ -1707,6 +1707,12 @@ function SetPhotoState( aIndex, aState ) end 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 ) if ( usTargetProfile ~= NO_PROFILE ) then @@ -2780,6 +2786,7 @@ DialogueActionEvent = ADE_WEATHERCHANGE = 12, -- the weather has changed in the current sector, and we can warn the player about that, aData1 is 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 + ADE_CONSUMEITEM = 15, -- we applied an item to us, aData1 is the item index } -- functions used here: @@ -2802,4 +2809,4 @@ DialogueActionEvent = -- 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 +end