speppoz 7 Posted February 26, 2018 Share Posted February 26, 2018 Hi all! I followed the guide at that link about the connection between client and quest: https://metin2dev.org/board/index.php?/topic/1698-howtooldquest-client-communicationfor-any-version/ But when I press the button in game, nothing happens in the quest! If I do it only on a graphical point of view, the button reacts to the click, but it doesn't get the anti exp active. This is my code added for the quest: game.py: def OnClickBlockExp(self): event.QuestButtonClick(int(constInfo.BLOCK_EXP)) ---------------------------------------------------------------------------------------------------------------- def __ServerCommand_Build(self): serverCommandList={ "blocco_exp" : self.blocco_exp, ---------------------------------------------------------------------------------------------------------------- def blocco_exp(self,value): constInfo.BLOCK_EXP = int(value) quest: quest anti_exp begin state start begin when login begin cmdchat("blocco_exp "..q.getcurrentquestindex()) if pc.getqf("blocco_exp") == 1 then pc.setqf("exp_pc",pc.get_exp()) chat("[Blocco Esperienza] - Attivato!") elseif pc.getqf("blocco_exp") == 0 then chat("[Blocco Esperienza] - Disattivato!") end end when button or info begin if pc.getqf("blocco_exp") == 0 then pc.setqf("blocco_exp", 1) pc.setqf("exp_pc",pc.get_exp()) chat("[Blocco Esperienza] - Attivato!") elseif pc.getqf("blocco_exp") == 1 then pc.setqf("blocco_exp", 0) chat("[Blocco Esperienza] - Disattivato!") end end when kill with not npc.is_pc() begin if pc.getqf("blocco_exp") == 1 then pc.give_exp2(pc.getqf("exp_pc")-pc.get_exp()) end end end end Could someone tell me why it doesn't work please? Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted February 26, 2018 Premium Share Posted February 26, 2018 Exp function is in INT if you upp your level over 2kkk exp you will get terrible errors. function format_exp() local expp = pc.get_exp() if expp < 1999999999 then --Do it thinking how many exp is required pc.give_exp2(-pc.get_exp()) else pc.give_exp2(-1999999999) pc.give_exp2(-pc.get_exp()) end end quest.format_exp() pc.block_exp() --I hope that you have it If you can't use LUA or PY is better doing a LETTER for this system or item with .use Regards WeedHex 1 Link to comment Share on other sites More sharing options...
speppoz 7 Posted February 26, 2018 Author Share Posted February 26, 2018 8 hours ago, WeedHex said: I cant see this things.... Exp function is in INT if you upp your level over 2kkk exp you will get fucking errors. function format_exp() local expp = pc.get_exp() if expp < 1999999999 then --Do it thinking how many exp is required pc.give_exp2(-pc.get_exp()) else pc.give_exp2(-1999999999) pc.give_exp2(-pc.get_exp()) end end quest.format_exp() pc.block_exp() --I hope that you have it........ Thanks for your reply! I will apply that to the quest but the problem was about the switching of the quest flag between 0 and 1. I don't see nothing in chat when I press the button. 8 hours ago, WeedHex said: If you can't use LUA or PY is better doing a LETTER for this system or item with .use I don't think that this is the best advice. I don't mean me but all. I think everyone has to make his experience and you can learn also by making mistakes. Don't judge people. Help them if you really want to be usefull and you will be respected. Take that like a friend advice P.s.: I have already do that by Letter but I decided to do it by button 1 Link to comment Share on other sites More sharing options...
speppoz 7 Posted February 26, 2018 Author Share Posted February 26, 2018 10 hours ago, WeedHex said: Ok now It works. It was a problem of communication between the client and the server I think because I only added a "chat.AppendChat(chat.CHAT_TYPE_INFO, "Button Clicked")" inside the "def OnClickBlockExp(self):" to see if the button reacted and did a reboot. Thanks all! 1 Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted February 27, 2018 Premium Share Posted February 27, 2018 I was not judging you, i was only telling that if you dont know a thing you cannot invent it but you can find other solutions. I'm happy if you use my function, I assure you it's perfect. 1 Link to comment Share on other sites More sharing options...
Premium tierrilopes 452 Posted February 27, 2018 Premium Share Posted February 27, 2018 Don't do those stuff using -exp. Example why: You need 600exp to level up, you kill a mob that gives 650 exp, you will level up first and then the remove exp will take place. Use those setqf to turn on/off exp blockage and then at the case point_exp of game add a check. If the qf is 1, do a return. That way you will really block exp gain, instead of working around like in those examples. 1 Link to comment Share on other sites More sharing options...
Premium r00t 123 Posted February 28, 2018 Premium Share Posted February 28, 2018 17 hours ago, tierrilopes said: Don't do those stuff using -exp. Example why: You need 600exp to level up, you kill a mob that gives 650 exp, you will level up first and then the remove exp will take place. True story. Make this system in source is very easy if you have unknolegde... or google can help you "metin2 anti exp c++" 1 Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted March 10, 2018 Premium Share Posted March 10, 2018 On 27/2/2018 at 4:23 PM, tierrilopes said: Don't do those stuff using -exp. Example why: You need 600exp to level up, you kill a mob that gives 650 exp, you will level up first and then the remove exp will take place. Use those setqf to turn on/off exp blockage and then at the case point_exp of game add a check. If the qf is 1, do a return. That way you will really block exp gain, instead of working around like in those examples. WTH You're telling?? If you dont know pc.block_exp() shhhush! Link to comment Share on other sites More sharing options...
Premium tierrilopes 452 Posted March 10, 2018 Premium Share Posted March 10, 2018 2 hours ago, WeedHex said: WTH You're telling?? If you dont know pc.block_exp() shhhush! I was adressing to the thread opener and what he showed there. If you can read, your issue. Next time I will explain it better so simple brains like yours can process it. You're no one to tell me to shut up, specially due to your cancerous topics showing nothing but lack of knowledge, so please, crawl back to your cave. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now