Jump to content
  • 0
Sign in to follow this  
DLSUD04

Can I request this script pls?

Question

Can I request for this kind of script please?

 

1. When you kill or be killed by another player, there is a chance to drop one of your equip. This will only applicable in Izlude town.

 

2. I want this kind of script because Im planning to have a farming map [izlude town] with a Mobster mobs summon x30 (respawnable mob) random area in izlude town and It has a chance to drop the item I want [depends on what item i want]

 

If this is possible, please teach me how to setup this or where to put this script? thanks :D

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

I'm actually working on a script almost similar to this LOL but i haven't finished it yet.

 

I can share you my script but Take Note: This will also drop bounded, rental, and restricted items.. Restricted = non tradable, non dropable, etc.....

 

if you want to check rental items, you need to apply getequipexpiretick

if you want to check restricted items, you may check THIS out.

If you want to check bounded items, you can use 'countbound'.. im still waiting for my request to check bounded items here

 

 

here's the script: Take note -> bounded and rental items will turn into normal item since I haven't put the checks yet. But i'll update you as soon as i fnished the script.

-	script	dropitems	-1,{OnPCDieEvent:	if( getgmlevel() != 0 )end;	if( killerrid > 3000000 )end; // The script will end if a monster killed the player	if( strcharinfo(3) == "izlude" ) {		getmapxy(.@mapname$,.@mapx,.@mapy,0);		for(.@i=0; .@i < 10; .@i++)		{			if( getequipisequiped(.@i) ) {				.@itemid = getequipid(.@i);				.@refine = getequiprefinerycnt(.@i);				.@card1 = getequipcardid(.@i,0);				.@card2 = getequipcardid(.@i,1);				.@card3 = getequipcardid(.@i,2);				.@card4 = getequipcardid(.@i,3);				if( rand(1,100) <= 50 ) { //50% chance to drop the item					delequip .@i;					makeitem2 .@itemid,1,.@mapname$,.@mapx,.@mapy,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;				}			}		}	}	end;}
Edited by Lord Ganja

Share this post


Link to post
Share on other sites
  • 0

@@Lord Ganja -

*getinventorylist;This command sets a bunch of arrays with a complete list of whatever the invoking character has in its inventory, including all the data needed to recreate these items perfectly if they are destroyed. Here's what you get:@inventorylist_id[]        - array of item ids.@inventorylist_amount[]    - their corresponding item amounts.@inventorylist_equip[]     - will return the slot the item is equipped on, if at all.@inventorylist_refine[]    - for how much it is refined.@inventorylist_identify[]  - whether it is identified.@inventorylist_attribute[] - whether it is broken.@inventorylist_card1[]     - These four arrays contain card data for the@inventorylist_card2[]       items. These data slots are also used to store@inventorylist_card3[]       names inscribed on the items, so you can@inventorylist_card4[]       explicitly check if the character owns an item                             made by a specific craftsman.@inventorylist_expire[]    - expire time (Unix time stamp). 0 means never                              expires.@inventorylist_bound       - whether it is an account bounded item or not.@inventorylist_count       - the number of items in these lists.This could be handy to save/restore a character's inventory, since no other command returns such a complete set of data, and could also be theonly way to correctly handle an NPC trader for carded and named items who could resell them - since NPC objects cannot own items, so they have to store item data in variables and recreate the items.Notice that the variables this command generates are all temporary, attached to the character, and integer.Be sure to use @inventorylist_count to go through these arrays, and not 'getarraysize', because the arrays are not automatically cleared between runs of 'getinventorylist'.

This returns @inventory_expire which gives you the rental time, if it has data ( not a 0 ) then it's a rental item. You can even see how long until it expires. Additionally, @inventory_bound SHOULD return the type of bound item it is (account, character, party, guild) or 0 if it's not bound at all. The reason I say SHOULD is because, I remember submitting an update to the command that would return the value of the bound type, rather than just return 1 (saying it's bound) and 0 (saying it's not bound), this way you should get all the information needed.

 

But lastly, I also created this command awhile back to check specifically for bound items, if theres a need for it.

*checkbound(<item_id>{,<bound_type>{,<refine>{,<attribute>{,<card_1>{,<card_2>{,<card_3>{,<card_4>}}}}}}});This command allows you to check whether or not the attached player has the specified bound item in their inventory.If a bound type is not specified or a bound type of 0 is used, it will search the player's inventory for a bound itemof any type, so long as the other parameters match. In all cases, this command will return the bound type of theitem found, or 0 if the specified item was not found.Valid bound types are: 0 - All Bound types. 1 - Account Bound 2 - Guild Bound 3 - Party Bound 4 - Character BoundOptional Parameters: bound_type - checks to see if the item has the specified bound type. refine - checks to see if the item is refined to the given number. attribute - whether the item is broken (1) or not (0). card 1,2,3,4 - checks to see if the specified cards are compounded on the item as well.Example:	// This will check if you have a bound (any type) 1205 (Cutter).	if (checkbound(1205)) {		mes "You have a bound Cutter";	} else {		mes "You do not have a bound Cutter";	}	close;		// This will also check if you have a bound (any type) 1205 (Cutter).	if (checkbound(1205,0)) {		mes "You have a bound Cutter";	} else {		mes "You do not have a bound Cutter";	}	close;		// This will check if the player doesn't have a bound 1205 (Cutter).	if (!checkbound(1205)) {		mes "You do not have a bound Cutter";	} else {		mes "You do have a bound Cutter";	}	close;		// This will check if the item found, has a bound type of 2 (guild_bound)	if (checkbound(1205) == 2) {		mes "You have a guild_bound Cutter";	} else {		mes "You do not have a guild_bound Cutter.";	}	close;		// This will check if you have a 'guild_bound' +7 1205 (Cutter).	if (checkbound(1205, 2, 7)) {		mes "You have a +7 guild_bound Cutter.";	} else {		mes "You don't have the required item.";	}	close;

 

Best of luck.

Share this post


Link to post
Share on other sites
  • 0

@@GmOcean

*getinventorylist; - @inventorylist_bound, only checks if the item is bounded or not? or does it also checks what bound_type the item has?

 

can you also share your checkbound diff? Thank you! :)

Share this post


Link to post
Share on other sites
  • 0

I don't have any of my RO files anymore, since I recently wiped my work station. Unlucky me got hit with a currupt drive :/

 

@inventorylist_bound will tell you exactly which bound type it is.

 

It will return the values:

0 - (Not bound)

1 - (Account Bound)

2 - (Guild Bound)

3 - (Party Bound)

4 - (Character Bound)

 

The same goes for *getcartinventorylist and @cartinventorylist_bound

Share this post


Link to post
Share on other sites
  • 0

I don't have any of my RO files anymore, since I recently wiped my work station. Unlucky me got hit with a currupt drive :/

 

@inventorylist_bound will tell you exactly which bound type it is.

 

It will return the values:

0 - (Not bound)

1 - (Account Bound)

2 - (Guild Bound)

3 - (Party Bound)

4 - (Character Bound)

 

The same goes for *getcartinventorylist and @cartinventorylist_bound

Alright. Thanks man. :)

Share this post


Link to post
Share on other sites
  • 0

 

I'm actually working on a script almost similar to this LOL but i haven't finished it yet.

 

I can share you my script but Take Note: This will also drop bounded, rental, and restricted items.. Restricted = non tradable, non dropable, etc.....

 

if you want to check rental items, you need to apply getequipexpiretick

if you want to check restricted items, you may check THIS out.

If you want to check bounded items, you can use 'countbound'.. im still waiting for my request to check bounded items here

 

 

here's the script: Take note -> bounded and rental items will turn into normal item since I haven't put the checks yet. But i'll update you as soon as i fnished the script.

-	script	dropitems	-1,{OnPCDieEvent:	if( getgmlevel() != 0 )end;	if( killerrid > 3000000 )end; // The script will end if a monster killed the player	if( strcharinfo(3) == "izlude" ) {		getmapxy(.@mapname$,.@mapx,.@mapy,0);		for(.@i=0; .@i < 10; .@i++)		{			if( getequipisequiped(.@i) ) {				.@itemid = getequipid(.@i);				.@refine = getequiprefinerycnt(.@i);				.@card1 = getequipcardid(.@i,0);				.@card2 = getequipcardid(.@i,1);				.@card3 = getequipcardid(.@i,2);				.@card4 = getequipcardid(.@i,3);				if( rand(1,100) <= 50 ) { //50% chance to drop the item					delequip .@i;					makeitem2 .@itemid,1,.@mapname$,.@mapx,.@mapy,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;				}			}		}	}	end;}

sir can you update the script please, im getting an error... thanks

Share this post


Link to post
Share on other sites
  • 0

@@DLSUD04

for the 2nd script, you should know how to do

just make a custom monster ... then set what you want it to drop from mob_db.conf

 

1st script

-	script	ksjfkjsfhs	FAKE_NPC,{OnPCKillEvent:	if ( strcharinfo(3) != "izlude" ) end;	attachrid killedrid;	getinventorylist;	for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) {		if ( @inventorylist_equip[.@i] && !@inventorylist_expire[.@i] && !@inventorylist_bound ) {			.@itemid[.@c] = @inventorylist_id[.@i];			.@refine[.@c] = @inventorylist_refine[.@i];			.@card1[.@c] = @inventorylist_card1[.@i];			.@card2[.@c] = @inventorylist_card2[.@i];			.@card3[.@c] = @inventorylist_card3[.@i];			.@card4[.@c] = @inventorylist_card4[.@i];			.@c++;		}	}	if ( !.@c ) end;	.@r = rand(.@c);	delitem2 .@itemid[.@r], 1, 1, .@refine[.@r], 0, .@card1[.@r], .@card2[.@r], .@card3[.@r], .@card4[.@r];	getmapxy .@map$, .@x, .@y, 0;	makeitem2 .@itemid[.@r], 1, .@map$, .@x, .@y, 1, .@refine[.@r], 0, .@card1[.@r], .@card2[.@r], .@card3[.@r], .@card4[.@r];	end;}
man ... just noticed ... we still don't have makeitem2 command ...

for the moment use this plugin -> fixed from here

 

think I'll do pull request later with this topic -> http://herc.ws/board/topic/4518-suggestion-brianl-rentitem2/

 

.


@@Lord Ganja

the author says something about 'When you kill or be killed by another player'

so should be using OnPCKillEvent

because if use OnPCDieEvent, this event will also trigger when kill by a monster

 

OnPCKillEvent only happens when a player kill another player

Edited by AnnieRuru

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.