Jump to content

[Package] getitem_map() & @itemmap


Xantara

Recommended Posts


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  243
  • Reputation:   206
  • Joined:  11/28/11
  • Last Seen:  

File Name: [Package] @itemmap & getitem_map()

File Submitter: Xantara

File Submitted: 18 Dec 2011

File Category: Source Modifications

Content Author: Xantara

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 .@id;
mes "input item amount";
next;
input .@amt;
mes "input type:";
mes "0=everyone, 1=party, 2=guild 3=bg";
next;
input .@t;
//getitem_map .@id,.@amt,strcharinfo(3),.@t,((.@t==1) ? getcharid(1) : (.@t==2) ? getcharid(2) : getcharid(4));
switch(.@t)
{
	 case 1:	set .@type_id, getcharid(1);	break;
	 case 2:	set .@type_id, getcharid(2);	break;
	 case 3:	set .@type_id, getcharid(4);	break;
}
getitem_map .@id,.@amt,strcharinfo(3),.@t,.@type_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.

Click here to download this file

  • Upvote 6
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

So basically, if you enter the party ID number, only players who are ON the map that are in a PARTY will only get the items?

Also, is it possible to make it a command too?

Edited by Mysterious
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  243
  • Reputation:   206
  • Joined:  11/28/11
  • Last Seen:  

@download, there is a current bug with uploading new versions so currently the download for this is currently unavailable. The bug has been reported though.

Yes, Mysterious, that is how it works. =)

It is possible for it to be a command. However, I would assume that the extra functionality (the part where you can choose to give to a party, guild, or bg team) would hardly be used since finding the party/guild/bg id would be difficult in-game?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

Well yeah indeed it would be. However, if the GM is currently on the map where 20+ people currently are doing the event and the GM wants everyone to win, well, @itemmap (or something) Jellopy 5, etc. xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  243
  • Reputation:   206
  • Joined:  11/28/11
  • Last Seen:  

I uploaded the source modification so it should now be available for download.

As a note, the upload new versions function is still bugged. But being worked on. I'll probably be testing on this file so if it suddenly disappears, check again soon and it should be back~

@Mysterious, Ah yea, that'd be useful. I guess it still could have the party or guild in the command using their party/guild name =)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

I uploaded the source modification so it should now be available for download.

As a note, the upload new versions function is still bugged. But being worked on. I'll probably be testing on this file so if it suddenly disappears, check again soon and it should be back~

@Mysterious, Ah yea, that'd be useful. I guess it still could have the party or guild in the command using their party/guild name =)

Something to look forward for the future /hmm Hopefully you come up with something xD

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  48
  • Reputation:   0
  • Joined:  01/21/12
  • Last Seen:  

good luck on this!

I am waiting if there's a possible @command feature or whisper system. :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  243
  • Reputation:   206
  • Joined:  11/28/11
  • Last Seen:  

Well, I forgot about the atcommand suggestion xD; Oppss.. Better late than never right?

Anyways, I've updated this source modification to a package that includes both getitem_map script command and itemmap/1/2 atcommand. There were changes to the rAthena SVN that affected the previous versions so this update also provides a fix to make it work on the latest revision (r15625).

The documentation might be a bit more confusing now so let me know if there is anything uncertain.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  48
  • Reputation:   0
  • Joined:  01/21/12
  • Last Seen:  

So we will just add this at command function right? cause I have already added the get_item_map sources before.

BTW. Thank you so much for this.

EDIT:

I added only the atcommand.c and got this

atcommand.c: In function ‘atcommand_itemmap’:
atcommand.c:9337: error: ‘LOG_TYPE_COMMAND’ undeclared (first use in this function)
atcommand.c:9337: error: (Each undeclared identifier is reported only once
atcommand.c:9337: error: for each function it appears in.)
atcommand.c:9337: error: too many arguments to function ‘pc_getitem_map’
atcommand.c:9347: error: too many arguments to function ‘pc_getitem_map’
atcommand.c:9354: error: too many arguments to function ‘pc_getitem_map’
make[1]: *** [obj_sql/atcommand.o] Error 1
make[1]: Leaving directory `/opt/test1/src/map'

using 3ceam661

Edited by brianj070707
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  243
  • Reputation:   206
  • Joined:  11/28/11
  • Last Seen:  

So we will just add this at command function right? cause I have already added the get_item_map sources before.

BTW. Thank you so much for this.

EDIT:

I added only the atcommand.c and got this

...

using 3ceam661

Hi,

rAthena changed some parts of how it logs items so I changed some of the functions to make it work with it. Therefore, the patch will only work with rA SVNs and not with any other (eA, 3ceAm, etc).

Regards,

- Xantara

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  48
  • Reputation:   0
  • Joined:  01/21/12
  • Last Seen:  

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO :)

Maybe I should try the NPC version of your's, if didn't works it just says. The whole script is rA version.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  251
  • Reputation:   20
  • Joined:  12/22/11
  • Last Seen:  

well done

Tested on rAthena Trunk 15627 :)

Edited by kurodikku
  • Upvote 1
Link to comment
Share on other sites

  • 3 months later...

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  10
  • Reputation:   3
  • Joined:  05/26/12
  • Last Seen:  

thanks

thanks

very mnuch

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  243
  • Reputation:   206
  • Joined:  11/28/11
  • Last Seen:  

So, I found out that someone was asking Zephyrus to add my work, this package in particular, to his eAmod. I was thinking of just removing this download but that would stop other members from using this. Instead, I'm asking the users to please stop. I did not make this, nor any of my other free downloads, just so that they can be added to someone else's work and get paid for it.

Link to comment
Share on other sites

  • 2 months later...

  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

nice..

Link to comment
Share on other sites

  • 3 months later...

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

I tried to patch it.. is this the correct way?

Right click -> SVN Checkout -> Apply Patch.

then idk where or which folder.. i tried to select "src" but it kept saying working memory lol

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  243
  • Reputation:   206
  • Joined:  11/28/11
  • Last Seen:  

I tried to patch it.. is this the correct way?

Right click -> SVN Checkout -> Apply Patch.

then idk where or which folder.. i tried to select "src" but it kept saying working memory lol

It seems like I didn't "follow" this topic either...

Yes, right-click your rAthena SVN folder, click Apply Patch. Then find the patch provided in the download. Then select "patch all files".

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   2
  • Joined:  01/16/13
  • Last Seen:  

what if it is not successful? what will i do? i'm nervous applying this patch. because i don't know what files should i back up for in case of emergency. can you test it in rA17098?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   1
  • Joined:  08/04/12
  • Last Seen:  

Just backup your src folder in case of failure :)

Link to comment
Share on other sites

  • 3 months later...

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   1
  • Joined:  06/14/12
  • Last Seen:  

Not working on r17235.

Rejected Patch Hunks for script.c

Rejected Patch Hunks for pc.h / pc.c

Rejected Patch Hunks for script_commands.txt

Rejected Patch Hunks for atcommand.c

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  243
  • Reputation:   206
  • Joined:  11/28/11
  • Last Seen:  

Not working on r17235.

Rejected Patch Hunks for script.c

Rejected Patch Hunks for pc.h / pc.c

Rejected Patch Hunks for script_commands.txt

Rejected Patch Hunks for atcommand.c

Thanks, I'll update it when I can.

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   1
  • Joined:  06/14/12
  • Last Seen:  

Please update to r17362. Thanks in advance!

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   3
  • Joined:  06/11/13
  • Last Seen:  

Not working on r17235.

Rejected Patch Hunks for script.c

Rejected Patch Hunks for pc.h / pc.c

Rejected Patch Hunks for script_commands.txt

Rejected Patch Hunks for atcommand.c

 

Just add it manually, I just tested it on rAthena 17352 and the only issues it had were

 

1>..\src\map\atcommand.c(1347): warning C4003: not enough actual parameters for macro 'msg_txt'
1>..\src\map\atcommand.c(1347): warning C4047: 'function' : 'map_session_data *' differs in levels of indirection from 'int'
1>..\src\map\atcommand.c(1347): warning C4024: 'map_msg_txt' : different types for formal and actual parameter 1
1>..\src\map\atcommand.c(1347): error C2059: syntax error : ')'
1>..\src\map\atcommand.c(1357): warning C4003: not enough actual parameters for macro 'msg_txt'
1>..\src\map\atcommand.c(1357): warning C4047: 'function' : 'map_session_data *' differs in levels of indirection from 'int'
1>..\src\map\atcommand.c(1357): warning C4024: 'map_msg_txt' : different types for formal and actual parameter 1
1>..\src\map\atcommand.c(1357): error C2059: syntax error : ')'
1>..\src\map\atcommand.c(1375): warning C4003: not enough actual parameters for macro 'msg_txt'
1>..\src\map\atcommand.c(1375): warning C4047: 'function' : 'map_session_data *' differs in levels of indirection from 'int'
1>..\src\map\atcommand.c(1375): warning C4024: 'map_msg_txt' : different types for formal and actual parameter 1
1>..\src\map\atcommand.c(1375): error C2059: syntax error : ')' 

 

Which is actually a simple fix it just means take these three lines

 

clif_displaymessage(fd, msg_txt(96)); // Incorrect name or ID, or no one from the party is online.
clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
clif_displaymessage(fd, msg_txt(18)); // Item created.
 

 

And change them to

 

 

clif_displaymessage(fd, msg_txt(sd,96)); // Incorrect name or ID, or no one from the party is online.
clif_displaymessage(fd, msg_txt(sd,94)); // Incorrect name/ID, or no one from the guild is online.
clif_displaymessage(fd, msg_txt(sd,18)); // Item created.
 

And it will run without errors

 

 

Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  03/29/12
  • Last Seen:  

@Xantara I really want to use this! :)

How can you patch/apply this manually?

Requesting for detailed instruction! 

Thanks in advance!  :) 

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
Reply to this topic...

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