Jump to content
  • 0

[Help] with Delevel NPC


Question

Posted

I think this script is false can someone Help me ? its for Gracia Final!!

 

import sys
from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from net.sf.l2j.gameserver.datatables import SkillTable
from net.sf.l2j			       import L2DatabaseFactory
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 = "7105_Delevel"

NPC=[1316188]
GOLDBAR = 3470
QuestId    = 1316188
QuestName   = "Delevel"
QuestDesc   = "custom"
InitialHtml = "1.htm"

print "INFO Loaded: Delevel Manager"

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() < 41 :
		htmltext = "<html><body>Players Lower 40 Level Can't use this Action!</body></html>"

	elif st.getQuestItemsCount(GOLDBAR) < 1 :	
                       		 htmltext = "<html><body>You Need 1 Gold Bar to use this Action!</body></html>"

	else:
		st.getPlayer().setTarget(st.getPlayer())

		if event == "2":
			st.takeItems(GOLDBAR,1)
                                st.getPlayer().getStat().removeExpAndSp((st.getPlayer().getExp() - Experience.LEVEL[st.getPlayer().getStat().getLevel() - 1]),0)
			st.setState(State.COMPLETED)
			return "Delevel Manager: You Get -1 Level"
                                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 have nothing to say to you</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)

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



×
×
  • Create New...