Hi, im working in this faction mod, and adapted a TvT event from the forum, now its working fine.
The only problem is that faction attack restriction interferes with TVT Event, so when 2 players from same faction are in tvt , they cannot attack each other,
found this in l2character:
if (this instanceof L2PcInstance)
{
L2PcInstance player = (L2PcInstance) this;
L2PcInstance trgtF = null;
boolean cond = true;
if (!player.isInSiege() && !player.isInOlympiadMode() && !player.isInsideZone(ZONE_PVP)) {
if (target instanceof L2PcInstance)
trgtF = (L2PcInstance) target;
else if (target instanceof L2SummonInstance)
trgtF = ((L2SummonInstance)target).getOwner();
else if (target instanceof L2PetInstance)
trgtF = ((L2PetInstance)target).getOwner();
if (trgtF != null && trgtF != player)
{
if (trgtF.getFactionId() == player.getFactionId() && player.getFactionId() > 0)
cond = false;
else if (trgtF.getFactionId() == 0 || player.getFactionId() == 0)
cond = false;
}
if (!cond)
return;
}
and this in l2pcinstance:
if (skill.isPvpSkill()) // pvp skill
{
// CHECK IF OKAY
if (!isInSiege() && !isInOlympiadMode()) {
if (getFactionId() != target.getActingPlayer().getFactionId() && !isInsidePeaceZone(this, target))
return true;
}
// in clan war player can attack whites even with sleep etc.
if (getClan() != null && ((L2PcInstance)target).getClan() != null)
{
if(getClan().isAtWarWith(((L2PcInstance)target).getClan().getClanId()))
return true;
}
}
else if ((skilldat != null && !skilldat.isCtrlPressed() && skill.isOffensive() && !srcIsSummon)
|| (skilldatpet != null && !skilldatpet.isCtrlPressed() && skill.isOffensive() && srcIsSummon))
{
if (!isInSiege() && !isInOlympiadMode()) {
if (getFactionId() != target.getActingPlayer().getFactionId() && !isInsidePeaceZone(this, target))
return true;
}
// in clan war player can attack whites even with sleep etc.
if (getClan() != null && ((L2PcInstance)target).getClan() != null)
{
if (getClan().isAtWarWith(((L2PcInstance)target).getClan().getClanId()))
return true;
}
i tried adding "if (!isInSiege() && !isInOlympiadMode() && !isInFunEvent) { but it does not work.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
The stats you see in game are corrected by their relative factors (for example the mob's STR will influence his P.Atk etc.)
The stats you see in the XML are the base stats.
NPC information in the game does not match the XML. The values are set higher than in the XML. All monsters are set this way. Where can I find information about this? There is no option in the server config files to change this. Please help.
Question
Kotegaeshi92
Hi, im working in this faction mod, and adapted a TvT event from the forum, now its working fine.
The only problem is that faction attack restriction interferes with TVT Event, so when 2 players from same faction are in tvt , they cannot attack each other,
found this in l2character:
if (this instanceof L2PcInstance) { L2PcInstance player = (L2PcInstance) this; L2PcInstance trgtF = null; boolean cond = true; if (!player.isInSiege() && !player.isInOlympiadMode() && !player.isInsideZone(ZONE_PVP)) { if (target instanceof L2PcInstance) trgtF = (L2PcInstance) target; else if (target instanceof L2SummonInstance) trgtF = ((L2SummonInstance)target).getOwner(); else if (target instanceof L2PetInstance) trgtF = ((L2PetInstance)target).getOwner(); if (trgtF != null && trgtF != player) { if (trgtF.getFactionId() == player.getFactionId() && player.getFactionId() > 0) cond = false; else if (trgtF.getFactionId() == 0 || player.getFactionId() == 0) cond = false; } if (!cond) return; }
and this in l2pcinstance:
if (skill.isPvpSkill()) // pvp skill { // CHECK IF OKAY if (!isInSiege() && !isInOlympiadMode()) { if (getFactionId() != target.getActingPlayer().getFactionId() && !isInsidePeaceZone(this, target)) return true; } // in clan war player can attack whites even with sleep etc. if (getClan() != null && ((L2PcInstance)target).getClan() != null) { if(getClan().isAtWarWith(((L2PcInstance)target).getClan().getClanId())) return true; } } else if ((skilldat != null && !skilldat.isCtrlPressed() && skill.isOffensive() && !srcIsSummon) || (skilldatpet != null && !skilldatpet.isCtrlPressed() && skill.isOffensive() && srcIsSummon)) { if (!isInSiege() && !isInOlympiadMode()) { if (getFactionId() != target.getActingPlayer().getFactionId() && !isInsidePeaceZone(this, target)) return true; } // in clan war player can attack whites even with sleep etc. if (getClan() != null && ((L2PcInstance)target).getClan() != null) { if (getClan().isAtWarWith(((L2PcInstance)target).getClan().getClanId())) return true; }
i tried adding "if (!isInSiege() && !isInOlympiadMode() && !isInFunEvent) { but it does not work.
Any idea or suggestion ? it will be appreciated
Edited by Kotegaeshi920 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.