Перейти к содержанию

Мария

Новичок
  • Публикаций

    4
  • Зарегистрирован

  • Посещение

  • Отзывы

    0%

Весь контент Мария

  1. Тема офф сама всё сделала) До этого 1 месяц не могла сделать а щас сделала)
  2. Нужна помощь с до настройкой скрипка на перенос лс и перенос точки переносится тока с классического шмота добавленный не видно вот скрипт на перенос точки import sys from java.lang import System from com.l2jfrozen.util.database import L2DatabaseFactory 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.network.serverpackets import CharInfo from com.l2jfrozen.gameserver.network.serverpackets import InventoryUpdate from com.l2jfrozen.gameserver.network.serverpackets import ItemList from com.l2jfrozen.gameserver.network.serverpackets import UserInfo from com.l2jfrozen.gameserver.templates import L2Item qn = "q8015_Enchex" #id нпц NPC = 300300 #id итема для заточки ITEM = 4037 #стоимость заточки за каждый + COST =50 #название итема INAME = "Event Coin" #список запрещенных итемов FORBIDDEN = [12,132,6611,6612,6620,6617,6619,6618,6621,6614,6616] print "importing custom: q8015_Enchex OK" class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onAdvEvent (self,event,npc,player): st = player.getQuestState(qn) if event == "spisok": htmltext = "<html><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI.SquareBlank\" width=260 height=2><br1>" htmltext += u"<table width=260><tr><td align=center><font color=LEVEL>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438</font></td></tr></table>" htmltext += u"<button value=\"\u041e\u0440\u0443\u0436\u0438\u0435\" action=\"bypass -h Quest q8015_Enchex step1_0\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" htmltext += u"<button value=\"\u0428\u043c\u043e\u0442\u043a\u0438\" action=\"bypass -h Quest q8015_Enchex step1_1\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" htmltext += u"<button value=\"\u0411\u0438\u0436\u0443\u0442\u0435\u0440\u0438\u044f\" action=\"bypass -h Quest q8015_Enchex jewerly\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" htmltext += "<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center></body></html>" elif event.startswith("step1_"): itemType = int(event.replace("step1_", "")) htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438:<br>\u041e\u0442\u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br><br><table width=300>" if itemType == 0: TYPES = ["Sword","Blunt","Dagger","Bow","Etc","Pole","Fist","Dual Sword","Dual Fist","Big Sword","Big Blunt"] elif itemType == 1: TYPES = ["Light","Heavy","Magic"] else: htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438:<br>\u041e\u0448\u0438\u0431\u043a\u0430.</body></html>" return htmltext st.set("type",str(itemType)) for Item in st.getPlayer().getInventory().getItems(): itemTemplate = Item.getItem() idtest = Item.getItemId() itype = str(Item.getItemType()) grade = itemTemplate.getCrystalType() if idtest not in FORBIDDEN and itemTemplate.getDuration() == -1 and grade == 5 and itype in TYPES and Item.getEnchantLevel() > 0: con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitems.setInt(1, idtest) rs=listitems.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : grades = {1: "D", 2: "C", 3: "B", 4: "A", 5: "S"} pgrade = grades.get(grade, str("")) if Item.getEnchantLevel() == 0: enchant = str("") else: enchant = " +"+str(Item.getEnchantLevel())+"" htmltext += "<tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><a action=\"bypass -h Quest q8015_Enchex step1next_" + str(Item.getObjectId()) +"\">" + itemTemplate.getName() + "["+str(pgrade)+"] " + enchant + "</a></td></tr>" except : try : listitems.close() except : pass try : con.close() except : pass htmltext += u"</table><br><a action=\"bypass -h Quest q8015_Enchex spusok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" elif event == "jewerly": htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438:<br>\u041e\u0442\u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br><br><table width=300>" st.set("type","3") for Item in st.getPlayer().getInventory().getItems(): itemTemplate = Item.getItem() idtest = Item.getItemId() itemType = Item.getItem().getType2() grade = itemTemplate.getCrystalType() if idtest not in FORBIDDEN and itemTemplate.getDuration() == -1 and grade == 5 and itemType == L2Item.TYPE2_ACCESSORY and Item.getEnchantLevel() > 0: con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitems.setInt(1, idtest) rs=listitems.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : grades = {1: "D", 2: "C", 3: "B", 4: "A", 5: "S"} pgrade = grades.get(grade, str("")) if Item.getEnchantLevel() == 0: enchant = str("") else: enchant = " +"+str(Item.getEnchantLevel())+"" htmltext += "<tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><a action=\"bypass -h Quest q8015_Enchex step1next_" + str(Item.getObjectId()) +"\">" + itemTemplate.getName() + "["+str(pgrade)+"] " + enchant + "</a></td></tr>" except : try : listitems.close() except : pass try : con.close() except : pass htmltext += u"</table><br><a action=\"bypass -h Quest q8015_Enchex spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" elif event.startswith("step1next_"): itemObjId = int(event.replace("step1next_", "")) Item = st.getPlayer().getInventory().getItemByObjectId(itemObjId) itemTemplate = Item.getItem() if Item and itemTemplate.getDuration() == -1 and Item.getEnchantLevel() > 0: grade = itemTemplate.getCrystalType() idtest = Item.getItemId() con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitems.setInt(1, idtest) rs=listitems.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : st.set("enchant",str(Item.getEnchantLevel())) st.set("oneitem",str(itemObjId)) grades = {1: "d", 2: "c", 3: "b", 4: "a", 5: "s"} pgrade = grades.get(grade, str("")) enchant = (Item.getEnchantLevel() > 0 and " +"+str(Item.getEnchantLevel())+"") or str("") htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438:<br>\u041e\u0442\u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br>" htmltext += "<table width=300><tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + " " + enchant + "</font><img src=\"symbol.grade_"+str(pgrade)+"\" width=16 height=16><br></td></tr></table><br><br>" payment = int(Item.getEnchantLevel()*COST) if st.getQuestItemsCount(ITEM) < payment: htmltext += u"\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430: <font color=ff2400>"+str(payment)+"</font> "+INAME+"<br>" else: htmltext += u"\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430: <font color=adff2f>"+str(payment)+"</font> "+INAME+"<br>" htmltext += u"<button value=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c\" action=\"bypass -h Quest q8015_Enchex step2\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" htmltext += u"<br><a action=\"bypass -h Quest q8015_Enchex spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" except : try : listitems.close() except : pass try : con.close() except : pass else : htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438:<br>\u041e\u0448\u0438\u0431\u043a\u0430!<br><a action=\"bypass -h Quest q8015_Enchex spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" elif event == "step2": htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438:<br>\u041a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br><br><table width=300>" itemType = st.getInt("type") if itemType == 0: TYPES = ["Sword","Blunt","Dagger","Bow","Etc","Pole","Fist","Dual Sword","Dual Fist","Big Sword","Big Blunt"] elif itemType == 1: TYPES = ["Light","Heavy","Magic"] weapon1 = st.getInt("oneitem") for Item in st.getPlayer().getInventory().getItems(): itemTemplate = Item.getItem() idtest = Item.getItemId() itype = str(Item.getItemType()) grade = itemTemplate.getCrystalType() if itemType == 0 or itemType == 1: if idtest not in FORBIDDEN and itemTemplate.getDuration() == -1 and grade == 5 and itype in TYPES and Item.getObjectId() != weapon1: con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitems.setInt(1, idtest) rs=listitems.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : grades = {1: "[D]", 2: "[C]", 3: "", 4: "[A]", 5: ""} pgrade = grades.get(grade, str("")) if Item.getEnchantLevel() == 0: enchant = str("") else: enchant = " +"+str(Item.getEnchantLevel())+"" htmltext += "<tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><a action=\"bypass -h Quest q8015_Enchex step2next_" + str(Item.getObjectId()) +"\">" + itemTemplate.getName() + ""+str(pgrade)+" " + enchant + "</a></td></tr>" except : try : listitems.close() except : pass try : con.close() except : pass elif itemType == 3: itemType2 = Item.getItem().getType2() if idtest not in FORBIDDEN and itemTemplate.getDuration() == -1 and grade == 5 and itemType2 == L2Item.TYPE2_ACCESSORY and Item.getObjectId() != weapon1: con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitems.setInt(1, idtest) rs=listitems.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : grades = {1: "[D]", 2: "[C]", 3: "", 4: "[A]", 5: ""} pgrade = grades.get(grade, str("")) if Item.getEnchantLevel() == 0: enchant = str("") else: enchant = " +"+str(Item.getEnchantLevel())+"" htmltext += "<tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><a action=\"bypass -h Quest q8015_Enchex step2next_" + str(Item.getObjectId()) +"\">" + itemTemplate.getName() + ""+str(pgrade)+" " + enchant + "</a></td></tr>" except : try : listitems.close() except : pass try : con.close() except : pass htmltext += u"</table><br><a action=\"bypass -h Quest q8015_Enchex spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" elif event.startswith("step2next_"): itemObjId = int(event.replace("step2next_", "")) obj = str(itemObjId) Item = st.getPlayer().getInventory().getItemByObjectId(itemObjId) itemTemplate = Item.getItem() if Item and itemTemplate.getDuration() == -1: grade = itemTemplate.getCrystalType() idtest = Item.getItemId() con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitems.setInt(1, idtest) rs=listitems.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : st.set("twoitem",obj) grades = {1: "d", 2: "c", 3: "b", 4: "a", 5: "s"} pgrade = grades.get(grade, str("")) enchant = (Item.getEnchantLevel() > 0 and " +"+str(Item.getEnchantLevel())+"") or str("") htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438:<br>\u0412 \u044d\u0442\u043e \u043e\u0440\u0443\u0436\u0438\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br>" htmltext += "<table width=300><tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + " " + enchant + "</font><img src=\"symbol.grade_"+str(pgrade)+"\" width=16 height=16><br></td></tr></table><br><br>" htmltext += u"<button value=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c\" action=\"bypass -h Quest q8015_Enchex step3\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" htmltext += u"<br><a action=\"bypass -h Quest q8015_Enchex spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" except : try : listitems.close() except : pass try : con.close() except : pass else : htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438:<br>\u041e\u0448\u0438\u0431\u043a\u0430!<br><a action=\"bypass -h Quest q8015_Enchex spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" elif event.startswith("step3"): weapon1 = st.getInt("oneitem") weapon2 = st.getInt("twoitem") htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438:<br>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0435?<br>" htmltext += u"\u0421 \u044d\u0442\u043e\u0433\u043e \u043e\u0440\u0443\u0436\u0438\u044f:" Item = st.getPlayer().getInventory().getItemByObjectId(weapon1) itemTemplate = Item.getItem() if Item: grade = itemTemplate.getCrystalType() idtest = Item.getItemId() con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitems.setInt(1, idtest) rs=listitems.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : grades = {1: "d", 2: "c", 3: "b", 4: "a", 5: "s"} pgrade = grades.get(grade, str("")) enchant = (Item.getEnchantLevel() > 0 and " +"+str(Item.getEnchantLevel())+"") or str("") htmltext += "<table width=300><tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + " " + enchant + "</font><img src=\"symbol.grade_"+str(pgrade)+"\" width=16 height=16><br></td></tr></table><br><br>" payment = int(Item.getEnchantLevel()*COST) if st.getQuestItemsCount(ITEM) < payment: htmltext += u"\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430: <font color=ff2400>"+str(payment)+"</font> "+INAME+"<br>" else: htmltext += u"\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430: <font color=adff2f>"+str(payment)+"</font> "+INAME+"<br>" except : try : listitems.close() except : pass try : con.close() except : pass htmltext += "Ha eTo:<br>" Item = st.getPlayer().getInventory().getItemByObjectId(weapon2) itemTemplate = Item.getItem() if Item: grade = itemTemplate.getCrystalType() idtest = Item.getItemId() cons=L2DatabaseFactory.getInstance().getConnection() listitemss=cons.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitemss.setInt(1, idtest) rs=listitemss.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : grades = {1: "d", 2: "c", 3: "b", 4: "a", 5: "s"} pgrade = grades.get(grade, str("")) enchant = (Item.getEnchantLevel() > 0 and " +"+str(Item.getEnchantLevel())+"") or str("") htmltext += "<table width=300><tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + " " + enchant + "</font><img src=\"symbol.grade_"+str(pgrade)+"\" width=16 height=16><br></td></tr></table><br><br>" except : try : listitemss.close() except : pass try : cons.close() except : pass htmltext += u"<button value=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c\" action=\"bypass -h Quest q8015_Enchex step4\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" else : htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438:<br>\u041e\u0448\u0438\u0431\u043a\u0430!<br><a action=\"bypass -h Quest q8015_Enchex spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" elif event.startswith("step4"): htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438:<br>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435...<br><br>" ench = st.getInt("enchant") payment = int(ench*COST) if st.getQuestItemsCount(ITEM) < payment: htmltext += u"\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430: <font color=ff2400>"+str(payment)+"</font> "+INAME+"<br>" return htmltext #< weapon1 = st.getInt("oneitem") weapon2 = st.getInt("twoitem") item1 = st.getPlayer().getInventory().getItemByObjectId(weapon1) item2 = st.getPlayer().getInventory().getItemByObjectId(weapon2) if item1 == None or item2 == None: st.set("enchant","0") htmltext += u"<font color=ff2400>\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430.</font><br>" return htmltext itemType = st.getInt("type") itype1 = str(item1.getItemType()) itype2 = str(item2.getItemType()) grade1 = item1.getItem().getCrystalType() grade2 = item2.getItem().getCrystalType() #< if item1.getEnchantLevel() != ench: st.set("enchant","0") htmltext += u"<font color=ff2400>\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430.</font><br>" return htmltext #< if grade1 != 5 or grade2 != 5: st.set("enchant","0") htmltext += u"<font color=ff2400>\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430.</font><br>" return htmltext #< if itemType == 0: TYPES = ["Sword","Blunt","Dagger","Bow","Etc","Pole","Fist","Dual Sword","Dual Fist","Big Sword","Big Blunt"] if itype1 not in TYPES or itype2 not in TYPES: st.set("enchant","0") htmltext += u"<font color=ff2400>\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430.</font><br>" return htmltext elif itemType == 1: TYPES = ["Light","Heavy","Magic"] if itype1 not in TYPES or itype2 not in TYPES: st.set("enchant","0") htmltext += u"<font color=ff2400>\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430.</font><br>" return htmltext elif itemType == 3: jew1 = item1.getItem().getType2() jew2 = item2.getItem().getType2() if jew1 != L2Item.TYPE2_ACCESSORY or jew2 != L2Item.TYPE2_ACCESSORY: st.set("enchant","0") htmltext += u"<font color=ff2400>\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430.</font><br>" return htmltext else: htmltext += u"<font color=ff2400>\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430.</font><br>" return htmltext #< st.takeItems(ITEM,payment) #< slott = item1.getEquipSlot() if slott > 0: testt = player.getInventory().getPaperdollItem(slott) player.getInventory().unEquipItemInSlotAndRecord(slott) item1.setEnchantLevel(0) player.getInventory().equipItemAndRecord(testt) iut = InventoryUpdate() iut.addModifiedItem(testt) player.sendPacket(iut) player.broadcastPacket(CharInfo(player)) player.sendPacket(UserInfo(player)) else: item1.setEnchantLevel(0) player.sendPacket(ItemList(player, False)) #< slot = item2.getEquipSlot() if slot > 0: test = player.getInventory().getPaperdollItem(slot) player.getInventory().unEquipItemInSlotAndRecord(slot) item2.setEnchantLevel(ench) player.getInventory().equipItemAndRecord(test) iu = InventoryUpdate() iu.addModifiedItem(test) player.sendPacket(iu) player.broadcastPacket(CharInfo(player)) player.sendPacket(UserInfo(player)) else: item2.setEnchantLevel(ench) player.sendPacket(ItemList(player, False)) htmltext += u"<font color=bef574>[ +"+str(ench)+"]</font> "u"\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d\u043e.<br>" else: htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0437\u0430\u0442\u043e\u0447\u043a\u0438:<br>Oops!</body></html>" return htmltext def onTalk (self,npc,player): st = player.getQuestState(qn) npcId = npc.getNpcId() if npcId == NPC: htmltext = "privetstvie.htm" return htmltext QUEST = Quest(8015,qn,"custom") CREATED = State('Start', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(NPC) QUEST.addTalkId(NPC) вот на перенос лс import sys from java.util import Iterator from com.l2jfrozen.util.random import Rnd from com.l2jfrozen.gameserver.network.serverpackets import SystemMessage 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.util.database import L2DatabaseFactory from com.l2jfrozen.gameserver.templates import L2EtcItemType from com.l2jfrozen.gameserver.templates import L2Item from java.lang import System from com.l2jfrozen.gameserver.idfactory import IdFactory from com.l2jfrozen.gameserver.model.actor.instance import L2ItemInstance from com.l2jfrozen.gameserver.datatables.xml import AugmentationData from com.l2jfrozen.gameserver.model import L2Augmentation from com.l2jfrozen.gameserver.network.serverpackets import ItemList from com.l2jfrozen.gameserver.model import L2Skill from com.l2jfrozen.gameserver.datatables import SkillTable qn = "q8014_LifeStone" #id нпц NPC = 300300 #id итема для переноса ITEM = 4037 #стоимость переноса COST = 50 #список запрещенных итемов FORBIDDEN = [6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621] print "importing custom: q8014_LifeStone OK" class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onAdvEvent (self,event,npc,player): st = player.getQuestState(qn) if event == "spisok": if st.getQuestItemsCount(ITEM) < COST: htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421 \u0441\u0442\u043e\u0438\u0442<font color=74bff5>"+str(COST)+" Event Coin</font></body></html>" return htmltext htmltext = "<html><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI.SquareBlank\" width=260 height=2><br1>" htmltext += u"<table width=260><tr><td align=center><font color=LEVEL>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421</font></td></tr></table>" htmltext += u"<button value=\"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u0440\u0443\u0436\u0438\u0435\" action=\"bypass -h Quest q8014_LifeStone step1\" width=80 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br1>" htmltext += "<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center></body></html>" elif event == "step1": htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041e\u0442\u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br><br><table width=300>" SPWEAPONS = ["Sword","Blunt","Dagger","Bow","Etc","Pole","Fist","Dual Sword","Dual Fist","Big Sword","Big Blunt"] for Item in st.getPlayer().getInventory().getItems(): itemTemplate = Item.getItem() idtest = Item.getItemId() itype = str(Item.getItemType()) if idtest not in FORBIDDEN and Item.isAugmented() and not Item.isEquipped() and itype in SPWEAPONS: cnt = Item.getCount() count = str(cnt) grade = itemTemplate.getCrystalType() con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitems.setInt(1, idtest) rs=listitems.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : if grade == 1: pgrade = str("[D]") elif grade == 2: pgrade = str("[C]") elif grade == 3: pgrade = str("") elif grade == 4: pgrade = str("[A]") elif grade == 5: pgrade = str("") else: pgrade = str("") if Item.getEnchantLevel() == 0: enchant = str("") else: enchant = " +"+str(Item.getEnchantLevel())+"" htmltext += "<tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><a action=\"bypass -h Quest q8014_LifeStone step1next_" + str(Item.getObjectId()) +"\">" + itemTemplate.getName() + ""+str(pgrade)+" " + enchant + "</a></td></tr>" except : try : insertion.close() except : pass try : con.close() except : pass htmltext += u"</table><br><a action=\"bypass -h Quest q8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" elif event.startswith("step1next_"): itemObjId = int(event.replace("step1next_", "")) obj = str(itemObjId) Item = st.getPlayer().getInventory().getItemByObjectId(itemObjId) itemTemplate = Item.getItem() if Item and not Item.isEquipped(): cnt = Item.getCount() count = str(cnt) grade = itemTemplate.getCrystalType() igrade = str(itemTemplate.getCrystalType()) itype = str(Item.getItemType()) idtest = Item.getItemId() con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT itemIcon, skill, attributes FROM `z_market_icons` icon, `augmentations` aug WHERE icon.itemId=? AND aug.item_id=?") listitems.setInt(1, idtest) listitems.setInt(2, itemObjId) rs=listitems.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") skill=rs.getInt("skill") attributes=rs.getInt("attributes") try : st.set("oneitem",obj) st.set("skill",str(skill)) grades = {1: "d", 2: "c", 3: "b", 4: "a", 5: "s"} pgrade = grades.get(grade, str("")) enchant = (Item.getEnchantLevel() > 0 and " +"+str(Item.getEnchantLevel())+"") or str("") htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u043e\u0440\u0443\u0436\u0438\u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br>" htmltext += "<table width=300><tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + " " + enchant + "</font><img src=\"symbol.grade_"+str(pgrade)+"\" width=16 height=16><br></td></tr></table><br><br>" if skill != 0: skill = SkillTable.getInstance().getInfo(skill, 1) name = skill.getName() htmltext += "<br><font color=bef574>["+str(name)+"]</font><br>" htmltext += u"<button value=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c\" action=\"bypass -h Quest q8014_LifeStone step2\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" else: htmltext += u"\u0412 \u044d\u0442\u043e\u043c \u043e\u0440\u0443\u0436\u0438\u0435 \u043d\u0435\u0442 \u0441\u043a\u0438\u043b\u043b\u0430" htmltext += u"<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" except : try : listitems.close() except : pass try : con.close() except : pass else : htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041e\u0448\u0438\u0431\u043a\u0430!<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" elif event == "step2": htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br><br><table width=300>" SPWEAPONS = ["Sword","Blunt","Dagger","Bow","Etc","Pole","Fist","Dual Sword","Dual Fist","Big Sword","Big Blunt"] weapon1 = st.getInt("oneitem") for Item in st.getPlayer().getInventory().getItems(): itemTemplate = Item.getItem() idtest = Item.getItemId() itype = str(Item.getItemType()) if idtest not in FORBIDDEN and not Item.isEquipped() and itype in SPWEAPONS and Item.getObjectId() != weapon1 and not Item.isAugmented(): grade = itemTemplate.getCrystalType() con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitems.setInt(1, idtest) rs=listitems.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : if grade == 1: pgrade = str("[D]") elif grade == 2: pgrade = str("[C]") elif grade == 3: pgrade = str("") elif grade == 4: pgrade = str("[A]") elif grade == 5: pgrade = str("") else: pgrade = str("") if Item.getEnchantLevel() == 0: enchant = str("") else: enchant = " +"+str(Item.getEnchantLevel())+"" htmltext += "<tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><a action=\"bypass -h Quest q8014_LifeStone step2next_" + str(Item.getObjectId()) +"\">" + itemTemplate.getName() + ""+str(pgrade)+" " + enchant + "</a></td></tr>" except : try : insertion.close() except : pass try : con.close() except : pass htmltext += u"</table><br><a action=\"bypass -h Quest q8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" elif event.startswith("step2next_"): itemObjId = int(event.replace("step2next_", "")) obj = str(itemObjId) Item = st.getPlayer().getInventory().getItemByObjectId(itemObjId) itemTemplate = Item.getItem() if Item and not Item.isAugmented() and not Item.isEquipped(): cnt = Item.getCount() count = str(cnt) grade = itemTemplate.getCrystalType() igrade = str(itemTemplate.getCrystalType()) itype = str(Item.getItemType()) idtest = Item.getItemId() con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitems.setInt(1, idtest) rs=listitems.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : st.set("twoitem",obj) st.set("lcount",count) st.set("grade",igrade) st.set("type",itype) grades = {1: "d", 2: "c", 3: "b", 4: "a", 5: "s"} pgrade = grades.get(grade, str("")) enchant = (Item.getEnchantLevel() > 0 and " +"+str(Item.getEnchantLevel())+"") or str("") htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u0412 \u044d\u0442\u043e \u043e\u0440\u0443\u0436\u0438\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br>" htmltext += "<table width=300><tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + " " + enchant + "</font><img src=\"symbol.grade_"+str(pgrade)+"\" width=16 height=16><br></td></tr></table><br><br>" htmltext += u"<button value=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c\" action=\"bypass -h Quest q8014_LifeStone step3\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" htmltext += u"<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" except : try : listitems.close() except : pass try : con.close() except : pass else : htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041e\u0448\u0438\u0431\u043a\u0430!<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" elif event.startswith("step3"): weapon1 = st.getInt("oneitem") weapon2 = st.getInt("twoitem") skillp = st.getInt("skill") htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u043c?<br>" skill = SkillTable.getInstance().getInfo(skillp, 1) name = skill.getName() htmltext += "<font color=bef574>["+str(name)+"]</font><br>" htmltext += u"\u0438\u0437:" Item = st.getPlayer().getInventory().getItemByObjectId(weapon1) itemTemplate = Item.getItem() if Item and Item.isAugmented() and not Item.isEquipped(): cnt = Item.getCount() count = str(cnt) grade = itemTemplate.getCrystalType() igrade = str(itemTemplate.getCrystalType()) itype = str(Item.getItemType()) idtest = Item.getItemId() con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitems.setInt(1, idtest) rs=listitems.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : grades = {1: "d", 2: "c", 3: "b", 4: "a", 5: "s"} pgrade = grades.get(grade, str("")) enchant = (Item.getEnchantLevel() > 0 and " +"+str(Item.getEnchantLevel())+"") or str("") htmltext += "<table width=300><tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + " " + enchant + "</font><img src=\"symbol.grade_"+str(pgrade)+"\" width=16 height=16><br></td></tr></table><br><br>" except : try : listitems.close() except : pass try : con.close() except : pass htmltext += "6=B:<br>" Item = st.getPlayer().getInventory().getItemByObjectId(weapon2) itemTemplate = Item.getItem() if Item and not Item.isAugmented() and not Item.isEquipped(): cnt = Item.getCount() count = str(cnt) grade = itemTemplate.getCrystalType() igrade = str(itemTemplate.getCrystalType()) itype = str(Item.getItemType()) idtest = Item.getItemId() cons=L2DatabaseFactory.getInstance().getConnection() listitemss=cons.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?") listitemss.setInt(1, idtest) rs=listitemss.executeQuery() while (rs.next()) : icon=rs.getString("itemIcon") try : grades = {1: "d", 2: "c", 3: "b", 4: "a", 5: "s"} pgrade = grades.get(grade, str("")) enchant = (Item.getEnchantLevel() > 0 and " +"+str(Item.getEnchantLevel())+"") or str("") htmltext += "<table width=300><tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + " " + enchant + "</font><img src=\"symbol.grade_"+str(pgrade)+"\" width=16 height=16><br></td></tr></table><br><br>" except : try : listitemss.close() except : pass try : cons.close() except : pass htmltext += u"<button value=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c\" action=\"bypass -h Quest q8014_LifeStone step4\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" else : htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041e\u0448\u0438\u0431\u043a\u0430!<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>" elif event.startswith("step4"): weapon1 = st.getInt("oneitem") weapon2 = st.getInt("twoitem") htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435...<br><br>" if st.getQuestItemsCount(ITEM) < COST: htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421 \u0441\u0442\u043e\u0438\u0442<font color=74bff5>"+str(COST)+" Event Coin</font></body></html>" return htmltext item2 = st.getPlayer().getInventory().getItemByObjectId(weapon2) item1 = st.getPlayer().getInventory().getItemByObjectId(weapon1) con=L2DatabaseFactory.getInstance().getConnection() listitems=con.prepareStatement("SELECT * FROM `augmentations` WHERE item_id=?") listitems.setInt(1, weapon1) rs=listitems.executeQuery() while (rs.next()) : attributes=rs.getInt("attributes") skill=rs.getInt("skill") try : st.takeItems(ITEM,COST) item2.setAugmentation(L2Augmentation(item2, attributes, skill, 10, True)) player.sendPacket(ItemList(player, False)) item1.removeAugmentation() skilla = SkillTable.getInstance().getInfo(skill, 1) name = skilla.getName() htmltext += u"<font color=bef574>["+str(name)+"]</font> "u"\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043d.<br>" except : try : listitems.close() except : pass try : con.close() except : pass else: htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>Oops!</body></html>" return htmltext def onTalk (self,npc,player): st = player.getQuestState(qn) npcId = npc.getNpcId() if npcId == NPC: htmltext = "privetstvie.htm" return htmltext QUEST = Quest(8014,qn,"custom") CREATED = State('Start', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(NPC) QUEST.addTalkId(NPC) что надо добавить или изменить чтоб переносить с добавленых шмоток?
  3. В лс не могу написать надо минимум 15 постов
  4. Помогите найти щит с L2Club.ru очень нужен)
×
×
  • Создать...