瀏覽代碼

Updated cash mall npc and added mesitemicon script command (#8929)

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
Atemo 3 月之前
父節點
當前提交
588395b783

+ 9 - 0
conf/battle/feature.conf

@@ -165,6 +165,15 @@ feature.mesitemlink_brackets: no
 // Default: no
 feature.mesitemlink_dbname: no
 
+// Itemlink Icons on NPC messages (Note 1)
+// Generates an itemicon string for an item and can be used for NPC's mes command.
+// Requires: 2023-03-02 or later
+feature.mesitemicon: on
+
+// Force all mesitemicons to use the database name, if mesitemicon feature is disabled (Note 1)
+// Default: no
+feature.mesitemicon_dbname: no
+
 // Stylist UI (Note 1)
 // Requires: 2015-11-04 or later
 feature.stylist: on

+ 4 - 4
db/re/item_db_etc.yml

@@ -92053,25 +92053,25 @@ Body:
       BuyingStore: true
       DropEffect: CLIENT
   - Id: 1001581
-    AegisName: aegis_1001581
+    AegisName: Coupon_GoodnEvil_Helm
     Name: Crown of Good and Evil Coupon
     Type: Etc
     Flags:
       BuyingStore: true
   - Id: 1001583
-    AegisName: aegis_1001583
+    AegisName: Coupon_FateSinBoots
     Name: Boots of Good and Evil Coupon
     Type: Etc
     Flags:
       BuyingStore: true
   - Id: 1001584
-    AegisName: aegis_1001584
+    AegisName: Coupon_Justice_Weapon
     Name: Good Weapon Coupon
     Type: Etc
     Flags:
       BuyingStore: true
   - Id: 1001588
-    AegisName: aegis_1001588
+    AegisName: Coupon_Injustice_Weapon
     Name: Evil Weapon Coupon
     Type: Etc
     Flags:

+ 20 - 0
doc/script_commands.txt

@@ -1188,6 +1188,11 @@ The following sample will open a preview window for Red Potion:
 
 NOTE: Be aware that item links are broken in some 2015 clients.
 
+In 2023 the syntax ^i[Item ID] was introduced to display an item icon inside a NPC dialog.
+We created a script command "mesitemicon" that allows you to create the correct syntax
+depending on your configured packet version. We recommend that you use this script command
+instead of hardcoding the other syntax. For more details see the documentation for "mesitemicon".
+
 URLs
 ----
 Similarly, you can create links to websites that launch in a new window:
@@ -11208,6 +11213,21 @@ Examples:
 	mes "Bring me a " + mesitemlink( 1201, false ) + "."; // Will display "Bring me a Knife." and "Knife" will be clickable.
 	mes "Bring me a " + mesitemlink( 1201, true, "Super cutting knife" ) + "."; // Will display "Bring me a [Super cutting knife]." and "[Super cutting knife]" will be clickable.
 
+---------------------------------------
+
+*mesitemicon(<item_id>{,<display_name>});
+
+Generates an itemicon string for an item and can be used with NPC's mes command.
+The NPC message will show the item's icon which will be clickable and opens the
+item description client side.
+
+If the feature is disabled, by default the database name of the item will be used.
+However if you provide a <display_name>, this name will be displayed instead.
+
+Examples:
+
+	mes mesitemicon( 1201 ); // Will display a Knife icon and will be clickable. If clicked it opens the description for Knife [3]
+
 ========================
 |14.- Channel commands.|
 ========================

+ 722 - 0
npc/re/merchants/barters/cashmall.yml

@@ -1037,3 +1037,725 @@ Body:
           - Index: 0
             Item: Cachua_Coupon
             Amount: 10
+  - Name: barter_mall_coupon_1
+    Items:
+      - Index: 0
+        Item: FateSin_Boots_CD
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 1
+        Item: FateSin_Boots_IQ
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 2
+        Item: FateSin_Boots_SOA
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 3
+        Item: FateSin_Boots_BO
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 4
+        Item: FateSin_Boots_DK
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 5
+        Item: FateSin_Boots_SH
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 6
+        Item: FateSin_Boots_EM
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 7
+        Item: FateSin_Boots_WH
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 8
+        Item: FateSin_Boots_SKE
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 9
+        Item: FateSin_Boots_IG
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 10
+        Item: FateSin_Boots_AG
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 11
+        Item: FateSin_Boots_NW
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 12
+        Item: FateSin_Boots_MT
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 13
+        Item: FateSin_Boots_SHC
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 14
+        Item: FateSin_Boots_SS
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 15
+        Item: FateSin_Boots_ABC
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 16
+        Item: FateSin_Boots_TR
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+      - Index: 17
+        Item: FateSin_Boots_HN
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_FateSinBoots
+  - Name: barter_mall_coupon_2
+    Items:
+      - Index: 0
+        Item: GoodnEvil_Circlet_DK
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 1
+        Item: GoodnEvil_Circlet_IG
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 2
+        Item: GoodnEvil_Circlet_AG
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 3
+        Item: GoodnEvil_Circlet_EM
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 4
+        Item: GoodnEvil_Circlet_CD
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 5
+        Item: GoodnEvil_Circlet_IQ
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 6
+        Item: GoodnEvil_Circlet_MT
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 7
+        Item: GoodnEvil_Circlet_BO
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 8
+        Item: GoodnEvil_Circlet_SHC
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 9
+        Item: GoodnEvil_Circlet_ABC
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 10
+        Item: GoodnEvil_Circlet_WH
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 11
+        Item: GoodnEvil_Circlet_TR
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 12
+        Item: GoodnEvil_Circlet_SS
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 13
+        Item: GoodnEvil_Circlet_SKE
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 14
+        Item: GoodnEvil_Circlet_SOA
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 15
+        Item: GoodnEvil_Circlet_HN
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 16
+        Item: GoodnEvil_Circlet_SH
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 17
+        Item: GoodnEvil_Circlet_NW
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 18
+        Item: GoodnEvil_Circlet_NW2
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 19
+        Item: GoodnEvil_Circlet_NW3
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 20
+        Item: GoodnEvil_Circlet_NW4
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+      - Index: 21
+        Item: GoodnEvil_Circlet_NW5
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_GoodnEvil_Helm
+  - Name: barter_mall_coupon_3
+    Items:
+      - Index: 0
+        Item: Punish_Hall
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 1
+        Item: Saint_Bringer
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 2
+        Item: Humma_Brilliance
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 3
+        Item: Luppiter_Spear
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 4
+        Item: Holy_Raise_Spear
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 5
+        Item: Lightforce_Foxtail_Wand
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 6
+        Item: Shining_Light_Katar
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 7
+        Item: Angel_Wing_Bow
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 8
+        Item: Guardian_Saber
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 9
+        Item: Holy_Light_Dagger
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 10
+        Item: Light_Power_Harp
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 11
+        Item: Light_Power_Spark
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 12
+        Item: Lighting_Splatter
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 13
+        Item: Justice_Bomber
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 14
+        Item: Last_Dawn
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 15
+        Item: Devil_Hunter
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 16
+        Item: Road_Of_Glory
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 17
+        Item: Victory_Sword
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 18
+        Item: Divine_Buster
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 19
+        Item: Orign_Of_Life
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 20
+        Item: Destiny_Staff
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 21
+        Item: Blessed_Bible
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+      - Index: 22
+        Item: Soul_Liberator
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Justice_Weapon
+  - Name: barter_mall_coupon_4
+    Items:
+      - Index: 0
+        Item: Demonic_Claw
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 1
+        Item: Sealed_Bible
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 2
+        Item: Darkness_Tablet
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 3
+        Item: Devil_Wing_Staff
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 4
+        Item: Doom_Bible
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 5
+        Item: Soul_Harvest
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 6
+        Item: The_Reaper
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 7
+        Item: Underworld_Knife
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 8
+        Item: Devil_Cursed_Sword
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 9
+        Item: Dark_Angel_Ray_Bow
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 10
+        Item: Crime_Violine
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 11
+        Item: Crime_Whip
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 12
+        Item: RG_5649
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 13
+        Item: Devil_L_Launcher
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 14
+        Item: Screaming_Rifle
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 15
+        Item: Devils_Bullet
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 16
+        Item: Outlaw_Cursed_Shotgun
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 17
+        Item: Blood_Rapier
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 18
+        Item: Destruction_Axe
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 19
+        Item: Devil_Claw
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 20
+        Item: Execution_Great_Sword
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 21
+        Item: Devil_Guardian_Sword
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+      - Index: 22
+        Item: Darkness_Foxtail_Model
+        RequiredItems:
+          - Index: 0
+            Item: Coupon_Injustice_Weapon
+  - Name: barter_mall_coupon_5
+    Items:
+      - Index: 0
+        Item: StormBow_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 1
+        Item: TornadoBow_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 2
+        Item: SaintBook_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 3
+        Item: SaintWand_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 4
+        Item: SunBook_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 5
+        Item: MoonBook_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 6
+        Item: Slayer_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 7
+        Item: Trident_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 8
+        Item: Demonius_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 9
+        Item: Demonsword_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 10
+        Item: Foxtail_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 11
+        Item: Setaria_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 12
+        Item: OverSpear_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 13
+        Item: aegis_103033
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 14
+        Item: Impact_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 15
+        Item: aegis_103034
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 16
+        Item: Humma_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 17
+        Item: WheelHumma_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 18
+        Item: GiganticAxe_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 19
+        Item: Hammer_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 20
+        Item: MasterSpellBook_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 21
+        Item: Grimoire_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 22
+        Item: Soul_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 23
+        Item: SpiritStick_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 24
+        Item: MetalVilolin_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 25
+        Item: MetalWhip_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 26
+        Item: Harp_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 27
+        Item: Whip_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 28
+        Item: Lapier_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 29
+        Item: SharpSword_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 30
+        Item: Stick_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 31
+        Item: WhiteSword_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 32
+        Item: Flame_Staff_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 33
+        Item: Specter_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 34
+        Item: GaleClaw_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 35
+        Item: Exterminate_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 36
+        Item: Gatling_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+      - Index: 37
+        Item: Rifle_Furious
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001809
+  - Name: barter_mall_coupon_6
+    Items:
+      - Index: 0
+        Item: FuriousCirclet_WH
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 1
+        Item: FuriousCirclet_CD
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 2
+        Item: FuriousCirclet_SKE
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 3
+        Item: FuriousCirclet_DK
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 4
+        Item: FuriousCirclet_ABC
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 5
+        Item: FuriousCirclet_SH
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 6
+        Item: FuriousCirclet_IG
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 7
+        Item: FuriousCirclet_SHC
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 8
+        Item: FuriousCirclet_SS
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 9
+        Item: FuriousCirclet_MT
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 10
+        Item: FuriousCirclet_EM
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 11
+        Item: FuriousCirclet_SOA
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 12
+        Item: FuriousCirclet_TR
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 13
+        Item: FuriousCirclet_BO
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 14
+        Item: FuriousCirclet_HN
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 15
+        Item: FuriousCirclet_AG
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 16
+        Item: FuriousCirclet_IQ
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810
+      - Index: 17
+        Item: FuriousCirclet_NW
+        RequiredItems:
+          - Index: 0
+            Item: aegis_1001810

+ 52 - 0
npc/re/merchants/cashmall.txt

@@ -4,6 +4,7 @@
 //= 1.0 Initial version from replays. [Lemongrass]
 //= 1.1 Cash Hair Stylist [Kisuka]
 //= 1.2 Updated Hair Stylist [Lemongrass]
+//= 1.3 Added an NPC to exchange coupons for Good, Evil or Wrath equipment. [Atemo]
 //============================================================
 
 prontera,137,125,4	script	Cash Sales Guide#prontera::cashmall_warper	4_M_HUMAN_02,{
@@ -329,3 +330,54 @@ itemmall,19,74,5	script	Stylist#cash	91,{
 	mes "to see you again. Take care!";
 	close;
 }
+
+itemmall,41,55,3	script	Cat Hand Salesman Tunkarom	4_M_MERCAT1,{
+	mes "[Tunkarom]";
+	mes "Welcome!";
+	mes "If you have a special coupon, we'll exchange it for the product you want!";
+	mes "These are the exchangeable coupons:";
+	mes mesitemicon(1001583) + " " + mesitemicon(1001581) + " " + mesitemicon(1001584) + " " + mesitemicon(1001588) + " " + mesitemicon(1001809) + " " + mesitemicon(1001810);
+	next;
+	switch( select( "Exchange Good and Evil Boots", "Exchange Good and Evil Crown", "Exchange Good Weapons", "Exchange Evil Weapons", "Exchange Wrath Weapons", "Exchange Wrath Crown", "Cancel" ) ) {
+	case 1:
+		mes "[Tunkarom]";
+		mes "This is an exchange of Good and Evil Boots. What a good choice~!";
+		close2;
+		callshop( "barter_mall_coupon_1" );
+		end;
+	case 2:
+		mes "[Tunkarom]";
+		mes "This is an exchange of Good and Evil Crown. What a great choice~!";
+		close2;
+		callshop( "barter_mall_coupon_2" );
+		end;
+	case 3:
+		mes "[Tunkarom]";
+		mes "This is an exchange of Good Weapons. What a great choice~!";
+		close2;
+		callshop( "barter_mall_coupon_3" );
+		end;
+	case 4:
+		mes "[Tunkarom]";
+		mes "This is an exchange of Evil Weapons. What a great choice~!";
+		close2;
+		callshop( "barter_mall_coupon_4" );
+		end;
+	case 5:
+		mes "[Tunkarom]";
+		mes "This is an exchange of Wrath Weapons. What a great choice~!";
+		close2;
+		callshop( "barter_mall_coupon_5" );
+		end;
+	case 6:
+		mes "[Tunkarom]";
+		mes "This is an exchange of Wrath Crowns. What a great choice~!";
+		close2;
+		callshop( "barter_mall_coupon_6" );
+		end;
+	case 7:
+		mes "[Tunkarom]";
+		mes "Can't find what you're looking for? Come back next time.";
+		close;
+	}
+}

+ 11 - 0
src/map/battle.cpp

@@ -11901,6 +11901,8 @@ static const struct _battle_data {
 	{ "feature.mesitemlink",                &battle_config.feature_mesitemlink,             1,      0,      1,              },
 	{ "feature.mesitemlink_brackets",       &battle_config.feature_mesitemlink_brackets,    0,      0,      1,              },
 	{ "feature.mesitemlink_dbname",         &battle_config.feature_mesitemlink_dbname,      0,      0,      1,              },
+	{ "feature.mesitemicon",                &battle_config.feature_mesitemicon,             1,      0,      1,              },
+	{ "feature.mesitemicon_dbname",         &battle_config.feature_mesitemicon_dbname,      0,      0,      1,              },
 	{ "break_mob_equip",                    &battle_config.break_mob_equip,                 0,      0,      1,              },
 	{ "macro_detection_retry",              &battle_config.macro_detection_retry,           3,      1,      INT_MAX,        },
 	{ "macro_detection_timeout",            &battle_config.macro_detection_timeout,         60000,  0,      INT_MAX,        },
@@ -12158,6 +12160,15 @@ void battle_adjust_conf()
 	}
 #endif
 
+#if PACKETVER < 20230302
+	if( battle_config.feature_mesitemicon ){
+#if !defined(BUILDBOT)
+		ShowWarning( "conf/battle/feature.conf:mesitemicon is enabled but it requires PACKETVER 2023-03-02 or newer, disabling...\n" );
+#endif
+		battle_config.feature_mesitemicon = 0;
+	}
+#endif
+
 #ifndef CELL_NOSTACK
 	if (battle_config.custom_cell_stack_limit != 1)
 		ShowWarning("Battle setting 'custom_cell_stack_limit' takes no effect as this server was compiled without Cell Stack Limit support.\n");

+ 2 - 0
src/map/battle.hpp

@@ -589,6 +589,8 @@ struct Battle_Config
 	int32 feature_mesitemlink;
 	int32 feature_mesitemlink_brackets;
 	int32 feature_mesitemlink_dbname;
+	int32 feature_mesitemicon;
+	int32 feature_mesitemicon_dbname;
 
 	// autotrade persistency
 	int32 feature_autotrade;

+ 28 - 0
src/map/itemdb.cpp

@@ -1447,6 +1447,34 @@ std::string ItemDatabase::create_item_link_for_mes( std::shared_ptr<item_data>&
 	}
 }
 
+std::string ItemDatabase::create_item_icon_for_mes( std::shared_ptr<item_data>& data, const char* name ){
+	if( data == nullptr ){
+		return "Unknown item";
+	}
+
+	// Feature is disabled
+	if( !battle_config.feature_mesitemicon ){
+		if( name != nullptr && !battle_config.feature_mesitemicon_dbname ){
+			// Name was forcefully overwritten
+			return name;
+		}else{
+			// Use database name
+			return data->ename;
+		}
+	}
+
+	const std::string start_tag = "^i[";
+	const std::string closing_tag = "]";
+
+	std::string itemstr;
+
+	itemstr += start_tag;
+	itemstr += std::to_string( data->nameid );
+	itemstr += closing_tag;
+
+	return itemstr;
+}
+
 ItemDatabase item_db;
 
 /**

+ 1 - 0
src/map/itemdb.hpp

@@ -3312,6 +3312,7 @@ public:
 	std::string create_item_link(struct item& item);
 	std::string create_item_link( std::shared_ptr<item_data>& data );
 	std::string create_item_link_for_mes( std::shared_ptr<item_data>& data, bool use_brackets, const char* name );
+	std::string create_item_icon_for_mes( std::shared_ptr<item_data>& data, const char* name );
 };
 
 extern ItemDatabase item_db;

+ 27 - 0
src/map/script.cpp

@@ -27541,6 +27541,31 @@ BUILDIN_FUNC(permission_add)
 	return SCRIPT_CMD_SUCCESS;
 }
 
+BUILDIN_FUNC(mesitemicon){
+	t_itemid nameid = script_getnum( st, 2 );
+	std::shared_ptr<item_data> data = item_db.find( nameid );
+	
+	if( data == nullptr ){
+		ShowError( "buildin_mesitemicon: Item ID %u does not exists.\n", nameid );
+		script_pushconststr( st, "" );
+		return SCRIPT_CMD_FAILURE;
+	}
+
+	const char* name = nullptr;
+
+	if( script_hasdata( st, 3 ) ){
+		name = script_getstr( st, 3 );
+	}
+
+	// Create the link, depending on configuration
+	std::string itemlstr = item_db.create_item_icon_for_mes( data, name );
+
+	// Push it to the script engine for further usage
+	script_pushstrcopy( st, itemlstr.c_str() );
+
+	return SCRIPT_CMD_SUCCESS;
+}
+
 #include <custom/script.inc>
 
 // declarations that were supposed to be exported from npc_chat.cpp
@@ -28312,6 +28337,8 @@ struct script_function buildin_func[] = {
 	BUILDIN_DEF(permission_add, "i?"),
 	BUILDIN_DEF2(permission_add, "permission_remove", "i?"),
 
+	BUILDIN_DEF( mesitemicon, "i??" ),
+
 #include <custom/script_def.inc>
 
 	{nullptr,nullptr,nullptr},