Skip to content

Instantly share code, notes, and snippets.

@dbjorkholm
Created August 28, 2015 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbjorkholm/d31a34194838e6690248 to your computer and use it in GitHub Desktop.
Save dbjorkholm/d31a34194838e6690248 to your computer and use it in GitHub Desktop.
Party Protection
function Creature:onTargetCombat(target)
if not self then
return true
end
if self:isPlayer() and target:isPlayer() then
local party = self:getParty()
if party then
local targetParty = target:getParty()
if targetParty and targetParty == party then
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end
end
end
return true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment