Jump to content
Maintenance ×
×
×
  • Create New...
  • 0

coins per mob oder metin kill


lordzokarum

Question

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

3 answers to this question

Recommended Posts

  • 1
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 0

      erorrs after update granny to 2.9

    2. 0

      Navicat Premium 16.1.1 x64

    3. 5

      problem Dargon Soul Changre Attribute

    4. 5

      problem Dargon Soul Changre Attribute

    5. 41

      Global Chat

    6. 5

      problem Dargon Soul Changre Attribute

    7. 2

      Startup Loading Window Library

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.