Лото на Open
11 replies129 viewsCurrently viewing: 1
· 01/17/2010, 12:01 PM
Сборка: Final , l2open,590
Краткое изложение СУТИ проблемы:
Раскрывающийся текст
Код
Error on: C:\l2open590\Game\data\scripts\custom\6666_loto\__init__.py.error.log
Line: -1 - Column: -1
Traceback (innermost last):
File "__init__.py", line 8, in ?
ImportError: no module named csv
Line: -1 - Column: -1
Traceback (innermost last):
File "__init__.py", line 8, in ?
ImportError: no module named csv
Вопрос: в чем причина и как исправить?
Раскрывающийся текст
Код
#######################
### Made by DJSvist ###
### l2apocalypse.ru ###
### 2009 god :D ###
### ICQ 404-404-200 ###
#######################
import sys
from com.l2open.gameserver.datatables.csv import DoorTable
from com.l2open.gameserver.datatables import SkillTable
from com.l2open.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2open.gameserver import Announcements
from com.l2open.util.database import L2DatabaseFactory
from com.l2open.gameserver.ai import CtrlIntention
from com.l2open.util.random import Rnd
from java.lang import System
from com.l2open.gameserver.model import L2World
from com.l2open.gameserver.model.actor.instance import L2DoorInstance
qn = "6666_loto"
### CONFIG ###
NPC = 99998 # ID NPC loto
STAW = 57 #ID itema stawki
STAW_KOL = 1000000 #kol-vo stawki
WIN = 57 # ID viigrisha
WIN_KOL = 5000000 # kol-wo viigrisha
CHANCE = 50 # chans
STAW2 = 4037 #Item №2
STAW2_KOL = 1 # kol-wo 2 itema
WIN2 = 4037 # 2 viigrish
WIN2_KOL = 2 # Kol-vo
CHANCE2 = 50 #2 CHANS
### /CONFIG ###
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent(self,event,st):
htmltext = event
cond = st.getInt("cond")
if event == "1":
if st.getQuestItemsCount(STAW) >= STAW_KOL :
st.takeItems(STAW, STAW_KOL)
st.set("cond", "1")
return "ok.htm"
else :
return "no.htm"
return
if event == "2":
if st.getQuestItemsCount(STAW2) >= STAW2_KOL :
st.takeItems(STAW2, STAW2_KOL)
st.set("cond", "2")
return "ok.htm"
else :
return "no.htm"
return
if event == "3":
if cond == 1 :
if st.getRandom(100) < CHANCE :
st.giveItems(WIN,WIN_KOL)
st.set("cond", "0")
return "win.htm"
else :
st.set("cond", "0")
return "lose.htm"
elif cond == 2 :
if st.getRandom(100) < CHANCE2 :
st.giveItems(WIN2,WIN2_KOL)
st.set("cond", "0")
return "win.htm"
else :
st.set("cond", "0")
return "lose.htm"
if event == "4":
return "1.htm"
return
def onTalk (self,npc,player):
htmltext = "4iter.htm"
st = player.getQuestState(qn)
if not st : return htmltext
npcId = npc.getNpcId()
id = st.getState()
cond = st.getInt("cond")
if npcId == NPC :
if cond == 0 :
htmltext = "1.htm"
elif cond == 1 or cond == 2 :
htmltext = "ok2.htm"
return htmltext
QUEST = Quest(6666,qn,"custom")
QUEST.addStartNpc(NPC)
QUEST.addTalkId(NPC)
### Made by DJSvist ###
### l2apocalypse.ru ###
### 2009 god :D ###
### ICQ 404-404-200 ###
#######################
import sys
from com.l2open.gameserver.datatables.csv import DoorTable
from com.l2open.gameserver.datatables import SkillTable
from com.l2open.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2open.gameserver import Announcements
from com.l2open.util.database import L2DatabaseFactory
from com.l2open.gameserver.ai import CtrlIntention
from com.l2open.util.random import Rnd
from java.lang import System
from com.l2open.gameserver.model import L2World
from com.l2open.gameserver.model.actor.instance import L2DoorInstance
qn = "6666_loto"
### CONFIG ###
NPC = 99998 # ID NPC loto
STAW = 57 #ID itema stawki
STAW_KOL = 1000000 #kol-vo stawki
WIN = 57 # ID viigrisha
WIN_KOL = 5000000 # kol-wo viigrisha
CHANCE = 50 # chans
STAW2 = 4037 #Item №2
STAW2_KOL = 1 # kol-wo 2 itema
WIN2 = 4037 # 2 viigrish
WIN2_KOL = 2 # Kol-vo
CHANCE2 = 50 #2 CHANS
### /CONFIG ###
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent(self,event,st):
htmltext = event
cond = st.getInt("cond")
if event == "1":
if st.getQuestItemsCount(STAW) >= STAW_KOL :
st.takeItems(STAW, STAW_KOL)
st.set("cond", "1")
return "ok.htm"
else :
return "no.htm"
return
if event == "2":
if st.getQuestItemsCount(STAW2) >= STAW2_KOL :
st.takeItems(STAW2, STAW2_KOL)
st.set("cond", "2")
return "ok.htm"
else :
return "no.htm"
return
if event == "3":
if cond == 1 :
if st.getRandom(100) < CHANCE :
st.giveItems(WIN,WIN_KOL)
st.set("cond", "0")
return "win.htm"
else :
st.set("cond", "0")
return "lose.htm"
elif cond == 2 :
if st.getRandom(100) < CHANCE2 :
st.giveItems(WIN2,WIN2_KOL)
st.set("cond", "0")
return "win.htm"
else :
st.set("cond", "0")
return "lose.htm"
if event == "4":
return "1.htm"
return
def onTalk (self,npc,player):
htmltext = "4iter.htm"
st = player.getQuestState(qn)
if not st : return htmltext
npcId = npc.getNpcId()
id = st.getState()
cond = st.getInt("cond")
if npcId == NPC :
if cond == 0 :
htmltext = "1.htm"
elif cond == 1 or cond == 2 :
htmltext = "ok2.htm"
return htmltext
QUEST = Quest(6666,qn,"custom")
QUEST.addStartNpc(NPC)
QUEST.addTalkId(NPC)
0
· 01/17/2010, 12:09 PM
Код
from com.l2open.gameserver.datatables.csv import DoorTable
на
Код
from com.l2open.gameserver.datatables import DoorTable
— Заболел
0
· 01/17/2010, 12:17 PM
Код
from com.l2open.gameserver.datatables.csv import DoorTable
Здесь ошибка, в L2Emu путь будет выглядеть так (L2Open и L2Emu - одно и тоже, только Emu постабильней).
Код
from com.l2open.gameserver.datatables import DoorTable
DeadAdsl:Кодfrom com.l2open.gameserver.datatables.csv import DoorTable
наКодfrom com.l2open.gameserver.datatables import DoorTable
Ха, обогнал, не заметил твой ответ.
0
· 01/17/2010, 12:27 PM
Спасибо.
0
· 01/17/2010, 12:33 PM
Закрыто
Открыто
Код
Error on: C:\l2open590\Game\data\scripts\custom\6666_loto\__init__.py.error.log
Line: -1 - Column: -1
Traceback (innermost last):
File "__init__.py", line 12, in ?
ImportError: no module named database
Line: -1 - Column: -1
Traceback (innermost last):
File "__init__.py", line 12, in ?
ImportError: no module named database
12 строчка. Сборки l2open на руках нету
Код
from com.l2open.util.database import L2DatabaseFactory
— Заболел
0
· 01/17/2010, 03:20 PM
а что нужно сделать?(найти в сборке)
0
· 01/17/2010, 03:39 PM
Собственно вопрос: а зачем Вы лепите в скрипт ненужные импорты, ведь они не используються.
0
· 01/17/2010, 03:42 PM
эт не я их лепил - не я создатель сиво чуда .
0
· 01/17/2010, 03:44 PM
Простите за дабл пост, неуспел отредактировать.
Вот собственно нужные импорты ждя вашего квеста.
Принцип: удаляете свои импорты и вставляете мои:
Код
import sys
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
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
0
· 01/17/2010, 04:05 PM
спасибо - помогло
0
Topic is closed for replies


