Jump to content

AnnieRuru

Script Developers
  • Content Count

    1677
  • Joined

  • Last visited

  • Days Won

    246

Everything posted by AnnieRuru

  1. AnnieRuru

    Enchanter

    of course I knew, but there is none atm unless using getinventorylist and ... I was thinking of writing getequipexpirationtick http://herc.ws/board/topic/4518-suggestion-brianl-rentitem2/?p=29376
  2. 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;}
  3. when this happens, you were using which version ?are you saying that this script will send only 1 player into the map ? this is unlikely to happen in version 1, if the script only found 1 player, it shouldn't even start the event in version 2 if the script only found 1 player, it will annnounce "can't find enough players" maybe I don't understand what you saying, and I really need a guide on how to reproduce your problem and your explanation is too short, maybe I always failed to understand what you said
  4. Ahhhh ! I made a stupid mistake should make the map clean of players before the event start version 2.1 clean the map from players using mapwarp .map$; I don't really understand this part, can explain better ?
  5. version 1.2 just a minor fixed of type BG, which was found here http://herc.ws/board/topic/4570-battleground-system-without-waitingroom/?p=42419 its minor because I'm sure everyone use getbgusers instead of getmemberaid to get the account ID of batttleground users =/
  6. AnnieRuru

    @item item_deny

    I thought of that before and I already knew a bugso now I show you - script sdjfhksdj -1,{OnInit: bindatcmd "item", strnpcinfo(0)+"::Onaaa"; bindatcmd "itemabount", strnpcinfo(0)+"::Onaaa"; end;Onaaa: if ( !.@atcmd_numparameters ) { atcommand .@atcmd_command$; end; } explode .@command$, .@atcmd_command$ +" "+ implode( .@atcmd_parameters$, " " ), " "; if ( !sscanf( .@atcmd_command$, "@%s", .@command$ ) ) sscanf .@atcmd_command$, "#%s", .@command$; query_sql "select level from item_deny where itemid = "+ .@command$[1], .@level; if ( getgmlevel() < .@level ) { message strcharinfo(0), "You are restricted from creating this item."; // <-- this part end; } atcommand "@"+ .@command$ +" "+ implode( .@atcmd_parameters$, " " ); end;}when you want to display a message for #char command, bindatcmd will behave weirdly if you code atcommand entirely in the source like post#2, sd->fd will display the restriction message on the person who type the command if you script this entirely as a npc script like this post, *message script command will send the restriction message to the target character that is because bindatcmd will make the command execute entirely on the target character as if the target were typing the command don't get it ? I used AnnieRuru character trying to send a red pot to EnnyRuru I tried "#item ennyruru 501 1" in post#2, it display the restriction message on AnnieRuru in this post, it display the restriction message on EnnyRuru the GM might be wondering why the command doesn't work, and then the target character gets spam by this irrelevant messages I've always use bindatcmd because its easy, yeah true, but when certain ones has to execute by char command as well, have to code in the source
  7. unfortunately ... rathena doesn't support getmemberaid because rathena still haven't break the 128 array limit I just tried this in rAthena prontera,162,180,5 script asdf 100,{ .@i[999] = 1; dispbottom .@i[999] +"";} [Warning]: script:getelementofarray: index out of range (999)[Debug]: Data: variable name='.@i' index=0[Debug]: Source (NPC): asdf at prontera (162,180)so ... no ... doesn't work for rathena
  8. 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
  9. http://herc.ws/wiki/Timers_%28Scripting%29#Use_Number_3:_Deny_Usage change 86400 into 10
  10. { Id: 607 AegisName: "Yggdrasilberry" Name: "Yggdrasil Berry" Type: 0 Buy: 5000 Weight: 300 Upper: 63 BuyingStore: true Delay: 5000 Script: <" percentheal 100,100; ">},already has 5 seconds default cool-down
  11. AnnieRuru

    @item item_deny

    src/map/atcommand.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex b5e8fa7..ff35309 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -1171,6 +1171,21 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) { } item_id = item_data->nameid;++ if ( SQL->Query( map->mysql_handle, "select level from item_deny where itemid = %d", item_data->nameid ) == SQL_ERROR )+ Sql_ShowDebug( map->mysql_handle );+ else if ( SQL->NextRow( map->mysql_handle ) == SQL_SUCCESS ) {+ char *data;+ int16 level;+ if ( SQL->GetData( map->mysql_handle, 0, &data, NULL ) == SQL_SUCCESS ) {+ level = atoi(data);+ if ( pc_get_group_level(sd) < level ) {+ clif->message( fd, "You are restricted from creating this item." );+ return false;+ }+ }+ SQL->FreeResult( map->mysql_handle );+ }+ get_count = number; //Check if it's stackable. if (!itemdb->isstackable2(item_data)) {are you sure you want to access to sql every time a GM item ?I think I can code something like @reloaditemdeny so it'll catch the data
  12. ahh ... I missed Happy's post that's a nice idea,but instead of reroll, I made it a registration @DarkPurple block same ip right ? added it release version 2.0
  13. 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
  14. I used this quite a lot when I was still on rathena forum but one thing that bugs me is ... let's say I finished a quest, and I get a bonus bstr, 10;then I went into an event, which gives another bonus bstr,10; it doesn't stack that part needs to be revise a little bit @evilpuncker seems no dur = 1000 * abs(script_getnum(st,3)); http://www.cprogramming.com/fod/abs.html I tried on rathena test server prontera,162,180,5 script asdf 100,{ bonus_script "{ bonus bStr,5; }",-1; end;}I get bonus +5 str for 1 second
  15. no, rathena doesn't have dispbottomcolor, or dispbottom having optional parameter yet https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L3765 the only clif_colormes inside rathenasrcmapscript.c is *openauction I'm still actively comply battleground script request on rathena board if they implement this, sure I'll know by the way, rathena colormes only has RRGGBB reverse bug, the code looks quite clean for them, I don't see a reason why they can't do it right now Download for rAthena users
  16. LOL, when I saw the colorful message I thought it works fixed in 1.1
  17. weird ... when I look at the ascii table http://www.cdrummond.qc.ca/cegep/informat/professeurs/alain/Images/ascii2.gif Alt+160 is actually -> á but how come in the game it works different -.-" prontera,156,173,4 script sdfkhfksd 100,{ input .@a$; if ( .@a$ == "x3A" ) dispbottom ":"; if ( .@a$ == "x3B" ) dispbottom ";"; if ( .@a$ == "x20" ) dispbottom "[space]"; if ( .@a$ == "xA0" ) dispbottom "Alt+03232"; setarray .@b$, "x20x3Ax20", "x20x3AxA0", "x20x3Bx20", "x20x3BxA0", "xA0x3Ax20", "xA0x3AxA0", "xA0x3Bx20", "xA0x3BxA0"; for ( .@i = 0; .@i < 8; .@i++ ) if ( compare( .@a$, .@b$[.@i] ) ) dispbottom "failed"; end;}
  18. before convert it, you have to list them I've tried on post#5 in this topic which has a max_3_space.c download it works on my test server, but said doesn't work on linux machine how about you try it ? is there any way to detect the word Alt+03232 without actually typing it ? maybe @KeyWorld can shred some light on this
  19. I got a very quick way of doing this src/map/clif.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..cbb080c 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -9110,6 +9110,27 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, *namelen_ = namelen; *message_ = message; *messagelen_ = messagelen;++ if ( stristr( message, ":" ) || stristr( message, ";" ) ) {+ char* array_names[8] = { // change 8 into total number of elements from the array below+ "AnnieRuru", // change all these to all your GM staff names+ "EnnyRuru",+ "Aurela",+ "Lumina",+ "Evilpunker",+ "Frost",+ "Garr",+ "KinoRuru"+ };+ int i;+ for ( i = 0; i < 8; i++ ) { // change the 8 here too+ if ( stristr( message, array_names[i] ) ) {+ clif->colormes( fd, COLOR_RED, "You can't impersonate as a GM staff !" );+ return false;+ }+ }+ }+ return true; } create a blacklist and detects them when they input ":" or ";" plus any of the names mentioned in the array but this is not an ideal way of how to code it ... ima thinking of using the correct way on how Ind code his manner.c using an external file impersonate.txt along with @reloadimpersonate something like Ind did EDIT: on 2nd thought, maybe you guys can just use Ind's manner.c ...
  20. prontera,158,182,6 script barricade 101,{ if ( has_instance2( "guild_vs2" ) >= 0 ) { warp has_instance( "guild_vs2" ), 0,0; end; } .@pid = getcharid(1); if ( !.@pid ) { mes "form a party 1st"; close; } getpartymember .@pid, 1; getpartymember .@pid, 2; if ( ( .@ins = instance_create( "test barricade", .@pid ) ) < 0 ) { mes "error : "+ .@ins; close; } if ( instance_attachmap( "guild_vs2", .@ins, 1, .@pid +"wall" ) == "" ) { mes "error : 5"; instance_destroy .@ins; close; } instance_set_timeout 30, 0, .@ins; instance_init .@ins; instance_attach .@ins; switch ( rand(4) ) { default: warp has_instance( "guild_vs2" ), 50, 90; break; case 1: warp has_instance( "guild_vs2" ), 50, 9; break; case 2: warp has_instance( "guild_vs2" ), 9, 50; break; case 3: warp has_instance( "guild_vs2" ), 90, 50; break; } end;}guild_vs2,0,0,0 script djfksdhfjkds -1,{OnInstanceInit: setcell has_instance( "guild_vs2" ), 46,87,53,87,cell_walkable,0; setcell has_instance( "guild_vs2" ), 46,12,53,12,cell_walkable,0; setcell has_instance( "guild_vs2" ), 12,46,12,53,cell_walkable,0; setcell has_instance( "guild_vs2" ), 87,46,87,53,cell_walkable,0; sleep 10000; setcell has_instance( "guild_vs2" ), 46,87,53,87,cell_walkable,1; setcell has_instance( "guild_vs2" ), 46,12,53,12,cell_walkable,1; setcell has_instance( "guild_vs2" ), 12,46,12,53,cell_walkable,1; setcell has_instance( "guild_vs2" ), 87,46,87,53,cell_walkable,1; end;}seems that you are right ... I couldn't walk pass... maybe it will only glitch when you setcell in the sight range of the character
  21. why do you need last monster ID for ? doesn't make sense select * from mob_db where id = ( select max(id) from mob_db ); and some people also change MAX_MOB_DB
  22. wait, I thought its common sense that players only try to impersonate other players that are currently in the chat roomif AnnieRuru is not in the chatroom, of course can impersonate, but players should know that she is not in the chatroom so its busted, isn't it ? because at the right hand side of the chatroom, it list the players currently inside are you saying so I should run a loop for all online players instead of just players joined the chat room ?
  23. *ahem* ... please test it and tell if it works =/ because I tested it working fine in my test server .... unless you guys found some other way to bypass this
  24. for some reason this script broken on latest revision... need some fixing ... http://upaste.me/043d1e http://upaste.me/640d56 thinking of make a real release of this after making the guild manipulation plugin
  25. @GmOcean I couldn't find those commands in rathena repo, but you mean this ? http://rathena.org/board/topic/97728- hercules developers has already rejected the party script commands http://herc.ws/board/topic/4186- reason 1 if you want to script party vs party script, its better to use battleground script commands provided reason 2 if you saying its meant to create a party for instance no, that's because rathena are forcing the instance to attach to party ID that's why they need it when creating an instance for a single player but remember hercules already has IOT_CHAR to attach the instance to account ID we don't need it since party script commands are rejected, guild script commands are going to be rejected as well but this might be a nice addition as a plugin ... though that guild info command seems interesting ... 0 - rejected - we have getguildname 1 - this is grey ... getguildlevel or getgdskilllv ? I dunno 2 - rejected - getguildmember can do this 3 - rejected - getguildmember can do this 4 - rejected - for what ?? 5 - hmm ... useful when writing certain kinds of guild based event ... 6 - hmm ... useful when writing certain kinds of guild based event ... 7 - rejected - I saw his code ... iterator ... bad idea, its better to loop with getcastledata overall ... no ... @SoulBlaker Ima thinking of convert Cydh's code into hercules plugin
×
×
  • Create New...

Important Information

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