📄 l1skilltimer.java
字号:
/*
* 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 2, 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package l1j.server.server.model.skill;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import java.util.logging.Logger;
import l1j.server.server.GeneralThreadPool;
import l1j.server.server.datatables.SkillsTable;
import l1j.server.Config;
import l1j.server.server.model.L1World;
import l1j.server.server.model.L1Inventory;
import l1j.server.server.model.L1Character;
import l1j.server.server.model.L1PolyMorph;
import l1j.server.server.model.Instance.L1MonsterInstance;
import l1j.server.server.model.Instance.L1NpcInstance;
import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.model.Instance.L1PetInstance;
import l1j.server.server.model.Instance.L1SummonInstance;
import l1j.server.server.model.Instance.L1ItemInstance;
import l1j.server.server.datatables.ItemTable;
import l1j.server.server.serverpackets.S_CurseBlind;
import l1j.server.server.serverpackets.S_Dexup;
import l1j.server.server.serverpackets.S_HPUpdate;
import l1j.server.server.serverpackets.S_MPUpdate;
import l1j.server.server.serverpackets.S_OwnCharAttrDef;
import l1j.server.server.serverpackets.S_OwnCharStatus;
import l1j.server.server.serverpackets.S_PacketBox;
import l1j.server.server.serverpackets.S_Paralysis;
import l1j.server.server.serverpackets.S_Poison;
import l1j.server.server.serverpackets.S_SPMR;
import l1j.server.server.serverpackets.S_ServerMessage;
import l1j.server.server.serverpackets.S_SystemMessage;
import l1j.server.server.serverpackets.S_SkillBrave;
import l1j.server.server.serverpackets.S_SkillHaste;
import l1j.server.server.serverpackets.S_SkillIconAura;
import l1j.server.server.serverpackets.S_SkillIconBlessOfEva;
import l1j.server.server.serverpackets.S_SkillIconShield;
import l1j.server.server.serverpackets.S_SkillIconWindShackle;
import l1j.server.server.serverpackets.S_SkillIconWisdomPotion;
import l1j.server.server.serverpackets.S_SkillSound;
import l1j.server.server.serverpackets.S_Strup;
import l1j.server.server.templates.L1Skills;
import static l1j.server.server.model.skill.L1SkillId.*;
public interface L1SkillTimer {
public int getRemainingTime();
public void begin();
public void end();
public void kill();
}
/*
* XXX 2008/02/13 vala 本来、このクラスはあるべきではないが暫定処置。
*/
class L1SkillStop {
private static l1j.eric.EricLogger _log = l1j.eric.EricLogger.getLogger2(L1SkillStop.class
.getName());
public static void stopSkill(L1Character cha, int skillId) {
if (skillId == LIGHT) { // ライト
if (cha instanceof L1PcInstance) {
if (!cha.isInvisble()) {
L1PcInstance pc = (L1PcInstance) cha;
pc.turnOnOffLight();
}
}
} else if (skillId == GLOWING_AURA) { // グローウィング オーラ
cha.addHitup(-5);
cha.addBowHitup(-5);
cha.addMr(-20);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SPMR(pc));
pc.sendPackets(new S_SkillIconAura(113, 0));
}
} else if (skillId == SHINING_AURA) { // シャイニング オーラ
cha.addAc(8);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillIconAura(114, 0));
}
} else if (skillId == BRAVE_AURA) { // ブレイブ オーラ
cha.addDmgup(-5);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillIconAura(116, 0));
}
} else if (skillId == SHIELD) { // シールド
cha.addAc(2);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillIconShield(5, 0));
}
} else if (skillId == BLIND_HIDING) { // ブラインドハイディング
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.delBlindHiding();
}
} else if (skillId == SHADOW_ARMOR) { // シャドウ アーマー
cha.addAc(3);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillIconShield(3, 0));
}
} else if (skillId == DRESS_DEXTERITY) { // ドレス デクスタリティー
cha.addDex((byte) -2);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_Dexup(pc, 2, 0));
}
} else if (skillId == DRESS_MIGHTY) { // ドレス マイティー
cha.addStr((byte) -2);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_Strup(pc, 2, 0));
}
} else if (skillId == SHADOW_FANG) { // シャドウ ファング
cha.addDmgup(-5);
} else if (skillId == ENCHANT_WEAPON) { // エンチャント ウェポン
cha.addDmgup(-2);
} else if (skillId == BLESSED_ARMOR) { // ブレスド アーマー
cha.addAc(3);
} else if (skillId == EARTH_BLESS) { // アース ブレス
cha.addAc(7);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillIconShield(7, 0));
}
} else if (skillId == RESIST_MAGIC) { // レジスト マジック
cha.addMr(-10);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SPMR(pc));
}
} else if (skillId == CLEAR_MIND) { // クリアー マインド
cha.addWis((byte) -3);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.resetBaseMr();
}
} else if (skillId == RESIST_ELEMENTAL) { // レジスト エレメント
cha.addWind(-10);
cha.addWater(-10);
cha.addFire(-10);
cha.addEarth(-10);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_OwnCharAttrDef(pc));
}
} else if (skillId == ELEMENTAL_PROTECTION) { // エレメンタルプロテクション
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
int attr = pc.getElfAttr();
if (attr == 1) {
cha.addEarth(-50);
} else if (attr == 2) {
cha.addFire(-50);
} else if (attr == 4) {
cha.addWater(-50);
} else if (attr == 8) {
cha.addWind(-50);
}
pc.sendPackets(new S_OwnCharAttrDef(pc));
}
} else if (skillId == ELEMENTAL_FALL_DOWN) { // エレメンタルフォールダウン
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
int attr = pc.getAddAttrKind();
int i = 50;
switch (attr) {
case 1:
pc.addEarth(i);
break;
case 2:
pc.addFire(i);
break;
case 4:
pc.addWater(i);
break;
case 8:
pc.addWind(i);
break;
default:
break;
}
pc.setAddAttrKind(0);
pc.sendPackets(new S_OwnCharAttrDef(pc));
} else if (cha instanceof L1NpcInstance) {
L1NpcInstance npc = (L1NpcInstance) cha;
int attr = npc.getAddAttrKind();
int i = 50;
switch (attr) {
case 1:
npc.addEarth(i);
break;
case 2:
npc.addFire(i);
break;
case 4:
npc.addWater(i);
break;
case 8:
npc.addWind(i);
break;
default:
break;
}
npc.setAddAttrKind(0);
}
} else if (skillId == IRON_SKIN) { // アイアン スキン
cha.addAc(10);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillIconShield(10, 0));
}
} else if (skillId == EARTH_SKIN) { // アース スキン
cha.addAc(6);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillIconShield(6, 0));
}
} else if (skillId == PHYSICAL_ENCHANT_STR) { // フィジカル エンチャント:STR
cha.addStr((byte) -5);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_Strup(pc, 5, 0));
}
} else if (skillId == PHYSICAL_ENCHANT_DEX) { // フィジカル エンチャント:DEX
cha.addDex((byte) -5);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_Dexup(pc, 5, 0));
}
} else if (skillId == FIRE_WEAPON) { // ファイアー ウェポン
cha.addDmgup(-4);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillIconAura(147, 0));
}
} else if (skillId == FIRE_BLESS) { // ファイアー ブレス
cha.addDmgup(-4);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillIconAura(154, 0));
}
} else if (skillId == BURNING_WEAPON) { // バーニング ウェポン
cha.addDmgup(-6);
cha.addHitup(-3);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillIconAura(162, 0));
}
} else if (skillId == BLESS_WEAPON) { // ブレス ウェポン
cha.addDmgup(-2);
cha.addHitup(-2);
cha.addBowHitup(-2);
} else if (skillId == WIND_SHOT) { // ウィンド ショット
cha.addBowHitup(-6);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillIconAura(148, 0));
}
} else if (skillId == STORM_EYE) { // ストーム アイ
cha.addBowHitup(-2);
cha.addBowDmgup(-3);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillIconAura(155, 0));
}
} else if (skillId == STORM_SHOT) { // ストーム ショット
cha.addBowDmgup(-5);
cha.addBowHitup(1);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -