[Classic] Unused items removal, Newbie buffers and more misc changes.
This commit is contained in:
@@ -133,6 +133,8 @@ import handlers.bypasshandlers.ReceivePremium;
|
||||
import handlers.bypasshandlers.ReleaseAttribute;
|
||||
import handlers.bypasshandlers.RentPet;
|
||||
import handlers.bypasshandlers.SkillList;
|
||||
import handlers.bypasshandlers.SupportBlessing;
|
||||
import handlers.bypasshandlers.SupportMagic;
|
||||
import handlers.bypasshandlers.TerritoryStatus;
|
||||
import handlers.bypasshandlers.TutorialClose;
|
||||
import handlers.bypasshandlers.VoiceCommand;
|
||||
@@ -433,6 +435,8 @@ public class MasterHandler
|
||||
ReleaseAttribute.class,
|
||||
RentPet.class,
|
||||
SkillList.class,
|
||||
SupportBlessing.class,
|
||||
SupportMagic.class,
|
||||
TerritoryStatus.class,
|
||||
TutorialClose.class,
|
||||
VoiceCommand.class,
|
||||
|
60
trunk/dist/game/data_classic/scripts/handlers/bypasshandlers/SupportBlessing.java
vendored
Normal file
60
trunk/dist/game/data_classic/scripts/handlers/bypasshandlers/SupportBlessing.java
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J DataPack
|
||||
*
|
||||
* This file is part of L2J DataPack.
|
||||
*
|
||||
* L2J DataPack 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.
|
||||
*
|
||||
* L2J DataPack 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 handlers.bypasshandlers;
|
||||
|
||||
import com.l2jserver.gameserver.handler.IBypassHandler;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.skills.CommonSkill;
|
||||
|
||||
public class SupportBlessing implements IBypassHandler
|
||||
{
|
||||
private static final String[] COMMANDS =
|
||||
{
|
||||
"GiveBlessing"
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
|
||||
{
|
||||
if (!target.isNpc())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final L2Npc npc = (L2Npc) target;
|
||||
|
||||
// If the player is too high level, display a message and return
|
||||
if ((activeChar.getLevel() > 39) || (activeChar.getClassId().level() >= 2))
|
||||
{
|
||||
npc.showChatWindow(activeChar, "html/default/SupportBlessingHighLevel.htm");
|
||||
return true;
|
||||
}
|
||||
npc.setTarget(activeChar);
|
||||
npc.doCast(CommonSkill.BLESSING_OF_PROTECTION.getSkill());
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getBypassList()
|
||||
{
|
||||
return COMMANDS;
|
||||
}
|
||||
}
|
179
trunk/dist/game/data_classic/scripts/handlers/bypasshandlers/SupportMagic.java
vendored
Normal file
179
trunk/dist/game/data_classic/scripts/handlers/bypasshandlers/SupportMagic.java
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J DataPack
|
||||
*
|
||||
* This file is part of L2J DataPack.
|
||||
*
|
||||
* L2J DataPack 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.
|
||||
*
|
||||
* L2J DataPack 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 handlers.bypasshandlers;
|
||||
|
||||
import com.l2jserver.gameserver.enums.CategoryType;
|
||||
import com.l2jserver.gameserver.handler.IBypassHandler;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.holders.SkillHolder;
|
||||
|
||||
public class SupportMagic implements IBypassHandler
|
||||
{
|
||||
private static final String[] COMMANDS =
|
||||
{
|
||||
"supportmagicservitor",
|
||||
"supportmagic"
|
||||
};
|
||||
|
||||
// Buffs
|
||||
private static final SkillHolder HASTE_1 = new SkillHolder(4327, 1);
|
||||
private static final SkillHolder HASTE_2 = new SkillHolder(5632, 1);
|
||||
private static final SkillHolder CUBIC = new SkillHolder(4338, 1);
|
||||
private static final SkillHolder[] FIGHTER_BUFFS =
|
||||
{
|
||||
new SkillHolder(4322, 1), // Wind Walk
|
||||
new SkillHolder(4323, 1), // Shield
|
||||
new SkillHolder(5637, 1), // Magic Barrier
|
||||
new SkillHolder(4324, 1), // Bless the Body
|
||||
new SkillHolder(4325, 1), // Vampiric Rage
|
||||
new SkillHolder(4326, 1), // Regeneration
|
||||
};
|
||||
private static final SkillHolder[] MAGE_BUFFS =
|
||||
{
|
||||
new SkillHolder(4322, 1), // Wind Walk
|
||||
new SkillHolder(4323, 1), // Shield
|
||||
new SkillHolder(5637, 1), // Magic Barrier
|
||||
new SkillHolder(4328, 1), // Bless the Soul
|
||||
new SkillHolder(4329, 1), // Acumen
|
||||
new SkillHolder(4330, 1), // Concentration
|
||||
new SkillHolder(4331, 1), // Empower
|
||||
};
|
||||
private static final SkillHolder[] SUMMON_BUFFS =
|
||||
{
|
||||
new SkillHolder(4322, 1), // Wind Walk
|
||||
new SkillHolder(4323, 1), // Shield
|
||||
new SkillHolder(5637, 1), // Magic Barrier
|
||||
new SkillHolder(4324, 1), // Bless the Body
|
||||
new SkillHolder(4325, 1), // Vampiric Rage
|
||||
new SkillHolder(4326, 1), // Regeneration
|
||||
new SkillHolder(4328, 1), // Bless the Soul
|
||||
new SkillHolder(4329, 1), // Acumen
|
||||
new SkillHolder(4330, 1), // Concentration
|
||||
new SkillHolder(4331, 1), // Empower
|
||||
};
|
||||
|
||||
// Levels
|
||||
private static final int LOWEST_LEVEL = 6;
|
||||
private static final int HIGHEST_LEVEL = 40;
|
||||
private static final int CUBIC_LOWEST = 16;
|
||||
private static final int CUBIC_HIGHEST = 34;
|
||||
private static final int HASTE_LEVEL_2 = 40;
|
||||
|
||||
@Override
|
||||
public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
|
||||
{
|
||||
if (!target.isNpc() || activeChar.isCursedWeaponEquipped())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (command.equalsIgnoreCase(COMMANDS[0]))
|
||||
{
|
||||
makeSupportMagic(activeChar, (L2Npc) target, true);
|
||||
}
|
||||
else if (command.equalsIgnoreCase(COMMANDS[1]))
|
||||
{
|
||||
makeSupportMagic(activeChar, (L2Npc) target, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void makeSupportMagic(L2PcInstance player, L2Npc npc, boolean isSummon)
|
||||
{
|
||||
final int level = player.getLevel();
|
||||
if (isSummon && !player.hasServitors())
|
||||
{
|
||||
npc.showChatWindow(player, "html/default/SupportMagicNoSummon.htm");
|
||||
return;
|
||||
}
|
||||
else if (level > HIGHEST_LEVEL)
|
||||
{
|
||||
npc.showChatWindow(player, "html/default/SupportMagicHighLevel.htm");
|
||||
return;
|
||||
}
|
||||
else if (level < LOWEST_LEVEL)
|
||||
{
|
||||
npc.showChatWindow(player, "html/default/SupportMagicLowLevel.htm");
|
||||
return;
|
||||
}
|
||||
else if (player.getClassId().level() == 3)
|
||||
{
|
||||
player.sendMessage("Only adventurers who have not completed their 3rd class transfer may receive these buffs."); // Custom message
|
||||
return;
|
||||
}
|
||||
|
||||
if (isSummon)
|
||||
{
|
||||
npc.setTarget(player.getAnyServitor());
|
||||
for (SkillHolder skill : SUMMON_BUFFS)
|
||||
{
|
||||
npc.doCast(skill.getSkill());
|
||||
}
|
||||
|
||||
if (level >= HASTE_LEVEL_2)
|
||||
{
|
||||
npc.doCast(HASTE_2.getSkill());
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.doCast(HASTE_1.getSkill());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setTarget(player);
|
||||
if (player.isInCategory(CategoryType.BEGINNER_MAGE))
|
||||
{
|
||||
for (SkillHolder skill : MAGE_BUFFS)
|
||||
{
|
||||
npc.doCast(skill.getSkill());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (SkillHolder skill : FIGHTER_BUFFS)
|
||||
{
|
||||
npc.doCast(skill.getSkill());
|
||||
}
|
||||
|
||||
if (level >= HASTE_LEVEL_2)
|
||||
{
|
||||
npc.doCast(HASTE_2.getSkill());
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.doCast(HASTE_1.getSkill());
|
||||
}
|
||||
}
|
||||
|
||||
if ((level >= CUBIC_LOWEST) && (level <= CUBIC_HIGHEST))
|
||||
{
|
||||
player.doSimultaneousCast(CUBIC.getSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getBypassList()
|
||||
{
|
||||
return COMMANDS;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user