/*
* Copyright (C) 2004-2013 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 custom.NpcBufferGod;/**
* @autor: fissban
*/import java.util.Collection;import ai.npc.AbstractNpcAI;import com.l2jserver.gameserver.ThreadPoolManager;import com.l2jserver.gameserver.datatables.SkillTable;import com.l2jserver.gameserver.model.Location;import com.l2jserver.gameserver.model.actor.L2Npc;import com.l2jserver.gameserver.model.actor.L2Summon;import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;import com.l2jserver.gameserver.model.base.ClassId;import com.l2jserver.gameserver.model.holders.SkillHolder;import com.l2jserver.gameserver.model.skills.L2Skill;publicclassNpcBufferGOD extends AbstractNpcAI{// NPCprivatestatic final intNewbie_Helper=32327;// Spawn stateprivatestatic boolean SPAWNED =false;static final Location[] SPAWNS ={// Sacado de la DBnewLocation(17136,144896,-3008,26624),newLocation(43556,-47608,-792,36864),newLocation(82385,53283,-1488,16384),newLocation(82879,149380,-3469,34120),newLocation(87152,-141328,-1336,49296),newLocation(111168,221008,-3544,0),newLocation(116935,77258,-2688,40960),newLocation(147099,25939,-2008,49151),newLocation(148077,-55367,-2728,32768),newLocation(-84081,243227,-3728,9000),newLocation(115632,-177996,-896,32768),newLocation(-45032,-113598,-192,32768),newLocation(12111,16686,-4584,63240),newLocation(45475,48359,-3056,49152),newLocation(-119692,44504,360,33324),newLocation(-13920,121977,-2984,33000),newLocation(-83123,150868,-3120,0),};protectedNpcBufferGOD(String name,String descr){
super(name, descr);
addStartNpc(Newbie_Helper);
addSpawnId(Newbie_Helper);
addTalkId(Newbie_Helper);if(!SPAWNED){for(Location spawn : SPAWNS){
addSpawn(Newbie_Helper, spawn,false,0);}
SPAWNED =true;}}@OverridepublicString onSpawn(L2Npc npc){ThreadPoolManager.getInstance().scheduleGeneral(newBufferAI(npc),5000);return super.onSpawn(npc);}@OverridepublicString onTalk(L2Npc npc, L2PcInstance player){return"32327.htm";}protectedclassBufferAI implements Runnable{private final L2Npc _npc;// Skillsprivate final SkillHolder HASTE_1 =newSkillHolder(4327,1);private final SkillHolder HASTE_2 =newSkillHolder(5632,1);private final SkillHolder CUBIC =newSkillHolder(4338,1);private final SkillHolder[] FIGHTER_BUFFS ={newSkillHolder(4322,1),// Wind WalknewSkillHolder(4323,1),// ShieldnewSkillHolder(5637,1),// Magic BarriernewSkillHolder(4324,1),// Bless the BodynewSkillHolder(4325,1),// Vampiric RagenewSkillHolder(4326,1),// Regeneration};private final SkillHolder[] MAGE_BUFFS ={newSkillHolder(4322,1),// Wind WalknewSkillHolder(4323,1),// ShieldnewSkillHolder(5637,1),// Magic BarriernewSkillHolder(4328,1),// Bless the SoulnewSkillHolder(4329,1),// AcumennewSkillHolder(4330,1),// ConcentrationnewSkillHolder(4331,1),// Empower};private final SkillHolder[] SUMMON_BUFFS ={newSkillHolder(4322,1),// Wind WalknewSkillHolder(4323,1),// ShieldnewSkillHolder(5637,1),// Magic BarriernewSkillHolder(4324,1),// Bless the BodynewSkillHolder(4325,1),// Vampiric RagenewSkillHolder(4326,1),// RegenerationnewSkillHolder(4328,1),// Bless the SoulnewSkillHolder(4329,1),// AcumennewSkillHolder(4330,1),// ConcentrationnewSkillHolder(4331,1),// Empower};protectedBufferAI(L2Npc caster){
_npc = caster;}@Overridepublicvoid run(){if((_npc == null)||!_npc.isVisible()){return;}Collection<L2PcInstance> plrs = _npc.getKnownList().getKnownPlayers().values();for(L2PcInstance player : plrs){if((player == null)|| player.isInvul()|| player.isDead()||(player.getLevel()>75)||(player.getLevel()<6)|| player.isCursedWeaponEquipped()||(player.getKarma()!=0)||!_npc.isInsideRadius(player,500,false,false)){continue;}// summonsif((player.getSummon()!= null)&& player.getSummon().isServitor()){for(SkillHolder skills : SUMMON_BUFFS){CastSummon(player.getSummon(), skills.getSkill());}if(player.getLevel()>40){CastSummon(player.getSummon(), HASTE_2.getSkill());}else{CastSummon(player.getSummon(), HASTE_1.getSkill());}}// magosif(player.isMageClass()&&(player.getClassId()!=ClassId.overlord)&&(player.getClassId()!=ClassId.warcryer)){for(SkillHolder skills : MAGE_BUFFS){CastPlayer(player, skills.getSkill());}}// warrioselse{for(SkillHolder skills : FIGHTER_BUFFS){CastPlayer(player, skills.getSkill());}if(player.getLevel()>40){CastPlayer(player, HASTE_2.getSkill());}else{CastPlayer(player, HASTE_1.getSkill());}}if((player.getLevel()>=16)&&(player.getLevel()<=34)){
player.doSimultaneousCast(CUBIC.getSkill());}}ThreadPoolManager.getInstance().scheduleGeneral(this,3000);}// metodo para los playersprivate boolean CastPlayer(L2PcInstance player, L2Skill skill){if(player.getFirstEffect(skill)== null){
skill.getEffects(_npc, player);SkillTable.getInstance().getInfo(skill.getId(), skill.getLevel()).getEffects(player, player);returntrue;}returnfalse;}// metodo para los summonsprivate boolean CastSummon(L2Summon summon, L2Skill skill){if(summon.getFirstEffect(skill)== null){
skill.getEffects(_npc, summon);SkillTable.getInstance().getInfo(skill.getId(), skill.getLevel()).getEffects(summon, summon);returntrue;}returnfalse;}}publicstaticvoid main(String[] args){newNpcBufferGOD(NpcBufferGOD.class.getSimpleName(),"ai/npc");}}
author code : fissban
hello I need help to adapt this code to interlude l2jfrozen or l2jacis thank you very much anyway
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
I apologize for my incompetence. The ability to trade is limited only for builder 1. Ordinary characters can trade with each other, and this has nothing to do with auto loot.)
Question
tensador27
author code : fissban
hello I need help to adapt this code to interlude l2jfrozen or l2jacis thank you very much anyway
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.