This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorial:esd-add-menu-reward [2026/06/20 22:46] – added example jenovavirus | tutorial: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/ | ===== Example: adding an extra menu and item trade/ | ||
| - | |||
| - | 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 " | Add the following " | ||
| - | 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, | AddTalkListData(99, | ||
| ShowShopMessage(TalkOptionsType.Regular) | ShowShopMessage(TalkOptionsType.Regular) | ||
| - | # trade | + | # Trade Firebomb for 20x Throwing Knife |
| if GetTalkListEntryResult() == 1: | if GetTalkListEntryResult() == 1: | ||
| assert (t320000_x12(lot1=lot1, | assert (t320000_x12(lot1=lot1, | ||
| - | # | + | # Trade 3x Large Titanite Shard for Ember |
| elif GetTalkListEntryResult() == 2: | elif GetTalkListEntryResult() == 2: | ||
| assert (t320000_x12(lot1=lot2, | assert (t320000_x12(lot1=lot2, | ||
| Line 307: | Line 309: | ||
| call = t320000_x13(goods2=goods2, | call = t320000_x13(goods2=goods2, | ||
| if call.Get() == 0: | if call.Get() == 0: | ||
| - | PlayerEquipmentQuantityChange(ItemType.Goods, | + | PlayerEquipmentQuantityChange(ItemType.Goods, |
| 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, | call = t320000_x13(goods2=goods2, | ||
| if call.Get() == 0: | if call.Get() == 0: | ||
| - | PlayerEquipmentQuantityChange(ItemType.Goods, | + | PlayerEquipmentQuantityChange(ItemType.Goods, |
| 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=_, | def t320000_x13(goods2=_, | ||
| if z1 == goods2: | if z1 == goods2: | ||
| - | if ComparePlayerInventoryNumber(ItemType.Goods, | + | if ComparePlayerInventoryNumber(ItemType.Goods, |
| return 0 | return 0 | ||
| else: | else: | ||
| return 1 | return 1 | ||
| elif z1 == goods3: | elif z1 == goods3: | ||
| - | if ComparePlayerInventoryNumber(ItemType.Goods, | + | if ComparePlayerInventoryNumber(ItemType.Goods, |
| 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 | ||