Jump to content

AnnieRuru

Script Developers
  • Content Count

    1677
  • Joined

  • Last visited

  • Days Won

    245

Everything posted by AnnieRuru

  1. oh yeah ... now I just remember something about getmapusers behaviourapparently the way server calculate map->list[m].users and sd->bl.m a little bit inconsistent because the map->list[m].users doesn't count the player when that player still in the loading screen means, if the player loads the map for more than 1 second, the map is consider empty and my instance_time_out says only wait for 1 second, so it gets destroyed its my scripting problem there's some clue around at *maprespawnguildid script command https://github.com/HerculesWS/Hercules/blob/master/src/map/script.c#L11326
  2. long time ago, when the instance system was coded by zephirus (which later he started eamod, his coding very unoptimized)the instance system map name has to be '<number>@<seven character long>' example : 1@tower when instanced, the name will become 0011@tower and doesn't support custom map name we have to use dataresnametable.txt to duplicate a map that wasn't '<number>@<seven character long>' into this format now both the instance system rewrite by hercules and rathena hercules system : 1@tower become 0001@tower custom map name: guild_vs2 instance_attachmap( "guild_vs2", .@ins, 1, getcharid(1)+"FYC" )that's my technique, unfortunately. rathena system : 1@tower become 0011@tower custom map name: guild_vs2 become 001#guild_vs2 . by my experience, all instanced map always start with a number, so I don't think start with a number might be an issue . . . 2000 ... should be impossible to reach in just 1 weekmy test server says loaded 880 maps, means there should be 1120 maps free to use but from the feedback from community members, they reply me in just 1 day after I finished the script which must be means ... in just several hours after put on a live server ... this ... is sux ... from what I gather, this kind of instance script works fine in test server, but doesn't work 100% in live server, due to kicking out from the instance the moment the player went in its not like crashing the server, which produce a core dump ... so although we knew the way to reproduce in live server, but we couldn't able to locate what is the cause . . . ah ... now I just recall this one I just debug it with getmapusers ... with IOT_CHAR type it return -1 with IOT_NONE type it return 0 ok its fine for being like this, IOT_NONE shouldn't need to unload the map so this one working correctly . . . actually what I meant it happens with IOT_CHAR or IOT_PARTY typeIOT_NONE type not included with IOT_CHAR type (confirmed), they say when set the instance_time_out like this instance_set_timeout 3600, 1, .@ins; // 1 hour for the map, 1 second to destroythey say the Memorial Dungeon is destroyed in 1 secthough, I'm not able to reproduce this bug even once
  3. I feel the need to make a topic about this, because many members has report about this bug http://herc.ws/board/topic/4850-fight-your-clone/?p=31745 http://herc.ws/board/topic/4652-raid-instances/?p=30813 and I didn't make a bug report, because I'm not able to reproduce the bug . .. . the example script, http://upaste.me/9b2110648e7662562 ok, I admit that I used a trick instance_attachmap( "guild_vs2", .@ins, 1, getcharid(3)+"FYC" )which will make as many map as possibleand a new map is added everytime an user register this instance 1. is there some kind of map name that is invalid to use ? because if accountID is 2001234, map name will be "2001234FYC" <-- string length :10, should be safe 2. I wonder is there a limit to how many maps that the server can create ? I also wonder is there any hardcoded limit for how many maps the server can load 3. after the instance has destroy, do the map unload ? when I wrote a custom job pvp script that each class has their own pvp room http://rathena.org/board/topic/92946-job-vs-job-pvp/?p=246463 <-- advertising the awesomeness of hercules I noticed that when the script loaded, there is some lag ... ok the map is loading but when I reloadscript, there is no lag -> the map is still available and didn't unload ? I thought those instance map should be destroyed the moment that instance_id destroy funny about this is ... I asked Hadeszeus to change the instance_set_timeout http://herc.ws/board/topic/4652-raid-instances/?p=30921 he said that will fix it ... ? but when I'm not able to reproduce this bug, I also uncertain about this
  4. if you want to randomize the query, use ORDER BY RAND()select * from `char` order by rand() limit 10;nothing to do with this topic, though
  5. I remember Emistry asked the same question before on IRC the problem is because of http://herc.ws/board/topic/512-skill-id-processing-overhaul/ hercules implement the skill ID reading in such a way that its harder to add more skill ID ( to save memory ) so we have to use the skill ID that is within the range of the gap that gravity not using
  6. support section, ok the zeny requirement has been set to dbreskill_require_db.txt https://github.com/HerculesWS/Hercules/blob/master/db/re/skill_require_db.txt#L406 so to make the condition, modify 'skill_check_condition_castbegin' inside case WS_CARTTERMINATION, make an item check in the source
  7. I remember I wrote noitemtrade mapflag in rathena http://rathena.org/board/topic/91157-is-there-a-way-to-prevent-use-on-a-specific-map/?p=239281 just need a little tweaking src/map/trade.c | 5 +++++ 1 file changed, 5 insertions(+)diff --git a/src/map/trade.c b/src/map/trade.cindex 44b669e..ad5f101 100644--- a/src/map/trade.c+++ b/src/map/trade.c@@ -36,6 +36,11 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta return; //Can't trade in notrade mapflag maps. } + if ( map->list[sd->bl.m].flag.gvg_castle && ( map->agit_flag || map->agit2_flag ) ) {+ clif->message( sd->fd, "You can't trade inside WoE castle during WoE siege period." );+ return;+ }+ if (target_sd == NULL || sd == target_sd) { clif->tradestart(sd, 1); // character does not exist return;
  8. @Adam I actually used it quite intensively in rathena forum just search "rand__" over there and you'll get more than 10 results I purposely change the name into "shuffle__" to differentiate rathena users and hercules users (as we have unlimited array index, they don't have yet) @evilpuncker I thought lottery script is just draw a card in an array ? set .@r, .array[ rand( getarraysize( .array ) ) ];its not like needed to shuffle the whole deckhttp://www.fredosaurus.com/notes-cpp/misc/random-shuffle.html
  9. rathena users use that onehttp://rathena.org/board/topic/77088-certain-map-weapon-restriction/?p=239342 but it doesn't support item names like hercules does, everything has to be filled in by numbers
  10. if you are using rathena, its very easy src/map/script.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)diff --git a/src/map/script.c b/src/map/script.cindex 5b68531..21735c0 100644--- a/src/map/script.c+++ b/src/map/script.c@@ -13103,8 +13103,12 @@ int atcommand_sub(struct script_state* st,int type){ TBL_PC *sd=script_rid2sd(st); const char *message; message=script_getstr(st,2);- if(sd)- clif_disp_onlyself(sd,message,(int)strlen(message));+ if(sd) {+ if ( script_hasdata(st,3) )+ clif_colormes( sd, script_getnum(st,3), message );+ else+ clif_disp_onlyself(sd,message,(int)strlen(message));+ } return SCRIPT_CMD_SUCCESS; } @@ -18975,7 +18979,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(deletepset,"i"), // Delete a pattern set [MouseJstr] #endif BUILDIN_DEF(preg_match,"ss?"),- BUILDIN_DEF(dispbottom,"s"), //added from jA [Lupus]+ BUILDIN_DEF(dispbottom,"s?"), //added from jA [Lupus] BUILDIN_DEF(getusersname,""), BUILDIN_DEF(recovery,"i???"), BUILDIN_DEF(getpetinfo,"i"),.. hercules however, clif->colormes has to be fixed without using color_table I dunno when Ind going to fix that though
  11. of course notit is using permanent character array, of course it will be saved in `char_reg_str_db` table
  12. its working at the same time its throwing error implode command must have at least 1 index in the array or the server throws error rathena users quite easy, they have addrid - script bst_atcommand -1,{OnInit: bindatcmd "bst",strnpcinfo(0)+"::OnCommand"; end;OnCommand: if ( !.@atcmd_numparameters ) { message strcharinfo(0), "Please, enter a message (usage: @bst <message>)."; end; } .@symbol$ = substr( .@atcmd_parameters$, 0,1 ); if ( .@symbol$ != "B>" && .@symbol$ != "S>" && .@symbol$ != "T>" ) { message strcharinfo(0), "Market Symbol is Needed when using this command ( B> S> T> )"; end; } if ( @bst_delay + 60 > gettimetick(2) ) { message strcharinfo(0), "There is a 60 seconds delay of using this command again"; end; } @bst_delay = gettimetick(2); .name$ = strcharinfo(0); .message$ = implode( .@atcmd_parameters$," " ); addrid 0; dispbottom "[Market] "+ .name$ +" : "+ .message$; end;}EDIT: why the code broken...ok that [Market] makes this cannot be post on the board it's being read as bbcode hercules user might want to try my getmemberaid http://upaste.me/86b8111195ced159a
  13. 1. possible by implementing as a script command but I don't think its possible to list more than 3 ... the client not able to list the 4th one when invite the 4th antagonist guild 2. I think its possible ... just need an extra check the opponent guild already has max antagonist guild 3. I think its possible ... just turn on the pk_mode, and everyone cursor will automatically become a sword because with pk setting on ... every map is a pvp map except with the pvp off mapflag and this kind of modification ... large as hell I don't consider this as a release ... is more like a project why not just turn on the pk_mode ?
  14. I don't think I'm gonna like this new hercules custom currency system, especially NST_CUSTOM type 1. trader type npc cannot run a script when clicking the npc 2. the confirmation message is just misleading ... http://upaste.me/5fc011118daeb01b0
  15. - script custom_drop -1,{OnNPCKillEvent: if ( !getcharid(1) ) { if ( checkidle() > 10 ) // 10 seconds end; if ( rand(4000) < 25 ) // .@rand_gc_drop ... 25/4000 = 1/160 getitem 512,1; if ( rand(2000) < 5 ) // .@rand_sc_drop .... 5/2000 = 1/400 getitem 513,1; if ( rand(1000) < 1 ) // .@rand_gc_drop .... 1/1000 getitem 511,1; } else { .@map$ = strcharinfo(3); // added a map check getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { attachrid $@partymemberaid[.@i]; if ( strcharinfo(3) != .@map$ || checkidle() > 10 ) continue; if ( rand(4000) < 25 ) // .@rand_gc_drop ... 25/4000 = 1/160 getitem 512,1; if ( rand(2000) < 5 ) // .@rand_sc_drop .... 5/2000 = 1/400 getitem 513,1; if ( rand(1000) < 1 ) // .@rand_gc_drop .... 1/1000 getitem 511,1; } } } end;}
  16. I should've commented the sample script lol algorithm script are only functions that doesn't work on its own usually need to accompany with other scripts to work yes, it only generate a set of random numbers that the numbers are not repeated ok I need to tell what is a shuffle algorithm ...
  17. http://upaste.me/08de11117d6ab17d3 you can even make multiple copies of the script, just by copy paste in the new npc and change the npc_id as the quest ID provided that you are using hercules of course, only hercules has character array
  18. I really need a topic for this shuffle algorithm or I have to keep press the search button non-stop what is Shuffle Algorithm ? - it generate a set of numbers in random order that the numbers are not repeated Wiki -> http://en.wikipedia.org/wiki/Fisher–Yates_shuffle This script is no longer necessary, use the one inside Global Function Commit Link Credit to @Haru Pull #872
  19. no it doesn't Mumbles is right when I read the source I saw SP_MOD_EXP and I thought it is like a *bonus type command but it actually store the data in `account_data` table which this table alter the value for the whole account using my script, or the script in post#8, will have an exploit that equip the item, logout, login another char in the same account then that character will be having increased exp/drop rate without equipping the item (you'll get the brown color announcement upon login ... very easy to spot this bug) no, this ModDrop, ModExp and ModDeath is not meant for item bonuses, its meant for VIP accounts has to do like EvilPunker did
  20. why use OnPCLoginEvent / OnPCLogoutEvent ? update item_db_re setscript = 'if ( readparam(bStr) >= 90 ) { bonus bAllStats,1; bonus bMaxHPrate,1; bonus bMaxSPrate,1; bonus bStr, getrefine(); }',equip_script = 'if ( readparam(bStr) >= 90 ) { ModExp = ModDrop = 110; }',unequip_script = 'if ( readparam(bStr) >= 90 ) { ModExp = ModDrop = 100; }'where id = 1201;
  21. AnnieRuru

    @sleep

    for some reason that I think I want make this as a release, so I rewrite this Download: 1.1 plugin sleeps the player and make the player invulnerable useful to take a break ?
  22. not sure if this is a bug, but its so simple to fix src/map/script.c | 2 ++ 1 file changed, 2 insertions(+)diff --git a/src/map/script.c b/src/map/script.cindex bba771a..4e83774 100644--- a/src/map/script.c+++ b/src/map/script.c@@ -8724,6 +8724,8 @@ bool buildin_delitem_search(struct map_session_data* sd, struct item* it, bool e sd = script->rid2sd(st); if( sd == NULL || sd->ud.skilltimer != INVALID_TIMER ) return true;+ if ( map->list[sd->bl.m].flag.noskill )+ return true; id = ( script_isstringtype(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) ); lv = script_getnum(st,3);
  23. - script kdjshfksfj -1,{OnInit: bindatcmd "autoloot", strnpcinfo(0)+"::OnReqItem"; bindatcmd "alootid", strnpcinfo(0)+"::OnReqItem"; bindatcmd "autolootitem", strnpcinfo(0)+"::OnReqItem"; bindatcmd "autoloottype", strnpcinfo(0)+"::OnReqItem"; end;OnReqItem: .@itemid = Red_Potion; // require item if ( !countitem( .@itemid ) ) { message strcharinfo(0), "You must have "+ getitemname( .@itemid ) +" to use "+ .@atcmd_command$; end; } if ( .@atcmd_numparameters ) atcommand .@atcmd_command$ +" "+ implode( .@atcmd_parameters$, " " ); else atcommand .@atcmd_command$; end;}why not just use bindatcmd and overwrite those autoloot stuffsso you can rentitem with an expire tick, then while the player having the items, they can use autoloot http://herc.ws/wiki/Timers_%28Scripting%29#AttachNPCTimer1. attachnpctimer is a npc type timer that is attached to the npc 2. addtimer is a player type timer that is attached to the player they are different 3. sleep type timer ... my favorite 4. static timer ... gettimetick(2)
  24. https://github.com/rathena/rathena/blob/master/db/const.txt#L1304 rathena's SC_SPIRIT in hercules is SC_SOULLINK https://github.com/HerculesWS/Hercules/blob/master/db/const.txt#L876 you'll get stoned if used your script and also, that's outdated technique http://upaste.me/f02211100e4c8f24d
  25. isn't the plugin is just below the code ? and there is no need to read the sql table, its not like this stuff is run when the player is offline to actually hit the player, both the source and target has to be online, so just use guild->check_alliance with enemy flag to read them make the script shorter a bit src/map/battle.c | 6 ++++++ 1 file changed, 6 insertions(+)diff --git a/src/map/battle.c b/src/map/battle.cindex 24f39a3..52b24ec 100644--- a/src/map/battle.c+++ b/src/map/battle.c@@ -6020,6 +6020,12 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f if( (s_bl = battle->get_master(src)) == NULL ) s_bl = src; + if ( s_bl->type == BL_PC && t_bl->type == BL_PC ) {+ TBL_PC *sd = BL_CAST( BL_PC, s_bl );+ if ( guild->check_alliance( sd->status.guild_id, ((TBL_PC*)t_bl)->status.guild_id, 1 ) && !map->list[sd->bl.m].flag.town && !map->list[sd->bl.m].flag.nowarpto )+ return 1;+ }+ if ( s_bl->type == BL_PC ) { switch( t_bl->type ) { case BL_MOB: // Source => PC, Target => MOB http://upaste.me/28fd11097df8e9a10 you know ... I start to think that lilith's faction system can actually be release entirely with plugins ..
×
×
  • Create New...

Important Information

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