Ir para conteúdo
  • Cadastre-se
  • 0

MOD NPC HITIMAN L2JFROZEN ALGUEM ?


ADMMAX

Pergunta

ESTOU COM COM CODIGO ALGUÉM PODERIA PASSAR PARA L2JFROZEN?

 

 

 

 

 

### Eclipse Workspace Patch 1.0

#P L2J_Server
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 5667)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -302,6 +313,96 @@
*/
public final class L2PcInstance extends L2Playable
{

+ public boolean _hitman = false;

+ public void setHitman(boolean h)
+ {
+
+ _hitman = h;
+ }
+
+ public boolean isHitman()
+ {
+ return _hitman;
+ }
+
@@ -5814,6 +6019,17 @@
public boolean doDie(L2Character killer)
{
// Kill the L2PcInstance
+ if (isHitman())
+ {
+ L2PcInstance killer1 = killer.getActingPlayer();
+ Hitman event = new Hitman();
+ event.rewardWinner(killer1);
+ event.annoucneWinner(killer1);
+ setHitman(false);
+
+ event.state = event.state.INACTIVE;
+ event.clear();
+ }
if (!super.doDie(killer))
{
return false;
Index: java/com/l2jserver/gameserver/model/entity/Hitman.java
===================================================================
--- java/com/l2jserver/gameserver/model/entity/Hitman.java (revision 0)
+++ java/com/l2jserver/gameserver/model/entity/Hitman.java (revision 0)
@@ -0,0 +1,159 @@
+/* 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.
+ *
+ *

O conteúdo está oculto, favor efetuar login ou se cadastrar!

+ */
+package com.l2jserver.gameserver.model.entity;
+
+import javolution.util.FastList;
+
+import com.l2jserver.gameserver.Announcements;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.util.Rnd;
+
+/**
+ * @author Marwan
+ */

+public class Hitman
+{
+ @SuppressWarnings("unused")
+ public static FastList<L2PcInstance> _players = new FastList<L2PcInstance>();
+ public static L2PcInstance chossenPlayer = null;
+
+ public static enum State
+ {
+ INACTIVE,
+ ACTIVE
+ }
+
+ public static State state = State.INACTIVE;
+
+ public class Start implements Runnable
+ {
+ @Override
+ public void run()
+ {
+ startEvent();
+ }
+ }
+
+ public void startEvent()
+ {
+ Announcements.getInstance().announceToAll("Hitman event started.");
+ Announcements.getInstance().announceToAll("Player will be chossen in 30 seconds to be the hitman.");
+ pickplayer();
+ waitSecs(30);
+ announce();
+ chosse(chossenPlayer);
+
+ if (state == State.ACTIVE)
+ {
+ Announcements.getInstance().announceToAll("Hitman Event will end in 5 minutes.");
+ wait(4);
+
+ Announcements.getInstance().announceToAll("Hitman Event will end in 1 minutes.");
+ wait(1);
+ end();
+ }
+
+ }
+
+ public void pickplayer()
+ {
+ state = State.ACTIVE;
+ chossenPlayer = _players.get(Rnd.get(0, _players.size() - 1));
+ }
+
+ public void end()
+ {
+ Announcements.getInstance().announceToAll("No one killed the Hitman");
+ Announcements.getInstance().announceToAll("Hitman event has end");
+ _players.clear();
+
+ }
+
+ public void announce()
+ {
+ Announcements.getInstance().announceToAll("Player :" + chossenPlayer.getName() + " has been chossen");
+ Announcements.getInstance().announceToAll("The first who kills him wil be rewarded");
+ Announcements.getInstance().announceToAll("Event will end in 10 minutes.");
+ }
+
+ public void chosse(L2PcInstance pl)
+ {
+ pl.setHitman(true);
+ pl.setTitle("HitMan Target");
+ pl.getAppearance().setTitleColor(255, 0, 0);
+ }
+
+ public void rewardWinner(L2PcInstance a)
+ {
+
+ a.addItem("hitman", 57, 10000, a, false);
+
+ }
+
+ public void annoucneWinner(L2PcInstance a)
+ {
+
+ Announcements.getInstance().announceToAll(a.getName() + " has won Hitman Event");
+
+ }
+
+ public void clear()
+ {
+ _players.clear();
+ }
+
+ public void waitSecs(int i)
+ {
+ try
+ {
+ Thread.sleep(i * 1000);
+ }
+ catch (InterruptedException ie)
+ {
+ ie.printStackTrace();
+ }
+ }
+
+ public void wait(int i)
+ {
+ try
+ {
+ Thread.sleep(i * 60000);
+ }
+ catch (InterruptedException ie)
+ {
+ ie.printStackTrace();
+ }
+ }
+
+ public Hitman()
+ {
+ // ThreadPoolManager.getInstance().scheduleAiAtFixedRate(new Start(), 600000, 600000);
+ }
+
+ public static Hitman getInstance()
+ {
+ return SingletonHolder._instance;
+ }
+
+ private static class SingletonHolder
+ {
+ @SuppressWarnings("synthetic-access")
+ protected static final Hitman _instance = new Hitman();
+ }
+}

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts recomendados


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.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Processando...
  • Registre-se

    Faça parte da maior e  mais antigas comunidades sobre Lineage2 da América Latina.





×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.