Jump to content

GrisoM

Legendary Member
  • Posts

    6,225
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by GrisoM

  1. Unless u have premium acc xD that is why i ask u , may be some other day when i am bored i upload them all to RS Any way good work (Make an update post when the last rev of gracia comes out) whit out being beta
  2. All Credits of this guide to g13h4ck3r: A player will talk to the NPC, select an item (weapon, armor, or jewel), and the NPC will safely (100% chance) enchant this item for some payment. By "enchant" I mean making the item +1 higher than the enchantment it already has. I will keep this script simple. People can customize it further. I shall explain everything one step at a time, but I will skip parts I believe to be "trivial"... Ok...so let's assume that we have a custom NPC with id 90000 whom we will use for this. Anybody can easily create the default htm for this NPC. At the bottom, instead of the typical "Quest" link, we could do: Line number On/Off | Expand/Contract | Select all <a action="bypass -h npc_%objectId%_Quest safe_enchant">Enchant an Item</a> When a player clicks on that link, it will directly call the onTalk section of the script that we are about to write. So, let's go to the "data/scripts/custom" folder, create a new subdirectory called "safe_enchant" and create a new file in there, name __init__.py This file will follow the quest prototype, so let's start up with the usual quest stuff. For now, the file should look something like this: import sys 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 = "safe_enchant" ENCHANT_NPC = 90000 class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onEvent (self,event,st) : return def onTalk (self,npc,player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st : return htmltext return htmltext QUEST = Quest(9000,qn,"Custom") QUEST.addStartNpc(ENCHANT_NPC) QUEST.addTalkId(ENCHANT_NPC) This has set us up to start working with the script. Now, what we need next is some way for the player to see what items are available for enchanting among the items in the inventory, select the item, and get the enchantment... For the purposes of this simple sample, I will assume that all enchantments cost 1,000,000 adena. You can easily change this...So let's first create an htm where the NPC explains how enchantment works, and what it costs. It is best to not mess with equipped items, just due to some exploits that have existed in the past. So let's tell the player we will only do this for unequipped items. This will do: <html><body>Enchanter:<br> Select an item you wish to enchant and I will add 1 to its enchantment level! All enchantments cost 1,000,000 adena. Please unequip the item that you wish to enchant, if you are currently wearing it. Are you ready?<br> <a action="bypass -h Quest safe_enchant choose_item">"I would like to enchant an item."</a></body></html> Let's name this 1.htm and place it in the same folder with the __init__.py file that we just created. This htm will need to be returned as soon as the player clicks on the link from the default script, so we'll put code in onTalk to display this: if npc.getNpcId() == ENCHANT_NPC : htmltext = "1.htm" Next, we want to make it such that, when a player clicks on the link, he gets a list of items from his inventory to choose from. So we'll have to add some code in onEvent and handle this... if event == "choose_item" : htmltext = "" for Item in st.getPlayer().getInventory().getItems(): #given an item instance, get the item template to check what type it is itemType = Item.getItem().getItemType().toString() if itemType in ['None','Light','Heavy','Magic','Shield','Sword','Blunt','Dagger','Bow','Pole','Etc','Fist','Dual Sword','Dual Fist','Big Sword','Big Blunt','Ancient','Crossbow','Rapier'] and item.getItem().getCrystalType() > 0 : htmltext += "<a action=\"bypass -h Quest safe_enchant enchantItem_" + str(Item.getObjectId()) +"\">" + Item.getItem().getName() + "+" + str(Item.getEnchantLevel()) + "</a><br>" if htmltext == "": htmltext = "You have no enchantable items in your inventory" htmltext = "<html><body>Enchanter:<br>Please choose which item you wish me to enchant, from the below list:<br>" + htmltext + "</body></html>" Notice that here selecting the enchantable items by item type is a bit of an overkill, but I purposely made it this way so you can more easily exclude jewels (None type), certain types of armor, or certain types of weapon (I can forsee people not wanting to allow safe enchanting of dual swords, for example). You can add similar checks for bodypart too, if you want...In addition, I added a check that the crystalType is not 0, meaning that only D Grade or higher can be enchanted. Each link shows the name of the item as well as the enchantment level, to help the player identify which weapon he/she is selecting. It uses the server-side item name, which actually includes the SA name, if any. However, it will not include info about the augmentations. You can add this info if you wish, but in general it should not be too important...Also, you could change this piece of code a little in order to show prices. That is, if you wish to have a different price for each item, next to each item you could also display the price. Of course, your script will need some way to identify what price to charge and the details of that are all for you to decide. When a player clicks on a link, the objectId of the selected item is passed back to the script, so we can guarantee that we grab exactly the item the user selected, not just any item of the same name ;) At the next step, we must be careful, we will identify that the player has selected an item, find that item from the inventory, and enchant it. We have to be careful here as players like to try to cheat and exploit by selecting an item and quickly getting rid of it, or such naughty actions ;) In addition, we must ensure that the player has enough adena (or otehr items) to pay for this exchange. This again needs to happen in onEvent elif event.startswith("enchantItem_"): # get the object id out of the event string objId = int(event.replace("enchantItem_", "")) # to avoid exploitation, check if the stored objectId still corresponds to an existing item # and if that item is still not equipped Item = st.getPlayer().getInventory().getItemByObjectId(objId ) if Item and not Item.isEquipped() : if st.getQuestItemsCount(57) >= 1000000 : Item.setEnchantLevel(Item.getEnchantLevel()+1) st.takeItems(57, 1000000) htmltext = "congratulations.htm" else : htmltext = "notEnoughItems.htm" else : htmltext = "cheater.htm" Here, we just checked if a link that started with "enchantItem_" was clicked, then we grabbed the remaining of the link as a number, the object id, found the item, checked if it's still in the inventory and not equipped...If any of this fails, the player is trying to cheat, so we return "cheater.htm". If all is good, we finally also check if the player has enough adena. If no, we return some dialog text to inform the player about "not enough adena" (or other items). If the player does have enough adena, we add 1 to the enchantment and take our 1,000,000 adena fee before returning a "congratulations.htm". Of course, you'll have to create those two htm files, but they can be pretty generic, so I'll leave those up to you. The line "st.takeItems(57,1000000)" could be changed if you wanted to charge a different amount or a different item than in my script and with some effort you could even make it charge a different amount for each input item... Finally, at your option, you may wish to keep your server's limits for enchantments. That is, you may wish to allow players to enchant their items beyond the server's max, or you may wish to limit them by your server's configs. If you wish not to impose a limit, everything we discussed above can be put together and the script will be done. So just putting together all the parts from above for the __init__.py script , the overall script will be as follows: import sys 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 = "safe_enchant" ENCHANT_NPC = 90000 acceptableItemTypes = ['None','Light','Heavy','Magic','Shield','Sword','Blunt','Dagger','Bow','Pole','Etc','Fist','Dual Sword','Dual Fist','Big Sword','Big Blunt','Ancient','Crossbow','Rapier'] class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onEvent (self,event,st) : if event == "choose_item" : htmltext = "" for Item in st.getPlayer().getInventory().getItems(): #given an item instance, get the item template to check what type it is itemType = Item.getItem().getItemType().toString() if itemType in acceptableItemTypes and item.getItem().getCrystalType() > 0 : htmltext += "<a action=\"bypass -h Quest safe_enchant enchantItem_" + str(Item.getObjectId()) +"\">" + Item.getItem().getName() + "+" + str(Item.getEnchantLevel()) + "</a><br>" if htmltext == "": htmltext = "You have no enchantable items in your inventory" htmltext = "<html><body>Enchanter:<br>Please choose which item you wish me to enchant, from the below list:<br>" + htmltext + "</body></html>" elif event.startswith("enchantItem_"): # get the object id out of the event string objId = int(event.replace("enchantItem_", "")) # to avoid exploitation, check if the stored objectId still corresponds to an existing item # and if that item is still not equipped Item = st.getPlayer().getInventory().getItemByObjectId(objId ) if Item and not Item.isEquipped() : if st.getQuestItemsCount(57) >= 1000000 : Item.setEnchantLevel(Item.getEnchantLevel()+1) st.takeItems(57, 1000000) htmltext = "congratulations.htm" else : htmltext = "notEnoughItems.htm" else : htmltext = "cheater.htm" return htmltext def onTalk (self,npc,player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st : return htmltext if npc.getNpcId() == ENCHANT_NPC : htmltext = "1.htm" return htmltext QUEST = Quest(9000,qn,"Custom") QUEST.addStartNpc(ENCHANT_NPC) If you additionally wish to limit the max enchantment based on your server configs, you will need to first import the config class into your script. That is, at the top of the script you will need the line: Line number On/Off | Expand/Contract | Select all from from net.sf.l2j import Config Next, you will need to add some if/else statements where you check the item type, the config option for max-enchantment for that item type, and if the item is already at or above the max. Just before getting the adena, we can add these few lines: itemType = Item.getItem().getItemType().toString() weapons = ['Sword','Blunt','Dagger','Bow','Pole','Etc','Fist','Dual Sword','Dual Fist','Big Sword','Big Blunt','Ancient','Crossbow','Rapier'] armors = ['Light','Heavy','Magic','Shield'] jewels = ['None'] if (itemType in weapons and Item.getEnchantLevel >= Config.ENCHANT_MAX_WEAPON) or (IitemType in armors and Item.getEnchantLevel >= Config.ENCHANT_MAX_ARMOR) or (itemType in jewels and Item.getEnchantLevel >= Config.ENCHANT_MAX_JEWELRY) : htmltext = "reachedMaxEnchant.htm" else: #... take the adena, give the +1 enchant... So again, putting everything together, we have: import sys from net.sf.l2j import Config 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 = "safe_enchant" ENCHANT_NPC = 90000 weapons = ['Sword','Blunt','Dagger','Bow','Pole','Etc','Fist','Dual Sword','Dual Fist','Big Sword','Big Blunt','Ancient','Crossbow','Rapier'] armors = ['Light','Heavy','Magic','Shield'] jewels = ['None'] acceptableItemTypes = weapons+armors+jewels class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onEvent (self,event,st) : if event == "choose_item" : htmltext = "" for Item in st.getPlayer().getInventory().getItems(): # given an item instance, get the item template to check what type it is itemType = Item.getItem().getItemType().toString() itemGrade = Item.getItem().getCrystalType() if itemType in acceptableItemTypes and itemGrade > 0 : htmltext += "<a action=\"bypass -h Quest safe_enchant enchantItem_" + str(Item.getObjectId()) +"\">" + Item.getItem().getName() + "+" + str(Item.getEnchantLevel()) + "</a><br>" if htmltext == "": htmltext = "You have no enchantable items in your inventory" htmltext = "<html><body>Enchanter:<br>Please choose which item you wish me to enchant, from the below list:<br>" + htmltext + "</body></html>" elif event.startswith("enchantItem_"): # get the object id out of the event string objId = int(event.replace("enchantItem_", "")) # to avoid exploitation, check if the stored objectId still corresponds to an existing item # and if that item is still not equipped Item = st.getPlayer().getInventory().getItemByObjectId(objId ) if Item and not Item.isEquipped() : itemType = Item.getItem().getItemType().toString() itemEnchant = Item.getEnchantLevel() if st.getQuestItemsCount(7267) >= 10 : if (itemType in weapons and itemEnchant >= Config.ENCHANT_MAX_WEAPON) or (itemType in armors and itemEnchant >= Config.ENCHANT_MAX_ARMOR) or (itemType in jewels and itemEnchant >= Config.ENCHANT_MAX_JEWELRY) : htmltext = "reachedMaxEnchant.htm" else : Item.setEnchantLevel(itemEnchant+1) st.takeItems(57, 1000000) htmltext = "congratulations.htm" else : htmltext = "notEnoughItems.htm" else : htmltext = "cheater.htm" return htmltext def onTalk (self,npc,player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st : return htmltext if npc.getNpcId() == ENCHANT_NPC : htmltext = "1.htm" return htmltext QUEST = Quest(9000,qn,"Custom") QUEST.addStartNpc(ENCHANT_NPC) QUEST.addTalkId(ENCHANT_NPC) Again, you will need to add the file reachedMaxEnchant.htm in the same directory and put some text to it, but that should be simple. Also, if you prefer, you can limit the max enchantment from this script to any other value (for example if your config allows up to +50 but you want people to get safe enchants for the script only up to +25) simply by replace the Config.ENCHANT_MAX_YYYYYY with the value you like... ############################################################################## Well Its Not So DIficul , u just need time ::)
  3. wtf is this? where should i add this into the list of mod ? O.o
  4. Its not about that boy ;) dosnt matter ^^ Evry one know alredy about what i am talking about And that is enought for me jajaja Cheers ^^
  5. what do u care about my opinion ? i am just a fucktard , it only has to like yourself and if some one dosnt like it tell him to gtfo btw u alredy know what i think about u so i better keep my anger to myself ^^
  6. JAAJAJ Mafia_007 has the musical taste of a 7 years old girl XD <3
  7. O.O that is friking cool mate :^D Nice start Keep up , Btw now i am woundering how to do shop or buffer whit item (is there any guide in mxc?)
  8. me2 just to see wtf feels to have a sig xD Be original [The only thing i dont want (if u do the sig) is anime or any game l2 wow cs on it -.- i hate anime ;P]
  9. yhea like cuting their balls out ;P btw if they dont charge money for it , nc cant do anything ^^
  10. Writing backwards sucks people, accept it ^^
  11. Well He will never say thnx beacuse he is banned xDDD if u haven see it , i tell u he is one of the top5 leachers ^^ So Gtfo Cobra ^^ bbz
  12. Some days ago i watch a guy question where he ask how to make The Glow of the weapon bigger and no one answer him (well till today i didnt know the answer xD) So i use search in other forums and i found it Here it goes: I hope you know how to open the weapongrp.dat in your /system folder. Do it with L2Edit. next you have a look at the Codeline i post you: 0 5800 1 1 7 10 0 LineageWeapons.duskk_sword_m00_wp LineageWeaponsTex.duskk_sword_t00_wp icon.weapon_sword_of_miracle_i01 95 1380 1 1 0 7 1 1 LineageWeapons.duskk_sword_m00_wp 1 LineageWeaponsTex.duskk_sword_t00_wp 4 ItemSound.sword_small_1 ItemSound.sword_great_4 ItemSound.sword_mid_2 ItemSound.public_sword_shing_4 ItemSound.itemdrop_sword ItemSound.itemequip_sword 10 280 180 1 5 8 0 0 0 0 379 0 3 3 1000 0 -1 0 LineageEffect.c_u006 2.000000 0.000000 0.000000 1.000000 5.500000 LineageWeapons.rangesample 3.29999971 1.000000 1.000000 15.000000 1.000000 0.000000 -1 -1 -1 -1 That is the DuskSword. just look at the last values. You can find there: LineageEffect.c_u006 2.000000 0.000000 0.000000 1.000000 5.500000 LineageWeapons.rangesample 3.29999971 1.000000 1.000000 15.000000 1.000000 0.000000 1. "LineageEffect.c_u006" and the following nummers "2.000000 0.000000 ..." are the options for the Flames on the sword. With the numbers you can manage how long, fast and fat the Flames are. Dont ask me what numbers you have to change exactly. Try it! With the ".c_u006" in "LineageEffect.c_u006" you change the kind of Flames. There are different Flames for Bows, Daggers, Pole, Hammers, Books and Swords. Just have a look on a Weapon of the same kind like that you want to edit. 2. "LineageWeapons.rangesample" is responsible for the Gloweffect. Allmost same like with the Flames, the numbers manage how long, fat, fast or round the Glow is. And again: Plz try! ATTENTION: if a Weapon has no value "LineageEffect.c_u006" you will have to put it yourself (copy from other Weapon). Watch out that you dont miss one of the invible spaces ("Tabs"). That can and will destroy the full file! You can find them by using the Arrowbuttons on you keyboard. Well i Hope THis help Forum :) ty skolex
  13. Well i think blasta said it (but in greek) Some Pic of the npc? xD For Low Rates this would be good to add a custom (if it has a custom npc xD) Well Lets see wtf is inside xD good job
  14. Welcome back O.o Well I guess those are last revisions? xDDDD 2 Comments: 1 U could upload them to Rapid Share ;P 2 Good Share [beacuse here is all in 1] For those that want to make their own L2J server ^^ Keep up.-
  15. I think that must be the 1 in the first photo Its not big but it must have fucking crazy stats ;P and i guess that it will drop a jewel better than valakas neckles ^^
  16. How when & why? 2006 I just have internet in my house and a friend comes and tell me hey u need to try this game lineage 2 its awesom (he told me like 200 storys of the game) and finnaly after 14 hours of download i had my c4 client xD
  17. @marsic2 1 more of this spams and i will - u boy u have 400 post and u still dont know the rules? my god.. @Drakwolf i use to play in a 20x rate whit a sph i tell u the easyiest way (if the server has big community) w8 till u lvl up hige and save adena and buy it from another person. why? Beacuse Craft drive u crazy (no one ever sell what u want and if u want to make it your self u have to go till the ass of the world to find 1 material xD) that way i bught full dc and maj jewels robe and well the rest we got it from drop of raid bosses ^^
  18. Has u can read here: http://www.maxcheaters.com/forum/index.php?topic=3211.0 What u need is a file core.dll (but 1 that is updated and this one i show u is not..): http://www.maxcheaters.com/forum/index.php?topic=3211.msg183293#msg183293 U should check in some other places , may be in ofi forum for that file GL
  19. Looks really good , evry time they make a new version they make some things more real and that is what i like about it
  20. OylFSw2-Oco&feature JGGibwT-FlA 7XpdcILyoj8&feature WFXBk6gXUeU asd
×
×
  • Create New...