Jump to content
  • 0

Scheme Buffer problem[SOLVED]


Question

Posted

Hi all, I have a server with about 200 players online, when registering in Olympiads await the last second and click in the buff button and enter the buffer scheme fullbuff in Olympiads, is that this problem has been answered in some posts but I've tried everything and nothing works I'm sure it's because those posts are from previous versions to my server, I use l2j high five and it fetches buffer scheme by no retouched to high five, not much but trying and testing codes I get only atribute error here is my code in Python:

 

here the imports:

import sys
from java.lang import System
from java.util import Iterator
from com.l2jserver import Config
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.instancemanager import QuestManager
from com.l2jserver import L2DatabaseFactory
from com.l2jserver.gameserver.datatables import SkillTable
from com.l2jserver.gameserver.datatables import ItemTable
from com.l2jserver.gameserver.model.actor.instance import L2PcInstance
from com.l2jserver.gameserver.model.actor.instance import L2PetInstance
from com.l2jserver.gameserver.model.actor.instance import L2SummonInstance
from com.l2jserver.gameserver.network.serverpackets import SetSummonRemainTime
from com.l2jserver.gameserver.network.serverpackets import SetupGauge
from com.l2jserver.gameserver.model.olympiad import Olympiad

this line:

from com.l2jserver.gameserver.model.olympiad import Olympiad

 

and here the part of the code i modified:

 

def onFirstTalk (self,npc,player):

st = player.getQuestState(QUEST_LOADING_INFO)

              isInOly = st.getPlayer().InOlympiadMode()

if not st : st = self.newQuestState(player)

if player.isGM():

if SCRIPT_RELOAD == True: return reloadPanel(st)

else: return rebuildMainHtml(st)

                elif isInOly == True:

                        return showText(st,"info","You can't use the scheme buffer while you're registered for the Olympiad Games!","False","Return","main")

elif int(System.currentTimeMillis()/1000) > st.getInt("blockUntilTime"):

 

if ENABLE_VIP_BUFFER == False or player.getAccessLevel().getLevel() == VIP_ACCESS_LEVEL and ENABLE_VIP_BUFFER == True:

 

if BUFF_WITH_KARMA == False and player.getKarma() > 0 :

return showText(st,"Info","You have too much <font color=\"FF0000\">karma!</font><br>Come back,<br>when you don't have any karma!","False","Return","main")

 

elif st.player.getLevel() < MIN_LEVEL :

return showText(st,"Info","Your level is too low!<br>You have to be at least level <font color\"LEVEL\">"+str(MIN_LEVEL)+"</font>,<br>to use my services!","False","Return","main")

 

 

elif st.player.isInCombat() :

return showText(st,"Info","You can't buff while you are attacking!<br>Stop your fight and try again!","False","Return","main")

 

else: return rebuildMainHtml(st)

 

else: return showText(st,"Sorry","This buffer is only for VIP's!<br>Contact the administrator for more info!","False","Return","main")

  else: return showText(st,"Sorry","You have to wait a while!<br>if you wish to use my services!","False","Return","main")

 

always get the same error atribute here the image:

http://imageshack.us/photo/my-images/705/failku.png/

failku.png

 

 

 

i test this code and nothing..

elif OlympiadManager.getInstance().isRegistered(player):
return showText(st,"info","You can't use the scheme buffer while you're registered for the Olympiad Games!","False","Return","main")

atribute error: isRegistered

 

I would appreciate any help, and yes i used google translator, thanks in advance.

9 answers to this question

Recommended Posts

  • 0
Posted

delete this

from com.l2jserver.gameserver.model.olympiad import Olympiad

and this:

elif isInOly == True:

                        return showText(st,"info","You can't use the scheme buffer while you're registered for the Olympiad Games!","False","Return","main")

 

And change this:

st = player.getQuestState(QUEST_LOADING_INFO)

                isInOly = st.getPlayer().InOlympiadMode()

 

with

st = player.getQuestState(QUEST_LOADING_INFO)
if st.getPlayer.InOlympiadMode() :
(Use Tab here)return showText(st,"info","You can't use the scheme buffer while you're registered for the Olympiad Games!","False","Return","main")

 

  • 0
Posted

here is the code changed and i deleted the import line ok but im still having problem with atribute error: getplayer

 

	def onFirstTalk (self,npc,player):
	st = player.getQuestState(QUEST_LOADING_INFO)
                if st.getPlayer.InOlympiadMode() :
		return showText(st,"info","You can't use the scheme buffer while you're registered for the Olympiad Games!","False","Return","main")
	if not st : st = self.newQuestState(player)
	if player.isGM(): 
		if SCRIPT_RELOAD == True: return reloadPanel(st)
		else: return rebuildMainHtml(st)
	elif int(System.currentTimeMillis()/1000) > st.getInt("blockUntilTime"):

		if ENABLE_VIP_BUFFER == False or player.getAccessLevel().getLevel() == VIP_ACCESS_LEVEL and ENABLE_VIP_BUFFER == True:

			if BUFF_WITH_KARMA == False and player.getKarma() > 0 :
				return showText(st,"Info","You have too much <font color=\"FF0000\">karma!</font><br>Come back,<br>when you don't have any karma!","False","Return","main")

			elif st.player.getLevel() < MIN_LEVEL :
				return showText(st,"Info","Your level is too low!<br>You have to be at least level <font color\"LEVEL\">"+str(MIN_LEVEL)+"</font>,<br>to use my services!","False","Return","main")


			elif st.player.isInCombat() :
				return showText(st,"Info","You can't buff while you are attacking!<br>Stop your fight and try again!","False","Return","main")

			else: return rebuildMainHtml(st)

 

look here the picture:

http://imageshack.us/a/img201/6243/fail2oc.png

fail2oc.png

 

 

thanks for taking your time answering ,greetings.

  • 0
Posted

here is the code changed and i deleted the import line ok but im still having problem with atribute error: getplayer

Lawl I forgot the ()

getPlayer()

  • 0
Posted

still having the same atribute error: 'getplayer' using this:

		st = player.getQuestState(QUEST_LOADING_INFO)
                if st.getPlayer().InOlympiadMode() :
		return showText(st,"info","You can't use the scheme buffer while you're registered for the Olympiad Games!","False","Return","main")

 

i dont know why, the scheme buffer have this atribute st.getplayer() in other part above of the script and it works fine,thanks in advance.

  • 0
Posted

yes this work    if player.InOlympiadMode() :    but now appear atribute error: 'InOlympiadMode' and i have the import for l2pcinstance ,this error will haunt me to death XD thanks .

  • 0
Posted

i found the problem in other website ,now is working i go post for other people

 

this is the change:

 

the import i add from com.l2jserver.gameserver.model.olympiad import OlympiadManager

 

and the restriction is

  if OlympiadManager.getInstance().isRegisteredInComp(player) :

return showText(st,"Info","You are in <font color=\"FF0000\">Olympiad!</font><br>Come back,<br>when you are out of Olympiad!","False","Return","main")

 

when you join olys and go to the buffer show this:

 

http://imageshack.us/a/img401/345/solvedx.png

solvedx.png

 

thanks for your help and interest, a greeting.

Guest
This topic is now closed to further replies.


×
×
  • Create New...