09-08-2011, 01:01 PM
Открыть спойлер
Бла бла блаВ общем нашел хороший, красивый гмшоп, изменил в нем картинки страниц, отредактировал цены.. долго не мог понять почему не работает магазин для дворян, если я им являюсь... дошло. Не дописал строчку в скрипты и не адаптировал init.py, все сделал, все заработало. Смотрю, строчки в дворянинском магазине на англ. а сам гмшоп на русском... Ну думаю, надо бы для себя любимого перевести... захожу в init.py, нахожу нужные строчки, меняю - перестает запускаться. И в UTF-8 переделывал, и в простой юникод, работает только на кодировке ANSI и только с английскими буквами.
Начал рыть гугл и яндекс "как русифицировать init.py" (там и нашел про кодировку) к сожалению, таких тем было мало, хотя и на вашем форуме нашел одну, но ответа толкового там не было.
На другом источнике прочитал, что на EMU RT сборках писать в init.py на русском - бесполезно и что лучше написать html. Забрал строчки хтмл из инит, сделал хтмл, прописал команду htmltext = "html.htm" удалил все содержание хтмла из инита, запустил сервер, все в порядке, но вылезает Error Script.
Начал рыть гугл и яндекс "как русифицировать init.py" (там и нашел про кодировку) к сожалению, таких тем было мало, хотя и на вашем форуме нашел одну, но ответа толкового там не было.
На другом источнике прочитал, что на EMU RT сборках писать в init.py на русском - бесполезно и что лучше написать html. Забрал строчки хтмл из инит, сделал хтмл, прописал команду htmltext = "html.htm" удалил все содержание хтмла из инита, запустил сервер, все в порядке, но вылезает Error Script.
Оригинал __init.py__ адаптированного под ему
import sys
from net.l2emuproject.gameserver.model.quest import State
from net.l2emuproject.gameserver.model.quest import QuestState
from net.l2emuproject.gameserver.model.quest.jython import QuestJython as JQuest
qn = "90000_BShopR"
NPC=[90000]
html = '<html><body>\
<center><img src="L2Font.mini_logo-k" width=250 height=90></center><br>\
<center><img src="L2UI.SquareWhite" width=245 height=1></center>\
<center>\
<table width=230 border=0 bgcolor=333333>\
<tr>\
<td align=center><button value="Life Stone" action="bypass -h npc_%objectId%_multisell 909930" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Scroll" action="bypass -h npc_%objectId%_multisell 909940" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Book" action="bypass -h npc_%objectId%_multisell 909960" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
</tr>\
<tr>\
<td align=center><button value="Sigil" action="bypass -h npc_%objectId%_multisell 909970" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Tatto" action="bypass -h npc_%objectId%_multisell 909990" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Armor PvP" action="bypass -h npc_%objectId%_multisell 909980" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
</tr>\
</table>\
<br>\
<center><button value="Pet" action="bypass -h npc_%objectId%_multisell 909950" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></center>\
<center><img src="L2UI.SquareWhite" width=245 height=1></center>\
<br>\
<button value="Back" action="bypass -h npc_%objectId%_Chat 0" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><br>\
</center>\
</body>\
</html>'
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st):
return event
def onTalk (self,npc,player):
st = player.getQuestState(qn)
if player.isNoble() == 1 :
bypass = 'Quest 2040_NShop noble-nopass.htm'
if st.getQuestItemsCount(6651):
bypass = 'npc_%objectId%_Chat 3'
htmltext=html.replace("%bypass%",str(bypass)).replace("%objectId%",str(npc.getObjectId()))
else :
htmltext="nobleteleporter-no.htm"
return htmltext
QUEST = Quest(90000,qn,"custom")
for item in NPC:
QUEST.addStartNpc(item)
QUEST.addTalkId(item)
print " "
print "_________________________________________________"
print " Special Shop for Baron Rus Gracia Final"
print " Created by Aniki La2offline Team © 2009"
print " For more details Visit WWW.LA2OFFLINE.NET"
print "_________________________________________________"
print " "
from net.l2emuproject.gameserver.model.quest import State
from net.l2emuproject.gameserver.model.quest import QuestState
from net.l2emuproject.gameserver.model.quest.jython import QuestJython as JQuest
qn = "90000_BShopR"
NPC=[90000]
html = '<html><body>\
<center><img src="L2Font.mini_logo-k" width=250 height=90></center><br>\
<center><img src="L2UI.SquareWhite" width=245 height=1></center>\
<center>\
<table width=230 border=0 bgcolor=333333>\
<tr>\
<td align=center><button value="Life Stone" action="bypass -h npc_%objectId%_multisell 909930" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Scroll" action="bypass -h npc_%objectId%_multisell 909940" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Book" action="bypass -h npc_%objectId%_multisell 909960" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
</tr>\
<tr>\
<td align=center><button value="Sigil" action="bypass -h npc_%objectId%_multisell 909970" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Tatto" action="bypass -h npc_%objectId%_multisell 909990" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Armor PvP" action="bypass -h npc_%objectId%_multisell 909980" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
</tr>\
</table>\
<br>\
<center><button value="Pet" action="bypass -h npc_%objectId%_multisell 909950" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></center>\
<center><img src="L2UI.SquareWhite" width=245 height=1></center>\
<br>\
<button value="Back" action="bypass -h npc_%objectId%_Chat 0" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><br>\
</center>\
</body>\
</html>'
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st):
return event
def onTalk (self,npc,player):
st = player.getQuestState(qn)
if player.isNoble() == 1 :
bypass = 'Quest 2040_NShop noble-nopass.htm'
if st.getQuestItemsCount(6651):
bypass = 'npc_%objectId%_Chat 3'
htmltext=html.replace("%bypass%",str(bypass)).replace("%objectId%",str(npc.getObjectId()))
else :
htmltext="nobleteleporter-no.htm"
return htmltext
QUEST = Quest(90000,qn,"custom")
for item in NPC:
QUEST.addStartNpc(item)
QUEST.addTalkId(item)
print " "
print "_________________________________________________"
print " Special Shop for Baron Rus Gracia Final"
print " Created by Aniki La2offline Team © 2009"
print " For more details Visit WWW.LA2OFFLINE.NET"
print "_________________________________________________"
print " "
Переписанный init + созданный хтмл.
init.py
import sys
from net.l2emuproject.gameserver.model.quest import State
from net.l2emuproject.gameserver.model.quest import QuestState
from net.l2emuproject.gameserver.model.quest.jython import QuestJython as JQuest
qn = "90000_BShopR"
NPC=[90000]
htmltext = "html.htm"
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st):
return event
def onTalk (self,npc,player):
st = player.getQuestState(qn)
if player.isNoble() == 1 :
bypass = 'Quest 2040_NShop noble-nopass.htm'
if st.getQuestItemsCount(6651):
bypass = 'npc_%objectId%_Chat 3'
htmltext=html.replace("%bypass%",str(bypass)).replace("%objectId%",str(npc.getObjectId()))
else :
htmltext="nobleteleporter-no.htm"
return htmltext
QUEST = Quest(90000,qn,"custom")
for item in NPC:
QUEST.addStartNpc(item)
QUEST.addTalkId(item)
print " "
print "_________________________________________________"
print " Special Shop for Baron Rus Gracia Final"
print " Created by Aniki La2offline Team © 2009"
print " For more details Visit WWW.LA2OFFLINE.NET"
print "_________________________________________________"
print " "
from net.l2emuproject.gameserver.model.quest import State
from net.l2emuproject.gameserver.model.quest import QuestState
from net.l2emuproject.gameserver.model.quest.jython import QuestJython as JQuest
qn = "90000_BShopR"
NPC=[90000]
htmltext = "html.htm"
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st):
return event
def onTalk (self,npc,player):
st = player.getQuestState(qn)
if player.isNoble() == 1 :
bypass = 'Quest 2040_NShop noble-nopass.htm'
if st.getQuestItemsCount(6651):
bypass = 'npc_%objectId%_Chat 3'
htmltext=html.replace("%bypass%",str(bypass)).replace("%objectId%",str(npc.getObjectId()))
else :
htmltext="nobleteleporter-no.htm"
return htmltext
QUEST = Quest(90000,qn,"custom")
for item in NPC:
QUEST.addStartNpc(item)
QUEST.addTalkId(item)
print " "
print "_________________________________________________"
print " Special Shop for Baron Rus Gracia Final"
print " Created by Aniki La2offline Team © 2009"
print " For more details Visit WWW.LA2OFFLINE.NET"
print "_________________________________________________"
print " "
Созданный html
html = '<html><body>\
<center><img src="L2Font.mini_logo-k" width=250 height=90></center><br>\
<center><img src="L2UI.SquareWhite" width=245 height=1></center>\
<center>\
<table width=230 border=0 bgcolor=333333>\
<tr>\
<td align=center><button value="Камень жизни" action="bypass -h npc_%objectId%_multisell 909930" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Свитки" action="bypass -h npc_%objectId%_multisell 909940" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Книги" action="bypass -h npc_%objectId%_multisell 909960" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
</tr>\
<tr>\
<td align=center><button value="Сиглы" action="bypass -h npc_%objectId%_multisell 909970" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Татту" action="bypass -h npc_%objectId%_multisell 909990" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="PvP Доспехи" action="bypass -h npc_%objectId%_multisell 909980" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
</tr>\
</table>\
<br>\
<center><button value="Животные" action="bypass -h npc_%objectId%_multisell 909950" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></center>\
<center><img src="L2UI.SquareWhite" width=245 height=1></center>\
<br>\
<button value="Back" action="bypass -h npc_%objectId%_Chat 0" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><br>\
</center>\
</body>\
</html>'
<center><img src="L2Font.mini_logo-k" width=250 height=90></center><br>\
<center><img src="L2UI.SquareWhite" width=245 height=1></center>\
<center>\
<table width=230 border=0 bgcolor=333333>\
<tr>\
<td align=center><button value="Камень жизни" action="bypass -h npc_%objectId%_multisell 909930" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Свитки" action="bypass -h npc_%objectId%_multisell 909940" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Книги" action="bypass -h npc_%objectId%_multisell 909960" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
</tr>\
<tr>\
<td align=center><button value="Сиглы" action="bypass -h npc_%objectId%_multisell 909970" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="Татту" action="bypass -h npc_%objectId%_multisell 909990" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
<td align=center><button value="PvP Доспехи" action="bypass -h npc_%objectId%_multisell 909980" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>\
</tr>\
</table>\
<br>\
<center><button value="Животные" action="bypass -h npc_%objectId%_multisell 909950" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></center>\
<center><img src="L2UI.SquareWhite" width=245 height=1></center>\
<br>\
<button value="Back" action="bypass -h npc_%objectId%_Chat 0" width=85 height=24 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><br>\
</center>\
</body>\
</html>'
P.S.
Картинка с ошибкой будет позже.