• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Party protection and shared exp.

Syryniss

Member
Joined
Feb 13, 2014
Messages
206
Reaction score
20
Hi. I'm looking for script, that will disable pvp when someone is in party with another player. So, if he cast a spell and party member will be in area, he won't recive any damage, but any onther player will, like normal.
And the second thing is shared experience, I want each party member to gain the same amount of exp, like 60% if they are 2 members, 40% if they are 3 and so on.
Thanks for any help.

And like always, I forgot : TFS 0.3.6
 
Last edited:
Sure.
Code:
function onCombat(cid, target)
if isPlayer(target) then
local a, b = getPlayerParty(cid), getPlayerParty(target)
if a and b and a == b then
return false
end
end
return true
end

Credits to Cykotitan.
 
data -> creaturescripts -> creaturescripts.xml , add this before "</creaturescripts>"
Code:
<event type="combat" name="PartyDamage" event="script" value="partydamage.lua"/>

data -> creaturescripts -> scripts -> create a new file partydamage.lua and paste this inside :
Code:
function onCombat(cid, target)
if isPlayer(target) then
local a, b = getPlayerParty(cid), getPlayerParty(target)
if a and b and a == b then
return false
end
end
return true
end

data -> creaturescripts -> scripts -> login.lua, paste this before "return true" :
Code:
registerCreatureEvent(cid, "PartyDamage")
 
!Bring Up My Post!
Still need help with shared exp, I mean I want to increase gained exp by party members like 60% for 2 members, 40% for 3 etc. (bonus +10% exp when in party, something like that).
 

Similar threads

Back
Top