TEPAH0BA 45 Опубликовано 29 октября, 2017 Доброе утро, я уже создавал тему сегодня ночью, но модератор Demoncool удалил без пояснения на вопрос в личку включает морозку ). Ну доладно, я еще создам мне что. Сборка: PWSoft В общем скрипт :Трейд через нпц или q8037_SafetyTrader Кнопка вызова скрипта: <br><a action="bypass -h Quest q8037_SafetyTrader step1">Продолжить</a> ( скрин 1, скрин 2, скрин 3 загрузка в консоле ) Все дальше нечего не происходит , не вещь тебе положить не броню и тд . Хотел под спойлер, но скрин 4 : пишет недопустимое значения файла [spoiler=Сам скрипт] import sys from java.lang import System from net.sf.l2j import L2DatabaseFactory from net.sf.l2j.gameserver.datatables import AugmentationData from net.sf.l2j.gameserver.datatables import SkillTable from net.sf.l2j.gameserver.model import L2Augmentation from net.sf.l2j.gameserver.model import L2Skill from net.sf.l2j.gameserver.model import L2World 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.network import SystemMessageId from net.sf.l2j.gameserver.network.serverpackets import ItemList from net.sf.l2j.gameserver.network.serverpackets import SystemMessage from net.sf.l2j.gameserver.templates import L2EtcItemType from net.sf.l2j.gameserver.templates import L2Item qn = "q8037_SafetyTrader" NPC = 80007 FORBIDDEN = [6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621] #плата, ид итема COL = 4355 #цена PAYMENT = 3 # на что меняем колы и прочее OTHER = [4037,4355] class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def init_LoadGlobalData(self) : print "q8037_SafetyTrader (Comercial) loaded." return def onAdvEvent (self,event,npc,player): st = player.getQuestState(qn) if event == "step1": try: obj = player.getObjectId() con=L2DatabaseFactory.getInstance().getConnection() chkChar=con.prepareStatement("SELECT * FROM `z_safety_trade` WHERE `char1` = ? OR `char2` = ? LIMIT 1") chkChar.setInt(1, obj) chkChar.setInt(2, obj) rs=chkChar.executeQuery() if (rs.next()) : tradeId=rs.getInt("id") char1Id=rs.getInt("char1") char1Name=rs.getString("char1name") item1Id=rs.getInt("item1") item1Name=rs.getString("item1name") pre1ench=rs.getInt("ench1") aug1Eff=rs.getInt("augm1eff") aug1Skl=rs.getInt("augm1skill") aug1Lvl=rs.getInt("augm1lvl") status1=rs.getLong("status1") char2Id=rs.getInt("char2") char2Name=rs.getString("char2name") item2Id=rs.getInt("item2") item2Name=rs.getString("item2name") pre2ench=rs.getInt("ench2") item2count=rs.getInt("item2count") aug2Eff=rs.getInt("augm2eff") aug2Skl=rs.getInt("augm2skill") aug2Lvl=rs.getInt("augm2lvl") status2=rs.getLong("status2") ctype=rs.getLong("ctype") #< if obj == char1Id: if status1 == 0: enchant = (pre1ench > 0 and "+"+str(pre1ench)+"") or str("+0") augment = "нет." if aug1Skl > 0: haveSkill = SkillTable.getInstance().getInfo(aug1Skl, 1) if haveSkill != None: if haveSkill.isPassive(): skilltype = "[Passive" elif haveSkill.isChance(): skilltype = "[Chance" else: skilltype = "[Active" skillname = haveSkill.getName() + " " + skilltype + ":"+ str(aug1Lvl) +"Lvl]" augment = skillname.replace("Item Skill: ","") brokeItem = ItemTable.getInstance().getTemplate(item1Id) htmltext = "<html><body>Ожидаем партнера.<br> Если вы передумали, то можете забрать шмотку." htmltext += "<table width=300><tr><td><img src=\""+brokeItem.getIcon()+"\" width=32 height=32></td><td><font color=LEVEL>" + item1Name + "</font><br>Заточка: " + enchant + "<br>Аугмент: " + augment + "</td></tr></table><br><br>" htmltext += "<button value=\"Забрать\" action=\"bypass -h Quest q8037_SafetyTrader cancel\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></body></html>" return htmltext if status1 > 123456 and (System.currentTimeMillis() - status1 > 300000): reason = "" if status2 == 0: try : con2=L2DatabaseFactory.getInstance().getConnection() zabiraem=con2.prepareStatement("DELETE FROM `z_safety_trade` WHERE `id`=?") zabiraem.setInt(1, tradeId) zabiraem.executeUpdate() except: pass finally: zabiraem.close() con2.close() reason = "Партнер так и не выставил шмотку" else: try: con3=L2DatabaseFactory.getInstance().getConnection() lockitem=con3.prepareStatement("UPDATE `z_safety_trade` SET `char1`=?,`char1name`=?,`item1`=?,`item1name`=?,`ench1`=?,`augm1eff`=?,`augm1skill`=?,`augm1lvl`=? WHERE `id`=?") lockitem.setInt(1, 0) lockitem.setString(2, "") lockitem.setInt(3, 0) lockitem.setString(4, "") lockitem.setInt(5, 0) lockitem.setInt(6, 0) lockitem.setInt(7, 0) lockitem.setInt(8, 0) lockitem.setInt(9, tradeId) lockitem.executeUpdate() except: pass finally: lockitem.close() con3.close() reason = "Вы не подтвердили шмотку партнера" #< item = player.getInventory().addItem("q8037_SafetyTrader", item1Id, 1, player, player.getTarget()) if pre1ench != 0: item.setEnchantLevel(pre1ench) if aug1Skl != 0: item.setAugmentation(L2Augmentation(item, aug1Eff, aug1Skl, aug1Lvl, True)) smsg = SystemMessage(SystemMessageId.EARNED_S2_S1_S) smsg.addItemName(item1Id) smsg.addNumber(1) player.sendPacket(smsg) player.sendPacket(ItemList(player, False)) htmltext = "<html><body>Время истекло! <br1>"+reason+"</body></html>" return htmltext #< if status2 == 0 and char2Id > 0: htmltext = "<html><body>Ждем, пока партнер подтвердит шмотку.</body></html>" return htmltext if status2 == 777: htmltext = "<html><body>Шаг 6. Партнер выставил шмотку!<br>" enchant = (pre2ench > 0 and "+"+str(pre2ench)+"") or str("+0") augment = "нет." if aug2Skl > 0: haveSkill = SkillTable.getInstance().getInfo(aug2Skl, 1) if haveSkill != None: if haveSkill.isPassive(): skilltype = "[Passive" elif haveSkill.isChance(): skilltype = "[Chance" else: skilltype = "[Active" skillname = haveSkill.getName() + " " + skilltype + ":"+ str(aug2Lvl) +"Lvl]" augment = skillname.replace("Item Skill: ","") brokeItem = ItemTable.getInstance().getTemplate(item2Id) htmltext += "Параметры:<br>Игрок:" + char2Name + "" if item2count > 1: s = str(item2count) for i in xrange(len(s)-3,s[0] in ('+','-'),-3): s=s[:i]+','+s[i:] item2count = "<font color=00CCFF>"+str(s)+"</font>" htmltext += "<table width=300><tr><td><img src=\""+brokeItem.getIcon()+"\" width=32 height=32></td><td><font color=LEVEL>" + item2Name + "</font><br>Количество: " + str(item2count) + " штук</td></tr></table><br><br>" else: htmltext += "<table width=300><tr><td><img src=\""+brokeItem.getIcon()+"\" width=32 height=32></td><td><font color=LEVEL>" + item2Name + "</font><br>Заточка: " + enchant + "<br>Аугмент: " + augment + "</td></tr></table><br><br>" htmltext += "<br>Это то, что вы хотели?<br1>" htmltext += "<button value=\"Продолжить\" action=\"bypass -h Quest q8037_SafetyTrader finish\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br><br>" htmltext += "<button value=\"Нет!\" action=\"bypass -h Quest q8037_SafetyTrader cancel\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></body></html>" return htmltext elif obj == char2Id: if status1 == 777: if item1Id != COL: if st.getQuestItemsCount(COL) < PAYMENT: htmltext = "<html><body>Стоимость услуги: "+str(PAYMENT)+" Coin of Luck</body></html>" return htmltext st.takeItems(COL,PAYMENT) try : con2=L2DatabaseFactory.getInstance().getConnection() zabiraem=con2.prepareStatement("DELETE FROM `z_safety_trade` WHERE `id`=?") zabiraem.setInt(1, tradeId) zabiraem.executeUpdate() except: pass finally: zabiraem.close() con2.close() #< item = player.getInventory().addItem("q8037_SafetyTrader", item1Id, 1, player, player.getTarget()) if pre1ench != 0: item.setEnchantLevel(pre1ench) if aug1Skl != 0: item.setAugmentation(L2Augmentation(item, aug1Eff, aug1Skl, aug1Lvl, True)) smsg = SystemMessage(SystemMessageId.EARNED_S2_S1_S) smsg.addItemName(item1Id) smsg.addNumber(1) player.sendPacket(smsg) player.sendPacket(ItemList(player, False)) htmltext = "<html><body>Партнер подтвердил шмотку, Сделка завершена!</body></html>" return htmltext if status2 == 777: htmltext = "<html><body>!<br>" htmltext += "Ждем, когда партнер подтвердит вашу шмотку.</body></html>" return htmltext if status1 > 0 and (System.currentTimeMillis() - status1 < 300000): htmltext = "<html><body>Шаг4. Подтверждение вещи" enchant = (pre1ench > 0 and "+"+str(pre1ench)+"") or str("+0") augment = "нет." if aug1Skl > 0: haveSkill = SkillTable.getInstance().getInfo(aug1Skl, 1) if haveSkill != None: if haveSkill.isPassive(): skilltype = "[Passive" elif haveSkill.isChance(): skilltype = "[Chance" else: skilltype = "[Active" skillname = haveSkill.getName() + " " + skilltype + ":"+ str(aug1Lvl) +"Lvl]" augment = skillname.replace("Item Skill: ","") brokeItem = ItemTable.getInstance().getTemplate(item1Id) htmltext += "Параметры:<br>Игрок:" + char1Name + "" htmltext += "<table width=300><tr><td><img src=\""+brokeItem.getIcon()+"\" width=32 height=32></td><td><font color=LEVEL>" + item1Name + "</font><br>Заточка: " + enchant + "<br>Аугмент: " + augment + "</td></tr></table><br><br>" if (ctype == 1): htmltext += "Подарок. Забираем?<br1>" htmltext += "<button value=\"Забираем\" action=\"bypass -h Quest q8037_SafetyTrader step4next_"+str(tradeId)+"\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" elif (ctype == 2): st.set("tradeId",str(tradeId)) st.set("char1Id",str(char1Id)) htmltext += "Обмен. Это то, что вы хотели?<br1>" htmltext += "<button value=\"Продолжить\" action=\"bypass -h Quest q8037_SafetyTrader step5\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" htmltext += "<button value=\"Не нужна!\" action=\"bypass -h Quest q8037_SafetyTrader cancel\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></body></html>" return htmltext if status1 > 123456 and (System.currentTimeMillis() - status1 > 300000): if status2 == 0: htmltext = "<html><body>Время истекло! Вы так и не выставили шмотку на обмен.</body></html>" return htmltext if item1Id > 0: con3=L2DatabaseFactory.getInstance().getConnection() lockitem=con3.prepareStatement("UPDATE `z_safety_trade` SET `char2`=?,`char2name`=?,`item2`=?, `item2name`=?, `item2count`=?,`ench2`=?,`augm2eff`=?,`augm2skill`=?,`augm2lvl`=? WHERE `id`=?") lockitem.setInt(1, 0) lockitem.setString(2, "") lockitem.setInt(3, 0) lockitem.setString(4, "") lockitem.setInt(5, 0) lockitem.setInt(6, 0) lockitem.setInt(7, 0) lockitem.setInt(8, 0) lockitem.setInt(9, 0) lockitem.setInt(10, tradeId) try : lockitem.executeUpdate() lockitem.close() con3.close() except : try : con3.close() except : pass else: try : con2=L2DatabaseFactory.getInstance().getConnection() zabiraem=con2.prepareStatement("DELETE FROM `z_safety_trade` WHERE `id`=?") zabiraem.setInt(1, tradeId) zabiraem.executeUpdate() except: pass finally: zabiraem.close() con2.close() #< item = player.getInventory().addItem("q8037_SafetyTrader", item2Id, item2count, player, player.getTarget()) if pre2ench != 0: item.setEnchantLevel(pre2ench) if aug2Skl != 0: item.setAugmentation(L2Augmentation(item, aug2Eff, aug2Skl, aug2Lvl, True)) smsg = SystemMessage(SystemMessageId.EARNED_S2_S1_S) smsg.addItemName(item2Id) smsg.addNumber(item2count) player.sendPacket(smsg) player.sendPacket(ItemList(player, False)) htmltext = "<html><body>Время истекло! Партнер так и не подтвердил вашу шмотку.</body></html>" return htmltext rs.close() #except: #htmltext = "<html><body>Ошибка!</body></html>" #return htmltext finally: chkChar.close() con.close() #< st.unset("tradeId") htmltext = "<html><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI.SquareBlank\" width=260 height=2></center><br>" htmltext += "<font color=LEVEL>Если вы собираетесь начать обмен, выберите вещь</font><br>" htmltext += "Оружие:<br1>" htmltext += "<button value=\"Аугментированное.\" action=\"bypass -h Quest q8037_SafetyTrader augment_1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br><br>" htmltext += "<font color=LEVEL>Если вас уже ждут, то сюда</font><br>" htmltext += "<button value=\"Войти с паролем\" action=\"bypass -h Quest q8037_SafetyTrader step3next\" width=90 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("enchanted_"): chType = int(event.replace("enchanted_", "")) htmltext = "<html><body>Шаг 1.<br>Что передаем/меняем?<br><br><table width=300>" st.unset("oneitem") st.unset("skill") st.unset("enchant") if chType > 3: # каг? htmltext = "<html><body>Ошибка.</body></html>" return htmltext for Item in player.getInventory().getItems(): itemTemplate = Item.getItem() itemId = itemTemplate.getItemId() itemType = itemTemplate.getType2() itemGrade = itemTemplate.getCrystalType() preench = Item.getEnchantLevel() if preench > 0 and itemType == chType and itemId not in FORBIDDEN and itemTemplate.getDuration() == -1 and itemGrade > 3 and not Item.isEquipped(): augment = "нет." brokeItem = ItemTable.getInstance().getTemplate(itemId) enchant = (preench > 0 and "+"+str(preench)+"") or str("+0") if Item.isAugmented(): haveSkill = itemTemplate.getAugmentation.getSkill() if haveSkill != None: if haveSkill.isPassive(): skilltype = "[Passive]" elif haveSkill.isChance(): skilltype = "[Chance]" else: skilltype = "[Active]" skillname = haveSkill.getName()+" "+skilltype augment = skillname.replace("Item Skill: ","") htmltext += "<tr><td><img src=\""+brokeItem.getIcon()+"\" width=32 height=32></td><td><a action=\"bypass -h Quest q8037_SafetyTrader step2_" + str(Item.getObjectId()) +"_1\">" + itemTemplate.getName() + "</a> " + enchant + "<br1>Аугмент: " + augment + "</td></tr>" htmltext += "</table><br><a action=\"bypass -h Quest q8037_SafetyTrader step1\">Вернуться.</a></body></html>" elif event.startswith("augment_"): chType = int(event.replace("augment_", "")) if st.getQuestItemsCount(COL) < PAYMENT: htmltext = "<html><body>Стоимость услуги: "+str(PAYMENT)+" Coin of Luck</body></html>" return htmltext htmltext = "<html><body>Шаг 1.<br>Что передаем/меняем?<br><br><table width=300>" st.unset("oneitem") st.unset("skill") st.unset("enchant") for Item in player.getInventory().getItems(): itemTemplate = Item.getItem() itemId = itemTemplate.getItemId() itemGrade = itemTemplate.getCrystalType() preench = Item.getEnchantLevel() if Item.isAugmented() and Item.getAugmentation().getSkill() != None and itemId not in FORBIDDEN and itemGrade > 3 and not Item.isEquipped(): brokeItem = ItemTable.getInstance().getTemplate(itemId) enchant = (preench > 0 and "+"+str(preench)+"") or str("+0") haveSkill = Item.getAugmentation().getSkill() if haveSkill != None: if haveSkill.isPassive(): skilltype = "[Passive" elif haveSkill.isChance(): skilltype = "[Chance" else: skilltype = "[Active" skillname = haveSkill.getName()+" "+skilltype+":"+str(haveSkill.getLevel())+"lvl]" augment = skillname.replace("Item Skill: ","") htmltext += "<tr><td><img src=\""+brokeItem.getIcon()+"\" width=32 height=32></td><td><a action=\"bypass -h Quest q8037_SafetyTrader step2_" + str(Item.getObjectId()) +"_2\">" + itemTemplate.getName() + "</a> " + enchant + "<br1>Аугмент: " + augment + "</td></tr>" htmltext += "</table><br><a action=\"bypass -h Quest q8037_SafetyTrader step1\">Вернуться.</a></body></html>" elif event == "other": htmltext = "<html><body>Шаг 1.<br>Что передаем/меняем?<br><br><table width=300>" st.unset("oneitem") st.unset("skill") st.unset("enchant") for Item in player.getInventory().getItems(): itemTemplate = Item.getItem() itemId = itemTemplate.getItemId() if itemId in OTHER: brokeItem = ItemTable.getInstance().getTemplate(itemId) count = Item.getCount() s = str(count) for i in xrange(len(s)-3,s[0] in ('+','-'),-3): s=s[:i]+','+s[i:] count = "<font color=00CCFF>"+str(s)+"</font>" htmltext += "<tr><td><img src=\""+brokeItem.getIcon()+"\" width=32 height=32></td><td><a action=\"bypass -h Quest q8037_SafetyTrader other2_" + str(Item.getObjectId()) +"_1\">" + itemTemplate.getName() + "</a> <br1> " + str(count) + " штук.</td></tr>" htmltext += "</table><br><a action=\"bypass -h Quest q8037_SafetyTrader step1\">Вернуться.</a></body></html>" elif event.startswith("step2_"): search = str(event.replace("step2_", "")) itemObjId,chType=search.split("_") itemObjId,chType=int(itemObjId),int(chType) if st.getQuestItemsCount(COL) < PAYMENT: htmltext = "<html><body>Стоимость услуги: "+str(PAYMENT)+" Coin of Luck</body></html>" return htmltext Item = player.getInventory().getItemByObjectId(itemObjId) if Item and not Item.isEquipped(): itemId = Item.getItemId() itemTemplate = Item.getItem() itemType = itemTemplate.getType2() preench = Item.getEnchantLevel() enchant = (preench > 0 and "+"+str(preench)+"") or str("+0") if chType == 1 and preench == 0: htmltext = "<html><body>Ошибка.</body></html>" return htmltext augId = 0 augment = "нет." if Item.isAugmented(): haveSkill = Item.getAugmentation().getSkill() if haveSkill != None: if haveSkill.isPassive(): skilltype = "[Passive" elif haveSkill.isChance(): skilltype = "[Chance" else: skilltype = "[Active" skillname = haveSkill.getName()+" "+skilltype+":"+str(haveSkill.getLevel())+"lvl]" augment = skillname.replace("Item Skill: ","") augId = haveSkill.getId() else: if chType == 2: htmltext = "<html><body>Ошибка.</body></html>" return htmltext brokeItem = ItemTable.getInstance().getTemplate(itemId) tradeId = st.getInt("tradeId") st.set("oneitem",str(itemObjId)) st.set("skill",str(augId)) st.set("enchant",str(preench)) if (tradeId > 0): step = 5 else: step = 2 htmltext = "<html><body>Шаг " + str(step) + ".<br>Подтверждаете?<br>" htmltext += "<table width=300><tr><td><img src=\""+brokeItem.getIcon()+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + "</font><br>Заточка: " + enchant + "<br>Аугмент: " + augment + "</td></tr></table><br><br>" if (step == 5): htmltext += "<button value=\"Продолжить\" action=\"bypass -h Quest q8037_SafetyTrader step5next_1\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" htmltext += "<br><a action=\"bypass -h Quest q8037_SafetyTrader step5\">Вернуться.</a></body></html>" else: htmltext += "<table width=180><tr><td>Выберите тип сделки:</td><td> <combobox width=40 var=\"chtype\" list=\"1;2\"></td></tr></table><br1>" htmltext += "1 - безвозмездный.<br1>" htmltext += "2 - обмен на другую вещь.<br>" htmltext += "Установите пароль (не более 16 символов):<br1><edit var=\"passw\" width=110 length=\"16\"><br>" htmltext += "<button value=\"Продолжить\" action=\"bypass -h Quest q8037_SafetyTrader step3_ $passw _ $chtype\" width=70 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" htmltext += "<br><a action=\"bypass -h Quest q8037_SafetyTrader step1\">Вернуться.</a></body></html>" else : htmltext = "<html><body>Ошибка!<br><a action=\"bypass -h Quest q8037_SafetyTrader step1\">Вернуться.</a></body></html>" elif event.startswith("other2_"): search = str(event.replace("other2_", "")) itemObjId,chType=search.split("_") itemObjId,chType=int(itemObjId),int(chType) Item = player.getInventory().getItemByObjectId(itemObjId) if Item and not Item.isEquipped(): itemId = Item.getItemId() itemTemplate = Item.getItem() brokeItem = ItemTable.getInstance().getTemplate(itemId) tradeId = st.getInt("tradeId") st.set("oneitem",str(itemObjId)) st.set("skill",str(0)) st.set("enchant",str(0)) itemCount = Item.getCount() s = str(itemCount) for i in xrange(len(s)-3,s[0] in ('+','-'),-3): s=s[:i]+','+s[i:] itemCount = "<font color=00CCFF>"+str(s)+"</font>" htmltext = "<html><body>Шаг 5.<br>Подтверждаете?<br>" htmltext += "<table width=300><tr><td><img src=\""+brokeItem.getIcon()+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + "</font><br1>" + str(itemCount) + " штук.</td></tr></table><br><br>" htmltext += "<br>Сколько штук?<br><edit var=\"count\" width=110 length=\"16\"><br><br>" htmltext += "<button value=\"Продолжить\" action=\"bypass -h Quest q8037_SafetyTrader step5next_ $count\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" htmltext += "<br><a action=\"bypass -h Quest q8037_SafetyTrader step5\">Вернуться.</a></body></html>" else : htmltext = "<html><body>Ошибка!<br><a action=\"bypass -h Quest q8037_SafetyTrader step1\">Вернуться.</a></body></html>" elif event.startswith("step3_"): search = str(event.replace("step3_", "")) password,chtype=search.split("_") password = str(password.replace(" ", "")) chtype = str(chtype.replace(" ", "")) htmltext = "<html><body>Шаг3.<br>Подождите...<br><br>" if password == "": htmltext += "Не указан пароль.</body></html>" return htmltext if chtype == "" or int(chtype) > 2 or int(chtype) <= 0: htmltext += "Хм...</body></html>" return htmltext myItem = st.getInt("oneitem") myEnch = st.getInt("enchant") myAugm = st.getInt("skill") Item = player.getInventory().getItemByObjectId(myItem) if Item and not Item.isEquipped(): itemId = Item.getItemId() itemType = Item.getItemType() itemTemplate = Item.getItem() preench = Item.getEnchantLevel() enchant = (preench > 0 and "+"+str(preench)+"") or str("+0") if preench != myEnch: htmltext = "<html><body>Ошибка.</body></html>" return htmltext augment = "нет." augEffId = 0 augSkillId = 0 augSklLvl = 0 if Item.isAugmented(): haveSkill = Item.getAugmentation().getSkill() if haveSkill != None: augSkillId = haveSkill.getId() if myAugm != augSkillId: htmltext = "<html><body>Ошибка.</body></html>" return htmltext augEffId = Item.getAugmentation().getAugmentationId() augSklLvl = haveSkill.getLevel() if haveSkill.isPassive(): skilltype = "[Passive" elif haveSkill.isChance(): skilltype = "[Chance" else: skilltype = "[Active" skillname = haveSkill.getName()+" "+skilltype+":"+str(haveSkill.getLevel())+"lvl]" augment = skillname.replace("Item Skill: ","") brokeItem = ItemTable.getInstance().getTemplate(itemId) #< try: con2=L2DatabaseFactory.getInstance().getConnection() storeitem=con2.prepareStatement("INSERT INTO `z_safety_trade` (`id`,`char1`,`char1name`,`item1`, `item1name`,`ench1`,`augm1eff`,`augm1skill`,`augm1lvl`,`status1`,`password`,`ctype`) VALUES (NULL,?,?,?,?,?,?,?,?,?,?,?);") storeitem.setInt(1, player.getObjectId()) storeitem.setString(2, player.getName()) storeitem.setInt(3, itemId) storeitem.setString(4, itemTemplate.getName()) storeitem.setInt(5, preench) storeitem.setInt(6, augEffId) storeitem.setInt(7, augSkillId) storeitem.setInt(8, augSklLvl) storeitem.setInt(9, 0) storeitem.setString(10, password) storeitem.setString(11, chtype) storeitem.executeUpdate() except: htmltext = "<html><body>Ошибка.1</body></html>" return htmltext finally: storeitem.close() con2.close() player.destroyItem("q8037_SafetyTrader",myItem, 1, player, 1) #< st.unset("oneitem") st.unset("skill") st.unset("enchant") htmltext += "<table width=300><tr><td><img src=\""+brokeItem.getIcon()+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + "</font><br>Заточка: " + enchant + "<br>Аугмент: " + augment + "</td></tr></table><br><br>" htmltext += "<br>Скажите пароль партнеру!<br>" htmltext += "<center>==================<br1>" htmltext += "<font color=FF9933>" + password + "</font><br1>" htmltext += "==================</center><br>" htmltext += "<br><br>Все, теперь его ждем.<br><br>Если передумали, можете забрать шмотку." htmltext += "<br><button value=\"Забрать\" action=\"bypass -h Quest q8037_SafetyTrader cancel\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br><br>" htmltext += "<br>Если хотите, можете закрыть это окно, ничего плохого не случится.</body></html>" else : htmltext = "<html><body>Ошибка!<br><a action=\"bypass -h Quest q8037_SafetyTrader step1\">Вернуться.</a></body></html>" elif event == "step3next": htmltext = "<html><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI.SquareBlank\" width=260 height=2></center><br1>" htmltext += "<font color=LEVEL>Введите пароль, который вам сообщил партнер и его ник.</font><br>" htmltext += "Ник партнера:<br1><edit var=\"partner\" width=110 length=\"16\"><br>" htmltext += "Пароль:<br1><edit var=\"passw\" width=110 length=\"16\">" htmltext += "<button value=\"Продолжить\" action=\"bypass -h Quest q8037_SafetyTrader step4_ $partner _ $passw\" width=60 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("step4_"): search = str(event.replace("step4_", "")) partner,password=search.split("_") #< partner = str(partner.replace(" ", "")) password = str(password.replace(" ", "")) htmltext = "<html><body>Шаг4.<br><br><br>" if partner == "": htmltext += "Не указан ник партнера.</body></html>" return htmltext if password == "": htmltext += "Не указан пароль.</body></html>" return htmltext try : con=L2DatabaseFactory.getInstance().getConnection() getitem=con.prepareStatement("SELECT id, char1, char1name, item1, item1name, ench1, augm1eff, augm1skill, augm1lvl, status1, password, ctype FROM `z_safety_trade` WHERE `char1name` = ? LIMIT 1") getitem.setString(1, partner) rs=getitem.executeQuery() if (rs.next()): tradeId=rs.getInt("id") char1Id=rs.getInt("char1") char1Name=rs.getString("char1name") itemId=rs.getInt("item1") itemName=rs.getString("item1name") preench=rs.getInt("ench1") augSkl=rs.getInt("augm1skill") augLvl=rs.getInt("augm1lvl") stpass=rs.getString("password") ctype=rs.getInt("ctype") #< if (stpass != password): htmltext = "<html><body>Неверный пароль!</body></html>" return htmltext #< try: con3=L2DatabaseFactory.getInstance().getConnection() lockitem=con3.prepareStatement("UPDATE `z_safety_trade` SET `status1`=?,`char2`=?,`char2name`=? WHERE `id`=? LIMIT 1") lockitem.setLong(1, System.currentTimeMillis()) lockitem.setInt(2, player.getObjectId()) lockitem.setString(3, player.getName()) lockitem.setInt(4, tradeId) lockitem.executeUpdate() except : htmltext = "<html><body>Ошибка!?</body></html>" return htmltext finally: lockitem.close() con3.close() #< augment = "нет." enchant = (preench > 0 and "+"+str(preench)+"") or str("+0") if augSkl > 0: haveSkill = SkillTable.getInstance().getInfo(augSkl, 1) if haveSkill != None: if haveSkill.isPassive(): skilltype = "[Passive" elif haveSkill.isChance(): skilltype = "[Chance" else: skilltype = "[Active" skillname = haveSkill.getName() + " " + skilltype + ":"+ str(augLvl) +"Lvl]" augment = skillname.replace("Item Skill: ","") #< brokeItem = ItemTable.getInstance().getTemplate(itemId) #< rs.close() st.unset("tradeId") htmltext += "Параметры:<br>Игрок:" + char1Name + "" htmltext += "<table width=300><tr><td><img src=\""+brokeItem.getIcon()+"\" width=32 height=32></td><td><font color=LEVEL>" + itemName + "</font><br>Заточка: " + enchant + "<br>Аугмент: " + augment + "</td></tr></table><br><br>" if (ctype == 1): htmltext += "Подарок. Забираем?<br1>" htmltext += "<button value=\"Забираем\" action=\"bypass -h Quest q8037_SafetyTrader step4next_"+str(tradeId)+"\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" htmltext += "<button value=\"Не нужна!\" action=\"bypass -h Quest q8037_SafetyTrader cancel\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" elif (ctype == 2): st.set("tradeId",str(tradeId)) st.set("char1Id",str(char1Id)) htmltext += "Обмен. Это то, что вы хотели?<br1>" htmltext += "<button value=\"Продолжить\" action=\"bypass -h Quest q8037_SafetyTrader step5\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" htmltext += "<button value=\"Нет!\" action=\"bypass -h Quest q8037_SafetyTrader cancel\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>" else: htmltext = "<html><body>Ошибка?</body></html>" return htmltext else: htmltext = "<html><body>Партнер с ником <font color=FF9966>" + partner + "</font> не найден!</body></html>" return htmltext except: htmltext = "<html><body>Ошибка!</body></html>" return htmltext finally: getitem.close() con.close() elif event.startswith("step4next_"): tradeId = int(event.replace("step4next_", "")) try: con=L2DatabaseFactory.getInstance().getConnection() geticon=con.prepareStatement("SELECT char1, char1name, item1, item1name, ench1, augm1eff, augm1skill, augm1lvl, status1 FROM `z_safety_trade` WHERE `id` = ?") geticon.setInt(1, tradeId) rs=geticon.executeQuery() if (rs.next()): char1Id=rs.getInt("char1") char1Name=rs.getString("char1name") itemId=rs.getInt("item1") itemName=rs.getString("item1name") preench=rs.getInt("ench1") augEff=rs.getInt("augm1eff") augSkl=rs.getInt("augm1skill") augLvl=rs.getInt("augm1lvl") status=rs.getLong("status1") #< if itemId != COL: if st.getQuestItemsCount(COL) < PAYMENT: htmltext = "<html><body>Стоимость услуги: "+str(PAYMENT)+" Coin of Luck</body></html>" return htmltext st.takeItems(COL,PAYMENT) #< try: con2=L2DatabaseFactory.getInstance().getConnection() zabiraem=con2.prepareStatement("DELETE FROM `z_safety_trade` WHERE `id`=?") zabiraem.setInt(1, tradeId) zabiraem.executeUpdate() except: htmltext = "<html><body>Ошибка!</body></html>" return htmltext finally: zabiraem.close() con2.close() #< item = player.getInventory().addItem("q8037_SafetyTrader", itemId, 1, player, player.getTarget()) if preench != 0: item.setEnchantLevel(preench) if augSkl != 0: item.setAugmentation(L2Augmentation(item, augEff, augSkl, augLvl, True)) smsg = SystemMessage(SystemMessageId.EARNED_S2_S1_S) smsg.addItemName(itemId) smsg.addNumber(1) player.sendPacket(smsg) player.sendPacket(ItemList(player, False)) #< alarm = L2World.getInstance().getPlayer(char1Name) if alarm: alarm.sendMessage("Партнер забрал шмотку!"); rs.close() htmltext = "<html><body>Сделка проведена!</body></html>" return htmltext else: htmltext = "<html><body>Ошибка!</body></html>" return htmltext except: htmltext = "<html><body>Ошибка!?</body></html>" return htmltext finally: geticon.close() con.close() elif event == "step5": if st.getQuestItemsCount(COL) < PAYMENT: htmltext = "<html><body>Стоимость услуги: "+str(PAYMENT)+" Coin of Luck</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></center><br1>" htmltext += "<font color=LEVEL>Выберите вещь, на которую хотите обменяться</font><br>" htmltext += "Оружие:<br1>" htmltext += "<button value=\"Аугментированное.\" action=\"bypass -h Quest q8037_SafetyTrader augment_1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">" htmltext += "Прочее: колы и так далее..<br1>" htmltext += "<button value=\"Другое\" action=\"bypass -h Quest q8037_SafetyTrader other\" width=90 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("step5next_"): search = str(event.replace("step5next_", "")) myCount = str(search.replace(" ", "")) if myCount == "": htmltext = "<html><body>Ошибка. Неверное количесто предметов!</body></html>" return htmltext myCount = int(myCount) htmltext = "<html><body>Шаг5.<br>Подождите...<br><br>" myItem = st.getInt("oneitem") myEnch = st.getInt("enchant") myAugm = st.getInt("skill") tradeId = st.getInt("tradeId") char1Id = st.getInt("char1Id") if char1Id == 0: try: con=L2DatabaseFactory.getInstance().getConnection() geticon=con.prepareStatement("SELECT char1 FROM `z_safety_trade` WHERE `char2` = ? LIMIT 1") geticon.setInt(1, player.getObjectId()) rs=geticon.executeQuery() if (rs.next()) : char1Id=rs.Int("char1") st.set("char1Id",str(char1Id)) rs.close() else: htmltext = "<html><body>Ошибка!</body></html>" return htmltext except: htmltext = "<html><body>Ошибка!</body></html>" return htmltext finally: geticon.close() con.close() Item = player.getInventory().getItemByObjectId(myItem) if Item and not Item.isEquipped(): itemId = Item.getItemId() itemTemplate = Item.getItem() itemType = itemTemplate.getType2() preench = Item.getEnchantLevel() itemCount = Item.getCount() #< if myCount > itemCount: htmltext = "<html><body>Ошибка. Неверное количесто предметов!</body></html>" return htmltext #< enchant = (preench > 0 and "+"+str(preench)+"") or str("+0") if preench != myEnch: htmltext = "<html><body>Ошибка.</body></html>" return htmltext augment = "нет." augEffId = 0 augSkillId = 0 augSklLvl = 0 if Item.isAugmented(): haveSkill = Item.getAugmentation().getSkill() if haveSkill != None: augSkillId = haveSkill.getId() if myAugm != augSkillId: htmltext = "<html><body>Ошибка.</body></html>" return htmltext augEffId = Item.getAugmentation().getAugmentationId() augSklLvl = haveSkill.getLevel() if haveSkill.isPassive(): skilltype = "[Passive]" elif haveSkill.isChance(): skilltype = "[Chance]" else: skilltype = "[Active]" skillname = haveSkill.getName()+" "+skilltype augment = skillname.replace("Item Skill: ","") brokeItem = ItemTable.getInstance().getTemplate(itemId) #< try : con3=L2DatabaseFactory.getInstance().getConnection() lockitem=con3.prepareStatement("UPDATE `z_safety_trade` SET `char2`=?,`char2name`=?,`item2`=?, `item2name`=?, `item2count`=?,`ench2`=?,`augm2eff`=?,`augm2skill`=?,`augm2lvl`=?,`status2`=? WHERE `id`=?") lockitem.setInt(1, player.getObjectId()) lockitem.setString(2, player.getName()) lockitem.setInt(3, itemId) lockitem.setString(4, itemTemplate.getName()) lockitem.setInt(5, myCount) lockitem.setInt(6, preench) lockitem.setInt(7, augEffId) lockitem.setInt(8, augSkillId) lockitem.setInt(9, augSklLvl) lockitem.setInt(10, 777) lockitem.setInt(11, tradeId) lockitem.executeUpdate() except : htmltext = "<html><body>Ошибка.d</body></html>" return htmltext finally: lockitem.close() con3.close() player.destroyItem("q8037_SafetyTrader",myItem, myCount, player, 0) #< st.unset("oneitem") st.unset("skill") st.unset("enchant") htmltext += "<table width=300><tr><td><img src=\""+brokeItem.getIcon()+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + "</font><br>Заточка: " + enchant + "<br>Аугмент: " + augment + "</td></tr></table><br><br>" htmltext += "<br><br>Все, теперь его ждем. Скажите ему, чтоб поговорил со мной.<br1>" #< #htmltext += "<br><br><button value=\"Продолжить\" action=\"bypass -h Quest q8037_SafetyTrader char2finish\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">" #< #alarm = L2World.getInstance().getPlayer(char1Name) #if alarm: #alarm.sendMessage("Партнер выставил шмотку, поговорите с нпц.") else : htmltext = "<html><body>Ошибка!<br><a action=\"bypass -h Quest q8037_SafetyTrader step1\">Вернуться.</a></body></html>" elif event.startswith("finish"): try: obj = player.getObjectId() con=L2DatabaseFactory.getInstance().getConnection() chkChar=con.prepareStatement("SELECT * FROM `z_safety_trade` WHERE `char1` = ? LIMIT 1") chkChar.setInt(1, obj) rs=chkChar.executeQuery() if (rs.next()) : tradeId=rs.getInt("id") char1Id=rs.getInt("char1") char2Name=rs.getString("char2name") item2Id=rs.getInt("item2") item2Name=rs.getString("item2name") pre2ench=rs.getInt("ench2") item2count=rs.getInt("item2count") aug2Eff=rs.getInt("augm2eff") aug2Skl=rs.getInt("augm2skill") aug2Lvl=rs.getInt("augm2lvl") status2=rs.getLong("status2") ctype=rs.getLong("ctype") #< if item2Id != COL: if st.getQuestItemsCount(COL) < PAYMENT: htmltext = "<html><body>Стоимость услуги: "+str(PAYMENT)+" Coin of Luck</body></html>" return htmltext st.takeItems(COL,PAYMENT) #< if obj == char1Id: try: con3=L2DatabaseFactory.getInstance().getConnection() lockitem=con3.prepareStatement("UPDATE `z_safety_trade` SET `char1`=?, `char1name`=?,`item2`=?, `item2name`=?, `item2count`=?,`ench2`=?,`augm2eff`=?,`augm2skill`=?,`augm2lvl`=?,`status1`=? WHERE `id`=?") lockitem.setInt(1, 0) lockitem.setString(2, "") lockitem.setInt(3, 0) lockitem.setString(4, "") lockitem.setInt(5, 0) lockitem.setInt(6, 0) lockitem.setInt(7, 0) lockitem.setInt(8, 0) lockitem.setInt(9, 0) lockitem.setInt(10, 777) lockitem.setInt(11, tradeId) lockitem.executeUpdate() except: htmltext = "<html><body>Ошибка!1</body></html>" return htmltext finally: lockitem.close() con3.close() #< item = player.getInventory().addItem("q8037_SafetyTrader", item2Id, item2count, player, player.getTarget()) if pre2ench != 0: item.setEnchantLevel(pre2ench) if aug2Skl != 0: item.setAugmentation(L2Augmentation(item, aug2Eff, aug2Skl, aug2Lvl, True)) smsg = SystemMessage(SystemMessageId.EARNED_S2_S1_S) smsg.addItemName(item2Id) smsg.addNumber(item2count) player.sendPacket(smsg) player.sendPacket(ItemList(player, False)) alarm = L2World.getInstance().getPlayer(char2Name) if alarm: alarm.sendMessage("Партнер забрал шмотку!") #< rs.close() #< htmltext = "<html><body>Сделка завершена!</body></html>" return htmltext else: htmltext = "<html><body>Ошибка!</body></html>" return htmltext #except: #pass finally: chkChar.close() con.close() elif event == "cancel": try: obj = player.getObjectId() con=L2DatabaseFactory.getInstance().getConnection() chkChar=con.prepareStatement("SELECT * FROM `z_safety_trade` WHERE `char1` = ? OR `char2` = ? LIMIT 1") chkChar.setInt(1, obj) chkChar.setInt(2, obj) rs=chkChar.executeQuery() if (rs.next()) : tradeId=rs.getInt("id") char1Id=rs.getInt("char1") char1Name=rs.getString("char1name") item1Id=rs.getInt("item1") item1Name=rs.getString("item1name") pre1ench=rs.getInt("ench1") aug1Eff=rs.getInt("augm1eff") aug1Skl=rs.getInt("augm1skill") aug1Lvl=rs.getInt("augm1lvl") status1=rs.getLong("status1") char2Id=rs.getInt("char2") char2Name=rs.getString("char2name") item2Id=rs.getInt("item2") item2Name=rs.getString("item2name") item2count=rs.getString("item2count") pre2ench=rs.getInt("ench2") aug2Eff=rs.getInt("augm2eff") aug2Skl=rs.getInt("augm2skill") aug2Lvl=rs.getInt("augm2lvl") status2=rs.getLong("status2") rs.close() #< if obj == char1Id: if status1 == 777: htmltext = "<html><body>Шмотку уже нельзя забрать, т.к. вы подтвердили сделку.</body></html>" return htmltext if status1 > 123456 and (System.currentTimeMillis() - status1 < 300000): htmltext = "<html><body>В данный момент вы не можете забрать шмотку или отменить сделку, т.к. она подтверждена партнером.<br>" htmltext += "Шмотку можно забрать через 5 минут, если вы отказываетесь от трейда.<br>" htmltext += "5 минут еще не истекли.</body></html>" return htmltext if status1 == 0 or status1 > 123456: if status2 == 0: try : con2=L2DatabaseFactory.getInstance().getConnection() zabiraem=con2.prepareStatement("DELETE FROM `z_safety_trade` WHERE `id`=?") zabiraem.setInt(1, tradeId) zabiraem.executeUpdate() except: pass finally: zabiraem.close() con2.close() else: try: con3=L2DatabaseFactory.getInstance().getConnection() lockitem=con3.prepareStatement("UPDATE `z_safety_trade` SET `item1`=?, `item1name`=?,`ench1`=?,`augm1eff`=?,`augm1skill`=?,`augm1lvl`=?, `status1`=? WHERE `id`=?") lockitem.setInt(1, 0) lockitem.setString(2, 0) lockitem.setInt(3, 0) lockitem.setInt(4, 0) lockitem.setInt(5, 0) lockitem.setInt(6, 0) lockitem.setInt(7, 0) lockitem.setInt(8, 999) lockitem.setInt(9, tradeId) lockitem.executeUpdate() except: pass finally: lockitem.close() con3.close() #< item = player.getInventory().addItem("q8037_SafetyTrader", item1Id, 1, player, player.getTarget()) if pre1ench != 0: item.setEnchantLevel(pre1ench) if aug1Skl != 0: item.setAugmentation(L2Augmentation(item, aug1Eff, aug1Skl, aug1Lvl, True)) smsg = SystemMessage(SystemMessageId.EARNED_S2_S1_S) smsg.addItemName(item1Id) smsg.addNumber(1) player.sendPacket(smsg) player.sendPacket(ItemList(player, False)) htmltext = "<html><body>Вы отменили трейд, шмотка снята.</body></html>" return htmltext elif obj == char2Id: if status1 == 777: htmltext = "<html><body>Шмотку уже нельзя забрать, т.к. сделка подтверждена.</body></html>" return htmltext if status1 > 0: if status2 == 777: try: con3=L2DatabaseFactory.getInstance().getConnection() lockitem=con3.prepareStatement("UPDATE `z_safety_trade` SET `item2`=?, `item2name`=?, `item2count`=?,`ench2`=?,`augm2eff`=?,`augm2skill`=?,`augm2lvl`=? WHERE `id`=?") lockitem.setInt(1, 0) lockitem.setString(2, 0) lockitem.setInt(3, 0) lockitem.setInt(4, 0) lockitem.setInt(5, 0) lockitem.setInt(6, 0) lockitem.setInt(7, 0) lockitem.setInt(8, tradeId) lockitem.executeUpdate() except: pass finally: lockitem.close() con3.close() item = player.getInventory().addItem("q8037_SafetyTrader", item2Id, item2count, player, player.getTarget()) if item2Ench != 0: item.setEnchantLevel(pre1ench) if aug2Skl != 0: item.setAugmentation(L2Augmentation(item, aug2Eff, aug2Skl, aug2Lvl, True)) smsg = SystemMessage(SystemMessageId.EARNED_S2_S1_S) smsg.addItemName(item2Id) smsg.addNumber(1) player.sendPacket(smsg) player.sendPacket(ItemList(player, False)) htmltext = "<html><body>Вы отменили трейд, шмотка снята.</body></html>" return htmltext elif status2 == 0: try: con3=L2DatabaseFactory.getInstance().getConnection() lockitem=con3.prepareStatement("UPDATE `z_safety_trade` SET `status1`=?, `char2`=?, `char2name`=? WHERE `id`=?") lockitem.setInt(1, 0) lockitem.setInt(2, 0) lockitem.setString(3, "") lockitem.setInt(4, tradeId) lockitem.executeUpdate() except: htmltext = "<html><body>eeee.</body></html>" return htmltext finally: lockitem.close() con3.close() alarm = L2World.getInstance().getPlayer(char1Name) if alarm: alarm.sendMessage("Партнер отказался от шмотки") htmltext = "<html><body>Вы отказались от шмотки.</body></html>" return htmltext #< except: htmltext = "<html><body>Ошибка!</body></html>" return htmltext finally: chkChar.close() con.close() else: htmltext = "<html><body>Ski-Ba-Bop-Ba-Dop-Bop!</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(8037,qn,"custom") CREATED = State('Start', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(NPC) QUEST.addTalkId(NPC) Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
SmokiMo 892 Опубликовано 29 октября, 2017 Вас самих не смущает что тему нужно прокручивать пол часа что бы добраться до низу? Вашу тему удалили потому что для таких случаев есть СПОЙЛЕР 1 Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
SmokiMo 892 Опубликовано 29 октября, 2017 А еще можно воспользоваться функцией "Прикрепить файл" Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
TEPAH0BA 45 Опубликовано 29 октября, 2017 А еще можно воспользоваться функцией "Прикрепить файл" Да, за это точно забыл про фукцию : прикрепить файл, вот под спойлер скрин: Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
localhost 715 Опубликовано 29 октября, 2017 Да, за это точно забыл про фукцию : прикрепить файл, вот под спойлер скрин: можно сделать архив и залить Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
Отвед 1 Опубликовано 29 октября, 2017 Я бы обратил внимание на эту строчку: if Item.isAugmented() and Item.getAugmentation().getSkill() != None and itemId not in FORBIDDEN and itemGrade > 3 and not Item.isEquipped(): Итем из инвентаря должен быть аугментен, должен иметь аугментный скилл, итем не должен быть в списке запрещенных, грейд выше третьего и не одет. Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты