Jump to content
  • 0

What I Do Wrong


Question

Posted

import sys
from lt.equal import Config
from java.lang import System
from cStringIO import StringIO
from lt.equal.gameserver.model.quest import State
from lt.equal.gameserver.model.quest import QuestState
from lt.equal.gameserver.model.quest.jython import QuestJython as JQuest
from lt.equal.gameserver.datatables import ItemTable
from lt.equal.gameserver.datatables import CharTemplateTable
from lt.equal.gameserver.model.base import Race
from lt.equal.gameserver.model.base import ClassId
from lt.equal.gameserver.network import SystemMessageId
from lt.equal.gameserver import Olympiad
from lt.equal.gameserver.serverpackets import SystemMessage
from lt.equal.gameserver.serverpackets import SetupGauge

##################### CONFIG #####################
ALLOW_REQ_ITEMS = False
ITEM_REQ = 3483
ITEM_AMOUNT = 500
ALLOW_KARMA_PLAYER = True
TIME_OUT = True
BLOCK_TIME = 10
try: MAX_SUBCLASS = Config.MAX_SUBCLASS
except: 
try: MAX_SUBCLASS = Config.ALT_MAX_SUBCLASSES
except: MAX_SUBCLASS = 3
##################################################

npcId         = 957
QuestId       = 957
QuestName     = "AIOGrandMaster"
QI            = "%s_%s" % (QuestId,QuestName)
QuestDesc     = "custom"

print "============================="
print "INFO LOADED AIO GRANDMASTER"
print "============================="

def IHTML(st) :
HTML = StringIO()
HTML.write("<html><title>AIO GRANDMASTER</title><body><center>")
HTML.write("<br><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>")
HTML.write("<font color=\"FF0000\">.::Subclass Master Opciones::.</font><br><br>")
if st.player.getTotalSubClasses() == 0:
	HTML.write("If you want to add any Subclass, your<br1>current occupation must be second or<br1>third, besides reach level <font color=\"LEVEL\">75 or above</font>")
	if ALLOW_REQ_ITEMS:
		HTML.write("<br1>and get <font color=\"LEVEL\">%s %s</font>.</font><br>" % (ITEM_AMOUNT, getitemname(ITEM_REQ)))
	else : HTML.write(".<br>")
if st.player.getTotalSubClasses() < MAX_SUBCLASS :
	HTML.write("<button value=\"Add Subclass\" action=\"bypass -h Quest %s getracemenu addsub 0 0\" width=150 height=30 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>" % QI)
if st.player.getTotalSubClasses() > 0 :
	HTML.write("<button value=\"Change Subclass\" action=\"bypass -h Quest %s subclass changesub 0 0\" width=150 height=30 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>" % QI)
	HTML.write("<button value=\"Remove Subclass\" action=\"bypass -h Quest %s subclass deletesub 0 0\" width=150 height=30 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>" % QI)
HTML.write("<br><font color=\"303030\">%s</font>" % AIO())
HTML.write("</center></body></html>")
return HTML.getvalue()

def IIHTML(st,case,case2) :
if ALLOW_REQ_ITEMS and st.player.getTotalSubClasses() == 0:
	if st.getQuestItemsCount(ITEM_REQ) < ITEM_AMOUNT:
		return IIIHTML("Sorry","You don't have the required items!<br>You will need: <font color =\"LEVEL\">%s %s</font><br>to add any subclass" % (ITEM_AMOUNT,getitemname(ITEM_REQ)))
HTML = StringIO()
HTML.write("<html><title>AIO GRANDMASTER</title><body><center>")
HTML.write("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>")
HTML.write("<font color=\"FF0000\">.::Chooce a Race::.</font><br>")
HTML.write("<button value=\"Human\" action=\"bypass -h Quest %s subclass %s 0 %s\" width=120 height=30 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" % (QI,case,case2))
if st.player.getRace().ordinal() != 2: HTML.write("<button value=\"Elf\" action=\"bypass -h Quest %s subclass %s 1 %s\" width=120 height=30 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" % (QI,case,case2))
if st.player.getRace().ordinal() != 1: HTML.write("<button value=\"Dark Elf\" action=\"bypass -h Quest %s subclass %s 2 %s\" width=120 height=30 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" % (QI,case,case2))
HTML.write("<button value=\"Orc\" action=\"bypass -h Quest %s subclass %s 3 %s\" width=120 height=30 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" % (QI,case,case2))
HTML.write("<button value=\"Dwarf\" action=\"bypass -h Quest %s subclass %s 4 %s\" width=120 height=30 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" % (QI,case,case2))
HTML.write("<br><font color=\"303030\">%s</font>" % AIO())
HTML.write("</center></body></html>")
return HTML.getvalue()

def IIIHTML(type,text) :
HTML = StringIO()
HTML.write("<html><head><title>AIO GRANDMASTER</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>")
HTML.write("<font color=\"LEVEL\">%s</font><br>%s<br>" % (type,text))
HTML.write("<font color=\"303030\">%s</font></center></body></html>" % AIO ())
return HTML.getvalue()

def getitemname(case):
try: val =ItemTable.getInstance().createDummyItem(case).getItemName()
except: val = "0"
return val

def getnames(case):
try: val = CharTemplateTable.getInstance().getClassNameById(case)
except: val = "0"
return val

def AIO():
    xe="l";xf="e";xg="n";xa="B";xb="y";xc=" ";xd="A"; val= "%(xa)s%(xb)s%(xc)s%(xd)s%(xe)s%(xe)s%(xf)s%(xg)s" % locals()
    return val

def addTimeout(st,gaugeColor,amount,offset) :
endtime = int(System.currentTimeMillis()/1000) + amount
st.set("blockUntilTime",`endtime`)
st.getPlayer().sendPacket(SetupGauge(gaugeColor, amount * 1000 + offset))
return True

def subclasslist(st,cases,case2,index) :
HTML = StringIO()
if st.player.getLevel() < 75 and int(index) == 0 or st.getPlayer().getClassId().level() < 2:
	HTML.write("<br><br><br><br><br><br><br><br><br><br><br><br><br><br><font color=\"FF0000\">You cannot add a new subclass!<br1>First your current occupation must be<br1>second or third job and all of your sub<br1>classes must be at level 75 or above.</font><br>")
	return HTML.getvalue()
currentBaseId = st.player.getBaseClass()
baseCID = ClassId.values()[currentBaseId]
if baseCID.level() > 2: baseClassId = baseCID.getParent().ordinal()
else: baseClassId = currentBaseId
num = 0
if baseClassId in [5,6,20,33]: subclasses = [5,6,20,33,57,51]
elif baseClassId in [8,23,36]: subclasses = [8,23,36,57,51]
elif baseClassId in [9,24,37]: subclasses = [9,24,37,57,51]
elif baseClassId in [12,27,40]: subclasses = [12,27,40,57,51]
else: subclasses = [baseClassId,57,51]
for i in range(MAX_SUBCLASS):
	if st.player.getSubClasses().containsKey(i+1):
		if st.player.getSubClasses().get(i+1).getLevel() < 75 and int(index) == 0:
			HTML.write("<br><br><br><br><br><br><br><br><br><br><br><br><br><br><font color=\"FF0000\">You cannot add a new subclass!<br1>First your current occupation must be<br1>second or third job and all of your sub<br1>classes must be at level 75 or above.</font><br>")
			return HTML.getvalue()
		temp = ClassId.values()[st.player.getSubClasses().get(i+1).getClassId()]
		if temp.level() > 2: subclasses.append(temp.getParent().ordinal())
		else: subclasses.append(temp.getId())

HTML.write("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>")
if int(index) == 0: HTML.write("<font color=\"FF0000\">Add Subclass:<br>Which subclass do you wish to add?</font><br><br1>")
if int(index) > 0: HTML.write("<font color=\"FF0000\">Please<br1>Select a new subclass to change.</font><br><font color=\"LEVEL\">Warning!</font> Your previous subclass and<br1>all the skills will be removed.")

for child in ClassId.values():
	if child.getRace() == Race.values()[int(case2)] and child.level() == 2 and child.getId() not in subclasses:
		num = 1
		HTML.write("<button value=\"%s\" action=\"bypass -h Quest %s subclass %s %s %s\" width=150 height=30 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" % (getnames(child.getId()),QI,cases,child.getId(),index))
if num == 0: 
	HTML = StringIO()
	HTML.write("<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><font color=\"FF0000\">There are no available subclasses at this moment.</font><br>")
return HTML.getvalue()

def subclassopcions(st,cases,id,index) :  
if st.player.isCastingNow() or st.player.isAllSkillsDisabled():
	st.player.sendPacket(SystemMessage(SystemMessageId.SUBCLASS_NO_CHANGE_OR_CREATE_WHILE_SKILL_IN_USE))
	return

if Olympiad.getInstance().isRegistered(st.player):
	st.player.sendMessage("You have already been registered in a Olympiad game.")
	return

HTML = StringIO()	
if cases == "addsub":
	if st.player.isSubClassActive():
		return IIIHTML("Sorry","You are not allow to add a subclass!<br>Come back when you're using your main class")
	if st.player.getTotalSubClasses() >= MAX_SUBCLASS :
		if TIME_OUT: 
			if addTimeout(st,3,BLOCK_TIME,300) : pass
		st.player.sendMessage("You can now only change one of your current sub classes.")
		return
	else:
		HTML.write("<html><title>AIO GRANDMASTER</title><body><center>")
		HTML.write(subclasslist(st,"acceptsub",id,"0"))
		HTML.write("</center></body></html>")
		return HTML.getvalue()

if cases == "acceptsub":
	if ALLOW_REQ_ITEMS and st.player.getTotalSubClasses() == 0:
		if st.getQuestItemsCount(ITEM_REQ) < ITEM_AMOUNT:
			return IIIHTML("Sorry","You don't have the required items!<br>You will need: <font color =\"LEVEL\">%s %s</font><br>to add any subclass" % (ITEM_AMOUNT,getitemname(ITEM_REQ)))					
		else: st.takeItems(ITEM_REQ,ITEM_AMOUNT)
	if not st.player.addSubClass(int(id),st.player.getTotalSubClasses() + 1):
		st.player.sendMessage("The sub class could not be added.")
		return
	st.player.setActiveClass(st.player.getTotalSubClasses())
	HTML.write("<html><title>AIO GRANDMASTER</title><body><center>")
	HTML.write("<br><br>Add Subclass:<br>The sub class of <font color=\"LEVEL\">%s</font><br> has been added.<br>" % getnames(int(id)))
	HTML.write("</center></body></html>")
	st.player.sendPacket(SystemMessage(SystemMessageId.CLASS_TRANSFER))
	return HTML.getvalue()

if cases == "acceptchangesub":
	if not st.player.setActiveClass(int(index)):
		if TIME_OUT: 
			if addTimeout(st,3,BLOCK_TIME,300) : pass
		st.player.sendMessage("The sub class could not be changed.")
		return
	else:
		HTML.write("<html><title>AIO GRANDMASTER</title><body><center>")
		HTML.write("<br><br>Change Subclass:<br>Your active class is now a:<br><font color=\"LEVEL\">%s</font>" % getnames(int(id)))
		HTML.write("</center></body></html>")
		st.player.sendPacket(SystemMessage(SystemMessageId.ADD_NEW_SUBCLASS))
		if TIME_OUT: 
			if addTimeout(st,3,BLOCK_TIME,300) : pass
		return HTML.getvalue()

if cases == "changesub":
	if st.player.getTotalSubClasses() > MAX_SUBCLASS :
		st.player.sendMessage("You can now only delete one of your current sub classes.")
		if TIME_OUT: 
			if addTimeout(st,3,BLOCK_TIME,300) : pass
		return
	else:
		j=0
		HTML.write("<html><title>AIO GRANDMASTER</title><body><center>")
		HTML.write("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>")
		HTML.write("<font color=\"FF0000\">Change Subclass:<br1>Which sub class do you wish to change?</font><br>")
		if st.player.isSubClassActive():
			j=1
			HTML.write("<font color=\"LEVEL\">Main-class</font>")
			HTML.write("<button value=\"%s\" action=\"bypass -h Quest %s subclass acceptchangesub %s 0\" width=150 height=30 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>" % (getnames(st.player.getBaseClass()),QI,st.player.getBaseClass()))
		for i in range(MAX_SUBCLASS):
			if st.player.getSubClasses().containsKey(i+1):
				xsubclassid = st.player.getSubClasses().get(i+1).getClassId()	
				if int(st.player.getClassId().getId()) != xsubclassid:
					j=i+1
					HTML.write("<font color=\"LEVEL\">Sub-class %s</font>" % (i+1))
					HTML.write("<button value=\"%s\" action=\"bypass -h Quest %s subclass acceptchangesub %s %s\" width=150 height=30 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" % (getnames(xsubclassid),QI,xsubclassid,i+1))
		if j == 0:
			HTML.write("<html><title>AIO GRANDMASTER</title><body><center>")
			HTML.write("<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><font color=\"FF0000\">There are no sub classes available<br>to change at this time.</font><br>")
			if TIME_OUT: 
				if addTimeout(st,3,BLOCK_TIME,300) : pass	 
		HTML.write("</center></body></html>")
		return HTML.getvalue()

if cases == "deletesub":
	if st.player.isSubClassActive():
		return IIIHTML("Sorry","You are not allow to delete a subclass!<br>Come back when you're using your main class")
	if st.player.getTotalSubClasses() > MAX_SUBCLASS :
		if TIME_OUT: 
			if addTimeout(st,3,BLOCK_TIME,300) : pass
		st.player.sendMessage("You can now only delete one of your current sub classes.")
		return
	else:
		j=0
		HTML.write("<html><title>AIO GRANDMASTER</title><body><center>")
		HTML.write("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>")
		HTML.write("<font color=\"FF0000\">Which sub class do you wish to delete?</font><br>")
		for i in range(MAX_SUBCLASS):
			if st.player.getSubClasses().containsKey(i+1):
				j=i+1
				HTML.write("<font color=\"LEVEL\">Sub-class %s</font>" % (i+1))
				HTML.write("<button value=\"%s\" action=\"bypass -h Quest %s getracemenu acceptnewsub %s 0\" width=150 height=30 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" % (getnames(st.player.getSubClasses().get(i+1).getClassId()),QI,i+1))
		HTML.write("<br>If you change a sub class, you'll start at level 40<br1>after the 2nd class transfer.")
		if j == 0:
			HTML.write("<html><title>AIO GRANDMASTER</title><body><center>")
			HTML.write("<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><font color=\"FF0000\">There are no sub classes available<br>to delete at this time.</font><br>")
			if TIME_OUT: 
				if addTimeout(st,3,BLOCK_TIME,300) : pass
		HTML.write("</center></body></html>")
		return HTML.getvalue()

if cases == "acceptnewsub":
	HTML.write("<html><title>AIO GRANDMASTER</title><body><center>")
	HTML.write(subclasslist(st,"acceptdelsub",id,index))
	HTML.write("</center></body></html>")
	return HTML.getvalue()  

if cases == "acceptdelsub":
	if st.player.modifySubClass(int(index), int(id)):
		st.player.stopAllEffects()
		st.player.setActiveClass(int(index))
		HTML.write("<html><title>AIO GRANDMASTER</title><body><center>")
		HTML.write("<br><br>Change Subclass:<br>Your sub class has been changed to<br1><font color=\"LEVEL\">%s</font>" % getnames(int(id)))
		HTML.write("</center></body></html>")
		st.player.sendPacket(SystemMessage(SystemMessageId.ADD_NEW_SUBCLASS))
		if TIME_OUT:
			if addTimeout(st,3,BLOCK_TIME,300) : pass
		return HTML.getvalue()
	else:
		player.setActiveClass(0)
		if TIME_OUT: 
			if addTimeout(st,3,BLOCK_TIME,300) : pass
		st.player.sendMessage("The sub class could not be added, you have been reverted to your base class.")
		return 

class Quest (JQuest) :

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

def onAdvEvent (self,event,npc,player) :
	try: st = player.getQuestState(QI)
	except: return				
	eventSplit = event.split(" ")
	event = eventSplit[0]
	event1 = eventSplit[1]
	event2 = eventSplit[2]
	event3 = eventSplit[3]

	if event == "getracemenu": return IIHTML(st,event1,event2)

   		if event == "subclass" : 
		if int(System.currentTimeMillis()/1000) > st.getInt("blockUntilTime"):
			return subclassopcions(st, event1, event2, event3)
		return IHTML(st)

	else: return

def onFirstTalk (self,npc,player):
	st = player.getQuestState(QI)
	if not st : st = self.newQuestState(player)
	if int(System.currentTimeMillis()/1000) > st.getInt("blockUntilTime"):
		if ALLOW_KARMA_PLAYER == False and player.getKarma() > 0 :
			return IIIHTML("Info","You have too much karma!<br>Come back,<br>when you don't have any karma!")
		elif st.player.getPvpFlag() > 0 :
			return IIIHTML("Info","You can't use my services while you are flagged!<br>Wait some time and try again!")
		elif st.player.isInCombat() :
			return IIIHTML("Info","You can't use my services while you are attacking!<br>Stop your fight and try again!")
		else: return IHTML(st)
   	else: return

QUEST    = Quest(QuestId,QI,QuestDesc)
CREATED  = State('Start', QUEST)
QUEST.setInitialState(CREATED)

QUEST.addStartNpc(npcId)
QUEST.addFirstTalkId(npcId)
QUEST.addTalkId(npcId)

 

faild import :   978_Shop_Enchants

in gs

2 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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.



  • Posts

    • i saw somewhere that: $var = (int) $_POST['some_id'] ?? string::error_class('text'); it was when i gave up and deleted the sources let him, he does not even understand what cross site or mitm means   still waiting for any client of yours so i can play with them     DUDE IM GONNA CALL YOU BoberKurwa FROM NOW ON!! rename your account aswell! BoberKurwa!   Note: what happend to your chatgpt answers boberkurwa did your subscription of $12.5/$20 ended?   it is PSR12 standard
    • if i was you i would check first argentinian developer team to learn and contribute then start my own project privatly and then practice in free coding for my self, then you would be ready to learn standards and code out of nothing, and if you fail means you are in good path, if you win you are in for higher level, whatever you do be persistent and focused, thats what i did when i had time.
    • Dude, seriously , how are you okay with publishing something like this as a public repo? I spent just 30 minutes reviewing your source code and already managed to bypass your API wall on the admin routes. You really need to rethink your server to client logic. What's the point of saving data both to your API and to the user's database? You first fetch the servers from your API and then save them to the database. What’s stopping someone from simply fetching their server data directly from the database and bypassing all the API logic? The client you provide as a public repo should only act as a wrapper around your service API and that's it. The API should handle all the logic, including connecting to the corresponding servers based on  authentication key requests and so on. I don't even want to get started on the fact that your codebase is a complete mess...... unused variables  everywhere, empty classes, and zero input validation. Anyone can pass whatever payload they want without restrictions. You seriously need to fix these issues before some poor guy who has no idea ends up buying your service. And don’t even start with "I'm still waiting for my server to get hacked" because  no one is going to waste time trying to hack something that's not even worth the effort. just by checking this im 90% confident someone can find something.  Also, you claim that 250 domains are already using your service? I seriously doubt that.   also LOL   
    • 🌟 Arena Fights – PvP System for Lineage II servers 📋 Overview The Arena Fights Manager is a fully automated and battle-proven PvP tournament system built for Lineage 2 servers (based on aCis pack standards). It offers hourly or custom-scheduled 1v1 fights, spectator options, disconnection handling, automatic NPC managers, and dynamic rescheduling, ensuring continuous and engaging PvP without the need for GM intervention. Ideal for any serious server that wants to offer competitive, organized, rewarding PvP content.   ⚙️ Features ✅ Full Automation Automatic start/stop based on your custom schedule (Config.ARENA_FIGHTS_SCHEDULE). Reschedules every day at 23:59 for the next day's tournaments. Server restarts during an event? No problem — the system self-detects and continues! ✅ Matchmaking System Smart queue system for 1v1 match creation. Automatic pairing: when two players are queued, a match is instantly created. Validation checks to remove disconnected or invalid players from the queue. ✅ Dynamic PvP Arenas Predefined player teleport locations for fair 1v1 battles. Spectator mode available: players can view live battles through the event interface. ✅ NPC Manager Control Spawns special Arena Manager NPCs during event times. NPCs are deleted when the event finishes to keep the world clean. Multiple Managers can be placed easily. ✅ Robust Player Handling Handles disconnects gracefully: Saves disconnected players. Restores them to a safe location on reconnection. Removes them from the queue or match without crashes or bugs. Players receive a system message upon restoration. ✅ Clean Coding Practices Fully integrated with ThreadPool tasks for efficient, non-blocking performance. Uses CopyOnWriteArrayList for thread-safe collections (queues, matches, disconnected players). Singleton Pattern ensures only one Arena Manager instance exists. ✅ Visual Enhancements World Announcements during important event phases ("Arena Fights have started!", "Battles are over!"). Red Sky Effect (ExRedSky) during Arena start and end for immersive atmosphere. ✅ Admin-Friendly Commands Allows NPC broadcast announcements. Easy to check current running matches and spectate them. Display list of ongoing matches dynamically.   📦 Technical Highlights Built with a modular and clean structure. Zero dependency on hardcoded values — everything configurable via the server Config. Handles dynamic spawning and safe deletion of NPCs through SpawnTable. Utilizes InstanceManager to safely handle player instances.   🎯 Why Choose This Arena System? Feature Other           Arena Fights Disconnection handling ❌ ✅ Fully automatic scheduling ❌ ✅ Daily rescheduling ❌ ✅ Manager NPC auto-spawn/despawn ❌ ✅ Queue matchmaking without GMs ❌ ✅ Clean code with thread-safety ❌ ✅ Integrated visual effects (Red Sky) ❌ ✅ Instant spectating capabilities ❌ ✅ 📈 Expandability Can be adapted to reward players with custom currencies (e.g., Arena Trophy). Could integrate ranking systems based on wins/loses. Room to add betting systems for spectators!   🔥 Screenshots / Preview (Optional) Lobby NPC screenshots Battle happening Spectator UI Disconnection restoration notification   💬 Final Words The Arena Fights Manager is not just a PvP mini-event — it's a major daily PvP engine that will boost: Player activity Server competitiveness Community engagement   It’s optimized for performance, designed for smoothness, and built for growth.   🛒 Available for purchase! Interested? Contact me and let's make your server shine.   PM me directly for inquiries and purchases. Discord: @Luminous   Pricing: Full License: 70e (One-time payment) Support & Updates: included on full licence
  • Topics

×
×
  • Create New...