Jump to content
  • 0

Help whit Pyhton Script


Question

Posted

I'm kinda new to phyton script i downloaded and modded lightmagik NPCLight nobless hero script for my use but it always says failed to import npc_light blablabla quest

 

here my script

 

import sys

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

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

 

qn = "9999_NPCLight"

 

NPC=[440457]

NOBLESS_TIARA = 7694

ADENA_ID=5588

SEALED_ID=7608

QuestId    = 9999

QuestName  = "NPCLight"

QuestDesc  = "custom"

InitialHtml = "1.htm"

 

class Quest (JQuest) :

 

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

 

def onEvent(self,event,st):

htmltext = event

count=st.getQuestItemsCount(ADENA_ID)

if count < 1 :

htmltext = "<html><head><body>You dont have the Required item.</body></html>"

else:

if event == "1":

if st.getPlayer().getLevel() > 5 :

return "Cheater.htm"

st.setState(COMPLETED)

if not st.getPlayer().setLevel(78) :

                                                        st.takeItems(ADENA_ID,1)

st.getPlayer().setNoble(True)

st.giveItems(NOBLESS_TIARA,1)

st.giveItems(6842,1)

return "Weapon.htm"

st.setState(COMPLETED)

 

if event == "2":

if st.getPlayer().isNoble() :

return "Cheater.htm"

st.setState(COMPLETED)

                if not st.takeItems(SEALED_ID,1)

st.getPlayer().st.giveItems(7575,1)

return "Armor.htm"

st.setState(COMPLETED)

if htmltext != event:

st.setState(COMPLETED)

st.exitQuest(1)

return htmltext

 

 

        def onTalk (self,npc,st):

htmltext = "<html><head><body>I have nothing to say to you</body></html>"

st = st.getQuestState(qn) 

st.setState(STARTED)

return InitialHtml

 

 

 

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

CREATED=State('Start',QUEST)

STARTED=State('Started',QUEST)

COMPLETED=State('Completed',QUEST)

 

QUEST.setInitialState(CREATED)

 

for npcId in NPC:

QUEST.addStartNpc(npcId)

QUEST.addTalkId(npcId)

 

i use Anarchy interlude serverpack that A style shared

3 answers to this question

Recommended Posts

  • 0
Posted

;)

 

mUrray - First warning.

 

eKo - its hard to put your codes in Quote/Code block?

 

Any error logs ...?

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

    • Very nice attempt and good luck with your sales.   Don't let the voices in this topic discourage you. Most of those people are just flexing. So if Celestine decides to write a bootkit or hook system calls or whatever and false-feed your anti-cheat fake info just because it sits in user mode just to go play in a private server with 100 people, I'll tell you one thing:   Who the fuck cares ... 😛   The average player won't / can't make these things, the big players like adrenaline won't bother (yet) (they don't have signed drivers do they ? They also run in user mode I believe). And even if they somehow manage to do so, there's a minority of players who would trust putting this thing on their pc. I wouldn't let anyone tamper with my kernel mode even if he had a signed certificate from Microsoft.    Also, in a scene where collusion has been brought out between bot makers and cheat guards, having many options is a blessing regardless of their strength. It makes colusion, conflict of interest and cartel more difficult, it drains from cheating software creators more resources to focus on more cheat guards, and it gives server owners plurality.    This arms race is a numbers game, you stop 90% of the cheaters you add value to all of us.    A couple of senior devs flexing their powers in a forum are not a concern.   If i'd ever make a server, I would definitelly buy from you, not because you have the best anti-cheat, but because you are not well known yet to be the focus of counter measures.     
    • TILL OPENING LEFT LESS THAN - 2 DAYS ! GRAND OPENING FROM - 10/07/2026, FRIDAY, 20:00 +3 GMT !
    • Add me on discord, lets talk   Discord: splicho
    • Add more information about your project, client, rates etc, this can help you find a developer more easily on your needs!
  • 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..