Jump to content

Recommended Posts

Posted

Update Epilogue l2j

 

 

[table][tr][td]index: com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

===================================================================

--- com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

+++ com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

 

import com.l2jserver.gameserver.model.entity.L2Event;

import com.l2jserver.gameserver.model.entity.Siege;

import com.l2jserver.gameserver.model.entity.TvTEvent;

+import com.l2jserver.gameserver.model.entity.Biohazard;

import com.l2jserver.gameserver.model.itemcontainer.Inventory;

import com.l2jserver.gameserver.model.itemcontainer.ItemContainer;

import com.l2jserver.gameserver.model.itemcontainer.PcFreight;

 

    };

 

private static final int[] COMMON_CRAFT_LEVELS = { 5, 20, 28, 36, 43, 49, 55, 62 };

+ private static boolean _inBiohazard = false;

 

public class AIAccessor extends L2Character.AIAccessor

{

 

private int _obsZ;

private boolean _observerMode = false;

 

+ public boolean _isZombie = false;

+ public void setIsZombie(boolean a)

+ {

+ _isZombie = a;

+ }

+ public boolean isZombie()

+ {

+ return _isZombie;

+ }

+

/** Stored from last ValidatePosition **/

private Point3D _lastServerPosition = new Point3D(0, 0, 0);

 

        private boolean _isFakeDeath;

+ public int factionId = 0;

+ public int getFactionId()

+ {

+ return this.factionId;

+ }

+ public void setFactionId(int i)

+ {

+ factionId=i;

+ }

+ public int isInFaction = 0;

+ public int inWorld()

+ {

+ return isInFaction;

+ }

+

    public void untransform()

    {

+ if (inBiohazard() && Biohazard.isStarted() && _transformation != null && isZombie())

+ return;

        if (_transformation != null)

        {

        setTransformAllowedSkills(new int[]{});

 

// Kill the L2PcInstance

if (!super.doDie(killer))

return false;

+

+ if (killer instanceof L2PcInstance)

+ {

+ L2PcInstance pl = (L2PcInstance) killer;

+ if (inBiohazard() && !isZombie() && pl.inBiohazard() && pl.isZombie() && Biohazard.isStarted())

+ {

+ pl.abortAttack();

+ pl.abortCast();

+ doRevive();

+ Biohazard.infectPlayer(this);

+ stopAllEffects();

+             setCurrentHp(getMaxHp());

+             setCurrentMp(getMaxMp());

+             setCurrentCp(getMaxCp());

+ }

+ }

 

if (isMounted())

stopFeed();

 

{

reviveRequest(this, null, false);

}

+

+ if (isZombie() && inBiohazard())

+ {

+ if(Biohazard._infected.contains(this))

+ {

+ Biohazard._infected.remove(this);

+ untransform();

+ if (Biohazard._infected.size() == 0)

+ Biohazard.playersWin();

+ }

+ }

return true;

}

 

 

// Check if the attacker isn't the L2PcInstance Pet

if (attacker == this || attacker == getPet())

return false;

-

+

+ L2PcInstance player = null;

+ if (attacker instanceof L2PcInstance)

+ player = (L2PcInstance) attacker;

+ if (attacker instanceof L2SummonInstance)

+ player = ((L2SummonInstance) attacker).getOwner();

+

+ if (player != null)

+ if (Biohazard.isStarted() && player.inBiohazard() && inBiohazard() && player.isZombie() != isZombie())

+ return true;

// TODO: check for friendly mobs

// Check if the attacker is a L2MonsterInstance

if (attacker instanceof L2MonsterInstance)

 

        return false;

        }

 

+        if (skill.getId() == 619 && inBiohazard() && isZombie())

+ return false;

+

        //************************************* Check Skill Type *******************************************

-

        // Check if this is offensive magic skill

        if (skill.isOffensive())

{

- if ((isInsidePeaceZone(this, target)) && !getAccessLevel().allowPeaceAttack())

+         if ((isInsidePeaceZone(this, target)) && !getAccessLevel().allowPeaceAttack())

{

// If L2Character or target is in a peace zone, send a system message TARGET_IN_PEACEZONE a Server->Client packet ActionFailed

sendPacket(new SystemMessage(SystemMessageId.TARGET_IN_PEACEZONE));

sendPacket(ActionFailed.STATIC_PACKET);

+

+         boolean cond = true;

+ L2PcInstance trgtF = null;

+ if (target instanceof L2PcInstance)

+ trgtF = (L2PcInstance)target;

+ else if (target instanceof L2SummonInstance)

+ trgtF = ((L2SummonInstance)target).getOwner();

+ if (trgtF != null)

+ if (Biohazard.isStarted() && trgtF.inBiohazard() && inBiohazard())

+ {

+ if (trgtF.isZombie() != isZombie())

+ cond = true;

+ if (trgtF.isZombie() == isZombie())

+ cond = false;

+ }

+

+ if (!cond)

return false;

}

 

 

{

if(skill.isPvpSkill()) // pvp skill

{

+ if (Biohazard.isStarted() && inBiohazard() && ((L2PcInstance)target).inBiohazard() && isZombie() != ((L2PcInstance)target).isZombie())

+ return true;

if(getClan() != null && ((L2PcInstance)target).getClan() != null)

{

if(getClan().isAtWarWith(((L2PcInstance)target).getClan().getClanId()) && ((L2PcInstance)target).getClan().isAtWarWith(getClan().getClanId()))

 

return true;

}

 

+ private boolean inBiohazard() {

+

+ return _inBiohazard;

+ }

/**

* Return True if the L2PcInstance is a Mage.<BR><BR>

*/

 

{

_log.log(Level.SEVERE, "deleteMe()", e);

}

-

+

+ try

+ {

+ Biohazard.onLogout(this);

+ }

+ catch (Exception e)

+ {

+ _log.log(Level.SEVERE, "deleteMe()", e);

+ }

+

// Update database with items in its inventory and remove them from the world

try

{

 

private boolean _canFeed;

private int _afroId = 0;

private boolean _isInSiege;

+ public int _oldX;

+ public int _oldY;

+ public int _oldZ;

 

    public Collection<TimeStamp> getReuseTimeStamps()

    {

 

        break;

        }

    }

+ public void setIsInBiohazard(boolean b) {

+

+ _inBiohazard = b;

+ }

}

\ No newline at end of file

Index: com/l2jserver/gameserver/model/entity/Biohazard.java

===================================================================

--- com/l2jserver/gameserver/model/entity/Biohazard.java (revision 0)

+++ com/l2jserver/gameserver/model/entity/Biohazard.java (revision 0)

 

+/*

+ * 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 com.l2jserver.gameserver.model.entity;

+

+import java.util.Calendar;

+import java.util.logging.Logger;

+

+import javolution.util.FastSet;

+import com.l2jserver.gameserver.Announcements;

+import com.l2jserver.gameserver.instancemanager.TransformationManager;

+import com.l2jserver.gameserver.model.L2World;

+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

+import com.l2jserver.gameserver.model.olympiad.Olympiad;

+import com.l2jserver.gameserver.network.serverpackets.PlaySound;

+import com.l2jserver.gameserver.util.Broadcast;

+import com.l2jserver.util.Rnd;

+

+/**

+ * @author Laikeriz

+ */

+public class Biohazard

+{

+ enum EventState

+ {

+ INACTIVE,

+ INACTIVATING,

+ REGISTERING,

+ STARTED,

+ REWARDING

+ }

+

+    private final static Logger _log = Logger.getLogger(Biohazard.class.getName());

+ private static EventState _state = EventState.INACTIVE;

+

+ public static FastSet<L2PcInstance> _participants = new FastSet<L2PcInstance>();

+ public static FastSet<L2PcInstance> _infected = new FastSet<L2PcInstance>();

+ public static FastSet<L2PcInstance> _notInfected = new FastSet<L2PcInstance>();

+

+ public static boolean isStarted()

+ {

+ if (_state == EventState.STARTED)

+ return true;

+ return false;

+ }

+

+ public static boolean isRegistering()

+ {

+ if (_state == EventState.REGISTERING)

+ return true;

+ return false;

+ }

+

+ public static void startRegistering()

+ {

+ if (_state == EventState.REGISTERING || _state == EventState.STARTED)

+ return;

+ Announcements.getInstance().announceToAll("Biohazard: Registration is open.");

+ Announcements.getInstance().announceToAll("Biohazard: Type \".bhreg\" to register to event.");

+ Announcements.getInstance().announceToAll("Biohazard: Type \".bhunreg\" to unregister from event.");

+ _state = EventState.REGISTERING;

+ int step = 0;

+ int after = 0;

+ for (int i = 40; i > 0; i-=10)

+ {

+ switch(i)

+ {

+ case 40:

+ step = 5;

+ after = 15;

+ break;

+ case 30:

+ step = 5;

+ after = 10;

+ break;

+ case 20:

+ step = 4;

+ after = 5;

+ break;

+ case 10:

+ step = 1;

+ after = 1;

+ break;

+ }

+ if (_state == EventState.INACTIVE)

+ return;

+ Announcements.getInstance().announceToAll("Biohazard: Registration will be closed in " + after + " minute(s).");

+ try{Thread.sleep(step*60000);}catch (Exception e){}

+ }

+ //sound = "";

+ try{Thread.sleep(60000);}catch (Exception e){}

+ if (_state == EventState.INACTIVE)

+ return;

+ if (_participants.size() >= 2)

+ {

+ Announcements.getInstance().announceToAll("Biohazard: Teleporting players in 20 seconds.");

+ try{Thread.sleep(20000);}catch (Exception e){}

+ _state = EventState.STARTED;

+ startEventAndTelePl();

+ }

+ else

+ Announcements.getInstance().announceToAll("Biohazard: Event aborted due to lack of participants.");

+ }

+

+ public static void addParticipant(L2PcInstance player)

+ {

+ if (Olympiad.getInstance().isRegistered(player) || TvTEvent.isPlayerParticipant(player.getObjectId()))

+ {

+ player.sendMessage("You cannot register because of registration in another event");

+ return;

+ }

+ if (_state == EventState.REGISTERING && !_participants.contains(player))

+ {

+ _participants.add(player);

+ player.sendMessage("You have successfully registered to this event");

+ }

+ else

+ player.sendMessage("You are already registered or it's not registration time.");

+ }

+

+ public static void removeParticipant(L2PcInstance player)

+ {

+ if (_state == EventState.REGISTERING)

+ {

+ if (_participants.contains(player))

+ _participants.remove(player);

+ else

+ player.sendMessage("You aren't registered in this event.");

+ player.setIsInBiohazard(false);

+ }

+ else

+ player.sendMessage("It's not registration time.");

+ }

+ public static void startEventAndTelePl()

+ {

+ if (_state == EventState.INACTIVE)

+ return;

+ synchronized(_participants)

+ {

+ for (L2PcInstance pl : _participants)

+ if (pl.isOnline() == 1)

+ {

+ _notInfected.add(pl);

+ pl._oldX = pl.getX();

+ pl._oldY = pl.getY();

+ pl._oldZ = pl.getZ();

+ pl.teleToLocation(-17507,143206,-3911);

+ pl.setTeam(0);

+ pl.setIsInBiohazard(true);

+ pl.untransform();

+ }

+ }

+ Announcements.getInstance().announceToAll("Biohazard: Teleportion done.");

+ Announcements.getInstance().announceToAll("Biohazard: One player was infected by untreatable virus!");

+ Announcements.getInstance().announceToAll("Biohazard: In about one minute virus will take over his body and he will become zombie!");

+ try{Thread.sleep(60000);}catch (Exception e){}

+ int num = Math.round(Rnd.get(_notInfected.size()-1));

+ L2PcInstance infectFirst = ((L2PcInstance[])getAllNotInfected())[num];

+ infectPlayer(infectFirst);

+ Announcements.getInstance().announceToAll("Biohazard: Virus took over " + infectFirst.getName() + " body and he wants to infect everybody else!");

+ }

+

+ public static void infectPlayer(L2PcInstance zombie)

+ {

+ if (_state == EventState.INACTIVE)

+ return;

+ if (zombie.isTransformed())

+ zombie.untransform();

+ zombie.setIsZombie(true);

+ _notInfected.remove(zombie);

+ _infected.add(zombie);

+ TransformationManager.getInstance().transformPlayer(303, zombie);

+ if (_notInfected.size() == 0)

+ zombiesWin();

+ }

+

+ public static void onLogout(L2PcInstance playerInstance)

+ {

+ if (_state == EventState.REGISTERING)

+ removeParticipant(playerInstance);

+ else if (_state == EventState.STARTED)

+ {

+ playerInstance.setXYZ(playerInstance._oldX,playerInstance._oldY,playerInstance._oldZ);

+ if (!playerInstance.isZombie())

+ _notInfected.remove(playerInstance);

+ else if (playerInstance.isZombie())

+ _infected.remove(playerInstance);

+ if (_notInfected.size() == 0)

+ zombiesWin();

+ if (_infected.size() == 0)

+ playersWin();

+ }

+ }

+

+ public static void zombiesWin()

+ {

+ if (_state == EventState.INACTIVE)

+ return;

+ Announcements.getInstance().announceToAll("Biohazard: Zombies won.");

+ Announcements.getInstance().announceToAll("Biohazard: Rewarding and teleporting participants back to village in 20 seconds.");

+ _state = EventState.REWARDING;

+ try{Thread.sleep(20000);}catch (Exception e){}

+ synchronized(_infected)

+ {

+ for (L2PcInstance pl : _infected)

+ if (pl.isOnline() == 1)

+ pl.addItem("Biohazard", 6673, 1, pl, true);

+ }

+ synchronized(_participants)

+ {

+ for (L2PcInstance pl : _participants)

+ if (pl.isOnline() == 1)

+ {

+ pl.teleToLocation(pl._oldX,pl._oldY,pl._oldZ);

+ pl.setIsInBiohazard(false);

+// if (pl.inWorld() == 1)

+// pl.setTeam(pl.getFactionId());

+ if (pl.isTransformed())

+ pl.untransform();

+ }

+ }

+ _participants.clear();

+ _infected.clear();

+ _notInfected.clear();

+ _state = EventState.INACTIVE;

+ }

+

+ public static void playersWin()

+ {

+ Announcements.getInstance().announceToAll("Biohazard: Players won.");

+ Announcements.getInstance().announceToAll("Biohazard: Rewarding and teleporting participants back to village in 20 seconds.");

+ _state = EventState.REWARDING;

+ try{Thread.sleep(20000);}catch (Exception e){}

+ synchronized(_notInfected)

+ {

+ for (L2PcInstance pl : _notInfected)

+ if (pl.isOnline() == 1)

+ {

+ pl.addItem("Biohazard", 6673, 1, pl, true);

+ }

+ }

+ synchronized(_participants)

+ {

+ for (L2PcInstance pl : _participants)

+ if (pl.isOnline() == 1)

+ {

+ pl.teleToLocation(pl._oldX,pl._oldY,pl._oldZ);

+ pl.setIsInBiohazard(false);

+// if (pl.inWorld() == 1)

+// pl.setTeam(pl.getFactionId());

+ if (pl.isTransformed())

+ pl.untransform();

+ }

+ }

+ _participants.clear();

+ _infected.clear();

+ _notInfected.clear();

+ _state = EventState.INACTIVE;

+ }

+

+ public static L2PcInstance[] getAllNotInfected()

+ {

+ synchronized(_notInfected)

+ {

+ return _notInfected.toArray(new L2PcInstance[_notInfected.size()]);

+ }

+ }

+

+ public static void abortEvent()

+ {

+ _state = EventState.INACTIVE;

+ _participants.clear();

+ _notInfected.clear();

+ _infected.clear();

+ Announcements.getInstance().announceToAll("Biohazard: Event aborted.");

+ }

+}

\ No newline at end of file[/table]

Posted

MasterHeadler.java

 

      private static void loadVoicedHandlers()

{

+ VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new castle());

VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new stats());

 

castle.java

 

same :)

Posted

1. ERROR in D:\Matrix\compiled\gameserver\data\scripts\handlers\admincommandhand

lers\AdminEventEngine.java (at line 37)

        import net.sf.l2j.gameserver.model.entity.Biohazard;

              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The import net.sf.l2j.gameserver.model.entity.Biohazard cannot be resolved

----------

2. ERROR in D:\Matrix\compiled\gameserver\data\scripts\handlers\admincommandhand

lers\AdminEventEngine.java (at line 98)

        Biohazard.startRegistering();

        ^^^^^^^^^

Biohazard cannot be resolved

----------

3. ERROR in D:\Matrix\compiled\gameserver\data\scripts\handlers\admincommandhand

lers\AdminEventEngine.java (at line 102)

        Biohazard.abortEvent();

        ^^^^^^^^^

Biohazard cannot be resolved

Posted

it's cant working on interlude?

Probably will work, but you have to change imports from
import com.l2jserver.gameserver...

to net.sf.l2j.gameserver... and then check and fix if sth is still wrong.

Guest
This topic is now closed to further replies.



  • Posts

    • Hello, I'm completely sharing my first attempt of functional PvE & PvP level/gear based independed phantoms. This source is completely made by AI so no hard critisism please. The extension is in a very early stage and it's not tested properly so its NOT supposed to be used in a live server yet because it still needs stability/optimization improvements.   The architecture is already done, third class behaviors are looking good (but still needs adjustments mostly for melee classes). I am currently dealing with second occupation classes functionality (most of them are functional).   The extension will automatically create the lucera_autobots table on starting the gameserver and then you will be able to populate the table with many rows of bots manually or save them to DB through the ingame bot's panel, you can also create temporary bots by not hitting the "Save Bot" button. The clan can be added to the bots as clanID through lucera_autobots DB table, the clan has to be owned by a real player with or without alliance, the bot will be spawned with the clan or clan+ally crest.     Request for advices and ideas: At the moment i haven't figured out an easy way (other than building a full navigation system of the world) to make the bot understand the geodata, avoid all the city obstacles and walk to gatekeeper, then travel back to the farming location on foot and avoid any obstacles and town layout so at this current state the bots are doing this: on death > go to village > stay idle for 30 seconds (time delay can be configured from the bot's management panel or through the DB table) > directly teleport back to death location.   On in-game, use //autobots command and create bots normally through the panel's options. NOTE: The bots will not attack a gm character.               LATEST CHANGELOGS SINCE BUILD M28: M29: Improved the mechanics and behavior for all the second and third classes. Added/adjusted PvP skills and self-buffs for many classes. Improved Tyrant/Grand Khavatari combat and force-charge behavior. Added tank skill/auto-attack rotations. Added Bladedancer dances/debuff behavior. Added mage skills such as Silence, Curse Fear, Aura Flash, Ice Dagger and Frost Bolt with usage limits. Increased dagger Switch usage to 25%. Added obstacle escape movement when bots get stuck while RETURNING to their farm area. M30: Reduced the pause after tank and archer sidestep movements so they re-engage faster. Improved Titan/Destroyer combat recovery and added Braveheart condition. Started fixing Gladiator/Duelist charge/combat behavior. Verified all classes can use Idle, AttackFlagged, and AttackEveryone. Reinforced the rule that skills are used only when actually learned by the bot. M31: Fixed offensive mage combat-entry logic for AttackEveryone. Prevented hostile mage debuffs from being used as the initial action against peaceful players. M32: Added a farming-area watchdog so bots outside their configured farm range return instead of remaining stuck in FARMING. Fixed automatic teleport recovery so it cannot silently replace the bot's configured farm origin. M33: Removed the newer broken Gladiator/Duelist charge state-machine and restored more of the older M27-style combat logic. M34: Completely rewrote Gladiator/Duelist combat behavior Gladiator/Duelist now use the same core combat system in PvE and PvP. All skills remain level/learned-skill dependent. M43: Fixed a visual “jump/teleport” issue during PvP. Removed the extra manual position correction that was interfering with Lucera’s normal movement updates. Kept the old movement safety protections that prevent real long-distance rollback bugs. Added Vicious Stance toggle always ON for fighter classes when learned. Added Arcane Power toggle always ON for offensive mages level 78+ when learned. Improved potion usage so bots follow Lucera’s normal item cooldown behavior. Changed Warsmith weapons/shields for several level ranges. Added None as a buff package (the bot will spawn without buffs). Removed Greater CP Potions from level 1–39 bots. Reworked starter fighter equipment for levels 1–10 and 11–19. Corrected several starter class names in the autobots UI panel. Improved the Autobots panel layout. Improved spacing and descriptions on the Create Bot page. Added basic pagination to the autobots UI panel. Changed buttons toward Lucera’s native button style. Improved spacing around the bot list and search area. Added a search layout. Reworked the main page, Create Bot page, class selection and manage pages. No AI, combat, movement, inventory, or DB behavior was changed.   Next update milestone: Ensuring stability and optimization changes.  
    • ASocks.com provides residential, mobile and datacenter proxies with a pool of 7M+ IPs across 150+ locations. Built for web scraping, market research, ad verification, and automation, it offers flexible rotation, city- and ASN-level targeting, 24/7 support and transparent pricing with no traffic expiration.
    • SX.ORG is a global proxy platform offering residential, mobile,  and datacenter IPs for SEO, web scraping, ad verification and multi-account management. It provides flexible IP rotation, precise geo-targeting, HTTP(S)/SOCKS5 support, API access and pay-as-you-go pricing based only on the traffic you use.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..