Jump to content

Zirius

Members
  • Content Count

    261
  • Joined

  • Last visited

Posts posted by Zirius


  1. src/map/atcommand.c

     

    Find "ACMD(send)", Add above:

    ACMD(storeitem) {	struct map_session_data *pl_sd;	struct item item_tmp;	struct item_data *item_data;	char item_name[ITEM_NAME_LENGTH];	char character[NAME_LENGTH];	int number = 0, item_id;	int get_count, i, pet_id, ref = 0;	memset(item_name, '0', sizeof(item_name));	if (!message || !*message || sscanf(message, "%49s %d %d %23[^n]", item_name, &number, &ref, character) < 4) {		clif->message(fd, "(usage: @storeitem <item name or ID> <quantity> <refine> <char name>).");		return false;	}	if( ref < 0 || ref > MAX_REFINE ) {		char output_p[124];		sprintf(output_p,"<refine> %d is out of bounds, limit is 0~%d. @storeitem failed.",ref,MAX_REFINE);		clif->message(fd,output_p);		return false;	}	if (number <= 0)		number = 1;	item_id = 0;	if ((item_data = itemdb->search_name(item_name)) != NULL || (item_data = itemdb->exists(atoi(item_name))) != NULL)			item_id = item_data->nameid;	else {		clif->message(fd, atcommand->msg_table[19]); // Invalid item ID or name.		return false;	}	/* only weapon (4) and armors (5) can refine, refineable item db field also applies */	if( ( item_data->type != 4 && item_data->type != 5 ) || item_data->flag.no_refine )			ref = 0;	get_count = number;	if (!itemdb->isstackable2(item_data)) { 		get_count = 1;	}	pet_id = pet->search_petDB_index(item_id, PET_EGG);	if (item_data->type == 4 || item_data->type == 5 || item_data->type == 7 || item_data->type == 8) {		get_count = 1;	}		if ((pl_sd = map->nick2sd(character)) != NULL) {		if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can add items only to groups of equal or lower level			for (i = 0; i < number; i += get_count) {					if (pet_id >= 0) {						pl_sd->catch_target_class = pet->db[pet_id].class_;						intif->create_pet(pl_sd->status.account_id, pl_sd->status.char_id,									(short)pet->db[pet_id].class_, (short)mob->db(pet->db[pet_id].class_)->lv,									(short)pet->db[pet_id].EggID, 0, (short)pet->db[pet_id].intimate,									100, 0, 1, pet->db[pet_id].jname);					} else {						memset(&item_tmp, 0, sizeof(item_tmp));						item_tmp.nameid = item_id;						item_tmp.identify = 1;						item_tmp.refine = ref;						storage->open(pl_sd);/* without open/close procedure the client requires you to relog to access storage properly */						storage->additem(pl_sd, &item_tmp, get_count);						storage->close(pl_sd);					}				}			//clif->message(fd, "Item has been added to your inventory.");		} else {			clif->message(fd, atcommand->msg_table[81]); // Your GM level don't authorise you to do this action on this player.			return false;		}	} else {		clif->message(fd, atcommand->msg_table[3]); // Character not found.		return false;	}		return true;}

    Find: "ACMD_DEF(costume),", Add below:

    ACMD_DEF(storeitem),

  2. Hello! Since I am having trouble making @storeitem works on my CentOS as plugin. Can somebody convert the following code into something that would work inside atcommand.c. So that I won't be needing anymore plugin tweaks.

     

    // Copyright (c) Hercules Dev Team, licensed under GNU GPL.// See the LICENSE file// Sample Hercules Plugin#include <stdio.h>#include <string.h>#include <stdlib.h>#include "../common/HPMi.h"#include "../map/atcommand.h"#include "../map/clif.h"#include "../map/itemdb.h"#include "../map/map.h"#include "../map/intif.h"#include "../map/status.h"#include "../map/unit.h"#include "../map/mob.h"#include "../map/pet.h"#include "../map/pc.h"#include "../map/storage.h"#include "../common/HPMDataCheck.h"/* Designed by Beowulf/Nightroad, HPM port by [Ind/Hercules] */HPExport struct hplugin_info pinfo = {	"@storeitem",	// Plugin name	SERVER_TYPE_MAP,// Which server types this plugin works with?	"0.1",			// Plugin version	HPM_VERSION,	// HPM Version (don't change, macro is automatically updated)};ACMD(storeitem) {	struct map_session_data *pl_sd;	struct item item_tmp;	struct item_data *item_data;	char item_name[ITEM_NAME_LENGTH];	char character[NAME_LENGTH];	int number = 0, item_id;	int get_count, i, pet_id, ref = 0;	memset(item_name, '0', sizeof(item_name));	if (!message || !*message || sscanf(message, "%49s %d %d %23[^n]", item_name, &number, &ref, character) < 4) {		clif->message(fd, "(usage: @storeitem <item name or ID> <quantity> <refine> <char name>).");		return false;	}	if( ref < 0 || ref > MAX_REFINE ) {		char output_p[124];		sprintf(output_p,"<refine> %d is out of bounds, limit is 0~%d. @storeitem failed.",ref,MAX_REFINE);		clif->message(fd,output_p);		return false;	}	if (number <= 0)		number = 1;	item_id = 0;	if ((item_data = itemdb->search_name(item_name)) != NULL || (item_data = itemdb->exists(atoi(item_name))) != NULL)			item_id = item_data->nameid;	else {		clif->message(fd, atcommand->msg_table[19]); // Invalid item ID or name.		return false;	}	/* only weapon (4) and armors (5) can refine, refineable item db field also applies */	if( ( item_data->type != 4 && item_data->type != 5 ) || item_data->flag.no_refine )			ref = 0;	get_count = number;	if (!itemdb->isstackable2(item_data)) { 		get_count = 1;	}	pet_id = pet->search_petDB_index(item_id, PET_EGG);	if (item_data->type == 4 || item_data->type == 5 || item_data->type == 7 || item_data->type == 8) {		get_count = 1;	}		if ((pl_sd = map->nick2sd(character)) != NULL) {		if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can add items only to groups of equal or lower level			for (i = 0; i < number; i += get_count) {					if (pet_id >= 0) {						pl_sd->catch_target_class = pet->db[pet_id].class_;						intif->create_pet(pl_sd->status.account_id, pl_sd->status.char_id,									(short)pet->db[pet_id].class_, (short)mob->db(pet->db[pet_id].class_)->lv,									(short)pet->db[pet_id].EggID, 0, (short)pet->db[pet_id].intimate,									100, 0, 1, pet->db[pet_id].jname);					} else {						memset(&item_tmp, 0, sizeof(item_tmp));						item_tmp.nameid = item_id;						item_tmp.identify = 1;						item_tmp.refine = ref;						storage->open(pl_sd);/* without open/close procedure the client requires you to relog to access storage properly */						storage->additem(pl_sd, &item_tmp, get_count);						storage->close(pl_sd);					}				}			//clif->message(fd, "Item has been added to your inventory.");		} else {			clif->message(fd, atcommand->msg_table[81]); // Your GM level don't authorise you to do this action on this player.			return false;		}	} else {		clif->message(fd, atcommand->msg_table[3]); // Character not found.		return false;	}		return true;}HPExport void plugin_init (void) {	atcommand = GET_SYMBOL("atcommand");	storage = GET_SYMBOL("storage");	clif = GET_SYMBOL("clif");	pc = GET_SYMBOL("pc");	map = GET_SYMBOL("map");	itemdb = GET_SYMBOL("itemdb");	intif = GET_SYMBOL("intif");	pet = GET_SYMBOL("pet");	mob = GET_SYMBOL("mob");	unit = GET_SYMBOL("unit");	addAtcommand("storeitem",storeitem);}

     

    Thanks!


  3. There already programs / bots that can answer reCaptcha successfully 100% of the time. All openkore needs to do is borrow that code or hook into those programs. Very easily done for a group of people dedicated to making these bots work.

     

    Thanks! I'm not aware that reCaptcha is already bypassable. But actually, I cannot find any program you are referring to.

     

     

    There already programs / bots that can answer reCaptcha successfully 100% of the time. All openkore needs to do is borrow that code or hook into those programs. Very easily done for a group of people dedicated to making these bots work.

    If still they dont code, they can do like, if mes appear, they will be alerted by sound on pc, which can help them to see npc chat on openkore, and the npc message will be somethijg like, <LINK> recaptcha link </LINK> and so, making the link visible to openkore, so they can open up that link, enter recaptcha, and continue botting.

     

    But that stops botting if the player is not online. After all, the big use of bot is if the user is not in front of his PC. Hence, majority of the job is done. There could be lots of improvement to that antibot. I believe external captcha is key to prevent these bots.


  4.  

    How about add captcha to antibots script

     

    rathena.org/board/topic/98175-recaptcha

     

    it would be demotivational

     

     

    still can bot, remember, those links are sended by mes command which are read by openkore, and they can see link, go to that link, and enter captcha. But I agree,it would be demotivational.

     

    Bro, I wanna know how could still be bypassable by bot. reCaptcha is an external captcha. Unless, openkore could create script that answers reCaptcha successfully.


  5. Bro, can you please check, I diffed via Nemo, I did not diff "Read Data Folder First"

    But, without the clientinfo.xml inside data folder, my client won't connect.

     

    But pretty sure it is ready my multiple grf and my custom data.ini

     

    I am using 20120410 client.


  6. One option is, have a copy of old MD5 password,

    use MD5 generator and convert your preferred password for him/her

    put the generated password to his login data via SQL

    login via new password, inspect

    then return his old password.


  7. Why am I having this error on my CentOS? in works on windows.

    I already added in to makefile.in, make plugins output:

     

     *** No rule to make target `@storeitem', needed by `all'.  Stop.make: *** [plugins] Error 2

    Thanks!


  8. I think this would be great feature for Hercules.

     

    On @whodrops Knife, Hercules would first list all "Knife" items from item_db, composed of Knife_,Knife__, etc.

    The thing is, I don't think players are interested at knowing items that are not even dropped by mobs (unless otherwise specified by @whodrops ID), so I think there should be no more reason to show them, plus there's @iteminfo to do that.

     

    What the current script does, is list all the items that has the keyword knife, then one by one get the names and drop chance of each.

    What I think should be better (though I think more resource consuming), pull all the items that are listed on the mob drops in mob_db, then from that list, start searching. This way, @whodrops will not show any more of those Rental Boxes, etc.

     

    I'd been playing with that atcommand.c for sometime now, and can't get it work.

     

    LOL.

     

    Thanks!

     

    Add. I think the better way is, for the herc to create a cache at init, to list all items under mob_db. Then @whodrops, it would retrieve only items inside that cache. The cache would be refreshed/regenerated upon @reloaditemdb/@reloadmobdb

     

    Thanks!


  9. Hello! I got this script:

     

    prontera,155,180,4	script	This eynt working#2	1_ETC_01,{	if (da_var < 3 ) {			while (da_var < 3) {			switch(da_var) {				case 0:										mes "you hit 0";					da_var = 1;					next;					break;				case 1:										mes "you hit 1";					da_var = 2;					next;					break;				case 2:										mes "you hit 2";					da_var = 3;					mes "Do you want to proceed?";					next;					break;				case 3:										mes "you hit 3";					da_var = 4;					next;					break;			}		}	} else {		mes "you hit rock bottom";		close;	}}
    basically, what it does is: a player talks to it and sets the variable "da_var" window by window until it reach "da_var" = 4. What I wish is once it goes to "da_var =4", the NPC would say: "you hit rock bottom" without re-talking to it again. If you test the script, it would get stuck at "you hit 3" and will never go to "you hit rock bottom", unless you re-talk to it.

     

    Hope somebody can help.

    Thanks!


  10.  

    P.S. Nemo Patcher can't diff it for me.

     

    Eh Why? what error did u get with the patcher  :rolleyes:

    Packet First Key Encryption: Failed in part 1. 

    I think that means NEMO can't find the hex?

     

    Though my tortoise says I am still updated.

     

    LOL. I just learned you are the developer of the program. (thumbs up!) Btw, I want to report a minor feature bug. If you load the client, and apply a patch where NEMO fails, says like above, the patch applied counter becomes -1. Its nothing though, just want to inform anyway. LOL.

     

    Sorry, seems like I just need to update my nemo. what a shame. though, GIT said I'm updated.

    post-6720-0-76752000-1411138975_thumb.jpg


  11. attachicon.gifscreenHercules027.jpg

     

    20140115

     

    maybe should move to client support ?

     

    post-6720-0-74376800-1411119567_thumb.jpgpost-6720-0-03286000-1411119570_thumb.jpg

     

    (using 20140115)

     

    Waa starting to think it is not client based.

     

    Mam (or anybody), can you please confirm my GIT is same as yours?

     

    ACMD(fontcolor) {	unsigned char k;	unsigned short msg_len = 1;	char mout[40];	if( !message || !*message ) {		for( k = 0; k < hChSys.colors_count; k++ ) {			msg_len += sprintf(mout, "[ %s ] : %s",command,hChSys.colors_name[k]);						WFIFOHEAD(fd,msg_len + 12);			WFIFOW(fd,0) = 0x2C1;			WFIFOW(fd,2) = msg_len + 12;			WFIFOL(fd,4) = 0;			WFIFOL(fd,8) = hChSys.colors[k];			safestrncpy((char*)WFIFOP(fd,12), mout, msg_len);			WFIFOSET(fd, msg_len + 12);		}		return false;	}		if( message[0] == '0' ) {		sd->fontcolor = 0;		return true;	}		for( k = 0; k < hChSys.colors_count; k++ ) {		if( strcmpi(message,hChSys.colors_name[k]) == 0 )			break;	}	if( k == hChSys.colors_count ) {		sprintf(atcmd_output, msg_txt(1411), message);// Unknown color '%s'		clif->message(fd, atcmd_output);		return false;	}		sd->fontcolor = k + 1;	msg_len += sprintf(mout, "Color changed to '%s'",hChSys.colors_name[k]);		WFIFOHEAD(fd,msg_len + 12);	WFIFOW(fd,0) = 0x2C1;	WFIFOW(fd,2) = msg_len + 12;	WFIFOL(fd,4) = 0;	WFIFOL(fd,8) = hChSys.colors[k];	safestrncpy((char*)WFIFOP(fd,12), mout, msg_len);	WFIFOSET(fd, msg_len + 12);	return true;}

    Why is my characters doing that.


  12.  

    I'm just wondering, if it is possible to completely compile Hercules without the old mysql, since MariaDB is wayyyy much faster, and Hercules is also fast, why not make Herc support MariaDB. I can run Herc via MariaDB when I am here at my windows platform, but on *nix, make sql requires the mysql stuff.

     

    Sorry, I am not familiar with compiling, so have no idea if this topic is absurd. LOL.

     

    THanks!

    Not used mariadb, but it seems like, mariadb supports mysql, so you can use it(I dont think it will error out)

     

    Yes man, I am using it with my Herc in my windows platform via XAMPP. And I can assure you it works wayyyyy tooo faster that mySQL.

    My issue is, on my *nix server, I cannot compile herc because it would need mysql dev. So you would need to install mySQL. which actually consumes memory wayyyy toooo big than MariaDB uses.

    So, if anyone knows any MariaDB package that can replace what Herc compiling needs, that would be great.

     

    Thanks man!


  13. try this

    attachicon.gif@storeitem.c

     

    wew! Beat me to it. I am supposed to also update the plugin. Btw, the old plugin is not yet configured to stack stackable items.

     

    Find:

     

    	if( ( item_data->type != 4 && item_data->type != 5 ) || item_data->flag.no_refine )			ref = 0;	get_count = number;

    Add after:

     

    	if (!itemdb->isstackable2(item_data)) { 		get_count = 1;	}

    For now, create_pet() seems to be attached to player only. So, putting it to storage fails.

×
×
  • Create New...

Important Information

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