Implemented Auto Shots with Config.
This commit is contained in:
@ -254,6 +254,7 @@ public final class Config
|
||||
public static boolean EXPERTISE_PENALTY;
|
||||
public static boolean STORE_RECIPE_SHOPLIST;
|
||||
public static boolean STORE_UI_SETTINGS;
|
||||
public static boolean ENABLE_AUTO_SHOTS;
|
||||
public static String[] FORBIDDEN_NAMES;
|
||||
public static boolean SILENCE_MODE_EXCLUDE;
|
||||
public static boolean SHOW_GOD_VIDEO_INTRO;
|
||||
@ -1545,6 +1546,7 @@ public final class Config
|
||||
EXPERTISE_PENALTY = Character.getBoolean("ExpertisePenalty", true);
|
||||
STORE_RECIPE_SHOPLIST = Character.getBoolean("StoreRecipeShopList", false);
|
||||
STORE_UI_SETTINGS = Character.getBoolean("StoreCharUiSettings", true);
|
||||
ENABLE_AUTO_SHOTS = Character.getBoolean("EnableAutoShots", true);
|
||||
FORBIDDEN_NAMES = Character.getString("ForbiddenNames", "").split(",");
|
||||
SILENCE_MODE_EXCLUDE = Character.getBoolean("SilenceModeExclude", false);
|
||||
SHOW_GOD_VIDEO_INTRO = Character.getBoolean("GoDVideoIntro", true);
|
||||
|
@ -13798,8 +13798,13 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void handleAutoShots()
|
||||
public void handleAutoShots(boolean force)
|
||||
{
|
||||
if (getAutoSoulShot().isEmpty() && !force)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final L2ItemInstance weapon = getActiveWeaponInstance();
|
||||
int soulShotId = 0;
|
||||
int spiritShotId = 0;
|
||||
@ -13853,10 +13858,40 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
}
|
||||
|
||||
sendPacket(new ExAutoSoulShot(soulShotId, true, 1));
|
||||
sendPacket(new ExAutoSoulShot(spiritShotId, true, 2));
|
||||
sendPacket(new ExAutoSoulShot(summonSoulShotId, true, 3));
|
||||
sendPacket(new ExAutoSoulShot(summonSpiritShotId, true, 4));
|
||||
for (int shotId : getAutoSoulShot())
|
||||
{
|
||||
if ((shotId != soulShotId) && (shotId != spiritShotId) && (shotId != summonSoulShotId) && (shotId != summonSpiritShotId))
|
||||
{
|
||||
removeAutoSoulShot(shotId);
|
||||
}
|
||||
}
|
||||
|
||||
if (soulShotId != 0)
|
||||
{
|
||||
addAutoSoulShot(soulShotId);
|
||||
}
|
||||
if (spiritShotId != 0)
|
||||
{
|
||||
addAutoSoulShot(spiritShotId);
|
||||
}
|
||||
if (summonSoulShotId != 0)
|
||||
{
|
||||
addAutoSoulShot(summonSoulShotId);
|
||||
}
|
||||
if (summonSpiritShotId != 0)
|
||||
{
|
||||
addAutoSoulShot(summonSpiritShotId);
|
||||
}
|
||||
|
||||
sendPacket(new ExAutoSoulShot(soulShotId, true, 0));
|
||||
sendPacket(new ExAutoSoulShot(spiritShotId, true, 1));
|
||||
sendPacket(new ExAutoSoulShot(summonSoulShotId, true, 2));
|
||||
sendPacket(new ExAutoSoulShot(summonSpiritShotId, true, 3));
|
||||
|
||||
if (!getAutoSoulShot().isEmpty())
|
||||
{
|
||||
rechargeShots(true, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
public GroupType getGroupType()
|
||||
|
@ -374,7 +374,7 @@ public abstract class Inventory extends ItemContainer
|
||||
|
||||
if (item.isWeapon())
|
||||
{
|
||||
player.handleAutoShots();
|
||||
player.handleAutoShots(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -470,7 +470,7 @@ public abstract class Inventory extends ItemContainer
|
||||
|
||||
if (item.isWeapon())
|
||||
{
|
||||
player.handleAutoShots();
|
||||
player.handleAutoShots(Config.ENABLE_AUTO_SHOTS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -460,7 +460,7 @@ public class PcInventory extends Inventory
|
||||
|
||||
if (item.isEtcItem() && (item.getItemType() == EtcItemType.SOULSHOT))
|
||||
{
|
||||
actor.handleAutoShots();
|
||||
actor.handleAutoShots(false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
@ -516,7 +516,7 @@ public class PcInventory extends Inventory
|
||||
|
||||
if (item.isEtcItem() && (item.getItemType() == EtcItemType.SOULSHOT))
|
||||
{
|
||||
actor.handleAutoShots();
|
||||
actor.handleAutoShots(false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
|
@ -63,6 +63,7 @@ import com.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.Die;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.EtcStatusUpdate;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExAdenaInvenCount;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExAutoSoulShot;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExBeautyItemList;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExCastleState;
|
||||
@ -616,7 +617,18 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
|
||||
activeChar.sendPacket(new ExOneDayReceiveRewardList(activeChar));
|
||||
activeChar.sendPacket(ExConnectedTimeAndGettableReward.STATIC_PACKET);
|
||||
activeChar.handleAutoShots();
|
||||
|
||||
if (Config.ENABLE_AUTO_SHOTS)
|
||||
{
|
||||
activeChar.handleAutoShots(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.sendPacket(new ExAutoSoulShot(0, false, 0));
|
||||
activeChar.sendPacket(new ExAutoSoulShot(0, false, 1));
|
||||
activeChar.sendPacket(new ExAutoSoulShot(0, false, 2));
|
||||
activeChar.sendPacket(new ExAutoSoulShot(0, false, 3));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -184,9 +184,13 @@ public final class RequestAutoSoulShot implements IClientIncomingPacket
|
||||
case SPIRITSHOT:
|
||||
case SOULSHOT:
|
||||
case FISHINGSHOT:
|
||||
{
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,9 +200,13 @@ public final class RequestAutoSoulShot implements IClientIncomingPacket
|
||||
{
|
||||
case SUMMON_SPIRITSHOT:
|
||||
case SUMMON_SOULSHOT:
|
||||
{
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user