Jump to content
Sign in to follow this  
Jelly

1 drop all monsters

Recommended Posts

hi guys is there a way to add a drop into all monsters without adding it to every monster in characterinfo?

 

if there is can someone help me? ty

Share this post


Link to post
Share on other sites

.txt are loaded by GS at the beginning and becomes static throughout the execution of program.

So ideally, this is not possible. People often go to Check_Baoliao(), but this is a mere calculator. 


kong.png

a2.png

Share this post


Link to post
Share on other sites
45 minutes ago, Jelly said:

hi guys is there a way to add a drop into all monsters without adding it to every monster in characterinfo?

 

if there is can someone help me? ty

I think one way u can use is to add it in function GetExp_New(dead , atk  ) and then just add the item to give in inventory... but that way it wont drop then on floor..


Download: Nightmare Demonic Helm

Dimension Pirates Online files: get now

New map Project: Flag PK

Black Skin 3.1.3 for pko 1: Get now

Share this post


Link to post
Share on other sites

You could try giving the monster an item when it is killed, idk if it would drop it though. I know if you give a monster an item and then kill it then it drops.

Edited by 7n6

Share this post


Link to post
Share on other sites
GlobalDrops = {Enabled = true}
GlobalDrops.GlobalItems = {
	{ID = 1, Amount = 2, Chance = 1},--These items drop from all non-players
	{ID = 2, Amount = 3, Chance = 1},--These items drop from all non-players
	{ID = 3, Amount = 4, Chance = 1},--These items drop from all non-players
}
GlobalDrops.MobItems = {
	[185] = {                --These items only drop from mystic flowers(ID 185).
		{ID = 7, Amount = 2, Chance = 1},--These items only drop from mystic flowers(ID 185).
		{ID = 8, Amount = 7, Chance = 1},--These items only drop from mystic flowers(ID 185).
		{ID = 9, Amount = 5, Chance = 1},--These items only drop from mystic flowers(ID 185).
	},    					 --These items only drop from mystic flowers(ID 185).
	
	[885] = {                 --These items only drop from BD phyliss(ID 885).
		{ID = 12, Amount = 2, Chance = 1},--These items only drop from BD phyliss(ID 885).
		{ID = 83, Amount = 7, Chance = 1},--These items only drop from BD phyliss(ID 885).
		{ID = 96, Amount = 5, Chance = 1},--These items only drop from BD phyliss(ID 885).
	},  
}

function GlobalDrops.Drop(role,array)
	for i,v in pairs(array) do
		if Percentage_Random(v.Chance) == 1 then
			GiveItem(role,0,v.ID,v.Amount,4)
			RemoveChaItem( role , v.ID , v.Amount , 2 , -1, 0 , 1  )
		end
	end	
end

function GlobalDrops.Check(DEFER,ATKER)
	if GlobalDrops.Enabled ~= true then
		return true
	end
	if GetChaTypeID( DEFER ) > 4 then
		GlobalDrops.Drop(DEFER,GlobalDrops.GlobalItems)	
	end
	local array = GlobalDrops.MobItems[GetChaTypeID( DEFER )]
	if array ~= nil then
		GlobalDrops.Drop(DEFER,array)
	end
end
Hook:AddPreHook("GetExp_PKM",GlobalDrops.Check)

You could use this as a base, just note that items will be protected for a few seconds after dropping.

Change Chance if you want to adjust rates. 0.5 = 50%, 1 = 100%, 0.1 = 10% etc

Edited by 7n6

Share this post


Link to post
Share on other sites

good concept! But as I mentioned above, Check_Baoliao is only a calculator,
if you are targeting monster's to forcefully drop items, the better function to hook is GetExp_PKM.

  • Like 1

kong.png

a2.png

Share this post


Link to post
Share on other sites

There is a function which drops item from role. I don't remember its name. I will try find out it tomorrow


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...