Jump to content
  • 0
Sign in to follow this  
Zezicla

add rathena new aloot type

Question

15 answers to this question

Recommended Posts

  • 0

Should I pull request? Its ok if its rejected.

 

pull the aloot type, but not the @autoattack

it will get accepted for sure

Share this post


Link to post
Share on other sites
  • 0

conf/atcommand_athena.conf

 

 

... ... @@ -59,6 +59,7 @@ aliases: {
59 59 accinfo: ["accountinfo"]
60 60 itemreset: ["clearinventory"]
61 61 channel: ["main"]
62 + autoloottype: ["aloottype"]
62 63 }
63 64
64 65 /* Commands help file */

 

 

conf/groups.conf

 

 

... ... @@ -125,6 +125,7 @@ groups: (
125 125 noks: true
126 126 autoloot: true
127 127 alootid: true
128 + autoloottype: true
128 129 autotrade: true
129 130 request: true
130 131 go: true

 

 


conf/msg_conf/map_msg.conf

 

 

... ... @@ -1478,5 +1478,19 @@
1478 1478 1478: Party share level range has been changed successfully.
1479 1479 1479: Failed to update configuration. Character server is offline.
1480 1480
1481 +// @autoloottype
1482 +1480: Item type not found.
1483 +1481: You're already autolooting this item type.
1484 +1482: Your autoloottype list has all item types. You can remove some items with @autoloottype -.
1485 +1483: Autolooting item type: '%s' {%d}
1486 +1484: You're currently not autolooting this item type.
1487 +1485: Removed item type: '%s' {%d} from your autoloottype list.
1488 +1486: To add an item type to the list, use "@aloottype +". To remove an item type, use "@aloottype -".
1489 +1487: Type List: healing = 0, usable = 2, etc = 3, weapon = 4, armor = 5, card = 6, petegg = 7, petarmor = 8, ammo = 10
1490 +1488: "@aloottype reset" will clear your autoloottype list.
1491 +1489: Your autoloottype list is empty.
1492 +1490: Item types on your autoloottype list:
1493 +1491: Your autoloottype list has been reset.
1494 +
1481 1495 //Custom translations
1482 1496 //import: conf/msg_conf/import/map_msg_eng_conf.txt

 

 

doc/atcommands.txt

 

 

... ... @@ -356,6 +356,15 @@ By default, 10 items can be autolooted at one time.
356 356
357 357 ---------------------------------------
358 358
359 +@autoloottype <+/- type name/ID>
360 +@autoloottype reset
361 +
362 +Starts or stops autolooting a specified item type.
363 +Type List: healing = 0, usable = 2, etc = 3, weapon = 4, armor = 5, card = 6, petegg = 7, petarmor = 8, ammo = 10
364 +Typing "reset" will clear the autoloot item list.
365 +
366 +---------------------------------------
367 +
359 368 @mobsearch
360 369
361 370 Locates and displays the position of a certain mob on the current map.

 

 


src/map/atcommand.c

 

 

... ... @@ -5851,6 +5851,8 @@ void getring (struct map_session_data* sd)
5851 5851 int i;
5852 5852 int action = 3; // 1=add, 2=remove, 3=help+list (default), 4=reset
5853 5853
5854 + nullpo_retr(-1, sd);
5855 +
5854 5856 if (message && *message) {
5855 5857 if (message[0] == '+') {
5856 5858 message++;
... ... @@ -5937,6 +5939,117 @@ void getring (struct map_session_data* sd)
5937 5939 }
5938 5940 return 0;
5939 5941 }
5942 +
5943 +/*==========================================
5944 + * @autoloottype
5945 + * Flags:
5946 + * 1: IT_HEALING, 2: IT_UNKNOWN, 4: IT_USABLE, 8: IT_ETC,
5947 + * 16: IT_WEAPON, 32: IT_ARMOR, 64: IT_CARD, 128: IT_PETEGG,
5948 + * 256: IT_PETARMOR, 512: IT_UNKNOWN2, 1024: IT_AMMO, 2048: IT_DELAYCONSUME
5949 + * 262144: IT_CASH
5950 + *------------------------------------------
5951 + * Credits:
5952 + * chriser
5953 + * Aleos
5954 + *------------------------------------------*/
5955 +ACMD_FUNC(autoloottype)
5956 +{
5957 + uint8 i = 0, action = 3; // 1=add, 2=remove, 3=help+list (default), 4=reset
5958 + enum item_types type;
5959 + int ITEM_NONE = 0, ITEM_MAX = 1533;
5960 +
5961 + nullpo_retr(-1, sd);
5962 +
5963 + if (message && *message) {
5964 + if (message[0] == '+') {
5965 + message++;
5966 + action = 1;
5967 + }
5968 + else if (message[0] == '-') {
5969 + message++;
5970 + action = 2;
5971 + }
5972 + else if (!strcmp(message,"reset"))
5973 + action = 4;
5974 + }
5975 +
5976 + if (action < 3) { // add or remove
5977 + if ((strncmp(message, "healing", 3) == 0) || (atoi(message) == 0))
5978 + type = IT_HEALING;
5979 + else if ((strncmp(message, "usable", 3) == 0) || (atoi(message) == 2))
5980 + type = IT_USABLE;
5981 + else if ((strncmp(message, "etc", 3) == 0) || (atoi(message) == 3))
5982 + type = IT_ETC;
5983 + else if ((strncmp(message, "weapon", 3) == 0) || (atoi(message) == 4))
5984 + type = IT_WEAPON;
5985 + else if ((strncmp(message, "armor", 3) == 0) || (atoi(message) == 5))
5986 + type = IT_ARMOR;
5987 + else if ((strncmp(message, "card", 3) == 0) || (atoi(message) == 6))
5988 + type = IT_CARD;
5989 + else if ((strncmp(message, "petegg", 4) == 0) || (atoi(message) == 7))
5990 + type = IT_PETEGG;
5991 + else if ((strncmp(message, "petarmor", 4) == 0) || (atoi(message) == 8))
5992 + type = IT_PETARMOR;
5993 + else if ((strncmp(message, "ammo", 3) == 0) || (atoi(message) == 10))
5994 + type = IT_AMMO;
5995 + else {
5996 + clif_displaymessage(fd, msg_txt(sd,1480)); // Item type not found.
5997 + return -1;
5998 + }
5999 + }
6000 +
6001 + switch (action) {
6002 + case 1:
6003 + if (sd->state.autoloottype&(1< 6004 + clif_displaymessage(fd, msg_txt(sd,1481)); // You're already autolooting this item type.
6005 + return -1;
6006 + }
6007 + if (sd->state.autoloottype == ITEM_MAX) {
6008 + clif_displaymessage(fd, msg_txt(sd,1482)); // Your autoloottype list has all item types. You can remove some items with @autoloottype -.
6009 + return -1;
6010 + }
6011 + sd->state.autolootingtype = 1; // Autoloot Activated
6012 + sd->state.autoloottype |= (1< 6013 + sprintf(atcmd_output, msg_txt(sd,1483), itemdb_typename(type), type); // Autolooting item type: '%s' {%d}
6014 + clif_displaymessage(fd, atcmd_output);
6015 + break;
6016 + case 2:
6017 + if (!(sd->state.autoloottype&(1< 6018 + clif_displaymessage(fd, msg_txt(sd,1484)); // You're currently not autolooting this item type.
6019 + return -1;
6020 + }
6021 + sd->state.autoloottype &= ~(1< 6022 + sprintf(atcmd_output, msg_txt(sd,1485), itemdb_typename(type), type); // Removed item type: '%s' {%d} from your autoloottype list.
6023 + clif_displaymessage(fd, atcmd_output);
6024 + if (sd->state.autoloottype == ITEM_NONE)
6025 + sd->state.autolootingtype = 0;
6026 + break;
6027 + case 3:
6028 + clif_displaymessage(fd, msg_txt(sd,1486)); // To add an item type to the list, use "@aloottype +". To remove an item type, use "@aloottype -".
6029 + clif_displaymessage(fd, msg_txt(sd,1487)); // Type List: healing = 0, usable = 2, etc = 3, weapon = 4, armor = 5, card = 6, petegg = 7, petarmor = 8, ammo = 10
6030 + clif_displaymessage(fd, msg_txt(sd,1488)); // "@aloottype reset" will clear your autoloottype list.
6031 + if (sd->state.autoloottype == ITEM_NONE)
6032 + clif_displaymessage(fd, msg_txt(sd,1489)); // Your autoloottype list is empty.
6033 + else {
6034 + clif_displaymessage(fd, msg_txt(sd,1490)); // Item types on your autoloottype list:
6035 + while (i < IT_MAX) {
6036 + if (sd->state.autoloottype&(1< 6037 + sprintf(atcmd_output, " '%s' {%d}", itemdb_typename(i), i);
6038 + clif_displaymessage(fd, atcmd_output);
6039 + }
6040 + i++;
6041 + }
6042 + }
6043 + break;
6044 + case 4:
6045 + sd->state.autoloottype = ITEM_NONE;
6046 + sd->state.autolootingtype = 0;
6047 + clif_displaymessage(fd, msg_txt(sd,1491)); // Your autoloottype list has been reset.
6048 + break;
6049 + }
6050 + return 0;
6051 +}
6052 +
5940 6053 /**
5941 6054 * No longer available, keeping here just in case it's back someday. [ind]
5942 6055 **/
... ... @@ -9284,6 +9397,7 @@ void atcommand_basecommands(void) {
9284 9397 ACMD_DEF(changelook),
9285 9398 ACMD_DEF(autoloot),
9286 9399 ACMD_DEF2("alootid", autolootitem),
9400 + ACMD_DEF(autoloottype),
9287 9401 ACMD_DEF(mobinfo),
9288 9402 ACMD_DEF(exp),
9289 9403 ACMD_DEF(version),

))>);
)))>);>))>

 

src/map/pc.c

 

 

... ... @@ -9464,11 +9464,18 @@ void pc_overheat(struct map_session_data *sd, int val) {
9464 9464 */
9465 9465 bool pc_isautolooting(struct map_session_data *sd, int nameid)
9466 9466 {
9467 - int i;
9468 - if( !sd->state.autolooting )
9467 + uint8 i;
9468 + bool j = false;
9469 +
9470 + if (!sd->state.autolooting && !sd->state.autolootingtype)
9469 9471 return false;
9470 - ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid == nameid);
9471 - return (i != AUTOLOOTITEM_SIZE);
9472 +
9473 + if (sd->state.autolooting)
9474 + ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid == nameid);
9475 + if (sd->state.autolootingtype && sd->state.autoloottype&(1< 9476 + j = true;
9477 +
9478 + return (i != AUTOLOOTITEM_SIZE || j );
9472 9479 }
9473 9480
9474 9481 /**

(nameid)))

 

src/map/pc.h

 

 

... ... @@ -184,7 +184,9 @@ struct map_session_data {
184 184 short pmap; // Previous map on Map Change
185 185 unsigned short autoloot;
186 186 unsigned short autolootid[AUTOLOOTITEM_SIZE]; // [Zephyrus]
187 + unsigned short autoloottype;
187 188 unsigned int autolooting : 1; //performance-saver, autolooting state for @alootid
189 + unsigned int autolootingtype : 1; //performance-saver, autolooting state for @autoloottype
188 190 unsigned short autobonus; //flag to indicate if an autobonus is activated. [inkfish]
189 191 struct guild *gmaster_flag;
190 192 unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not.

 

new autoloot rathena.rar

Share this post


Link to post
Share on other sites
  • 0

now in rathena they improved the @autoloot.

 

why not in hercules make the one click autoattack specific monster?

not like bot. that walk around to attack any monster.

this is auto attack will just attack the same monster that you first attack and will just hunt same monster that you will see in screen.

then after being idle you have to click another monster to attack.

Edited by themon

Share this post


Link to post
Share on other sites
  • 0

now in rathena they improved the @autoloot.

 

why not in hercules make the one click autoattack specific monster?

not like bot. that walk around to attack any monster.

this is auto attack will just attack the same monster that you first attack and will just hunt same monster that you will see in screen.

then after being idle you have to click another monster to attack.

 

because that is weird to be built in in the emulator, it is better to be a plugin

Share this post


Link to post
Share on other sites
  • 0

Added a Pull Request: https://github.com/HerculesWS/Hercules/pull/195

If they didn't accept it, then for those who want this feature: autoloottype.diff (Here's a Diff)

 

 

now in rathena they improved the @autoloot.

 

why not in hercules make the one click autoattack specific monster?

not like bot. that walk around to attack any monster.

this is auto attack will just attack the same monster that you first attack and will just hunt same monster that you will see in screen.

then after being idle you have to click another monster to attack.

Autoattack i think not a command that most of server owners needed(Its like how can they know if someone is idle), what will be the difference in botting and autoattacking, from botting too we search for a particular type of mob.

Edited by Dastgir Pojee

Share this post


Link to post
Share on other sites
  • 0

The auto attack I'm looking for is not like a bot because you still have to control it. It will only attack what you attack first and will not attack or walk in random.

Share this post


Link to post
Share on other sites
  • 0

The auto attack I'm looking for is not like a bot because you still have to control it. It will only attack what you attack first and will not attack or walk in random.

 

 

the autoattack patch you provided , walks random  and attack all in the range.

Share this post


Link to post
Share on other sites
  • 0

Its goddameit auto attack

How can I edit it work like what I explained earlier?

What I like is like auto chase same monster and the AoE is just screen wide only and when their is no monster left in the screen it will stop and you will have to attack again a new monster. How about right now I don't have to press control to attack the one monster and I would like to make an option that when you hold ctrl+click monster it will attack only that kind of monster on the screen.

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.