Files
2026-06-01 12:46:52 +02:00

123 lines
4.7 KiB
Lua

function cmShop()
local npcId = get_npc_id()
dlg_title("CM Vendor")
if npcId == 11746 then -- HV
dlg_text("Hello " ..surname().. " and welcome to the new Challenge Mark vending network!")
elseif npcId == 11843 then -- Rondo
dlg_text("Its such a beautiful day today! Would you like to see some of my wares?")
elseif npcId == 11844 then -- Laksy
dlg_text("Did you see that ruckus over there? It was crazy! Oh, you just wanna see my junk? Fine.")
elseif npcId == 11845 then -- Katan
dlg_text("I'm telling you! They say iSmokeDrow eloped with a Teletubbie. Huh? My items? Oh, right.")
elseif npcId == 11846 then -- Horizon
dlg_text("Some say I sell items, it has been rumored that I might even take CM in exchange for them, hell those rumors just may be correct.")
end
dlg_menu("I have questions", 'cmQuestions()')
dlg_menu("Character", 'showCMShopList(1)')
dlg_menu("Feathers", 'showCMShopList(2)')
dlg_menu("Others", 'showCMShopList(3)')
dlg_menu("Nevermind", "")
dlg_show()
end
function cmQuestions()
dlg_title("CM Vendor")
dlg_text("Sure I'd be happy to answer your questions, just choose a topic below")
dlg_menu("What is CM?", 'cmQuestion_response(1)')
dlg_menu("What can I buy here?", 'cmQuestion_response(2)')
dlg_menu("Go back", 'cmShop()')
dlg_menu("Nevermind", "")
dlg_show()
end
function cmQuestion_response(qCode)
dlg_title("CM Vendor")
if qCode == 1 then -- What is CM?
dlg_text("CM stands for Challenge Mark, a currency here that you can gain by completing Instanced Dungeons, Secret Dungeons and/or Boss Matching")
dlg_menu("Instanced Dungeons?", 'cmQuestion_response(101)')
dlg_menu("Secret Dungeons?", 'cmQuestion_response(102)')
dlg_menu("Boss Matching?", 'cmQuestion_response(103)')
dlg_menu("Spending CM", 'cmQuestion_response(104)')
elseif qCode == 101 then
dlg_text("Instanced Dungeons are: Vulcanus, Cubrick [aka Labyrinth], Any Underground Dungeon and Circus.")
dlg_menu("Go back", 'cmQuestion_response(1)')
elseif qCode == 102 then
dlg_text("Secret Dungeons are: Secret - Crystal Valley, Palmir Plateau, Sanctuary, Temple of Ancients, Temple of Lost Souls, Temple of Exile")
dlg_menu("Go back", 'cmQuestion_response(1)')
elseif qCode == 103 then
dlg_text("Boss Matching is a new services provided by the Dungeon teleporters, you should give it a try sometime!")
elseif qCode == 104 then -- Spending CM
dlg_text("We are not the only ones who will accept CM as payment, there are several other NPC's like the Hair Stylist and Pet Breeders who also accept CM")
elseif qCode == 2 then
dlg_text("You can buy high demand items and possible [in the future] services. These items include Enhancement Items such as: E-Pro, E-Rep, Strikes/Defenses and more")
end
dlg_menu("Back to Questions", 'cmQuestions()')
dlg_menu("Back to Main", 'cmShop()')
dlg_menu("Nevermind", "")
dlg_show()
end
function showCMShopList(lCode)
dlg_title("CM Vendor")
if lCode == 101 then -- Lak Necklace Upgrades
elseif lCode == 1 then -- Character
dlg_text("Browse our Character based items below.")
dlg_menu("Homonculus Heart 15[CM]", 'purchaseItem(15,601100284,1)')
dlg_menu("Rebirth Scroll 10[CM]", 'purchaseItem(10,920008,1)')
dlg_menu("Growth Potion 5[CM](2pk)", 'purchaseItem(2,900005,5)')
dlg_menu("Super Growth Potion 10[CM](2pk)", 'purchaseItem(10,900014,2)')
dlg_menu("Deva's Blessing Scroll 1[CM]", 'purchaseItem(1,601100231,1)')
elseif lCode == 2 then -- Feathers
dlg_text("Which kind of Feathers are you interested in purchasing?")
dlg_menu("Normal Feathers", 'showCMShopList(201)')
dlg_menu("Secret Feathers", 'showCMShopList(202)')
elseif lCode == 3 then -- Others
dlg_text("Yeah, we have some of these aswell.")
dlg_menu("Transmogrifying Charm 10[CM]", 'purchaseItem(10,601100285,1)')
elseif lCode == 201 then -- Normal
dlg_text("Browse our Normal Feathers below")
dlg_menu("Summon 2[CM](5pk)", 'purchaseItem(2,910007,5)')
dlg_menu("Teleport 4[CM](5pk)", 'purchaseItem(4,910022,5)')
dlg_menu("Return 2[CM](10pk)", 'purchaseItem(2,910006,10)')
dlg_menu("Union 5[CM](5pk)", 'purchaseItem(5,910008,5)')
elseif lCode == 202 then -- Secret
dlg_text("Browse our Secret Feathers below")
dlg_menu("Summon 4[CM](5pk)", 'purchaseItem(4,910081,5)')
dlg_menu("Teleport 8[CM](5pk)", 'purchaseItem(8,910083,5)')
dlg_menu("Return 4[CM](10pk)", 'purchaseItem(4,910080,10)')
dlg_menu("Union 10[CM](5pk)", 'purchaseItem(10,910082,5)')
end
dlg_menu("Go back", 'cmShop()')
dlg_menu("Nevermind", "")
dlg_show()
end
function purchaseItem(cost, itemId, itemAmount)
if validateMarks(cost) then
removeMarks(cost)
attemptCMInsert(itemId, itemAmount)
else
cprint("<b>You do not have enough Challenge Marks for that!")
end
end