-
Content Count
363 -
Joined
-
Days Won
46
Posts posted by meko
-
-
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
-
you can use any @command on another character by doing #command "char name" <arguments>
this means what you want is #changesex player
-
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.
-
@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()
-
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
-
-
-
-
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
-
@AnnieRuru I just released version 9, which adds array_filter() and makes array_shuffle() use the Durstenfeld implementation of the Fisher-Yates algorithm
-
-
if you explain what you are trying to accomplish I could help you find a suitable solution
-
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
-
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?
-
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
-
-
-
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
-
-
-
-
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 }
-
bonus2(bHPRegenRate, ((MaxHP/100)*5), 1000); bonus2(bHPDrainRate, 10, 2);
-
use bonus instead of bonus2
OnNPCKillEvent changes
in Suggestions
Posted
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