Jump to content
Sign in to follow this  
kyleflow

Can anyone give input why it does not work?

Recommended Posts

This code have 2 part, the upper part work wonders and the 2nd part did not work. The 2nd part basically emulate the same way the first part work but still it does not work. This was placed inside exp_and_level under GetEXP_PKM.

 

--custom drop dpt Item
	local dead_id = GetChaID(dead)
    local mob = {}
	local ChaX = TurnToCha(role)--check lvl 
	
    mob[696] = {ItemDrop = 7325, Quantity = 1, Quality = 4,  Rate = 1}    --100%% drop
	mob[687] = {ItemDrop = 7325, Quantity = 1, Quality = 4,  Rate = 1} 
	mob[690] = {ItemDrop = 7325, Quantity = 10, Quality = 4,  Rate = 1}
	mob[693] = {ItemDrop = 7325, Quantity = 10, Quality = 4,  Rate = 1}
	mob[707] = {ItemDrop = 7325, Quantity = 10, Quality = 4,  Rate = 1} 
	mob[686] = {ItemDrop = 7326, Quantity = 1, Quality = 4,  Rate = 0.05} --abandoned city 1 mobs
	mob[689] = {ItemDrop = 7326, Quantity = 1, Quality = 4,  Rate = 0.05}
	mob[688] = {ItemDrop = 7326, Quantity = 1, Quality = 4,  Rate = 0.05}
	mob[695] = {ItemDrop = 7327, Quantity = 1, Quality = 4,  Rate = 0.1}--dark swamp
	mob[697] = {ItemDrop = 7327, Quantity = 1, Quality = 4,  Rate = 0.1}
	
    if mob[dead_id] ~= nil then
        if Percentage_Random(mob[dead_id].Rate) == 1 then
            GiveItem ( atk, 0, mob[dead_id].ItemDrop, mob[dead_id].Quantity , mob[dead_id].Quality)
			BickerNotice(atk, "You have obtained 1 IMP Point from "..GetChaDefaultName(dead) )
        end
		if Percentage_Random(mob[dead_id].Rate) == 0.05 then
			GiveItem ( atk, 0, mob[dead_id].ItemDrop, mob[dead_id].Quantity , mob[dead_id].Quality)
			BickerNotice(atk, "You have obtained 1 Rock Voucher from "..GetChaDefaultName(dead) )
		end
		if Percentage_Random(mob[dead_id].Rate) == 0.1 then
			GiveItem ( atk, 0, mob[dead_id].ItemDrop, mob[dead_id].Quantity , mob[dead_id].Quality)
			BickerNotice(atk, "You have obtained 1 Jade Voucher from "..GetChaDefaultName(dead) )
		end
    end    
	--end here custom drop item
	--custom script untuk 
	--from here it does not worked
	if((GetChaMapName(atk) == "garner" or GetChaMapName(atk) == "magicsea" or GetChaMapName(atk) == "darkblue" ) and Lv(ChaX)>= 41) then
		
		local MIB = GetChaID(dead)
		local MIBX = {}
		MIBX[MIB] = {ItemDrop = 7328, Quantity = 1, Quality = 4, Rate = 1}
		if MIBX[MIB] ~= nil then
			if Percentage_Random(MIBX[MIB].Rate) == 1 then
			GiveItem( atk, 0, MIBX[MIB].ItemDrop, MIBX[MIB].Quantity, MIBX[MIB].Quality)
			end
		end
	end



--stop sini custom accessories mobs by map

 

Edited by kyleflow
solved. figured how to do it myself

Share this post


Link to post
Share on other sites

I've seen your edit, do you mind sharing the solution for future reference? Thanks!


"Beware of bugs in the above code; I have only proved it correct, not tried it."

- Donald E. Knuth

Share this post


Link to post
Share on other sites
2 hours ago, Mdrst said:

I've seen your edit, do you mind sharing the solution for future reference? Thanks!

Not at all. I script to learn and play solo. So I don't mind sharing any script I somehow manage to do.  It's a bit messy but it work.

 

local dead_id = GetChaID(dead)
    local mob = {}
	local arg_mob = {} -- argent
	local ms_mob = {} --magicsea
	local dblue_mob = {}
	local Cha = TurnToCha(role)--check lvl 
	
    mob[696] = {ItemDrop = 7325, Quantity = 1, Quality = 4,  Rate = 1}    --100%% drop
	mob[687] = {ItemDrop = 7325, Quantity = 1, Quality = 4,  Rate = 1} 
	mob[690] = {ItemDrop = 7325, Quantity = 10, Quality = 4,  Rate = 1}
	mob[693] = {ItemDrop = 7325, Quantity = 10, Quality = 4,  Rate = 1}
	mob[707] = {ItemDrop = 7325, Quantity = 10, Quality = 4,  Rate = 1} 
	mob[686] = {ItemDrop = 7326, Quantity = 1, Quality = 4,  Rate = 0.05} --abandoned city 1 mobs
	mob[689] = {ItemDrop = 7326, Quantity = 1, Quality = 4,  Rate = 0.05}
	mob[688] = {ItemDrop = 7326, Quantity = 1, Quality = 4,  Rate = 0.05}
	mob[695] = {ItemDrop = 7327, Quantity = 1, Quality = 4,  Rate = 0.1}--dark swamp
	mob[697] = {ItemDrop = 7327, Quantity = 1, Quality = 4,  Rate = 0.1}
	
	arg_mob[dead_id] = {ItemDrop = 7328, Quantity = 1, Quality = 4, Rate = 0.01, Peta = "garner"}
	ms_mob[dead_id] = {ItemDrop = 7328, Quantity = 1, Quality = 4, Rate = 0.01, Peta = "magicsea"}
	dblue_mob[dead_id] = {ItemDrop = 7328, Quantity = 1, Quality = 4, Rate = 0.01, Peta = "darkblue"}
	
    if mob[dead_id] ~= nil then
        if Percentage_Random(mob[dead_id].Rate) == 1 then
            GiveItem ( atk, 0, mob[dead_id].ItemDrop, mob[dead_id].Quantity , mob[dead_id].Quality)
			BickerNotice(atk, "You have obtained 1 IMP Point from "..GetChaDefaultName(dead) )
        end
		if Percentage_Random(mob[dead_id].Rate) == 0.05 then
			GiveItem ( atk, 0, mob[dead_id].ItemDrop, mob[dead_id].Quantity , mob[dead_id].Quality)
			BickerNotice(atk, "You have obtained 1 Rock Voucher from "..GetChaDefaultName(dead) )
		end
		if Percentage_Random(mob[dead_id].Rate) == 0.1 then
			GiveItem ( atk, 0, mob[dead_id].ItemDrop, mob[dead_id].Quantity , mob[dead_id].Quality)
			BickerNotice(atk, "You have obtained 1 Jade Voucher from "..GetChaDefaultName(dead) )
		end
    end
	if (arg_mob[dead_id] ~= nil and GetChaMapName(atk) == arg_mob[dead_id].Peta) then
		if Percentage_Random(arg_mob[dead_id].Rate) == 0.01 then
			GiveItem( atk, 0, arg_mob[dead_id].ItemDrop, arg_mob[dead_id].Quantity, arg_mob[dead_id].Quality)
			BickerNotice(atk, "You have obtained 1 Accessories Fragment from "..GetChaDefaultName(dead) )
		end
	end
	if (ms_mob[dead_id] ~= nil and GetChaMapName(atk) == ms_mob[dead_id].Peta) then
		if Percentage_Random(ms_mob[dead_id].Rate) == 0.01 then
			GiveItem( atk, 0, ms_mob[dead_id].ItemDrop, ms_mob[dead_id].Quantity, ms_mob[dead_id].Quality)
			BickerNotice(atk, "You have obtained 1 Accessories Fragment from "..GetChaDefaultName(dead) )
		end
	end
	if (dblue_mob[dead_id] ~= nil and GetChaMapName(atk) == dblue_mob[dead_id].Peta) then
		if Percentage_Random(dblue_mob[dead_id].Rate) == 0.01 then
			GiveItem( atk, 0, dblue_mob[dead_id].ItemDrop, dblue_mob[dead_id].Quantity, dblue_mob[dead_id].Quality)
			BickerNotice(atk, "You have obtained 1 Accessories Fragment from "..GetChaDefaultName(dead) )
		end
	end
	
---smpai sini	

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Ouh for testing purpose, when you want to try the drop is working or not, please change the rate into 1 so that u can see that it works. I reduce the the success into 0.01 to make it hard for me to get it in an open Map with lots of level.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...