Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Rappelz > Rappelz Private Server
You last visited: Today at 20:52

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Relese] Decompose Items Script

Discussion on [Relese] Decompose Items Script within the Rappelz Private Server forum part of the Rappelz category.

Reply
 
Old   #1
 
yosiemelo's Avatar
 
elite*gold: 0
Join Date: Apr 2017
Posts: 213
Received Thanks: 119
Thumbs up [Relese] Decompose Items Script

Hello dear Players and Developers,

I often see players on servers asking for an automatic decompose feature for their equipment, and often they don't receive it. So, I decided to meet you halfway and wrote such a script. I believe it is a good base for learning. I recommend delving into it and either editing this script or writing your own new one. I hope it helps someone!



Code:
function get_module_name()
	return "YSM_Decompose.lua"
end

-----------Script written by YoSiem for educational purposes.------------------------------------------
-----------Please do not remove the credits; respect the author's contribution.-------------------------
-----------This script is shared for learning and is a courtesy of YoSiem.------------------------------


-- Insert item IDs here
local itemIDs_table = {210510101, 210510102, 210510103, 210510104}  -- There are actually over 11,000 items; only 4 are included here for readability
local decompose_data = {  -- Data from Epic 9.6
    [2] = { --Rank
        [0] = {min = 1, max = 1},   --Grade | minimal result count | maximal result count
        [1] = {min = 1, max = 2},
        [2] = {min = 2, max = 4},
        [3] = {min = 4, max = 7}
    },
    [3] = {
        [0] = {min = 2, max = 2},
        [1] = {min = 2, max = 3},
        [2] = {min = 3, max = 5},
        [3] = {min = 4, max = 8}
    },
    [4] = {
        [0] = {min = 2, max = 4},
        [1] = {min = 3, max = 5},
        [2] = {min = 4, max = 7},
        [3] = {min = 5, max = 10}
    },
    [5] = {
        [0] = {min = 4, max = 7},
        [1] = {min = 4, max = 8},
        [2] = {min = 5, max = 10},
        [3] = {min = 7, max = 13}
    },
    [6] = {
        [0] = {min = 6, max = 11},
        [1] = {min = 6, max = 12},
        [2] = {min = 7, max = 14},
        [3] = {min = 9, max = 17}
    },
    [7] = {
        [0] = {min = 8, max = 15},
        [1] = {min = 8, max = 16},
        [2] = {min = 9, max = 18},
        [3] = {min = 11, max = 21},
        [4] = {min = 13, max = 25},
        [5] = {min = 15, max = 30},
        [6] = {min = 18, max = 36},
        [7] = {min = 22, max = 43},
        [8] = {min = 22, max = 43},
        [9] = {min = 22, max = 43}
    }
}

local function get_min_max(item_rank, item_grade)
    if decompose_data[item_rank] and decompose_data[item_rank][item_grade] then
        local data = decompose_data[item_rank][item_grade]
        return data.min, data.max
    else
        return nil, nil
    end
end

local function getRandomResultCount(item_rank, item_grade)
    local min, max = get_min_max(item_rank, item_grade)
    if min and max then
        return math.random(min, max)
    end
	cprint("Invalid ItemRank: "..item_rank.. " or item_grade: "..item_grade)
    return nil
end


local function decomposeItem(itemHandle, itemID)
    delete_item(itemHandle, 1)
    av('gold', -5100)
    local item_grade = get_item_grade(itemHandle)
    local item_rank = get_item_rank(itemHandle)
    for _ = 1, getRandomResultCount(item_rank, item_grade) do
        insert_item(-3000942, 1)
    end
end

local function is_item_worn(table, item_handle)
    for _, handle in pairs(table) do
        if handle == item_handle then
            return true
        end
    end
    
    return false
end

function DecomposeDuraEquipment()
    local itemHandle_table
    local enchant
    local count
    local wear_item = {
        [0] = get_wear_item_handle(0),      --WEAR_WEAPON		              
        [1] = get_wear_item_handle(1),      --WEAR_SHIELD		
        [2] = get_wear_item_handle(2),      --WEAR_ARMOR		
        [3] = get_wear_item_handle(3),      --WEAR_HELM		
        [4] = get_wear_item_handle(4),      --WEAR_GLOVE		
        [5] = get_wear_item_handle(5),      --WEAR_BOOTS		
        [6] = get_wear_item_handle(6),      --WEAR_BELT		
        [8] = get_wear_item_handle(8),      --WEAR_ARMULET			
        [9] = get_wear_item_handle(9),      --WEAR_RING		
        [10] = get_wear_item_handle(10),    --WEAR_SECOND_RING
        [11] = get_wear_item_handle(11),    --WEAR_EAR		
        [26] = get_wear_item_handle(26)     --WEAR_SECOND_EAR
    }
	
	
    for i,itemID in ipairs(itemIDs_table) do
        count = 0
        itemHandle_table = get_item_handle_list(itemID) or {}

        for _, itemHandle in ipairs(itemHandle_table) do

            enchant = get_item_enhance(itemHandle)
            if enchant > 0 or is_item_worn(wear_item, itemHandle) or gv('gold') < 5100 then
                --dont destroy
            else
			    decomposeItem(itemHandle, itemID)
                count = count + 1
			end
        end
		if count > 0 then
			message(sconv("You have decomposed #@count@# pieces of #@name@#", "#@name@#","@"..get_item_name_id(itemID), "#@count@#", count))
		end

    end

end
Download Link below :P

Attached Files
File Type: rar YSM_Decompose.rar (1.4 KB, 23 views)
yosiemelo is offline  
Thanks
4 Users
Old 01/29/2024, 06:27   #2
 
doctorxanny's Avatar
 
elite*gold: 0
Join Date: Jul 2023
Posts: 52
Received Thanks: 2
Bitte geben Sie Ihren gesamten Dateicode kostenlos an. Es wird sowieso niemand kaufen.
doctorxanny is offline  
Reply

Tags
lua, rappelz, script


Similar Threads Similar Threads
LF Äther zerlegen / Äther decompose Tool
03/26/2015 - Aion - 1 Replies
Kennt ihr ein kostenloses Tool zum Äther zerlegen? Ich habe Ghostmouse probiert, aber das funktioniert leider nicht... Es geht lediglich um das Zerkleinern von Äther, es muss also kein Aion spezifisches Programm sein. Is there any free äther decompose tool? Tried Ghostmouse but it doesn't work... I only want do decompose mats, it doesn't has to be a aion specific tool. MfG
[HELP] How can i fix Decompose issue?
02/27/2013 - Rappelz Private Server - 3 Replies
Hello guys, Im using 8.1 Databases. I have a problem, when using "Decompose" function server is shutting down. How can i drop or fix this problem? I'd appreciate it if you help :handsdown:
(relese) 100% working atak speed 0... in CE 5.4
08/10/2008 - General Gaming Discussion - 27 Replies
OK SO THAT GUID WORKING 100% WITH ALL CHRACTERS crdit to me XP 1.enter the game log in ur charcter and be into the game 2.unequip ur weapon (normal speed w8out weapon) for me its 2.0 3.open cheat engine serch 2 in "float" 3.equip ur wapon and serch "decresd valuv" 4.now unequip ur weapon serch "incresd valuv"



All times are GMT +1. The time now is 20:53.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.