Site Tools


tutorial:esd-add-menu-reward

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:esd-add-menu-reward [2026/06/20 22:46] – added example jenovavirustutorial:esd-add-menu-reward [2026/06/20 23:27] (current) – and another one jenovavirus
Line 210: Line 210:
  
 ===== Example: adding an extra menu and item trade/reward system ===== ===== Example: adding an extra menu and item trade/reward system =====
- 
-We will add: 
-  - a talk option 
-  - a text menu there 
-  - an exchange system (take an item from the player and award an item) 
  
  
Line 223: Line 218:
  
 Add the following "Event" text entries: \\  Add the following "Event" text entries: \\ 
-15000630: "No Firebomb in inventory" \\  +15000610: "Trade Firebomb for 20x Throwing Knife" \\  
-15000640: "3x Large Titanite Shards not in inventory" \\ +15000620: "Trade 3x Large Titanite Shard for Ember" \\  
 +15001610: "No Firebomb in inventory" \\  
 +15001620: "3x Large Titanite Shards not in inventory" \\ 
  
 +
 +We will add:
 +  - a talk option
 +  - a text menu there
 +  - an exchange system (take an item from the player and award an item)
  
 For the menu we add the new talk option: \\  For the menu we add the new talk option: \\ 
Line 267: Line 269:
         AddTalkListData(99, 15000005, -1)         AddTalkListData(99, 15000005, -1)
         ShowShopMessage(TalkOptionsType.Regular)         ShowShopMessage(TalkOptionsType.Regular)
-        # trade +        # Trade Firebomb for 20x Throwing Knife
         if GetTalkListEntryResult() == 1:         if GetTalkListEntryResult() == 1:
             assert (t320000_x12(lot1=lot1, goods2=goods2, goods3=goods3))             assert (t320000_x12(lot1=lot1, goods2=goods2, goods3=goods3))
-        # +        # Trade 3x Large Titanite Shard for Ember
         elif GetTalkListEntryResult() == 2:         elif GetTalkListEntryResult() == 2:
             assert (t320000_x12(lot1=lot2, goods2=goods2, goods3=goods3))             assert (t320000_x12(lot1=lot2, goods2=goods2, goods3=goods3))
Line 307: Line 309:
         call = t320000_x13(goods2=goods2, goods3=goods3, z1=goods2)         call = t320000_x13(goods2=goods2, goods3=goods3, z1=goods2)
         if call.Get() == 0:         if call.Get() == 0:
-            PlayerEquipmentQuantityChange(ItemType.Goods, goods2, -3)+            PlayerEquipmentQuantityChange(ItemType.Goods, goods2, -1)
             assert t320000_x14(lot1=lot1)             assert t320000_x14(lot1=lot1)
         elif call.Get() == 1:         elif call.Get() == 1:
-            assert t320000_x15(action4=15000630)+            assert t320000_x15(action4=15001610)
     elif lot1 == 3200930:     elif lot1 == 3200930:
         call = t320000_x13(goods2=goods2, goods3=goods3, z1=goods3)         call = t320000_x13(goods2=goods2, goods3=goods3, z1=goods3)
         if call.Get() == 0:         if call.Get() == 0:
-            PlayerEquipmentQuantityChange(ItemType.Goods, goods3, -1)+            PlayerEquipmentQuantityChange(ItemType.Goods, goods3, -3)
             assert t320000_x14(lot1=lot2)             assert t320000_x14(lot1=lot2)
         elif call.Get() == 1:         elif call.Get() == 1:
-            assert t320000_x15(action4=15000640)+            assert t320000_x15(action4=15001620)
     else:     else:
         pass         pass
Line 333: Line 335:
 def t320000_x13(goods2=_, goods3=_, z1=_): def t320000_x13(goods2=_, goods3=_, z1=_):
     if z1 == goods2:     if z1 == goods2:
-        if ComparePlayerInventoryNumber(ItemType.Goods, goods2, CompareType.GreaterOrEqual3, False):+        if ComparePlayerInventoryNumber(ItemType.Goods, goods2, CompareType.Greater0, False):
             return 0             return 0
         else:         else:
             return 1             return 1
     elif z1 == goods3:     elif z1 == goods3:
-        if ComparePlayerInventoryNumber(ItemType.Goods, goods3, CompareType.Greater0, False):+        if ComparePlayerInventoryNumber(ItemType.Goods, goods3, CompareType.GreaterOrEqual3, False):
             return 0             return 0
         else:         else:
Line 349: Line 351:
  
 <code Python> <code Python>
-def t320000_x14(goods2=_, goods3=_, z1=_):+def t320000_x14(lot1=_):
     GetItemFromItemLot(lot1)     GetItemFromItemLot(lot1)
     assert not IsMenuOpen(63) and GetCurrentStateElapsedFrames() > 1     assert not IsMenuOpen(63) and GetCurrentStateElapsedFrames() > 1
tutorial/esd-add-menu-reward.1781992012.txt.gz · Last modified: by jenovavirus