Jump to content

AnnieRuru

Script Developers
  • Content Count

    1677
  • Joined

  • Last visited

  • Days Won

    245

Everything posted by AnnieRuru

  1. https://github.com/HerculesWS/Hercules/blob/stable/db/re/job_db.conf
  2. your profile said you are using Hercules but when I test the script all kinds of errors pop up [Error]: script_add_str: detected possible use of wrong case in a script. Found 'setBattleFlag', probably meant to be 'setbattleflag' (in 'npc/zzz.txt'). [Error]: script error in file 'npc/zzz.txt' line 158 column 3 parse_line: expect command, missing function name or calling undeclared func tion 155: 156: // Restore experience rates: 157: if(checkcell("prontera",0,0,cell_water)) { * 158: setBattleFlag "base_exp_rate",getBattleFlag("base_exp_rate") - $TIbr; ~~~~~~~~~~~~~~~~^ 159: setBattleFlag "job_exp_rate",getBattleFlag("job_exp_rate") - $TIjr; 160: set $TIbr,0; 161: set $TIjr,0; [Error]: script error in file 'npc/zzz.txt' line 158 column 46 parse_line: need ';' 155: 156: // Restore experience rates: 157: if(checkcell("prontera",0,0,cell_water)) { * 158: setbattleflag "base_exp_rate",getBattleFlag("base_exp_rate") - $TIbr; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 159: setbattleflag "job_exp_rate",getBattleFlag("job_exp_rate") - $TIjr; 160: set $TIbr,0; 161: set $TIjr,0; [Error]: script error in file 'npc/zzz.txt' line 332 column 48 parse_line: expect command, missing function name or calling undeclared funtion 329: end; 330: 331: OnPCDieEvent: * 332: if((.a > 0) && (getsavepoint(0) == .c2$[.b])) save .s$,.sx,.sy; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 333: end; 334: 335: OnWhisperGlobal: this script is not meant for Hercules ok the script loads fine in rathena [Warning]: buildin_monster: Attempted to spawn non-existing monster class 2503 [Debug]: Source (NPC): invasor (invisible/not on a map) [Warning]: buildin_monster: Attempted to spawn non-existing monster class 1228 [Debug]: Source (NPC): invasor (invisible/not on a map) can you just read the map-server.exe for all the errors ? this is a bad ... script ... unreadable ... why I have to refer to what the t1 c1 c2 t2 means ... why not just make a proper variable name like .t1 = .min_time , .t3 = .duration I cannot read this script, I'm out
  3. what's the point of Pause button if when you say you will only get the reward when you stayed online for 5 hours straight without logging out/disconnect/offline ?
  4. http://upaste.me/c7b7498104f6c72df you know ... this script do exactly the same thing as the previous one ... now you can see the script just look totally different EDIT: although I don't know you are also obsess with instanced battleground or not ... since both hercules and rathena also can do it
  5. should be prontera,155,189,5 script ksdfjhsf 1_F_MARIA,{ // atcommand "@kick "+ strcharinfo(0); .ban_hour = 1; atcommand "@ban +"+.ban_hour+"h "+strcharinfo(0); //Ban the Player for 1 hour. end; } without the double quotation mark
  6. I hope you are not asking dump question safesnprintf(atcmd_output, CHAT_SIZE_MAX, "Price: %u | Amount: %d | Map: %s (%d,%d)", pl_sd->vending[j].value, pl_sd->vending[j].amount, map->list[pl_sd->bl.m].name, pl_sd->bl.x, pl_sd->bl.y); clif->message(fd, atcmd_output); safesnprintf(atcmd_output, CHAT_SIZE_MAX, "Shop: %s +%d %d[%d][%d][%d][%d]", pl_sd->message, pl_sd->status.cart[pl_sd->vending[j].index].refine, pl_sd->status.cart[pl_sd->vending[j].index].nameid, pl_sd->status.cart[pl_sd->vending[j].index].card[0], pl_sd->status.cart[pl_sd->vending[j].index].card[1], pl_sd->status.cart[pl_sd->vending[j].index].card[2], pl_sd->status.cart[pl_sd->vending[j].index].card[3]); clif->message(fd, atcmd_output);
  7. wait a moment ... you are using rathena but that bg script in github doesn't work for you ? must have mean you are using very outdated emulator https://github.com/rathena/rathena/commits/master/npc/custom/battleground/bg_emp.txt check the history and use the initial version that Euphy posted 4 years ago ?
  8. assuming you have this https://github.com/HerculesWS/Hercules/blob/stable/npc/mapflag/town.txt prontera,150,185,5 script test 1_F_MARIA,{ input .@map$; if ( getmapusers( .@map$ ) == -1 ) dispbottom "no such map"; else if ( !getmapflag( .@map$, mf_town ) ) dispbottom "not a town"; else atcommand "@go "+ .@map$; // yeah lazy to note down the coordinate, so use atcommand end; }
  9. hercules<=>rathena battleground/instance/mob-controller script commands are totally different I also have to admit hercules one are always on the harder side ... this is not funny matter .... just ... well ... see how the script grow in size comparative to rathena ones, and you'll understand why until today I still haven't convert my arathi basin on rathena into hercules http://upaste.me/f08349808ea0ba1b1
  10. I remember this is client issue though, correct me if I'm wrong .... because I remember I read this topic/article before .... it just like all those Job_Knight2/Job_Crusader2 is actually tell the client sprite change from Job_Knight which is setmount MOUNT_NONE; into Job_Knight2 which is setmount MOUNT_PECO; so its the same if you want to make other jobs that can mount pecopeco, has to make more custom job like example Job_Novice2 ... etc etc Note the difference between Job_Star_Gladiator and Job_Star_Gladiator2 so yeah, the only way is to client hexing ... erm ... Good luck ~
  11. my signature ... click on the right heart ... old rubbish -> eAthena-TXT-9909[Stable].rar
  12. similar topic appear in rathena forum prontera,155,180,0 script Test Instance 1_F_MARIA,{ if ( has_instance2("guild_vs2") >= 0 ) { // dispbottom has_instance2("guild_vs2") +" destroy"; instance_destroy has_instance2("guild_vs2"); } if ( ( .@ins = instance_create( "Test Instance", getcharid(CHAR_ID_ACCOUNT), IOT_CHAR ) ) < 0 ) { mes "error : "+ .@ins; close; } if ( !getstrlen( instance_attachmap( "guild_vs2", .@ins, true, ( getcharid(CHAR_ID_ACCOUNT) )+"INST" ) ) ) { mes "error : 5"; instance_destroy .@ins; close; } instance_set_timeout 3600, 15, .@ins; instance_init .@ins; warp has_instance("guild_vs2"), 49,49; end; } guild_vs2,49,49,5 script test dialog 1_F_MARIA,{ dispbottom strnpcinfo(NPC_MAP); mesf "%d monsters on this map", 'amount; next; select "Destroy"; instance_destroy; end; OnInstanceInit: monster has_instance("guild_vs2"), 49,49, "--ja--", PORING, 10, instance_npcname( strnpcinfo(NPC_NAME) )+"::OnMobDead"; 'amount = 10; end; OnMobDead: --'amount; if ( !'amount ) instance_announce -1, "all monster killed", bc_map; end; } few things noted for hercules ones 1. hercules has more instance related script commands, but also make this more flexible to write once you learn them all a. hercules has *instance_attach script command, make sure this script command is added before trying do anything instance related in the register npc b. hercules has to emulate the map name with *instance_attachmap if the map name doesn't follow the syntax <number>@<5 string limit> 2. hercules instance ID start from 0, rathena instance ID start from 1 a. make sure the instance_announce is set to -1 3. hercules seems cannot *instance_destroy inside the instance map itself ... has to rely on *instance_set_timeout of the timeout value
  13. script -> http://upaste.me/94e94979017edd8ef plugin -> http://upaste.me/d74c497892f91a6d6 @MikZ next time should ask on the forum instead of bombard my PM box and its your own topic too
  14. let's see ... #include "common/hercules.h" #include "map/pc.h" #include "map/mob.h" #include "map/battle.h" #include "plugins/HPMHooking.h" #include "common/HPMDataCheck.h" HPExport struct hplugin_info pinfo = { "Poring invincible", SERVER_TYPE_MAP, "0_0", HPM_VERSION, }; int64 battle_calc_damage_pre(struct block_list **src,struct block_list **bl,struct Damage **d,int64 *damage,uint16 *skill_id,uint16 *skill_lv) { struct block_list *s_bl = *src; if ( (s_bl = battle->get_master(*src)) == NULL ) { s_bl = *src; } if ( s_bl->type == BL_PC && (*bl)->type == BL_MOB ) { TBL_PC *sd = BL_CAST( BL_PC, s_bl ); TBL_MOB *md = BL_CAST( BL_MOB, *bl ); if ( !strcmp( mapindex_id2name(sd->mapindex), "prontera" ) && md->class_ == 1002 ) { hookStop(); return 0; } } return 0; } HPExport void plugin_init (void) { addHookPre( battle, calc_damage, battle_calc_damage_pre ); } still can agi down the mob ... etc lazy to do the rest EDIT: some other answers on rathena forum ... NPC_INVINCIBlE = SC_INVINCIBLE .... means dealing 1 damage .... not 0 damage though EDIT2: change BL_UCAST into BL_CAST BL_UCAST should be only use in iteration
  15. https://rathena.org/board/topic/115702-how-i-do-make-a-invencible-mob/ unfortunately, hercules doesn't have the script command to make monster immune ... although I have a better idea on how to do this ...but I have to say currently hercules mob controller system is f*ck up better fix existing one 1st before moving on implement new stuffs
  16. https://github.com/HerculesWS/Hercules/blob/stable/db/re/level_penalty.txt#L13 well you can search RENEWAL_DROP inside the src folder for further investigation
  17. the easiest way I can think of is ... OnNPCKillEvent: + *getitem EDIT: prontera,159,185,5 script jskdhfjs2hfd 1_F_MARIA,{ freeloop true; .@nb = query_sql("select id from mob_db", .@id ); for ( .@i = 0; .@i < .@nb; ++.@i ) { if ( addmonsterdrop( .@id[.@i], 512, 10000 ) == false ) dispbottom "Mob ID "+ .@id[.@i] +" failed."; // else // dispbottom "Mob ID "+ .@id[.@i] +" OK."; } dispbottom .@nb +" monsters updated"; end; } yeah it works ... the RENEWAL_DROP is getting in the way comment the line in src\config\renewal.h and it works
  18. 9. What is the maximum string limit for *query_sql Since query_sql sending the query as a string, we can actually use string manipulation script commands such as *sprintf and *implode Example : *sprintf Example : *implode So, someone might ask, what is the string limit for query_sql until the map-server show error ? The answer is very surprising ... I just tested with above script, and it still works perfectly fine ! loop -> 64.210 seconds query -> 3.229 seconds it means, ahh .... or maybe ... The answer might be ... [SQL]: DB error - MySQL server has gone away [Debug]: showmsg: dynamic buffer used, increase the static buffer size to 4306185 or more. until MySQL stop responding XD 9a. UNION Just now the *implode example, it just shows the `mvp_id`, but if we want to display the information like this, +--------+------------------+------------+-----------------------+ | MVP_ID | MVP_NAME | DropCardid | MVP_CARD_NAME | +--------+------------------+------------+-----------------------+ | 1086 | Golden Thief Bug | 4128 | Golden Thiefbug Card | | 1115 | Eddga | 4123 | Eddga Card | | 1150 | Moonlight Flower | 4131 | Moonlight Flower Card | for ( .@i = 0; .@i < .@size; ++.@i ) .@values$[.@i] = "( "+ .@mvpid[.@i] +", (SELECT `kname` FROM `mob_db` WHERE ID = "+ .@mvpid[.@i] +"), (SELECT `DropCardid` FROM `mob_db` WHERE ID = "+ .@mvpid[.@i] +"), (SELECT `item_db`.`name_japanese` FROM `item_db` LEFT JOIN `mob_db` ON `item_db`.`id` = `mob_db`.`DropCardid` WHERE `mob_db`.`ID` = "+ .@mvpid[.@i] +") )"; query_sql "INSERT IGNORE INTO `mvp_table` VALUES "+ implode( .@values$, ", " ); This part ... can be optimize with UNION for ( .@i = 0; .@i < .@size; ++.@i ) .@values$[.@i] = "SELECT "+ .@mvpid[.@i] +", `kname`, `DropCardid` AS `MVP_CARD`, (SELECT `name_japanese` FROM `item_db` WHERE `id` = `MVP_CARD`) FROM `mob_db` WHERE ID = "+ .@mvpid[.@i]; query_sql "INSERT IGNORE INTO `mvp_table` "+ implode( .@values$, " UNION " ); DONE ---- FINALLY !! 2 weeks to get this guide done XD Yes, I knew the chapter 5 and beyond is very tough to understand ... it also took me longer time to write and test all these advance SQL techniques too Anyway, this topic is now open to Suggestions, Ideas, Improvements, and Questions ~ I'm sure many of you have some questions since the creation of this topic You may also post up your tricks if you want to share with us
  19. prontera,155,185,5 script jsdfksdjf 1_F_MARIA,{ if ( .mobid ) end; .mobid = monster( "this", -1, -1, "--ja--", 1002, 1, strnpcinfo(3)+"::Onaaa" ); setunitdata .mobid, UDT_MAXHP, 1000000; setunitdata .mobid, UDT_HP, 1000000; while ( .mobid ) { npctalk "Poring HP is now "+( getunitdata( .mobid, UDT_HP ) / 10000 )+"%"; sleep 2000; } end; Onaaa: .mobid = 0; end; } ... although this script is working but ... my map-server.exe spam error ... check the script command in script.c ... Line 19671 } break; default: ShowError("buildin_getunitdata: Unknown object!\n"); script_pushint(st, 0); return false; } // end of bl->type switch #undef getunitdata_sub return false; <<----- WTF PUT A RETURN FALSE FOR WHAT REASON !!! }
  20. 8. Table JOIN vs AS CREATE TABLE `pvpladder` ( `char_id` int(11) PRIMARY KEY, `points` int(11) ) ENGINE = InnoDB; This table is missing the `name` field. So have to retrieve the `name` from the `char` table. A simple way is using table JOIN SELECT `char`.`char_id`, `char`.`name` , `pvpladder`.`points` FROM `pvpladder` LEFT JOIN `char` ON `pvpladder`.`char_id` = `char`.`char_id` ORDER BY `pvpladder`.`points` DESC LIMIT 10; However, there is an uncommon method, the same thing can be done using Aliases SELECT `char_id` AS `CID`, (SELECT `name` FROM `char` WHERE `char_id` = `CID`), `points` FROM `pvpladder` ORDER BY `points` DESC LIMIT 10; In this example, both tables `char` and `pvpladder` have the `char_id` field index as PRIMARY KEY and thus both examples return the result in same amount of time However, there is a key difference on the optimization speed if the one of the table is not index properly The below example, `item_id`.`id` field is index as PRIMARY KEY, but `mob_db`.`DropCardid` is not index SELECT `mob_db`.`ID`, `mob_db`.`kname`, `item_db`.`id`, `item_db`.`name_japanese` FROM `mob_db` LEFT JOIN `item_db` ON `mob_db`.`DropCardid` = `item_db`.`id` WHERE `mob_db`.`DropCardid` > 0; SELECT `ID`, `kname`, `DropCardid` AS `ITEM_ID`, (SELECT `name_japanese` FROM `item_db` WHERE `id` = `ITEM_ID`) FROM `mob_db` WHERE `mob_db`.`DropCardid` > 0; The 2nd query that uses Aliases will return result faster than table JOIN in this case Conclusion : If use table JOIN, you have to keep in mind that the joined column has to be index but if use AS, there is no need to consider this issue
  21. of course I don't know how to get that bug ... and I immediately removed the registry without reading anything ... I mean like com'on ... if this is server side bug, I would love to know how to do this too XD however this only happens in my registry area so .... how the server going to modify another person's computer registry just to get this feature ... doesn't sound right to me
  22. pk mode is meant for something else I don't think using pk mode as your idea will work - script DayNightPvP FAKE_NPC,{ OnInit: // Put all possible fields and dungeons here setarray .map$, "prt_fild00", "prt_fild01", "prt_fild02", "prt_fild03"; // lazy to put all .size = getarraysize(.map$); freeloop true; for ( .@i = 0; .@i < .size; ++.@i ) { setmapflag .map$[.@i], mf_pvp_nocalcrank; if ( gettime(GETTIME_HOUR) >= 20 || gettime(GETTIME_HOUR) < 8 ) setmapflag .map$[.@i], mf_pvp; } // Overlap the original atcommand, both will run together bindatcmd "day", strnpcinfo(0)+"::OnClock0800"; bindatcmd "night", strnpcinfo(0)+"::OnClock2000"; end; OnClock0800: announce "Morning! The world has become safer!", bc_all, C_WHITE; day; for ( .@i = 0; .@i < .size; ++.@i ) // pvpoff .map$[.@i]; removemapflag .map$[.@i], mf_pvp; end; OnClock2000: announce "Night! Outside the city it became dangerous!", bc_all, C_WHITE; night; for ( .@i = 0; .@i < .size; ++.@i ) // pvpon .map$[.@i]; setmapflag .map$[.@i], mf_pvp; end; } EDIT2: it seems just setmapflag pvp works, don't need to use pvpon script command EDIT: woot ... suddenly 2 new posts comes out ... let me test ... - script DayNightPvP -1,{ OnInit: bindatcmd "day", strnpcinfo(0)+"::OnClock0800"; bindatcmd "night", strnpcinfo(0)+"::OnClock2000"; end; OnClock0800: announce "Morning! The world has become safer!", bc_all, C_WHITE; setbattleflag "pk_mode", 0; end; OnClock2000: announce "Night! Outside the city it became dangerous!", bc_all, C_WHITE; setbattleflag "pk_mode", 1; end; } nope, doesn't work ... I set my pk_mode into 0, @_night doesn't let me kill other player and when set pk_mode into 1, @_day also let me able to kill other player PS: _day _night because someone really name night here ... if I type that will become mention that member
  23. thanks to @Asheraf solved this in discord I just have to clean my registry ... problem solved
  24. 7. INSERT INTO ... SELECT ... Question : This question was asked on eathena forum . Note: at the time the old mail system was unstable and not many server use it I want to reward my players for supporting my server. I want to give every player who are still actively login in this year (2010) an item ID 22574 in their storage How do I achieve this ? Answer : Run this SQL command when your server is offline INSERT INTO `storage` (`account_id`, `nameid`, `amount`, `identify`) SELECT `account_id`, '22574', '1', '1' FROM `login` WHERE DATE(`lastlogin`) >= '2010-01-01' && `account_id` !=1; The reply from the topic starter gives a feed back, including this Inserted rows: 7738 Inserted row id: 8244859 (Query took 13.6253 sec)
  25. Character name appear on top of character head -> in Hercules ok I have NO IDEA how it becomes like this the only thing I remember is when I was trying this reproduce this bug https://github.com/HerculesWS/Hercules/issues/1930 after @.fontcolor red and say something, immediately log out, and it became like this ever since I have clean my Hercules emulator, recompile 3 times, and still show up like this 2017-05-17aRagexeRE_patched.exe and don't tell me its client side error, I have tested with rathena test server and it doesn't show like this same hexed client, same KRO, same data folder, same client translation, same clientinfo.xml ..... only different emulator
×
×
  • Create New...

Important Information

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