Newbie support magic.
This commit is contained in:
parent
a73980a5a5
commit
a624facd9a
6
L2J_Mobius_Classic/dist/game/data/html/default/BlessingOfProtection.htm
vendored
Normal file
6
L2J_Mobius_Classic/dist/game/data/html/default/BlessingOfProtection.htm
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Guide:<br>
|
||||
The Blessing of Protection is available to <font color="LEVEL">characters under level 39 who have not completed</font> their second class transfer.<br>
|
||||
Protected by its power, <font color="LEVEL">you cannot receive damage from (or inflict damage to)</font> chaotic characters who are 10+ levels above you. It will not protect you on the battlefield, however.<br>
|
||||
Would you like to receive the Blessing of Protection now?<br>
|
||||
<a action="bypass -h npc_%objectId%_GiveBlessing">Say yes.</a>
|
||||
</body></html>
|
3
L2J_Mobius_Classic/dist/game/data/html/default/SupportBlessingHighLevel.htm
vendored
Normal file
3
L2J_Mobius_Classic/dist/game/data/html/default/SupportBlessingHighLevel.htm
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
<html><body>Newbie Guide:<br>
|
||||
I'm sorry, but you are not eligible to receive the Blessing of Protection. Only adventurers who are <font color="LEVEL">level 39 or lower, and who have not completed their 2nd class transfer</font> may receive this buff.
|
||||
</body></html>
|
12
L2J_Mobius_Classic/dist/game/data/html/default/SupportMagic.htm
vendored
Normal file
12
L2J_Mobius_Classic/dist/game/data/html/default/SupportMagic.htm
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<html><body>
|
||||
You are eligible to receive the following supplemental magic:<br>
|
||||
Levels 6-75: Wind Walk<br1>
|
||||
Levels 6-75: Shield<br1>
|
||||
Levels 6-75: Magic Barrier<br1>
|
||||
Levels 6-75: Bless the Body (Fighter), Bless the Soul (Wizard)<br1>
|
||||
Levels 6-75: Vampiric Rage (Fighter), Acumen (Wizard)<br1>
|
||||
Levels 6-75: Regeneration (Fighter), Concentration (Wizard)<br1>
|
||||
Levels 6-75: Haste (effect increases after level 40), Empower (Wizard)<br1>
|
||||
Levels 16-34: Life Cubic<br>
|
||||
<a action="bypass -h npc_%objectId%_SupportMagic">Receive supplemental magic.</a>
|
||||
</body></html>
|
3
L2J_Mobius_Classic/dist/game/data/html/default/SupportMagicHighLevel.htm
vendored
Normal file
3
L2J_Mobius_Classic/dist/game/data/html/default/SupportMagicHighLevel.htm
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
<html><body>
|
||||
Support magic is only available for characters who are <font color="LEVEL">level 75 or below</font>.
|
||||
</body></html>
|
3
L2J_Mobius_Classic/dist/game/data/html/default/SupportMagicLowLevel.htm
vendored
Normal file
3
L2J_Mobius_Classic/dist/game/data/html/default/SupportMagicLowLevel.htm
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
<html><body>Newbie Guide:<br>
|
||||
You do not yet require Support Magic. Come see me again when you reach level 6.
|
||||
</body></html>
|
3
L2J_Mobius_Classic/dist/game/data/html/default/SupportMagicNoSummon.htm
vendored
Normal file
3
L2J_Mobius_Classic/dist/game/data/html/default/SupportMagicNoSummon.htm
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
<html><body>
|
||||
Only servitors can receive this Support Magic. If you do not have a servitor, you cannot access these spells.
|
||||
</body></html>
|
6
L2J_Mobius_Classic/dist/game/data/html/default/SupportMagicServitor.htm
vendored
Normal file
6
L2J_Mobius_Classic/dist/game/data/html/default/SupportMagicServitor.htm
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
<html><body>
|
||||
Your servitor is eligible to receive the supplemental magic listed below. These spells do not benefit pets.<br>
|
||||
Eligibility is determined by the master's level.<br>
|
||||
Levels 6-75: Wind Walk, Shield, Magic Barrier, Bless the Body, Bless the Soul, Vampiric Rage, Acumen, Regeneration, Concentration, Haste (increased effect after level 40), Empower<br>
|
||||
<a action="bypass -h npc_%objectId%_SupportMagicServitor">Receive supplemental magic for servitor.</a>
|
||||
</body></html>
|
@ -150,6 +150,8 @@ import handlers.bypasshandlers.PrivateWarehouse;
|
||||
import handlers.bypasshandlers.QuestLink;
|
||||
import handlers.bypasshandlers.ReleaseAttribute;
|
||||
import handlers.bypasshandlers.SkillList;
|
||||
import handlers.bypasshandlers.SupportBlessing;
|
||||
import handlers.bypasshandlers.SupportMagic;
|
||||
import handlers.bypasshandlers.TerritoryStatus;
|
||||
import handlers.bypasshandlers.TutorialClose;
|
||||
import handlers.bypasshandlers.VoiceCommand;
|
||||
@ -455,6 +457,8 @@ public class MasterHandler
|
||||
PrivateWarehouse.class,
|
||||
ReleaseAttribute.class,
|
||||
SkillList.class,
|
||||
SupportBlessing.class,
|
||||
SupportMagic.class,
|
||||
TerritoryStatus.class,
|
||||
TutorialClose.class,
|
||||
VoiceCommand.class,
|
||||
|
59
L2J_Mobius_Classic/dist/game/data/scripts/handlers/bypasshandlers/SupportBlessing.java
vendored
Normal file
59
L2J_Mobius_Classic/dist/game/data/scripts/handlers/bypasshandlers/SupportBlessing.java
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 handlers.bypasshandlers;
|
||||
|
||||
import com.l2jmobius.gameserver.handler.IBypassHandler;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.CommonSkill;
|
||||
import com.l2jmobius.gameserver.model.skills.SkillCaster;
|
||||
|
||||
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, "data/html/default/SupportBlessingHighLevel.htm");
|
||||
return true;
|
||||
}
|
||||
npc.setTarget(activeChar);
|
||||
SkillCaster.triggerCast(npc, activeChar, CommonSkill.BLESSING_OF_PROTECTION.getSkill());
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getBypassList()
|
||||
{
|
||||
return COMMANDS;
|
||||
}
|
||||
}
|
182
L2J_Mobius_Classic/dist/game/data/scripts/handlers/bypasshandlers/SupportMagic.java
vendored
Normal file
182
L2J_Mobius_Classic/dist/game/data/scripts/handlers/bypasshandlers/SupportMagic.java
vendored
Normal file
@ -0,0 +1,182 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 handlers.bypasshandlers;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.CategoryType;
|
||||
import com.l2jmobius.gameserver.handler.IBypassHandler;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import com.l2jmobius.gameserver.model.skills.SkillCaster;
|
||||
|
||||
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 = 75;
|
||||
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, "data/html/default/SupportMagicNoSummon.htm");
|
||||
return;
|
||||
}
|
||||
else if (level > HIGHEST_LEVEL)
|
||||
{
|
||||
npc.showChatWindow(player, "data/html/default/SupportMagicHighLevel.htm");
|
||||
return;
|
||||
}
|
||||
else if (level < LOWEST_LEVEL)
|
||||
{
|
||||
npc.showChatWindow(player, "data/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)
|
||||
{
|
||||
for (L2Summon s : player.getServitors().values())
|
||||
{
|
||||
npc.setTarget(s);
|
||||
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))
|
||||
{
|
||||
SkillCaster.triggerCast(npc, player, CUBIC.getSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getBypassList()
|
||||
{
|
||||
return COMMANDS;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user