PDA

View Full Version : [Lua]Anti-PVP + Anti-Duel Guards



Dr. Fallen
13-03-10, 07:59 AM
First of all these scripts aren't mine! So i'm not gonna yell for reps :p

Yes, they are coded in HypArcLUA and yes all of them usable in ArcEmu

Anti-Pvp;

if someone attacks to another player its getting killed by npc


function Battleguard(pUnit, Event)
pUnit:RegisterEvent("Lookingforpvpers", 1000, 0)
end
function Lookingforpvpers(pUnit, Event)
local tbl = pUnit:GetInRangeFriends()
for k,v in pairs(tbl) do
if v:IsInCombat() == true and v:IsPlayerAttacking() == true and v:GetDistance(pUnit) <= 1800 then
pUnit:Kill(v)
end
end
end
RegisterUnitEvent(Npc id , 18, "Battleguard")Anti-Duel;

if someone makes a duel; attacker will be killed by npc


local ADG_ID = 13371337
local duelrecord = {}

function ADG_Spawn(ADG, Event)
ADG:RegisterEvent("InRangePlayerCheckForDuels", 2000, 0)
ADG:RegisterEvent("PeriodicPrint", 600000, 0) -- One hour
logcol(13)
print("[Anti-Duel Guard] Loaded Successfully!")
logcol(7)
end

function InRangePlayerCheckForDuels(ADG, Event)
local plrs = ADG:GetInRangePlayers()
for k, v in pairs(plrs) do
if (v:GetDuelState() == 1) then -- duel state started
table.insert(duelrecord, v:GetName())
ADG:Kill(v)
v:BroadcastAreaTriggerMessage("Do not duel in the mall! Your name has been logged!")
end
end
end

local PeriodicPrint = function(ADG, Event)
logcol(13) -- some beautiful magenta
print("[Anti-Duel Guard] These people have dueled within the last server restart:\n"..duelrecord)
logcol(7) -- return to its original grey
end

RegisterUnitEvent(ADG_ID, 18, "ADG_Spawn")Credits;

THX for Anti-Duel to

Alvanaar
Neglected
Hypersniper

THX for Anti-PVP to

Nezth

Don't forget to change npc idS with ur own npc

Ish-nu Alah...