Clan Flag.
Thanks gamelike85, gigilo1968.
This commit is contained in:
103
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Servitors/ClanFlag.java
vendored
Normal file
103
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Servitors/ClanFlag.java
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.others.Servitors;
|
||||
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.L2Clan;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class ClanFlag extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int CLAN_FLAG = 19269;
|
||||
// Skills
|
||||
private static final SkillHolder BUFF = new SkillHolder(15095, 1);
|
||||
private static final SkillHolder DEBUFF = new SkillHolder(15096, 1);
|
||||
|
||||
private ClanFlag()
|
||||
{
|
||||
addSpawnId(CLAN_FLAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("END_OF_LIFE", 1800000, npc, null);
|
||||
getTimers().addTimer("SKILL_CAST", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "SKILL_CAST":
|
||||
{
|
||||
if (npc.getSummoner() != null)
|
||||
{
|
||||
final L2Clan summonerClan = npc.getSummoner().getClan();
|
||||
if (summonerClan != null)
|
||||
{
|
||||
L2World.getInstance().forEachVisibleObjectInRange(npc, L2PcInstance.class, 2000, target ->
|
||||
{
|
||||
if ((target != null) && !target.isDead() && GeoEngine.getInstance().canSeeTarget(npc, target))
|
||||
{
|
||||
final L2Clan targetClan = target.getClan();
|
||||
if (targetClan != null)
|
||||
{
|
||||
if (targetClan == summonerClan)
|
||||
{
|
||||
BUFF.getSkill().applyEffects(npc, target);
|
||||
}
|
||||
else if (targetClan.isAtWarWith(summonerClan))
|
||||
{
|
||||
DEBUFF.getSkill().applyEffects(npc, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
getTimers().addTimer("SKILL_CAST", 3000, npc, null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
getTimers().addTimer("END_OF_LIFE", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
case "END_OF_LIFE":
|
||||
{
|
||||
getTimers().cancelTimer("SKILL_CAST", npc, null);
|
||||
npc.deleteMe();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new ClanFlag();
|
||||
}
|
||||
}
|
||||
@@ -2662,11 +2662,9 @@
|
||||
<height normal="31" grown="36" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="19269" level="90" type="L2Monster" name="Clan Flag">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<npc id="19269" level="90" type="L2EffectPoint" name="Clan Flag" usingServerSideName="true">
|
||||
<race>CONSTRUCT</race>
|
||||
<sex>ETC</sex>
|
||||
<mpReward value="20" type="PER" ticks="10" affects="PARTY" />
|
||||
<stats str="88" int="79" dex="55" wit="78" con="82" men="78">
|
||||
<vitals hp="1277698" hpRegen="8.5" mp="40" mpRegen="0.9" />
|
||||
<speed>
|
||||
@@ -2678,17 +2676,9 @@
|
||||
<attribute>
|
||||
<defence fire="100" water="100" wind="100" earth="100" holy="100" dark="100" />
|
||||
</attribute>
|
||||
<abnormalResist physical="0" magical="0" />
|
||||
</stats>
|
||||
<status attackable="false" undying="false" />
|
||||
<skill_list>
|
||||
<skill id="4416" level="2" /> <!-- Magic Creatures -->
|
||||
<skill id="4390" level="1" /> <!-- NPC Abnormal Immunity -->
|
||||
<skill id="4415" level="3" /> <!-- One-handed Sword -->
|
||||
<skill id="14765" level="2" /> <!-- Blood Siphon Resistance -->
|
||||
<skill id="4045" level="1" /> <!-- Resist Full Magic Attack -->
|
||||
</skill_list>
|
||||
<ai clanHelpRange="300" aggroRange="300" />
|
||||
<status targetable="false" canMove="false" undying="true" />
|
||||
<ai clanHelpRange="1000" aggroRange="300" />
|
||||
<collision>
|
||||
<radius normal="15" />
|
||||
<height normal="120" />
|
||||
|
||||
@@ -2985,7 +2985,6 @@
|
||||
<affectScope>SINGLE</affectScope>
|
||||
</skill>
|
||||
<skill id="15094" toLevel="1" name="Clan Flag">
|
||||
<!-- AUTO GENERATED SKILL -->
|
||||
<!-- Summons a Clan Flag that symbolizes your clan. Applies a buff on clan members and a de-buff on enemy clan members within a 2000 grid. It is despawned after 30 minutes but the effect lasts for 10 more minutes. Consumes 100 Clan Reputation. Can be used be Count or higher. Cooldown is 30 minute(s). -->
|
||||
<icon>icon.etc_alliance_flag_i00</icon>
|
||||
<operateType>A1</operateType>
|
||||
@@ -2999,28 +2998,36 @@
|
||||
<reuseDelay>1800000</reuseDelay>
|
||||
<targetType>SELF</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<clanRepConsume>100</clanRepConsume>
|
||||
<conditions>
|
||||
<condition name="OpCanNotUseAirship" />
|
||||
<condition name="OpSocialClass">
|
||||
<socialClass>8</socialClass>
|
||||
</condition>
|
||||
</conditions>
|
||||
<effects>
|
||||
<effect name="SummonNpc">
|
||||
<npcId>19269</npcId> <!-- Clan Flag -->
|
||||
</effect>
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="15095" toLevel="1" name="Clan Rising">
|
||||
<!-- Glory Days confirmed -->
|
||||
<!-- Through the clan flag, increases clan members' PvP damage by 5% and decreases received PvP damage by 5%. -->
|
||||
<icon>BranchSys2.icon.skill20006</icon>
|
||||
<operateType>A2</operateType>
|
||||
<hitTime>1500</hitTime>
|
||||
<operateType>A5</operateType> <!-- Hide system messages -->
|
||||
<blockedInOlympiad>false</blockedInOlympiad>
|
||||
<abnormalType>FLAG_BUF</abnormalType>
|
||||
<abnormalVisualEffect>REAL_TARGET</abnormalVisualEffect>
|
||||
<basicProperty>NONE</basicProperty>
|
||||
<rideState>NONE</rideState>
|
||||
<magicCriticalRate>-5</magicCriticalRate>
|
||||
<magicLvl>99</magicLvl>
|
||||
<hitCancelTime>0</hitCancelTime>
|
||||
<magicLvl>90</magicLvl>
|
||||
<abnormalLvl>1</abnormalLvl>
|
||||
<abnormalTime>40</abnormalTime>
|
||||
<abnormalTime>600</abnormalTime> <!-- It is despawned after 30 minutes but the effect lasts for 10 more minutes. -->
|
||||
<affectRange>2000</affectRange>
|
||||
<isMagic>1</isMagic>
|
||||
<isMagic>4</isMagic>
|
||||
<targetType>SELF</targetType>
|
||||
<affectScope>POINT_BLANK</affectScope>
|
||||
<affectObject>FRIEND_PC</affectObject>
|
||||
@@ -3048,10 +3055,9 @@
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="15096" toLevel="1" name="Clan Curse">
|
||||
<!-- AUTO GENERATED SKILL -->
|
||||
<!-- Domain where the clan flag's curse applies. -->
|
||||
<icon>icon.skill1167</icon>
|
||||
<operateType>A2</operateType>
|
||||
<operateType>A5</operateType> <!-- Hide system messages -->
|
||||
<abnormalType>FLAG_DEBUF</abnormalType>
|
||||
<basicProperty>NONE</basicProperty>
|
||||
<rideState>NONE</rideState>
|
||||
@@ -3062,13 +3068,12 @@
|
||||
<activateRate>100</activateRate>
|
||||
<magicLvl>99</magicLvl>
|
||||
<abnormalLvl>1</abnormalLvl>
|
||||
<abnormalTime>40</abnormalTime>
|
||||
<abnormalTime>5</abnormalTime>
|
||||
<trait>POISON</trait>
|
||||
<affectRange>2000</affectRange>
|
||||
<isDebuff>true</isDebuff>
|
||||
<targetType>SELF</targetType>
|
||||
<affectScope>POINT_BLANK</affectScope>
|
||||
<affectObject>NOT_FRIEND_PC</affectObject>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
</skill>
|
||||
<skill id="15097" toLevel="1" name="Raid Boss">
|
||||
<!-- Glory Days confirmed -->
|
||||
|
||||
Reference in New Issue
Block a user