瘋天堂私服發佈網站廣告欄位!
瘋天堂私服發佈網站您最佳的選擇!
免費曝光天堂私服的方式!
害怕天堂私服倒閉嗎?快使用天堂分析師!
天堂私服抽獎扭蛋物品及機率測試器
天堂私服稱號顏色製造器
瘋天堂私服發佈網站教您註冊推文收藏私服!
天堂私服血量魔力計算器
瘋天堂私服發布網站廣告贊助及爆料私服客服
教您如何不用註冊也可以推文天堂私服!
天堂私服270怪物查詢掉落資料庫
天堂私服盟徽製造器
test0428
2014-11-15 12:36

天堂騎士魔法反震的java教學寫法!

[教學] 被動技能~反震
不知道是不是原創啦
小弟是新手剛學核心
因為小弟要創的服是走向變態版
所以就會作一些奇奇怪怪的技能囉
這次分享的技能叫做"反震"
適合給騎士使用
在騎士遭受物理傷害時有機率反暈到敵人
版本是1118
參考衝暈及冰之石的寫法
L1Attack.java
對玩家是暈0.3~1.5秒 對NPC是暈1~5秒
找到 public int calcPcPcDamage() {

找地方加入
//反震 by leolin310148
int oprate = (_targetPc.getLevel())/3-10; //機率依照等級來算
if (_targetPc.getInventory().checkItem(310071) && ((_random.nextInt(100) + 1) <= oprate)
&& _weaponType != 20){ //弓不會被反震
_targetPc.sendPackets(new S_SystemMessage("敵人被你堅硬的盔甲震盪"));
_pc.sendPackets(new S_SystemMessage("你被堅硬的盔甲震暈"));
L1Poison2 poison = new L1Poison2();
poison.handleCommands((L1Object) _pc, 4, 300, 0);

_pc.add_poison2(_pc.get_poison2());
L1EffectSpawn.getInstance()
.spawnEffect(81162, 300,
_pc.getX(), _pc.getY(), _pc.getMapId());}
else if (_targetPc.getInventory().checkItem(310072) && ((_random.nextInt(100) + 1) <= oprate)
&& _weaponType != 20){ //弓不會被反震
_targetPc.sendPackets(new S_SystemMessage("敵人被你堅硬的盔甲震盪"));
_pc.sendPackets(new S_SystemMessage("你被堅硬的盔甲震暈"));
L1Poison2 poison = new L1Poison2();
poison.handleCommands((L1Object) _pc, 4, 600, 0);

_pc.add_poison2(_pc.get_poison2());
L1EffectSpawn.getInstance()
.spawnEffect(81162, 600,
_pc.getX(), _pc.getY(), _pc.getMapId());}
else if (_targetPc.getInventory().checkItem(310073) && ((_random.nextInt(100) + 1) <= oprate)
&& _weaponType != 20){ //弓不會被反震
_targetPc.sendPackets(new S_SystemMessage("敵人被你堅硬的盔甲震盪"));
_pc.sendPackets(new S_SystemMessage("你被堅硬的盔甲震暈"));
L1Poison2 poison = new L1Poison2();
poison.handleCommands((L1Object) _pc, 4, 900, 0);

_pc.add_poison2(_pc.get_poison2());
L1EffectSpawn.getInstance()
.spawnEffect(81162, 900,
_pc.getX(), _pc.getY(), _pc.getMapId());}
else if (_targetPc.getInventory().checkItem(310074) && ((_random.nextInt(100) + 1) <= oprate)
&& _weaponType != 20){ //弓不會被反震
_targetPc.sendPackets(new S_SystemMessage("敵人被你堅硬的盔甲震盪"));
_pc.sendPackets(new S_SystemMessage("你被堅硬的盔甲震暈"));
L1Poison2 poison = new L1Poison2();
poison.handleCommands((L1Object) _pc, 4, 1200, 0);

_pc.add_poison2(_pc.get_poison2());
L1EffectSpawn.getInstance()
.spawnEffect(81162, 1200,
_pc.getX(), _pc.getY(), _pc.getMapId());}
else if (_targetPc.getInventory().checkItem(310075) && ((_random.nextInt(100) + 1) <= oprate)
&& _weaponType != 20){ //弓不會被反震
_targetPc.sendPackets(new S_SystemMessage("敵人被你堅硬的盔甲震盪"));
_pc.sendPackets(new S_SystemMessage("你被堅硬的盔甲震暈"));
L1Poison2 poison = new L1Poison2();
poison.handleCommands((L1Object) _pc, 4, 1500, 0);

_pc.add_poison2(_pc.get_poison2());
L1EffectSpawn.getInstance()
.spawnEffect(81162, 1500,
_pc.getX(), _pc.getY(), _pc.getMapId());}


//反震END

在找到
private int calcNpcPcDamage() {
找地方加入

// 反震 by leolin310148
int oprate = (_targetPc.getLevel())/3;
if (_targetPc.getInventory().checkItem(310071) && ((_random.nextInt(100) + 1) <= oprate)){
_targetPc.sendPackets(new S_SystemMessage("敵人被你堅硬的盔甲震盪"));
L1Poison2 poison = new L1Poison2();
poison.handleCommands((L1Object) _npc, 4, 1000, 0);

_npc.add_poison2(_npc.get_poison2());
L1EffectSpawn.getInstance()
.spawnEffect(81162, 1000,
_npc.getX(), _npc.getY(), _npc.getMapId());}
else if (_targetPc.getInventory().checkItem(310072) && ((_random.nextInt(100) + 1) <= oprate)){
_targetPc.sendPackets(new S_SystemMessage("敵人被你堅硬的盔甲震盪"));
L1Poison2 poison = new L1Poison2();
poison.handleCommands((L1Object) _npc, 4, 2000, 0);

_npc.add_poison2(_npc.get_poison2());
L1EffectSpawn.getInstance()
.spawnEffect(81162, 2000,
_npc.getX(), _npc.getY(), _npc.getMapId());}
else if (_targetPc.getInventory().checkItem(310073) && ((_random.nextInt(100) + 1) <= oprate)){
_targetPc.sendPackets(new S_SystemMessage("敵人被你堅硬的盔甲震盪"));
L1Poison2 poison = new L1Poison2();
poison.handleCommands((L1Object) _npc, 4, 3000, 0);

_npc.add_poison2(_npc.get_poison2());
L1EffectSpawn.getInstance()
.spawnEffect(81162, 3000,
_npc.getX(), _npc.getY(), _npc.getMapId());}
else if (_targetPc.getInventory().checkItem(310074) && ((_random.nextInt(100) + 1) <= oprate)){
_targetPc.sendPackets(new S_SystemMessage("敵人被你堅硬的盔甲震盪"));
L1Poison2 poison = new L1Poison2();
poison.handleCommands((L1Object) _npc, 4, 4000, 0);
_npc.add_poison2(_npc.get_poison2());
L1EffectSpawn.getInstance()
.spawnEffect(81162, 4000,
_npc.getX(), _npc.getY(), _npc.getMapId());}
else if (_targetPc.getInventory().checkItem(310075) && ((_random.nextInt(100) + 1) <= oprate)){
_targetPc.sendPackets(new S_SystemMessage("敵人被你堅硬的盔甲震盪"));
L1Poison2 poison = new L1Poison2();
poison.handleCommands((L1Object) _npc, 4, 5000, 0);
_npc.add_poison2(_npc.get_poison2());
L1EffectSpawn.getInstance()
.spawnEffect(81162, 5000,
_npc.getX(), _npc.getY(), _npc.getMapId());}


//反震END


最後到DB的ectitem新增
310071 被動:反震LV1 被動:反震LV1 other normal mineral 0 3119 22 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1
310072 被動:反震LV2 被動:反震LV2 other normal mineral 0 3119 22 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1
310073 被動:反震LV3 被動:反震LV3 other normal mineral 0 3119 22 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1
310074 被動:反震LV4 被動:反震LV4 other normal mineral 0 3119 22 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1
310075 被動:反震LV5 被動:反震LV5 other normal mineral 0 3119 22 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1

就完成啦


感謝觀賞
如果寫法有可以改進的地方以及有侵犯著作權的地方
麻煩告知
感謝您



上一篇文章:天堂小遊戲猜數字的java教學寫法!
下一篇文章:天堂玩家間交易公告的java教學寫法!

分享文章:分享到微博! 分享到臉書! 分享到噗浪! 分享到維特! 分享到Google+! 分享到LINE!