-
Content Count
1677 -
Joined
-
Last visited
-
Days Won
246
Content Type
Profiles
Forums
Downloads
Staff Applications
Calendar
Everything posted by AnnieRuru
-
@Darkpurple nope, this modification took me 2 full days to write, very time consuming stuffs go ahead and buy from roserver or cydh ... I don't care seriously, you should consider switch to hercules because I noticed you always follow my posts @THPO fixed in 1.0a
-
Download: 1.5 plugin create table maintenance ( id int primary key auto_increment, account_id int, name varchar(23), reason varchar(99), minlv2connect tinyint, order_time datetime, start_time datetime, end_time datetime ) engine = innodb; . remember to enable HPMHooking to enable this modification plugins_list: [ /* Enable HPMHooking when plugins in use rely on Hooking */ "HPMHooking", . . Note: sometimes the server countdown jumps 1 second ahead this is normal because the timetick from time->add is unstable so I use unix_time to synchronize the countdown to server time . . so, if you found some script/source code having bugs and you need to shut down your server for a short while then you come to the right place . @maintenance <Group ID can stay 1~99> <duration to kick in minute> <maintenance duration in minute> <reason> then a GM99 can commence the maintenance Example : '@maintenance 40 5 10 need to fix announcer script' every player with group ID 40 and below will be kick after 5 minutes and the server will start counting down by an announcement, during the maintenance of 10 minutes, group ID 40 and below will deny from login into the server `maintenance` table will also generate a new line, with the `reason` field as 'need to fix announcer script' which is useful to know when and how many times you did emergency server shutdown though, the actual reason for using SQL is to persist the data after server shutdown so the server will continue being in maintenance mode despite how many times you have shut down the server until it times up ( `end_time` field ), or manually do `@maintenanceoff` Note: you can't generate a new line using 'INSERT INTO' Sql syntax when server is online because I declare a bunch of variables to for them, for the purpose of saving memory consumption you have to login the game and type `@maintenance` to initiate the maintenance mode, otherwise it wont work. . . . @maintenanceoff if you have already finished fixing the script/source code, and there's still a lot of time left you can type '@maintenanceoff' to immediately turn off the maintenance mode so players can login before the schedule. . . . . -- Script commands -- . *maintenance <Group ID can stay 1~99>, <duration to kick in minute>, <maintenance duration in minute> { , <reason> }; . . actually I have no idea why I wanna make a script command ... maybe just for fun ? . - script jsdfksdj FAKE_NPC,{ OnMon0255: maintenance 40, 5, 60; end; } . this will make an announcement on Monday, 2:55AM that the server will have a regular server maintenance starts from 3AM to 4AM during that time, player with group ID 40 will be kicked and blocked from entering the server the `reason` field in `maintenance` table will be defaulted to '*Regular server maintenance*' . maintenance 40, 5, 60, "系统保养"; this will overwrite the `reason` field in `maintenance` table to '系统保养' instead of regular maintenance . . *maintenanceoff { <reason> }; uhh ... useless I think ... . . *maintenancecheck( <type> ); use 'maintenance()' to check the server is currently in maintenance mode or not return 0 if server is normal return 1 if server is going to have maintenance return 2 if server is having maintenance all other types are meant to myself to debug this junk
-
char_id of all the players in a particular area
AnnieRuru replied to Squall's question in Script Support
http://herc.ws/board/topic/4593-getmemberaid-checkmes/ // return account_id of all online players within the specific coordinatesprontera,153,185,5 script AREA_coordinate 100,{ getmapxy .@map$, .@x, .@y, 0; detachrid; getmemberaid AREA, .@map$, .@x-1, .@y-1, .@x+1, .@y+1; for ( .@i = 0; .@i < $@onlinecount; .@i++ ) announce rid2name( $@onlineaid[.@i] ), bc_all; end;}.. why you need char_id instead of account_id ? because of *warpchar ? better just use *areawarp -
huh ? since when archive type table couldn't support auto_increment ? I still using MySQL 5.1 ... maybe change 'engine = archive' into 'engine = innodb' and what's on the line 501,503,539,547 ? maybe copy paste my code in {code} tag then comment on the line number if (1) // line501 http://upaste.me/4aea36 create table maintenance (id int(11) primary key auto_increment,account_id int(11),name varchar(23),reason varchar(99),minlv2connect tinyint(4),order_time datetime,start_time datetime,end_time datetime) engine = innodb; finished the script command, now start converting ...
-
awww .... give me a break @GmOcean need problem with hooking ? just post the script in source support and someone might answer and yes, everything is possible with plugin for this system, as guild.c is under srcmap folder so just hook the guild->xxxx function that you think it might work guild->delalliance ... { clif->guild_delalliance ... guild B } @Luffy kro has this http://herc.ws/board/blog/1/entry-48-a-peek-on-clans/ don't ask me, go ask Ind
-
its been 2 days and still just 70% complete and the script is getting too large, so I need to save this here to create as a backup http://upaste.me/9b7fdd create table maintenance (id int(11) primary key auto_increment,account_id int(11),name varchar(23),reason varchar(99),minlv2connect tinyint(4),order_time datetime,start_time datetime,end_time datetime) engine = archive;.. still have *maintenance script command, and convert into plugin feel free to try and report any bug
-
ACMD(test1) { int account_id; char player_name[NAME_LENGTH]; if ( SQL->Query( map->mysql_handle, "select name, account_id from `char` where account_id = 2000000" ) == SQL_ERROR ) { Sql_ShowDebug( map->mysql_handle ); return false; } else if ( SQL->NextRow( map->mysql_handle ) == SQL_SUCCESS ) { char *data; if ( SQL->GetData( map->mysql_handle, 0, &data, NULL ) == SQL_SUCCESS ) safestrncpy( player_name, data, NAME_LENGTH ); if ( SQL->GetData( map->mysql_handle, 1, &data, NULL ) == SQL_SUCCESS ) account_id = atoi(data); SQL->FreeResult( map->mysql_handle ); } else { SQL->FreeResult( map->mysql_handle ); return false; } safesnprintf( atcmd_output, 255, "%s %d", player_name, account_id ); clif->message( fd, atcmd_output ); return true;}ACMD(test2) { char strings1[40], strings2[40]; if ( SQL->Query( map->mysql_handle, "select lastlogin, date_format( lastlogin,' %W %l %i %p') from login where account_id = 2000000" ) == SQL_ERROR ) { Sql_ShowDebug( map->mysql_handle ); return false; } else if ( SQL->NextRow( map->mysql_handle ) == SQL_SUCCESS ) { char *data; size_t len; if ( SQL->GetData( map->mysql_handle, 0, &data, &len ) == SQL_SUCCESS ) safestrncpy( strings1, data, 40 );// if ( SQL->GetData( map->mysql_handle, 1, &data, NULL ) == SQL_SUCCESS ) { if ( SQL->GetData( map->mysql_handle, 1, &data, &len ) == SQL_SUCCESS ) { safestrncpy( strings2, data, 40 ); ShowDebug( "%s %s", data, strings2 ); } SQL->FreeResult( map->mysql_handle ); } else { SQL->FreeResult( map->mysql_handle ); return false; } safesnprintf( atcmd_output, 255, "%s %s", strings1, strings2 ); clif->message( fd, atcmd_output ); return true;} ACMD_DEF(test1), ACMD_DEF(test2), @test1 return AnnieRuru 2000000 @test2 return 2014-09-10 16:41:34 W 1226864 0012B3A8 ???? why is "date_format( lastlogin,' %W %l %i %p')" gives funny numbers ? I couldn't figure out why using the same syntax, same script, just different query can lead to different result ? and the exact same query, when use in a npc, it doesn't bug at all - script kjsdhfkjsdhf -1,{OnInit: query_sql "select lastlogin, date_format( lastlogin,' %W %l %i %p') from login where account_id = 2000000", .@time1$, .@time2$; announce .@time1$ +" "+ .@time2$, 0;}
-
you mean login_config.min_group_id_to_connect ? this value is defined in srcloginlogin.h, and currently plugin not able to read anything outside srcmap folder so I'm not going to use that btw ... I pull back the statement saying this is a simple mod when imagine in theory, I pictured it just about 3 functions and 1 sql table but when try it out ... there seems to have a lot of limitations ... none the less, I still can get this done, just take longer time @others I used to have AnnieRuru fan club back in 2008 but it was dissolved when ToastofDoom and Nymphycus joined scripting moderator in eathena ( not to mentioned Keyworld too ) so now its no more ... LOL
-
HPM Hooking return random value from the defined function
AnnieRuru replied to AnnieRuru's question in Plugin Support
tried that [Debug]: 4. EnnyRuru try to login. Value 150001 Group 99. [Debug]: 4. RimuRuru try to login. Value 150005 Group 0. weird, why it display their char_id instead of group id opsss ~ forgot to change 'time_t expiration_time' into 'time_t *expiration_time' now this is working #include <stdio.h>#include <string.h>#include <stdlib.h>#include "../map/pc.h"#include "../common/HPMi.h"#include "../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */HPExport struct hplugin_info pinfo = { "maintenance", // Plugin name SERVER_TYPE_MAP,// Which server types this plugin works with? "1.0", // Plugin version HPM_VERSION, // HPM Version (don't change, macro is automatically updated)};bool pc_authok_pre( struct map_session_data *sd, int *login_id2, time_t *expiration_time, int *group_id, struct mmo_charstatus *st, bool *changing_mapservers ) {// ShowDebug ( "1. %s try to login. Value %d Group %d.", sd->status.name, group_id, sd->group_id );// ShowDebug ( "1. %s try to login. Value %d Group %d.", sd->status.name, &group_id, sd->group_id ); ShowDebug ( "1. %s try to login. Value %d Group %d.", sd->status.name, *group_id, sd->group_id ); if ( *group_id < 99 ) { clif->authfail_fd( sd->fd, 1 ); return false; } return true;}bool pc_authok_post( int retVal, struct map_session_data *sd, int *login_id2, time_t *expiration_time, int *group_id, struct mmo_charstatus *st, bool *changing_mapservers ) {// ShowDebug ( "4. %s try to login. Value %d Group %d.", sd->status.name, group_id, sd->group_id );// ShowDebug ( "4. %s try to login. Value %d Group %d.", sd->status.name, &group_id, sd->group_id ); ShowDebug ( "4. %s try to login. Value %d Group %d.", sd->status.name, *group_id, sd->group_id ); if ( sd->group_id < 99 ) { clif->authfail_fd( sd->fd, 1 ); return false; } return true;}HPExport void plugin_init (void) { clif = GET_SYMBOL("clif"); addHookPre( "pc->authok", pc_authok_pre ); addHookPost( "pc->authok", pc_authok_post );}it seems that I didn't read the documentation properlyhttp://herc.ws/wiki/Hercules_Plugin_Manager#HPM_Hooks -
HPM Hooking return random value from the defined function
AnnieRuru posted a question in Plugin Support
need both patch and plugin to explain patch src/map/pc.c | 2 ++ 1 file changed, 2 insertions(+)diff --git a/src/map/pc.c b/src/map/pc.cindex 2372d31..412c12b 100644--- a/src/map/pc.c+++ b/src/map/pc.c@@ -975,12 +975,14 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim sd->login_id2 = login_id2; +ShowDebug ( "2. %s try to login. Value %d Group %d.", sd->status.name, group_id, sd->group_id ); if (pc->set_group(sd, group_id) != 0) { ShowWarning("pc_authok: %s (AID:%d) logged in with unknown group id (%d)! kicking...n", st->name, sd->status.account_id, group_id); clif->authfail_fd(sd->fd, 0); return false; }+ShowDebug ( "3. %s try to login. Value %d Group %d.", sd->status.name, group_id, sd->group_id ); memcpy(&sd->status, st, sizeof(*st)); #include <stdio.h>#include <string.h>#include <stdlib.h>#include "../map/pc.h"#include "../common/HPMi.h"#include "../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */HPExport struct hplugin_info pinfo = { "maintenance", // Plugin name SERVER_TYPE_MAP,// Which server types this plugin works with? "1.0", // Plugin version HPM_VERSION, // HPM Version (don't change, macro is automatically updated)};bool pc_authok_pre( struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers ) { ShowDebug ( "1. %s try to login. Value %d Group %d.", sd->status.name, group_id, sd->group_id ); if ( group_id < 99 ) { clif->authfail_fd( sd->fd, 1 ); return false; } return true;}bool pc_authok_post( int retVal, struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers ) { ShowDebug ( "4. %s try to login. Value %d Group %d.", sd->status.name, group_id, sd->group_id ); if ( sd->group_id < 99 ) { clif->authfail_fd( sd->fd, 1 ); return false; } return true;}HPExport void plugin_init (void) { clif = GET_SYMBOL("clif"); addHookPre( "pc->authok", pc_authok_pre ); addHookPost( "pc->authok", pc_authok_post );}.. . ok I need the group_id value, when I debug it with a normal char [Debug]: 1. try to login. Value 90443865 Group 0. [Debug]: 2. try to login. Value 0 Group 0. [Debug]: 3. try to login. Value 0 Group 0. [Debug]: 4. KinoRuru try to login. Value 90443865 Group 0. then only got a kick debug with a GM99 char [Debug]: 1. try to login. Value 90443865 Group 0. [Debug]: 2. try to login. Value 99 Group 0. [Debug]: 3. try to login. Value 99 Group 99. [Debug]: 4. AnnieRuru try to login. Value 90443865 Group 99. and successfully login the problem here is ... why is that when using patch, the pc_authok function inside pc.c works fine, group_id returns the value correctly but when using plugin, no matter is pre-hook or post-hook, group_id value gives random-like value ? my feeling tells me, there is some bug inside srcpluginsHPMHooking folder.. -
of course everything that I write will be free . . https://github.com/HerculesWS/Hercules/blob/master/src/map/clif.c#L676clif->authfail_fd( sd->fd, 1 ); will display 'Server Closed (1)' note that the packet header is 0x81 if you change 'min_group_id_to_connect', you'll get this https://github.com/HerculesWS/Hercules/blob/master/src/login/login.c#L1107 the packet header is also 0x81 somehow *athena core developer dunno who, doesn't make use of clif->authfail_fd function I know about this topic http://herc.ws/board/topic/1286-requesting-maintenance-plugin/?p=10266 where people says plugin not supported, because they edit the login_auth_ok function inside srcloginlogin.c but I found out HPMHooking allow to hook pc->authok inside srcmappc.c so mine can support plugin ... well in theory I'm about 20% done now ... now writing the sql table to make it persist after server shutdown ... because it seems roservice they have that
-
wow ... don't do anything stupid ... ima gonna write one ... $20 for this simple mod ? omg ... its overpriced in my opinion ...
-
Where are the messages Hercules outputs in Logs and how to change color?
AnnieRuru replied to Zirius's question in Source Support
clif_disp_onlyself is actually clif->disp_message https://github.com/HerculesWS/Hercules/blob/master/src/map/clif.h#L50 clif->disp_message is using guild-chat color to send message to the target https://github.com/HerculesWS/Hercules/blob/master/src/map/clif.c#L8115 the packet starts with 0x17f clif->colormes ... however, using different kind of packet the packet starts with 0x2C1 and on the 4th field of the packet allows color coding, which clif->disp_message couldn't do so no ... depends on how you deprecate it they are doing the same thing, which display a message on player's chat box just clif->colormes allows color code, but clif->disp_message couldn't while they are actually using different types of packets -
a few places, I can think of 2 battle_calc_**** inside battle.c status_calc_pc_ inside status.c just Ctrl+F search for 'refine'
-
https://github.com/HerculesWS/Hercules/blob/master/src/map/guild.h#L16
-
attachrid killedrid & killerrid assigning temp character variable
AnnieRuru replied to Zirius's question in Script Support
yup this one, when the character died, the streak is reset as long as the player die, for what ever reason, the streak is reset - script kjdhfkjdshf -1,{OnPCKillEvent: if ( killedrid == getcharid(3) ) end; @streak++; dispbottom "you killed "+ rid2name( killedrid ) +". streak count "+ @streak; end;OnPCDieEvent: @streak = 0; dispbottom "your current streak count "+ @streak; end;}.. . this one, when the character die from player's hand, the streak is reset die from other means such as suicide, killed by non-human players doesn't count - script skdfjhskdf -1,{OnPCKillEvent: if ( killedrid != getcharid(3) ) { @streak++; dispbottom "you killed "+ rid2name( killedrid ) +". streak count "+ @streak; } attachrid killedrid; @streak = 0; dispbottom "your current streak count "+ @streak; end;} -
then how about changing line 60 into - script Cek -1,{.and line 74 into - script HiddenNpc -1,{
-
shouldn't your map-server.exe print this ? [Error]: npc_parsesrcfile: Unknown coordinates ('182', '183') for map '2@pump' in file 'npc/custom1/zzz.txt', line '60'. Skipping line...[Error]: npc_parsesrcfile: Unknown coordinates ('182', '183') for map '2@pump' in file 'npc/custom1/zzz.txt', line '74'. Skipping line...
-
attachrid killedrid on AnnieRuru's PVP Ladder conflict on Summoned Plants
AnnieRuru replied to Zirius's question in Script Support
omg omg ... I gave wrong info ... sh*t I wish I can abuse my moderation power to delete my previous post .... better not I remember that skotlex changed what I said above, that OnNPCKillEvent will trigger the monster kill count so if a monster died, no matter is player/monster/homun/pet/mercernary, OnNPCKillEvent will trigger regardless of who made the kill BUT ... OnPCKillEvent hasn't change herculessrcpc.c int pc_dead(struct map_session_data *sd,struct block_list *src) {..... if (src && src->type == BL_PC) { struct map_session_data *ssd = (struct map_session_data *)src; pc->setparam(ssd, SP_KILLEDRID, sd->bl.id); npc->script_event(ssd, NPCE_KILLPC);when a player has dead, and check if the killer was also a player ... please disregard my post above so what you wanted that needs to do source modifications -
oh ! that's another site I could refer on direct translate, magical attack and shape shift, last 5 seconds and chanting time reduce 50%correct grammar is, when transform into angeling by magical attack, the transform last 5 seconds and casting time reduce by 50% so it should be autobonus "{ bonus bCastrate, -50; }", 20*getrefine(), 5000, BF_MAGIC, "{ disguise ANGELING; sleep2 5000; undisguise; }";
-
you can try something like this http://herc.ws/board/topic/2844-monster-transform/?p=28399 All State + 1. -> bonus bAllStats, 1; ATK, MATK + 2. -> bonus bAtk, 2; bonus bMatk, 2; Additional ATK, MATK + 2 per 1 refine grade. -> bonus bAtk, getrefine() *2; bonus bMatk, getrefine() *2; Transform into Angeling for 5 sec by a certain chance when attacking physically or magically. - When transforming with a phycial attack, ASPD +2 for 5 sec. --> autobonus "{ bonus bAspd, 2; }", 10000, 5000, BF_WEAPON|BF_NORMAL, "{ disguise ANGELING; sleep2 5000; undisguise; }"; - When transforming with a magical attack, decrease Floating Casting time for 5 sec. --> autobonus "{ bonus bCastrate, -5; }", 10000, 5000, BF_MAGIC, "{ disguise ANGELING; sleep2 5000; undisguise; }"; Transformation success chance will be increased per each refine grade. --> ???
-
attachrid killedrid on AnnieRuru's PVP Ladder conflict on Summoned Plants
AnnieRuru replied to Zirius's question in Script Support
oh yea ... when I scripted that on year 2008, it wasn't behave like this yet now I just remember at one time, monsters/homun/pet (mercenary wasn't even introduced) are now attached to the master that did the kills means, last time homunculus were counted separately, wasn't attached to the script but now, if homunculus made a kill, the master (alchemist) will be attached to the script instead I think this was changed around 2009 or 2010 I couldn't remember well that info already outdated, should be change into if the player was killed by a pet/homun/monster/mercenary having a master as a player, the dead player will be added a dead count, and killer will be added a kill streak.it only not counted if the monster not having master at all, or having monster as a master (such as MVP) something like this .... read post below ... -
I am quite sure bsplashrange is splashed around the target try baphomet card mount on bow on archer and try ?
-
yeah, the conflicts are from my own patch as well anyway, just update 1st post, so try download again