Jump to content
  • 0

[Help]Level NPC


Question

13 answers to this question

Recommended Posts

  • 0
Posted

Code:

 

/*

* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.

*/

package custom.LevelNPC;

 

import net.sf.l2j.gameserver.instancemanager.QuestManager;

import net.sf.l2j.gameserver.model.actor.L2Npc;

import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

import net.sf.l2j.gameserver.model.base.Experience;

import net.sf.l2j.gameserver.model.quest.Quest;

import net.sf.l2j.gameserver.model.quest.QuestState;

import net.sf.l2j.gameserver.network.clientpackets.Say2;

import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;

 

/**

* @author Based on idea of SeaNet

* @author lord_rex

* @since ToDay

*/

public class LevelNPC extends Quest

{

private final static int NPC = 50023;

 

public LevelNPC(int questId, String name, String descr)

{

super(questId, name, descr);

addFirstTalkId(NPC);

addStartNpc(NPC);

addTalkId(NPC);

}

 

public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)

{

String htmltext = "";

htmltext = npc.getNpcId() + ".htm";

QuestState st = player.getQuestState(getName());

 

if (event.equalsIgnoreCase("level_me"))

{

if (st.getPlayer().getLevel() < 1)

st.getPlayer().sendPacket(new CreatureSay(st.getPlayer().getObjectId(), Say2.TELL, "Level NPC", "wtf?"));

else if (st.getQuestItemsCount(57) < 1)

st.getPlayer().sendPacket(new CreatureSay(st.getPlayer().getObjectId(), Say2.TELL, "Level NPC", "You need 10.000.000 adena to add your level."));

else if (st.getPlayer().getKarma() > 0)

st.getPlayer().sendPacket(new CreatureSay(st.getPlayer().getObjectId(), Say2.TELL, "Level NPC", "You are chaotic, go away please!"));

else if (st.getPlayer().getPvpFlag() != 0)

st.getPlayer().sendPacket(new CreatureSay(st.getPlayer().getObjectId(), Say2.TELL, "Level NPC", "You cannot add your level when you are fighting."));

else if (st.getPlayer().isAttackingNow() == true)

st.getPlayer().sendPacket(new CreatureSay(st.getPlayer().getObjectId(), Say2.TELL, "Level NPC", "Leave me please!!!"));

else

{

st.getPlayer().setTarget(st.getPlayer());

 

st.takeItems(57, 1);

                                st.getPlayer().getStat().addExpAndSp((st.getPlayer().getExp() - Experience.LEVEL[st.getPlayer().getStat().getLevel() + 84]),0);

}

}

 

return htmltext;

}

 

public String onFirstTalk(L2Npc npc, L2PcInstance player)

{

String htmltext = "";

QuestState st = player.getQuestState(getName());

if (st == null)

{

Quest q = QuestManager.getInstance().getQuest(getName());

st = q.newQuestState(player);

}

htmltext = npc.getNpcId() + ".htm";

return htmltext;

}

 

public static void main(String[] args)

{

new LevelNPC(-1, "LevelNPC", "custom");

}

}

 

but not happend.

  • 0
Posted

Try this:

 

import sys

from net.sf.l2j.gameserver.network.serverpackets import CreatureSay

from java.lang import System

from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance

from net.sf.l2j.gameserver.model.base import Experience

from net.sf.l2j.gameserver.model.quest import State

from net.sf.l2j.gameserver.model.quest import QuestState

from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest

from java.util import Iterator

from net.sf.l2j.gameserver.datatables import SkillTable

from net.sf.l2j import L2DatabaseFactory

from net.sf.l2j.gameserver.network.serverpackets import SetupGauge

 

qn = "7105_Delevel"

 

NPC=[7108]

MEDAL = 57

QuestId    = 7105

QuestName  = "Delevel"

QuestDesc  = "custom"

InitialHtml = "1.htm"

 

print "INFO Loaded: Delevel Manager by promo"

 

class Quest (JQuest) :

 

def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

 

 

def onEvent(self,event,st):

htmltext = event

 

if  st.getPlayer().getLevel() < 1 :

st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Ban khong du level!"))

 

elif st.getQuestItemsCount(MEDAL) < 10000000 :

                      st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Ban khong co du adena !"))

 

elif st.getPlayer().getKarma() > 0 :

st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Diem karma cua ban qua cao!"))

 

elif st.getPlayer().getPvpFlag() != 0 :

st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Ban dang trong tinh trang chien dau!"))

 

elif st.getPlayer().isAttackingNow() == True :

st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Dont hit me, Plz!!!!"))

 

elif st.getPlayer().getLevel() < 1 :

SkillTable.getInstance().getInfo(1389,3).getEffects(st.getPlayer(),st.getPlayer())

st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Ban  khong the su dung tiep tuc neu ban duoi cap 48"))

 

else:

st.getPlayer().setTarget(st.getPlayer())

 

if event == "2":

st.takeItems(MEDAL,10000000)

                                st.getPlayer().getStat().addExpAndSp((st.getPlayer().getExp() - Experience.LEVEL[st.getPlayer().getStat().getLevel() + 84]),0)

st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 3, "Delevel Manager", "Ban da duoc giam di 1 level"))

return "1.htm"

st.setState(State.COMPLETED)

st.exitQuest(1)

 

 

if htmltext != event:

st.setState(State.COMPLETED)

st.exitQuest(1)

return htmltext

 

def onTalk (self,npc,player):

  st = player.getQuestState(qn)

  htmltext = "<html><head><body> I dont have anything to say .</body></html>"

  st.setState(State.STARTED)

  return InitialHtml

 

QUEST      = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)

 

for npcId in NPC:

QUEST.addStartNpc(npcId)

QUEST.addTalkId(npcId)

 

  • 0
Posted

Traceback (innermost last):

  (no code object) at line 0

SyntaxError: ('invalid syntax', ('__init__.py', 57, 33, '                                st.getPlayer().getStat().addExpAndSp((st.getPlayer().getExp() - Experience.LEVEL[st.getPlayer().getStat().getLevel() + 84]),0)'))

  • 0
Posted

<html>

<head><title>Delevel Manager</title>

</head>

<body>

Click here to increase level.<br>

<center>

<table>

<tr>

<td align=center><button value="Increase  level " action="bypass -h Quest 7105_Delevel 2" width=264 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>

</tr>

</table>

</body></html>

  • 0
Posted

I write, but not happened. It doesn't matter, but I say thank you for the much help because of that. You are neat, that you tried to help this much.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Server Description L2 Karma is a permanent Interlude 1x server built on L2J with retail-like mechanics and a long-term vision — not a seasonal reset or wipe server. We focus on competitive longevity, fair play, and a community where every player matters. Core Features ✔ True x1 Experience (XP / SP / Adena / Drop / Spoil) ✔ Retail mechanics — no forced progression shortcuts ✔ Single-box only (1 client per player — no multi-boxing advantage) ✔ No Pay-to-Win & strict anti-RMT policy ✔ Already live and active with players progressing ✔ Long-term commitment — 3-year guarantee ✔ Designed for meaningful PvP and community cohesion 📏 Server Rules No Multi-Boxing Advantage — Only one client per account is allowed. No Pay-to-Win Items or Services — VIP runes are optional and do not lock content. No Bots, Scripts, or Automation — Zero tolerance. Suspicious accounts will be banned. No Exploit Abuse — Reporting exploits immediately avoids penalties. No RMT / Real Money Trading — Strict enforcement — economy integrity matters. Fair Play Only — Harassment and racism are not allowed in chat or Discord. Respect Admin Decisions — Official rulings are final to keep the server stable. 📥 How to Join 🔗 Website: https://l2karma.org 🔗 Discord: https://discord.gg/VV9RAfmnth Chronicle: Interlude Rates: x1 (Classic) Box Limit: Single Box 🧠 What Makes Us Different ✔ Permanent World — No resets ever ✔ Designed for players tired of wipe-cycle servers ✔ Community-centric growth — not rinse-and-repeat launches ✔ Competitive but fair environment ✔ Events, structured seasons, and ongoing content support
    • A widespread proxy service, operating through hijacked devices, has been shut down in a cross-industry effort led by Google. The network, known as IPIDEA, functioned by secretly converting millions of personal devices into proxies for malicious actors. The Mechanism of the Scheme The operation distributed hidden code within seemingly legitimate free apps and VPN services. Once installed, this code enrolled the user’s device into a pool of residential IP addresses. These addresses were then sold anonymously, primarily to cybercriminal and state-sponsored groups, to mask the origin of attacks, fraud, and espionage. Key impacts of the network included: Facilitating operations for more than 550 identified threat actors. Exposing unsuspecting device owners to potential legal and security risks by associating their IP addresses with criminal traffic. The Takedown Strategy Google and its partners disrupted the service by: Seizing core operational domains. Using Google Play Protect to detect and remove malicious applications. Coordinating with infrastructure providers to prevent the network from reestablishing itself. The action highlights the necessity of continuous user awareness, developer diligence in code reviews, and proactive industry cooperation to maintain cybersecurity. Front Companies Associated with IPIDEA IPIDEA masked its activities under various brand names, such as: Proxy Brands: 360 Proxy, 922 Proxy, Luna Proxy, IP2World, ABC Proxy. VPN Brands: Door VPN, Radish VPN, Galleon VPN. SDK Brands: PacketSDK, HexSDK (the toolkits used to embed proxy code).   Choosing Ethical Proxy Services Alternatives For lawful purposes like market research, ad verification, or data aggregation, selecting a transparent and consensual provider is essential. Reputable services obtain explicit user permission for their networks and enforce strict compliance measures. Examples of Established Providers: Bright Data: A leading, consent-based residential proxy network. Oxylabs: Provides large-scale proxy solutions for enterprise needs. MoMoProxy: Maintains a large pool of residential IPs for tasks like web scraping.   Only $850/1TB.  https://momoproxy.com   Identifying a Legitimate Provider: A trustworthy service will typically demonstrate: Informed Consent: Networks are built with the clear agreement of participants. Robust Compliance: Proactive systems to prevent abuse and respect website terms. Operational Transparency: Public-facing policies, identifiable corporate structure, and genuine customer support. Conduct thorough due diligence. Opt for providers that are clear about their IP sources and maintain strong anti-abuse policies, ensuring your legitimate activities do not inadvertently support harmful operations.
    • Lineage 2 Interlude Developer – Cliente + Datapack Hola, soy developer especializado en Lineage 2 Interlude con experiencia tanto en cliente como datapack/core. ✔ Desarrollo datapack (Java, scripts, quests, balance PvP/PvE) ✔ Fixes core / geodata / exploits ✔ Sistemas custom (events, Olympiad, instancias, mods PvP) ✔ Cliente: interface mods, system patches, .dat edits, UI personalizada ✔ Optimización y estabilidad de servidor ✔ Trabajo freelance o colaboración fija Si necesitáis soporte dev o mejoras para vuestro servidor Interlude, podéis contactarme por DM. Portfolio y ejemplos disponibles bajo petición.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and 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..