Created
August 28, 2015 18:34
-
-
Save dbjorkholm/d31a34194838e6690248 to your computer and use it in GitHub Desktop.
Party Protection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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