Jump to content

meko

Core Developers
  • Content Count

    363
  • Joined

  • Days Won

    46

Everything posted by meko

  1. meko

    Hash table

    Version 0.3.0

    7 downloads

    This plugin exposes the internal hash table (strdb) to the script engine to provide a key-value store. See documentation on hercules-hashtable/doc/script_commands.txt Download here: https://github.com/Helianthella/hercules-hashtable
  2. View File Hash table This plugin exposes the internal hash table (strdb) to the script engine to provide a key-value store. See documentation on hercules-hashtable/doc/script_commands.txt Download here: https://github.com/Helianthella/hercules-hashtable Submitter meko Submitted 06/18/18 Category Plugins  
  3. if one doesn't want to rely on mapflags, they could also make the maps use a custom zone, and then it can be checked with OnNPCKillEvent: if (getmapinfo(MAPINFO_ZONE, strcharinfo(PC_MAP)) == "my_zone") end;
  4. meko

    Main chat area

    you can set a custom chat_area_size in battle_configuration you should find it in conf/map/battle/client.conf if you want to allow everyone on the map to talk to everyone from anywhere I would advise you to use the #map channel instead of increasing the chat area size
  5. you can use any @command on another character by doing #command "char name" <arguments> this means what you want is #changesex player
  6. IP addresses and mac addresses do not uniquely identify people. Most home internet users have dynamic IP addresses assigned by their ISP, so it changes over time, and some ISPs even assign a different one every single time the router is rebooted (ie: Orange). Even with a static IP, nothing prevents anyone from using a VPN, tor, or any other anonymity tool. IP addresses may also be shared: some schools, dormitories, and organizations have a single address for every single computer on its network, so you could end up mistaking hundreds of people as the same person. Some computers themselves are also shared (ie: with coworkers, family members, friends, …). As for mac addresses, they can very easily be spoofed, and one could even make a script to change their mac address every minute if they wanted to... so yeah, that's a bad idea too. If this still does not discourage you from using mac addresses, feel free to add this "feature" to Hercules: https://github.com/HerculesWS/Hercules/issues/1734 There's really no silver bullet to really be sure of the identity of someone, but one of the approaches that kinda works is to make abuse costly on abusers, while not imposing a huge burden on non-abusers. What works best is doing a physical verification instead of a digital one when someone creates an account. For example, most social media platforms now ask you to provide and validate a phone number. This means if someone were to bypass this verification they would have to have more than one phone. Some sites, such as Paypal, go even further ask you for your credit card number (or bank account number) and then do a transaction on it (usually $1), to see if the card is valid. This means you would have to have more than one credit card if you want to bypass this verification, which implies physically going to your bank, making an appointment, and opening a new account. Some (such as Google) prefer to snail mail you an envelope containing a code, which you then have to enter on their website. To abuse this you would need more than one street address. Keep in mind that this only makes it harder on would-be abusers and that nothing can 100% fingerprint someone. Even DNA profiling isn't perfect.
  7. @luizragna this because mes() and most commands only run for the attached player. If you want to run it for another player you will have to attachrid(.@units[.@i]); or addtimer(0, "MyNPC::MyEvent", .@units[.@i]); If you go for the timer approach you might as well just use maptimer()
  8. you could either use maptimer() or make your own function with getunits() and a for() loop EDIT: oops, @Myriad replied while I was writing this
  9. chmod u+x ./{login,char,map}-server If you want to keep the file ownership and permissions intact when copying from linux to windows you should first make a tarball on the source machine and then download this instead of downloading every file one by one (ie via FTP)
  10. released version 10, which adds array_sort() and array_rsort() uses the Lomuto implementation of the Quicksort algorithm works with both string arrays (arr$) and integer arrays (arr)
  11. all of the array functions take the given index into account, this means if you give array[8] it is only executed from index 8 onwards. for array_shuffle this is not of much use but for array_shift, for example, it can be quite useful consider an array that is 0, 1, 2, 3, 4 and that you want to remove 2: you would do array_shift(array[2]) and the array would become 0, 1, 3, 4
  12. @AnnieRuru I just released version 9, which adds array_filter() and makes array_shuffle() use the Durstenfeld implementation of the Fisher-Yates algorithm
  13. please direct all further comments here: https://github.com/HerculesWS/Hercules/issues/1734
  14. if you explain what you are trying to accomplish I could help you find a suitable solution
  15. You can't just get the player ID (account id) out of thin air, you have to get it from somewhere. If you have a ScriptState (st) you can get it from st->rid if you have a block_list (bl) you can get it from bl->id if you have a map_session_data (sd) you can get it from sd->bl.id if you have a nickname you can get the sd with map->nick2sd(nick) and then get the id with sd->bl.id
  16. meko

    @PK Command

    you want players to be able to toggle pk_mode for everyone or you want them to be able to opt-in to attacking and being attacked?
  17. I would rather advise you to use doc/script_commands.txt and the doc folder in general since it is always up-to-date. The wiki is infrequently updated
  18. use close(); instead of end(); also menu() is deprecated, so please use select()
  19. function foobar { .@first_argument$ = getarg(0); // get the value of the first argument passed to foobar() .@output$ = "Hello " + .@first_argument$; // add the value of the first argument to "Hello" return .@output$; // exit the function, while returning the value of .@output$ } mes(foobar("world")); // Hello World
  20. .@num$ = .@num % (10 ** (.@i + 1)) / (10 ** .@i) + .@num$; // x = (y mod (10 ** (z + 1)) / (10 ** z)) // x = y mod 10 // this means it can be simplified to: .@num$ = (.@num % 10) + .@num$; but I believe your original script had an error because it uses both .@num and .@num$
  21. dispbottom(sprintf("Gained 1 cash point. You now have a total of %i cash points.", ++#CASHPOINTS));
  22. That's quite resource-intensive, but sure: prontera,39,30,0 script npc_name npc_id,{ // ask the player if they want to proceed mesf("Do you want to warp your party to %s? It will cost %i tickets to every party member.", .destination_map$, .ticket_cost); if (select("yes", "no") != 1) close; // now go through a lenghty routine to validate everything .@party = getcharid(CHAR_ID_PARTY); if (.@party < 1) { mes("You must be in a party."); close; } .@leader = getpartyleader(.@party, 1); if (.@leader != getcharid(CHAR_ID_ACCOUNT)) { mes("You must be a party leader."); close; } if (strcharinfo(PC_MAP) != .start_map$) { mesf("You must be on %s.", .start_map$); close; } .@ticket_delta = .ticket_cost - TICKETMANIAC; if (.@ticket_delta > 0) { mesf("You are missing %i ticket%s.", .@ticket_delta, .@ticket_delta > 1 ? "s" : ""); close; } getpartymember(.@party, 1); .@party_count = $@partymembercount; copyarray(.@party_cid[0], $@partymembercid[0], .@party_count); copyarray(.@party_name$[0], $@partymembername$[0], .@party_count); freeloop(true); for (.@i = 0; .@i < .@party_count; ++.@i) { .@name$ = .@party_name$[.@i]; .@cid = .@party_cid[.@i]; .@aid = charid2rid(.@cid); if (.@aid < 1 || isloggedin(.@aid, .@cid) == false) { mesf("All party members must be online, but %s is currently offline.", .@name$); freeloop(false); close; } .@map$ = strcharinfo(PC_MAP, "", .@aid); if (.@map$ != .start_map$) { mesf("All party members must be on %s, but %s is currently on %s.", .start_map$, .@name$, .@map$); freeloop(false); close; } .@ticket_delta = .ticket_cost - getvariableofpc(TICKETMANIAC, .@aid, 0); if (.@ticket_delta > 0) { mesf("Party member %s is missing %i ticket%s.", .@name$, .@ticket_delta, .@ticket_delta > 1 ? "s" : ""); freeloop(false); close; } } // we got through the loop, so all conditions are met; now let's warp and decrease tickets for (.@i = 0; .@i < .@party_count; ++.@i) { .@cid = .@party_cid[.@i]; .@aid = charid2rid(.@cid); set(getvariableofpc(TICKETMANIAC, .@aid), max(0, getvariableofpc(TICKETMANIAC, .@aid) - .ticket_cost)); if (.@cid != getcharid(CHAR_ID_CHAR)) { warpchar(.destination_map$, rand(.destination_loc[0], .destination_loc[2]), rand(.destination_loc[1], .destination_loc[3]), .@cid); } } freeloop(false); mes("All party members have been warped. Now it's your turn!"); close2(); TICKETMANIAC = max(0, TICKETMANIAC - .ticket_cost); warp(.destination_map$, rand(.destination_loc[0], .destination_loc[2]), rand(.destination_loc[1], .destination_loc[3])); end; OnInit: // change those settings to your liking .start_map$ = "prontera"; .ticket_cost = 1; .destination_map$ = "payon"; .destination_loc[0] = 20; // x1 .destination_loc[1] = 20; // y1 .destination_loc[2] = 90; // x2 .destination_loc[3] = 90; // y2 }
×
×
  • Create New...

Important Information

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