Does anyone know how I can fix Skill point scroll? When trying to use the item it says the item is unusable. However CanUse is set to 1 in _RefObjCommon
I am willing to pay for a working solution. I am only interested in making the original item work as it should. No custom items that also teleport the player and use procedures to update the SP.
Does anyone know how I can fix Skill point scroll? When trying to use the item it says the item is unusable. However CanUse is set to 1 in _RefObjCommon
I am willing to pay for a working solution. I am only interested in making the original item work as it should. No custom items that also teleport the player and use procedures to update the SP.
Thanks in advance and have a good day
Use DB2PK2 tool then import the files into the client.
This usually happens when the refobjcommon ID doesn't match the itemdata one.
I checked into this for fun tonight, and it doesn't look possible. VSRO 188 doesn't seem to contain the logic handler to use that item, so that's why you get "The selected item is unusable" error. I believe the "CanUse" field just means can you right click to use it, which is why you can right click to use it, but the game server is failing to actually use it, as opposed to you just not being able to right click it (with like arrows, for example)
I tracked down the problem to be that logic handler for item use. TypeID4 is being checked to select which logic handler to run. However, a handler for any TypeID4 above 11 is not implemented, so it doesn't know how to use the item. If you change the JA to JMP, any item that is used from this section of the code becomes unusable, so it was pretty easy to put things together.
If you run the query
Code:
SELECT
Service, Id, CodeName128, DescStrID128, CashItem, TypeID1, TypeID2, TypeID3, TypeID4
FROM _RefObjCommon
where
TypeID1 = 3 and
TypeID2 = 3 and
TypeID3 = 3
order by TypeID4
You'll end up with the following list of items to verify the logic handlers for:
So for example, ITEM_MALL_GLOBAL_CHATTING has a TypeID4 of 5. If you were to breakpoint in the GameServer at 0x49BA6E when using a global chat item, EAX would be set to 4 (since the code subtracts 1 to do the handler lookup) which is something I've confirmed along with a few other types.
Likewise, ITEM_ETC_E090825_LAMP_10SP has a TypeID4 of 10. It too works without issue and is easily testable.
Obviously, I'm using ITEM_EVENT_RENT_SKILLPOINT_SCROLL because that's what the VSRO itemdata contains, and not the other 3, but their TypeID's are all the same anyways, so it wouldn't matter anyways. However, since their TypeID4 is 12, there's no code in GameServer to handle it.
To do one last confirmation, give yourself an ITEM_EVENT_OPTLEVEL_UPGRADE_SCROLL_1 and try to use it. With a TypeID4 of 14 and it being in service by default, it shouldn't be usable (and it's not).
My conclusion is that VSRO just doesn't have the original code to handle that item, which makes sense, because there's quite a few items in the PK2s that didn't exist for certain versions, but the data in the PK2s was always there. That, and the fact the service was probably set to 0 for a reason. The reason I grouped the sql by TypeID4, is if you consider the items in each group, the handlers would all handle the same type of logic for each item.
For example, 1 = Teleport Scrolls, 2 = COS, 3 = Reverse Return (which have options for the player to choose from), 4 = Booth Decoration, and so on. 10 is related to scrolls, but if you change TypeID4 to 10 instead of 12, the GameServer still doesn't handle it correctly, so that pretty much confirms it's not a matter of the wrong TypeID4 being set for it.
Basically, you'll either have to find another SRO version that has the code to handle this item and port the code over, or implement custom logic yourself.
I checked into this for fun tonight, and it doesn't look possible. VSRO 188 doesn't seem to contain the logic handler to use that item, so that's why you get "The selected item is unusable" error. I believe the "CanUse" field just means can you right click to use it, which is why you can right click to use it, but the game server is failing to actually use it, as opposed to you just not being able to right click it (with like arrows, for example)
I tracked down the problem to be that logic handler for item use. TypeID4 is being checked to select which logic handler to run. However, a handler for any TypeID4 above 11 is not implemented, so it doesn't know how to use the item. If you change the JA to JMP, any item that is used from this section of the code becomes unusable, so it was pretty easy to put things together.
If you run the query
Code:
SELECT
Service, Id, CodeName128, DescStrID128, CashItem, TypeID1, TypeID2, TypeID3, TypeID4
FROM _RefObjCommon
where
TypeID1 = 3 and
TypeID2 = 3 and
TypeID3 = 3
order by TypeID4
You'll end up with the following list of items to verify the logic handlers for:
So for example, ITEM_MALL_GLOBAL_CHATTING has a TypeID4 of 5. If you were to breakpoint in the GameServer at 0x49BA6E when using a global chat item, EAX would be set to 4 (since the code subtracts 1 to do the handler lookup) which is something I've confirmed along with a few other types.
Likewise, ITEM_ETC_E090825_LAMP_10SP has a TypeID4 of 10. It too works without issue and is easily testable.
Obviously, I'm using ITEM_EVENT_RENT_SKILLPOINT_SCROLL because that's what the VSRO itemdata contains, and not the other 3, but their TypeID's are all the same anyways, so it wouldn't matter anyways. However, since their TypeID4 is 12, there's no code in GameServer to handle it.
To do one last confirmation, give yourself an ITEM_EVENT_OPTLEVEL_UPGRADE_SCROLL_1 and try to use it. With a TypeID4 of 14 and it being in service by default, it shouldn't be usable (and it's not).
My conclusion is that VSRO just doesn't have the original code to handle that item, which makes sense, because there's quite a few items in the PK2s that didn't exist for certain versions, but the data in the PK2s was always there. That, and the fact the service was probably set to 0 for a reason. The reason I grouped the sql by TypeID4, is if you consider the items in each group, the handlers would all handle the same type of logic for each item.
For example, 1 = Teleport Scrolls, 2 = COS, 3 = Reverse Return (which have options for the player to choose from), 4 = Booth Decoration, and so on. 10 is related to scrolls, but if you change TypeID4 to 10 instead of 12, the GameServer still doesn't handle it correctly, so that pretty much confirms it's not a matter of the wrong TypeID4 being set for it.
Basically, you'll either have to find another SRO version that has the code to handle this item and port the code over, or implement custom logic yourself.
Thank you, that makes perfect sense. Although I am not even close to the level as you are to prove it by disassembling but I was just looking at all the items that are not working and started to wonder if it was based on TypeID4 as all those had pretty high TypeID4 values. Your explanation proves that and again, thank you for sharing it
What would be the best way to implement such a scroll(or any scroll) that updates values in the DB without teleport/relog in your opinion?
The middle 4 bytes is the new SP, so you could just make your code/proxy send that packet to the client to update their SP value with whatever you just updated in the DB.
I'd just approach the problem that way, try to find whatever game update packet exists for the data you want to change, and then just send that update packet with the new data. For some more complicated things, a teleport in place might be needed, as the only other way to update things in the client that it doesn't have handlers for, is by just coding custom logic in the client and handling a custom packet that updates using the new data.
You could also create a SoOk event (see jewel boxes), ask for the specific item and trade it for sp with "LuaSetAchievedSkillPont(XYZ)".
It will be an easy workaround to include items like fades beads into older sro files.
You could also create a SoOk event (see jewel boxes), ask for the specific item and trade it for sp with "LuaSetAchievedSkillPont(XYZ)".
It will be an easy workaround to include items like fades beads into older sro files.
but this part about filling new sp/item can be done through game server only
See attached example to give SP EXP for specific items, using LUA scripts. You do not have to edit the gameserver to use it.
Ofc. you can also edit your gameserver if you want, but you could also use an existing function, instead of reversing a "new function".
I am quite sure you could also use that function to receive a packet structure, which will be needed to add sp to the client.
Code:
function SRO_019_GiveEventRewardItem(EventID, items_required, consumed_item)
SYSOP_REASON_Event = 0
items = LuaEventInQuireSameItem(0, consumed_item, INQUIRE_SAMEITEM_OP_COUNT_ALL_SAMEITEM, 0)
if items > 0 then
for i = 1 , items do
SRO_001_ItemDel(items_required, consumed_item)
sp_exp = SRO_001_Random_2_Dice_SP()
LuaGiveEventPoint_EXP_Gold(0, sp_exp, 0)
end
end
end
With sp_exp being:
Code:
function SRO_001_Random_2_Dice_SP()
return_result = 400
result = LuaRaSROd_rand_n(1, 1000)
if result <= 27 then
return_result = 4000
elseif result <= 83 then
return_result = 10000
elseif result <= 166 then
return_result = 20000
elseif result <= 277 then
return_result = 30000
elseif result <= 416 then
return_result = 40000
elseif result <= 583 then
return_result = 100000
elseif result <= 722 then
return_result = 200000
elseif result <= 833 then
return_result = 300000
elseif result <= 916 then
return_result = 400000
elseif result <= 972 then
return_result = 600000
elseif result <= 1000 then
return_result = 800000
else
return_result = 400
end
return return_result
end
Skill added but not visible in skill tab, and cant add to skill bar. 02/16/2024 - SRO PServer Questions & Answers - 4 Replies Hi guys, i'm trying to modify cleric skill but i end up with a visual bug.
As you can see in the picture, skill not display level, as long as i add skill points reduced, but i cant pick skill and put it to skill bar.
I kinda sure server side is good, just the media side, it will be nice if someone can have solution for this bug. Thank in advance !