09-11-2014, 11:28 PM
Уважаемые , помогите в такой проблеме поставил нпс на замену цвета ника и титула (сборка l2Frozen rev1127) да он все меняет тока не сохраняет на других сборка пробовал он пашет но есть од но на других пробниках в таблице характер чар есть столбы титул-колор и имя-колор там после рега все сохраняется а в l2Froz rev.1127 там таких столбцов нет. Создал но результатов не дало. Нашёл таблицу характер-колор и понял что через админку можно все таки сменить ник-цвета и при рестарте он сохранится тока почему-то когда задаю цвет нужно указать время //setcolor 00ffff(цвет) 10(время) только после этого рестарт не скидывает цвета. Помогите переделать скрипт чтоб он кидал в нужный реестер в бд вот сом скрипт:
###########################################
import sys
from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
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
#
#========================================
# DO NOT TOUCH THIS
#========================================
QuestId = 1000
QuestName = "ColorManager"
QuestDesc = "custom"
qn = "q"+str(QuestId)+"_"+str(QuestName)
#========================================
StartNpc = 50000
ItemId = 57
ItemQty = 1
MinLevel = 1
MaxLevel = 80
#========================================
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onAdvEvent(Self,event,npc,player):
text = "noaction.htm"
st = player.getQuestState(qn)
if not st : return text
if (player.getLevel() < MinLevel) or (player.getLevel() > MaxLevel) : return "charlevel.htm"
if st.getQuestItemsCount(ItemId) < ItemQty : return "nomoney.htm"
nameColor = hex(player.getAppearance().getNameColor())
titleColor = hex(player.getAppearance().getTitleColor())
st.set("nameColor",str(nameColor))
st.set("titleColor",str(titleColor))
if event == "N_Blue" :
nameColor = "FF0000"
elif event == "N_Red" :
nameColor = "0000FF"
elif event == "N_Cyan" :
nameColor = "00FF00"
elif event == "N_Magenta" :
nameColor = "FF00FF"
elif event == "N_Yellow" :
nameColor = "00FFFF"
elif event == "N_Gray" :
nameColor = "808080"
elif event == "N_White" :
nameColor = "FFFFFF"
elif event == "T_Blue" :
titleColor = "FF0000"
elif event == "T_Red" :
titleColor = "0000FF"
elif event == "T_Cyan" :
titleColor = "FFFF00"
elif event == "T_Green" :
titleColor = "00FF00"
elif event == "T_Magenta" :
titleColor = "FF00FF"
elif event == "T_Yellow" :
titleColor = "00FFFF"
elif event == "T_Gray" :
titleColor = "808080"
elif event == "T_White" :
titleColor = "FFFFFF"
nameColor = int(nameColor,16)
titleColor = int(titleColor,16)
player.getAppearance().setNameColor(nameColor)
player.getAppearance().setTitleColor(titleColor)
st.takeItems(ItemId,ItemQty)
player.broadcastUserInfo()
player.store()
text = "done.htm"
return text
def onTalk (Self,npc,player):
st = player.getQuestState(qn)
if not st :
return "Quest is not started!"
st.setState(State.STARTED)
return "1.htm"
def onFirstTalk (Self,npc,player):
st = getQuestState(qn)
if not st : return "Invalid quest state"
QUEST = Quest(QuestId,qn,QuestDesc)
QUEST.addStartNpc(StartNpc)
QUEST.addTalkId(StartNpc)
###########################################
import sys
from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
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
#
#========================================
# DO NOT TOUCH THIS
#========================================
QuestId = 1000
QuestName = "ColorManager"
QuestDesc = "custom"
qn = "q"+str(QuestId)+"_"+str(QuestName)
#========================================
StartNpc = 50000
ItemId = 57
ItemQty = 1
MinLevel = 1
MaxLevel = 80
#========================================
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onAdvEvent(Self,event,npc,player):
text = "noaction.htm"
st = player.getQuestState(qn)
if not st : return text
if (player.getLevel() < MinLevel) or (player.getLevel() > MaxLevel) : return "charlevel.htm"
if st.getQuestItemsCount(ItemId) < ItemQty : return "nomoney.htm"
nameColor = hex(player.getAppearance().getNameColor())
titleColor = hex(player.getAppearance().getTitleColor())
st.set("nameColor",str(nameColor))
st.set("titleColor",str(titleColor))
if event == "N_Blue" :
nameColor = "FF0000"
elif event == "N_Red" :
nameColor = "0000FF"
elif event == "N_Cyan" :
nameColor = "00FF00"
elif event == "N_Magenta" :
nameColor = "FF00FF"
elif event == "N_Yellow" :
nameColor = "00FFFF"
elif event == "N_Gray" :
nameColor = "808080"
elif event == "N_White" :
nameColor = "FFFFFF"
elif event == "T_Blue" :
titleColor = "FF0000"
elif event == "T_Red" :
titleColor = "0000FF"
elif event == "T_Cyan" :
titleColor = "FFFF00"
elif event == "T_Green" :
titleColor = "00FF00"
elif event == "T_Magenta" :
titleColor = "FF00FF"
elif event == "T_Yellow" :
titleColor = "00FFFF"
elif event == "T_Gray" :
titleColor = "808080"
elif event == "T_White" :
titleColor = "FFFFFF"
nameColor = int(nameColor,16)
titleColor = int(titleColor,16)
player.getAppearance().setNameColor(nameColor)
player.getAppearance().setTitleColor(titleColor)
st.takeItems(ItemId,ItemQty)
player.broadcastUserInfo()
player.store()
text = "done.htm"
return text
def onTalk (Self,npc,player):
st = player.getQuestState(qn)
if not st :
return "Quest is not started!"
st.setState(State.STARTED)
return "1.htm"
def onFirstTalk (Self,npc,player):
st = getQuestState(qn)
if not st : return "Invalid quest state"
QUEST = Quest(QuestId,qn,QuestDesc)
QUEST.addStartNpc(StartNpc)
QUEST.addTalkId(StartNpc)