Jump to content

PC Bang Points Event


vagos123

Recommended Posts

Making a trading npc. Taking Bang Points and giving a item.

The only problem i have is that  st.getPlayer().reducePcBangScore(POINTS) <- THis getting error.

Any idea?

import sys
from com.l2jserver.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from com.l2jserver.gameserver.datatables import SkillTable
from com.l2jserver		       import L2DatabaseFactory
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.actor.appearance import PcAppearance
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2jserver.gameserver.model.quest        			import State
from com.l2jserver.gameserver.model.quest        			import QuestState
from com.l2jserver.gameserver.model.quest.jython 			import QuestJython as JQuest
from com.l2jserver.gameserver.network.serverpackets      	import PledgeShowInfoUpdate
from com.l2jserver.gameserver.network.serverpackets      	import SystemMessage


qn = "90099_BangPoints"

NPC=[32070]
COINS= 4356
COUNT = 10
POINTS = 100
QuestId     = 8205
QuestName   = "BangPoints"
QuestDesc   = "custom"
InitialHtml = "1.htm"

print "INFO Loaded: Points Bying 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().getPcBangScore()) < COUNT) :	
                        htmltext = "Error1.htm"

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

		if event == "2":
			st.giveItems(COINS,COUNT)
                st.getPlayer().reducePcBangScore(POINTS)
                st.playSound("ItemSound.quest_finish")
			st.setState(State.COMPLETED)
			st.exitQuest(1)
			return "End.htm"


		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)

if you want use python you also need modify java for that 'reduce' or you can do it through multisell.java

Link to comment
Share on other sites

  • 3 months later...
  • 3 weeks later...

if you want use python you also need modify java for that 'reduce' or you can do it through multisell.java

 

In my opinion forget about python, simply check how l2j manages fame on a character (it can count as "pc bang points" if you think of it).... So just search a bit :), there is a file named Multisell.java as i remember (coz i already did it), if im right is on Datatables, but im not sure, good luck :)!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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