Added interactive actions example: cooking a steak

git-svn-id: https://ja2svn.mooo.com/source/ja2_v1.13_data@2598 4f8fa57e-7814-0410-bad4-adc449f26b7c
This commit is contained in:
Flugente
2021-07-08 19:33:03 +00:00
parent bb5be64169
commit 5d4daff92e
3 changed files with 27 additions and 0 deletions
+18
View File
@@ -596,6 +596,7 @@ InteractiveAction =
PICTURE_DELIVERY = 63, -- 2-tile Poster: 'Delivery'
PICTURE_GENERALSTORE = 64, -- 2-tile Poster: 'General Store'
PICTURE_SHADYLADY = 65, -- 2-tile Poster: 'Shady Lady'
COOK_COWMEAT_TO_STEAK = 66, -- take cow meat from merc, add steak to merc
}
-- We have an array of 1000 signed integers that a modder can use to set whatever data he wants.
@@ -1744,6 +1745,23 @@ function HandleInteractiveActionResult(sSectorX, sSectorY, bSectorZ, sGridNo, bL
elseif ( sLuaactionid == InteractiveAction.PICTURE_SHADYLADY ) then
DisplayPictureTactical("Interface\\shady_lady.png", 0)
elseif ( sLuaactionid == InteractiveAction.COOK_COWMEAT_TO_STEAK ) then
-- 1565 cow meat
-- 1559 Steak
if ( HasItemInInventory(ubID, 1565) ) then
CreateItemInvOrFloor(ubID, 1559)
DestroyOneItemInInventory(ubID, 1565)
PlaySound("Sounds\\cooking.wav")
SetScreenMsg(FontColour.FONT_MCOLOR_DKWHITE, "Cooked a steak.")
end
end
@@ -1178,6 +1178,15 @@
<sActionType>6</sActionType>
<luaactionid>65</luaactionid>
</ACTION>
<!-- oven -->
<ACTION>
<szTileSetName>furn_6.sti</szTileSetName>
<usTileIndex>22</usTileIndex>
<usTileIndex>23</usTileIndex>
<sActionType>6</sActionType>
<luaactionid>66</luaactionid>
</ACTION>
<!-- |||||||||||||||||||| VARIOUS |||||||||||||||||||| -->
</INTERACTIVEACTIONS>
Binary file not shown.