Sea of ​​Spores Defender AI.

This commit is contained in:
MobiusDevelopment 2024-12-07 20:53:29 +02:00
parent 8c71d83be1
commit e5f5e7f594
7 changed files with 540 additions and 324 deletions

View File

@ -1,5 +1,3 @@
<html><body>Paterson's Disciple Bacon:<br>
This dangerous place... you treat it like your living room. You're my kind of crazy.<br>
<button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 902">"I want to use some Steel Door Guild Coins."</button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
This place is so dangerous and yet you walk around like it's a playground... You must truly be a great adventurer.
</body></html>

View File

@ -0,0 +1,104 @@
/*
* Copyright (c) 2013 L2jMobius
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package ai.areas.SeaOfSpores;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* @author Notorion
*/
public class SeaOfSporesDefender extends AbstractNpcAI
{
// NPCs
private static final int FUNGUS_DEFENDER = 24649;
private static final int FUNGUS = 24650;
// Misc
private static final Map<Npc, Long> TALK_COOLDOWN = new ConcurrentHashMap<>();
private static final long COOLDOWN_TIME = 60000; // 1 minute
private SeaOfSporesDefender()
{
addSpawnId(FUNGUS_DEFENDER);
addAttackId(FUNGUS_DEFENDER, FUNGUS);
}
@Override
public String onSpawn(Npc npc)
{
if (npc.getId() == FUNGUS_DEFENDER)
{
npc.setInvul(true);
final int count = getRandom(3, 6);
final int radius = 63;
for (int i = 0; i < count; i++)
{
final double angle = Math.toRadians((360.0 / count) * i);
final int x = npc.getX() + (int) (radius * Math.cos(angle));
final int y = npc.getY() + (int) (radius * Math.sin(angle));
addSpawn(FUNGUS, x, y, npc.getZ(), 0, false, 0);
}
for (Npc minion : World.getInstance().getVisibleObjectsInRange(npc, Npc.class, 100))
{
if (minion.getId() == FUNGUS)
{
minion.setInvul(true);
}
}
}
return super.onSpawn(npc);
}
@Override
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
{
if ((npc.getId() == FUNGUS_DEFENDER) || (npc.getId() == FUNGUS))
{
npc.setCurrentHp(npc.getMaxHp());
if ((npc.getId() == FUNGUS_DEFENDER) && npc.isInCombat())
{
final long currentTime = System.currentTimeMillis();
final long lastTalkTime = TALK_COOLDOWN.getOrDefault(npc, 0L);
if ((currentTime - lastTalkTime) >= COOLDOWN_TIME)
{
TALK_COOLDOWN.put(npc, currentTime);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_WON_T_KILL_ME_THESE_SPORES_MAKE_ME_IMMORTAL);
}
}
}
return super.onAttack(npc, attacker, damage, isSummon);
}
public static void main(String[] args)
{
new SeaOfSporesDefender();
}
}

View File

@ -8,6 +8,7 @@
<npc id="33960" x="57450" y="31235" z="-3736" heading="51260" respawnTime="60sec" /> <!-- Barrier Enforcer -->
<npc id="33960" x="63633" y="20925" z="-3736" heading="33512" respawnTime="60sec" /> <!-- Barrier Enforcer -->
<npc id="34508" x="65480" y="26024" z="-3747" heading="32770" respawnTime="60sec" /> <!-- Battlefield Guide - Cursed Sword -->
<npc id="33846" x="41372" y="21926" z="-3877" heading="18357" respawnTime="60sec" /> <!-- Bacon - Paterson's Disciple -->
</group>
</spawn>
</list>

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/spawns.xsd">
<spawn name="21_18">
<group>
<npc id="24649" x="58309" y="28359" z="-4241" heading="31649" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="58593" y="29805" z="-3826" heading="19152" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="60511" y="30055" z="-3761" heading="50992" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="58555" y="27058" z="-4668" heading="16446" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="57567" y="25930" z="-5026" heading="41023" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="57257" y="29365" z="-4177" heading="29615" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="56006" y="27583" z="-5092" heading="42019" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="54410" y="28596" z="-5099" heading="30903" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="53543" y="27749" z="-5197" heading="42275" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="53646" y="26390" z="-5044" heading="33897" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="60885" y="27473" z="-3821" heading="54728" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="61154" y="26369" z="-3863" heading="62405" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="63136" y="24423" z="-3785" heading="50887" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="59145" y="24706" z="-4481" heading="32478" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="60741" y="24115" z="-4087" heading="49370" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="59181" y="25792" z="-4529" heading="31828" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="56414" y="24792" z="-5279" heading="41246" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="56214" y="25906" z="-5157" heading="32215" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="56303" y="23602" z="-5106" heading="44219" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="54974" y="25064" z="-5308" heading="52453" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="53565" y="23727" z="-5385" heading="33818" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="53624" y="22575" z="-5308" heading="45077" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="51365" y="22582" z="-5467" heading="45379" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="50515" y="24349" z="-5041" heading="28111" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="48659" y="23030" z="-5252" heading="28132" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="47077" y="22277" z="-5145" heading="38849" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="46056" y="23225" z="-5200" heading="26595" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="43789" y="22872" z="-4964" heading="25928" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="62338" y="21679" z="-3824" heading="51160" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="58924" y="19080" z="-4695" heading="29572" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="62341" y="16660" z="-3855" heading="54813" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="60425" y="16936" z="-4308" heading="56089" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="58912" y="16297" z="-4584" heading="32872" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="58176" y="15138" z="-4530" heading="27353" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="60468" y="14280" z="-4222" heading="62874" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="61721" y="14657" z="-3968" heading="35413" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="61313" y="12491" z="-4074" heading="57014" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="61991" y="11183" z="-3910" heading="49915" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="63036" y="10099" z="-3710" heading="41626" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="61332" y="10145" z="-3978" heading="5808" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="61453" y="8369" z="-3889" heading="52075" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="59357" y="9310" z="-4291" heading="38813" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="58910" y="7873" z="-4259" heading="27554" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="58069" y="6931" z="-4308" heading="25792" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="57654" y="5633" z="-4256" heading="18806" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="56037" y="6976" z="-4388" heading="20387" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="55480" y="5594" z="-4364" heading="42714" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="54445" y="7831" z="-4415" heading="21700" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="53952" y="9161" z="-4452" heading="64967" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="52151" y="9103" z="-4388" heading="27452" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="54530" y="12925" z="-5676" heading="2425" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="56775" y="11028" z="-4825" heading="56752" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="53070" y="14700" z="-5706" heading="28473" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="53585" y="15689" z="-5376" heading="27960" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="51874" y="16234" z="-5296" heading="289" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="50404" y="15017" z="-5348" heading="38303" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="49097" y="15994" z="-4948" heading="23223" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="50833" y="18395" z="-5192" heading="5069" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="50740" y="17384" z="-5437" heading="558" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="49418" y="18444" z="-5091" heading="25937" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="51415" y="19751" z="-5337" heading="50988" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="49201" y="20284" z="-5398" heading="28664" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="50421" y="20834" z="-5391" heading="9198" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="52620" y="21138" z="-5500" heading="56978" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="49241" y="21867" z="-5454" heading="56069" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="49777" y="23728" z="-5203" heading="17469" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="52333" y="21827" z="-5392" heading="38521" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="51121" y="21514" z="-5323" heading="11626" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="53746" y="20859" z="-5571" heading="4191" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="54979" y="20479" z="-5502" heading="59288" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="54710" y="22399" z="-5440" heading="11661" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="56817" y="20823" z="-5403" heading="5239" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="52600" y="24382" z="-5310" heading="51856" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="48454" y="24713" z="-4801" heading="25944" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="46721" y="20107" z="-5075" heading="48530" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="46336" y="24486" z="-5080" heading="19009" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
<npc id="24649" x="43986" y="25330" z="-4833" heading="14641" respawnTime="60sec" /> <!-- Carnivorous Fungus - Sea of Spores Defender -->
</group>
</spawn>
</list>

View File

@ -3307,6 +3307,11 @@
</dropLists>
</npc>
<npc id="24649" level="116" type="Monster" name="Carnivorous Fungus" title="Sea of Spores Defender">
<parameters>
<param name="MoveAroundSocial" value="0" />
<param name="MoveAroundSocial1" value="0" />
<skill name="Skill01_ID" id="34268" level="1" />
</parameters>
<race>PLANT</race>
<sex>FEMALE</sex>
<stats str="88" int="79" dex="55" wit="78" con="82" men="78">
@ -3314,14 +3319,15 @@
<attack physical="733514.268097518" magical="1543.76790583647" random="30" critical="4.75" accuracy="4.75" attackSpeed="250" type="SWORD" range="40" distance="80" width="120" />
<defence physical="60000" magical="200000" />
<attribute>
<attack type="EARTH" value="2500" />
<defence fire="2500" water="2500" wind="2500" earth="2500" holy="2500" dark="2500" />
<attack type="EARTH" value="1450" />
<defence fire="1600" water="1600" wind="1550" earth="1600" holy="1600" dark="1600" />
</attribute>
<speed>
<walk ground="70" />
<run ground="110" />
</speed>
</stats>
<status attackable="false" undying="true" canMove="false" targetable="false" />
<skillList>
<skill id="4416" level="5" /> <!-- Plants -->
<skill id="5465" level="1" /> <!-- Earth Attack -->
@ -3331,9 +3337,9 @@
<skill id="14818" level="1" /> <!-- Instant Kill Resistance -->
<skill id="16547" level="10" /> <!-- Danger Zone Resistance -->
<skill id="5599" level="12" /> <!-- Confusion Resistance -->
<skill id="34268" level="1" /> <!-- Walking Fungus' Energy Spike -->
</skillList>
<status attackable="true" />
<ai type="FIGHTER" clanHelpRange="450" aggroRange="450" isAggressive="true">
<ai type="MAGE" clanHelpRange="500" aggroRange="500" isAggressive="true">
<clanList>
<clan>SOS</clan>
</clanList>
@ -3344,15 +3350,19 @@
</collision>
</npc>
<npc id="24650" level="116" type="Monster" name="Walking Fungus">
<parameters>
<param name="MoveAroundSocial" value="0" />
<param name="MoveAroundSocial1" value="0" />
</parameters>
<race>PLANT</race>
<sex>FEMALE</sex>
<stats str="88" int="79" dex="55" wit="78" con="82" men="78">
<vitals hp="1278871" hpRegen="100.5" mp="2862" mpRegen="30.6" />
<attack physical="733514.268097518" magical="1543.76790583647" random="30" critical="4.75" accuracy="4.75" attackSpeed="250" type="SWORD" range="40" distance="80" width="120" />
<attack physical="733514.268097518" magical="1543.76790583647" random="30" critical="4.75" accuracy="4.75" attackSpeed="250" type="SWORD" range="50" distance="50" width="120" />
<defence physical="60000" magical="200000" />
<attribute>
<attack type="EARTH" value="2500" />
<defence fire="2500" water="2500" wind="2500" earth="2500" holy="2500" dark="2500" />
<attack type="EARTH" value="1450" />
<defence fire="1600" water="1600" wind="1550" earth="1600" holy="1600" dark="1600" />
</attribute>
<speed>
<walk ground="70" />
@ -3369,8 +3379,8 @@
<skill id="16547" level="10" /> <!-- Danger Zone Resistance -->
<skill id="5599" level="12" /> <!-- Confusion Resistance -->
</skillList>
<status attackable="true" />
<ai type="FIGHTER" clanHelpRange="450" aggroRange="450" isAggressive="true">
<status attackable="false" undying="true" canMove="false" targetable="false" />
<ai type="FIGHTER" clanHelpRange="150" aggroRange="100" isAggressive="true">
<clanList>
<clan>SOS</clan>
</clanList>

View File

@ -1041,7 +1041,26 @@
<skill id="34268" toLevel="1" name="Walking Fungus' Energy Spike">
<!-- A basic magic skill. -->
<icon>icon.skill0000</icon>
<castRange>400</castRange>
<coolTime>420</coolTime>
<effectPoint>-337</effectPoint>
<effectRange>400</effectRange>
<hitTime>780</hitTime>
<magicLevel>76</magicLevel>
<nextAction>CAST</nextAction>
<operateType>A1</operateType>
<reuseDelay>1000</reuseDelay>
<magicCriticalRate>5</magicCriticalRate>
<targetType>ENEMY</targetType>
<affectScope>SINGLE</affectScope>
<effects>
<effect name="PhysicalAttack">
<power>20000</power>
<ignoreShieldDefence>true</ignoreShieldDefence>
<criticalChance>30</criticalChance>
<overHit>true</overHit>
</effect>
</effects>
</skill>
<skill id="34269" toLevel="1" name="Unable to Target">
<!-- You cannot choose a target. -->