summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-20 16:02:22 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-20 16:02:22 +0000
commit4f06f94e70e92904a8d86be32de0b1dfb6c35633 (patch)
treeef36652e967a87f3d0fdbaa61d910e4b464516a2
parentf3e0608b8871675ec21c8da90ea3ca545f54e017 (diff)
downloadhercules-4f06f94e70e92904a8d86be32de0b1dfb6c35633.tar.gz
hercules-4f06f94e70e92904a8d86be32de0b1dfb6c35633.tar.bz2
hercules-4f06f94e70e92904a8d86be32de0b1dfb6c35633.tar.xz
hercules-4f06f94e70e92904a8d86be32de0b1dfb6c35633.zip
- getpetinfo 5 will now return the pet's rename flag.
- Autoloot will now only work on items dropped a certain distance from the player. The distance is defined by AUTOLOOT_DISTANCE in atcommand.h and defaults to AREA_SIZE. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10039 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--doc/script_commands.txt2
-rw-r--r--src/map/atcommand.h7
-rw-r--r--src/map/mob.c3
-rw-r--r--src/map/script.c5
5 files changed, 18 insertions, 3 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 0f6f9d444..34c00bb9f 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/03/21
+ * getpetinfo 5 will now return the pet's rename flag.
+ * Autoloot will now only work on items dropped a certain distance from the
+ player. The distance is defined by AUTOLOOT_DISTANCE in atcommand.h and
+ defaults to AREA_SIZE.
* Removed Magic Rod's cast bar.
* Gravitation no longer causes damage flinch. [Skotlex]
2007/03/20
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 3514ccd57..f6c9c4162 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -2737,7 +2737,7 @@ currently has active. Valid types are:
2 - Pet name. Will return "null" if there's no pet.
3 - Pet friendly level (intimacy score). 1000 is full loyalty.
4 - Pet hungry level. 100 is completely full.
-
+ 5 - Pet rename flag. 0 means this pet has not been named yet.
---------------------------------------
*petstat(<flag>)
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index dfcbd2de7..d18e8e923 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -4,6 +4,13 @@
#ifndef _ATCOMMAND_H_
#define _ATCOMMAND_H_
+//This is the distance at which @autoloot works,
+//if the item drops farther from the player than this,
+//it will not be autolooted. [Skotlex]
+#ifndef AUTOLOOT_DISTANCE
+ #define AUTOLOOT_DISTANCE AREA_SIZE
+#endif
+
enum AtCommandType {
AtCommand_None = -1,
AtCommand_Broadcast = 0,
diff --git a/src/map/mob.c b/src/map/mob.c
index 4cde44b84..c56e4362f 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1494,7 +1494,8 @@ static void mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, str
}
if (dlist->first_sd && dlist->first_sd->state.autoloot &&
- (drop_rate <= dlist->first_sd->state.autoloot)
+ drop_rate <= dlist->first_sd->state.autoloot &&
+ check_distance_blxy(&dlist->first_sd->bl, dlist->x, dlist->y, AUTOLOOT_DISTANCE)
) { //Autoloot.
if (party_share_loot(
dlist->first_sd->status.party_id?
diff --git a/src/map/script.c b/src/map/script.c
index 5d7c3154d..e75456b63 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10663,7 +10663,7 @@ BUILDIN_FUNC(recovery)
/*==========================================
* Get your pet info: getpetinfo(n)
* n -> 0:pet_id 1:pet_class 2:pet_name
- 3:friendly 4:hungry
+ * 3:friendly 4:hungry, 5: rename flag.
*------------------------------------------
*/
BUILDIN_FUNC(getpetinfo)
@@ -10693,6 +10693,9 @@ BUILDIN_FUNC(getpetinfo)
case 4:
script_pushint(st,pd->pet.hungry);
break;
+ case 5:
+ script_pushint(st,pd->pet.rename_flag);
+ break;
default:
script_pushint(st,0);
break;