Grind Team

Смотрим чудо спавн:
<spawn count="2" respawn="100" respawn_random="20" period_of_day="none">
<territory>
<add x="113175" y="-72539" zmin="-685" zmax="-335"/>
<add x="114837" y="-72535" zmin="-685" zmax="-335"/>
<add x="114838" y="-71579" zmin="-685" zmax="-335"/>
<add x="113172" y="-71579" zmin="-685" zmax="-335"/>
</territory>
<!--<banned_territory>
<add x="113175" y="-72539" zmin="-685" zmax="-335"/>
<add x="114837" y="-72535" zmin="-685" zmax="-335"/>
<add x="114838" y="-71579" zmin="-685" zmax="-335"/>
<add x="113172" y="-71579" zmin="-685" zmax="-335"/>
</banned_territory>-->
<npc id="22798"/><!--Divinity Protector-->
</spawn>
Вот это да, какая реализация и не сделаны banned территории, но всё согласно же официальному контенту. Но это осталось с оверов, а мозгов реализовать не хватило притом, что оверы парсили с офф скриптов, но как говорит гринд это придумали масоны. Про миньенов и точечный спавн молчу это нужно переписывать и да супер менеджер работающий с бд конечно же:
package core.gameserver.instancemanager;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

import core.commons.dbutils.DbUtils;
import core.commons.threading.RunnableImpl;
import core.commons.util.Rnd;
import core.gameserver.Announcements;
import core.gameserver.Config;
import core.gameserver.ThreadPoolManager;
import core.gameserver.data.xml.holder.NpcHolder;
import core.gameserver.data.xml.holder.ResidenceHolder;
import core.gameserver.database.DatabaseFactory;
import core.gameserver.idfactory.IdFactory;
import core.gameserver.model.base.Race;
import core.gameserver.model.Creature;
import core.gameserver.model.Player;
import core.gameserver.model.SimpleSpawner;
import core.gameserver.model.Spawner;
import core.gameserver.model.entity.residence.Castle;
import core.gameserver.model.instances.NpcInstance;
import core.gameserver.templates.mapregion.RestartArea;
import core.gameserver.templates.mapregion.RestartPoint;
import core.gameserver.templates.npc.NpcTemplate;
import core.gameserver.utils.HtmlUtils;
import core.gameserver.utils.Location;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AutoSpawnManager
{
private static final Logger _log = LoggerFactory.getLogger(AutoSpawnManager.class);
private static AutoSpawnManager _instance;

private static final int DEFAULT_INITIAL_SPAWN = 30000; // 30 seconds after registration
private static final int DEFAULT_RESPAWN = 3600000; //1 hour in millisecs
private static final int DEFAULT_DESPAWN = 3600000; //1 hour in millisecs

protected Map<Integer, AutoSpawnInstance> _registeredSpawns;
protected Map<Integer, ScheduledFuture<?>> _runningSpawns;

public AutoSpawnManager()
{
_registeredSpawns = new ConcurrentHashMap<Integer, AutoSpawnInstance>();
_runningSpawns = new ConcurrentHashMap<Integer, ScheduledFuture<?>>();

restoreSpawnData();

_log.info("AutoSpawnHandler: Loaded " + size() + " handlers in total.");
}

public static AutoSpawnManager getInstance()
{
if(_instance == null)
_instance = new AutoSpawnManager();

return _instance;
}

public final int size()
{
return _registeredSpawns.size();
}

private void restoreSpawnData()
{
int numLoaded = 0;
Connection con = null;
PreparedStatement statement = null;
PreparedStatement statement2 = null;
ResultSet rset = null, rset2 = null;

try
{
con = DatabaseFactory.getInstance().getConnection();

// Restore spawn group data, then the location data.
statement = con.prepareStatement("SELECT * FROM random_spawn ORDER BY groupId ASC");
statement2 = con.prepareStatement("SELECT * FROM random_spawn_loc WHERE groupId=?");

rset = statement.executeQuery();
while(rset.next())
{
// Register random spawn group, set various options on the created spawn instance.
AutoSpawnInstance spawnInst = registerSpawn(rset.getInt("npcId"), rset.getInt("initialDelay"), rset.getInt("respawnDelay"), rset.getInt("despawnDelay"));
spawnInst.setSpawnCount(rset.getInt("count"));
spawnInst.setBroadcast(rset.getBoolean("broadcastSpawn"));
spawnInst.setRandomSpawn(rset.getBoolean("randomSpawn"));
numLoaded++;

// Restore the spawn locations for this spawn group/instance.

statement2.setInt(1, rset.getInt("groupId"));
rset2 = statement2.executeQuery();
while(rset2.next())
// Add each location to the spawn group/instance.
spawnInst.addSpawnLocation(rset2.getInt("x"), rset2.getInt("y"), rset2.getInt("z"), rset2.getInt("heading"));
DbUtils.close(rset2);
}
}
catch(Exception e)
{
_log.warn("AutoSpawnHandler: Could not restore spawn data: " + e);
}
finally
{
DbUtils.closeQuietly(statement2, rset2);
DbUtils.closeQuietly(con, statement, rset);
}
}

/**
* Registers a spawn with the given parameters with the spawner, and marks it as
* active. Returns a AutoSpawnInstance containing info about the spawn.
*
* @param int npcId
* @param int[][] spawnPoints
* @param int initialDelay (If < 0 = default value)
* @param int respawnDelay (If < 0 = default value)
* @param int despawnDelay (If < 0 = default value or if = 0, function disabled)
* Return AutoSpawnInstance spawnInst
*/
public AutoSpawnInstance registerSpawn(int npcId, int[][] spawnPoints, int initialDelay, int respawnDelay, int despawnDelay)
{
if(initialDelay < 0)
initialDelay = DEFAULT_INITIAL_SPAWN;

if(respawnDelay < 0)
respawnDelay = DEFAULT_RESPAWN;

if(despawnDelay < 0)
despawnDelay = DEFAULT_DESPAWN;

AutoSpawnInstance newSpawn = new AutoSpawnInstance(npcId, initialDelay, respawnDelay, despawnDelay);

if(spawnPoints != null)
for(int[] spawnPoint : spawnPoints)
newSpawn.addSpawnLocation(spawnPoint);

int newId = IdFactory.getInstance().getNextId();
newSpawn._objectId = newId;
_registeredSpawns.put(newId, newSpawn);

setSpawnActive(newSpawn, true);

return newSpawn;
}

/**
* Registers a spawn with the given parameters with the spawner, and marks it as
* active. Returns a AutoSpawnInstance containing info about the spawn.
* <BR>
* <B>Warning:</B> Spawn locations must be specified separately using addSpawnLocation().
*
* @param int npcId
* @param int initialDelay (If < 0 = default value)
* @param int respawnDelay (If < 0 = default value)
* @param int despawnDelay (If < 0 = default value or if = 0, function disabled)
* Return AutoSpawnInstance spawnInst
*/
public AutoSpawnInstance registerSpawn(int npcId, int initialDelay, int respawnDelay, int despawnDelay)
{
return registerSpawn(npcId, null, initialDelay, respawnDelay, despawnDelay);
}

/**
* Remove a registered spawn from the list, specified by the given spawn instance.
*
* @param AutoSpawnInstance spawnInst
* Return boolean removedSuccessfully
*/
public boolean removeSpawn(AutoSpawnInstance spawnInst)
{
if(!isSpawnRegistered(spawnInst))
return false;

try
{
// Try to remove from the list of registered spawns if it exists.
_registeredSpawns.remove(spawnInst.getNpcId());

// Cancel the currently associated running scheduled task.
ScheduledFuture<?> respawnTask = _runningSpawns.remove(spawnInst._objectId);
respawnTask.cancel(false);
}
catch(Exception e)
{
_log.warn("AutoSpawnHandler: Could not auto spawn for NPC ID " + spawnInst._npcId + " (Object ID = " + spawnInst._objectId + "): " + e);
return false;
}

return true;
}

/**
* Remove a registered spawn from the list, specified by the given spawn object ID.
*
* @param int objectId
* Return boolean removedSuccessfully
*/
public void removeSpawn(int objectId)
{
removeSpawn(_registeredSpawns.get(objectId));
}

/**
* Sets the active state of the specified spawn.
*
* @param AutoSpawnInstance spawnInst
* @param boolean isActive
*/
public void setSpawnActive(AutoSpawnInstance spawnInst, boolean isActive)
{
int objectId = spawnInst._objectId;

if(isSpawnRegistered(objectId))
{
ScheduledFuture<?> spawnTask = null;

if(isActive)
{
AutoSpawner rset = new AutoSpawner(objectId);
if(spawnInst._desDelay > 0)
spawnTask = ThreadPoolManager.getInstance().scheduleAtFixedRate(rset, spawnInst._initDelay, spawnInst._resDelay);
else
spawnTask = ThreadPoolManager.getInstance().schedule(rset, spawnInst._initDelay);
//spawnTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(rset, spawnInst._initDelay, spawnInst._resDelay);
_runningSpawns.put(objectId, spawnTask);
}
else
{
spawnTask = _runningSpawns.remove(objectId);

if(spawnTask != null)
spawnTask.cancel(false);
}

spawnInst.setSpawnActive(isActive);
}
}

/**
* Returns the number of milliseconds until the next occurrance of
* the given spawn.
*
* @param AutoSpawnInstance spawnInst
* @param long milliRemaining
*/
public final long getTimeToNextSpawn(AutoSpawnInstance spawnInst)
{
int objectId = spawnInst._objectId;

if(!isSpawnRegistered(objectId))
return -1;

return _runningSpawns.get(objectId).getDelay(TimeUnit.MILLISECONDS);
}

/**
* Attempts to return the AutoSpawnInstance associated with the given NPC or Object ID type.
* <BR>
* Note: If isObjectId == false, returns first instance for the specified NPC ID.
*
* @param int id
* @param boolean isObjectId
* Return AutoSpawnInstance spawnInst
*/
public final AutoSpawnInstance getAutoSpawnInstance(int id, boolean isObjectId)
{
if(isObjectId)
{
if(isSpawnRegistered(id))
return _registeredSpawns.get(id);
}
else
for(AutoSpawnInstance spawnInst : _registeredSpawns.values())
if(spawnInst._npcId == id)
return spawnInst;

return null;
}

public Map<Integer, AutoSpawnInstance> getAllAutoSpawnInstance(int id)
{
Map<Integer, AutoSpawnInstance> spawnInstList = new ConcurrentHashMap<Integer, AutoSpawnInstance>();

for(AutoSpawnInstance spawnInst : _registeredSpawns.values())
if(spawnInst._npcId == id)
spawnInstList.put(spawnInst._objectId, spawnInst);

return spawnInstList;
}

/**
* Tests if the specified object ID is assigned to an auto spawn.
*
* @param int objectId
* Return boolean isAssigned
*/
public final boolean isSpawnRegistered(int objectId)
{
return _registeredSpawns.containsKey(objectId);
}

/**
* Tests if the specified spawn instance is assigned to an auto spawn.
*
* @param AutoSpawnInstance spawnInst
* Return boolean isAssigned
*/
public final boolean isSpawnRegistered(AutoSpawnInstance spawnInst)
{
return _registeredSpawns.containsValue(spawnInst);
}

/**
* AutoSpawner Class
* <BR><BR>
* This handles the main spawn task for an auto spawn instance, and initializes
* a despawner if required.
*
* @author Tempy
*/
private class AutoSpawner extends RunnableImpl
{
private int _objectId;

AutoSpawner(int objectId)
{
_objectId = objectId;
}

@Override
public void runImpl() throws Exception
{
try
{
// Retrieve the required spawn instance for this spawn task.
AutoSpawnInstance spawnInst = _registeredSpawns.get(_objectId);

// If the spawn is not scheduled to be active, cancel the spawn task.
if(!spawnInst.isSpawnActive() || Config.DONTLOADSPAWN)
return;

Location[] locationList = spawnInst.getLocationList();

// If there are no set co-ordinates, cancel the spawn task.
if(locationList.length == 0)
{
_log.info("AutoSpawnHandler: No location co-ords specified for spawn instance (Object ID = " + _objectId + ").");
return;
}

int locationCount = locationList.length;
int locationIndex = Rnd.get(locationCount);

/*
* If random spawning is disabled, the spawn at the next set of
* co-ordinates after the last. If the index is greater than the number
* of possible spawns, reset the counter to zero.
*/
if(!spawnInst.isRandomSpawn())
{
locationIndex = spawnInst._lastLocIndex;
locationIndex++;

if(locationIndex == locationCount)
locationIndex = 0;

spawnInst._lastLocIndex = locationIndex;
}

// Set the X, Y and Z co-ordinates, where this spawn will take place.
final int x = locationList[locationIndex].x;
final int y = locationList[locationIndex].y;
final int z = locationList[locationIndex].z;
final int heading = locationList[locationIndex].h;

// Fetch the template for this NPC ID and create a new spawn.
NpcTemplate npcTemp = NpcHolder.getInstance().getTemplate(spawnInst.getNpcId());
SimpleSpawner newSpawn = new SimpleSpawner(npcTemp);

newSpawn.setLocx(x);
newSpawn.setLocy;
newSpawn.setLocz(z);
if(heading != -1)
newSpawn.setHeading(heading);
newSpawn.setAmount(spawnInst.getSpawnCount());
if(spawnInst._desDelay == 0)
newSpawn.setRespawnDelay(spawnInst._resDelay);

// Add the new spawn information to the spawn table, but do not store it.
NpcInstance npcInst = null;

for(int i = 0; i < spawnInst._spawnCount; i++)
{
npcInst = newSpawn.doSpawn(true);

// To prevent spawning of more than one NPC in the exact same spot,
// move it slightly by a small random offset.
npcInst.setXYZ(npcInst.getX() + Rnd.get(50), npcInst.getY() + Rnd.get(50), npcInst.getZ());

// Add the NPC instance to the list of managed instances.
spawnInst.addAttackable(npcInst);
}

RestartArea ra = MapRegionManager.getInstance().getRegionData(RestartArea.class, npcInst.getLoc());
String nearestTown = "";
if(ra != null)
{
RestartPoint rp = ra.getRestartPoint().get(Race.human);
nearestTown = rp.getNameLoc();
}

// Announce to all players that the spawn has taken place, with the nearest town location.
if(spawnInst.isBroadcasting() && npcInst != null)
Announcements.getInstance().announceByCustomMessage("core.gameserver.model.AutoSpawnHandler.spawnNPC", new String[] {
npcInst.getName(),
nearestTown });

// If there is no despawn time, do not create a despawn task.
if(spawnInst.getDespawnDelay() > 0)
{
AutoDespawner rd = new AutoDespawner(_objectId);
ThreadPoolManager.getInstance().schedule(rd, spawnInst.getDespawnDelay() - 1000);
}
}
catch(Exception e)
{
_log.warn("AutoSpawnHandler: An error occurred while initializing spawn instance (Object ID = " + _objectId + "): " + e);
_log.error("", e);
}
}
}

/**
* AutoDespawner Class
* <BR><BR>
* Simply used as a secondary class for despawning an auto spawn instance.
*
* @author Tempy
*/
private class AutoDespawner extends RunnableImpl
{
private int _objectId;

AutoDespawner(int objectId)
{
_objectId = objectId;
}

@Override
public void runImpl() throws Exception
{
try
{
AutoSpawnInstance spawnInst = _registeredSpawns.get(_objectId);

for(NpcInstance npcInst : spawnInst.getAttackableList())
{
npcInst.deleteMe();
spawnInst.removeAttackable(npcInst);
}
}
catch(Exception e)
{
_log.warn("AutoSpawnHandler: An error occurred while despawning spawn (Object ID = " + _objectId + "): " + e);
}
}
}

/**
* AutoSpawnInstance Class
* <BR><BR>
* Stores information about a registered auto spawn.
*
* @author Tempy
*/
public class AutoSpawnInstance
{
protected int _objectId;
protected int _spawnIndex;

protected int _npcId;
protected int _initDelay;
protected int _resDelay;
protected int _desDelay;
protected int _spawnCount = 1;
protected int _lastLocIndex = -1;

private List<NpcInstance> _npcList = new ArrayList<NpcInstance>();
private List<Location> _locList = new ArrayList<Location>();

private boolean _spawnActive;
private boolean _randomSpawn = false;
private boolean _broadcastAnnouncement = false;

protected AutoSpawnInstance(int npcId, int initDelay, int respawnDelay, int despawnDelay)
{
_npcId = npcId;
_initDelay = initDelay;
_resDelay = respawnDelay;
_desDelay = despawnDelay;
}

void setSpawnActive(boolean activeValue)
{
_spawnActive = activeValue;
}

boolean addAttackable(NpcInstance npcInst)
{
return _npcList.add(npcInst);
}

boolean removeAttackable(NpcInstance npcInst)
{
return _npcList.remove(npcInst);
}

public int getObjectId()
{
return _objectId;
}

public int getInitialDelay()
{
return _initDelay;
}

public int getRespawnDelay()
{
return _resDelay;
}

public int getDespawnDelay()
{
return _desDelay;
}

public int getNpcId()
{
return _npcId;
}

public int getSpawnCount()
{
return _spawnCount;
}

public Location[] getLocationList()
{
return _locList.toArray(new Location[_locList.size()]);
}

public NpcInstance[] getAttackableList()
{
return _npcList.toArray(new NpcInstance[_npcList.size()]);
}

public Spawner[] getSpawns()
{
List<Spawner> npcSpawns = new ArrayList<Spawner>();

for(NpcInstance npcInst : _npcList)
npcSpawns.add(npcInst.getSpawn());

return npcSpawns.toArray(new Spawner[npcSpawns.size()]);
}

public void setSpawnCount(int spawnCount)
{
_spawnCount = spawnCount;
}

public void setRandomSpawn(boolean randValue)
{
_randomSpawn = randValue;
}

public void setBroadcast(boolean broadcastValue)
{
_broadcastAnnouncement = broadcastValue;
}

public boolean isSpawnActive()
{
return _spawnActive;
}

public boolean isRandomSpawn()
{
return _randomSpawn;
}

public boolean isBroadcasting()
{
return _broadcastAnnouncement;
}

public boolean addSpawnLocation(int x, int y, int z, int heading)
{
return _locList.add(new Location(x, y, z, heading));
}

public boolean addSpawnLocation(int[] spawnLoc)
{
if(spawnLoc.length != 3)
return false;

return addSpawnLocation(spawnLoc[0], spawnLoc[1], spawnLoc[2], -1);
}

public Location removeSpawnLocation(int locIndex)
{
try
{
return _locList.remove(locIndex);
}
catch(IndexOutOfBoundsException e)
{
return null;
}
}
}
}
DROP TABLE IF EXISTS random_spawn;
CREATE TABLE random_spawn (
groupId INT NOT NULL default 0,
npcId INT NOT NULL default 0,
count INT NOT NULL default 0,
initialDelay BIGINT NOT NULL default -1,
respawnDelay BIGINT NOT NULL default -1,
despawnDelay BIGINT NOT NULL default -1,
broadcastSpawn enum('false','true') NOT NULL default 'false',
randomSpawn enum('false','true') NOT NULL default 'true',
PRIMARY KEY (groupId)
) ENGINE=MyISAM;

INSERT INTO `random_spawn` VALUES
(2,31111,1,-1,60,0,'false','false'),
(3,31112,1,-1,60,0,'false','false'),
(4,31113,1,-1,-1,-1,'true','true'),
(5,31126,1,-1,-1,-1,'true','true'),
(6,31094,1,-1,300000,300000,'false','true'),
(7,31094,1,-1,300000,300000,'false','true'),
(8,31094,1,-1,300000,300000,'false','true'),
(9,31094,1,-1,300000,300000,'false','true'),
(10,31094,1,-1,300000,300000,'false','true'),
(11,31094,1,-1,300000,300000,'false','true'),
(12,31094,1,-1,300000,300000,'false','true'),
(13,31094,1,-1,300000,300000,'false','true'),
(14,31093,1,-1,300000,300000,'false','true'),
(15,31093,1,-1,300000,300000,'false','true'),
(16,31093,1,-1,300000,300000,'false','true'),
(17,31093,1,-1,300000,300000,'false','true'),
(18,31093,1,-1,300000,300000,'false','true'),
(19,31093,1,-1,300000,300000,'false','true'),
(20,31093,1,-1,300000,300000,'false','true'),
(21,31093,1,-1,300000,300000,'false','true'),
(22,25283,1,-1,86400,0,'false','false'),
(23,25286,1,-1,86400,0,'false','false');

-- sevensigns emblem_of_dawn,emblem_of_dusk
insert into random_spawn values
(103, 31170, 1, -1, 60, 0, 'false', 'false'),
(104, 31171, 1, -1, 60, 0, 'false', 'false'),
(105, 31170, 1, -1, 60, 0, 'false', 'false'),
(106, 31171, 1, -1, 60, 0, 'false', 'false'),
(107, 31170, 1, -1, 60, 0, 'false', 'false'),
(108, 31171, 1, -1, 60, 0, 'false', 'false'),
(109, 31170, 1, -1, 60, 0, 'false', 'false'),
(110, 31171, 1, -1, 60, 0, 'false', 'false'),
(111, 31170, 1, -1, 60, 0, 'false', 'false'),
(112, 31171, 1, -1, 60, 0, 'false', 'false'),
(113, 31170, 1, -1, 60, 0, 'false', 'false'),
(114, 31171, 1, -1, 60, 0, 'false', 'false'),
(115, 31170, 1, -1, 60, 0, 'false', 'false'),
(116, 31171, 1, -1, 60, 0, 'false', 'false'),
(117, 31170, 1, -1, 60, 0, 'false', 'false'),
(118, 31171, 1, -1, 60, 0, 'false', 'false'),
(119, 31170, 1, -1, 60, 0, 'false', 'false'),
(120, 31171, 1, -1, 60, 0, 'false', 'false'),
(121, 31170, 1, -1, 60, 0, 'false', 'false'),
(122, 31171, 1, -1, 60, 0, 'false', 'false'),
(123, 31170, 1, -1, 60, 0, 'false', 'false'),
(124, 31171, 1, -1, 60, 0, 'false', 'false'),
(125, 31170, 1, -1, 60, 0, 'false', 'false'),
(126, 31171, 1, -1, 60, 0, 'false', 'false'),
(127, 31170, 1, -1, 60, 0, 'false', 'false'),
(128, 31171, 1, -1, 60, 0, 'false', 'false'),
(129, 31170, 1, -1, 60, 0, 'false', 'false'),
(130, 31171, 1, -1, 60, 0, 'false', 'false');
 
Реализация автоанонсов просто нечто, уровень 2007 года.
package core.gameserver.instancemanager;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import javax.xml.parsers.DocumentBuilderFactory;

import core.gameserver.Announcements;
import core.gameserver.Config;
import core.gameserver.model.AutoAnnounces;

import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AutoAnnounce implements Runnable
{
private static final Logger _log = LoggerFactory.getLogger(AutoAnnounce.class);
private static AutoAnnounce _instance;

static HashMap<Integer, AutoAnnounces> _lists;

public static AutoAnnounce getInstance()
{
if(_instance == null)
_instance = new AutoAnnounce();
return _instance;
}

public static void reload()
{
_instance = new AutoAnnounce();
}

public AutoAnnounce()
{
_lists = new HashMap<Integer, AutoAnnounces>();
_log.info("AutoAnnounce: Initializing");
load();
_log.info("AutoAnnounce: Loaded " + _lists.size() + " announce.");
}

private void load()
{
try
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setIgnoringComments(true);

File file = new File("./config/autoannounce.xml");
if(!file.exists())
{
_log.warn("AutoAnnounce: NO FILE (./config/autoannounce.xml)");
return;
}

Document doc = factory.newDocumentBuilder().parse(file);
int counterAnnounce = 0;
for(Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
if("list".equalsIgnoreCase(n.getNodeName()))
{
for(Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
{
if("announce".equalsIgnoreCase(d.getNodeName()))
{
ArrayList<String> msg = new ArrayList<String>();
NamedNodeMap attrs = d.getAttributes();
int delay = Integer.parseInt(attrs.getNamedItem("delay").getNodeValue());
int repeat = Integer.parseInt(attrs.getNamedItem("repeat").getNodeValue());
AutoAnnounces aa = new AutoAnnounces(counterAnnounce);
for(Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{
if("message".equalsIgnoreCase(cd.getNodeName()))
msg.add(String.valueOf(cd.getAttributes().getNamedItem("text").getNodeValue()));
}
aa.setAnnounce(delay, repeat, msg);
_lists.put(counterAnnounce, aa);
counterAnnounce++;
}
}
}
_log.info("AutoAnnounce: Load OK");
}
catch(Exception e)
{
_log.warn("AutoAnnounce: Error parsing autoannounce.xml file. " + e);
}
}

public void run()
{
if(_lists.size() <= 0)
return;
for(int i = 0; i < _lists.size(); i++)
{
if(_lists.get(i).canAnnounce())
{
ArrayList<String> msg = _lists.get(i).getMessage();
for(int c = 0; c < msg.size(); c++)
Announcements.getInstance().announceToAll(msg.get(c));
_lists.get(i).updateRepeat();
}
}
}
}
Оставляет желать лучше данная реализация.
 
Оно еще и багнутое
 
Реакции: kick

    kick

    Баллов: 26
    Без комментариев
BaiumManager.java
Оо даа паофувсио.
Код:
        // Archangels
        try
        {
            NpcTemplate angel = NpcHolder.getInstance().getTemplate(ARCHANGEL);
            SimpleSpawner spawnDat;
            _angelSpawns.clear();

            // 5 random numbers of 10, no duplicates
            List<Integer> random = new ArrayList<Integer>();
            for(int i = 0; i < 5; i++)
            {
                int r = -1;
                while(r == -1 || random.contains(r))
                    r = Rnd.get(10);
                random.add(r);
            }

            for(int i : random)
            {
                spawnDat = new SimpleSpawner(angel);
                spawnDat.setAmount(1);
                spawnDat.setLoc(ANGEL_LOCATION[i]);
                spawnDat.setRespawnDelay(300000);
                _angelSpawns.add(spawnDat);
            }
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
 
Реакции: kick
Гринд же просто чсв-клоун
 
Реакции: zcxv

    Mangol

    Баллов: 25
    Без комментариев
Код:
    <skill id="23197" levels="1" name="Ball Trapping Orodriel Agathion Special Skill - Buff of Cheers">
        <!-- With the power of cheers, for 1 hour, increases Max MP, MP Recovery Bonus, HP Recovery Bonus,
        Critical Attack Power, P. Def., Atk. Spd., M. Atk., M. Def., Casting Spd. by 20%, the occurrence rate of
        Prominent Damage through damage magic by 2, P. Atk. by 10%, and resistance to de-buffs by 10%. Also decreases
        MP consumption needed for skill use by 5% and moving speed by 20%. Reuse Delay 1 hour. Consumes 250 energy. -->
        <set name="icon" val="icon.skill_agathion_special" />
        <set name="reuseDelay" val="3600000" />
        <set name="hitTime" val="4000" />
        <set name="target" val="TARGET_ONE" />
        <set name="skillType" val="BUFF" />
        <set name="operateType" val="OP_ACTIVE" />
        <set name="mpConsume2" val="250" />
        <for>
            <effect count="1" name="Buff" stackOrder="1" stackType="agation" time="3600" val="0">
                <mul order="0x30" stat="maxMp" val="1.2" />
                <mul order="0x30" stat="cAtkStatic" val="1.2" />
                <mul order="0x30" stat="pAtk" val="1.1" />
                <mul order="0x30" stat="mAtk" val="1.2" />
                <mul order="0x30" stat="mDef" val="1.2" />
                <mul order="0x30" stat="pDef" val="1.2" />
                <mul order="0x30" stat="pAtkSpd" val="1.2" />
                <mul order="0x30" stat="regMp" val="1.2" />
                <mul order="0x30" stat="regHp" val="1.2" />
                <mul order="0x30" stat="runSpd" val="1.2" />
                <add order="0x30" stat="mCritRate" val="2" />
                <mul order="0x30" stat="mpConsum" val="0.95" />
                <add order="0x40" stat="debuffResist" val="10" />
            </effect>
        </for>
    </skill>

i_agathion_energy;-250;diff - птс
Consumes 250 energy.
<set name="mpConsume2" val="250" /> - гриндоптсэ
what??? !111 Вместо поглащения энергии агитациона поглащает МП.
 
Последнее редактирование:
Оффтоп:
Код:
package quests;

import java.util.HashMap;
import java.util.Map;

import l2ft.commons.threading.RunnableImpl;
import l2ft.gameserver.ThreadPoolManager;
import l2ft.gameserver.model.Player;
import l2ft.gameserver.model.base.Race;
import l2ft.gameserver.model.instances.NpcInstance;
import l2ft.gameserver.model.quest.Quest;
import l2ft.gameserver.model.quest.QuestState;
import l2ft.gameserver.scripts.ScriptFile;

public class _999_T1Tutorial extends Quest implements ScriptFile
{
    private static int RECOMMENDATION_01 = 1067;
    private static int RECOMMENDATION_02 = 1068;
    private static int LEAF_OF_MOTHERTREE = 1069;
    private static int BLOOD_OF_JUNDIN = 1070;
    private static int LICENSE_OF_MINER = 1498;
    private static int VOUCHER_OF_FLAME = 1496;
    private static int SOULSHOT_NOVICE = 5789;
    private static int SPIRITSHOT_NOVICE = 5790;
    private static int BLUE_GEM = 6353;
    private static int DIPLOMA = 9881;

    private static class Event
    {
        public String htm;
        public int radarX;
        public int radarY;
        public int radarZ;
        public int item;
        public int classId1;
        public int gift1;
        public int count1;
        public int classId2;
        public int gift2;
        public int count2;

        public Event(String htm, int radarX, int radarY, int radarZ, int item, int classId1, int gift1, int count1, int classId2, int gift2, int count2)
        {
            this.htm = htm;
            this.radarX = radarX;
            this.radarY = radarY;
            this.radarZ = radarZ;
            this.item = item;
            this.classId1 = classId1;
            this.gift1 = gift1;
            this.count1 = count1;
            this.classId2 = classId2;
            this.gift2 = gift2;
            this.count2 = count2;
        }
    }

    private static class Talk
    {
        public int raceId;
        public String[] htmlfiles;
        public int npcTyp;
        public int item;

        public Talk(int raceId, String[] htmlfiles, int npcTyp, int item)
        {
            this.raceId = raceId;
            this.htmlfiles = htmlfiles;
            this.npcTyp = npcTyp;
            this.item = item;
        }
    }

    private static Map<String, Event> events = new HashMap<String, Event>();

    static
    {
        events.put("32133_02", new Event("32133-03.htm", -119692, 44504, 380, DIPLOMA, 0x7b, SOULSHOT_NOVICE, 200, 0x7c, SOULSHOT_NOVICE, 200));
        events.put("30008_02", new Event("30008-03.htm", 0, 0, 0, RECOMMENDATION_01, 0x00, SOULSHOT_NOVICE, 200, 0x00, 0, 0));
        events.put("30008_04", new Event("30008-04.htm", -84058, 243239, -3730, 0, 0x00, 0, 0, 0, 0, 0));
        events.put("30017_02", new Event("30017-03.htm", 0, 0, 0, RECOMMENDATION_02, 0x0a, SPIRITSHOT_NOVICE, 100, 0x00, 0, 0));
        events.put("30017_04", new Event("30017-04.htm", -84058, 243239, -3730, 0, 0x0a, 0, 0, 0x00, 0, 0));
        events.put("30370_02", new Event("30370-03.htm", 0, 0, 0, LEAF_OF_MOTHERTREE, 0x19, SPIRITSHOT_NOVICE, 100, 0x12, SOULSHOT_NOVICE, 200));
        events.put("30370_04", new Event("30370-04.htm", 45491, 48359, -3086, 0, 0x19, 0, 0, 0x12, 0, 0));
        events.put("30129_02", new Event("30129-03.htm", 0, 0, 0, BLOOD_OF_JUNDIN, 0x26, SPIRITSHOT_NOVICE, 100, 0x1f, SOULSHOT_NOVICE, 200));
        events.put("30129_04", new Event("30129-04.htm", 12116, 16666, -4610, 0, 0x26, 0, 0, 0x1f, 0, 0));
        events.put("30528_02", new Event("30528-03.htm", 0, 0, 0, LICENSE_OF_MINER, 0x35, SOULSHOT_NOVICE, 200, 0x00, 0, 0));
        events.put("30528_04", new Event("30528-04.htm", 115642, -178046, -941, 0, 0x35, 0, 0, 0x00, 0, 0));
        events.put("30573_02", new Event("30573-03.htm", 0, 0, 0, VOUCHER_OF_FLAME, 0x31, SPIRITSHOT_NOVICE, 100, 0x2c, SOULSHOT_NOVICE, 200));
        events.put("30573_04", new Event("30573-04.htm", -45067, -113549, -235, 0, 0x31, 0, 0, 0x2c, 0, 0));
    }

    private static Map<Integer, Talk> talks = new HashMap<Integer, Talk>();

    static
    {
        talks.put(30017, new Talk(0, new String[]{
                "30017-01.htm",
                "30017-02.htm",
                "30017-04.htm"
        }, 0, 0));
        talks.put(30008, new Talk(0, new String[]{
                "30008-01.htm",
                "30008-02.htm",
                "30008-04.htm"
        }, 0, 0));
        talks.put(30370, new Talk(1, new String[]{
                "30370-01.htm",
                "30370-02.htm",
                "30370-04.htm"
        }, 0, 0));
        talks.put(30129, new Talk(2, new String[]{
                "30129-01.htm",
                "30129-02.htm",
                "30129-04.htm"
        }, 0, 0));
        talks.put(30573, new Talk(3, new String[]{
                "30573-01.htm",
                "30573-02.htm",
                "30573-04.htm"
        }, 0, 0));
        talks.put(30528, new Talk(4, new String[]{
                "30528-01.htm",
                "30528-02.htm",
                "30528-04.htm"
        }, 0, 0));
        talks.put(30018, new Talk(0, new String[]{
                "30131-01.htm",
                "",
                "30019-03a.htm",
                "30019-04.htm",
        }, 1, RECOMMENDATION_02));
        talks.put(30019, new Talk(0, new String[]{
                "30131-01.htm",
                "",
                "30019-03a.htm",
                "30019-04.htm",
        }, 1, RECOMMENDATION_02));
        talks.put(30020, new Talk(0, new String[]{
                "30131-01.htm",
                "",
                "30019-03a.htm",
                "30019-04.htm",
        }, 1, RECOMMENDATION_02));
        talks.put(30021, new Talk(0, new String[]{
                "30131-01.htm",
                "",
                "30019-03a.htm",
                "30019-04.htm",
        }, 1, RECOMMENDATION_02));
        talks.put(30009, new Talk(0, new String[]{
                "30530-01.htm",
                "30009-03.htm",
                "",
                "30009-04.htm",
        }, 1, RECOMMENDATION_01));
        talks.put(30011, new Talk(0, new String[]{
                "30530-01.htm",
                "30009-03.htm",
                "",
                "30009-04.htm",
        }, 1, RECOMMENDATION_01));
        talks.put(30012, new Talk(0, new String[]{
                "30530-01.htm",
                "30009-03.htm",
                "",
                "30009-04.htm",
        }, 1, RECOMMENDATION_01));
        talks.put(30056, new Talk(0, new String[]{
                "30530-01.htm",
                "30009-03.htm",
                "",
                "30009-04.htm",
        }, 1, RECOMMENDATION_01));
        talks.put(30400, new Talk(1, new String[]{
                "30131-01.htm",
                "30400-03.htm",
                "30400-03a.htm",
                "30400-04.htm",
        }, 1, LEAF_OF_MOTHERTREE));
        talks.put(30401, new Talk(1, new String[]{
                "30131-01.htm",
                "30400-03.htm",
                "30400-03a.htm",
                "30400-04.htm",
        }, 1, LEAF_OF_MOTHERTREE));
        talks.put(30402, new Talk(1, new String[]{
                "30131-01.htm",
                "30400-03.htm",
                "30400-03a.htm",
                "30400-04.htm",
        }, 1, LEAF_OF_MOTHERTREE));
        talks.put(30403, new Talk(1, new String[]{
                "30131-01.htm",
                "30400-03.htm",
                "30400-03a.htm",
                "30400-04.htm",
        }, 1, LEAF_OF_MOTHERTREE));
        talks.put(30131, new Talk(2, new String[]{
                "30131-01.htm",
                "30131-03.htm",
                "30131-03a.htm",
                "30131-04.htm",
        }, 1, BLOOD_OF_JUNDIN));
        talks.put(30404, new Talk(2, new String[]{
                "30131-01.htm",
                "30131-03.htm",
                "30131-03a.htm",
                "30131-04.htm",
        }, 1, BLOOD_OF_JUNDIN));
        talks.put(30574, new Talk(3, new String[]{
                "30575-01.htm",
                "30575-03.htm",
                "30575-03a.htm",
                "30575-04.htm",
        }, 1, VOUCHER_OF_FLAME));
        talks.put(30575, new Talk(3, new String[]{
                "30575-01.htm",
                "30575-03.htm",
                "30575-03a.htm",
                "30575-04.htm",
        }, 1, VOUCHER_OF_FLAME));
        talks.put(30530, new Talk(4, new String[]{
                "30530-01.htm",
                "30530-03.htm",
                "",
                "30530-04.htm",
        }, 1, LICENSE_OF_MINER));
        talks.put(32133, new Talk(5, new String[]{
                "32133-01.htm",
                "32133-02.htm",
                "32133-04.htm"
        }, 0, 0));
        talks.put(32134, new Talk(5, new String[]{
                "32134-01.htm",
                "32134-03.htm",
                "",
                "32134-04.htm",
        }, 1, DIPLOMA));
    }

    public void onLoad()
    {
    }

    public void onReload()
    {
    }

    public void onShutdown()
    {
    }

    public _999_T1Tutorial()
    {
        super(false);

        addStartNpc(30008, 30009, 30017, 30019, 30129, 30131, 30573, 30575, 30370, 30528, 30530, 30400, 30401, 30402, 30403, 30404, 32133, 32134);
        addTalkId(30008, 30009, 30017, 30019, 30129, 30131, 30573, 30575, 30370, 30528, 30530, 30400, 30401, 30402, 30403, 30404, 32133, 32134);
        addFirstTalkId(30008, 30009, 30017, 30019, 30129, 30131, 30573, 30575, 30370, 30528, 30530, 30400, 30401, 30402, 30403, 30404, 32133, 32134);

        addKillId(18342, 20001);
    }

    @Override
    public String onEvent(String event, QuestState st, NpcInstance npc)
    {
        QuestState qs = st.getPlayer().getQuestState(_255_Tutorial.class);
        if(qs == null || st == null)
            return null;

        Player player = st.getPlayer();
        if(player == null)
            return null;

        String htmltext = event;
        int Ex = qs.getInt("Ex");
        int classId = player.getClassId().getId();
        boolean isMage = (player.getClassId().getRace() != Race.orc) && player.getClassId().isMage();
        if(event.equalsIgnoreCase("TimerEx_NewbieHelper"))
        {
            if(Ex == 0)
            {
                if(isMage)
                    st.playTutorialVoice("tutorial_voice_009b");
                else
                    st.playTutorialVoice("tutorial_voice_009a");
                qs.set("Ex", "1");
            }
            else if(Ex == 3)
            {
                st.playTutorialVoice("tutorial_voice_010a");
                qs.set("Ex", "4");
            }
            return null;
        }
        else if(event.equalsIgnoreCase("TimerEx_GrandMaster"))
        {
            if(Ex >= 4)
            {
                st.showQuestionMark(7);
                st.playSound(SOUND_TUTORIAL);
                st.playTutorialVoice("tutorial_voice_025");
            }
            return null;
        }
        else if(event.equalsIgnoreCase("isle"))
        {
            st.addRadar(-119692, 44504, 380);
            player.teleToLocation(-120050, 44500, 360);
            String title = npc == null ? "" : npc.getTitle() + " " + npc.getName();
            htmltext = "<html><body>" + title + "<br>Go to the <font color=\"LEVEL\">Isle of Souls</font> and meet the <font color=\"LEVEL\">Newbie Guide</font> there to learn a number of important tips. He will also give you an item to assist your development.<br>Follow the direction arrow above your head and it will lead you to the Newbie Guide. Good luck!</body></html>";
        }
        else
        {
            Event e = events.get(event);
            if(e.radarX != 0)
                st.addRadar(e.radarX, e.radarY, e.radarZ);
            htmltext = e.htm;
            if(st.getQuestItemsCount(e.item) > 0 && st.getInt("onlyone") == 0)
            {
                st.addExpAndSp(0, 50);
                st.startQuestTimer("TimerEx_GrandMaster", 60000);
                st.takeItems(e.item, 1);
                if(Ex <= 3)
                    qs.set("Ex", "4");
                if(classId == e.classId1)
                {
                    st.giveItems(e.gift1, e.count1);
                    if(e.gift1 == SPIRITSHOT_NOVICE)
                        st.playTutorialVoice("tutorial_voice_027");
                    else
                        st.playTutorialVoice("tutorial_voice_026");
                }
                else if(classId == e.classId2)
                {
                    if(e.gift2 != 0)
                    {
                        st.giveItems(e.gift2, e.count2);
                        st.playTutorialVoice("tutorial_voice_026");
                    }
                }
                st.set("step", "3");
                st.set("onlyone", "1");
            }
        }
        return htmltext;
    }

    @Override
    public String onFirstTalk(NpcInstance npc, Player player)
    {
        String htmltext = "";
        QuestState qs = player.getQuestState(_255_Tutorial.class);
        if(qs == null)
            return htmltext;

        QuestState st = player.getQuestState(getClass());
        if(st == null)
        {
            newQuestState(player, CREATED);
            st = player.getQuestState(getClass());
        }

        int Ex = qs.getInt("Ex");
        int npcId = npc.getNpcId();
        int step = st.getInt("step");
        int onlyone = st.getInt("onlyone");
        int level = player.getLevel();
        boolean isMage = (player.getClassId().getRace() != Race.orc) && player.getClassId().isMage();

        Talk t = talks.get(npcId);
        if(t == null)
            return "";

        if((level >= 10 || onlyone == 1) && t.npcTyp == 1)
            htmltext = "30575-05.htm";
        else if(onlyone == 0 && level < 10)
        {
            if(player.getRace().ordinal() == t.raceId)
                htmltext = t.htmlfiles[0];
            if(t.npcTyp == 1)
            {
                if(step == 0 && Ex < 0)
                {
                    qs.set("Ex", "0");
                    st.startQuestTimer("TimerEx_NewbieHelper", 30000);
                    if(isMage)
                    {
                        st.set("step", "1");
                        st.setState(STARTED);
                    }
                    else
                    {
                        htmltext = "30530-01.htm";
                        st.set("step", "1");
                        st.setState(STARTED);
                    }
                }
                else if(step == 1 && st.getQuestItemsCount(t.item) == 0 && Ex <= 2)
                {
                    if(st.getQuestItemsCount(BLUE_GEM) > 0)
                    {
                        st.takeItems(BLUE_GEM, st.getQuestItemsCount(BLUE_GEM));
                        st.giveItems(t.item, 1);
                        st.set("step", "2");
                        qs.set("Ex", "3");
                        st.startQuestTimer("TimerEx_NewbieHelper", 30000);
                        qs.set("ucMemo", "3");
                        if(isMage)
                        {
                            st.playTutorialVoice("tutorial_voice_027");
                            st.giveItems(SPIRITSHOT_NOVICE, 100);
                            htmltext = t.htmlfiles[2];
                            if(htmltext.isEmpty())
                                htmltext = "<html><body>" + (npc.getTitle().isEmpty() ? "" : npc.getTitle() + " ") + npc.getName() + "<br>I am sorry. I only help warriors. Please go to another Newbie Helper who may assist you.</body></html>";
                        }
                        else
                        {
                            st.playTutorialVoice("tutorial_voice_026");
                            st.giveItems(SOULSHOT_NOVICE, 200);
                            htmltext = t.htmlfiles[1];
                            if(htmltext.isEmpty())
                                htmltext = "<html><body>" + (npc.getTitle().isEmpty() ? "" : npc.getTitle() + " ") + npc.getName() + "<br>I am sorry. I only help mystics. Please go to another Newbie Helper who may assist you.</body></html>";
                        }
                    }
                    else
                    {
                        if(isMage)
                        {
                            htmltext = "30131-02.htm";
                            if(player.getRace().ordinal() == 3)
                                htmltext = "30575-02.htm";
                        }
                        else
                            htmltext = "30530-02.htm";
                    }
                }
                else if(step == 2)
                    htmltext = t.htmlfiles[3];
            }
            else if(t.npcTyp == 0)
            {
                if(step == 1)
                    htmltext = t.htmlfiles[0];
                else if(step == 2)
                    htmltext = t.htmlfiles[1];
                else if(step == 3)
                    htmltext = t.htmlfiles[2];
            }
        }

        return htmltext;
    }

    @Override
    public String onKill(NpcInstance npc, QuestState st)
    {
        QuestState qs = st.getPlayer().getQuestState(_255_Tutorial.class);
        if(qs == null)
            return null;
        int Ex = qs.getInt("Ex");
        if(Ex <= 1)
        {
            st.playTutorialVoice("tutorial_voice_011");
            st.showQuestionMark(3);
            qs.set("Ex", "2");
        }
        if(Ex <= 2 && st.getQuestItemsCount(BLUE_GEM) < 1) //TODO: На оффе квестовые итемы дропаются\даются через 3 сек, после убийства моба!
            ThreadPoolManager.getInstance().schedule(new DropGem(npc, st), 3000);
        return null;
    }

    public static class DropGem extends RunnableImpl
    {
        private NpcInstance _npc;
        private QuestState _st;

        public DropGem(NpcInstance npc, QuestState st)
        {
            _npc = npc;
            _st = st;
        }

        public void runImpl() throws Exception
        {
            if(_st != null && _npc != null)
            {
                _npc.dropItem(_st.getPlayer(), BLUE_GEM, 1);
                _st.playSound(SOUND_TUTORIAL);
            }
        }
    }

    @Override
    public boolean isVisible()
    {
        return false;
    }
}

Вааай....... А как же туториал ? Блин не робит Ах да... в туториале же нужно под 500 штмлок. Не царское видимо это дело..... ЗАТО У ГРИНДА КАГНАПТСЭ.
 
Обратите внимание, что данный пользователь заблокирован! Не совершайте с ним никаких сделок! Перейдите в его профиль, чтобы узнать причину блокировки.
СССР, манголы и прочии сочувствующие им леваки поддакивают в такт, отсасавшему за сборку/илиещечтото кику,

кик публикует куски кода (часть из которых мне доставалось в наследство) и прикрепляет комментарии к ним в духе "Оставляет желать лучше данная реализация" или "Код просто отличный" - ничего не значащие, без конкретики или пояснений.

очень смешно наблюдать, за людьми, у которых нет никаких достижений в этой сфере, не успешных проектов, не разработок, не клиентов с успешными проектами.

Также весело наблюдать за тем, как один клоун, который учит математики за 5 класс (как делить целые числа без остатка), поддакивает другому клоуно, который в подобных тестах ошибается xD И эти люди пытаются на своем колхозном языке объяснить мне - что не так.

особо яросто в ход идут комментарии другого ноунейма, модера с проекта emerald, хотя относительно его руководитель проекта дал мне четкие объяснения
 
Последнее редактирование модератором:
Код:
    public void addExpAndCheckBonus(MonsterInstance mob, final double noRateExp, double noRateSp, double partyVitalityMod)
    {
        if(_activeClass == null)
            return;

        // Начисление душ камаэлям
        double neededExp = calcStat(Stats.SOULS_CONSUME_EXP, 0, mob, null);
        if(neededExp > 0 && noRateExp > neededExp)
        {
            mob.broadcastPacket(new SpawnEmitter(mob, this));
            ThreadPoolManager.getInstance().schedule(new GameObjectTasks.SoulConsumeTask(this), 1000);
        }

        double vitalityBonus = 0.;
        int npcLevel = mob.getLevel();
        if(Config.ALT_VITALITY_ENABLED)
        {
            vitalityBonus = mob.isRaid() ? 0. : getVitalityLevel(getNevitSystem().isBlessingActive()) / 2.;
            vitalityBonus *= Config.ALT_VITALITY_RATE;
            if(noRateExp > 0 && !getNevitSystem().isBlessingActive())
            {
                if(!isVitalityStop())
                {
                    if(!mob.isRaid())
                    {
                        // TODO: Разобратся, нельзя предметы использовать, или предметы не будут давать эффекта?
                        // (Все предметы для восполнения или поддержания энергии не действуют во время действия Нисхождения Невитта)
                        if(!(getVarB("NoExp") && getExp() == Experience.LEVEL[getLevel() + 1] - 1))
                        {
                            double points = ((noRateExp / (npcLevel * npcLevel)) * 100) / 9;
                            points *= Config.ALT_VITALITY_CONSUME_RATE;
                            if(getEffectList().getEffectByType(EffectType.Vitality) != null)
                                points *= -1;
                                setVitality(getVitality() - points * partyVitalityMod);
                        }
                    }
                    else
                        setVitality(getVitality() + Config.ALT_VITALITY_RAID_BONUS);
                }
                else
                    setVitality(getVitality());
            }
        }

        //При первом вызове, активируем таймеры бонусов.
        if(!isInPeaceZone())
        {
            setRecomTimerActive(true);
            getNevitSystem().startAdventTask();
            if((getLevel() - npcLevel) <= 9)
            {
                int nevitPoints = (int) Math.round(((noRateExp / (npcLevel * npcLevel)) * 100) / 20); //TODO: Формула от балды.
                getNevitSystem().addPoints(nevitPoints);
            }
        }

        long normalExp = (long)  (noRateExp * ((Config.RATE_XP * getRateExp() + vitalityBonus) * getRecomBonusMul()));
        long normalSp = (long)  (noRateSp * (Config.RATE_SP * getRateSp() + vitalityBonus));

        long expWithoutBonus = (long)  (noRateExp * Config.RATE_XP * getRateExp());
        long spWithoutBonus = (long)  (noRateSp * Config.RATE_SP * getRateSp());

        int razLvl = getLevel() - npcLevel;
        if((razLvl >= 10 && razLvl <= 14)  || (razLvl <= -10 && razLvl >= -14))//30% от 10 до 14 уровней разница
        {
            addExpAndSp(normalExp/100*30, normalSp/100*30, (normalExp - expWithoutBonus)/100*30, (normalSp - spWithoutBonus)/100*30, false, true);
            return;
        }
        if(razLvl > 14 || razLvl < -14)//0% свыше 14 уровней разница
        {
            addExpAndSp(0, 0, 0, 0, false, true);
            return;
        }
        addExpAndSp(normalExp, normalSp, normalExp - expWithoutBonus, normalSp - spWithoutBonus, false, true);          
}
У парня даже формулы виталити "ПА ОФУ".
 
Реакции: kick
Обратите внимание, что данный пользователь заблокирован! Не совершайте с ним никаких сделок! Перейдите в его профиль, чтобы узнать причину блокировки.
То чувство, когда папки ЗГ обсираются публчично в очередной раз, а стыдно почему-то мне

Давайте может обсудим говнокод JTS (где все по офу и жалобы только на диалоги)?
Или сборки СССРа на которых фейлились ВСЕ его клиенты и нет ниодного успешного проекта.
Или давай обсудим кика, у которого просто - ничего нет.
 
Обратите внимание, что данный пользователь заблокирован! Не совершайте с ним никаких сделок! Перейдите в его профиль, чтобы узнать причину блокировки.
Твое по офу ПТССКРИПТЫКАКНАОФЕ я уже лично видел на
 
А когда он глянет виталити и какие скилы он увидит
 
10.Запрещены какие-либо необоснованные (без доказательств) обвинения
 
А причем тут он когда это комментарий разработчика выложен был
 
Последнее редактирование:
Обратите внимание, что данный пользователь заблокирован! Не совершайте с ним никаких сделок! Перейдите в его профиль, чтобы узнать причину блокировки.
Короче можете тут поливаться дерьмом сколько влезет))) свои догадки и колхозные рассуждения оставлять для таких же колхозников)
У меня есть - мои проекты тысячники, мои клиенты, мои доходы.
У вас - ПТССКРИПТЫКАКНАОФЕ И ДАЖИЛУЧШЕ!!1

О чем тут можно говорить?)
 

    zcxv

    Баллов: -29
    Без комментариев
Ну грузи дальше w3. Пиши в бд. Держи статик в бд и конечно же гавнокодь
 
Обратите внимание, что данный пользователь заблокирован! Не совершайте с ним никаких сделок! Перейдите в его профиль, чтобы узнать причину блокировки.
10.Запрещены какие-либо необоснованные (без доказательств) обвинения
Кик я знаю как это работает, можешь не пояснять, ты привратил свой форум в ЗГ2, я разочарован.
 
Оно и видно как ваши клиенты о вас говорят и правильно с таким кодом и реализациями можно сходить в туалет