Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[HELP] Script enchanting one by one?
Author Message
LuxorITA Offline
Gremlin
*

Posts: 9
Joined: Nov 2013
Reputation: 0
Version: 1.4.1.121
Post: #1
[HELP] Script enchanting one by one?
Hello all,

im beginner with l2 tower and im trying in interlude server to do the enchanting sequence script...i tried this but it with 15 draconic bows in inventory will do only "+1 +2 +3 +4..." etc.

i tried to search right script but without results..

i need the trick " +1 +1 +1 +1....+2 +2 +2 +2..." etc.

If somebody can help that newbye thx..

Code:
function enchantResult()
return GetEnchantManager():getLastResult()
end

function getItemByName(name, maxenchant)
invList = GetInventory();
for item in invList.list do
if item.Name == name and item.Enchanted < maxenchant then
-- ShowToClient("ITEM", item.Name .. " (ID: " .. item.displayId .. ")");
return item
end
end
end

maxenchant = 15
GetEnchantManager():setDelay(3900)

while true do
-- weapon = getItemByName("Icarus Spirit", maxenchant)
-- enchant = getItemByName("Scroll: Enchant Weapon (S)", maxenchant)
weapon = getItemByName("Draconic Bow", maxenchant)
enchant = getItemByName("Scroll: Enchant Weapon (Grade S)", maxenchant)
enchantB = getItemByName("Blessed Scroll: Enchant Weapon (Grade S)", maxenchant)
if ( weapon == nil or enchant == nil ) then
ShowToClient("Enchant:", "Out of weapons of enchants")
break
end

if ( weapon.Enchanted > maxenchant ) then
ShowToClient("Enchant:", "Reached desired enchant")
break
end
if ( weapon.Enchanted < 3 ) then
GetEnchantManager():setEnchantId(enchant.objectId)
end;
if ( weapon.Enchanted >= 3 ) then
GetEnchantManager():setEnchantId(enchantB.objectId)
end;
GetEnchantManager():setItemId(weapon.objectId)
GetEnchantManager():Enchant()
-- ShowToClient(">>>>", "Waiting for result...");
while ( enchantResult() == Enchant.ENCHANT_PENDING ) do
Sleep(200)
end
if ( enchantResult() == Enchant.ENCHANT_SUCCESS ) then
Sleep ( 100 ) -- sleep so item data is updated
weapon = GetInventory():FindById(weapon.objectId)
ShowToClient("Enchant", weapon.Name .. " is now +" .. weapon.Enchanted);
elseif ( enchantResult() == Enchant.ENCHANT_FAILURE ) then
ShowToClient("Enchant", weapon.Name .. " failed on " .. weapon.Enchanted .. " -> " .. weapon.Enchanted+1)
end
-- ShowToClient(">>>>", "Last result" .. tostring(enchantResult()));
end
(This post was last modified: 11-24-2013 13:20 PM by LuxorITA.)
11-23-2013 23:03 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  L2 Tower Scrip enchanting problem DavidSLO 0 656 02-06-2014 14:41 PM
Last Post: DavidSLO
  Script for auto skill enchanting wiceqq 1 6,940 09-08-2012 22:12 PM
Last Post: rexatron



User(s) browsing this thread: 1 Guest(s)