citylala Posted November 30, 2012 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 12 Reputation: 0 Joined: 11/30/12 Last Seen: December 12, 2012 Share Posted November 30, 2012 hello, im goign to make an Holiday Event... i wan player to hunt certain monsters.. and who hunt the most .. .. i need a Board NPC that record players killed how many the monster. Top1 ~ top10 ranks Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 30, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share Posted November 30, 2012 (edited) try this.. http://pastebin.com/raw.php?i=gM2yYtva Top1 ~ top10 ranks change LIMIT 127 to LIMIT 10 refer post#4 Edited November 30, 2012 by Emistry Refer Post#4 for updated script contents. Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 30, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 30, 2012 txt style ladder ... been some time I'm able to do this holiday_event_ladder.0.1.txt @emistry query_sql( "INSERT INTO `kill_rank` VALUES ( '"++"','1' ) ON DUPLICATE KEY UPDATE `kill`=`kill`+1" '"++"' is so weird missing strcharinfo(0) inside ? Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 30, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share Posted November 30, 2012 LOL...... haha yaya..missing strcharinfo(0)..... >.< @TS anyway..try this.... http://pastebin.com/raw.php?i=QNnfz9T7 or http://pastebin.com/raw.php?i=NCRNceBw Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 30, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 30, 2012 (edited) your 2nd script .@rank = query_sql( "SELECT `char_id`,`value` FROM `global_reg_value` WHERE `str`='mobkill' ORDER BY `value` DESC LIMIT 10",.@cid,.@kill ); change into .@rank = query_sql( "SELECT `char_id`,`value` FROM `global_reg_value` WHERE `str`='mobkill' ORDER BY CAST( `value` AS SIGNED ) DESC LIMIT 10",.@cid,.@kill ); `value` in `global_reg_value` is a STRING type column, if the value has 1111,2222,12345 will be sort as 2222 12345 1111 because the first string is being sort 1st, as it is a string type ... it should be sort as integers, so do CAST( `value` AS SIGNED ) something wrong with your SQL knowledge .... or perhaps you are sleepy EDIT: another one rid2name( .@cid[.@i] ) I'm quite sure our rid2name script command doesn't support char ID field ..... try refer to this post to how it being made ... Edited November 30, 2012 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 30, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share Posted November 30, 2012 it should be sort as integers, so do CAST( `value` AS SIGNED ) owh...well this is new to be....i mean the "CAST()" haha i didnt know there is something like that.. and..ya i forgot that the string sorting would be different from integer...LOL... >.< thx for remind.... something wrong with your SQL knowledge .... or perhaps you are sleepy another one rid2name( .@cid[.@i] ) I'm quite sure our rid2name script command doesn't support char ID field ..... try refer to this post to how it being made ... aw...O.O.....thx for the information and remind..xD usually i would prefer of using this script.. http://pastebin.com/raw.php?i=QNnfz9T7 because most of the time i can easily find out the data i wan...manipulate it easily in the way i want.. so i less using `global_reg_value` >.< guess i have to study more on SQL stuff later on ~ haha~ Quote Link to comment Share on other sites More sharing options...
GmOcean Posted November 30, 2012 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted November 30, 2012 You could use rid2name in combination with getcharid to retrieve the char I'd, but, I have no idea how the script is written or if this is even remotely close to what's being talked about since I'm on my phone lol. Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 30, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 30, 2012 (edited) 1. rid2name script command requires players to online 2. rid2name only search account_id on players if ((bl = map_id2bl(rid))) { switch (bl->type) { ..... case BL_PC: script_pushstrcopy(st,((TBL_PC *)bl)->status.name); break; the map_id2bl function in source, only store the information that is inside the map_server.exe if players is not online, the data is left inside SQL table ( which is why we can freely edit them once @kick them out ) and the type of information is already predefine in the source //Limits to avoid ID collision with other game objects#define START_ACCOUNT_NUM 2000000 #define END_ACCOUNT_NUM 100000000 #define START_CHAR_NUM 150000 account ID starts with 2000000 and ends at 100000000if you start your test server and use getnpcid(0), it always start with 100000001 because these ranges are already predefined charID is somehow is in other range with other objects *Proof* prontera,153,182,5 script jhfksdjf 100,{ dispbottom " ==== "; dispbottom rid2name( 2000000 ); // Annieruru is online, return "Annieruru" dispbottom rid2name( 2000001 ); // Ennyruru is online, return "Ennyruru" dispbottom rid2name( 2000002 ); // Kinoruru is offline, return "(null)" dispbottom rid2name( getcharid(0) ); // your ownself CharID, which doesn't work, return "(null)" } emistry script on post#4 there which using rid2name sure doesn't work if the user has score a ladder in the board doesn't online will return "(null)" } else { ShowError("buildin_rid2name: invalid RID\n"); script_pushconststr(st,"(null)"); } Edited November 30, 2012 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
GmOcean Posted November 30, 2012 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted November 30, 2012 Ahh i see lol. I made that comment at the time, without having looked at the script so i didn't know in which way it was being used, but after looking at it, yes i see your point lol. I was under the impression that Emistry made a (so unlike him) mistake and used rid2name to obtain the char's id.. only did it wrong lol. But like i said, that's so not like him. But yes, I agree with you on that one Annie. After reviewing the script, that would indeed not work. However his improved script is efficient enough in its task Quote Link to comment Share on other sites More sharing options...
citylala Posted December 1, 2012 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 12 Reputation: 0 Joined: 11/30/12 Last Seen: December 12, 2012 Author Share Posted December 1, 2012 haha! so download the #4 that 1? Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted December 1, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted December 1, 2012 let's see ... my script on post#3 and emistry script on post#6 is stable script my script use txt style ladder, which generate 1 perm player variable + 2 global array emistry script use sql style ladder which require SQL table try use either one of the solution provided Quote Link to comment Share on other sites More sharing options...
citylala Posted December 2, 2012 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 12 Reputation: 0 Joined: 11/30/12 Last Seen: December 12, 2012 Author Share Posted December 2, 2012 let's see ... my script on post#3 and emistry script on post#6 is stable script my script use txt style ladder, which generate 1 perm player variable + 2 global array emistry script use sql style ladder which require SQL table try use either one of the solution provided annie im using ur script, btw how do i set it just kill "Jakk" this monster and record it to the board npc? Quote Link to comment Share on other sites More sharing options...
Emistry Posted December 2, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share Posted December 2, 2012 OnNPCKillEvent: if( killedrid != <MOBID> ) end; Quote Link to comment Share on other sites More sharing options...
donkeyg Posted December 3, 2012 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Share Posted December 3, 2012 OnNPCKillEvent: if( killedrid != <MOBID> ) end; replace to where? OnNPCKillEvent:holiday_event_points++; become OnNPCKillEvent:if( killedrid != <MOBID> ) end; holiday_event_points++; ? Quote Link to comment Share on other sites More sharing options...
GmOcean Posted December 3, 2012 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted December 3, 2012 OnNPCKillEvent:if( killedrid != <MOBID> ) end; holiday_event_points++; ? Yes. Quote Link to comment Share on other sites More sharing options...
donkeyg Posted December 3, 2012 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Share Posted December 3, 2012 OnNPCKillEvent:if( killedrid != <MOBID> ) end; holiday_event_points++; ? Yes. ERROR. i put 3007 into the modid 3007 is my custom monster id i clicke the npc and the npc didnt respond anything Quote Link to comment Share on other sites More sharing options...
GmOcean Posted December 3, 2012 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted December 3, 2012 Umm, it responds to when you kill that monster, not when you talk to the NPC. Quote Link to comment Share on other sites More sharing options...
Euphy Posted December 3, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted December 3, 2012 You should read the documentation. trunk/doc/script_commands.txt OnNPCKillEvent:This special label triggers when a player kills a monster. The variable 'killedrid' is set to the Class of the monster killed. Quote Link to comment Share on other sites More sharing options...
donkeyg Posted December 3, 2012 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Share Posted December 3, 2012 may i know how to reset theranking? xD Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted December 3, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted December 3, 2012 holiday_event_ladder.0.2.txt Quote Link to comment Share on other sites More sharing options...
donkeyg Posted December 8, 2012 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Share Posted December 8, 2012 holiday_event_ladder.0.2.txt can i suggesst to remove players from the list? got 2 player name same at the board there=.= bug? Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted December 8, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted December 8, 2012 wait wait wait.. wait.... wait .......wait .............. I created mine from scratch, and even compare to terces pvp ladder script ... if terces pvp ladder script doesn't have his bug, then mine should be the same ..... questions ... did you ever use reset ladder function once already ? but even so ... I couldn't reproduce this bug, unless someone else can find it for me holiday_event_ladder.0.3.txt Quote Link to comment Share on other sites More sharing options...
Question
citylala
hello, im goign to make an Holiday Event... i wan player to hunt certain monsters.. and who hunt the most .. .. i need a Board NPC that record players killed how many the monster. Top1 ~ top10 ranks
Link to comment
Share on other sites
21 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.