Jump to content
  • 0

@drop on / off command


darking123

Question


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

when a player login. @dropoff is automatically initiated.


 


functions of drop off and drop on


 


drop off= any item cannot be drop but can be stored to the storage and can be sold.


 


drop on= can drop the item and etc.


 


AnnieRuru made a .diff for hercules only if someone can convert this to rathena i'll be glad.



src/map/atcommand.c | 26 ++++++++++++++++++++++++++
src/map/pc.c | 5 +++++
src/map/pc.h | 2 ++
3 files changed, 33 insertions(+)

diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index b5e8fa7..af092eb 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -9374,6 +9374,31 @@ static inline void atcmd_channel_help(int fd, const char *command, bool can_crea
clif->message(fd,atcmd_output);
return true;
}
+
+ACMD(drop) {
+ if ( stristr( message, "on" ) ) {
+ if ( sd->candrop )
+ clif->message( fd, "You already turn on @drop." );
+ else {
+ sd->candrop = 1;
+ clif->message( fd, "You are now turn ON @drop. You can drop items now." );
+ }
+ }
+ else if ( stristr( message, "off" ) ) {
+ if ( !sd->candrop )
+ clif->message( fd, "You already turn off @drop" );
+ else {
+ sd->candrop = 0;
+ clif->message( fd, "You are now turn OFF @drop. You can't drop items now." );
+ }
+ }
+ else {
+ clif->message( fd, "Syntax: @drop on|off." );
+ return false;
+ }
+ return true;
+}
+
/**
* Fills the reference of available commands in atcommand DBMap
**/
@@ -9384,6 +9409,7 @@ void atcommand_basecommands(void) {
* Command reference list, place the base of your commands here
**/
AtCommandInfo atcommand_base[] = {
+ ACMD_DEF(drop),
ACMD_DEF2("warp", mapmove),
ACMD_DEF(where),
ACMD_DEF(jumpto),
diff --git a/src/map/pc.c b/src/map/pc.c
index 2372d31..1c0c934 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4123,6 +4123,11 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount)
return 0; //Can't drop items in nodrop mapflag maps.
}

+ if ( !sd->candrop ) {
+ clif->message( sd->fd, "You can't drop items. Type '@drop on' to allow drop items." );
+ return 0;
+ }
+
if( !pc->candrop(sd,&sd->status.inventory[n]) )
{
clif->message (sd->fd, msg_txt(263));
diff --git a/src/map/pc.h b/src/map/pc.h
index bec4522..c84c9a3 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -547,6 +547,8 @@ struct map_session_data {
const char* delunit_prevfile;
int delunit_prevline;

+ bool candrop;
+
};

#define EQP_WEAPON EQP_HAND_R

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

For your information,

if you're using newer client .ex 2013. You dont even need a source mod to enable this feature.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

For your information,

if you're using newer client .ex 2013. You dont even need a source mod to enable this feature.

I'm using 20140115 and I don't see anywhere the client having this feature though
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

 

For your information,

if you're using newer client .ex 2013. You dont even need a source mod to enable this feature.

I'm using 20140115 and I don't see anywhere the client having this feature though

 

 

 

 

your inventory window .... bottom left corner... "Lock Item Drop"

 

rLK7xMq.jpg

Edited by Emistry
added image
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  64
  • Topics Per Day:  0.02
  • Content Count:  180
  • Reputation:   7
  • Joined:  12/19/12
  • Last Seen:  

kkkkkkkk a good code but a old command, in alt+e have this func.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

For your information,

if you're using newer client .ex 2013. You dont even need a source mod to enable this feature.

I'm using 20100730 sir

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