Jump to content

[Package] @itemmap & getitem_map() 2.0.1


About This File

Information

This command will give a specific amount of specified items to all players on the map.

I tried to make it a bit more challenging for myself so I have added the capability of giving the same party or guild members of that specific map as well.

Makes it easier to script stuff such as events especially those including parties and guilds to participate.

Atcommand version now available!

Tested on rAthena Trunk 17062

Syntax

Script

*getitem_map <item id>,<amount>,"<mapname>"{,<type>,<ID for Type>};

Atcommand

@itemmap <item id/name> {<amount>}

@itemmap1 <item id/name> <amount>, <party name>

@itemmap2 <item id/name> <amount>, <guild name>

Documentation

Script

*getitem_map <item id>,<amount>,"<mapname>"{,<type>,<ID for Type>};

This command will give a specific amount of specified items to the players on the specified map.

Works similarly to getitem but for multiple players on certain map.

Negative ID numbers also apply. However item name is currently not supported.

Those parameters that are different from 'getitem' are:

  • mapname - Map name of the players to give the item(s) too
  • type - Optional.
    • 0 = everyone on the map (default)
    • 1 = specific party and their members on the map
    • 2 = specific guild and their members on the map
    • 3 = specific battleground team and their members on the map

    [*]ID for Type - Only needed if type is not 0

    • If type = 1, ID is Party ID
    • If type = 2, ID is Guild ID
    • If type = 3, ID is Battleground ID

If type is given, party members who are offline or are not on the specific map do not get the item.

Same for guild members. If BG ID is not found, it will not give to any players.

This transaction is logged if the log script generated transactions option is enabled.

Created by Xantara

Example:

Script Command (also found in doc/sample/npc_getitem_map.txt)

// Sample NPC to test the custom getitem_map script command
// Script and command created by Xantara
prontera,156,170,3	script	getitem_map test	120,{
mes "input item id";
next;
input [email protected];
mes "input item amount";
next;
input [email protected];
mes "input type:";
mes "0=everyone, 1=party, 2=guild 3=bg";
next;
input [email protected];
//getitem_map [email protected],[email protected],strcharinfo(3),[email protected],(([email protected]==1) ? getcharid(1) : ([email protected]==2) ? getcharid(2) : getcharid(4));
switch([email protected])
{
	 case 1:	set [email protected]_id, getcharid(1);	break;
	 case 2:	set [email protected]_id, getcharid(2);	break;
	 case 3:	set [email protected]_id, getcharid(4);	break;
}
getitem_map [email protected],[email protected],strcharinfo(3),[email protected],[email protected]_id;
mes "done";
close;
}

Atcommand

// Everyone one the same map as the who called this command will get 1 Jellopy (ID#607)
@itemmap 607
// Everyone one the same map as the who called this command will get 5 Jellopy (ID#607)
@itemmap 607 5
// Players who are in the party "myParty" and on the same map as the who called this command will get 2 Yggdrasil Berry (ID#608)
@itemmap1 608 2, myParty
// Players who are in the guild "hisGuild" and on the same map as the who called this command will get 3 Jellopy
@itemmap2 "jellopy" 3, hisGuild

Credits

Created by Xantara

BG Support Suggestion/Idea by Silvester

Atcommand Suggestion/Idea by Mysterious

Mirror

http://downloads.artistic-coder.com/download.php?file=package_getitem_map_v2.0.1_%5BXantara%5D.patch

88x31.png

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Do not mirror without my consent.


What's New in Version 2.0.1   See changelog

Released

  • 1.0 - Initial release.
  • 1.1 - Added BG Team Support
  • 2.0a - Updated to work on rAthena
  • 2.0b - Added @itemmap/1/2
  • 2.0.1 - Updated to work on r17062+
 Share


×
×
  • Create New...

Important Information

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