Jump to content
  • 0

Drop per map setter


Kido

Question


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

hello, i would like to request/know if there is a way to make the drops of a whole specific map increase for certain period of time

 

i would like to use this to make basic mvp card for high rates like my server (turtle general, phreeoni, doppelganger and so on) be more easy to get

 

i have a private mvp room where for certain amount of X coins you can summon almost any mvp, so adding a little increase drop rate to the private mvp room map would give it a plus, also this will help to basic mvp room maps too

 

well maybe not for a period of time, just making the whole map drop of monster increase would help a lot

 

thanks in advance (:

Edited by Kido
Link to comment
Share on other sites

10 answers to this question

Recommended Posts


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

PS: I'm the author of the script /oops

http://rathena.org/board/topic/72376-mvp-summon-script/?p=146696

 

 

anyways, what you are requesting is probably going to need source modification ...

introducing a new mapflag

06guild_01    mapflag    droprate    200
increase the item drop rate by 100% increase

do you know how to apply patch and recompile ?

 

because sometimes I waste my time created the patch and some members doesn't want to use it, they don't want to recompile <.<

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


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

haha thanks, yeah i know how to recompile, on centos and microsoft visual c++

i don't know how to patch x_x i didn't know about them at all haha

 

you the author? thanks for such cool script and well done ;D!

 

a mapflag for the % it's amazing, that will solve all o:!! 

Edited by Kido
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:  

that script was 5 years old already lol

looks outdated now, meh lazy to update =/

droprate.patch

droprate_20131229.patch

tested with

prontera,150,180,5	script	ksdjfjsdf	100,{
	input .@i, 1,1000000000;
	setmapflag strcharinfo(3), mf_droprate, .@i;
	end;
}
prontera	mapflag	droprate	100
either one works

btw, I follow bexp/jexp

prontera	mapflag	droprate	50
1/2 drop rate

prontera	mapflag	droprate	200
double drop rate

to apply patch, use tortoisegit

right click on the patch file, select Apply Patch ...

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

huh @_@ allright o:

 

i opened the patch and this appeared

 db/const.txt     | 1 +
 src/map/map.c    | 1 +
 src/map/map.h    | 1 +
 src/map/mob.c    | 4 ++++
 src/map/npc.c    | 6 ++++++
 src/map/pc.c     | 2 +-
 src/map/script.c | 6 +++++-
 7 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/db/const.txt b/db/const.txt
index d31c105..77c622d 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -379,6 +379,7 @@ mf_nomineeffect	57
 mf_nolockon	58
 mf_notomb	59
 mf_skill_damage	60
+mf_droprate	61
 
 //'setcell' types
 cell_walkable	0
diff --git a/src/map/map.c b/src/map/map.c
index a0562df..839e694 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -3081,6 +3081,7 @@ void map_flags_init(void)
 		map[i].nocommand   = 0;  // nocommand mapflag level
 		map[i].adjust.bexp = 100;  // per map base exp multiplicator
 		map[i].adjust.jexp = 100;  // per map job exp multiplicator
+		map[i].adjust.droprate = 100;  // per map job exp multiplicator
 		memset(map[i].drop_list, 0, sizeof(map[i].drop_list));  // pvp nightmare drop list
 
 		// skill damage
diff --git a/src/map/map.h b/src/map/map.h
index 3e44813..f14f6ee 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -618,6 +618,7 @@ struct map_data {
 	struct {
 		int jexp;	// map experience multiplicator
 		int bexp;	// map experience multiplicator
+		int droprate;	// map droprate multiplicator
 #ifdef ADJUST_SKILL_DAMAGE
 		struct s_skill_damage damage;
 #endif
diff --git a/src/map/mob.c b/src/map/mob.c
index ad5c387..f0f7b47 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2401,6 +2401,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 					drop_rate = 1;
 			}
 #endif
+
+			if ( map[m].adjust.droprate )
+				drop_rate = drop_rate * map[m].adjust.droprate / 100;
+
 			// attempt to drop the item
 			if (rnd() % 10000 >= drop_rate)
 					continue;
diff --git a/src/map/npc.c b/src/map/npc.c
index cb17f84..bd16eea 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3634,6 +3634,12 @@ static const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, con
 		if( map[m].adjust.bexp < 0 ) map[m].adjust.bexp = 100;
 		 map[m].flag.nobaseexp = (map[m].adjust.bexp==0)?1:0;
 	}
+	else if (!strcmpi(w3,"droprate")) {
+		map[m].adjust.droprate = (state) ? atoi(w4) : 100;
+		if( map[m].adjust.droprate < 0 ) map[m].adjust.droprate = 100;
+		map[m].flag.nomobloot = ( map[m].adjust.droprate== 0 )? 1:0;
+		map[m].flag.nomvploot = ( map[m].adjust.droprate== 0 )? 1:0;
+	}
 	else if (!strcmpi(w3,"loadevent"))
 		map[m].flag.loadevent=state;
 	else if (!strcmpi(w3,"nochat"))
diff --git a/src/map/pc.c b/src/map/pc.c
index bcc468e..c9d9795 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4750,7 +4750,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
 	}
 
 	// base skill success chance (percentual)
-	rate = (sd_status->dex - md_status->dex)/2 + skill_lv*6 + 4;
+	rate = ( (sd_status->dex - md_status->dex)/2 + skill_lv*6 + 4 ) * map[sd->bl.m].adjust.droprate / 100;
 	rate += sd->bonus.add_steal_rate;
 
 	if( rate < 1 )
diff --git a/src/map/script.c b/src/map/script.c
index 68551cd..3ac96ef 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -417,7 +417,8 @@ enum {
 	MF_NOMINEEFFECT,
 	MF_NOLOCKON,
 	MF_NOTOMB,
-	MF_SKILL_DAMAGE	//60
+	MF_SKILL_DAMAGE,	//60
+	MF_DROPRATE
 };
 
 const char* script_op2name(int op)
@@ -10894,6 +10895,7 @@ static int buildin_addrid_sub(struct block_list *bl,va_list ap)
 			case MF_NOMINEEFFECT:		script_pushint(st,map[m].flag.nomineeffect); break;
 			case MF_NOLOCKON:			script_pushint(st,map[m].flag.nolockon); break;
 			case MF_NOTOMB:				script_pushint(st,map[m].flag.notomb); break;
+			case MF_DROPRATE:			script_pushint(st,map[m].adjust.droprate); break;
 #ifdef ADJUST_SKILL_DAMAGE
 			case MF_SKILL_DAMAGE:
 				{
@@ -11017,6 +11019,7 @@ static int script_mapflag_pvp_sub(struct block_list *bl,va_list ap) {
 			case MF_NOMINEEFFECT:		map[m].flag.nomineeffect = 1 ; break;
 			case MF_NOLOCKON:			map[m].flag.nolockon = 1 ; break;
 			case MF_NOTOMB:				map[m].flag.notomb = 1; break;
+			case MF_DROPRATE:			map[m].adjust.droprate = (val <= 0) ? 100 : val; break;
 #ifdef ADJUST_SKILL_DAMAGE
 			case MF_SKILL_DAMAGE:
 				{
@@ -11128,6 +11131,7 @@ static int script_mapflag_pvp_sub(struct block_list *bl,va_list ap) {
 			case MF_NOMINEEFFECT:		map[m].flag.nomineeffect = 0 ; break;
 			case MF_NOLOCKON:			map[m].flag.nolockon = 0 ; break;
 			case MF_NOTOMB:				map[m].flag.notomb = 0; break;
+			case MF_DROPRATE:			map[m].adjust.droprate = 0; break;
 #ifdef ADJUST_SKILL_DAMAGE
 			case MF_SKILL_DAMAGE:
 				{

so i just need to make those changes to my server, then recompile and that's all o:?

i don't have git, i still use svn, i got in a big truble switching to git so i just keep the svn thing x_x

 

i understand that the minus means remove and the plus means add, but what does mean the @@ ? thanks again o: 

in the 90% of my answers i use this face --->  o:

Edited by Kido
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:  

diff --git a/src/map/mob.c b/src/map/mob.c
index ad5c387..f0f7b47 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2401,6 +2401,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 					drop_rate = 1;
 			}
 #endif
+
+			if ( map[m].adjust.droprate )
+				drop_rate = drop_rate * map[m].adjust.droprate / 100;
+
 			// attempt to drop the item
 			if (rnd() % 10000 >= drop_rate)
 					continue;
in src/map/mob.c file

search around the line 2401, inside mob_dead function

the mob_dead function has a line looks like

int mob_dead(struct mob_data *md, struct block_list *src, int type)
inside this function, search for if (rnd()%10000 .... add those lines above it with the '+'

this patch is quite hard to add manually, I think ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.08
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

oooo

diff --git a/src/map/mob.c b/src/map/mob.c
index ad5c387..f0f7b47 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2401,6 +2401,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 					drop_rate = 1;
 			}
 #endif
+
+			if ( map[m].adjust.droprate )
+				drop_rate = drop_rate * map[m].adjust.droprate / 100;
+
 			// attempt to drop the item
 			if (rnd() % 10000 >= drop_rate)
 					continue;
in src/map/mob.c file

search around the line 2401, inside mob_dead function

the mob_dead function has a line looks like

int mob_dead(struct mob_data *md, struct block_list *src, int type)
inside this function, search for if (rnd()%10000 .... add those lines above it with the '+'

this patch is quite hard to add, I think

 

annie, are u sure this script is working???

and btw how to hide the npc?

Edited by donkeyg
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

well huh i right clicked and selected "apply patch" and then a window appeared with all documents that would suffer changes

 

by clickng save, that changes will apply to that documenst without having to do it manually o:?

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:  

well huh i right clicked and selected "apply patch" and then a window appeared with all documents that would suffer changes

 

by clickng save, that changes will apply to that documenst without having to do it manually o:?

yes indeed

that's the purpose of making a diff / patch file

 

though it couldn't patch sometimes, due to changes of line in the file

happens when using old patch file on newer emulator version , or vice-versa

then have to patch manually then

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

oh allright o: kinda riskie x_x thanks, gonna try it o:

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