Jump to content
  • 0
Sign in to follow this  
frenzmu06

Request: extra monster drop

Question

Hello good day, can anyone with good scripting knowledge help finish this script. so what the script does is it's triggered by killing a monster from the list and it'll give the specified zeny and cash point to the killer (100%), there is also a 10% chance that the killer gets the listed items (if there are).
i copied the array format from Stolao's DailyReward. 
 
-	script	ExtraDrop	-1,{
OnNPCKillEvent:
	if (killedrid == <monster id>)	{
			#CASHPOINTS += <cash points>;
			Zeny += <zeny amount>;
		}
		if ()rand(1000) < 10 ) 			//Chance: 100 = 10%, 10 = 1%, etc.
				getitem <item ids>, <item amounts>;
	end;
OnInit:
	//		Monster & Drop List:
	//		"<Monster ID>|<Zeny>|<Cash Points>|<itemID-1>|<amount-1>|<itemID-2>|<amount-2>...etc",
	setarray .mvpmonsterdrop$[1],
		"1112,5000,2,504,10",			//	Drake: 5000 Zeny + 2 Cash Points +10 White Potion
		"1115,3000,1,504,10,506,10",		//	Eddga: 3000 Zeny + 1 Cash Points +10 White Potion + 10 Green Potion
		"2098,4000,0,504,10,506,10,505,10",	//	Doppelganger: 4000 Zeny + 1 Cash Points +10 White Potion + 10 Green Potion + 10 Blue Potion
		"1120,1000";				// 	Ghostring:	1000 Zeny
	end;
}

 

 

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

I decided to rewrite this whole script, if you want them to have certain % rates for each mob instead of continuously getting the rewards, I'll change it, but here you go!

// Created by Aeromesi
// Version 1.0
// Works with Hercules & rAthena
-    script    ExtraDrop    -1,{
OnNPCKillEvent:
 
    .@killedRID = killedrid;
    for ( .@i = 1; .@i <= $@SelectedMob; .@i++ ) {
    if ( .@killedRID == $@MonsterID[.@i]) {
    getitem $@ItemRewards[.@i], $@RewardAmount[.@i];
    Zeny += $@ZenyAmount[.@i];
    #CASHPOINTS += $@CashAmount[.@i];
    dispbottom "Obtained "+getitemname($@ItemRewards[.@i])+".";
    dispbottom "Obtained "+$@ZenyAmount[.@i]+" Zeny.";
    dispbottom "Obtained "+$@CashAmount[.@i]+" Cash Points.";
    end;
}
}
                /* ---         Format:     
                        Poring(1002)
                        Zeny: 5000
                        Cash: 10
                        Item: Red Potion (501)
                        Amount of Red Potion: 6
                                                --- */
                                    
OnInit:
    setarray $@SelectedMob,4; // Edit this to the max amount of monsters you have, currently in $@MonsterID we have a total of 4 monsters, so we put 4.
    setarray $@MonsterID[1],1002,1004,1005,1007; // Monster ID's, make sure to keep count of how many you're adding for $@SelectedMob array.
    setarray $@ZenyAmount[1],5000,3000,4000,1000; // 1002 would be poring, so he would get 5000 zeny, set the item rewards/cash amounts in accordance to each monster.
    setarray $@CashAmount[1],10,5,10,5; // Same for Cash, 1002 (Poring) would get 10 Cash Points.
    setarray $@ItemRewards[1],501,502,503,504; // Poring would drop a Red Potion.
    setarray $@RewardAmount[1],6,5,5,5;
end;
}

Share this post


Link to post
Share on other sites
  • 0

 

I decided to rewrite this whole script, if you want them to have certain % rates for each mob instead of continuously getting the rewards, I'll change it, but here you go!

 

// Created by Aeromesi
// Version 1.0
// Works with Hercules & rAthena
-    script    ExtraDrop    -1,{
OnNPCKillEvent:
 
    .@killedRID = killedrid;
    for ( .@i = 1; .@i <= $@SelectedMob; .@i++ ) {
    if ( .@killedRID == $@MonsterID[.@i]) {
    getitem $@ItemRewards[.@i], $@RewardAmount[.@i];
    Zeny += $@ZenyAmount[.@i];
    #CASHPOINTS += $@CashAmount[.@i];
    dispbottom "Obtained "+getitemname($@ItemRewards[.@i])+".";
    dispbottom "Obtained "+$@ZenyAmount[.@i]+" Zeny.";
    dispbottom "Obtained "+$@CashAmount[.@i]+" Cash Points.";
    end;
}
}
                /* ---         Format:     
                        Poring(1002)
                        Zeny: 5000
                        Cash: 10
                        Item: Red Potion (501)
                        Amount of Red Potion: 6
                                                --- */
                                    
OnInit:
    setarray $@SelectedMob,4; // Edit this to the max amount of monsters you have, currently in $@MonsterID we have a total of 4 monsters, so we put 4.
    setarray $@MonsterID[1],1002,1004,1005,1007; // Monster ID's, make sure to keep count of how many you're adding for $@SelectedMob array.
    setarray $@ZenyAmount[1],5000,3000,4000,1000; // 1002 would be poring, so he would get 5000 zeny, set the item rewards/cash amounts in accordance to each monster.
    setarray $@CashAmount[1],10,5,10,5; // Same for Cash, 1002 (Poring) would get 10 Cash Points.
    setarray $@ItemRewards[1],501,502,503,504; // Poring would drop a Red Potion.
    setarray $@RewardAmount[1],6,5,5,5;
end;
}

 

thanks Aeromesi this is great, configurable enough, btw how should i do it if i want to add another drop (2nd, 3rd or more) for monster id 1005 and 1007 and none for 1002 and 1004.

 

can you also add % config @ OnInit for chances to get items or the rewards, individually (zeny, cash, item1, item2).

 

thanks again for helping

 

 

edit: can i also use constant names for items and monsters instead of their ids?

Edited by frenzmu06

Share this post


Link to post
Share on other sites
  • 0

Hmm I didn't design it to have multiple drops, just a drop of an item, zeny and cash.

Though right now I'm making some changes:

POSSIBLY: making the item rewards random on each item instead of fixed (support or no?)

IMPLEMENTED but not uploaded: Fixed % rate for each item to drop when killing the mob.


Should I make a system where they can edit the mob data/drops via @command?

Share this post


Link to post
Share on other sites
  • 0

just the chance to drop and another "$@ItemRewards2[1]"

 

drop percentages for example is 10% for the zeny drop, 20% for the cash drop, and 5% for the item drop

which has a individual config switch @ OnInit

 

i think the @command isn't needed

Share this post


Link to post
Share on other sites
  • 0

 

should the 2 (could be 3) drops have different drop rates? or same?

if it's possible then its better

pls release it sir :blush:

Edited by frenzmu06

Share this post


Link to post
Share on other sites
  • 0

I'll work on a better version don't worry. For the edit of the id's replaced by the constants they're stored in an array that holds integers not strings of text, so no, it would cause errors. If the scripting engine could disregard the ID's if constant names matched an ID then it would work, but I'm pretty sure Hercules can't do that, or any emulator for that matter.

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
Answer this question...

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

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.