Noticias:

No tienes permiso para ver los enlaces. Para poder verlos Registrate o Conectate.

Menú Principal

NPC Recomendaciones (netvirus)

Iniciado por Swarlog, Jul 24, 2025, 10:50 PM

Tema anterior - Siguiente tema

Swarlog

### Eclipse Workspace Patch 1.0
#P L2J_DataPack_BETA
Index: dist/game/data/scripts/ai/npc/RecNpc/100001-02.html
===================================================================
--- dist/game/data/scripts/ai/npc/RecNpc/100001-02.html  (revision 0)
+++ dist/game/data/scripts/ai/npc/RecNpc/100001-02.html    (working copy)
@@ -0,0 +1,4 @@
+<html><body>Your NPC name:<br>
+In your bad I would do that ?<br>
+You didn't give me a chance!
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/RecNpc/100001.html
===================================================================
--- dist/game/data/scripts/ai/npc/RecNpc/100001.html    (revision 0)
+++ dist/game/data/scripts/ai/npc/RecNpc/100001.html    (working copy)
@@ -0,0 +1,5 @@
+<html><body>Your NPC name:<br>
+Hi, I can give you a full recommendation. If you need...<br>
+<a action="bypass -h Quest RecNpc get">Ok, give me.</a>
+<a action="bypass -h Quest RecNpc quit">No. Thanks.</a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/RecNpc/RecNpc.java
===================================================================
--- dist/game/data/scripts/ai/npc/RecNpc/RecNpc.java    (revision 0)
+++ dist/game/data/scripts/ai/npc/RecNpc/RecNpc.java    (working copy)
@@ -0,0 +1,70 @@
+/*
+ * 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 ai.npc.RecNpc;
+
+import ai.npc.AbstractNpcAI;
+
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.network.serverpackets.ExVoteSystemInfo;
+
+/**
+ * @author netvirus
+ */
+public class RecNpc extends AbstractNpcAI
+{
+    
+    // NPC
+    private static final int NPC_NAME = 100001;
+    
+    private RecNpc(String name, String descr)
+    {
+        super(name, descr);
+        addStartNpc(NPC_NAME);
+        addFirstTalkId(NPC_NAME);
+        addTalkId(NPC_NAME);
+    }
+    
+    @Override
+    public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+    {
+        String htmltext = event;
+        switch (event)
+        {
+            case "get":
+            {
+                player.setRecomHave(255);
+                player.sendPacket(new ExVoteSystemInfo(player));
+                player.broadcastUserInfo();
+                htmltext = "100001-01.html";
+                break;
+            }
+            case "quit":
+            {
+                htmltext = "100001-02.html";
+                break;
+            }
+        }
+        return htmltext;
+    }
+    
+    public static void main(String[] args)
+    {
+        new RecNpc(RecNpc.class.getSimpleName(), "ai/npc");
+    }
+}
Index: dist/game/data/scripts/ai/npc/RecNpc/100001-01.html
===================================================================
--- dist/game/data/scripts/ai/npc/RecNpc/100001-01.html    (revision 0)
+++ dist/game/data/scripts/ai/npc/RecNpc/100001-01.html    (working copy)
@@ -0,0 +1,4 @@
+<html><body>Your NPC name:<br>
+Here. Now give me the fucking money!!!<br>
+Or I'll call the cops.
+</body></html>
\ No newline at end of file

Fuente

https://gist.github.com/netvirus/6137304