Registrar | Comunidade | Postados Hoje | Pesquisar | Calendário | FAQ |
|
Tutoriais Line Age Acessa esta área, e prenda muito mais sobre este magnífico Game. |
|
Ferramentas do Tópico |
#1
|
||||
|
||||
Venho aqui postar esse tuto que acho que estava faltando aqui no forúm. Sem mais bla bla vamos começar
Vou começar com o buffer por template aqui é uma parte do HTML do buffer ----------------------------------------------------------------------------------------------------------------------------------- <html><title>Buffer</title> <body> <br> <center> <font color="80F0FF">Custom Buff</font> <button value="Wind Walk" action="bypass -h npc_%objectId%_MakeBuffs WindWalkbyUsweer" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"> <button value="Invigore" action="bypass -h npc_%objectId%_MakeBuffs InvigorebyUsweer" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"> <button value="Mental Shield" action="bypass -h npc_%objectId%_MakeBuffs MentalShieldbyUsweer" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"> <button value="Magic Barrier" action="bypass -h npc_%objectId%_MakeBuffs MagicBarrierbyUsweer" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"> <br> <button value="Back" action="bypass -h npc_%objectId%_Chat" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"> <font color="LEVEL">------</font><font color="00FF00">Cost</font> <font color="FF0000">1</font> <font color="00FF00">Buff-</font> <font color="FF0000">40</font><font color="LEVEL">'</font><font color="FF0000">000</font> <font color="00FF00">aden</font><font color="LEVEL">------</font> </center> </body> </html> ------------------------------------------------------------------------------------------------------------------------------------------- Essa parte que eu destaquei é a parte que direciona o html para a tabela dos buffs <button value="Wind Walk" action="bypass -h npc_%objectId%_MakeBuffs WindWalkbyUsweer" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"> Agora vou explicar cada parte do html 1º- button -> cria um botão no html ( também pode ser substituido por <a>...</a> no caso de ser um npc mais simples) 2º- value -> o nome que aparece no botão (nesse caso "wind walk") 3º- action -> aqui é a parte fundamental do html, pois ele redireciona o npc para o DB, usando esse codigo: "bypass -h npc_%objectId%_MakeBuffs WindWalkbyUsweer" QUOTE bypass -h npc_%objectId%_MakeBuffs essa parte é a que manda o npc buffar o player QUOTE WindWalkbyUsweer esse é o buff que ele vai dá pro player, ele deverá está na tabela buff_templates 4º- width e height-> aqui é a largura e altura do botão da html, respectivamente 5º- back e fore -> aqui são as imagens do botão quando for clicado e o normal, respectivamente Aqui está a tabela buff_templates [Para ver e baixar os arquivos, deve se Registrar ou Logar. ][Para ver e baixar os arquivos, deve se Registrar ou Logar. ] aí vem a pergunta para que serve cada coluna dessa tabela? 1- ID -> Aqui encontrar o ID do nome do buff para direcionamento .2- name -> Aqui é o nome do buff que usamos para direcionar (nesse caso WindWalkbyUsweer) .3- Skill_id -> Aqui é o id da skill que o buffer usará 4- Skill_name -> nome da skill que será usada pelo buffer 5- Skill_level -> Level da skill que será usada pelo buffer .6- skill force -> aqui é usado quando a skill tem stocktype( aconselho que deixe 1 nessa coluna) .7- Skill order -> usado quando o buffer tem a opção full buff ou buff fight ( aquelas que dá muitos buffs de uma só vez) então so colocar a order dos buffs que queira que seja usado primeiro. .8- char_min_level -> o level minimo que o player tem que ter para ser buffado .9- char_max_level -> o level maximo que o player poderá ser buffado .10- char_race -> expecifica qual a raça do char poderá se buffar ( coloque 0 para que todas as raças possam se buffar) .11- char_class -> expecifica qual classe poderá se buffar ( coloque 0 para que todas as classes possam se buffar) .12- char_faction -> esse ainda não testei mas creio que seja para buffar um determinado clan .13- price_adena -> aqui é o preço do buff .14- price_points -> aqui pode deixar 0 Então para editar só precisará do html e da tabela buff templates com isso acho que vcs já saberão como adicionar ou remover um buff do npc por template NPC BUFFER POR SCRIPT 1. A HTML DO NPC Só lembrando que A HTML TEM QUE SER FEITA COM O MESMO ID DO NPC QUOTE <html> <body> <center> <tr><td><font color="FF44FF">Buffer</font></tr></td><br> Em que posso ajudar? <br> <button value="Buff-me" action="bypass -h npc_%objectId%_Quest 9999_NPCBuffer" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"> </body> </html> vou só explicar uma pequena diferença desse html pro outro, que é o caminho do link QUOTE action="bypass -h npc_%objectId%_Quest 9999_NPCBuffer" ao invés de redirecionar a html pro DB ele redirecionará para uma quest (9999_NPCBuffer) 2.Agora partiremos para o SCRIPT do NPC O npc buffer por script fica na pasta Gameserver/data/script/custom ou jscript/custom( esse no caso de IL) Então vá até essa pasta e crie uma pasta com o nome 9999_NPCBuffer, após criar esta pasta abra o bloco de notas e crie um arquivo __init__.py e coloque esse codigo dentro: Obs: este já ta editado CODE import sys from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance from java.util import Iterator from net.sf.l2j.gameserver.datatables import SkillTable from net.sf.l2j import L2DatabaseFactory 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 qn = "9999_NPCBuffer" NPC=[55400] ADENA_ID=57 QuestId = 9999 QuestName = "NPCBuffer" QuestDesc = "custom" InitialHtml = "1.htm" print "importing custom: 9999: NPCBuffer" class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onEvent(self,event,st): htmltext = event count=st.getQuestItemsCount(ADENA_ID) if count < 0 or st.getPlayer().getLevel() < 10 : htmltext = "<html><head><body>Voce Nao tem Adena<br></body></html>" else: st.takeItems(ADENA_ID,0) st.getPlayer().setTarget(st.getPlayer()) if event == "1": st.takeItems(ADENA_ID,10000) st.getPlayer().restoreHPMP() return "1.htm" st.setState(COMPLETED) #Wind Walk if event == "2": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1204,2).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Decrease Weight if event == "3": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1257,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Shield if event == "4": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1040,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Might if event == "5": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1068,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Mental Shield if event == "6": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1035,4).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Bless the Body if event == "7": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1045,6).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Bless the Soul if event == "8": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1048,6).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Magic Barrier if event == "9": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1036,2).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Resist Shock if event == "10": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1259,4).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Concentration if event == "11": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1078,6).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Berserker Spirit if event == "12": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1062,2).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Bless Shield if event == "13": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1243,6).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Vampiric Rage if event == "14": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1268,4).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Acumen if event == "15": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1085,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Empower if event == "16": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1059,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Haste if event == "17": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1086,2).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Guidance if event == "18": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1240,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Focus if event == "19": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1077,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Death Whisper if event == "20": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1242,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) if event == "21": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(271,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "22": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(272,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "23": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(273,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "24": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(274,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "25": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(275,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "26": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(276,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "27": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(277,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "28": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(307,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "29": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(309,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "30": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(310,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "31": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(311,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "32": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(366,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "33": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(365,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "3.htm" if event == "34": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(264,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "35": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(265,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "36": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(266,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "37": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(267,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "38": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(268,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "39": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(269,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "40": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(270,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "41": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(304,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "42": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(305,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "43": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(306,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "44": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(308,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "45": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(363,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "46": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(364,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" if event == "47": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(349,1).getEffects (st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "4.htm" st.setState(COMPLETED) #Chant of Battle if event == "48": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1007,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of Shielding if event == "49": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1009,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of Fire if event == "50": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1006,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of Flame if event == "51": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1002,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of life if event == "52": st.takeItems(ADENA_ID,2000) SkillTable.getInstance().getInfo(1229,18).getEffec ts(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of Fury if event == "53": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1251,2).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of Evasion if event == "54": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1252,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of Rage if event == "55": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1253,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of Revenge if event == "56": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1284,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of Vampire if event == "57": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1310,4).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of Eagle if event == "58": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1309,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of Predator if event == "59": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1308,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of Spirit if event == "60": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1362,1).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #Chant of Victory if event == "61": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1363,1).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #chant of magnus if event == "62": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1413,1).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "5.htm" st.setState(COMPLETED) #MPreg if event == "63": st.takeItems(ADENA_ID,1000) SkillTable.getInstance().getInfo(1013,32).getEffec ts(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "1.htm" st.setState(COMPLETED) #greatmight if event == "64": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1388,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #greatshield if event == "65": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1389,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #holyresist if event == "66": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1392,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #Unholyresist if event == "67": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1393,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #pof if event == "68": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1356,1).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #elemtprotect if event == "69": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1352,1).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #wildmagic if event == "70": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1303,2).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #advblock if event == "71": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1304,3).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #divProtect if event == "72": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1353,1).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #pow if event == "73": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1355,1).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #powi if event == "74": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1357,1).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #manaregen if event == "75": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1047,4).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #ba if event == "76": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1311,6).getEffect s(st.getPlayer(),st.getPlayer()) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) #noble if event == "77": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1323,1).getEffect s(st.getPlayer(),st.getPlayer()) return "1.htm" st.setState(COMPLETED) #Cancellation if event == "78": st.takeItems(ADENA_ID,0) st.getPlayer().useMagic(SkillTable.getInstance().g etInfo(9950,1),False,False) st.getPlayer().restoreHPMP() return "1.htm" st.setState(COMPLETED) if htmltext != event: st.setState(COMPLETED) st.exitQuest(1) return htmltext def onTalk (self,npc,player): st = player.getQuestState(qn) htmltext = "<html><head><body>I have nothing to say to you</body></html>" st.setState(STARTED) return InitialHtml QUEST = Quest(9999,qn,"custom") CREATED = State('Start',QUEST) STARTED = State('Started',QUEST) COMPLETED = State('Completed',QUEST) for npcId in NPC: QUEST.addStartNpc(npcId) QUEST.addTalkId(npcId) Agora vou explicar algumas partes importantes deste arquivo CODE import sys from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance from java.util import Iterator from net.sf.l2j.gameserver.datatables import SkillTable from net.sf.l2j import L2DatabaseFactory 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 aqui ele está importando algums arquivos que já estão no servidor QUOTE qn = "9999_NPCBuffer" -> A pasta onde se encontra a quest NPC=[55400] -> ID do NPC buffer ADENA_ID=57 -> ID da adena ( id do item que tira do player ao buffar também pode ser outro item só coloca o id do mesmo) QuestId = 9999 -> ID da quest QuestName = "NPCBuffer" -> Nome da quest QuestDesc = "custom" -> tipo de quest InitialHtml = "1.htm" -> pagina inicial do buff QUOTE def onEvent(self,event,st): htmltext = event count=st.getQuestItemsCount(ADENA_ID) -> Tipo de item que vai consumir if count < 0 or st.getPlayer().getLevel() <[red] 10[/red] : -> se o player tiver menos que o level 10 ele não poderá se buffar htmltext = "<html><head><body>Voce Nao tem Adena<br></body></html>" -> mensagem que aparecerá pro player se não tiver adena else: st.takeItems(ADENA_ID,0) st.getPlayer().setTarget(st.getPlayer()) QUOTE if event == "1": -> Ínicio dos eventos st.takeItems(ADENA_ID,10000) -> preço do buff st.getPlayer().restoreHPMP() -> ação curar HP e MP return "1.htm" -> voltar para o html 1 st.setState(COMPLETED) sucesso no evento QUOTE #Wind Walk -> Nome do buff só para facilitar a localização if event == "2": -> evento 2 a cada buff adicionado deverá almentar o número de evento st.takeItems(ADENA_ID,200) -> preço do buff, já explicado SkillTable.getInstance().getInfo(1204,2).getEffects(st.getPlayer(),st.getPlayer()) -> id e level da skill st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) para adicionar mais buff é só seguir o mesmo raciocionio, não esquecendo de acresentar no event QUOTE #Decrease Weight if event == "3": st.takeItems(ADENA_ID,200) SkillTable.getInstance().getInfo(1257,3).getEffect s(st.getPlayer(),st.getPlayer( )) st.getPlayer().restoreHPMP() return "2.htm" st.setState(COMPLETED) 3. html da quest ( onde estará localizado os links para os buffs) 1.htm ------------------------------------------------------------------------------------------------------------------------------------------ <html><title> Buffer 1</title> <body> <br> Lembrando que voce tem que estar no Nivel <font color="LEVEL">10</font>. <br> <img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left> <table width="200" border="0"> <tr> <td><button value="HP-MP" action="bypass -h Quest 9999_NPCBuffer 1" width=80 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> -> aqui é o evento 1 aquele que mostrei aqui em cima pra curar HP e MP <td><button value="Choose Buffs" action="bypass -h Quest 9999_NPCBuffer 2.htm" width=80 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td></tr> -> aqui é a parte que vai redirecionar para a página de buff que é a 2.htm </table> </body> </center> </html> --------------------------------------------------------------------------------------------------------------------------------------------- 2.htm -------------------------------------------------------------------------------------------------------------------------------------------- <html><title>buffer 2</title> <body> <button value="WindWalk" action="bypass -h Quest 9999_NPCBuffer 2" width=100 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> -> aqui a única coisa que mudou foi o 2 que diz respeito ao event do wind walk <button value="Shield" action="bypass -h Quest 9999_NPCBuffer 4" width=100 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> </body> </html> --------------------------------------------------------------------------------------------------------------------------------------------- Após ter feito va na pasta jscript/custom ou script/custom abra o arquivo __init__.py e adicione a pasta do seu buffer QUOTE __all__ = [ 'q3995_echo', 'q4000_ShadowWeapons', 'q6050_KetraOrcSupport', 'q6051_VarkaSilenosSupport', 'q7000_HeroItems', 'q8000_RaidbossInfo', 'q8001_NpcLocationInfo', '911_CatMagazin', '9999_NPCBuffer' -> aqui a pasta do seu buffer ] print "" print "importing custom data ..." for name in __all__ : try : __import__('data.jscript.custom.'+name,globals(), locals(), ['__init__'], -1) except: print "failed to import quest : ",name print "... done" print "" Então para adicionar mais buffs só lembra de editar no arquivo __init__.py e no html. Não esqueça seja criativo, mude, inove. vc pode fazer diversas páginas com buffs diferentes buffs separado por class e talz Acho que é só isso que tenho para passar pra vcs, qualquer dúvida é só perguntar, e se alguém acha que está faltando alguma coisa favor posta ai ou manda mp pra mim adicionar credits: KhayrusS repostagem e acerto de alguns erros:SUPREMO Se gostarao agradeção. |
O Seguinte 7 Usuário(s) disseram "MUITO OBRIGADO" para SUPREMO Por terem gostado deste post : | ||
abacada (24-06-2009), cowboy furioso (02-06-2009), guinho w.a (01-06-2009), Nosyel (01-06-2009), oloco99 (23-03-2013), SUPREMO (01-06-2009), tpcs_90 (02-06-2009) |
|
|
Tópicos Similares | ||||
Tópico | Tópico Iniciado Por | Fórum | Respostas | Última Mensagem |
[Tutorial] Criando 2 servidores no mesmo login., 2 ou mais servidores na mesma pc. | SUPREMO | Tutoriais Line Age | 3 | 17-10-2009 11:19 PM |