Request: extra monster drop

frenzmu06

New member
Messages
85
Points
0
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. 
 
Code:
-	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;
}
 
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!

Code:
// 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;
}
 
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?

 
Last edited by a moderator:
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?

 
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

 
should the 2 (could be 3) drops have different drop rates? or same?
if it's possible then its better
pls release it sir
default_blush.png


 
Last edited by a moderator:
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.

 
Back
Top