Jump to content

_Okuz_

Members
  • Posts

    92
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by _Okuz_

  1. Hmm... Did you get any output of the map-server console when you tried the donpcevent? I noticed that you left a comma before the first { in your function, please remove it. And you still need a NPC to count the timer, so, you can't just turn that NPC into a function because functions cannot have timers, you need to write some code in order to adjust the things. Change your callfunc to callfunc("F_vip_for_1week"); and replace your current code with the bellow code, I put 2 debugs on it to check if the function is being accessed or not and if the NPC event is being accessed or not, let me know the map-server console outputs. - script vip_for_1week -1,{ OnPCLoginEvent: debugmes "Event found!"; if (getgroupid() != 0) end; // first time logging into this account if (#VIP_expire == 0) { set #VIP_expire, gettimetick(2) + (7*86400); // 7 days dispbottom "Welcome to the server!"; dispbottom "You have been upgraded to a VIP for 1 week."; } if (#VIP_expire > gettimetick(2)) { // they still have time left dispbottom "VIP Rental : expires in " + callfunc("Time2Str",#VIP_expire); atcommand "@adjgroup 1"; deltimer strnpcinfo(3)+"::OnPCLoginEvent"; if ((#VIP_expire - gettimetick(2)) < 2147483) { // prevent overflow error addtimer (#VIP_expire - gettimetick(2)) *1000, strnpcinfo(3)+"::OnPCLoginEvent"; } else { addtimer 2147483000, strnpcinfo(3)+"::OnPCLoginEvent"; } } else if (#VIP_expire > 1) { set #VIP_expire, 1; atcommand "@adjgroup 0"; dispbottom "Your VIP Rental has expired."; } end; } function script F_vip_for_1week { debugmes "Function found!"; doevent "vip_for_1week::OnPCLoginEvent"; } Can you explain what intended to do when a player uses a coin? What they are going to receive? I'm telling you this because maybe there's a better solution for this. C ya!
  2. _Okuz_

    R>Healer

    Hello myieee, how are you? Let me see if I got what you want. Players will be able to heal only by touching the NPC area and not by clicking the NPC. prontera,150,150,5 script Healer 79,5,5,{ end; OnTouch: if (@lastTick < gettimetick(2)) { set @lastTick, (gettimetick(2) + .delay * 60); percentheal 100, 100; } end; OnInit: set .delay, 5; // delay in minutes } The above script is intended to heal 100% of HP/SP once the players touch its area. There's a 5 minutes delay on each touch so you'll be protected from spams, adjust as needed. I hope it works, good luck.
  3. Hello blackbord, how are you? You can use the doevent command on the first {} found in the item script. Something like this: 670,Gold_Coin_Moneybag,Bag of Gold Coins,2,100000,,400,,,,,0xFFFFFFFF,7,2,,,,,,{ doevent "vip_for_1week::OnPCLoginEvent"; },{},{} I also have changed the item type from 0 to 2 (Healing -> Usable). Another solution is to change this script to be a function, so you'll be able to use whenever you needed it. I hope it works, good luck.
  4. Hello AngelaKiss how are you? =] I rewrote this whole script with a new logic and I tested it on haru.ws/scriptchecker/ to check for sintax errors and nothing was found, please tell me if it fits your needs. - script AFK_Vaporizer -1,{ OnPCLoginEvent: initnpctimer getcharid(3); end; OnTimer60000: if (gethominfo(2) != "null" && (checkidle() / 60 >= .vaporize)) { atcommand "@useskill 244 1 "+strcharinfo(0); dispbottom "You are not allowed to farm with Homun while AFK."; } initnpctimer getcharid(3); end; OnInit: set .vaporize, 2; // How many minutes to use vaporize. } I hope it works, good luck.
  5. Ok, there is a way to debug this sh** to see if the error is on the server side or on the cora cp side. I'm going to merge the solution proposed by Sir Emistry so you can have a better script. Here is the merged solution: - script user_counter -1,{ OnPCLoginEvent: query_sql("SELECT COUNT(`char_id`) FROM `char` WHERE `online` = 1",.@userOnline); set $userOnline, .@userOnline; if(.@userOnline > $userPeak) { set $userPeak, .@userOnline; } set .@peak, $userPeak; debugmes "Online on Login: " + $userOnline; debugmes "Peak: " + $userPeak; end; OnPCLogoutEvent: query_sql("SELECT COUNT(`char_id`) FROM `char` WHERE `online` = 1",.@userOnline); set $userOnline, .@userOnline; debugmes "Online on Logout: " + $userOnline; } Now you are able to see on Login and Logouts what's the number of players online and the peak of users online till that moment in the map-server console. I have tested it on (http://haru.ws/scriptchecker) and have found "No errors found!" output, but I don't know if it'll work as we expect, I need you to test it. If you the results on the above script are not what you expect, try this script that is the same as you posted with a few edits to insert two debugs that will try to output the number of users online and user peak on each login and logout in the map-server console just like we did before. - script user_counter -1,{ OnPCLoginEvent: query_sql("SELECT value FROM mapreg WHERE varname='userOnline'",.@lastOnline); if(getarraysize(.@lastOnline) == 0) { query_sql("INSERT INTO mapreg(varname,value) VALUE('userOnline',1)"); set .@userOnline,1; } else { query_sql("UPDATE mapreg SET value=value+1 WHERE varname='userOnline'"); set .@userOnline,.@lastOnline[0]+1; } query_sql("SELECT value FROM mapreg WHERE varname='userPeak'",.@userPeak); if((.@userOnline > .@userPeak[0]) || (getarraysize(.@userPeak) == 0)) { if(getarraysize(.@userPeak) == 0) .@newPeak$ = "INSERT INTO mapreg(varname,value) VALUE('userPeak',"+.@userOnline+")"; else .@newPeak$ = "UPDATE mapreg SET value="+.@userOnline+" WHERE varname='userPeak'"; query_sql(.@newPeak$); .@peak = .@userOnline; } else { .@peak = .@userPeak[0]; } debugmes "Online on Login: " + .@userOnline; debugmes "Peak: " + .@userPeak; end; OnPCLogoutEvent: query_sql("SELECT value FROM mapreg WHERE varname='userOnline'",.@lastOnlineB); if(.@lastOnlineB[0] > 1) query_sql("UPDATE mapreg SET value=value-1 WHERE varname='userOnline'"); else query_sql("DELETE FROM mapreg WHERE varname='userOnline'"); debugmes "Online on Logout: " + .@lastOnlineB; end; } I hope it works, good luck!
  6. Hello Elithe, I don't understand exactly what is your problem. The main goal of this script is to set up some variables to be read by the Cora CP, I mean this is what I understood from the context until now. If so, I think we can drop all the query_sqls and set all the variables in the "conventional way". Besides that, I need more details because honestly I don't see anything wrong with this script. Where you want to display the count? Where did you got this script? Do you have any link or something else to help us finding the best solution?
  7. Thank you very much! This file really helped me
  8. It works! Now I know the structure of WDGTranslateClient.txt. Very clever by Ai4rei I must say. Thanks.
  9. I have tested your WDGTranslateClient.dll and I got an error msg in the plugins\WeeDiffGen\WeeDiffGen.txt. Here is the msg: "Mon, 29 Oct 2012 21:06:59 GMT :: 20120618 :: WDGTranslateClient\WDGTranslateClient.cpp :: Part 0 :: CXLateBE::CXLateBE: File not found.". Thanks!
  10. I'll try to update my WeeDiffGen .dll's and nanakiwurtz, can you tell me where did you download your Lua Files? I'm trying to find using Search Tool but I didn't find anything related to this Client and Lua Files. Thank you!
  11. Ai4rei, I have a question regarding ur releases. Should I put ur .dll over the Shin's .dll's or I can just ignore Shin's .dll's and use just yours? Sorry about english :S
  12. Ai4rei, always doing an excellent job around the Ragnarok Community x).
  13. Ok here is what's happening: I'm trying to use this post to make a new patch, but I don't know why some things are still in Korean even if I use this topic attachments. Here is what I did in the following order: 1) Applied (http://svn6.assembla...18aRagexeRE.txt) in packet_db.txt 2) Diffed 2012-06-18a.exe client with Client Obfuscation plus Read lua before lub and Read Data folder first. 3) Downloaded all things in this SVN: http://svn6.assembla...svn/ClientSide/ 4) Created a data/ folder with (http://svn6.assembla...ject/lua files/) and (http://svn6.assembla...n_Project/data/) folders. 5) Created a GRF based on data/ folder. 6) Moved GRF file to patch/ folder, which contains the patch structure. 7) Copied (http://svn6.assembla...t/Patch Client/) and (http://svn6.assembla...Project/System/) folders to patch/ folder. 8) Moved all files to my RO installation folder to perform the tests. The result is: All skill descriptions and other stuffs are still in korean. Can anyone help, please? It isn't related to my msgringtable.txt, I just think that my lua files are incorrect or something..
×
×
  • Create New...