Jump to content

coins per mob oder metin kill


Go to solution Solved by Tasho,

Recommended Posts

hallo,

ich komm einfach nicht mehr weiter. Bitte helft mir.
das Problem ist ich will nur das der player coins bekommt wenn er z.b. irgendein metin kill sagen wir mal 2 coins als belohnung bekommt
oder halt ween er einen Boss killt z.b. 1093. 

 

quest coins_for_kill begin 
    state start begin  
        when kill begin 
        
        local metin = { 
            [8024] = {30}, -- 1. Vnum des Metin 2. Anzahl der Coins 
            [8025] = {20} 
        }
            if npc.get_race() == metin[pc.get_mob_vnum] then
                mysql_query("UPDATE account.account SET coins = coins + "..metin[pc.get_mob_vnum][2].." WHERE id = "..pc.get_account_id()..";") 
            end 
        end 
    end  
end

 

aber leider funzt die obere quest nicht keine Fehler bei ./qc aber auch keine coins auf dem Konto.

 

Danke

Link to comment
Share on other sites

  • Solution
quest coins_for_kill begin 
    state start begin  
        when kill begin 
			local mobVnum = npc.get_race()
			local mobCoins = ({
				[8024] = 30, -- 30 Coins
				[8025] = 20 -- 20 Coins
			})
			[mobVnum]
			
			if not mobCoins then
				return
			end

			pc.charge_cash(mobCoins, "coins_for_kill")
			syschat(string.format("You get %d coins from %s.", mobCoins, mob_name(mobVnum)))
		end 
	end  
end

This is correctly quest rewrited.

Already ymir did the function for lua to charge the coins via pc.charge_cash, but not all people was used because name of row is called: "cash" and they are used on website/itemshop etc row "coins", but can change very easy.

Go in /src/db/ClientManager.cpp

sprintf(szQuery, "update account set `cash` = `cash` + %d where id = %d limit 1", packet->dwAmount, packet->dwAID);

Replace `cash` = `cash` with `coins` = `coins`

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.