-
Content Count
1677 -
Joined
-
Last visited
-
Days Won
245
Reputation Activity
-
AnnieRuru got a reaction from Kairedia in Maintenance mode
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
-
AnnieRuru got a reaction from aszrool in Maintenance mode
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
-
AnnieRuru got a reaction from caspe in Maintenance mode
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
-
AnnieRuru got a reaction from Squall in char_id of all the players in a particular area
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
-
AnnieRuru got a reaction from Legend in Maintenance mode
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
-
AnnieRuru got a reaction from THPO in [request] @maintenance Command?
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 ...
-
AnnieRuru got a reaction from DoriTos Nacho in Maintenance mode
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
-
AnnieRuru got a reaction from nakatto in party vs party (blue team v.s. red team)
my 1st impression is that ... why not just use my setbgid ?
just setbgid the whole party into battleground team without having to use waitingroom
.
.
.
try thishttp://upaste.me/309471
though, not only this script uses older techniques, those custom stuffs are too unoptimized
that will be a lot of time needed if I want to rewrite everything from scratch
so ... just stick with it
-
AnnieRuru reacted to Angelmelody in HPM Hooking return random value from the defined function
maybe group_id will retrun memory address , try using *group_id instead
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;} -
AnnieRuru got a reaction from Break San in Npc Emblem of War
maybe you can try my mithril coin shop
http://rathena.org/board/topic/91109-how-to-fix-multi-shop-v12/?p=238863
- shop market2#hidden -1,501:1000prontera,156,172,5 script market 100,{ dispbottom "You currently have "+ countitem(.currency) +" "+ getitemname(.currency); callshop .shopname$, 1; end;OnInit: function addshopitem { npcshopdelitem .shopname$, 501; .@count = getargcount(); for ( .@i = 0; .@i < .@count; .@i++ ) { if ( .@i % 2 == 0 ) .itemid[ .@i /2 ] = getarg( .@i ); else { .itemcost[ .@i /2 ] = getarg( .@i ); npcshopadditem .shopname$, .itemid[ .@i /2 ], getarg( .@i ); } } }// ----- Configuration ------ .shopname$ = "market2#hidden"; // shop name that match the 1st line in this script .currency = 674; // item used for currency addshopitem // adds shop items here 512,10, 513,20, 514,30, 515,40, 516,50, 607,1;// ------------------------- .itemsize = getarraysize( .itemid ); for ( .@i = 0; .@i < .itemsize; .@i++ ) setd ".item"+ .itemid[.@i] +"cost", .itemcost[.@i]; npcshopattach .shopname$; end;OnBuyItem: if ( !@bought_quantity ) end; .@size = getarraysize( @bought_nameid ); for ( .@i = 0; .@i < .@size; .@i++ ) .@itemcost = .@itemcost + getd( ".item"+ @bought_nameid[.@i] +"cost" ) * @bought_quantity[.@i]; if ( .@itemcost > countitem(.currency) ) { mes "you don't have enough "+ getitemname(.currency); close; } if ( !checkweight2( @bought_nameid, @bought_quantity ) ) { mes "you can't carry all these items !"; close; } delitem .currency, .@itemcost; for ( .@i = 0; .@i < .@size; .@i++ ) getitem @bought_nameid[.@i], @bought_quantity[.@i]; end;OnSellItem: if ( !@sold_quantity ) end; .@size = getarraysize( @sold_nameid ); for ( .@i = 0; .@i < .@size; .@i++ ) .@itemgain = .@itemgain + getd( ".item"+ @sold_nameid[.@i] +"cost" ) * @sold_quantity[.@i]; if ( !checkweight( .currency, .@itemgain ) ) { mes "you can't carry all these items !"; close; } for ( .@i = 0; .@i < .@size; .@i++ ) if ( getd( ".item"+ @sold_nameid[.@i] +"cost" ) ) delitem @sold_nameid[.@i], @sold_quantity[.@i]; getitem .currency, .@itemgain; end;} -
AnnieRuru got a reaction from Nova in Chat space limitation!/Scammer avoid *Will pay for help*
I hope this is final one that will work
patch
src/map/clif.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..5b3418e 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -9110,6 +9110,22 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, *namelen_ = namelen; *message_ = message; *messagelen_ = messagelen;++ {+ int i, l = strlen(message);+ for ( i = 0; i <= l; i++ )+ if ( message[i] == 'xA0' )+ message[i] = 'x20'; // replace Alt+0160 into [space]+ if ( stristr( message, " " ) ) {+ clif->colormes( sd->fd, COLOR_RED, "You are only allow to type maximum of 3 spaces in a dialog." );+ return false;+ }+ if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked+ clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" );+ return false;+ }+ }+ return true; } plugin#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../map/pc.h"#include "../map/clif.h"#include "../common/HPMi.h"#include "../common/socket.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 = { "GM_impersonate", // 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)};bool clif_process_message_spaces( int retVal, struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_) { if ( retVal == true ) { char* message = (char*)RFIFOP( sd->fd ,4) + strnlen(sd->status.name, NAME_LENGTH-1) + 3; int i, l = strlen(message); for ( i = 0; i <= l; i++ ) if ( message[i] == 'xA0' ) message[i] = 'x20'; // replace Alt+0160 into [space] if ( stristr( message, " " ) ) { clif->colormes( sd->fd, COLOR_RED, "You are only allow to type maximum of 3 spaces in a dialog." ); return false; } if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" ); return false; } } return true;}HPExport void plugin_init (void) { clif = GET_SYMBOL("clif"); session = GET_SYMBOL("session"); strlib = GET_SYMBOL("strlib"); addHookPost("clif->process_message", clif_process_message_spaces);}..
as it turns out, I just have to replace Alt+0160 into [space], then just block players from typing " : " is already enough
no need some kind of blocklist after all
-
AnnieRuru got a reaction from Edgar in [request] @maintenance Command?
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
-
AnnieRuru got a reaction from evilpuncker in attachrid killedrid & killerrid assigning temp character variable
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;} -
AnnieRuru got a reaction from Zirius in [request] @maintenance Command?
wow ... don't do anything stupid ... ima gonna write one ...
$20 for this simple mod ? omg ... its overpriced in my opinion ...
-
AnnieRuru got a reaction from Zirius in Guildmate position on minimap lags?
https://github.com/HerculesWS/Hercules/blob/master/src/map/guild.h#L16 -
AnnieRuru got a reaction from jaBote in Guildmate position on minimap lags?
https://github.com/HerculesWS/Hercules/blob/master/src/map/guild.h#L16 -
AnnieRuru got a reaction from RodRich in dispbottomcolor
since our developers are ... not implementing dispbottom and message with colors
http://herc.ws/board/topic/3899-suggestion-displaybottom-message-colors/?p=28345
I think I just make a release for this
Download: 1.2
Plugin
tested with
prontera,162,180,5 script asdf 100,{ dispbottomcolor "test color", 0xFF0000; dispbottomcolor "test color", 0x00FF00; dispbottomcolor "test color", 0x0000FF; dispbottomcolor "test color", 0xFFFFFF, 2000000; end;}PS: there is a reason that this couldn't be in the officialbecause hercules' clif->colormes is ... badly coded ...
changing that function also means change a lot of lines having clif->colormes, which is all over the places
-
AnnieRuru got a reaction from Zirius in attachrid killedrid & killerrid assigning temp character variable
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;} -
AnnieRuru got a reaction from Zirius in Where are the messages Hercules outputs in Logs and how to change color?
unfortunately ... hercules' clif->colormes is badly coded
if you really need it, you have to create another one ==> 'clif->colormes2'
src/map/clif.c | 15 +++++++++++++++ src/map/clif.h | 1 + 2 files changed, 16 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..146e7a3 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -8385,6 +8385,20 @@ int clif_colormes(int fd, enum clif_colors color, const char* msg) { return 0; } +int clif_colormes2(int fd, unsigned int color, const char* msg) {+ size_t msg_len = strlen(msg) + 1;++ WFIFOHEAD(fd,msg_len + 12);+ WFIFOW(fd,0) = 0x2C1;+ WFIFOW(fd,2) = msg_len + 12;+ WFIFOL(fd,4) = 0;+ WFIFOL(fd,8) = (color & 0x0000FF) << 16 | (color & 0x00FF00) | (color & 0xFF0000) >> 16;;+ safestrncpy((char*)WFIFOP(fd,12), msg, msg_len);+ WFIFOSET(fd, msg_len + 12);++ return 0;+}+ /// Monster/NPC color chat [SnakeDrak] (ZC_NPC_CHAT). /// 02c1 <packet len>.W <id>.L <color>.L <message>.?B void clif_messagecolor(struct block_list* bl, unsigned int color, const char* msg) {@@ -18835,6 +18849,7 @@ void clif_defaults(void) { clif->messageln = clif_displaymessage2; clif->messages = clif_displaymessage_sprintf; clif->colormes = clif_colormes;+ clif->colormes2 = clif_colormes2; clif->process_message = clif_process_message; clif->wisexin = clif_wisexin; clif->wisall = clif_wisall;diff --git a/src/map/clif.h b/src/map/clif.hindex e4de51a..291997d 100644--- a/src/map/clif.h+++ b/src/map/clif.h@@ -817,6 +817,7 @@ struct clif_interface { /* message+s(printf) */ void (*messages) (const int fd, const char *mes, ...) __attribute__((format(printf, 2, 3))); int (*colormes) (int fd, enum clif_colors color, const char* msg);+ int (*colormes2) (int fd, unsigned int color, const char* msg); bool (*process_message) (struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_); void (*wisexin) (struct map_session_data *sd,int type,int flag); void (*wisall) (struct map_session_data *sd,int type,int flag);then you can do as the formatclif->colormes2( sd->fd, <color code>, "<message>" );example likeclif->colormes2( sd->fd, 0xFF0000, "Red Light" ); -
AnnieRuru got a reaction from Zirius in attachrid killedrid on AnnieRuru's PVP Ladder conflict on Summoned Plants
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 ...
-
AnnieRuru got a reaction from iZeal in Update how many seconds left?
prontera,155,172,5 script kjdhfkdjsf 100,{ .@deny = 10; if ( @delay + .@deny > gettimetick(2) ) { dispbottom "Please wait "+( @delay + .@deny - gettimetick(2) )+" seconds."; end; } @delay = gettimetick(2); percentheal 100,100; skilleffect AL_HEAL, 10; end;}I usually set the deny variable equal to gettimetick(2)its because from my experience in script release
example like instance dungeon set it deny for 3 hours before re-entering, and I always make it configurable
if admin suddenly change it into 5 hours, player's deny usage doesn't change ... ( well just 2 hours doesn't matter much .. )
so I didn't follow wiki example
-
AnnieRuru got a reaction from sever in dispbottomcolor
since our developers are ... not implementing dispbottom and message with colors
http://herc.ws/board/topic/3899-suggestion-displaybottom-message-colors/?p=28345
I think I just make a release for this
Download: 1.2
Plugin
tested with
prontera,162,180,5 script asdf 100,{ dispbottomcolor "test color", 0xFF0000; dispbottomcolor "test color", 0x00FF00; dispbottomcolor "test color", 0x0000FF; dispbottomcolor "test color", 0xFFFFFF, 2000000; end;}PS: there is a reason that this couldn't be in the officialbecause hercules' clif->colormes is ... badly coded ...
changing that function also means change a lot of lines having clif->colormes, which is all over the places
-
AnnieRuru reacted to Garr in Chat space limitation!/Scammer avoid *Will pay for help*
Hmm, I remember that one. That's indeed a nice idea. But I'm at loss how to implement such a check for every char name used, unless going through all the chars for each message, and it'll kill the messaging. Btw, such trick also works for normal chat window if you leave it at default size, aka pretend you're getting PMs from GM.
-
AnnieRuru got a reaction from karazu in Chat space limitation!/Scammer avoid *Will pay for help*
I hope this is final one that will work
patch
src/map/clif.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..5b3418e 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -9110,6 +9110,22 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, *namelen_ = namelen; *message_ = message; *messagelen_ = messagelen;++ {+ int i, l = strlen(message);+ for ( i = 0; i <= l; i++ )+ if ( message[i] == 'xA0' )+ message[i] = 'x20'; // replace Alt+0160 into [space]+ if ( stristr( message, " " ) ) {+ clif->colormes( sd->fd, COLOR_RED, "You are only allow to type maximum of 3 spaces in a dialog." );+ return false;+ }+ if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked+ clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" );+ return false;+ }+ }+ return true; } plugin#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../map/pc.h"#include "../map/clif.h"#include "../common/HPMi.h"#include "../common/socket.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 = { "GM_impersonate", // 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)};bool clif_process_message_spaces( int retVal, struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_) { if ( retVal == true ) { char* message = (char*)RFIFOP( sd->fd ,4) + strnlen(sd->status.name, NAME_LENGTH-1) + 3; int i, l = strlen(message); for ( i = 0; i <= l; i++ ) if ( message[i] == 'xA0' ) message[i] = 'x20'; // replace Alt+0160 into [space] if ( stristr( message, " " ) ) { clif->colormes( sd->fd, COLOR_RED, "You are only allow to type maximum of 3 spaces in a dialog." ); return false; } if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" ); return false; } } return true;}HPExport void plugin_init (void) { clif = GET_SYMBOL("clif"); session = GET_SYMBOL("session"); strlib = GET_SYMBOL("strlib"); addHookPost("clif->process_message", clif_process_message_spaces);}..
as it turns out, I just have to replace Alt+0160 into [space], then just block players from typing " : " is already enough
no need some kind of blocklist after all
-
AnnieRuru got a reaction from evilpuncker in Chat space limitation!/Scammer avoid *Will pay for help*
I hope this is final one that will work
patch
src/map/clif.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..5b3418e 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -9110,6 +9110,22 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, *namelen_ = namelen; *message_ = message; *messagelen_ = messagelen;++ {+ int i, l = strlen(message);+ for ( i = 0; i <= l; i++ )+ if ( message[i] == 'xA0' )+ message[i] = 'x20'; // replace Alt+0160 into [space]+ if ( stristr( message, " " ) ) {+ clif->colormes( sd->fd, COLOR_RED, "You are only allow to type maximum of 3 spaces in a dialog." );+ return false;+ }+ if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked+ clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" );+ return false;+ }+ }+ return true; } plugin#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../map/pc.h"#include "../map/clif.h"#include "../common/HPMi.h"#include "../common/socket.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 = { "GM_impersonate", // 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)};bool clif_process_message_spaces( int retVal, struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_) { if ( retVal == true ) { char* message = (char*)RFIFOP( sd->fd ,4) + strnlen(sd->status.name, NAME_LENGTH-1) + 3; int i, l = strlen(message); for ( i = 0; i <= l; i++ ) if ( message[i] == 'xA0' ) message[i] = 'x20'; // replace Alt+0160 into [space] if ( stristr( message, " " ) ) { clif->colormes( sd->fd, COLOR_RED, "You are only allow to type maximum of 3 spaces in a dialog." ); return false; } if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" ); return false; } } return true;}HPExport void plugin_init (void) { clif = GET_SYMBOL("clif"); session = GET_SYMBOL("session"); strlib = GET_SYMBOL("strlib"); addHookPost("clif->process_message", clif_process_message_spaces);}..
as it turns out, I just have to replace Alt+0160 into [space], then just block players from typing " : " is already enough
no need some kind of blocklist after all