Jump to content

Searching for anti farm pvp kills


Recommended Posts

Hi,

Im searching for a system that prevents farming kills.

Let's say that i have a quest that gives 50 STR if Player A kills 500 players.

Basicly, what people do (it's very common) is:

Player A creates a whole bunch of accounts/characters and kills them with their main account - so it's easier to gain that 50 STR bonus.

Im looking for something that can prevent this - i know there's something around as i've seen it before.

 

Thanks

  • Love 1
Link to comment
Share on other sites

12 hours ago, asterix2 said:

Hi geral.

battle.cpp

search this function:

bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)

Search in the function this:

if (ch->IsPC() && victim->IsPC())

 

add under:

if (ch->GetMapIndex() == MAPINDEX && victim->GetMapIndex() == MAPINDEX)
return false;

How can that solve my concern?

Link to comment
Share on other sites

4 hours ago, tierrilopes said:

Check level/gametime of dead player match a condition?

Check if the ip of the killer and killed person matches?

Or a max kill per minute thing?

Thats some options, but all are bypassable.

That would work, althought im not confortable coding C++ that's why im paying for someone to actually do it.

Link to comment
Share on other sites

7b46693f53f201bd91bbb1b7fb1b8636.gif

 

I made this 5 minutes .. why pay for this easy work? xD

Quest:

quest lua_function_vegas begin
	state start begin
		when kill with npc.is_pc() begin
			local global_insult_sex
				if pc.get_sex() == 0 then
					global_insult_sex = "gay"
				else
					global_insult_sex = "bitch"
				end
				
			local check_my_ip = pc.get_ip()
			local check_enemy_ip = npc.get_ip()
  
				if check_my_ip == check_enemy_ip then
					say("You're too "..global_insult_sex.."!")
					return	
			end
		end
	end
end
Server/quest_functions
pc.get_ip
npc.get_ip
Src/game/questlua_pc.cpp
	int pc_get_ip(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
		if(!ch) return 0;
 
		lua_pushstring(L, ch->GetDesc()->GetHostName());
		return 1;
	}
	
	{ "get_ip",				pc_get_ip							},
Src/game/questlua_npc.cpp  
	int npc_get_ip(lua_State* L)
    {
        LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr();
        if (npc && npc->IsPC())
            lua_pushstring(L, npc->GetDesc()->GetHostName());
        else
            lua_pushstring(L, "");
        return 1;
    }
	
	{ "get_ip",						npc_get_ip						},
Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2
Link to comment
Share on other sites

15 hours ago, VegaS said:

7b46693f53f201bd91bbb1b7fb1b8636.gif

 

I made this 5 minutes .. why pay for this easy work? xD

Quest:


quest lua_function_vegas begin
	state start begin
		when kill with npc.is_pc() begin
			local global_insult_sex
				if pc.get_sex() == 0 then
					global_insult_sex = "gay"
				else
					global_insult_sex = "bitch"
				end
				
			local check_my_ip = pc.get_ip()
			local check_enemy_ip = npc.get_ip()
  
				if check_my_ip == check_enemy_ip then
					say("You're too "..global_insult_sex.."!")
					return	
			end
		end
	end
end

Server/quest_functions

pc.get_ip
npc.get_ip

Src/game/questlua_pc.cpp

	int pc_get_ip(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
		if(!ch) return 0;
 
		lua_pushstring(L, ch->GetDesc()->GetHostName());
		return 1;
	}
	
	{ "get_ip",				pc_get_ip							},

Src/game/questlua_npc.cpp  

	int npc_get_ip(lua_State* L)
    {
        LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr();
        if (npc && npc->IsPC())
            lua_pushstring(L, npc->GetDesc()->GetHostName());
        else
            lua_pushstring(L, "");
        return 1;
    }
	
	{ "get_ip",						npc_get_ip						},

 

Sounds great, althought i think that people would complain because let's say that Player A has a brother & he's dueling with him. Maybe there's any way to make something that works like ratio, let's say it only raises suspect flags of farming if it's killed within X seconds or if it killed the same person more than X times?

 

Thanks!

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

9 hours ago, geral541 said:

 

Sounds great, althought i think that people would complain because let's say that Player A has a brother & he's dueling with him. Maybe there's any way to make something that works like ratio, let's say it only raises suspect flags of farming if it's killed within X seconds or if it killed the same person more than X times?

 

Thanks!

I believe you can add a qf counting the kills, using Vegas example

But having it reset after some time, for example 15min?

Dont actually know how to write it, just supposing it could be that way, im sure theres someone that may write it or even better then my example

Link to comment
Share on other sites

mKCWHQU.png

 

3 hours ago, MartaSampaio said:

I believe you can add a qf counting the kills, using Vegas example

But having it reset after some time, for example 15min?

Dont actually know how to write it, just supposing it could be that way, im sure theres someone that may write it or even better then my example

 

It was written in 15 minutes, may be some mistakes and the code is not one of the best.

--[[
##########################################
# Dev: VegaS        	  				 #
# Quest: Blocking IP address to killings #
# Date: 25/05/2016    	  				 #
##########################################
]]
quest pvp_global begin
    state start begin
	function Verification_Ip_Adress()
		local search_me = pc.get_ip()
		local search_enemy = npc.get_ip()	
		local table_count_kill_ip = pc.getqf("count_ip_block")	
		if search_me == search_enemy then
			pc.setqf("count_ip_block", pc.getqf("count_ip_block") + 1)
		end	
	end
	function Verification_Block()
		local go_to_text_insult_find_by_race
		if pc.get_sex() == 0 then
			go_to_text_insult_find_by_race = "gay"
		else
			go_to_text_insult_find_by_race = "bitch"
		end	
		local block_me = pc.get_ip()
		local block_enemy = npc.get_ip()	
		local list_block_ = pc.getqf("count_ip_block")	
		if block_me == block_enemy and list_block_ == 10 then
			say("You're too "..go_to_text_insult_find_by_race.."!")
			return
		end
	end
        when login with pc.level >= 1 begin
            set_state(player_kill)
        end
    end
    state player_kill begin
        when letter begin
            send_letter("Kill PvP")
        end

        when button or info begin
            say_title("Experts pvp")
            say_reward("Kill 30 player!")
            pc.setqf("state_kill", 30)
            q.set_counter("Kills left:", 30)
			set_state(kill)
        end
   end
   state kill begin
      when letter begin
         send_letter("Duel")
      end
		when button or info begin
			say("Your text........")
			say_reward("Kills left: "..pc.getqf("state_kill").." ")
		end

        when kill with npc.is_pc() begin	
			if get_time() < pc.getqf("time_kill") then
				syschat("Not yet passed the 5 minutes after the last killing!")
				return
			end

			pvp_global.Verification_Block()
			
            local count_kill = pc.getqf("state_kill") - 1
            if count_kill <= 30 then
				pvp_global.Verification_Ip_Adress()

                pc.setqf("state_kill", count_kill)
                q.set_counter("Kills left:", count_kill)
				pc.setqf("time_kill", get_time()+ 300) -- 5 minutes
            end
            if count_kill == 0 then
                say_title("Congratulations!")
				notice_all("".. pc.get_name() .." mission completed your details!")
                clear_letter()
                set_state(__COMPLETE__)
            end
		end
	end
		state __COMPLETE__ begin
    end
end

 

3 hours ago, Exygo said:

Don't forget #include "desc_client.h"

for quest_lua_npc

Is ok and, perhaps it already has:

    #include "desc.h"

 

 

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.