saa0d 2 Report post Posted July 25, 2017 Hello guys, I want to make a Lvl up NPC that would lvl you up. It works this way: Say you have 1x Old Ticket. You go to the npc, checks your lvl, takes the old ticket and lvl u up to the next lvl. I tried using GetChaAttr to get the lvl - which I copied from functions.lua- but when I approach the npc, it stops functioning. I tried making a function similar to AddExp_1 but When I apply it, nothing happens. I tried modifying AddExp_1 its self but when I apply it, I don't get the modified effects. Anybody can help? Thanks Quote Share this post Link to post Share on other sites
mangojkee 47 Report post Posted July 25, 2017 2 часа назад, saa0d сказал: Hello guys, I want to make a Lvl up NPC that would lvl you up. It works this way: Say you have 1x Old Ticket. You go to the npc, checks your lvl, takes the old ticket and lvl u up to the next lvl. I tried using GetChaAttr to get the lvl - which I copied from functions.lua- but when I approach the npc, it stops functioning. I tried making a function similar to AddExp_1 but When I apply it, nothing happens. I tried modifying AddExp_1 its self but when I apply it, I don't get the modified effects. Anybody can help? Thanks mb, you can give an example that you are using? In general it works local lv_role = GetChaAttr ( role , ATTR_LV ) local lv_next = lv_role + 1 SetChaAttrI( role , ATTR_LV , lv_next ) Quote Share this post Link to post Share on other sites
saa0d 2 Report post Posted July 25, 2017 50 minutes ago, mangojkee said: mb, you can give an example that you are using? In general it works local lv_role = GetChaAttr ( role , ATTR_LV ) local lv_next = lv_role + 1 SetChaAttrI( role , ATTR_LV , lv_next ) Yes, I have done that! Well tbh it works but not fully. What happens is that the lvl changes only after i relog or teleport! Plus when I do that, I don't get the lvl up visual effect! I tried using the AddExp method but turns out that the exp table is wrong for all lvls above 2! Usually, the method u stated is the logical one but as I said, I need to teleport to see change and I don't get the lvl up effect which I want. Help?! Thanks Quote Share this post Link to post Share on other sites
mangojkee 47 Report post Posted July 25, 2017 7 минут назад, saa0d сказал: Yes, I have done that! Well tbh it works but not fully. What happens is that the lvl changes only after i relog or teleport! Plus when I do that, I don't get the lvl up visual effect! I tried using the AddExp method but turns out that the exp table is wrong for all lvls above 2! Usually, the method u stated is the logical one but as I said, I need to teleport to see change and I don't get the lvl up effect which I want. Help?! Thanks Also, you can teleport cha after lvl_up with goto function)) Quote Share this post Link to post Share on other sites
saa0d 2 Report post Posted July 25, 2017 2 minutes ago, mangojkee said: Also, you can teleport cha after lvl_up with goto function)) But I still won't get the lvl up effect.. Plus isn't goto function only ingame? or i can use it in lua? Quote Share this post Link to post Share on other sites
mangojkee 47 Report post Posted July 25, 2017 (edited) 6 минут назад, saa0d сказал: But I still won't get the lvl up effect.. Plus isn't goto function only ingame? or i can use it in lua? GoTo( role, pos_x, pos_y, map) - function for example local x, y = GetChaPos(role) local map_name = GetChaMapName (role) local x = math.floor (x/100) local y = math.floor (y/100) GoTo( role, x, y, map) Edited July 25, 2017 by mangojkee Quote Share this post Link to post Share on other sites
saa0d 2 Report post Posted July 25, 2017 4 minutes ago, mangojkee said: GoTo( role, pos_x, pos_y, map) - function Thanks it works, But still.. I want the Lvl Up effect, any idea how to make it work?! I noticed that it appears when I lvl up using AddExp but not SetChaAttr! Quote Share this post Link to post Share on other sites
mangojkee 47 Report post Posted July 25, 2017 (edited) 6 минут назад, saa0d сказал: Thanks it works, But still.. I want the Lvl Up effect, any idea how to make it work?! I noticed that it appears when I lvl up using AddExp but not SetChaAttr! As far as I understand, the accumulated experience is stored in the database, and as you say: "exp table is wrong for all lvls above 2", most likely when the level is raised through SetChaAttrI - ATTR_LB - the level rises, but visually there is no effect due to the fact that where that is checking Ex. From exp tables Mb if you fix exp tables -> lvl_up will work Sorry for a Google translate Edited July 25, 2017 by mangojkee Quote Share this post Link to post Share on other sites
saa0d 2 Report post Posted July 25, 2017 4 minutes ago, mangojkee said: As far as I understand, the accumulated experience is stored in the database, and as you say: "exp table is wrong for all lvls above 2", most likely when the level is raised through SetChaAttrI - ATTR_LB - the level rises, but visually there is no effect due to the fact that where that is checking Ex. From exp tables Mb if you fix exp tables -> lvl_up will work Sorry for a Google translate Actually I tried changing the exp table using another clean server files, nothing has changed! Quote Share this post Link to post Share on other sites
saa0d 2 Report post Posted July 25, 2017 Problem solved by @KONG thanks all! Quote Share this post Link to post Share on other sites
mangojkee 47 Report post Posted July 26, 2017 18 часов назад, saa0d сказал: Problem solved by @KONG thanks all! Please describe the fix Quote Share this post Link to post Share on other sites
saa0d 2 Report post Posted July 26, 2017 12 minutes ago, mangojkee said: Please describe the fix He did something that he called npc binding where he registered something in npcsdk which i have no idea of. I can't get the codes now am not on my computer sorry. Quote Share this post Link to post Share on other sites