Jump to content
  • 0
qtdan

Can someone add @flooritem command from eAmod to rAthena ?

Question

This command from eAmod

/*==========================================
 * Creaci󮠤e items en el suelo, en un Area.
 *------------------------------------------*/
ACMD_FUNC(flooritem)
{
	char item_name[100];
	int number = 0, count;
	struct item_data *item_data;
	nullpo_retr(-1, sd);

	memset(item_name, '\0', sizeof(item_name));

	if( !message || !*message || (
		sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 &&
		sscanf(message, "%99s %d", item_name, &number) < 1
	)) {
		clif_displaymessage(fd, "Usage: @flooritem <itemname/itemid> [quantity]");
		return -1;
	}

	if( number <= 0 )
		number = 1;

	if ((item_data = itemdb_searchname(item_name)) == NULL &&
	    (item_data = itemdb_exists(atoi(item_name))) == NULL)
	{
		clif_displaymessage(fd, msg_txt(sd,19)); // Invalid item ID or name.
		return -1;
	}

	count = map_addflooritem_area(&sd->bl, 0, 0, 0, item_data->nameid, number);

	if( count != 0 )
		if( number == count )
			clif_displaymessage(fd, "All items created.");
		else
		{
			sprintf(atcmd_output, "%d item(s) created.", count);
			clif_displaymessage(fd, atcmd_output);
		}
	else {
		clif_displaymessage(fd, "No items created!!.");
		return -1;
	}

	return 0;
}

can add to rathena ?

Edited by mharkeke
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Try this...

-	script	flooritem	FAKE_NPC,{
end;
OnInit:
	bindatcmd "flooritem", strnpcinfo(0)+"::OnFI", 60,90;
	end;
OnFI:
	[email protected] = atoi([email protected]_parameters$[0]);
	[email protected] = atoi([email protected]_parameters$[1]);

if ( [email protected] ) {
	message strcharinfo(0), "@flooritem <Itemid or itemname> <amount>";
	end;
	}
if ( [email protected] < 0 ) {
	message strcharinfo(0), "@flooritem -> Invalid amount";
	end;
	}
if ( getitemname([email protected]) == "null" && !searchitem([email protected][0],[email protected]_parameters$[0]) ) {
	message strcharinfo(0), "@flooritem -> Invalid Item ID";
	end;
	}
if([email protected][0])		[email protected] = [email protected][0];
	else
[email protected] = [email protected];	[email protected] = (sqrt([email protected]) > 16 ? 16 :sqrt([email protected]));

	getmapxy([email protected]$,[email protected],[email protected],0);
	[email protected]_x =(([email protected]@r) < 1?1:([email protected]@r));
	[email protected]_x =(([email protected][email protected]) > 512 ? 512:([email protected][email protected]));
	[email protected]_y =(([email protected]@r) < 1?1:([email protected]@r));
	[email protected]_y =(([email protected][email protected]) > 512 ? 512:([email protected][email protected]));
	freeloop(1);
	for([email protected]=0;[email protected]< [email protected];[email protected]++) {
	while (checkcell([email protected]$[[email protected]],[email protected]=rand([email protected]_x, [email protected]_x),[email protected]=rand([email protected]_y , [email protected]_y), cell_chknopass));
	makeitem [email protected],1,[email protected]$,[email protected],[email protected];
	}
	freeloop(0);
	end;

}

 

Link to comment
Share on other sites

  • 0

item doesn't show

[Debug]: (map_mapname2mapid) mapindex_name2id: Map "" not found in index list

Link to comment
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.   Paste as plain text instead

  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.



×
×
  • Create New...

Important Information

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