kyleflow
-
Content Count
230 -
Joined
-
Last visited
-
Days Won
4
Posts posted by kyleflow
-
-
On 2/14/2024 at 1:23 PM, Angelix said:The tip I shared has nothing to do with the functions shared. It's just a tip.
Also, yes, yes you do have the "&updateall". It's integrated on all GameServer by default, maybe renamed, but it's in there. This is basic knowledge, I'm wondering why you're saying you don't have it...
As for your code, it's already stated you need knowledge on persistency between GameServers. Other people have stated the ways this can be done, but you still need knowledge on how it works. If you haven't been able to get it to work, you're better off learning about those methods instead of trying to brute-force a function onto your files that you have no understanding of how it works because you won't be able to fix it if it breaks something on your files. When you learn how to work with either method mention, then come back and try to re-write your function to work.I'm saying I dont know about it since I never come across any code related to the game that I need to use it. Does it seem appropriate that I dont know of it existance ? I check through the code but unable to find any with Lua that function or simply I dont know how to find it. Tried my best to understand but unable to. Also I'm not actually gaining anything from the code if its working, simply something that should be implement since as the game development tweak mobs and item sets, the role of a support healer lose it purpose. Hope anyone who knows, please do contribute.
-
On 2/9/2024 at 1:10 PM, Angelix said:As a side note, when using global variables, try checking for consistency. If you do not do this, every time you use "&updateall" it will refresh the variable and delete everything you have stored in it, which might also cause trouble when going through all this testing you're doing.
HardenTable = HardenTable or {}
Based on the code example made by other people (simpler form),the declaration for your code should be a header only or inside the function of SHPF? &updateall code, I dont have it.The code for lua_all shared here is not working as expected. Could you assist more on this ?
-
4 hours ago, YeYeJuice said:Hi bro, were you able to find out the exact steps to have all the client and server files working? I would like to test it with some friends.
Would any DB work with these files?
No sadly. I dont have the exact step. Not sure also about DB
-
-
58 minutes ago, Perseus said:Not sure if something is different about my setup, but I had to do an additional step - convert all the files from the traditional chinese encoding to utf-8. VS2022 would break compilation otherwise.
@kyleflow you need to run the symlink script outside and then should be able to use the executables in the `Server` folderWhich VS that would not break the compilation? Can you list step by step what you do and how yo do it
-
Step to do ?
Using VS 2022 Community to open the TOP.sln.
Compile Utility
Compile AudioSDL
Compile Engine
Compile Client
Is that all? where do I find the compiled files?
-
3 hours ago, mkhzaleh said:define the CMD_MM_DO_STRING = 4015 -- lua_all
and tryfunction lua_all(role, cmd) local packet = GetPacket() local CMD_MM_DO_STRING = 4015 WriteCmd(packet, CMD_MM_DO_STRING) WriteDword(packet, 0) WriteString(packet, cmd) SendPacket(role, packet) end
Still error
-
Anyone making guide for this? Never work with CO
-
11 hours ago, mkhzaleh said:i have mentioned it above
your only way to use lua_all or save buffer spr value in .txt and load it back on remove states
all codes about talk about player role, not buffer role so the spr is different
as i mentioned it before too, addstate/removestate have info only of current player that's why i said u have to save it inside skill first then use it later--the code above as example local sprvalue = 5 --this example local cmd = string.format("HardenTable[%d]=%d",deferId,sprvalue) lua_all(cmd,role)
this will update table cross all gameservers for u
I took your advice and changes a bit the code suggested above and here the code. First I put the code of lua_all load in the same files of serialize.lua so that it load before other files load. Here is the code that I changes from above but the results say lua_cmd error from the game notice.
HardenTable = {} function Skill_Shpf_End ( ATKER , DEFER , sklv ) local statelv = sklv local statetime = 600 local deferId = GetPlayerID(GetChaPlayer(DEFER)) local bufferSpr = Sta(ATKER) local cmd = string.format("HardenTable[%d]=%d",deferId,bufferSpr) lua_all(cmd,role) AddState ( ATKER , DEFER , STATE_SHPF , statelv , statetime ) end function State_Shpf_Add ( role , statelv ) local buffer_spr = 0 local deferId = GetPlayerID(GetChaPlayer(role)) if HardenTable[deferId] ~= nil then buffer_spr = HardenTable[deferId][bufferSpr] end local def_dif = 10 + statelv * 4 + buffer_spr local def = DefSb(role) + def_dif SetCharaAttr( def , role , ATTR_STATEV_DEF ) ALLExAttrSet(role) end function State_Shpf_Rem ( role , statelv ) local buffer_spr = 0 local deferId = GetPlayerID(GetChaPlayer(role)) if HardenTable[deferId] ~= nil then buffer_spr = HardenTable[deferId][bufferSpr] HardenTable[deferId] = nil end local def_dif = 10 + statelv * 4 + buffer_spr local def = DefSb(role) - def_dif SetCharaAttr( def , role , ATTR_STATEV_DEF ) ALLExAttrSet(role) end
-
51 minutes ago, Wilhelm said:Maybe it's not optimal, but try this, it should work:
I did get this result before with different code but same issues where when I change location into different map server ( since its not advisable to put 3 big map in 1 server ), the calculation remove the SPR effect leaving the original buff calculation. Clean code btw bro. Better version than what I do.
-
38 minutes ago, Sultan said:@kyleflow Hello, I've written this code it should work pretty well replace this code to yours. Haven't tested it, try it and let me know the results.
If player has Harden skill activated, the following will be applied:
1. Player will gain additional defense stat according to gained spr
2. Player will gain x2 defense stat if Fairy Body skill (Poss) is active
3. Once buff wears off all of the additional stats will go back to normal
Tested out on all the possible ways and here is the result.
1. The target player get double the buff based on your script calculation if in poss before being buff by the buffer. The SPR amount that calculated is not the buffer but instead the player itself.
2. The cross server buff effect registered but the end result is not as expected. I prefer the buffer SPR affect the calculation of the def and benefit of the buff given to the targeted player. But your poss script is much much simple than what I tried to do and that something new.
-
10 hours ago, V3ct0r said:What exactly is your problem?
I actually don't have knowledge on how to to implement it as a global function or make a separate files.
1. Lets says that in a table array, I construct it like this.
local buff_table = {} local buff_atker = {} --i simplified it on the table.insert here for now. buff_table[buff_atker] = { Buff_targetID = "ChaID" , State = "skill state", Timer = "needed?" }
Lets says when the buff given to a target "Buff_targetID" by "buff_atker" with a certain skill "State". How do I made it check inside other gameserver when it is only a readable table.
2. If lets say the buffer buff multiple target, the duration of the buff state itself would not be the same and lets say after the buff duration end, how do I clear individual table data?
-
UP again, need more input from others. Thanks
-
-
Obviously it ain't conventional but hey, it worked with the files version he work with
-
Instead you can just make a check on itemID in the inventory to enable a certain STATE and include the item stats of your choice in the calculation of updated stats when equipped.
-
I know you have been helpful @mkhzaleh. Probably hope other can help me more. I just can't understand the way to make it work for now. Or somehow with trials, I might find the correct way. Anyways, hats off to you for the help.
-
the syntax that you provide such as luall and globalBuff, I tried to check on how to use it properly but to no avail. not at my level of understanding for now. Need a solid case of an example for me to implemented it myself. Do you mind provide me with an example of it ?
-
Okay with assistance from @mkhzaleh. I'm able to make the buff worked with Spirit stats.
Few bugs that occur to me when using this code.
1. The buff retain the 1st buff without poss even after rebuff with poss and vice versa.
2. Sometimes the buff did not calculated when teleporting into other region. It seem like the value changes by location.
E.g If i buff a char in Argent, the value when entering Shaitan is original value, same goes to other location. But, if I then go to Shaitan and buff the same char, the value sustain in Argent and Shaitan and not other location. AND if I swap into poss and buff the same char, the value change into the last buff recorded in the previous location and when I get back to the location of the buff with poss, the value calculated to the new value. Seem like there is a memory issues here which I don't know how to resolved.
Here is the code.
function Skill_Shpf_End ( ATKER , DEFER , sklv ) c = { STATE_JLFT1 , STATE_JLFT2 , STATE_JLFT3 , STATE_JLFT4, STATE_JLFT5, STATE_JLFT6 , STATE_JLFT7, STATE_JLFT8 } local semak_state = 0 if semak_state == c[1] or semak_state == c[2] or semak_state == c[3] or semak_state == c[4] or semak_state == c[5] or semak_state == c[6] or semak_state == c[7] or semak_state == c[8] then local sta_buff = Sta(ATKER)--try tambah a = {} table.insert(a,1,sta_buff) local statelv = sklv local statetime = 600 AddState ( ATKER, DEFER, STATE_SHPF, statelv, statetime ) else local sta_buff = Sta(ATKER)--try tambah a = {} table.insert(a,1,sta_buff) local statelv = sklv local statetime = 600 AddState ( ATKER, DEFER, STATE_SHPF, statelv, statetime ) end --local sta_buff = Sta(ATKER)--try tambah --a = {} --table.insert(a,1,sta_buff) --local statelv = sklv --local statetime = 600 --ubah jd 10min. khairul ubah, asl 180 --AddState ( ATKER , DEFER , STATE_SHPF , statelv , statetime ) --asal atker depan --LG("skill_Shpf", "function Skill_Def_Shpf : " , "role = " , role , "sklv = " , sklv , "\n" ) --xterlibat end function State_Shpf_Add ( role , statelv ) --LG("state", "function State_Shpf_Add : " , " role = ", role, "statelv = " , statelv , "\n" ) --local sta_buff = Sta(role) local def_dif = 10 + a[1] + statelv * 4 -- asal 10 + statelv * 4 local def = DefSb(role) + def_dif SetCharaAttr( def , role , ATTR_STATEV_DEF ) ALLExAttrSet(role) end function State_Shpf_Rem ( role , statelv ) -- LG("state", "function State_Shpf_Rem : " ,"statelv = " , statelv , " role = ", role, "\n" ) --local sta_buff = Sta(role) local def_dif = 10 + a[1] + statelv * 4 local def = DefSb(role) - def_dif SetCharaAttr( def , role , ATTR_STATEV_DEF ) ALLExAttrSet(role) end
-
-
@mkhzaleh i tried simply change it into this
local sta_buff = Sta(role)
This actually work but the stats its calculated is based on the target Spirit not the buffer. Probably that is why in heal, it used ATKER instead of other role. now need to think on how to ensure the buffer Spirit is used for the def calculation
-
2 hours ago, mkhzaleh said:not sure what are you trying to do but you already call none exist role in your code
local sta_buff = Sta(ATKER) * 0.5 -- tarik stats spr
its role not atker
I tried to include the value of Spirit into the calculation of def_dif so that it can be add and remove. Is it not ATKER role? weird since I check the one for heal. it seem like it. but the one on heal seem be complicated and I don't know how to properly align it with the harden.
-
11 hours ago, mkhzaleh said:function Sta(a) --LuaPrint("Obtain character attribute sta") local sta=GetChaAttr(a,ATTR_STA) --[[ȡsta]]-- return sta end
spr values
I tried to change the way it calculate harden buff with Sta in play but it just not working out. Can you check why its not working based on this code.
function State_Shpf_Add ( role , statelv ) --LG("state", "function State_Shpf_Add : " , " role = ", role, "statelv = " , statelv , "\n" ) local sta_buff = Sta(ATKER) * 0.5 -- tarik stats spr local def_dif = 10 + sta_buff + statelv * 4 -- asal 10 + statelv * 4 local def = DefSb(role) + def_dif SetCharaAttr( def , role , ATTR_STATEV_DEF ) ALLExAttrSet(role) end function State_Shpf_Rem ( role , statelv ) -- LG("state", "function State_Shpf_Rem : " ,"statelv = " , statelv , " role = ", role, "\n" ) local sta_buff = Sta(ATKER) * 0.5 local def_dif = 10 + sta_buff + statelv * 4 local def = DefSb(role) - def_dif SetCharaAttr( def , role , ATTR_STATEV_DEF ) ALLExAttrSet(role) end
I tried it multiple time, simply adding a check for Sta also fails the skill. not including the Sta call up inside the def_dif calculation for that trial. But in the code I include it and it also fail. it wont change the value from the before buff value.
-
Known as an example that a cleric spiritual bolt is the only dmg skill that affected by Spirit stats. Can anyone guide me on how to change other buff to be affected by Spirit stats also. In the function for spiritual bolt, is this indicate spirit level ?
function Skill_Xlcz_End ( ATKER , DEFER , sklv ) if ValidCha(ATKER) == 0 then LG ( "luascript_err" , "function Skill_Xlcz_End : ATKER as null" ) return end if ValidCha(DEFER) == 0 then LG ( "luascript_err" , "function Skill_Xlcz_End : DEFER as null" ) return end -- local atkdmg = Atk_Dmg ( ATKER , DEFER ) local lv_atker = Lv ( TurnToCha ( ATKER ) ) local lv_defer = Lv ( TurnToCha ( DEFER ) ) local sta_atker = Sta(ATKER) -- IS THIS THE Spirit STATS or IS THIS SP AMOUNT? local sta_defer = Sta(DEFER) local lv_dif = math.max ( ( - 1 ) * 10 , math.min ( 10 , lv_atker - lv_defer ) ) local AddStateLv = 0 AddStateLv = GetChaStateLv ( ATKER , STATE_MLCH ) hpdmg = math.floor (( 10 + sta_atker * 2 ) * ( 1 + sklv * 0.25 ) * ( 1 + lv_dif * 0.025 )) local map_name_ATKER = GetChaMapName ( ATKER ) local map_name_DEFER = GetChaMapName ( DEFER ) local agi_atker = Agi(ATKER) local Can_Pk_Garner2 = Is_NormalMonster (DEFER) if map_name_ATKER == "garner2" or map_name_DEFER == "garner2" then if Can_Pk_Garner2 == 0 then local dmg = MAGIC_Atk_Dmg(ATKER,DEFER) hpdmg = math.floor (dmg * ( 1 + sklv * 0.1 ) ) -- Notice ( "statetime="..statetime) end end local dmg_fin = Cuihua_Mofa ( hpdmg ,AddStateLv ) local dmg_ElfSkill = ElfSkill_MagicAtk ( hpdmg , ATKER ) dmg_fin = dmg_fin + dmg_ElfSkill Hp_Endure_Dmg ( DEFER, dmg_fin ) -- LG( "xlcz", "Spiritual Bolt Skill Level=" , sklv ,"Attacker sta=", sta ,"Normal attack damage=", atkdmg , "Skill Damage= " , dmg , "\n" ) end
Is this the part for Spirit Stats or is it SP amount?
local sta_atker = Sta(ATKER)
Hey, how can i make a plug and play private server for fun
in Guides
Posted · Report reply
There is actually a release of plug and play if you search the forum but not like other private server that you do not need to install anything, this one need to install things but all the item and instruction is provided by the community released.