Jump to content

meko

Core Developers
  • Content Count

    363
  • Joined

  • Days Won

    46

Posts posted by meko


  1. 6 hours ago, AnnieRuru said:

    but there is a way to actually solve all these problem,

    find this line

    
    OnNPCKillEvent:

    replace with ...

    
    OnNPCKillEvent:
    	if ( getmapflag( strcharinfo(PC_MAP), mf_nosave ) )
    		end;

     

     

    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;

     


  2. 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.


  3. 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


  4. 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

  5. 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

     


  6. 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.