Skip to content

Trade the seasonal NPC exchanges their dialogs state - #3864

Merged
erwan-joly merged 1 commit into
masterfrom
events/3376-seasonal-exchanges
Nov 29, 2026
Merged

erwan-joly merged 1 commit into
masterfrom
events/3376-seasonal-exchanges

Conversation

@erwan-joly

Copy link
Copy Markdown
Collaborator

Part of #3376

Wires the seasonal NPC exchanges where the client's npctalk.dat dialog lines and Item.dat descriptions state both sides of the trade. It uses the NpcExchanges table from #3766 and #3779. Values come from the current client archive (NSgtdData.NOS). None of these n_runs appear in the stored packet traces.

Exchanges

n_run Dialog (speaker) Takes Gives What the client says
34 OldExchangeForChristmasGiftBox 28 Christmas (Santa) 5 Christmas Stocking 1367, 5 Falling Star 1368, 5 Jingle Bell 1369 Winter Event Gift Box 1370 "If you give me 5 Christmas Stockings, 5 Falling Stars and 5 Jingle Bells, I'll give you a Winter Event Gift Box."
35 OldExchangeForChristmasSnowmanRaidSeal 28 Christmas (Santa) 8 of each of the three Raid Seal of Snowman 1371 "If you give me 8 Christmas Stockings, 8 Falling Stars and 8 Jingle Bells, I'll give you a Raid Seal of Snowman."
40 ExchangeForEasterEggFairy 6 Alchemy Association (Malcolm Mix) Soul of Easter 1410 and one each of Red 1406, Blue 1407, Yellow 1409 and White 1408 Easter Egg Egg Fairy 538 "bring me the Soul of Easter and 4 Easter Eggs, one each in Red, Blue, Yellow and White... I'll give you an Egg Fairy"
41 ExchangeForEasterGrasslinSeal 9 NosVille Market (Eva Energy) 3 Rice 1233, 3 Chicken Drumstick 1230, 3 Bamboo 1231 and 20000 gold Raid Seal of Grasslin 1234 "Bring me three lots of Rice, Chicken Drumsticks and Bamboo, plus 20000 Gold, and I'll give you a raid seal." The three items' descriptions say they "can also be exchanged for a Grasslin Seal from Eva Energy".
46 ExchangeForRedMagicalFairy 6 (Malcolm Mix) 20 Red Mooncake 1300 Red Magical Fairy 920 "If you bring me 20 Red Mooncakes, I will give you the Red Magical Fairy."
47 ExchangeForHalloweenBox 6 Malcolm Mix / 9 Eva Energy / 10 Soraya Style 10 Pumpkin 2314 Malcolm's 1539 / Eva's 1540 / Soraya's 1541 Halloween Box Each NPC promises their own box ("mighty potions, protection scrolls", "a health potion", "Cellons or other cute items"), and these match the three boxes' descriptions. The Pumpkin's description says: "If you give it to Malcolm, Eva or Soraya, they will give you something great in exchange."
49 ExchangeForThanksgivingGiftBox 6 (Malcolm Mix) 5 Potato Monster Seedling 5038 Thanksgiving Gift Box 5040 "collect 5x Monster Potato Seedlings, the village of NosVille will show you their gratitude with a present" (seedling description: "take them to Malcolm Mix to receive a Thanksgiving Gift Box")
76 ExchangeForJackOLanternSealPlusHalloweenBlessing 464 Eric 1 Bag of Sweets (Event) 1917 Raid Seal of Jack O'Lantern 1916 and the Halloween Blessing buff (card 375) "If you bring me a Bag of Sweets, I'll swap them for the Raid Seal of Jack O'Lantern. Plus I'll also give you the Halloween Blessing."
84 / 85 443 Santa Claus, Exchange Cakes 30 Fresh Cream Cake 2327 / 30 Chocolate Cake 2326 Sealed Christmas Vessel 5064 The button texts, e.g. "I want to exchange 30 Fresh Cream Cakes for a Sealed Christmas Vessel."
86 / 87 443 Santa Claus 30 Fresh Cream Cake / 30 Chocolate Cake Raid Seal of Snowman 1371 The button texts
6001 OldExchangeForChristmasReindeerAntlers 443 Santa Claus 3 Rudolph's Antlers 1576 Santa's Big Gift Box 1578 "If you bring me 3 Antlers, I'll give you a Big Gift Box containing a Cake, a Christmas Decoration or a Christmas Costume (7 Days)." 1578 is the only box with that content ("Christmas jewellery, cake and Santa costume (7 days)"). 1577 holds the 1-day costume and 1579 the 30-day one.

84 to 87 are not listed in #3376, but they are the same kind of seasonal exchange on Santa's dialog, and master did not handle them either.

Item.dat has two Egg Fairy entries. 538 is the standard fairy. 8067 has the same fairy index but sits in the limited-item range (index 8, extra flags), like 8023 for the Grasslin Fairy.

What changed

  • NpcExchange has three new optional columns (migration AddNpcExchangeDialogGoldAndBuff):
    • Dialog: a row that names a dialog is only given by an NPC with that dialog. n_run 47 uses it so each of the three NPCs hands out their own box.
    • Gold: gold taken along with the materials. If the player has too little, the existing sayi NotEnoughGold is sent and nothing is taken. On success the gold is removed and a gold packet is sent.
    • CardId: a buff cast on the player after the item is given, through IBuffService.ApplyAsync. Its duration comes from the card.
  • NpcExchangeService applies the three columns. As before, the NPC's dialog must offer the runner.
  • One NpcExchangeHandler subclass per runner, following the existing pattern.
  • The parser has to be re-run before the new rows take effect.

Left for later (data does not settle them)

n_run Why
31 (5, 7, 8, 9, 12) An old generic exchange. Its sections are not linked from any NPC's start page. 31 8 and 31 7 repeat the Red Magical Fairy and Grasslin seal texts, which are now handled through 46 and 41. 31 5 is Mimi placeholder text, and 31 9 and 31 12 state no items.
32 Exchange Airwaves Dr. W Event dialog 27 has buttons only and gives no amounts
36, 37, 38 (anniversary) The texts ask for "the word NOSYEARS plus the number 19". Item.dat only has NOSYEARS (Event) 13441 and no "19". 36 is once per account, 37 once per day and refills SP, and the buff card for 38 is unnamed.
1503 Trick or Treat 1503 is a disabled &@ button on the shop NPCs. Its reward and the costume condition are not stated.
1504 Exchange Bag of Sweets (Benito Butler) Disabled button. The dialog only says "I'll reward you", with no reward.
6000 Exchange Christmas Stockings, 6002 Exchange Christmas Vouchers Disabled buttons that state nothing
6015 Producing a Bell "20 Jingle Bells and 20 Falling Stars" gives "randomly one of three different bells" (Golden 1125, Silver 1126, Bronze 1144), and the odds are not given anywhere
6016 Get your Christmas Gift Box (10 Jingle Bells + 10 Falling Stars), 88 (5 Christmas Stockings) Item.dat has several "Christmas Gift Box" items with the same description (5065, 5206, 5307), so the one given is not settled
149 View Mini-game Schedule Opens a window, not an exchange. The packet is unknown.

A packet trace of any of these buttons on the official server would settle them.

Tests

  • NpcExchangeServiceTests:
    • Malcolm and Eva each give their own Halloween Box for the same 10 pumpkins.
    • The Grasslin seal takes 20000 gold with the rice. With 19999 gold, everything is kept and NotEnoughGold is said.
    • A Bag of Sweets gives the raid seal and casts the Halloween Blessing once. Without the bag, no buff is cast.
  • NpcExchangeParserTests: every new row is written with its materials, gold, dialog and card.
  • MigrationTests.EveryModelChangeHasItsMigration passes.
  • Locally, NosCore.GameObject.Tests (3496), NosCore.Parser.Tests (482), NosCore.PacketHandlers.Tests (1154) and NosCore.Database.Tests (16) all pass.

Manual test plan (added under "NPC exchanges")

  • Eric, Exchange Bags of Sweets: one Bag of Sweets (Event) becomes a Raid Seal of Jack O'Lantern and the Halloween Blessing buff shows
  • Dialogs 6, 9 and 10, I'll retrieve your Pumpkins: 10 Pumpkins become Malcolm's, Eva's or Soraya's Halloween Box
  • Malcolm Mix: Red Mooncakes for the Red Magical Fairy, seedlings for the Thanksgiving Gift Box, the Easter soul and eggs for the Egg Fairy
  • Eva Energy, Exchange for Seal: 3 of each item plus 20000 gold make the Grasslin seal. With 19999 gold the player gets "Not enough gold".
  • Santa Claus: the four cake buttons, and 3 Rudolph's Antlers for Santa's Big Gift Box
  • Dialog 28: the Winter Event Gift Box (5 of each) and the Raid Seal of Snowman (8 of each)

Verification

Only unit tests have checked this so far. It has not been tried in the client.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5b6dd06 and 3270588.

Files ignored due to path filters: 1

  • src/NosCore.Database/Migrations/20261129091909_AddNpcExchangeDialogGoldAndBuff.Designer.cs is excluded by !**/*.Designer.cs
Files selected for processing: 22

  • documentation/manual-test-plan.md
  • src/NosCore.Database/Entities/NpcExchange.cs
  • src/NosCore.Database/Migrations/20261129091909_AddNpcExchangeDialogGoldAndBuff.cs
  • src/NosCore.Database/Migrations/NosCoreContextModelSnapshot.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangeBagOfSweetsForJackOLanternSealHandler.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangeChocolateCakesForSealedChristmasVesselHandler.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangeChocolateCakesForSnowmanRaidSealHandler.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangeForEggFairyHandler.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangeForGrasslinRaidSealHandler.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangeForRedMagicalFairyHandler.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangeForSnowmanRaidSealHandler.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangeForThanksgivingGiftBoxHandler.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangeForWinterEventGiftBoxHandler.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangeFreshCreamCakesForSealedChristmasVesselHandler.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangeFreshCreamCakesForSnowmanRaidSealHandler.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangePumpkinsForHalloweenBoxHandler.cs
  • src/NosCore.GameObject/Messaging/Handlers/Nrun/ExchangeRudolphsAntlersForBigGiftBoxHandler.cs
  • src/NosCore.GameObject/Services/NpcExchangeService/NpcExchangeService.cs
  • src/NosCore.Parser/Parsers/NpcExchangeParser.cs
  • src/NosCore.Parser/Parsers/NpcExchanges.cs
  • test/NosCore.GameObject.Tests/Services/NpcExchangeService/NpcExchangeServiceTests.cs
  • test/NosCore.Parser.Tests/NpcExchangeParserTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Rebased on master and regenerated the AddNpcExchangeDialogGoldAndBuff migration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUfJ46iekh4rbiCyoTamtn
@erwan-joly
erwan-joly force-pushed the events/3376-seasonal-exchanges branch from 327915b to 3270588 Compare November 29, 2026 09:49
@erwan-joly
erwan-joly merged commit 441d2fb into master Nov 29, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants