Jump to content
  • 0

@drop on / off command


Question

Posted

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

5 answers to this question

Recommended Posts

Posted

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
Posted (edited)

 

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...