Jump to content

AnnieRuru

Script Developers
  • Content Count

    1677
  • Joined

  • Last visited

  • Days Won

    245

Everything posted by AnnieRuru

  1. nonono ... the char_make_new_char_sql function already has a slot variable so we can make use of that variable for not using sql syntax btw, my mistake for not using slot variable in my previous post, fixed src/char/char.c | 8 ++++++++ 1 file changed, 8 insertions(+)diff --git a/src/char/char.c b/src/char/char.cindex 41b13b3..d5849f5 100644--- a/src/char/char.c+++ b/src/char/char.c@@ -1671,6 +1671,9 @@ int char_make_new_char_sql(struct char_session_data* sd, char* name_, int str, i return -2; // invalid input #endif + if ( slot != 0 && sd->group_id > 10 ) { // change 10 to minimum gm level+ return -2;+ } // check char slot if( sd->found_char[slot] != -1 ) return -2; /* character account limit exceeded */@@ -4574,6 +4577,11 @@ void char_parse_char_select(int fd, struct char_session_data* sd, uint32 ipl) } #endif + if ( slot != 0 && sd->group_id > 10 ) {+ chr->creation_failed(fd, -2);+ return;+ }+ ARR_FIND(0, ARRAYLENGTH(chr->server), server_id, chr->server[server_id].fd > 0 && VECTOR_LENGTH(chr->server[server_id].maps) > 0); /* not available, tell it to wait (client wont close; char select will respawn). * magic response found by Ind thanks to Yommy <3 */somehow I'm unable to write the char_parse_char_select as plugin ...I always get error for this line in plugin int slot = RFIFOB(fd,2);
  2. case SP_ASPD: ShowDebug( "amotion %dn", sd->battle_status.amotion ); WFIFOL(fd,4)=sd->battle_status.amotion; break;
  3. simple patch plugin #include "common/hercules.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include "char/char.h"#include "common/nullpo.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = { "1charpergm", // Plugin name SERVER_TYPE_CHAR,// Which server types this plugin works with? "0.1", // Plugin version HPM_VERSION, // HPM Version (don't change, macro is automatically updated)};int char_make_new_char_sql_pre(struct char_session_data* sd, char* name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style) { nullpo_retr(-2, sd); if ( slot != 0 && sd->group_id > 10 ) { // change 10 to minimum gm level hookStop(); return -2; } return 0;}HPExport void plugin_init (void) { addHookPre( "chr->make_new_char_sql", char_make_new_char_sql_pre );}EDIT : change 'char->' into 'chr->'now it works EDIT2: what have I done LOL forgot to add slot variable
  4. this is the 4th script that I saw someone using txt style pvp ladder 1st terces, 2nd goddameit, 3rd mine, 4th masao the problem with txt style ladder is it uses an algorithm to move the array index so its quite hard to alter the calculation that already has a fixed formula with it like you request that wants to add die ranking, to move the index, that would be impossible (if you are already using it) its better to use SQL ladder script, where it can still perform fast with million of rows if the specific key is indexed well
  5. mine, do the exact same stats in the screen shot before awakening after awakening https://github.com/HerculesWS/Hercules/blob/master/src/map/clif.c#L2858 try debug the value there
  6. - script resetter -1,{OnClock0025:mes "test"; // <--- what is this ?query_sql("TRUNCATE `dailyreward`"); end;}I'm sure you didn't check the map-server.exe for the errorthe error already print there it should say something like 'player not attached !' change that 'mes "test";' into 'announce "test", bc_all;' or 'debugmes "test";'
  7. http://herc.ws/board/topic/8587-cell-pvp-pk-area-patch/?hl=cell_pvp you have to figure out how to debug that patch ... ...actually I'm quite interested to turn it into plugin ...
  8. no, getmobdata doesn't tell what is the monster doingI will code the mobevent script command later but if you are successfully patch that mob controller system you can use AI_ACTION_TYPE_ATTACK flag to check if the monster is attacking ahh ... that patch doesn't include those constants, it was removed later http://herc.ws/board/tracker/issue-7964-left-over-constants-from-mob-controller-system/ you have to re-add it
  9. https://github.com/HerculesWS/Hercules/blob/master/src/map/itemdb.h#L500
  10. I already pull requesthttps://github.com/HerculesWS/Hercules/pull/858 but already 1 week there is no input from haru yet ... . . this one I have to refuse for 2 reasonhttp://herc.ws/board/topic/4186-party-commands/
  11. this is not official script o.o this is inside custom folder hmm ... all right I will fix it properly .. quite a ton of scripts actually ... EDIT: what the heck ... Haru is changing npc header now o.o
  12. that mob controller is seriously outdated rathena already has a more update mob unit controller script commands now ima thinking of integrate these new stuffs into my setmobdata MOBDATA_KILLER - make the monster freely attack by anything, even other monster can attack it MOBDATA_PLAYER - that player can't attack that monster, everyone else can MOBDATA_PARTY - in pvp/gvg maps, the party can't attack that monster, everyone else can MOBDATA_GUILD - in gvg maps, the guild can't attack that monster, everyone else can bg already has *bg_monster_set_team script command so can leave it out hmm ... need more ideas ...
  13. exactly, and since the player can't select anything, click ok or cancel will just close the npc without further talking thus, the script isn't bug ...... http://upaste.me/369a21998cc2e67c5 I wonder I should fix or not .... since the script isn't bug ...
  14. existing upaste link of course ? http://upaste.me/acc521986e3f34df7 there is a modify button if you register an account
  15. I already started writing battleground script since eathena you know ... ? https://www.eathena.ws/board/index.php?showtopic=276681 and another https://rathena.org/board/topic/91274-about-mob-summoned-by-bg-monster/ battleground monsters NEVER fight each other if you want, you have to make source modification ... probably in battle_check_target just to double check - script custom_bg#control FAKE_NPC,{OnStart: if ( !getwaitingroomstate( 0, "Attack Team" ) || !getwaitingroomstate( 0, "Defend Team" ) ) end; .atkteam = waitingroom2bg( "prontera", 152,187, "", "", "Attack Team" ); .defteam = waitingroom2bg( "prontera", 160,187, "", "", "Defend Team" ); delwaitingroom "Attack Team"; delwaitingroom "Defend Team"; bg_warp .atkteam, "prontera", 152,187; bg_warp .defteam, "prontera", 160,187; bg_monster .atkteam, "prontera", 155,187, "--ja--", BOW_GUARDIAN_, "custom_bg#control::OnEnd"; bg_monster .defteam, "prontera", 157,187, "--ja--", BOW_GUARDIAN_, "custom_bg#control::OnEnd"; sleep 10000; // 10 seconds to kill killmonster "prontera", "custom_bg#control::OnEnd"; bg_destroy .atkteam; bg_destroy .defteam; donpcevent "Attack Team::OnInit"; donpcevent "Defend Team::OnInit"; end;OnEnd:// awake strnpcinfo(0); end;}prontera,155,182,5 script Attack Team 1_F_MARIA,{ end;OnInit: waitingroom "ATTACK",2,"custom_bg#control::OnStart",1; end;}prontera,158,182,5 script Defend Team 1_F_MARIA,{ end;OnInit: waitingroom "DEFEND",2,"custom_bg#control::OnStart",1; end;}prontera mapflag battlegroundthis plugin should do it#include "common/hercules.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include "map/pc.h"#include "map/mob.h"#include "common/nullpo.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = { "bgmobattack", // 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)};int battle_check_target_post( int retVal, struct block_list *src, struct block_list *target, int flag ) { int16 m = target->m; struct block_list *s_bl = src, *t_bl = target; nullpo_ret(src); nullpo_ret(target); if( (t_bl = battle->get_master(target)) == NULL ) t_bl = target; if( (s_bl = battle->get_master(src)) == NULL ) s_bl = src; if ( t_bl->type == BL_MOB && s_bl->type == BL_MOB && map->list[m].flag.battleground ) if ( ((TBL_MOB*)t_bl)->bg_id != ((TBL_MOB*)s_bl)->bg_id ) return 1; return retVal;}HPExport void plugin_init (void) { addHookPost( "battle->check_target", battle_check_target_post );}
  16. HAHAHAHA !! that was a debug message I test the value for rogue compulsion discount fixed again .... damn I need to double check to not post up my debug stuffs ...
  17. since keyworld counting sort doesn't really work -> it display all same index in the output array I write my own counting sort use upaste then http://upaste.me/9aa421992effb80b1 now test how fast is it compare to merge sort, comb sort and counting sort http://upaste.me/42e2219938d15d0ff Haru's merge sort -> 499~531 mili-seconds Keyworld's merge sort -> 453~468 mili-seconds Haru's comb sort -> 436~453 mili-seconds Keyworld's comb sort -> 390~437 mili-seconds counting sort -> 109~125 mili-seconds I'll stick to my counting sort from now on function script counting_sort_index { .@total = .@size = getarg( 2, getarraysize( getarg(0) ) ); copyarray .@arr, getarg(0), .@size; while ( .@i < .@size ) { setd ".@index_"+ .@arr[.@i] +"["+( .@tmp[.@arr[.@i]] )+"]", .@i; .@tmp[.@arr[.@i]]++; .@i++; } do { .@index = getarraysize(.@tmp) -1; .@tmp[.@index]--; .@out[.@size-1] = getd( ".@index_"+ .@index +"["+( .@tmp[.@index] )+"]" ); .@size--; } while( .@size ); copyarray getarg(1), .@out, .@total; return;}addtionally, asm method doesn't run faster anymore, seems haru already upgrade our script engine
  18. @@Emistry https://github.com/HerculesWS/Hercules/blob/master/npc/custom/card_remover.txt#L40 at least try to memorize all the script name in npc/custom/...
  19. that was meant for high rate server so I never having this problem but yeah in low rate server it may be .... fixed PS: I prefer high rate server because I prefer to write events/gvg/battleground scripts
  20. ah ... that was because official behavior, players can change equipment while talking to npc that's why that check was meant to counter those players who are trying to cheat with changing equips after members found this may lead to some exploit (on other script), the *disable_item script command was added later so yeah, with *disable_item script command, that condition is useless but I tested the script isn't bug though
  21. exactlyotherwise why you think members say my plugin is bug because I used "common/memmgr.h" but they have to change to "common/malloc.h" how long do you think this have been changed ?
  22. no, I mean some server use the SQL table, and haru doesn't provide converter for SQL one http://herc.ws/board/topic/10913-mob-db-file-structure-overhaul/?p=65080 that member store all custom mobs in his `mob_db2` table
  23. you want all stuffs for your healer npc ? https://www.eathena.ws/board/index.php?s=&showtopic=274421&view=findpost&p=1504415 everything is inside here remember the constant needs capital letters ... lol erm ... writing one now http://upaste.me/acc521986e3f34df7
  24. agree with Samuel saidwe should always use the update server revision as we keep adding stuffs and fixing bugs just stick to update server revision EDIT: many member still doesn't want to use the latest one probably because they hate the new mob_db.conf format too many custom mobs need to convert =/
  25. guild_vs2,50,50,4 script Shy Eclipse 4_DOG01,{ addtimer 1, strnpcinfo(0)+"::OnEndTalk"; .talking++; mes "[Eclipse]"; mes "!! Squik..!"; emotion e_panic; next; if ( select("Pet it.:Scare it away.") == 1 ){ mes "[Eclipse]"; mes "**Squik~**"; emotion e_lv; } else { mes "[Eclipse]"; mes "SQUIK!"; emotion e_omg; } close;OnEndTalk:OnPCLogoutEvent: .talking--;// announce .talking +"", 0; end;OnInit: npcspeed 100; while ( true ) { if ( !.talking ) { getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@x2 = .@x + rand(-10,10), .@y2 = .@y + rand(-10,10), cell_chknopass ) ); npcwalkto .@x2, .@y2; } sleep rand(1000,3000); }}
×
×
  • Create New...

Important Information

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