Rumor 2608 Posted February 3, 2014 Share Posted February 3, 2014 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) For this one you will need Mijago's quest functions, get them here: http://metin2dev.org/board/topic/30-mijagos-quest-functions/ You have to edit the vnum of the item you want to use to give players coins on line 6 inside the "[" and "]" brackets. The number after the equals sign is the amount of coins you want the item to give the player. You can add more lines underneath this in the same format in-case you want different items to give different amounts of coins. You may need to modify the MYSQL query on line 29 to match the columns of your database table. It's pretty self-explanatory, but if you need assistance feel free to reply. quest givegiftcoins begin state start begin when 80017.use begin local count = pc.count_item(item.get_vnum()) local value = ({ [80017] = 100, })[item.get_vnum()] say_title('Gift Coin Scroll') say('') say('This coin scroll is worth: '..value..' NC.') say('Nirvana Coins can be used in the itemshop!') say('Remember, for each NC you spend you receive 1 NM.') say('This scroll was meant to be used to gift coins.') say('You ARE allowed to sell it, if you wish.') say('') wait() say_title('Gift Coin Scroll') say('') say('Would you like to add the NC to your acccount?') say('You can only use this item once.') say('') if select('Yes','No') == 2 then return end if count ~= pc.count_item(item.get_vnum()) then -- BUGUSER! say('') say_reward('Bug use attempted. Coin reward has been cancelled.') say('') return end mysql_query('UPDATE account.account SET nc = nc+'..value..' WHERE id = '..pc.get_account_id()..' LIMIT 1') mysql_query('INSERT INTO log.coinscrollgift_log (account_id, coins, time) VALUES (".. pc.get_account_id() ..", ".. value ..", NOW())') pc.remove_item(item.get_vnum()) syschat('Your account has successfully been rewarded with NC.') -- If item is not stackable use: -- item.remove() end end end 13 1 4 1 Link to comment Share on other sites More sharing options...
Developer PACI 922 Posted February 3, 2014 Developer Share Posted February 3, 2014 Nowadays we have quest functions (made in the game file) that gives X coins to a player account. And also, instead of another query to log the character's action, I would use char_log(pc.get_account_id(), 'COINS', value..' coins') when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
Rumor 2608 Posted February 3, 2014 Author Share Posted February 3, 2014 Nowadays we have quest functions (made in the game file) that gives X coins to a player account. And also, instead of another query to log the character's action, I would use char_log(pc.get_account_id(), 'COINS', value..' coins') But why have it in multiple quests when you can have it all in one central place? That's a good idea with the char_log function. Link to comment Share on other sites More sharing options...
Developer PACI 922 Posted February 3, 2014 Developer Share Posted February 3, 2014 But why have it in multiple quests when you can have it all in one central place? Hm? What I was saying is there's already a function to charge coins on an account. when 123.use or 1234.use or 12345.use begin local cash = {[123] = 10, [1234] = 20, [12345] = 30} pc.charge_cash(cash[item.vnum], 'cash') char_log(pc.get_account_id(), 'GIVE_IS_COINS', cash[item.vnum]..' Coins') end I don't know if this function exists on other game revisions. But at least in 34083, it exists.So that makes your quest useful for those who are more 'oldschool'. 2 when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
Rumor 2608 Posted February 4, 2014 Author Share Posted February 4, 2014 Oh okay I didn't know that Sent from my Nexus 5 using Tapatalk Link to comment Share on other sites More sharing options...
Recommended Posts