|
You last visited: Today at 06:54
Advertisement
Rappelz Skills Card Combiner help
Discussion on Rappelz Skills Card Combiner help within the Rappelz Private Server forum part of the Rappelz category.
01/16/2024, 04:29
|
#1
|
elite*gold: 0
Join Date: Mar 2013
Posts: 8
Received Thanks: 2
|
Rappelz Skills Card Combiner help
Hey guys , I've been racking my brain with this LUA for auto combining skill cards . I can get everything working besides the actual combination when clicking the +1 to +2 combine option . Auth emu doesnt spit any issues , so i've tried racking Chatgpt's brain but no luck doing it's suggestions. Working with modified version of Revos 9.5.2 database
function get_module_name()
return "Skill_cardcombine"
end
function mapTable(inputTable, transformation)
local resultTable = {}
if type(inputTable) == "table" then
for i, value in ipairs(inputTable) do
table.insert(resultTable, transformation(value))
end
else
print("Input is not a table.")
end
return resultTable
end
sellCards = { 1, 2, 3, 4, 5 }
sellCards2 = mapTable(sellCards, function(e) return e * 10 + 2 end)
sellCards3 = mapTable(sellCards, function(e) return e * 10 + 3 end)
sellCards4 = mapTable(sellCards, function(e) return e * 10 + 4 end)
function inTable(tbl, item)
for , value in ipairs(tbl) do
if value == item then
return true
end
end
return false
end
function Skill_card_combine_contact()
dlg_title("Combine your skillcards")
dlg_text("Combine your skillcards in bulk!")
dlg_menu("Combine with normal cubes!", 'combine_with_normal_cubes_menu()')
dlg_menu("Combine with special cubes!", 'combine_with_special_cubes_menu()')
dlg_show()
end
function combine_with_normal_cubes_menu()
dlg_title("Combine your skillcards")
dlg_text("Combine your skillcards in bulk!")
dlg_menu("+1 to +2", 'attemptCombine(70)')
dlg_menu("+2 to +3", 'attemptCombine(60)')
dlg_menu("+3 to +4", 'attemptCombine(50)')
dlg_menu("+4 to +5", 'attemptCombine(40)')
dlg_show()
end
function combine_with_special_cubes_menu()
dlg_title("Combine your skillcards")
dlg_text("Combine your skillcards in bulk!")
dlg_menu("+1 to +2", 'combine_with_special_cubes(1)')
dlg_menu("+2 to +3", 'combine_with_special_cubes(2)')
dlg_menu("+3 to +4", 'combine_with_special_cubes(3)')
dlg_menu("+4 to +5", 'combine_with_special_cubes(4)')
dlg_show()
end
function attemptCombine(rate)
local count, tableChoice
if rate == 70 then
count = table.getn(sellCards)
tableChoice = sellCards
elseif rate == 60 then
count = table.getn(sellCards2)
tableChoice = sellCards2
elseif rate == 50 then
count = table.getn(sellCards3)
tableChoice = sellCards3
elseif rate == 40 then
count = table.getn(sellCards4)
tableChoice = sellCards4
end
for i = 1, count do
combine(tableChoice[i], rate)
end
end
function combine(id, rate)
local handles = get_item_handle_list(id)
local handleCount = table.getn(handles)
local success = 0
local is_card = inTable(sellCards,id) or inTable(sellCards2, id) or inTable(sellCards3, id) or inTable(sellCards4, id)
if handleCount > 1 then
local remainder = handleCount % 2
local totalOperations = (handleCount - remainder) / 2
for i = 1, totalOperations * 2, 2 do
local rng = math.random(0, 100)
delete_item(handles[i])
delete_item(handles[i + 1])
if rng <= rate then
if rate == 70 then
insert_item((id*10) + 1)
success = success + 1
elseif rate == 60 then
insert_item(id + 1)
success = success + 1
elseif rate == 50 then
insert_item(id +1 )
success = success + 1
elseif rate == 40 then
insert_item(id + 1)
success = success + 1
end
end
end
end
return success
end
|
|
|
01/16/2024, 15:46
|
#2
|
elite*gold: 0
Join Date: Apr 2017
Posts: 200
Received Thanks: 113
|
oh  here we go again :P
contact me on discord when you still need help with that
|
|
|
01/16/2024, 18:42
|
#3
|
elite*gold: 0
Join Date: Mar 2013
Posts: 8
Received Thanks: 2
|
Not asking for anyone to redo it , just asking for guidance in the right direction for someone fairly new to LUA/ and or if someone see's something wrong with what I've got . What I'm asking for isn't justifiable IMO by paying you . So no thanks.
|
|
|
01/16/2024, 18:54
|
#4
|
elite*gold: 0
Join Date: Apr 2017
Posts: 200
Received Thanks: 113
|
Quote:
Originally Posted by lordfarthhold
Not asking for anyone to redo it , just asking for guidance in the right direction for someone fairly new to LUA/ and or if someone see's something wrong with what I've got . What I'm asking for isn't justifiable IMO by paying you . So no thanks.
|
I don't mean paying for that; I just wanted to give you some tips that might be easier than on this forum.
Your script is ALMOST completely wrong from start to finish, except when it comes to talking with NPCs. So, you are approaching it the wrong way.
1.You need an array of cards for specific races.
2.Your logic for combining them is incorrect. When you have 1000 cards and encounter a failure, it removes your cards. Instead, you should use a for loop or a while loop and independently randomize chances each time.
3.You don't ask about the enchant item anywhere.
4.You don't have checks, which leads to more bugs in your script.
etc etc etc etc etc etc etc etc etc etc etc etc etc etc etc etc etc
|
|
|
01/16/2024, 19:30
|
#5
|
elite*gold: 0
Join Date: Mar 2013
Posts: 8
Received Thanks: 2
|
Ohhh gotcha my bad for assuming XD , So just for helping other's who may come across this issue . I'd like to keep it on the forum for some extra resource material for up and coming dev's .
Could you possibly explain the logic that I should be using a little more? I pulled a good portion of this script from some old files I had lying around from a 7.3 project. So I know some stuff changed from there to the new Epic's.
Like as in some stuff you mentioned above
@2.Your logic for combining them is incorrect. When you have 1000 cards and encounter a failure, it removes your cards. Instead, you should use a for loop or a while loop and independently randomize chances each time. < Primarily this for the Loop
and
3.You don't ask about the enchant item anywhere.
|
|
|
01/16/2024, 19:41
|
#6
|
elite*gold: 0
Join Date: Apr 2017
Posts: 200
Received Thanks: 113
|
Quote:
Originally Posted by lordfarthhold
Ohhh gotcha my bad for assuming XD , So just for helping other's who may come across this issue . I'd like to keep it on the forum for some extra resource material for up and coming dev's .
Could you possibly explain the logic that I should be using a little more? I pulled a good portion of this script from some old files I had lying around from a 7.3 project. So I know some stuff changed from there to the new Epic's.
Like as in some stuff you mentioned above
@2.Your logic for combining them is incorrect. When you have 1000 cards and encounter a failure, it removes your cards. Instead, you should use a for loop or a while loop and independently randomize chances each time. < Primarily this for the Loop
and
3.You don't ask about the enchant item anywhere.
|
ok i do that when im home later
Quote:
Originally Posted by lordfarthhold
Ohhh gotcha my bad for assuming XD , So just for helping other's who may come across this issue . I'd like to keep it on the forum for some extra resource material for up and coming dev's .
Could you possibly explain the logic that I should be using a little more? I pulled a good portion of this script from some old files I had lying around from a 7.3 project. So I know some stuff changed from there to the new Epic's.
Like as in some stuff you mentioned above
@2.Your logic for combining them is incorrect. When you have 1000 cards and encounter a failure, it removes your cards. Instead, you should use a for loop or a while loop and independently randomize chances each time. < Primarily this for the Loop
and
3.You don't ask about the enchant item anywhere.
|
So... let's start by defining the LOCAL table with card IDs for different races.
You can do this inside the combine function or outside.
Code:
local SkillCardsID = {}
SkillCardsID[1] = { -- Devaskills
502001, 502011, 502012, 502013, 502014, 502018, 502019, 502020, 502021,
502022, 502061, 502063, 502064, 502067, 502068, 502611, 502615, 502635,
503001, 503002, 503003, 503004, 503005, 503011, 503037, 503040, 503201,
503202, 503203, 503204, 503205, 503210, 503401, 503402, 503454, 503492,
503621, 503814, 503815, 504001, 504002, 504003, 504012, 504201, 504202,
504207, 504402, 506010, 521124, 521302, 521304, 521308, 521320, 521417,
521427, 521504, 521506, 521524, 521525, 521526, 521527, 522001, 522002,
522003, 522004, 522005, 522006, 522007, 522008, 523001, 523002, 523003,
523004, 523009, 523010, 523011, 523012, 523013, 523014, 523201, 523202,
523204, 523205, 523206, 523401, 523402, 523403, 523404, 523405, 523406,
523407, 523408, 523409, 523410, 523411, 523412, 523413, 523414, 523415,
523416, 523417, 523432, 523433, 523434, 523435, 523436, 523437, 523438,
523439, 523601, 523606, 524204, 524401, 524402, 524403, 524404, 550101,
550102, 550401
}
SkillCardsID[2] = { -- Asuraskills
502001, 502031, 502032, 502033, 502034, 502051, 502060, 502070, 502071,
502074, 502075, 502076, 502077, 502078, 502303, 502304, 502331, 502332,
502333, 502334, 502337, 502339, 502340, 502501, 502502, 502503, 502601,
502620, 502621, 502622, 502623, 502624, 502626, 502630, 502637, 502638,
502639, 502649, 502671, 502672, 502673, 502676, 502677, 502678, 502679,
503012, 503013, 503014, 503015, 503016, 503017, 503027, 503030, 503033,
503035, 503156, 503185, 503186, 503211, 503212, 503411, 503412, 503435,
503458, 503460, 503461, 503601, 503602, 503603, 503607, 503608, 503613,
503614, 503616, 503750, 503753, 503803, 503806, 503810, 503811, 504001,
504002, 504003, 504012, 504211, 504412, 504413, 504612, 504613, 504614,
504801, 504802, 504901, 506010, 522011, 522301, 522302, 522303, 522304,
522307, 523005, 523006, 523007, 523008, 523017, 523203, 523428, 523429,
523430, 523431, 523444, 523445, 523605, 523801, 523802, 524201, 524405,
524406, 524407, 524802, 524803, 524804, 524805, 531105, 531108, 531116,
531117, 531124, 531204, 531208, 531308, 531314, 531315, 531320, 531329,
531407, 531504, 531505, 531512, 531524, 531526, 550201, 550401
}
SkillCardsID[3] = { -- Gaiaskills
502001, 502041, 502043, 502044, 502045, 502046, 502052, 502053, 502055,
502056, 502058, 502082, 502311, 502312, 502313, 502315, 502321, 502322,
502326, 502328, 502602, 502616, 502617, 502631, 502635, 502641, 502642,
502645, 502655, 502656, 502661, 502662, 502663, 502664, 502668, 502681,
502682, 503021, 503022, 503023, 503024, 503025, 503103, 503151, 503181,
503183, 503187, 503188, 503209, 503220, 503222, 503224, 503423, 503424,
503425, 503426, 503427, 503428, 503429, 503430, 503431, 503472, 503622,
503751, 503752, 503754, 503901, 504001, 504002, 504003, 504012, 506010,
522009, 522010, 522012, 522305, 522306, 522501, 523015, 523016, 523418,
523419, 523420, 523421, 523422, 523423, 523424, 523425, 523426, 523427,
523441, 523442, 523443, 523602, 523603, 523604, 524001, 524002, 524202,
524203, 524801, 541107, 541124, 541211, 541224, 541225, 541306, 541315,
541329, 541330, 541406, 541413, 541506, 541513, 541523, 550301, 550401
}
Additionally, you did not consider different chances for each enhancement level.
This can be done using a local array variable that contains both arrays of chances, one for the normal cube, the other for the ancient cube.
Code:
local success_percent= { {100, 60, 50, 40, 30, 20, 15, 10, 5, 3}, --- normal cube
{100, 90, 80, 70, 60, 50, 45, 40, 35, 33 } --- ancient cube
local cube_array = {700401,700402} --cube ids
Below is a function from my friend InkDevil. It checks true if an item is removable (not equipped) and has the appropriate enhance.
Code:
---With Enhancement Filter, nonstackable items
function check_hlist_amount_with_enhance(nItemId , amount, nEnhance)
local hList = get_item_handle_list(nItemId)
local hDeletionList = {}
local nAmount = 0
for i,v in ipairs(hList) do
if is_erasable_item(v) == 1 and get_item_enhance(v) == nEnhance then
nAmount = nAmount + 1
table.insert(hDeletionList, v)
if nAmount == amount then
return true,hDeletionList
end
end
end
hDeletionList = {}
return false,hDeletionList
end
The full 'combine' function looks like this, I recommend you read it carefully and draw conclusions from it.
If you don't understand a part of the code, ChatGPT can help you perfectly with that.
Unfortunately, GPT does not know the Rappelz environment, so it cannot write scripts specifically for Rappelz.
However, I thought about creating GPTs that I would teach Rappelz functions and train them in using them, but I don't have time for that :c
Code:
function new_skillcard_upgrade(nCard, current_enhance, nCubeType, bMessage)
local success_percent= { {100, 60, 50, 40, 30, 20, 15, 10, 5, 3}, --- normal cube
{100, 90, 80, 70, 60, 50, 45, 40, 35, 33 }
}
local cube_array = {700401,700402}
local checkS, itemS = check_hlist_amount_for_stackable_items(nCard,2,current_enhance)
local checkC, itemC = check_hlist_amount_for_stackable_items(cube_array[nCubeType],1,0)
local count = 0
local bWithMessage = bMessage
if bWithMessage == nil or bWithMessage == "" then
bWithMessage = false
end
while checkS == true and checkC == true do
delete_item(itemS,2)
delete_item(itemC,1)
local serverrate = get_env("game.skillcard_enhance_rate")
if math.random( 1, 100) <= (success_percent[nCubeType][current_enhance+1] * serverrate) then
insert_item(nCard,1,current_enhance +1)
count = count + 1
end
checkS, itemS = check_hlist_amount_for_stackable_items(nCard,2,current_enhance)
checkC, itemC = check_hlist_amount_for_stackable_items(cube_array[nCubeType],1,0)
end
if checkS == false and bWithMessage == true and count > 0 then
-- message("You don't have enough skillcards to use this function further!")
message("Processing skillcard...done!")
elseif checkC == false and bWithMessage == true and count > 0 then
message("You don't have enough of the selected skillcubes to use this service further!")
end
if bWithMessage == true and count > 0 then
message(sconv("<#B3EE3A>Process-Result: #@amount@#x #@itemname@ +#@new_enhance@#!","#@amount@#",count,"#@itemname@","@"..get_item_name_id(nCard),"#@new_enhance@#",current_enhance +1))
end
return count
end
|
|
|
01/17/2024, 22:05
|
#7
|
elite*gold: 0
Join Date: Sep 2015
Posts: 603
Received Thanks: 1,201
|
You didn't post the fitting functions for it.
In new_skillcard_upgrade you're calling check_hlist_amount_for_stackable_items, you was posting check_hlist_amount_with_enhance, which actually had a fkin comment above from me that this one is for NONSTACKABLE items.
The version for stackables contains functions which I've added in sourcecode (for checking stack-size), so not really useable for a non-source-server - but you might have known that at least.
You can use the nonstack-version, sure, but it wouldn't work that way as the stackable one does...
@  sry I have to interfere in your thread, but it would actually confuse you more if you'd use those parts of my script than leading to your requested help.
|
|
|
 |
Similar Threads
|
Deli Rappelz, Rappelz Private Server, Türkçe Rappelz Private Server, Rappelz Deli
03/10/2014 - Rappelz Private Server - 2 Replies
Merhaba kardeşlerim,
deli rappelz açıldı.
Oyundan kısaca bahsedersek oyun 7.4 versiyonlu muhteşem bi oyundur.
Herkeze tavsiye edebilirim - Oyunda sadece oyuncuyum sizleride oyunda görürsek daha mutlu oluruz.
Oyun 24 saat açıktır istediğiniz zaman girer oynarsınız.
######### Oyun özellikleri #########
x60 Drop özelliği (1 Saat içerisinde 100 level olabilme imkanı.) & ne zor ne kolay tam orta derece. sıkılmayacaksınız!
Volkanus (Aktif!)
|
MakeSafSah Tool (Patcher/Combiner)
09/18/2012 - Shaiya Private Server - 4 Replies
MakeSafSah
Requirements:
Python - Download (Tested on 2.6)
Download Here
|
[Tool] Shaiya data re-Combiner
08/15/2010 - Shaiya Hacks, Bots, Cheats & Exploits - 3 Replies
Why is this useful?
When Shaiya has many patches applied the data file becomes fragmented and messy. Using this tool along with the Data SAF Extractor Chinese Tool you can make a "CLEAN" Data file that can be used as if the Shaiya version was just installed. This will lead to better performance and smaller file sizes.
This also could be used to re-combine modified data files as well, such as new model, textures etc (would be client-sided though).
It does NOT include the CRC file...
|
All times are GMT +1. The time now is 06:55.
|
|