Jump to content
  • 0

[help java] increase level npc little edit


Question

Posted

hy guys i'have find this npc can increase level i want set can only lvl1 player can use it

 

wo want help me ?

 

script:

import sys
import l2.brick.gameserver.model.quest.Quest;
import l2.brick.gameserver.model.quest.QuestState;
from l2.brick.gameserver.model.quest.jython import QuestJython as JQuest

qn = "8500_LevelUp"
NPCid = [65534]
NPC = [65534]
ADENA = 10639
QuestId = 8500
QuestName = "LevelUp"
QuestDesc = "custom"
InitialHtml = "1.htm"


print "Rise Level Npc Sucessfully imported"

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

    def onEvent(self,event,st) :
        htmltext = event
        level = st.getPlayer().getLevel()
        #Went up a level for 1kk
        if event == "1":
            if st.getQuestItemsCount(ADENA) >= 4:
                  st.takeItems(ADENA,1)
                  delexp = (st.player.getStat().getExp() - st.player.getStat() .getExpForLevel(level+52))
                  st.player.getStat().addExp(-delexp)
                  return "2.htm"
            else:
                  htmltext = "You do not have Bonus Coin."
                  return htmltext
                
    def onTalk (self,npcid,player):
        st = player.getQuestState(qn)
        st.setState(State.STARTED)
        return InitialHtml

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

for npcId in NPC:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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


×
×
  • 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..