Перейти к содержанию
Авторизация  
Jumper

Не Работает Квест

Рекомендуемые сообщения

вот переделывал баффера, он прекрасно работает, на питоне, решил переделать нпс смены ника и цвета ника и титула, всё прописал правильно, но при запуски геймсервера, баффер импортируется, а нпс смены ника нет и в игре просто не работает

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
дай скрипт сюда не)

 

Скрытый текст
import sys

from java.util.regex import Pattern

from com.l2jfrozen.gameserver.datatables.sql import CharNameTable

from com.l2jfrozen.gameserver.model import L2World

from com.l2jfrozen.gameserver.model.quest import State

from com.l2jfrozen.gameserver.model.quest import QuestState

from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

from com.l2jfrozen.gameserver.util import Util

 

 

NPC = 9998

ITEM_ID = 4037

NAME_COUNT = 20

COLOR_COUNT = 20

 

class Quest (JQuest) :

def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

 

def onEvent(self,event,st) :

if event == "1":

return "1.htm"

 

if event == "2":

return "2.htm"

 

if event == "3":

return "3.htm"

 

if event == "200":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x000000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "201":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x000090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "202":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x0000ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "203":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x009000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "204":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x00ff00)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "205":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x900000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "206":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0xff0000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "207":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x009090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "208":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x0090ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "209":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x00ffff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "210":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x900090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "211":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x9000ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "212":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0xff00ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "213":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x909000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "214":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0xffff00)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "215":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0xffffff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "300":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x000000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "301":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x000090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "302":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x0000ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "303":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x009000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "304":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x00ff00)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "305":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x900000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "306":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0xff0000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "307":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x009090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "308":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x0090ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "309":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x00ffff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "310":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x900090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "311":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x9000ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "312":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0xff00ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "313":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x909000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "314":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0xffff00)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "315":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0xffffff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if not CharNameTable.getInstance().doesCharNameExist(event):

if len(event) >= 3 and len(event) <= 16 and Pattern.matches("[A-Za-z0-9\`\~\!\@\#\$\%\^\*\(\)\_\-\=\[\]\'\.\,\:\;]*", event):

if st.getPlayer().isClanLeader():

return "<html><head><body><center>!!!</center></body></html>"

if st.getPlayer().getClan():

return "<html><head><body><center>!!!</center></body></html>"

if st.getQuestItemsCount(ITEM_ID) >= NAME_COUNT:

st.takeItems(ITEM_ID,NAME_COUNT)

L2World.getInstance().removeFromAllPlayers(st.getPlayer());

st.getPlayer().setName(event);

st.getPlayer().store();

L2World.getInstance().addToAllPlayers(st.getPlayer());

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

else:

return "<html><head><body><center>!!!</center></body></html>"

else:

return "<html><head><body><center>!!!</center></body></html>"

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

def onTalk (self,npc,player):

return "0.htm"

 

QUEST = Quest(9998, "9998_Name", "custom")

CREATED = State('Start',QUEST)

 

QUEST.setInitialState(CREATED)

 

QUEST.addStartNpc(NPC)

QUEST.addTalkId(NPC)

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Скрытый текст
import sys

from java.util.regex import Pattern

from com.l2jfrozen.gameserver.datatables.sql import CharNameTable

from com.l2jfrozen.gameserver.model import L2World

from com.l2jfrozen.gameserver.model.quest import State

from com.l2jfrozen.gameserver.model.quest import QuestState

from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

from com.l2jfrozen.gameserver.util import Util

 

 

NPC = 9998

ITEM_ID = 4037

NAME_COUNT = 20

COLOR_COUNT = 20

 

class Quest (JQuest) :

def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

 

def onEvent(self,event,st) :

if event == "1":

return "1.htm"

 

if event == "2":

return "2.htm"

 

if event == "3":

return "3.htm"

 

if event == "200":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x000000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "201":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x000090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "202":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x0000ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "203":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x009000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "204":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x00ff00)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "205":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x900000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "206":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0xff0000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "207":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x009090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "208":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x0090ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "209":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x00ffff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "210":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x900090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "211":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x9000ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "212":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0xff00ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "213":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x909000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "214":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0xffff00)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "215":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0xffffff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "300":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x000000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "301":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x000090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "302":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x0000ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "303":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x009000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "304":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x00ff00)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "305":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x900000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "306":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0xff0000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "307":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x009090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "308":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x0090ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "309":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x00ffff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "310":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x900090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "311":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x9000ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "312":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0xff00ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "313":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x909000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "314":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0xffff00)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "315":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0xffffff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if not CharNameTable.getInstance().doesCharNameExist(event):

if len(event) >= 3 and len(event) <= 16 and Pattern.matches("[A-Za-z0-9\`\~\!\@\#\$\%\^\*\(\)\_\-\=\[\]\'\.\,\:\;]*", event):

if st.getPlayer().isClanLeader():

return "<html><head><body><center>!!!</center></body></html>"

if st.getPlayer().getClan():

return "<html><head><body><center>!!!</center></body></html>"

if st.getQuestItemsCount(ITEM_ID) >= NAME_COUNT:

st.takeItems(ITEM_ID,NAME_COUNT)

L2World.getInstance().removeFromAllPlayers(st.getPlayer());

st.getPlayer().setName(event);

st.getPlayer().store();

L2World.getInstance().addToAllPlayers(st.getPlayer());

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

else:

return "<html><head><body><center>!!!</center></body></html>"

else:

return "<html><head><body><center>!!!</center></body></html>"

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

def onTalk (self,npc,player):

return "0.htm"

 

QUEST = Quest(9998, "9998_Name", "custom")

CREATED = State('Start',QUEST)

 

QUEST.setInitialState(CREATED)

 

QUEST.addStartNpc(NPC)

QUEST.addTalkId(NPC)

Как то сидел на ФВ*(фрозен Ворлд). Вот остался НПЦ:

Скрытый текст
from com.l2jfrozen.gameserver.datatables.sql import CharNameTable

from com.l2jfrozen.gameserver.model import L2World

from com.l2jfrozen.gameserver.model.quest import State

from com.l2jfrozen.gameserver.model.quest import QuestState

from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

from com.l2jfrozen.gameserver.util import Util;

 

from java.util.regex import Pattern;

 

NPC = 300300

ITEM_ID = 4037

NAME_COUNT = 20

COLOR_COUNT = 20

 

class Quest (JQuest) :

def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

 

def onEvent(self,event,st) :

if event == "1":

return "1.htm"

 

if event == "2":

return "2.htm"

 

if event == "3":

return "3.htm"

 

if event == "200":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x000000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "201":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x000090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "202":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x0000ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "203":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x009000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "204":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x00ff00)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "205":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x900000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "206":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0xff0000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "207":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x009090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "208":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x0090ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "209":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x00ffff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "210":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x900090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "211":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x9000ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "212":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0xff00ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "213":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0x909000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "214":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0xffff00)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "215":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setNameColor(0xffffff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "300":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x000000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "301":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x000090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "302":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x0000ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "303":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x009000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "304":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x00ff00)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "305":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x900000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "306":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0xff0000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "307":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x009090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "308":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x0090ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "309":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x00ffff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "310":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x900090)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "311":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x9000ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "312":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0xff00ff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "313":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0x909000)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "314":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0xffff00)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if event == "315":

if st.getQuestItemsCount(ITEM_ID) >= COLOR_COUNT:

st.takeItems(ITEM_ID,COLOR_COUNT)

st.getPlayer().getAppearance().setTitleColor(0xffffff)

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

if not CharNameTable.getInstance().doesCharNameExist(event):

if len(event) >= 3 and len(event) <= 16 and Pattern.matches("[A-Za-z0-9\`\~\!\@\#\$\%\^\*\(\)\_\-\=\[\]\'\.\,\:\;]*", event):

if st.getPlayer().isClanLeader():

return "<html><head><body><center>Clan leaders no can change name!</center></body></html>"

if st.getPlayer().getClan():

return "<html><head><body><center>Clan members no can change name!</center></body></html>"

if st.getQuestItemsCount(ITEM_ID) >= NAME_COUNT:

st.takeItems(ITEM_ID,NAME_COUNT)

L2World.getInstance().removeFromAllPlayers(st.getPlayer());

st.getPlayer().setName(event);

st.getPlayer().store();

L2World.getInstance().addToAllPlayers(st.getPlayer());

st.getPlayer().broadcastUserInfo();

return "4.htm"

else:

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

else:

return "<html><head><body><center>Name is incorrect!</center></body></html>"

else:

return "<html><head><body><center>Name already exist!</center></body></html>"

return "<html><head><body><center>Item count is incorrect!</center></body></html>"

 

def onTalk (self,npc,player):

return "0.htm"

 

QUEST = Quest(8833, "8833_Name", "custom")

CREATED = State('Start',QUEST)

 

QUEST.setInitialState(CREATED)

 

QUEST.addStartNpc(NPC)

QUEST.addTalkId(NPC)

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

всё, разобрался, ща тестить буду) если кому надо скину

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти
Авторизация  

  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

×
×
  • Создать...