瘋天堂私服發佈網站廣告欄位!
害怕天堂私服倒閉嗎?快使用天堂分析師!
天堂私服抽獎扭蛋物品及機率測試器
天堂私服稱號顏色製造器
瘋天堂私服發佈網站教您註冊推文收藏私服!
天堂私服血量魔力計算器
瘋天堂私服發布網站廣告贊助及爆料私服客服
教您如何不用註冊也可以推文天堂私服!
天堂私服270怪物查詢掉落資料庫
天堂私服盟徽製造器
test0428
2009-02-21 17:50

天堂集體加速卷軸的java寫法!

C_ItemUSe

}else if(itemId == 60041){//集體魔法卷軸:集體加速卷軸(測試)
useMassSkillEffect(pc,300,755,1,true,true);
pc.getInventory().removeItem(l1iteminstance, 1);

複製代碼

//集體魔法卷軸:集體加速卷軸 by13630020
private void useMassSkillEffect(L1PcInstance player, int time, int castgfx, int moveSet, boolean isPc, boolean isNpc) {
List<L1PcInstance> targetPc = L1World.getInstance().getVisiblePlayer(player);
List<L1Object> targetNpc = L1World.getInstance().getVisibleObjects(player);
boolean isAgree = false;
for (L1Object tgobj : targetNpc) {//對寵物或召喚
if (tgobj instanceof L1SummonInstance
|| tgobj instanceof L1PetInstance) {
isAgree=true;
}
if(isAgree){
if(isNpc){//是否給寵物或召喚
L1NpcInstance npc = (L1NpcInstance) tgobj;
if((npc instanceof L1SummonInstance || npc instanceof L1PetInstance)
&& npc.getMaster() == player){
npc.broadcastPacket(new S_SkillSound(npc.getId(), castgfx));
npc.setMoveSpeed(moveSet);
npc.setSkillEffect(STATUS_HASTE, time * 1000);
}
}
}
}
for (L1PcInstance pc : targetPc) {
if (pc.getClanid() == player.getClanid()
|| pc.getPartyID() == player.getPartyID()) {//對同盟或組隊成員
isAgree=true;
}
if(isAgree){
if(isPc){
if (pc.getClanid() == player.getClanid()
|| pc.getPartyID() == player.getPartyID()) {//是否給同盟或組隊成員
pc.sendPackets(new S_SkillSound(pc.getId(), castgfx));
pc.broadcastPacket(new S_SkillSound(pc.getId(), castgfx));
pc.sendPackets(new S_SkillHaste(pc.getId(), 1, time));
pc.broadcastPacket(new S_SkillHaste(pc.getId(), 1, 0));
pc.setMoveSpeed(moveSet);
pc.setSkillEffect(STATUS_HASTE, time * 1000);
pc.sendPackets(new S_ServerMessage(183));//\f1你的腿得到新的能量。
}
}
}
}
//最後也必須給自己效果
player.broadcastPacket(new S_SkillSound(player.getId(), castgfx));
player.sendPackets(new S_SkillSound(player.getId(), castgfx));
player.sendPackets(new S_SkillHaste(player.getId(), 1, time));
player.broadcastPacket(new S_SkillHaste(player.getId(), 1, 0));
player.setMoveSpeed(moveSet);
player.setSkillEffect(STATUS_HASTE, time * 1000);
player.sendPackets(new S_ServerMessage(183));//\f1你的腿得到新的能量。
//使用者施法動作(19)
player.sendPackets(new S_DoActionGFX(player.getId(),ActionCodes.ACTION_SkillBuff));
player.broadcastPacket(new S_DoActionGFX(player.getId(),ActionCodes.ACTION_SkillBuff));
}
// end

複製代碼


簡介一下

useMassSkillEffect{player<使用者>

,time<時間(t秒)>

,castgfx<圖檔>

,moveSet<速度值:1(加速)2(緩速XD)>

,isPc<是否給同伴true/false>

,isNpc<是否給召寵true/false>}

這樣就完成囉^^!!



上一篇文章:天堂寵物競賽的java寫法!
下一篇文章:天堂如何讓伺服器減少LAG的方法!

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